airport-qingdao-vue3/airport/assets/index.93ce84d4.js
2026-06-29 17:00:06 +08:00

1111 lines
5.3 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{a as tB,c as FZ,m as xPe,w as Ctt,g as nv,i as O8,T as DA,s as SPe,D as wPe,l as Ks,O as BR,b as Att,C as QN,R as Mtt,u as Pf,d as GO,r as Itt,B as sz,e as Tp,f as Jg,h as hc,j as Rx,k as bPe,E as zo,n as _1,o as zO,p as Ltt,P as EPe,q as Ptt,V as one,t as TPe,v as bv,x as sne,y as hM,z as Ott,A as lne,F as Bg,G as sA,H as UO,I as pp,J as une,K as Rtt,L as BZ,M as Dtt,N as GZ,Q as CPe,S as zZ,U as UZ,W as VZ,X as lz,Y as Ntt,Z as ktt,_ as Ftt,$ as Btt,a0 as APe,a1 as Tde,a2 as R8,a3 as d1,a4 as $Z,a5 as Cde,a6 as D8,a7 as Gtt,a8 as ztt,a9 as hne,aa as uz,ab as N8,ac as Utt,ad as Vtt,ae as k8,af as LF,ag as $tt,ah as e3,ai as MPe,aj as Wtt,ak as Htt,al as jtt,am as Xtt,an as Ytt,ao as t3,ap as qtt,aq as cne,ar as Ztt,as as WZ,at as fne,au as IPe,av as Ktt,aw as Jtt,ax as Qtt,ay as ert,az as trt,aA as rrt,aB as sp,aC as Hx,aD as E1,aE as Qb,aF as rB,aG as Ade,aH as nrt,aI as irt,aJ as art,aK as ort,aL as srt,aM as HZ,aN as lrt,aO as urt,aP as hrt,aQ as crt,aR as jZ,aS as Mde,aT as RW,aU as dne,aV as frt,aW as drt,aX as lA,aY as Ide,aZ as LPe,a_ as vrt,a$ as NC,b0 as Lde,b1 as prt,b2 as grt,b3 as yrt,b4 as mrt,b5 as _rt,b6 as PF,b7 as OF,b8 as PPe,b9 as xrt,ba as Srt,bb as wrt,bc as $b,bd as T1,be as jx,bf as C1,bg as OPe,bh as hz,bi as brt,bj as DW,bk as RF,bl as Pde,bm as Ode,bn as Ert,bo as Trt,bp as Rde,bq as Crt,br as Art}from"./VehicleMovementControlRefactored.a43df089.js";import{z as at,A as Nd,B as Mrt,_ as rf,r as un,v as ul,C as P0,D as Af,F as i_,o as qr,c as hn,l as fe,G as cl,f as Xo,H as Dp,I as Np,J as lu,K as kC,x as mn,j as Bs,p as kd,q as Fd,L as PS,M as qg,i as RPe,N as Dde,n as NA,y as vne,O as Sp,m as a_,P as Irt,Q as Nde,d as nB,e as Mf,R as Lrt,S as XZ,k as uA,T as Prt,w as kde,U as Ort,V as DPe,W as Rrt,X as Drt}from"./index.bba5ce79.js";import{l as Nrt}from"./vehicle_type.9e72c0f2.js";import{g as krt,a as Frt}from"./manager.386efea2.js";import{l as Brt}from"./intersection.ab3021ee.js";function Grt(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(n,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const pne=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return F0},get Circle(){return JHt},get Ellipse(){return ejt},get Image(){return rjt},get Line(){return ijt},get Marker(){return sjt},get Path(){return Ise},get Polygon(){return gjt},get Polyline(){return mjt},get Rect(){return wjt},get Text(){return Ejt}},Symbol.toStringTag,{value:"Module"})),gne=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return lg},get Circle(){return Ljt},get Dom(){return Ojt},get Ellipse(){return Djt},get Image(){return kjt},get Line(){return Bjt},get Marker(){return zjt},get Path(){return Vjt},get Polygon(){return Wjt},get Polyline(){return jjt},get Rect(){return qjt},get Text(){return eXt}},Symbol.toStringTag,{value:"Module"})),zrt="/airport/assets/light.32436962.svg",Urt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA3qSURBVHgBzVl7jF1FGZ+Zc9+v3W63u2wftqXFPkKhsdgC4VFQNETFfywkEokSIMESY2KoGv7AYvGdAAkIIaK89A9qU/1DUKi2JVoeTQEtu33T1z7a7d3u69573jP+vjnn3Hu2++hWGuK0s+fMOXNmft/3/eb7vpnL2UUoZ5QqVivsFq7YEm6w1VKyJqbYHMbxVzHOOevBtYcJ1oXuu4Vg++bleA/7mIWzj1FODqs10mDrlWRrJumiYnPU7+nG4Gyb8r2t85uT29j/WC4IvFJK9z804K5Op5LrJWOrwzH0C3XOgLo/hz2ia2xS1bjvTTL27TklfiD2+OKDf3tgoDTLaF6vOP/GuJeQhIk4rKmmVOOeKV++5M8QTy7lfJRNs0wXPP93d21OOpd6DhSeTSSGNvXXSkk0haIrdfR9yZTn8Jaddy6eYZ9KQeWsL3epaX/uxY981+eJZFLWv2MiHCWQHgbqdZTzrZWtuWmth2mB/+BkbY6RNZ5jSnQ0yBFeuf6nmMR/qbgQXF1+8NYrhvdXWUJI/b2nuCpeNkN1Lvlzp/7ACCmkrRWbCG3JZZ9pVe65eu7MHnYeM04KnvhKGt5+aGBOqZB/lgveMearCYb1PJcX33pwwZzKeyURro96MYTqLN7Wz1d/55QB7XP9nk+IhtaBaY/ed+281l42hQBishcArl5540gpm8s+4zHV5krpU3XAC9cP7uvPUGu2I0eGBvnSYmfTOOCEwFd8den1dsd1JapypfJdxRrj4N7xlB7b8WV7Ill45tW3DxXZFAqeFDxpvmNJ+z2+Ym2er2RQpfQk88O2vrr1575ceOjBRSM99sTKgAJHT1iquPuHCyzbI5DSw4eeghA0Bt1DiGhsx5Ptxdkd97LIvSo1bfBi64fHl3qcf83B4KjSgTtwtKboqoKKexfvK6alyse7UvN4d97gk9NUgNEril0zqsMD3HY9qccGUi+Yw3fDK+ZSdA+Lr3vtw75VIU4+JfjQj1MVhULLJq2JyKw+aYjAMg9Xeia1qfHMhyBrK48urQ247HxltNdSVx7dsMz2QB9om+jj0Fg+VWpr63r6irlELvfNEJM6V/tjwBPP161bJ7Z82Hc96DLLIVp4UgXASQhNGUX3RBXH86Rtu7K6f0cxVxlMJeJaR54gR04yOdqt76OCyMovMU7nhnsOp0zbUo6mDIBLX4/vh3T0gzkRvPmK3+/+aBX5Y3aO9kVM67q9efNmLpLpWzQn/YCTuMVYTAMmrUMjxHVy6b7lOmpd7tfLvZoXVwNTtX5WuP8QK9zbxVT11Jh5q2WX3Wr+6ApaPzQ2zeH5TM+nLYrq6Lm01WW+qelOwqbjyySa15T52StvzJaCryFTOpI8gB6ItI82tAFlOKQVvK9Ztsrs39xmnqqNNaF0WfqaHzCeyDKeLrH0jZvwrLGQE0KxzMhI0jy4s1Stmiy0rF78BNom7dfnIvrwFet/8mTTww8/zOPUEQ3GaKlEU3vHYlBF0sdeXSuBBvxAI9C9L224POLoV1q3LsHL8a7Rq2JUQSPjfrwHsqseu6P47Aqfc88OLawr5vXrFkCs9oN1d+XaL1yzc+dOwWPqT0SUIU4tXrxYJLL5y2kwLRXCfoAkAKeorXTUFK5ts0X7H19cdWsTRhvlVBpNdzQQJFbAfeb2jYpU38uzK8vu6EmkM5iT+kg9D0bgwA9cCNOEIpVYuGPHDt0hxKtEqHY94OHDhw0lkvOJy05gQqW5J1m4WEn7Slm2TVqRN3a8P59NEJA0ULuRXym3xiaKNRiE3z7n1WWkXduhwBU4BbIoPJFeU9rqmJeJzHJS9tq1a0n7wQKNOLR8+XJyCQbM2BK6LJgLi5MGCtylJLdo00Tg1VUHH1o5eqw6qVNXzkhM8wR+fEghcSrHTbWw67ElAC+D6B24T0/zXeNQnnafMkuDjI6ORu48oA01urq6uAbP2Ezink7AQ8l4bJF4tiPs0UGxauaJtmofm7gQz63hhiBulU1aQMkvzv/Pgr221YU8U1Hew8L59CV0v5wbLYTPNE0e0qYeuXRgouox7pHUbiNUay8QVFgBOvnS8KY1w702m6ooO655c9J+NPHI8Zq6/sQjn4FFldZ8OB+5Z1BHRngIPJRcX7R1/tA4hULBcHTw0b4W4TqqiIIAXa1Uea17f+7Tqf7mBJ960yErvY376mltjcmKgcX52bbuS6zRsrAsR0U+3obmnHripgi8mDt3rlY2aT+ueV6pVLhlWgO6M0VWLxQkSsi48O9OPXWtOeCef7vmO8z6xwZm/3MTk+XO83av9Fjqrsqj15H2vXqagLk9X2MwTatMGLu7u7UWeBhyY9tJxk3PqXlBkuSRtGHE803LYuzoruY2NZxD8nX+TQw0Q1GW2YMsdK9TFkob5qTONnnlIxnTtnViRhgcneMoHx5uIJ/Pa2XD4+hcR7sANPQAeMmGz5w+QhyLKvHOBQFp5W+45KUbnBFvWptko+1ylv3y8yx9869Ycunt0xIAiZ36bu7xm/UeQafIlOMw7XlGBsu91ape+Bz+XvfX4KMGvSz3dPcBKGWLfrBwiDquzB7b3sqGaoaY1tYR8olEo5kusukcDJBFi7VKmh1/d4aLDYvO62m9YRWf3N95rDE4a4APH+j61gtPHKAV7upKaYAjTdtR9xmbr/FMf5obds78U+8z66/3M2v795n7wW/GZJZTFbvis687L6+x4fMsEBebK8rr1dF3t1N2N8Z8ichnhuBl/4G95vBA+USuuWUuxWgk74ZnmapZ1HLqAk5VeKoAAfboUXm2ZdrfYf/OL81WSlathrwu7yewea+UTx3Y+5fNgxFGFqQIXMSAq2KxSLtuv3Pbll2aNpDeReSzbZO7LOFdCPhQhCld5ETFhxfsttJVLFCkIY6ywfyP3n2zU78KgAeBk3Kb6BRswYIFyjAoO+D+nt89cWJkoL/HgdsCbRTclPpp3w27ks1JFT/5utgFaZjKt6f5z4due9OGd3Np7mp1eNdTjxwKwdcF0H4+DFLq2LFj/tDQkI/w6zmO4x1+fetu2nRQ6os2e8+/9PTGzqt2VY20HQhwkSv4YibSzv3vXL+tx2+C5i0drN559pevEx5g9GbNmuXHND/Gc9CKSqPmUQuoxc8/+sKNTfMXrrAGy6naQH/WHipnHLNmIAU04H1FeGoUnD7JRtYbeEV6QOeUYRKiH+EZjojrR1awOl5Tby6MhDRSaT9VKLmZ5plWtqXNqp06sXf7jx/YkclkBi3LojSVfKUTaT/uAuI5Dvm5xOChrpGOa25ahACXcmqWgBnh9D2hZIBO5/eUvxEAgfQbV1hT4oAJbV1Jo5SUU19fCd2fDtZ0f7RxS/gFnQP6IpWSIpV2jGzexehDe55+ZIe0zREhRBXrEfgtN6SOirTNJhEgaY0M8PLBff1tK6+eiy9SBJpO5OgMQ0FTQhi4T3o8mdST60r3gu4TkhsJn6owUqhGvc0FniUSPkvgW3zDkikCjppzjFyB2DLS+eJjb4x2Hz0L4BWANgHeqdX0RlnGwdYL9ohi48aNqebm5gz4n0+lUiXwrdS8eHn7irs33ISA1aRsy/Ac04AT4DpnjTYjgoe7LBFRhhNNMHm49Yk4FZ9Vb8IQ5g29sTUyGXBRjex7/ok3q71HTnmeN4ROw01NTRXwvYbNkquCc0g1DjwL8gZj3759aUiZRZQrQGoKj8XmRctnLbv3oeu4kcz7rk0kEYjisLgRbQ21SjQLfK5TvvC8U42xq6oLh9MebPVJaOoMKyrXqXX99hf/snoOlwF8OJ1Oj9q2zq011xXtM84555+INjjvZynkOnkMUqDTBwiSz7d1FBfe/sDS0pKVC7WvIqDhDwdR6hI5ASSwihuKpJATbhVZtMAFHTGzoa73j53449P7q2f6qslksor5RjD9aDabrZXLZdo8eKyRCYwHH50Ms2At0KLNoOaggTwEyOE+iz7pmavWNi+863srRTqTJQQ416bdsnYbgRXCA/w4VbRY4eEQa5xum2d6hk5ve+VQ97Y/nUHTBXATVKvRIoXbJo0T8LqHOVfT40ooBIFPgm9p8D6HgbJYAwSeagIWMeZ99Z7ZM9bc1J6dd1kr930OEjR2qlIFv5Ro18LqoOkZeSnv9Mnh3tf+cKTv71sGEli8GM/F+DbmrSFYVkFb5ODMAo1dJI4+myCzmyp2i9ACRCHy/xlYQIOHMGloKAXT0ntRWnJlrrRsVSGzaMWM9CWfKhj5QjaRLaXryrAqFmK9V+s9MlTpOVLp/9uWfm+gxwVoHPV5RAcNHOOauVwOaU2N9o32qlWr3D179nhskpR0qh8XopMobYGwZiNBwmsqFFALERsPnjLBAlxjfg2MKlGAtOkBtItpbCrgOLKBKmnchcadyTQ+HfCRp9AeCAMlWlpaUmfPnk1hEaVBowh8ClZIRFZgjTgRja8giIIgGjj6SvQlUKRtF9qmwEOA7bBS2wuFi4S+MPAxISILxGmkvVGsJsKqBQBARGM3Pna02OoaD0G62PQ72Ds7URun1D4Oe6Pka6yrvVDw5xTBGumDFgSTJzH5GPBYGwIsGLfRIeCwGiV/bkwArWVY14N1JTvHHV6Uosb66kgAog65UApkzaVSiXYdrahtqO1UwWO6tiG803N639za2lrEEUa0fpLQtqGUulBFfiwh6kkctKYFIUAhqDxrZKdU8x0dHTnsGTJxwJSOsEZg/ORK7JxcTx4CEQSKKmusg0i4+IL+ZMH+P5b/AnzHa8MtdL8IAAAAAElFTkSuQmCC",Vrt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA5kSURBVHgBzVl7jF3FeZ+Z87rnvvbuy/au19gGmxQHG5p1gLqN5TRN1aZS06ZCaUKqUqnqH7WqVDVR/iARcksjpCZCVO4/FbQlFZFih9KWBkhNwE54BMgSCGDs2F4be71r73v3Ps9jZvL75p6ze3fx7l4SlGTs2fOcM7/v+37fY+Zy9j60Ca0L1Qr7ONfsA9xityjFOphmGxnHX8045+wSjpeYYCfw+itCsLc3Zfkl9nM2zn6OdnFO36ostl8rdusKr+iWORbO6cTi7Gkt48c2l5yn2c/Y3hN4rbV5//RUdIvnOvsVY7ck3zAP9LIPmvc57JEeWybVi+ejDmN/vbHIT7Xcfv/B/2BqqthrlfZrzv/sXQ8hCROtsFabUr/rnpbqP2WnOPRrnJdZm61d8Pz1kdpGL+s+BAr3E4mhTTNaa4VLoenY/CDOmeKLE7ReCzNkYZx5lmJQZKDRUId/cXNPti1/aAv8axdrGy3feohp0bdIjuTIzT/gW0YawZrWaHmfyGMmTSmkkvfShmvF1Vi9UfnL2wa6L7E1zLgieOIrafjZ01Mbi/ncv3LB+5aMSj4bS8mFJbQMAz52/OlC/9EnezaMvON31GuWjiMhMr6cQD+3dXsl+uTtk+sHb61hqFZaC6vFD1rRkB/Ug/Jf7dnUM8pWEWBVzR8+erbjmh19jwD4hmVCaaW0YQCBzh/8wrU3vTPc0Wg0WEMqY4h3z8RZxraZ5zjs1cE9E/FdX74gleSWsJovc0ES0ad183U+Nnn+4h2fuG17eSUBVtX8cxerfyeE+HTLXUPYWMXcsR0V/+/h3r2HH946W60243kbwYLG24LrfDbLn7jr4InCzl+v0kgrEZmn0+MUGvrmR67J349rGKqZMNoBL/7rjfMf6Cz1/tvie4agWhEVbEv33fflbVtee6W7FsdNt3uPTULFnb7PX/6Tz51r/PFnrmjJWvhPDi6gEMUb85W/+f0b+4Z00+RLJhJLtNKM49RFPt91b6yUpB5Rl6B1bAwdbfjHL1038OpLXfUoujpwpFA1NcXU8DDT1aqhzPJmYa7Zep0NHvn61vh/vtkdyFhHUqpIKhUrFmNOFWsWi2z2zgQT4WcrgifJbr/9dvHom2MfkZr1hlKrKFaagJMAIS7UE4/2bHlzqAcT8ZXMpkZHWf7QIdY5Ps68O+9ken7+qu+R4PNBwD525OvbK+eG7XojQLhH3sW8kubEBTxo5yOvDA9SPGbLmMJbtM6SF8Rjp6b/3hJiT1qY0OMoioygn9r/6b3T0Ka1ClV4sciKR49CCmWsMLN1KxPr1q34fgyl5Ysd6olD33heoDhCgNBN92nOD729/kfXdx/ADclanFcsE4Tfd/hovxL81hBmCxWCCZTdIO0jq1z7Dwc+SM65GnDjaiL5bHpcwydsUEhVK1bj0UfWNcJIweKgK1lb45zow3fu/8qhjnvuuYe3UicFzxMNi471fduIHTRYEec1cT1SjUaobh690M2T+mbFRpqamFiUBX7BwpCt1RpSsk8+83/baC7DfUVdxwBv/O6mfb/7G8ePHxe8JeTYTcU0KbNt2zZh+7kbAww2UiHtQwAuQZnqC892NsDPtho5aQoeY7SUaw4h/mei0C5fuWxl1/dJ206gcaEMUVx767Fjx0zeTvDqJsZEmDNnzlhaOJsl0QVOE8NzSAv1MNRbjz+5MVCKtdUIfPouzrkQbQ2rQ1D57JO9AbiK+WEDJinAUQRiIrMDr9j79u0TacgUKYd27Nhh4WAhhnQRYDIVWaARhQoaV9dNXC6yNuM5adrQhVoZCdKy2hpHGPvP/aSjHgYanYWGPuAOhU2lfMJbLpfTcL7I+RMnTnADnrHuEDyPUGoZvkPser2u++LIYe020jpiuDmdnmbc89oaRqoZmJ/JBkGgF/ILhWh0xa0uwgcsC05rJ1KYxEQ9ZjzWSd2iYsnDMBAhaKOj0Gq7+IemKTnxUokpxHrmuu2OZH4cWY2goZntaicjlGXZpihJrG5ByanTatGScnk+n7coNFF4NBKDdUEY6RoKLuV4cdsIUHxRhqWmrlyBiuy2hhGiccsOAZ4FkYk6GlGnaQHdLCAGBgaMskn7adYyvVKp8Ea9MWVeNplVqQAeE0aRHnG9Omu3ATyDwNQou/I2wZMWx4pdFVJYFEealJj2er0xSRhHRkbSNYHJqC3LScbrcVgjrhPnKMYis2qywIud6yeXF0YrNdHdzWp3383UyAgLHnyQsTY574JuJzZtu4IyhBRnNG6cFXgQNKZyuZxRNiJOkzY0CBdmMB6yuYkrZ2PKbMpQxwykL/zoxg9fyDpOe7SnRAVHnbnuOsYLBdZulPLhG5f6N88iylARqOM4BnUYZVs1PzM5Wm3mD45431QS/Ukv6OHkpZExM7iZ2ZBmmaLSYK7QVeWOQ4XSmiCIKs7evazjpZeY6O1FDFw7SeENfdp2q4EWKCY55kSuYVyG0B0inrx48q3z6efTMaLlhukvPvzAKQJsqGM+APycxwFc5l96rznpiLWpIzo7We7++5m9axcrPP44U2Njaw1hOdfl/3zTbw0hQ1AtE9OcslkWyximO/fys5dZsipemKel0KETNX7qjfrc1OQFKMvUFpIJ+LzAwZbfuWH3sJfL6QiaWRXJ8qS0RoZFGNPDfmHuTK5UwViyE6zOQV0oEJyZvTJ26o1vH5lJMbJmicBFWvJSLxQKtFqRbz396AtEHSoTFJkRH8RyOaao86c79z7Tk/WFXGVhTLG9fu+9TL3zDit/9rNM9PSsApyr7nyef37w48/BV1BU2ZGGoiQH2ShZci2HX/7eW6xZDqsEa7O2SXfBtmzZAoxUHXA59O8PXICDjEQ4lwIC2G6k0bnjRZOWG9y9eecPSljCSXZ1ClFyCr/1LTYH3qvTp1dMUqjjVXcuKz51828/hazKuJsNhZuJlWVHSggESy5r5ercsfu/dDoBvyCAifNJ+NPnz5+Xs7OzEuk3RkaNf/Kdx15RpkSA5oUTM9eLhOeTVuLv5krTX9yy6/murM+jZTw0jaiI8Cj6+69KGd1EAeA58Ye7PvrkGGon4fshxkRQVCgtJw5RzMLZ5AsPfvUpYyD03t5e2aJ51krOtESgjGKPvvZisGH33ozXua6X9jlQXWBhGXKQEPaU/Cxy2De6+s/eUZ26xpHSjpsmXDMUgQq6AKuN+fm537v+tmfKoKKVLYROrhDa+Y7QyuZjy/Njbtlq4vTrJ14+dPBtDKME2ajVakEiSLNWWAZ+iQDTJ9+cHdj7B1uZY9vwHUrVGi4MASJGwtSigP9H16azJ11/ak9U7+6xLUdRRcm50YxOPkbnHpw47/ts0s1UP7Pxhuce6h44R7a3crnAzhUiJ9fRgACx5WdD1DUyatTLL3zl88dkvVKFsuqdnZ3YFmpErGUpyJeBJ9BE0Cw6sgvLr9+1p2fwrvt+B5ooqFrVDirzdjg75QWVWVfWKm4cNCwVh4IWLRnkgZ1z06UPzU/19jXmi9sdxzohdXjZ88vPldaPny92zQVhaAkscmwvI62MH9l+PvKKpdApdkReoSu0Mhmk17j6wwe+ePTy0PNUIFXQy6BMfWJiYonml5gZa0Rx8OBBt1QqZcD/nOd5eThSrnvn7q7dB762D/m4IGs1OyzPOkF51o2q866s1xwVBhAgFuicNlVRz2ILEGEERjBHlIXYvIKHCbiMI4Xtos7zY+HnYqdQDN08wGcLsQ3KIL6Uh7524Pj8ydenUZpQSq0AT7Wnp6eOxVLUun+zJCBjjWhKhZmZGY5sC4+Rpkyuj4/KmZNvjPd8+GMbGNWpAv9pUwhLNM0pjArkFAvZl44o+HANpMgNOLcAVliKwQkFKlOKJpaXDa1cR0A8F/lSYOXyEYcwWLGWX/2nL3x/+q0fzsGShufEd+LL9PR0rJtb0kv2+dlVeE8LDxe1Thb1RY60j2s/P7Alu+1zB3YUt994bVSvW6pRs2W97EQ4YoVuySiwGOp+ZHRkNmAX6VaxjYBlYT3hStvzQZcsuO3HTh4cz+RiLFbk7Ns/Hh5++KtvVy6fryUOWsX8Vd/3a5OTk610uTr4dGc4sQjxP5PwP+u6bhbPM+he9+6Pdm6+428/BD/IaVBGhqGQAQQIIUAQYNUeWQgrzQkETQY72RDA9aTwPADPwwoZhagiw5nL0+PP/PfJi/9/mLYcokTbtaQTbYLkvmLLEuNVQ1siBIF3Ojo6vLm5OT8RwncchwRwYBFn0yf+vL80+Jt9bt+WdQoaB3iBUhB7fRH4Lhd+UKCfdCzHJepoC1rmcFY1OTo78tThMxPff3wC2o2RX8IEaAqchGiAxhEKR8muktFXi8sisQBRiAryDBzYB3AfSczD1gTdsyCE1Xn9zTn/+g8WMptu6PR6NhQRRbI8W/SQgM1vUbpSwf5HHDbGLs5UR8/NTz//7StyetyEPSiJjkjmHIEorGezWYrnRJtgcHAwGhoaitnPsMWd7kTZiQDU/VSQ5OjCEjaFawgBZtjpysykVdzDCtA2CweqzXFOxzTF0zEGHQ1wauB4HYGCNB5B4+FKGm8HPE88m1YuFj5kd3V1ufB6F2b2YGYDPhUAYc3C0cKRkxAJ8FQAAm2cDe/Q6oxARQQc2k55HrBFfseJcAbKewbfIkRqgVYamWjU0u2k03MBgIKEaPlM6mwLGk9ARlj0h1g7h+k1dqnlkSNH0uKLr7b0fE8/ZSYCiBagDiZ3MPkS8PANARa8a6FDwGE1Kv6iFgGMlmHdGNZVbFk4fF+aXrrBmgpA1ElLiVKxWKSNISreaT97PXXwmI7rsFag+/S8hGxZwBZG6j8OtG3ptTZw32chFoo4aM0IQoASULmk55Oe6+vry2LNkGkFTOUIW0yMv7jWsnw0kydABIGizhb9IBXOUOqXAvZXsf0UJdYANhEG1sEAAAAASUVORK5CYII=",$rt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAYAAABzJ5OsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA8ZSURBVHgBzVkJjF1XeT7n3HvfPmtmbM94TWzHjpckJjSJmzoxiFCBCpXVRoiklQC1tE2kCkFVqTQiRqURlYJQWtRC2qiiNAnFTYCACeBEHlvEhJhxQryQ8TJxPJvtWd+85b67nHP6/efe++bOeGycpVWPdXzfvWf7/v98/3LOcPYulHGtW2pVdjfXbAO32K1KsTam2XLG8b9mnHM2gucIE+wEuh8Wgv16ZYGPsHdYOHsHZaisb1MWe0ArdttluujUGs3f9MPi7Hktw++ubneeZ2+zvCXwWmvT/9RkcGs24zygGLs1nsM06AUTmv4c+5E8U4vqud+jDmP3L2/lA6nP7z74lyYnW7ut9gc05398SSMkYSIN60pL6ku+aam+JTvE1zZyXmFXWa4WPP/VcH15tpB5HBTuJRJDm2a01gqvQtMzmhC/meJzC6TfhRnSHGfaEgyKNmjU1/4nb+4qXJU9XBX4V4fqy6289TjTomeOHPGTm3/At4A0gkW7kepP5DGLJhRScb+k4F1xNeY2qn9y+4prRthv2MbLgie+kob3n5pc3loqPsYF75k3Sl9hRs0uIXa8TdHcAM9j+7lkbPQYdb3Kp397ZdfoFVa6sua/s+9M26pNPU8A+DJ6z1ePF3pO/u1aKxjPsHe5yEy3P7b+78+4pc11A4zzsYmzQ/d9+Pb1ZAP6LYEnzf9sqPZZIcTHdPx+/Wu7bnSCiYzVdj3jdovpp9xRpupj5rco9DCR723OcaW2cLI/AuC0mDZZPskCp8s/ddP3fgVlwSSwOUr9145Vpa/SVFjfBIx0sdniRXz32JsbOtq7/xCopQxDoVSoCbjddQtrueOxSFtYcPalz4Q0T37jn7Hchk/PaRJtlRej93SbDiqsfuwRxiZJoF4zF4Gf7fs4Y+WTGTfwlbAEHJcFC9D3PHds7OCHtvT0x9rXlwWf8JzAl0qdXwqVkgoaAHjme415YvvnfgAQX2EsqFwCPGkjoAuBk0AkGO0eASfNmx2Id7Jed1k2l5PCigxbFAqfwOcji2k/beum8z333COePja2Q2rW7UutvDDQrheoWt1tSt048ySrvbLbgClu++I84JdrU/XRJvDMqo/MA24ECyP3XndruuH72gtDFYQKwZtvfeLw4C3kj9kCmouU1s37nj17uHCydwfQeSil8vGj4XnKdeumQzjRz1xolRZu3fkUgPxeczL39W8s2rYQeHHb7nnAaRy1UalW66zeaDBaP8DOo6piW9t9hO1KnKcW/uXv7OtVgt+GsYpcdxhK5gWeqLnunMQprialfvQR5g0+dUlbApwMdyG9EuCNgcfmdq7R0E6+JLkTKscW4Inxu1sfePhrbV3e+PTu3bt1IkSi+SbX25b2rMN2KeyYJM5T9aAG3w/UYsCJHrVXHloUeGK0vwk47UKyEx4W90JfByHWxNq+jDDctPOD2w8cOCB4Sv0iTZl169YJO1/c4oEuAVUon560C34YRp3I5aWAEzj/3A+NAbbufPJtAY/4XzLffUCFrrCq1rQ+VpW+YpJl7Gv7+voM75ME0Y7VbgaePn3a0sJZLdE5pA7IPwIaLDUnTbBUaErTgXhc2PK5pvbS3qaw9a9Y9rqPXxE4CZ6UAE6CFOZB27aUGrmeMvmPyG0ivDt37qRkKjTgE/ezadMm68SJE5bkvFOT3NGOcHCeh/ggmbYWA55de68BnhQCTt6GCoFS/qwBe2EmUpByR9BnL6mMOb23sJlf9+F3H3MqVVbACjFdza4j1wHQKEHC7udp4yuVirFN+pYYLAdw+mBJxq6B1qVJwFECrYUfQghMGgEfQ0C59xIfntZoUog6VL/xU8H2vpYPrFwuiFo64x5HTaWFG7P1wpfv40wuxUIUWgx4JVnMCs4tGmS5rssThduxFFSJTyJkULTSJnNlYAq2kKKDhB1ZidapLKTDQuC0I1ZrRIfvP/x37P2fefBn3eu3lCMkscZAX9IrJWm//PbXN75w9LmNwRIpfVBUSKxuKWXhXElnyTipI3YkRqttPnfC4aVSyfIppgI8QgLyC1AmhAAhuE+aiAsFn4X+nYCTtyGqBGN9zCvdwl4bZOzgwYOmjygUPeyi2T0CQtHHeIsodcaS0fwIjjBSbXw8uKKlIHzNdFusWLGCDw8PG+2nNc+r1SpvuI1J4TgdoJo5PvvIjwJMgUnNwpTbpIEv9O+H9z/J+vYJtu8rf82srtUX21avH0e3zUQ70mhT8dGBBubIjS+Pogo4D4OFiySlK9pyBhmoQQbBFI0i4NFwzgl8OuvmbujXs7bdaigiFZFPwNsg0smmwSaF/Du5SQJevW43++S9f86mqvXaki13v3HzX37obMuyVVXIzocOPb85NG4vtiUVORBq4ya3h/tQEQ5FPyWX8DoSFqmikxrXnudNFotFUavVODwOh9uMDBYvDC8Mjaw8fuFM5/I1S8zuKtAFewplwPHqJm3IWKu/+JxJaxONv/ryAKsw58KOL/zrC0YToENIB6yIKNAo6ABrwsnPnJjIEdM5DBODOYIWM+C1ZUsf3s1ICAnAXzNmdnpiFMDN1ITVsID+S16ocWJkeKy0bKWMwGthgkWguU/kZ5fPDKvVfkNlH9o12alOjnqRzGQzHlEhTmxFdJhVkePQRO+INnBsQnNKypRCIk5GjcFs6PXjZxPdJUq0Ux9M/fk3Hx1YuW27WRJ60vDzAvtIzIsMKk6gFgamaBJtQBobBJbmMZbGwSJDChfC6JlF8drQXRNvVAyK1jH0InkwSJCjR2b8xsv7z6emM0XEqUEigLo4cNQtT06cM1kl9hSTyThwNDuSf1+YGcrygHFoxjBRK8NvFExmKCPVU9SkUE/vnslYFfoMFpEOUEw0B4cmeIxHf+2buZSeuTA2cHTvnukEY6Qbze04NTBab2lpAUUCefz5pw/dtOtTf0Cf4ToZTRAQOVl0bFs0T4HHUY0lmcrQYPHs01+/q3FxeJldbKn27Nz1EvWpnh8uEnCyvrA244w899T2pE/X7Xe/EtbrDnMot4GVKOOulUUSWVwPvnzwOMkVAzdCEtfs5PS0Zs0aPTMzg0NTKPv//dFz19750eFcR2evJF8vzRYYDabzkCZw+Pjt+Pztfuea1//lwY+13vDe19bd/6VnR370xNahvf/xAer35n//84fT44prtwxsuv/hZ8f3P3P9+Ree2UnfluzQ7JSxMdhXlpMZKFmrVfq++uCpGHxTAGKMiIOUPnv2rCTwCL+h7/vhyR/vOUwBIyDKUNCIwZPBJoVcZRJVl27/Invme99nO+68i2XX3DDiYVxx3ZZhavv5L16eV02fFWtHaDcLG7eZC6YffV6y+wDenKBgApQa09qH/u2RH5OJUO3u7pYpzc8zWBVLRh2DX37rH4c7tm4/1nHtuq10oiIu+tzxMuWT2fK+5IQU3QwQlbyhZ039yIYxdug/j9zhT5xvqQ8c2bjrjmLzIJ6U9605zw7tqb1XNuoZ9/Tx6z5wY2SHVV6axS4jNSAL03Jy4NXjp/Y+eZHwEK7x8fFE86akA086xyGh7OmBY+Xe3/ngdWBSNnTr4kLnb53czI6tyYRTWR1U50Yq3whCdUmxwrqLXtaZGlx16+pa4RN3es22pK5ojftMos/K2ZY/uhO6sx3vcfYXP3hz2vZ5JhtKP6i89A+f3S/dag2cdTs6OnDIagSxgnUCOA2eQFPWXkAlV9Laufk9S2/+08//rnQbHY2Zizm/Us4Ebs2BI0b2IwUFTC6Esixbi2w+tPLFwMnkQu7YcLXIrvxA6DCwTLJnWQqpB642bG1ZjsI9N1xLiBkQeOFCLYzLtLT73M6Ujz7+8E9mTrxyARQmLVVAGRea92JmRAejFHj90EMPGaNob28nCb1MJtOYOn5k+sg/feFA0KhXFLdCLRC3qFpUrQChFKYhVIgnbXnoB3Tm5b7nMa/hszDw8bvBfN9lfqPG/XqV+zgP+56rfTpo+x6jU1oIV0SXBV4F4e7Rvzk4ffxIGcB9wkF42trajNZTrn0ebRjOiCZVmJ6e5pRDOI4j4H2sxvQ4mx08Md16w3uWaWHbFPXNnQpCObY7ZHgK25H05Da+0YURp+BMAZUuv+KIRCFJoE0g8IgoxFBqRqkXdzISyVf1xDcfebE+dGYS61ZzuVwdzzrxZWpqKtRRojPvnp8twnuH6INcp4jBLXC7bfD/bfnO7s6e9+/a1LJ6wxoZBqBMdJaMIqmljUA26ANKIFnUgMcV/ZK4cSN6CJwyARr00QSe6GMWRf5SPnn03OhPnnrdLU/NQGllrDeN5Sv5fL4+MTGRpsvi4FM3ZlbM/xxqCfQpoa0NlZ7FlvVbO5f//qe2OrlC3gwUtiKgNLsgAcBfkzzimxFMUjJJOjZIAdqKAODZuDhaHn/xh2fGDx+g1LkO4FVgmLUsqwq3TXxvsMjbKLbgum/Ri9ZYCALvtLa25qCFIiYqYeIigaddwY44ve/76LK2bXd151au7zLgkmTMJIlRZmkyF0pekm+0KAzVuzA0e+GnT78xcfiFyWw2K5HyNjC/C8ErqFUorI6I38CNRoDEUbJFboqvdMUt4h0wAszOzhawSB40IE+UgWbyEIBsQrSvu7FYWL+1kFu7paOwbEWJ50o5u9SeNX+Jwl9NVHXGU74XukOD5drI6crUwb3jcnY80Sb4xIkWPkDXQRUX/K739PQ0ent7g/7+/pC9jSvu5CbK7AABLhQK+Xq9nsXvLLRElCK3aqGvRULYts3T8+IbwzeW+o0s1aTWpmIOExABukECQCEueTg4jACOw7+cxq8GPI8tm04uFiayOzs7M9BKBkaUBY2yMfgMQNiglhXvVhLokvl1DNoYG/oqSv4INIAG8Ia0A8RrL64mmrIoGBkobxl8SohkB5o0imsmVe24GgHIxQJgeu7E2OalIFRx6PdxdvaTd9xSS1z2JskXT7vGtwx+QRFsLn0wgmBxB4vPAw/bEDDARPs6VSV2jZK/ICWA0TJ2N8TuKrbIHxHecdHz/wCWCEDUSVKJdhg2XQx1odIZeClVGCA9l8Bz0Hdqb+/q6mrBFUY+Hu9A25Ze7A9s73ZJLdJM4qA1IwgBikEV41qKaxHeo4AzQy4NGOlIYiP/+8AXCMFSQvAYiCBQVNmcHSTCpQ36/xbs/8fyP6oaQOYVoYvQAAAAAElFTkSuQmCC",Wrt="/airport/assets/count4.577debcf.png";var Hrt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jrt=function(n){Hrt(e,n);function e(t){var r=n.call(this)||this;return r.map_=t,r}return e.prototype.dispatchRenderEvent=function(t,r){tB()},e.prototype.calculateMatrices2D=function(t){var r=t.viewState,i=t.coordinateToPixelTransform,a=t.pixelToCoordinateTransform;FZ(i,t.size[0]/2,t.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),xPe(a,i)},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o,s,l,u){var h,c=r.viewState;function f(k,D,G,W){return o.call(s,D,k?G:null,W)}var d=c.projection,v=Ctt(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&a){var g=d.getExtent(),m=nv(g);p.push([-m,0],[m,0])}for(var y=r.layerStatesArray,_=y.length,x=[],S=[],w=0;w<p.length;w++)for(var b=_-1;b>=0;--b){var E=y[b],T=E.layer;if(T.hasRenderer()&&O8(E,c)&&l.call(u,T)){var C=T.getRenderer(),A=T.getSource();if(C&&A){var M=A.getWrapX()?v:t,I=f.bind(null,E.managed);S[0]=M[0]+p[w][0],S[1]=M[1]+p[w][1],h=C.forEachFeatureAtCoordinate(S,r,i,I,x)}if(h)return h}}if(x.length!==0){var R=1/x.length;return x.forEach(function(k,D){return k.distanceSq+=D*R}),x.sort(function(k,D){return k.distanceSq-D.distanceSq}),x.some(function(k){return h=k.callback(k.feature,k.layer,k.geometry)}),h}},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){return tB()},e.prototype.hasFeatureAtCoordinate=function(t,r,i,a,o,s){var l=this.forEachFeatureAtCoordinate(t,r,i,a,DA,this,o,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){tB()},e.prototype.scheduleExpireIconCache=function(t){SPe.canExpireCache()&&t.postRenderFunctions.push(Xrt)},e}(wPe);function Xrt(n,e){SPe.expire()}const Yrt=jrt;var qrt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Zrt=function(n){qrt(e,n);function e(t){var r=n.call(this,t)||this;r.fontChangeListenerKey_=Ks(Att,BR.PROPERTYCHANGE,t.redrawText.bind(t)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=QN+" ol-layers";var a=t.getViewport();return a.insertBefore(r.element_,a.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(t,r){var i=this.getMap();if(i.hasListener(t)){var a=new Mtt(t,void 0,r);i.dispatchEvent(a)}},e.prototype.disposeInternal=function(){Pf(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),n.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(GO.PRECOMPOSE,t);var r=t.layerStatesArray.sort(function(d,v){return d.zIndex-v.zIndex}),i=t.viewState;this.children_.length=0;for(var a=[],o=null,s=0,l=r.length;s<l;++s){var u=r[s];t.layerIndex=s;var h=u.layer,c=h.getSourceState();if(!O8(u,i)||c!="ready"&&c!="undefined"){h.unrender();continue}var f=h.render(t,o);!f||(f!==o&&(this.children_.push(f),o=f),"getDeclutter"in h&&a.push(h))}for(var s=a.length-1;s>=0;--s)a[s].renderDeclutter(t);Itt(this.element_,this.children_),this.dispatchRenderEvent(GO.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){for(var s=r.viewState,l=r.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var c=l[h],f=c.layer;if(f.hasRenderer()&&O8(c,s)&&o(f)){var d=f.getRenderer(),v=d.getDataAtPixel(t,r,i);if(v){var p=a(f,v);if(p)return p}}}},e}(Yrt);const NPe=Zrt;var kPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Dx=function(n){kPe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.layer=r,i}return e}(sz),NW={LAYERS:"layers"},Krt=function(n){kPe(e,n);function e(t){var r=this,i=t||{},a=Tp({},i);delete a.layers;var o=i.layers;return r=n.call(this,a)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(NW.LAYERS,r.handleLayersChanged_),o?Array.isArray(o)?o=new Jg(o.slice(),{unique:!0}):hc(typeof o.getArray=="function",43):o=new Jg(void 0,{unique:!0}),r.setLayers(o),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Pf),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(Ks(t,Rx.ADD,this.handleLayersAdd_,this),Ks(t,Rx.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(Pf);bPe(this.listenerKeys_);for(var i=t.getArray(),a=0,o=i.length;a<o;a++){var s=i[a];this.registerLayerListeners_(s),this.dispatchEvent(new Dx("addlayer",s))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[Ks(t,BR.PROPERTYCHANGE,this.handleLayerChange_,this),Ks(t,zo.CHANGE,this.handleLayerChange_,this)];t instanceof e&&r.push(Ks(t,"addlayer",this.handleLayerGroupAdd_,this),Ks(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[_1(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new Dx("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new Dx("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var r=t.element;this.registerLayerListeners_(r),this.dispatchEvent(new Dx("addlayer",r)),this.changed()},e.prototype.handleLayersRemove_=function(t){var r=t.element,i=_1(r);this.listenerKeys_[i].forEach(Pf),delete this.listenerKeys_[i],this.dispatchEvent(new Dx("removelayer",r)),this.changed()},e.prototype.getLayers=function(){return this.get(NW.LAYERS)},e.prototype.setLayers=function(t){var r=this.getLayers();if(r)for(var i=r.getArray(),a=0,o=i.length;a<o;++a)this.dispatchEvent(new Dx("removelayer",i[a]));this.set(NW.LAYERS,t)},e.prototype.getLayersArray=function(t){var r=t!==void 0?t:[];return this.getLayers().forEach(function(i){i.getLayersArray(r)}),r},e.prototype.getLayerStatesArray=function(t){var r=t!==void 0?t:[],i=r.length;this.getLayers().forEach(function(h){h.getLayerStatesArray(r)});var a=this.getLayerState(),o=a.zIndex;!t&&a.zIndex===void 0&&(o=0);for(var s=i,l=r.length;s<l;s++){var u=r[s];u.opacity*=a.opacity,u.visible=u.visible&&a.visible,u.maxResolution=Math.min(u.maxResolution,a.maxResolution),u.minResolution=Math.max(u.minResolution,a.minResolution),u.minZoom=Math.max(u.minZoom,a.minZoom),u.maxZoom=Math.min(u.maxZoom,a.maxZoom),a.extent!==void 0&&(u.extent!==void 0?u.extent=zO(u.extent,a.extent):u.extent=a.extent),u.zIndex===void 0&&(u.zIndex=o)}return r},e.prototype.getSourceState=function(){return"ready"},e}(Ltt);const cz=Krt;var Jrt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Qrt=function(n){Jrt(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.map=r,a.frameState=i!==void 0?i:null,a}return e}(sz);const FC=Qrt;var ent=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),tnt=function(n){ent(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,o)||this;return l.originalEvent=i,l.pixel_=null,l.coordinate_=null,l.dragging=a!==void 0?a:!1,l.activePointers=s,l}return Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){n.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){n.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(FC);const v1=tnt,Yo={SINGLECLICK:"singleclick",CLICK:zo.CLICK,DBLCLICK:zo.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},YZ={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var rnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),nnt=function(n){rnt(e,n);function e(t,r){var i=n.call(this,t)||this;i.map_=t,i.clickTimeoutId_,i.emulateClicks_=!1,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=r===void 0?1:r,i.down_=null;var a=i.map_.getViewport();return i.activePointers_=[],i.trackedTouches_={},i.element_=a,i.pointerdownListenerKey_=Ks(a,YZ.POINTERDOWN,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=Ks(a,YZ.POINTERMOVE,i.relayMoveEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(zo.TOUCHMOVE,i.boundHandleTouchMove_,EPe?{passive:!1}:!1),i}return e.prototype.emulateClick_=function(t){var r=new v1(Yo.CLICK,this.map_,t);this.dispatchEvent(r),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,r=new v1(Yo.DBLCLICK,this.map_,t),this.dispatchEvent(r)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var i=new v1(Yo.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var r=t,i=r.pointerId;if(r.type==Yo.POINTERUP||r.type==Yo.POINTERCANCEL){delete this.trackedTouches_[i];for(var a in this.trackedTouches_)if(this.trackedTouches_[a].target!==r.target){delete this.trackedTouches_[a];break}}else(r.type==Yo.POINTERDOWN||r.type==Yo.POINTERMOVE)&&(this.trackedTouches_[i]=r);this.activePointers_=Ptt(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var r=new v1(Yo.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(r),this.emulateClicks_&&!r.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Pf),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return t.button===0},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);var r=new v1(Yo.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(r),this.down_={};for(var i in t){var a=t[i];this.down_[i]=typeof a=="function"?one:a}if(this.dragListenerKeys_.length===0){var o=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Ks(o,Yo.POINTERMOVE,this.handlePointerMove_,this),Ks(o,Yo.POINTERUP,this.handlePointerUp_,this),Ks(this.element_,Yo.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==o&&this.dragListenerKeys_.push(Ks(this.element_.getRootNode(),Yo.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var r=new v1(Yo.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(r)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var r=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new v1(Yo.POINTERMOVE,this.map_,t,r))},e.prototype.handleTouchMove_=function(t){var r=this.originalPointerMoveEvent_;(!r||r.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Pf(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(zo.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Pf(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Pf),this.dragListenerKeys_.length=0,this.element_=null,n.prototype.disposeInternal.call(this)},e}(TPe);const int=nnt,Zu={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var F8=1/0,ant=function(){function n(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,bPe(this.queuedElements_)},n.prototype.dequeue=function(){var e=this.elements_,t=this.priorities_,r=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},n.prototype.enqueue=function(e){hc(!(this.keyFunction_(e)in this.queuedElements_),31);var t=this.priorityFunction_(e);return t!=F8?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(e){return e*2+1},n.prototype.getRightChildIndex_=function(e){return e*2+2},n.prototype.getParentIndex_=function(e){return e-1>>1},n.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},n.prototype.isEmpty=function(){return this.elements_.length===0},n.prototype.isKeyQueued=function(e){return e in this.queuedElements_},n.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},n.prototype.siftUp_=function(e){for(var t=this.elements_,r=this.priorities_,i=t.length,a=t[e],o=r[e],s=e;e<i>>1;){var l=this.getLeftChildIndex_(e),u=this.getRightChildIndex_(e),h=u<i&&r[u]<r[l]?u:l;t[e]=t[h],r[e]=r[h],e=h}t[e]=a,r[e]=o,this.siftDown_(s,e)},n.prototype.siftDown_=function(e,t){for(var r=this.elements_,i=this.priorities_,a=r[t],o=i[t];t>e;){var s=this.getParentIndex_(t);if(i[s]>o)r[t]=r[s],i[t]=i[s],t=s;else break}r[t]=a,i[t]=o},n.prototype.reprioritize=function(){var e=this.priorityFunction_,t=this.elements_,r=this.priorities_,i=0,a=t.length,o,s,l;for(s=0;s<a;++s)o=t[s],l=e(o),l==F8?delete this.queuedElements_[this.keyFunction_(o)]:(r[i]=l,t[i++]=o);t.length=i,r.length=i,this.heapify_()},n}();const ont=ant,Hi={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};var snt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lnt=function(n){snt(e,n);function e(t,r){var i=n.call(this,function(a){return t.apply(null,a)},function(a){return a[0].getKey()})||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=r,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return e.prototype.enqueue=function(t){var r=n.prototype.enqueue.call(this,t);if(r){var i=t[0];i.addEventListener(zo.CHANGE,this.boundHandleTileChange_)}return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var r=t.target,i=r.getState();if(i===Hi.LOADED||i===Hi.ERROR||i===Hi.EMPTY){r.removeEventListener(zo.CHANGE,this.boundHandleTileChange_);var a=r.getKey();a in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[a],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,r){for(var i=0,a,o,s;this.tilesLoading_<t&&i<r&&this.getCount()>0;)o=this.dequeue()[0],s=o.getKey(),a=o.getState(),a===Hi.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,o.load())},e}(ont);const unt=lnt;function hnt(n,e,t,r,i){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return F8;var a=n.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}const Jd={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var FPe=256;function Fde(n,e,t){return function(r,i,a,o,s){if(!!r){if(!i&&!e)return r;var l=e?0:a[0]*i,u=e?0:a[1]*i,h=s?s[0]:0,c=s?s[1]:0,f=n[0]+l/2+h,d=n[2]-l/2+h,v=n[1]+u/2+c,p=n[3]-u/2+c;f>d&&(f=(d+f)/2,d=f),v>p&&(v=(p+v)/2,p=v);var g=bv(r[0],f,d),m=bv(r[1],v,p);if(o&&t&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,f-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-d)/y),m+=-y*Math.log(1+Math.max(0,v-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-p)/y)}return[g,m]}}}function cnt(n){return n}function yne(n,e,t,r){var i=nv(e)/t[0],a=hM(e)/t[1];return r?Math.min(n,Math.max(i,a)):Math.min(n,Math.min(i,a))}function mne(n,e,t){var r=Math.min(n,e),i=50;return r*=Math.log(1+i*Math.max(0,n/e-1))/i+1,t&&(r=Math.max(r,t),r/=Math.log(1+i*Math.max(0,t/n-1))/i+1),bv(r,t/2,e*2)}function fnt(n,e,t,r){return function(i,a,o,s){if(i!==void 0){var l=n[0],u=n[n.length-1],h=t?yne(l,t,o,r):l;if(s){var c=e!==void 0?e:!0;return c?mne(i,h,u):bv(i,u,h)}var f=Math.min(h,i),d=Math.floor(sne(n,f,a));return n[d]>h&&d<n.length-1?n[d+1]:n[d]}else return}}function dnt(n,e,t,r,i,a){return function(o,s,l,u){if(o!==void 0){var h=i?yne(e,i,l,a):e,c=t!==void 0?t:0;if(u){var f=r!==void 0?r:!0;return f?mne(o,h,c):bv(o,c,h)}var d=1e-9,v=Math.ceil(Math.log(e/h)/Math.log(n)-d),p=-s*(.5-d)+.5,g=Math.min(h,o),m=Math.floor(Math.log(e/g)/Math.log(n)+p),y=Math.max(v,m),_=e/Math.pow(n,y);return bv(_,c,h)}else return}}function Bde(n,e,t,r,i){return function(a,o,s,l){if(a!==void 0){var u=r?yne(n,r,s,i):n,h=t!==void 0?t:!0;return!h||!l?bv(a,e,u):mne(a,u,e)}else return}}function _ne(n){if(n!==void 0)return 0}function Gde(n){if(n!==void 0)return n}function vnt(n){var e=2*Math.PI/n;return function(t,r){if(r)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t}}function pnt(n){var e=n||Ott(5);return function(t,r){if(r)return t;if(t!==void 0)return Math.abs(t)<=e?0:t}}function BPe(n){return Math.pow(n,3)}function wI(n){return 1-BPe(1-n)}function gnt(n){return 3*n*n-2*n*n*n}function ynt(n){return n}var mnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kW=0,_nt=function(n){mnt(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=Tp({},t);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=lne(i.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,i.projection&&Ftt(),i.center&&(i.center=Bg(i.center,r.projection_)),i.extent&&(i.extent=sA(i.extent,r.projection_)),r.applyOptions_(i),r}return e.prototype.applyOptions_=function(t){var r=Tp({},t);for(var i in Jd)delete r[i];this.setProperties(r,!0);var a=Snt(t);this.maxResolution_=a.maxResolution,this.minResolution_=a.minResolution,this.zoomFactor_=a.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=a.minZoom;var o=xnt(t),s=a.constraint,l=wnt(t);this.constraints_={center:o,resolution:s,rotation:l},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var r=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var a=t||[0,0,0,0];r=r||[0,0,0,0];var o=this.getResolution(),s=o/2*(a[3]-r[3]+r[1]-a[1]),l=o/2*(a[0]-r[0]+r[2]-a[2]);this.setCenterInternal([i[0]+s,i[1]-l])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var r=this.getProperties();return r.resolution!==void 0?r.resolution=this.getResolution():r.zoom=this.getZoom(),r.center=this.getCenterInternal(),r.rotation=this.getRotation(),Tp({},r,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var r=new Array(arguments.length),i=0;i<r.length;++i){var a=arguments[i];a.center&&(a=Tp({},a),a.center=Bg(a.center,this.getProjection())),a.anchor&&(a=Tp({},a),a.anchor=Bg(a.anchor,this.getProjection())),r[i]=a}this.animateInternal.apply(this,r)},e.prototype.animateInternal=function(t){var r=arguments.length,i;r>1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var a=0;a<r&&!this.isDef();++a){var o=arguments[a];o.center&&this.setCenterInternal(o.center),o.zoom!==void 0?this.setZoom(o.zoom):o.resolution&&this.setResolution(o.resolution),o.rotation!==void 0&&this.setRotation(o.rotation)}if(a===r){i&&DF(i,!0);return}for(var s=Date.now(),l=this.targetCenter_.slice(),u=this.targetResolution_,h=this.targetRotation_,c=[];a<r;++a){var f=arguments[a],d={start:s,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||gnt,callback:i};if(f.center&&(d.sourceCenter=l,d.targetCenter=f.center.slice(),l=d.targetCenter),f.zoom!==void 0?(d.sourceResolution=u,d.targetResolution=this.getResolutionForZoom(f.zoom),u=d.targetResolution):f.resolution&&(d.sourceResolution=u,d.targetResolution=f.resolution,u=d.targetResolution),f.rotation!==void 0){d.sourceRotation=h;var v=UO(f.rotation-h+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=h+v,h=d.targetRotation}bnt(d)?d.complete=!0:s+=d.duration,c.push(d)}this.animations_.push(c),this.setHint(pp.ANIMATING,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[pp.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[pp.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(pp.ANIMATING,-this.hints_[pp.ANIMATING]);for(var t,r=0,i=this.animations_.length;r<i;++r){var a=this.animations_[r];if(a[0].callback&&DF(a[0].callback,!1),!t)for(var o=0,s=a.length;o<s;++o){var l=a[o];if(!l.complete){t=l.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!!this.getAnimating()){for(var t=Date.now(),r=!1,i=this.animations_.length-1;i>=0;--i){for(var a=this.animations_[i],o=!0,s=0,l=a.length;s<l;++s){var u=a[s];if(!u.complete){var h=t-u.start,c=u.duration>0?h/u.duration:1;c>=1?(u.complete=!0,c=1):o=!1;var f=u.easing(c);if(u.sourceCenter){var d=u.sourceCenter[0],v=u.sourceCenter[1],p=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=d+f*(p-d),y=v+f*(g-v);this.targetCenter_=[m,y]}if(u.sourceResolution&&u.targetResolution){var _=f===1?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){var x=this.getViewportSize_(this.getRotation()),S=this.constraints_.resolution(_,0,x,!0);this.targetCenter_=this.calculateCenterZoom(S,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var w=f===1?UO(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){var b=this.constraints_.rotation(w,!0);this.targetCenter_=this.calculateCenterRotate(b,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=w}if(this.applyTargetState_(!0),r=!0,!u.complete)break}}if(o){this.animations_[i]=null,this.setHint(pp.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=a[0].callback;E&&DF(E,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,r){var i,a=this.getCenterInternal();return a!==void 0&&(i=[a[0]-r[0],a[1]-r[1]],une(i,t-this.getRotation()),Rtt(i,r)),i},e.prototype.calculateCenterZoom=function(t,r){var i,a=this.getCenterInternal(),o=this.getResolution();if(a!==void 0&&o!==void 0){var s=r[0]-t*(r[0]-a[0])/o,l=r[1]-t*(r[1]-a[1])/o;i=[s,l]}return i},e.prototype.getViewportSize_=function(t){var r=this.viewportSize_;if(t){var i=r[0],a=r[1];return[Math.abs(i*Math.cos(t))+Math.abs(a*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(a*Math.cos(t))]}else return r},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&BZ(t,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Jd.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var r=this.calculateExtentInternal(t);return Dtt(r,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var r=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();hc(i,1);var a=this.getResolution();hc(a!==void 0,2);var o=this.getRotation();return hc(o!==void 0,3),GZ(i,a,o,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Jd.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,r){return this.getResolutionForExtentInternal(sA(t,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(t,r){var i=r||this.getViewportSizeMinusPadding_(),a=nv(t)/i[0],o=hM(t)/i[1];return Math.max(a,o)},e.prototype.getResolutionForValueFunction=function(t){var r=t||2,i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/Math.log(r);return function(s){var l=i/Math.pow(r,s*o);return l}},e.prototype.getRotation=function(){return this.get(Jd.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var r=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/r;return function(s){var l=Math.log(i/s)/r/o;return l}},e.prototype.getViewportSizeMinusPadding_=function(t){var r=this.getViewportSize_(t),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var t=this.getProjection(),r=this.getResolution(),i=this.getRotation(),a=this.getCenterInternal(),o=this.padding_;if(o){var s=this.getViewportSizeMinusPadding_();a=FW(a,this.getViewportSize_(),[s[0]/2+o[3],s[1]/2+o[0]],r,i)}return{center:a.slice(0),projection:t!==void 0?t:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,r=this.getResolution();return r!==void 0&&(t=this.getZoomForResolution(r)),t},e.prototype.getZoomForResolution=function(t){var r=this.minZoom_||0,i,a;if(this.resolutions_){var o=sne(this.resolutions_,t,1);r=o,i=this.resolutions_[o],o==this.resolutions_.length-1?a=2:a=i/this.resolutions_[o+1]}else i=this.maxResolution_,a=this.zoomFactor_;return r+Math.log(i/t)/Math.log(a)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=bv(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,bv(t-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,r){var i;if(hc(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){hc(!CPe(t),25);var a=sA(t,this.getProjection());i=zZ(a)}else if(t.getType()==="Circle"){var a=sA(t.getExtent(),this.getProjection());i=zZ(a),i.rotate(this.getRotation(),UZ(a))}else{var o=Btt();o?i=t.clone().transform(o,this.getProjection()):i=t}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(t){for(var r=this.getRotation(),i=Math.cos(r),a=Math.sin(-r),o=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,c=-1/0,f=0,d=o.length;f<d;f+=s){var v=o[f]*i-o[f+1]*a,p=o[f]*a+o[f+1]*i;l=Math.min(l,v),u=Math.min(u,p),h=Math.max(h,v),c=Math.max(c,p)}return[l,u,h,c]},e.prototype.fitInternal=function(t,r){var i=r||{},a=i.size;a||(a=this.getViewportSizeMinusPadding_());var o=i.padding!==void 0?i.padding:[0,0,0,0],s=i.nearest!==void 0?i.nearest:!1,l;i.minResolution!==void 0?l=i.minResolution:i.maxZoom!==void 0?l=this.getResolutionForZoom(i.maxZoom):l=0;var u=this.rotatedExtentForGeometry(t),h=this.getResolutionForExtentInternal(u,[a[0]-o[1]-o[3],a[1]-o[0]-o[2]]);h=isNaN(h)?l:Math.max(h,l),h=this.getConstrainedResolution(h,s?0:1);var c=this.getRotation(),f=Math.sin(c),d=Math.cos(c),v=UZ(u);v[0]+=(o[1]-o[3])/2*h,v[1]+=(o[0]-o[2])/2*h;var p=v[0]*d-v[1]*f,g=v[1]*d+v[0]*f,m=this.getConstrainedCenter([p,g],h),y=i.callback?i.callback:one;i.duration!==void 0?this.animateInternal({resolution:h,center:m,duration:i.duration,easing:i.easing},y):(this.targetResolution_=h,this.targetCenter_=m,this.applyTargetState_(!1,!0),DF(y,!0))},e.prototype.centerOn=function(t,r,i){this.centerOnInternal(Bg(t,this.getProjection()),r,i)},e.prototype.centerOnInternal=function(t,r,i){this.setCenterInternal(FW(t,r,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,r,i,a){var o,s=this.padding_;if(s&&t){var l=this.getViewportSizeMinusPadding_(-i),u=FW(t,a,[l[0]/2+s[3],l[1]/2+s[0]],r,i);o=[t[0]-u[0],t[1]-u[1]]}return o},e.prototype.isDef=function(){return!!this.getCenterInternal()&&this.getResolution()!==void 0},e.prototype.adjustCenter=function(t){var r=BZ(this.targetCenter_,this.getProjection());this.setCenter([r[0]+t[0],r[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var r=this.targetCenter_;this.setCenterInternal([r[0]+t[0],r[1]+t[1]])},e.prototype.adjustResolution=function(t,r){var i=r&&Bg(r,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,r){var i=this.getAnimating()||this.getInteracting(),a=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,a,i);r&&(this.targetCenter_=this.calculateCenterZoom(o,r)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,r){this.adjustResolution(Math.pow(this.zoomFactor_,-t),r)},e.prototype.adjustRotation=function(t,r){r&&(r=Bg(r,this.getProjection())),this.adjustRotationInternal(t,r)},e.prototype.adjustRotationInternal=function(t,r){var i=this.getAnimating()||this.getInteracting(),a=this.constraints_.rotation(this.targetRotation_+t,i);r&&(this.targetCenter_=this.calculateCenterRotate(a,r)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t&&Bg(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,r){return this.hints_[t]+=r,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,r){var i=this.getAnimating()||this.getInteracting()||r,a=this.constraints_.rotation(this.targetRotation_,i),o=this.getViewportSize_(a),s=this.constraints_.resolution(this.targetResolution_,0,o,i),l=this.constraints_.center(this.targetCenter_,s,o,i,this.calculateCenterShift(this.targetCenter_,s,a,o));this.get(Jd.ROTATION)!==a&&this.set(Jd.ROTATION,a),this.get(Jd.RESOLUTION)!==s&&(this.set(Jd.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),(!l||!this.get(Jd.CENTER)||!VZ(this.get(Jd.CENTER),l))&&this.set(Jd.CENTER,l),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,r,i){var a=t!==void 0?t:200,o=r||0,s=this.constraints_.rotation(this.targetRotation_),l=this.getViewportSize_(s),u=this.constraints_.resolution(this.targetResolution_,o,l),h=this.constraints_.center(this.targetCenter_,u,l,!1,this.calculateCenterShift(this.targetCenter_,u,s,l));if(a===0&&!this.cancelAnchor_){this.targetResolution_=u,this.targetRotation_=s,this.targetCenter_=h,this.applyTargetState_();return}var c=i||(a===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==u||this.getRotation()!==s||!this.getCenterInternal()||!VZ(this.getCenterInternal(),h))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:h,resolution:u,duration:a,easing:wI,anchor:c}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(pp.INTERACTING,1)},e.prototype.endInteraction=function(t,r,i){var a=i&&Bg(i,this.getProjection());this.endInteractionInternal(t,r,a)},e.prototype.endInteractionInternal=function(t,r,i){this.setHint(pp.INTERACTING,-1),this.resolveConstraints(t,r,i)},e.prototype.getConstrainedCenter=function(t,r){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,r||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,r){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,r))},e.prototype.getConstrainedResolution=function(t,r){var i=r||0,a=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,a)},e}(lz);function DF(n,e){setTimeout(function(){n(e)},0)}function xnt(n){if(n.extent!==void 0){var e=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return Fde(n.extent,n.constrainOnlyCenter,e)}var t=lne(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&t.isGlobal()){var r=t.getExtent().slice();return r[0]=-1/0,r[2]=1/0,Fde(r,!1,!1)}return cnt}function Snt(n){var e,t,r,i=28,a=2,o=n.minZoom!==void 0?n.minZoom:kW,s=n.maxZoom!==void 0?n.maxZoom:i,l=n.zoomFactor!==void 0?n.zoomFactor:a,u=n.multiWorld!==void 0?n.multiWorld:!1,h=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,c=n.showFullExtent!==void 0?n.showFullExtent:!1,f=lne(n.projection,"EPSG:3857"),d=f.getExtent(),v=n.constrainOnlyCenter,p=n.extent;if(!u&&!p&&f.isGlobal()&&(v=!1,p=d),n.resolutions!==void 0){var g=n.resolutions;t=g[o],r=g[s]!==void 0?g[s]:g[g.length-1],n.constrainResolution?e=fnt(g,h,!v&&p,c):e=Bde(t,r,h,!v&&p,c)}else{var m=d?Math.max(nv(d),hM(d)):360*Ntt[ktt.DEGREES]/f.getMetersPerUnit(),y=m/FPe/Math.pow(a,kW),_=y/Math.pow(a,i-kW);t=n.maxResolution,t!==void 0?o=0:t=y/Math.pow(l,o),r=n.minResolution,r===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?r=t/Math.pow(l,s):r=y/Math.pow(l,s):r=_),s=o+Math.floor(Math.log(t/r)/Math.log(l)),r=t/Math.pow(l,s-o),n.constrainResolution?e=dnt(l,t,r,h,!v&&p,c):e=Bde(t,r,h,!v&&p,c)}return{constraint:e,maxResolution:t,minResolution:r,minZoom:o,zoomFactor:l}}function wnt(n){var e=n.enableRotation!==void 0?n.enableRotation:!0;if(e){var t=n.constrainRotation;return t===void 0||t===!0?pnt():t===!1?Gde:typeof t=="number"?vnt(t):Gde}else return _ne}function bnt(n){return!(n.sourceCenter&&n.targetCenter&&!VZ(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function FW(n,e,t,r,i){var a=Math.cos(-i),o=Math.sin(-i),s=n[0]*a-n[1]*o,l=n[1]*a+n[0]*o;s+=(e[0]/2-t[0])*r,l+=(t[1]-e[1]/2)*r,o=-o;var u=s*a-l*o,h=l*a+s*o;return[u,h]}const Ay=_nt;var Ent=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function GPe(n){if(n instanceof hne){n.setMapInternal(null);return}n instanceof cz&&n.getLayers().forEach(GPe)}function zPe(n,e){if(n instanceof hne){n.setMapInternal(e);return}if(n instanceof cz)for(var t=n.getLayers().getArray(),r=0,i=t.length;r<i;++r)zPe(t[r],e)}var Tnt=function(n){Ent(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=Cnt(t);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,r.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:APe,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=Tde(),r.pixelToCoordinateTransform_=Tde(),r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=t.moveTolerance,r.keyboardEventTarget_=i.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=i.controls||new Jg,r.interactions=i.interactions||new Jg,r.overlays_=i.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new unt(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Zu.LAYERGROUP,r.handleLayerGroupChanged_),r.addChangeListener(Zu.VIEW,r.handleViewChanged_),r.addChangeListener(Zu.SIZE,r.handleSizeChanged_),r.addChangeListener(Zu.TARGET,r.handleTargetChanged_),r.setProperties(i.values);var a=r;return t.view&&!(t.view instanceof Ay)&&t.view.then(function(o){a.setView(new Ay(o))}),r.controls.addEventListener(Rx.ADD,function(o){o.element.setMap(this)}.bind(r)),r.controls.addEventListener(Rx.REMOVE,function(o){o.element.setMap(null)}.bind(r)),r.interactions.addEventListener(Rx.ADD,function(o){o.element.setMap(this)}.bind(r)),r.interactions.addEventListener(Rx.REMOVE,function(o){o.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(Rx.ADD,function(o){this.addOverlayInternal_(o.element)}.bind(r)),r.overlays_.addEventListener(Rx.REMOVE,function(o){var s=o.element,l=s.getId();l!==void 0&&delete this.overlayIdIndex_[l.toString()],o.element.setMap(null)}.bind(r)),r.controls.forEach(function(o){o.setMap(this)}.bind(r)),r.interactions.forEach(function(o){o.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){var r=this.getLayerGroup().getLayers();r.push(t)},e.prototype.handleLayerAdd_=function(t){zPe(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var r=t.getId();r!==void 0&&(this.overlayIdIndex_[r.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),n.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,r,i){if(!(!this.frameState_||!this.renderer_)){var a=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};var o=i.hitTolerance!==void 0?i.hitTolerance:0,s=i.layerFilter!==void 0?i.layerFilter:DA,l=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(a,this.frameState_,o,l,r,null,s,null)}},e.prototype.getFeaturesAtPixel=function(t,r){var i=[];return this.forEachFeatureAtPixel(t,function(a){i.push(a)},r),i},e.prototype.getAllLayers=function(){var t=[];function r(i){i.forEach(function(a){a instanceof cz?r(a.getLayers()):t.push(a)})}return r(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,r,i){if(!(!this.frameState_||!this.renderer_)){var a=i||{},o=a.hitTolerance!==void 0?a.hitTolerance:0,s=a.layerFilter||DA;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,r,s)}},e.prototype.hasFeatureAtPixel=function(t,r){if(!this.frameState_||!this.renderer_)return!1;var i=this.getCoordinateFromPixelInternal(t);r=r!==void 0?r:{};var a=r.layerFilter!==void 0?r.layerFilter:DA,o=r.hitTolerance!==void 0?r.hitTolerance:0,s=r.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,s,a,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var r=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-r.left,i.clientY-r.top]},e.prototype.getTarget=function(){return this.get(Zu.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return t!==void 0?typeof t=="string"?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return BZ(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var r=this.frameState_;return r?R8(r.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var r=this.overlayIdIndex_[t.toString()];return r!==void 0?r:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Zu.LAYERGROUP)},e.prototype.setLayers=function(t){var r=this.getLayerGroup();if(t instanceof Jg){r.setLayers(t);return}var i=r.getLayers();i.clear(),i.extend(t)},e.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),r=0,i=t.length;r<i;++r){var a=t[r];if(!!a.visible){var o=a.layer.getRenderer();if(o&&!o.ready)return!0;var s=a.layer.getSource();if(s&&s.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var r=Bg(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(r)},e.prototype.getPixelFromCoordinateInternal=function(t){var r=this.frameState_;return r?R8(r.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Zu.SIZE)},e.prototype.getView=function(){return this.get(Zu.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,r,i,a){return hnt(this.frameState_,t,r,i,a)},e.prototype.handleBrowserEvent=function(t,r){var i=r||t.type,a=new v1(i,this,t);this.handleMapBrowserEvent(a)},e.prototype.handleMapBrowserEvent=function(t){if(!!this.frameState_){var r=t.originalEvent,i=r.type;if(i===YZ.POINTERDOWN||i===zo.WHEEL||i===zo.KEYDOWN){var a=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():a,s=r.target;if(this.overlayContainerStopEvent_.contains(s)||!(o===a?a.documentElement:o).contains(s))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1)for(var l=this.getInteractions().getArray().slice(),u=l.length-1;u>=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var c=h.handleEvent(t);if(!c||t.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var t=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,a=i;if(t){var o=t.viewHints;if(o[pp.ANIMATING]||o[pp.INTERACTING]){var s=Date.now()-t.time>8;i=s?0:8,a=s?0:2}}r.getTilesLoading()<i&&(r.reprioritize(),r.loadMoreTiles(i,a))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(GO.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(GO.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new FC(d1.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new FC(d1.LOADSTART,this,t))));for(var l=this.postRenderFunctions_,u=0,h=l.length;u<h;++u)l[u](this,t);l.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,r=this.targetChangeHandlerKeys_.length;t<r;++t)Pf(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(zo.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(zo.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,$Z(this.viewport_)}var i=this.getTargetElement();if(!i)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{i.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new int(this,this.moveTolerance_);for(var a in Yo)this.mapBrowserEventHandler_.addEventListener(Yo[a],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(zo.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(zo.WHEEL,this.boundHandleBrowserEvent_,EPe?{passive:!1}:!1);var o=this.getOwnerDocument().defaultView,s=this.keyboardEventTarget_?this.keyboardEventTarget_:i;this.targetChangeHandlerKeys_=[Ks(s,zo.KEYDOWN,this.handleBrowserEvent,this),Ks(s,zo.KEYPRESS,this.handleBrowserEvent,this),Ks(o,zo.RESIZE,this.updateSize,this)]}this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Pf(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Pf(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Ks(t,BR.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Ks(t,zo.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Pf),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Dx("addlayer",t)),this.layerGroupPropertyListenerKeys_=[Ks(t,BR.PROPERTYCHANGE,this.render,this),Ks(t,zo.CHANGE,this.render,this),Ks(t,"addlayer",this.handleLayerAdd_,this),Ks(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),r=0,i=t.length;r<i;++r){var a=t[r].layer;a.hasRenderer()&&a.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){var r=this.getLayerGroup().getLayers();return r.remove(t)},e.prototype.handleLayerRemove_=function(t){GPe(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var r=this,i=this.getSize(),a=this.getView(),o=this.frameState_,s=null;if(i!==void 0&&Cde(i)&&a&&a.isDef()){var l=a.getHints(this.frameState_?this.frameState_.viewHints:void 0),u=a.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:GZ(u.center,u.resolution,u.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:u,viewHints:l,wantedTiles:{},mapId:_1(this),renderTargets:{}},u.nextCenter&&u.nextResolution){var h=isNaN(u.nextRotation)?u.rotation:u.nextRotation;s.nextExtent=GZ(u.nextCenter,u.nextResolution,h,i)}}if(this.frameState_=s,this.renderer_.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),o){var c=!this.previousExtent_||!CPe(this.previousExtent_)&&!D8(s.extent,this.previousExtent_);c&&(this.dispatchEvent(new FC(d1.MOVESTART,this,o)),this.previousExtent_=Gtt(this.previousExtent_))}var f=this.previousExtent_&&!s.viewHints[pp.ANIMATING]&&!s.viewHints[pp.INTERACTING]&&!D8(s.extent,this.previousExtent_);f&&(this.dispatchEvent(new FC(d1.MOVEEND,this,s)),ztt(s.extent,this.previousExtent_))}this.dispatchEvent(new FC(d1.POSTRENDER,this,s)),this.renderComplete_=this.hasListener(d1.LOADSTART)||this.hasListener(d1.LOADEND)||this.hasListener(GO.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){r.postRenderTimeoutHandle_=void 0,r.handlePostRender()},0))},e.prototype.setLayerGroup=function(t){var r=this.getLayerGroup();r&&this.handleLayerRemove_(new Dx("removelayer",r)),this.set(Zu.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(Zu.SIZE,t)},e.prototype.setTarget=function(t){this.set(Zu.TARGET,t)},e.prototype.setView=function(t){if(!t||t instanceof Ay){this.set(Zu.VIEW,t);return}this.set(Zu.VIEW,new Ay);var r=this;t.then(function(i){r.setView(new Ay(i))})},e.prototype.updateSize=function(){var t=this.getTargetElement(),r=void 0;if(t){var i=getComputedStyle(t),a=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),o=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(a)&&!isNaN(o)&&(r=[a,o],!Cde(r)&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(r),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var r=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(r=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(r)}},e}(lz);function Cnt(n){var e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);var t={},r=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new cz({layers:n.layers});t[Zu.LAYERGROUP]=r,t[Zu.TARGET]=n.target,t[Zu.VIEW]=n.view instanceof Ay?n.view:new Ay;var i;n.controls!==void 0&&(Array.isArray(n.controls)?i=new Jg(n.controls.slice()):(hc(typeof n.controls.getArray=="function",47),i=n.controls));var a;n.interactions!==void 0&&(Array.isArray(n.interactions)?a=new Jg(n.interactions.slice()):(hc(typeof n.interactions.getArray=="function",48),a=n.interactions));var o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new Jg(n.overlays.slice()):(hc(typeof n.overlays.getArray=="function",49),o=n.overlays):o=new Jg,{controls:i,interactions:a,keyboardEventTarget:e,overlays:o,values:t}}const UPe=Tnt;var Ant=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Mnt=function(n){Ant(e,n);function e(t){var r=n.call(this)||this,i=t.element;return i&&!t.target&&!i.style.pointerEvents&&(i.style.pointerEvents="auto"),r.element=i||null,r.target_=null,r.map_=null,r.listenerKeys=[],t.render&&(r.render=t.render),t.target&&r.setTarget(t.target),r}return e.prototype.disposeInternal=function(){$Z(this.element),n.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&$Z(this.element);for(var r=0,i=this.listenerKeys.length;r<i;++r)Pf(this.listenerKeys[r]);if(this.listenerKeys.length=0,this.map_=t,t){var a=this.target_?this.target_:t.getOverlayContainerStopEvent();a.appendChild(this.element),this.render!==one&&this.listenerKeys.push(Ks(t,d1.POSTRENDER,this.render,this)),t.render()}},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_=typeof t=="string"?document.getElementById(t):t},e}(lz);const fz=Mnt;var Int=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Lnt=function(n){Int(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.ulElement_=document.createElement("ul"),r.collapsed_=i.collapsed!==void 0?i.collapsed:!0,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=i.collapsible!==void 0,r.collapsible_=i.collapsible!==void 0?i.collapsible:!0,r.collapsible_||(r.collapsed_=!1);var a=i.className!==void 0?i.className:"ol-attribution",o=i.tipLabel!==void 0?i.tipLabel:"Attributions",s=i.expandClassName!==void 0?i.expandClassName:a+"-expand",l=i.collapseLabel!==void 0?i.collapseLabel:"\u203A",u=i.collapseClassName!==void 0?i.collapseClassName:a+"-collapse";typeof l=="string"?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=l,r.collapseLabel_.className=u):r.collapseLabel_=l;var h=i.label!==void 0?i.label:"i";typeof h=="string"?(r.label_=document.createElement("span"),r.label_.textContent=h,r.label_.className=s):r.label_=h;var c=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(c),r.toggleButton_.addEventListener(zo.CLICK,r.handleClick_.bind(r),!1);var f=a+" "+QN+" "+uz+(r.collapsed_&&r.collapsible_?" "+N8:"")+(r.collapsible_?"":" ol-uncollapsible"),d=r.element;return d.className=f,d.appendChild(r.toggleButton_),d.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return e.prototype.collectSourceAttributions_=function(t){for(var r={},i=[],a=!0,o=t.layerStatesArray,s=0,l=o.length;s<l;++s){var u=o[s];if(!!O8(u,t.viewState)){var h=u.layer.getSource();if(!!h){var c=h.getAttributions();if(!!c){var f=c(t);if(!!f)if(a=a&&h.getAttributionsCollapsible()!==!1,Array.isArray(f))for(var d=0,v=f.length;d<v;++d)f[d]in r||(i.push(f[d]),r[f[d]]=!0);else f in r||(i.push(f),r[f]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(a),i},e.prototype.updateElement_=function(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=this.collectSourceAttributions_(t),i=r.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Utt(r,this.renderedAttributions_)){Vtt(this.ulElement_);for(var a=0,o=r.length;a<o;++a){var s=document.createElement("li");s.innerHTML=r[a],this.ulElement_.appendChild(s)}this.renderedAttributions_=r}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(N8),this.collapsed_?k8(this.collapseLabel_,this.label_):k8(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(fz);const Pnt=Lnt;var Ont=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Rnt=function(n){Ont(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var a=i.className!==void 0?i.className:"ol-rotate",o=i.label!==void 0?i.label:"\u21E7",s=i.compassClassName!==void 0?i.compassClassName:"ol-compass";r.label_=null,typeof o=="string"?(r.label_=document.createElement("span"),r.label_.className=s,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(s));var l=i.tipLabel?i.tipLabel:"Reset rotation",u=document.createElement("button");u.className=a+"-reset",u.setAttribute("type","button"),u.title=l,u.appendChild(r.label_),u.addEventListener(zo.CLICK,r.handleClick_.bind(r),!1);var h=a+" "+QN+" "+uz,c=r.element;return c.className=h,c.appendChild(u),r.callResetNorth_=i.resetNorth?i.resetNorth:void 0,r.duration_=i.duration!==void 0?i.duration:250,r.autoHide_=i.autoHide!==void 0?i.autoHide:!0,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(LF),r}return e.prototype.handleClick_=function(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap(),r=t.getView();if(!!r){var i=r.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:wI}):r.setRotation(0))}},e.prototype.render=function(t){var r=t.frameState;if(!!r){var i=r.viewState.rotation;if(i!=this.rotation_){var a="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(LF);!o&&i===0?this.element.classList.add(LF):o&&i!==0&&this.element.classList.remove(LF)}this.label_.style.transform=a}this.rotation_=i}},e}(fz);const Dnt=Rnt;var Nnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),knt=function(n){Nnt(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),target:i.target})||this;var a=i.className!==void 0?i.className:"ol-zoom",o=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:a+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:a+"-out",u=i.zoomInLabel!==void 0?i.zoomInLabel:"+",h=i.zoomOutLabel!==void 0?i.zoomOutLabel:"\u2013",c=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",f=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof u=="string"?document.createTextNode(u):u),d.addEventListener(zo.CLICK,r.handleClick_.bind(r,o),!1);var v=document.createElement("button");v.className=l,v.setAttribute("type","button"),v.title=f,v.appendChild(typeof h=="string"?document.createTextNode(h):h),v.addEventListener(zo.CLICK,r.handleClick_.bind(r,-o),!1);var p=a+" "+QN+" "+uz,g=r.element;return g.className=p,g.appendChild(d),g.appendChild(v),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(t,r){r.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var r=this.getMap(),i=r.getView();if(!!i){var a=i.getZoom();if(a!==void 0){var o=i.getConstrainedZoom(a+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:wI})):i.setZoom(o)}}},e}(fz);const Fnt=knt;var VPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),BW=.75,NF=.1,Bnt=function(n){VPe(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createRenderer=function(){return new NPe(this)},e}(UPe),Gnt=function(n){VPe(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.boundHandleRotationChanged_=r.handleRotationChanged_.bind(r),r.collapsed_=i.collapsed!==void 0?i.collapsed:!0,r.collapsible_=i.collapsible!==void 0?i.collapsible:!0,r.collapsible_||(r.collapsed_=!1),r.rotateWithView_=i.rotateWithView!==void 0?i.rotateWithView:!1,r.viewExtent_=void 0;var a=i.className!==void 0?i.className:"ol-overviewmap",o=i.tipLabel!==void 0?i.tipLabel:"Overview map",s=i.collapseLabel!==void 0?i.collapseLabel:"\u2039";typeof s=="string"?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s):r.collapseLabel_=s;var l=i.label!==void 0?i.label:"\u203A";typeof l=="string"?(r.label_=document.createElement("span"),r.label_.textContent=l):r.label_=l;var u=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(u),h.addEventListener(zo.CLICK,r.handleClick_.bind(r),!1),r.ovmapDiv_=document.createElement("div"),r.ovmapDiv_.className="ol-overviewmap-map",r.view_=i.view,r.ovmap_=new Bnt({view:i.view});var c=r.ovmap_;i.layers&&i.layers.forEach(function(S){c.addLayer(S)});var f=document.createElement("div");f.className="ol-overviewmap-box",f.style.boxSizing="border-box",r.boxOverlay_=new $tt({position:[0,0],positioning:"center-center",element:f}),r.ovmap_.addOverlay(r.boxOverlay_);var d=a+" "+QN+" "+uz+(r.collapsed_&&r.collapsible_?" "+N8:"")+(r.collapsible_?"":" ol-uncollapsible"),v=r.element;v.className=d,v.appendChild(r.ovmapDiv_),v.appendChild(h);var p=r,g=r.boxOverlay_,m=r.boxOverlay_.getElement(),y=function(S){return{clientX:S.clientX,clientY:S.clientY}},_=function(S){var w=y(S),b=c.getEventCoordinateInternal(w);g.setPosition(b)},x=function(S){var w=c.getEventCoordinateInternal(S);p.getMap().getView().setCenterInternal(w),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",x)};return m.addEventListener("mousedown",function(){window.addEventListener("mousemove",_),window.addEventListener("mouseup",x)}),r}return e.prototype.setMap=function(t){var r=this.getMap();if(t!==r){if(r){var i=r.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(n.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(Ks(t,BR.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var a=t.getView();a&&(this.bindView_(a),a.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===Zu.VIEW){var r=t.oldValue;r&&this.unbindView_(r);var i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(t.key===Zu.TARGET||t.key===Zu.SIZE)&&this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var r=new Ay({projection:t.getProjection()});this.ovmap_.setView(r)}t.addChangeListener(Jd.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(Jd.ROTATION,this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),r=this.ovmap_;if(!(!t.isRendered()||!r.isRendered())){var i=t.getSize(),a=t.getView(),o=a.calculateExtentInternal(i);if(!(this.viewExtent_&&D8(o,this.viewExtent_))){this.viewExtent_=o;var s=r.getSize(),l=r.getView(),u=l.calculateExtentInternal(s),h=r.getPixelFromCoordinateInternal(e3(o)),c=r.getPixelFromCoordinateInternal(MPe(o)),f=Math.abs(h[0]-c[0]),d=Math.abs(h[1]-c[1]),v=s[0],p=s[1];f<v*NF||d<p*NF||f>v*BW||d>p*BW?this.resetExtent_():Wtt(u,o)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),r=this.ovmap_,i=t.getSize(),a=t.getView(),o=a.calculateExtentInternal(i),s=r.getView(),l=Math.log(BW/NF)/Math.LN2,u=1/(Math.pow(2,l/2)*NF);Htt(o,u),s.fitInternal(zZ(o))},e.prototype.recenter_=function(){var t=this.getMap(),r=this.ovmap_,i=t.getView(),a=r.getView();a.setCenterInternal(i.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),r=this.ovmap_;if(!(!t.isRendered()||!r.isRendered())){var i=t.getSize(),a=t.getView(),o=r.getView(),s=this.rotateWithView_?0:-a.getRotation(),l=this.boxOverlay_,u=this.boxOverlay_.getElement(),h=a.getCenterInternal(),c=a.getResolution(),f=o.getResolution(),d=i[0]*c/f,v=i[1]*c/f;if(l.setPosition(h),u){u.style.width=d+"px",u.style.height=v+"px";var p="rotate("+s+"rad)";u.style.transform=p}}},e.prototype.updateBoxAfterOvmapIsRendered_=function(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=jtt(this.ovmap_,d1.POSTRENDER,function(t){delete this.ovmapPostrenderKey_,this.updateBox_()},this))},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(N8),this.collapsed_?k8(this.collapseLabel_,this.label_):k8(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered()){this.viewExtent_=void 0,t.render();return}t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){!this.collapsible_||this.collapsed_===t||this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(fz);const znt=Gnt;function Unt(n){var e=n||{},t=new Jg,r=e.zoom!==void 0?e.zoom:!0;r&&t.push(new Fnt(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&t.push(new Dnt(e.rotateOptions));var a=e.attribution!==void 0?e.attribution:!0;return a&&t.push(new Pnt(e.attributionOptions)),t}const qZ={ACTIVE:"active"};var Vnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$nt=function(n){Vnt(e,n);function e(t){var r=n.call(this)||this;return r.on,r.once,r.un,t&&t.handleEvent&&(r.handleEvent=t.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(qZ.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(qZ.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(lz);function Wnt(n,e,t){var r=n.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:ynt,center:n.getConstrainedCenter(i)})}}function xne(n,e,t,r){var i=n.getZoom();if(i!==void 0){var a=n.getConstrainedZoom(i+e),o=n.getResolutionForZoom(a);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:r!==void 0?r:250,easing:wI})}}const r3=$nt;var Hnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jnt=function(n){Hnt(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Yo.DBLCLICK){var i=t.originalEvent,a=t.map,o=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=a.getView();xne(l,s,o,this.duration_),i.preventDefault(),r=!0}return!r},e}(r3);const Xnt=jnt;var Ynt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),qnt=function(n){Ynt(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Yo.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Yo.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Yo.POINTERDOWN){var a=this.handleDownEvent(t);this.handlingDownUpSequence=a,r=this.stopDown(a)}else t.type==Yo.POINTERMOVE&&this.handleMoveEvent(t);return!r},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(r3);function Sne(n){for(var e=n.length,t=0,r=0,i=0;i<e;i++)t+=n[i].clientX,r+=n[i].clientY;return[t/e,r/e]}const bI=qnt;function ZZ(n){var e=arguments;return function(t){for(var r=!0,i=0,a=e.length;i<a&&(r=r&&e[i](t),!!r);++i);return r}}var Znt=function(n){var e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Knt=function(n){var e=n.map.getTargetElement(),t=n.map.getOwnerDocument().activeElement;return e.contains(t)},$Pe=function(n){return n.map.getTargetElement().hasAttribute("tabindex")?Knt(n):!0},WPe=DA,HPe=function(n){var e=n.originalEvent;return e.button==0&&!(Xtt&&Ytt&&e.ctrlKey)},wne=function(n){var e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},jPe=function(n){var e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},XPe=function(n){var e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},GW=function(n){var e=n.originalEvent;return hc(e!==void 0,56),e.pointerType=="mouse"},Jnt=function(n){var e=n.originalEvent;return hc(e!==void 0,56),e.isPrimary&&e.button===0},Qnt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),eit=function(n){Qnt(e,n);function e(t){var r=n.call(this,{stopDown:t3})||this,i=t||{};r.kinetic_=i.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var a=i.condition?i.condition:ZZ(wne,Jnt);return r.condition_=i.onFocusOnly?ZZ($Pe,a):a,r.noKinetic_=!1,r}return e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var r=this.targetPointers,i=Sne(r);if(r.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var a=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],o=t.map,s=o.getView();qtt(a,s.getResolution()),une(a,s.getRotation()),s.adjustCenterInternal(a)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=r.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var r=t.map,i=r.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var a=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),s=i.getCenterInternal(),l=r.getPixelFromCoordinateInternal(s),u=r.getCoordinateFromPixelInternal([l[0]-a*Math.cos(o),l[1]-a*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(u),duration:500,easing:wI})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var r=t.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(bI);const tit=eit;var rit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),nit=function(n){rit(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,{stopDown:t3})||this,r.condition_=i.condition?i.condition:Znt,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){if(!!GW(t)){var r=t.map,i=r.getView();if(i.getConstraints().rotation!==_ne){var a=r.getSize(),o=t.pixel,s=Math.atan2(a[1]/2-o[1],o[0]-a[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(t){if(!GW(t))return!0;var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(t){if(!GW(t))return!1;if(HPe(t)&&this.condition_(t)){var r=t.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(bI);const iit=nit;var ait=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),oit=function(n){ait(e,n);function e(t){var r=n.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+t,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,r=this.endPixel_,i="px",a=this.element_.style;a.left=Math.min(t[0],r[0])+i,a.top=Math.min(t[1],r[1])+i,a.width=Math.abs(r[0]-t[0])+i,a.height=Math.abs(r[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,r){this.startPixel_=t,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,r=this.endPixel_,i=[t,[t[0],r[1]],r,[r[0],t[1]]],a=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);a[4]=a[0].slice(),this.geometry_?this.geometry_.setCoordinates([a]):this.geometry_=new cne([a])},e.prototype.getGeometry=function(){return this.geometry_},e}(wPe);const sit=oit;var YPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kF={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},zW=function(n){YPe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.coordinate=r,a.mapBrowserEvent=i,a}return e}(sz),lit=function(n){YPe(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=t||{};return r.box_=new sit(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:HPe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(t,r,i){var a=i[0]-r[0],o=i[1]-r[1];return a*a+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new zW(kF.BOXDRAG,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var r=this.boxEndCondition_(t,this.startPixel_,t.pixel);return r&&this.onBoxEnd(t),this.dispatchEvent(new zW(r?kF.BOXEND:kF.BOXCANCEL,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new zW(kF.BOXSTART,t.coordinate,t)),!0):!1},e.prototype.onBoxEnd=function(t){},e}(bI);const uit=lit;var hit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cit=function(n){hit(e,n);function e(t){var r=this,i=t||{},a=i.condition?i.condition:jPe;return r=n.call(this,{condition:a,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(t){var r=this.getMap(),i=r.getView(),a=this.getGeometry();if(this.out_){var o=i.rotatedExtentForGeometry(a),s=i.getResolutionForExtentInternal(o),l=i.getResolution()/s;a=a.clone(),a.scale(l*l)}i.fitInternal(a,{duration:this.duration_,easing:wI})},e}(uit);const fit=cit,$w={LEFT:37,UP:38,RIGHT:39,DOWN:40};var dit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),vit=function(n){dit(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.defaultCondition_=function(a){return wne(a)&&XPe(a)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==zo.KEYDOWN){var i=t.originalEvent,a=i.keyCode;if(this.condition_(t)&&(a==$w.DOWN||a==$w.LEFT||a==$w.RIGHT||a==$w.UP)){var o=t.map,s=o.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;a==$w.DOWN?h=-l:a==$w.LEFT?u=-l:a==$w.RIGHT?u=l:h=l;var c=[u,h];une(c,s.getRotation()),Wnt(s,c,this.duration_),i.preventDefault(),r=!0}}return!r},e}(r3);const pit=vit;var git=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),yit=function(n){git(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.condition_=i.condition?i.condition:XPe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==zo.KEYDOWN||t.type==zo.KEYPRESS){var i=t.originalEvent,a=i.charCode;if(this.condition_(t)&&(a=="+".charCodeAt(0)||a=="-".charCodeAt(0))){var o=t.map,s=a=="+".charCodeAt(0)?this.delta_:-this.delta_,l=o.getView();xne(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(r3);const mit=yit;var _it=function(){function n(e,t,r){this.decay_=e,this.minVelocity_=t,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return n.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},n.prototype.update=function(e,t){this.points_.push(e,t,Date.now())},n.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;for(var r=t-3;r>0&&this.points_[r+2]>e;)r-=3;var i=this.points_[t+2]-this.points_[r+2];if(i<1e3/60)return!1;var a=this.points_[t]-this.points_[r],o=this.points_[t+1]-this.points_[r+1];return this.angle_=Math.atan2(o,a),this.initialVelocity_=Math.sqrt(a*a+o*o)/i,this.initialVelocity_>this.minVelocity_},n.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},n.prototype.getAngle=function(){return this.angle_},n}();const xit=_it;var Sit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),UW={TRACKPAD:"trackpad",WHEEL:"wheel"},wit=function(n){Sit(e,n);function e(t){var r=this,i=t||{};r=n.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var a=i.condition?i.condition:WPe;return r.condition_=i.onFocusOnly?ZZ($Pe,a):a,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();if(!!t){var r=t.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var r=t.type;if(r!==zo.WHEEL)return!0;var i=t.map,a=t.originalEvent;a.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var o;if(t.type==zo.WHEEL&&(o=a.deltaY,Ztt&&a.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=APe),a.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?UW.TRACKPAD:UW.WHEEL);var l=i.getView();if(this.mode_===UW.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=o;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),u),!1},e.prototype.handleWheelZoom_=function(t){var r=t.getView();r.getAnimating()&&r.cancelAnimations();var i=-bv(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),xne(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(r3);const qPe=wit;var bit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Eit=function(n){bit(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=t3),r=n.call(this,a)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){var r=0,i=this.targetPointers[0],a=this.targetPointers[1],o=Math.atan2(a.clientY-i.clientY,a.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=o-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=o;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==_ne){var h=l.getViewport().getBoundingClientRect(),c=Sne(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(c),this.rotating_&&(l.render(),u.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(bI);const Tit=Eit;var Cit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ait=function(n){Cit(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=t3),r=n.call(this,a)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(t){var r=1,i=this.targetPointers[0],a=this.targetPointers[1],o=i.clientX-a.clientX,s=i.clientY-a.clientY,l=Math.sqrt(o*o+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();r!=1&&(this.lastScaleDelta_=r);var c=u.getViewport().getBoundingClientRect(),f=Sne(this.targetPointers);f[0]-=c.left,f[1]-=c.top,this.anchor_=u.getCoordinateFromPixelInternal(f),u.render(),h.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView(),a=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,a),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(bI);const Mit=Ait;var Iit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ZPe=function(n){Iit(e,n);function e(t,r,i){var a=n.call(this)||this;if(i!==void 0&&r===void 0)a.setFlatCoordinates(i,t);else{var o=r||0;a.setCenterAndRadius(t,o,i)}return a}return e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){var o=this.flatCoordinates,s=t-o[0],l=r-o[1],u=s*s+l*l;if(u<a){if(u===0)for(var h=0;h<this.stride;++h)i[h]=o[h];else{var c=this.getRadius()/Math.sqrt(u);i[0]=o[0]+c*s,i[1]=o[1]+c*l;for(var h=2;h<this.stride;++h)i[h]=o[h]}return i.length=this.stride,u}else return a},e.prototype.containsXY=function(t,r){var i=this.flatCoordinates,a=t-i[0],o=r-i[1];return a*a+o*o<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var r=this.flatCoordinates,i=r[this.stride]-r[0];return WZ(r[0]-i,r[1]-i,r[0]+i,r[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],r=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+r*r},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){var r=this.getExtent();if(fne(t,r)){var i=this.getCenter();return t[0]<=i[0]&&t[2]>=i[0]||t[1]<=i[1]&&t[3]>=i[1]?!0:IPe(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],a=t.slice();a[r]=a[0]+i;for(var o=1;o<r;++o)a[r+o]=t[o];this.setFlatCoordinates(this.layout,a),this.changed()},e.prototype.setCenterAndRadius=function(t,r,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var a=this.flatCoordinates,o=Ktt(a,0,t,this.stride);a[o++]=a[0]+r;for(var s=1,l=this.stride;s<l;++s)a[o++]=a[s];a.length=o,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,r){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,r){var i=this.getCenter(),a=this.getStride();this.setCenter(Jtt(i,0,i.length,a,t,r,i)),this.changed()},e.prototype.translate=function(t,r){var i=this.getCenter(),a=this.getStride();this.setCenter(Qtt(i,0,i.length,a,t,r,i)),this.changed()},e}(ert);ZPe.prototype.transform;const Lit=ZPe;var KPe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),xo={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},FF={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"},BF=function(n){KPe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.feature=r,i}return e}(sz),Pit=function(n){KPe(e,n);function e(t){var r=this,i=t;i.stopDown||(i.stopDown=t3),r=n.call(this,i)||this,r.on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=t.source?t.source:null,r.features_=t.features?t.features:null,r.snapTolerance_=t.snapTolerance?t.snapTolerance:12,r.type_=t.type,r.mode_=Rit(r.type_),r.stopClick_=!!t.stopClick,r.minPoints_=t.minPoints?t.minPoints:r.mode_===xo.POLYGON?3:2,r.maxPoints_=r.mode_===xo.CIRCLE?2:t.maxPoints?t.maxPoints:1/0,r.finishCondition_=t.finishCondition?t.finishCondition:DA,r.geometryLayout_=t.geometryLayout?t.geometryLayout:trt.XY;var a=t.geometryFunction;if(!a){var o=r.mode_;if(o===xo.CIRCLE)a=function(l,u,h){var c=u||new Lit([NaN,NaN]),f=Bg(l[0]),d=rrt(f,Bg(l[l.length-1]));return c.setCenterAndRadius(f,Math.sqrt(d),this.geometryLayout_),c};else{var s;o===xo.POINT?s=Qb:o===xo.LINE_STRING?s=rB:o===xo.POLYGON&&(s=cne),a=function(l,u,h){return u?o===xo.POLYGON?l[0].length?u.setCoordinates([l[0].concat([l[0][0]])],this.geometryLayout_):u.setCoordinates([],this.geometryLayout_):u.setCoordinates(l,this.geometryLayout_):u=new s(l,this.geometryLayout_),u}}}return r.geometryFunction_=a,r.dragVertexDelay_=t.dragVertexDelay!==void 0?t.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,r.overlay_=new sp({source:new Hx({useSpatialIndex:!1,wrapX:t.wrapX?t.wrapX:!1}),style:t.style?t.style:Oit(),updateWhileInteracting:!0}),r.geometryName_=t.geometryName,r.condition_=t.condition?t.condition:wne,r.freehandCondition_,t.freehand?r.freehandCondition_=WPe:r.freehandCondition_=t.freehandCondition?t.freehandCondition:jPe,r.addChangeListener(qZ.ACTIVE,r.updateState_),r}return e.prototype.setMap=function(t){n.prototype.setMap.call(this,t),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(t){t.originalEvent.type===zo.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_=this.mode_!==xo.POINT&&this.freehandCondition_(t);var r=t.type===Yo.POINTERMOVE,i=!0;if(!this.freehand_&&this.lastDragTime_&&t.type===Yo.POINTERDRAG){var a=Date.now();a-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&t.type===Yo.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===Yo.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=t.type===Yo.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):(t.originalEvent.pointerType==="mouse"||t.type===Yo.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(t)):t.type===Yo.DBLCLICK&&(i=!1),n.prototype.handleEvent.call(this,t)&&i},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new v1(Yo.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===xo.POINT)&&(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&t.preventDefault(),r},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=t.pixel,a=r[0]-i[0],o=r[1]-i[1],s=a*a+o*o;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var r=!1;if(this.sketchFeature_){var i=!1,a=[this.finishCoordinate_],o=this.mode_;if(o===xo.POINT)r=!0;else if(o===xo.CIRCLE)r=this.sketchCoords_.length===2;else if(o===xo.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(o===xo.POLYGON){var s=this.sketchCoords_;i=s[0].length>this.minPoints_,a=[s[0][0],s[0][s[0].length-2]]}if(i)for(var l=this.getMap(),u=0,h=a.length;u<h;u++){var c=a[u],f=l.getPixelFromCoordinate(c),d=t[0]-f[0],v=t[1]-f[1],p=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(d*d+v*v)<=p,r){this.finishCoordinate_=c;break}}}return r},e.prototype.createOrUpdateSketchPoint_=function(t){if(!this.sketchPoint_)this.sketchPoint_=new E1(new Qb(t)),this.updateSketchFeatures_();else{var r=this.sketchPoint_.getGeometry();r.setCoordinates(t)}},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new E1);var r=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(r.getLayout(),r.getFlatCoordinates()),i.changed()):(i=new rB(r.getFlatCoordinates(),r.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){for(var r=this.getMap().getView().getProjection(),i=Ade(this.geometryLayout_);t.length<i;)t.push(0);this.finishCoordinate_=t,this.mode_===xo.POINT?this.sketchCoords_=t.slice():this.mode_===xo.POLYGON?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new E1(new rB(this.sketchLineCoords_)));var a=this.geometryFunction_(this.sketchCoords_,void 0,r);this.sketchFeature_=new E1,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(a),this.updateSketchFeatures_(),this.dispatchEvent(new BF(FF.DRAWSTART,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var r=this.getMap(),i=this.sketchFeature_.getGeometry(),a=r.getView().getProjection(),o=Ade(this.geometryLayout_),s,l;t.length<o;)t.push(0);if(this.mode_===xo.POINT?l=this.sketchCoords_:this.mode_===xo.POLYGON?(s=this.sketchCoords_[0],l=s[s.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):(s=this.sketchCoords_,l=s[s.length-1]),l[0]=t[0],l[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,a),this.sketchPoint_){var u=this.sketchPoint_.getGeometry();u.setCoordinates(t)}if(i.getType()==="Polygon"&&this.mode_!==xo.POLYGON)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){var h=this.sketchLine_.getGeometry();h.setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),a,o,s=this.mode_;s===xo.LINE_STRING||s===xo.CIRCLE?(this.finishCoordinate_=t.slice(),o=this.sketchCoords_,o.length>=this.maxPoints_&&(this.freehand_?o.pop():a=!0),o.push(t.slice()),this.geometryFunction_(o,r,i)):s===xo.POLYGON&&(o=this.sketchCoords_[0],o.length>=this.maxPoints_&&(this.freehand_?o.pop():a=!0),o.push(t.slice()),a&&(this.finishCoordinate_=o[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),a&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(!!this.sketchFeature_){var t=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,a=this.mode_;if(a===xo.LINE_STRING||a===xo.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var o=this.finishCoordinate_.slice();i[i.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(i,t,r),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(a===xo.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var s=this.sketchLine_.getGeometry();if(i.length>=2){var o=i[i.length-2].slice();i[i.length-1]=o,this.createOrUpdateSketchPoint_(o)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,t,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(!!t){var r=this.sketchCoords_,i=t.getGeometry(),a=this.getMap().getView().getProjection();this.mode_===xo.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,a)):this.mode_===xo.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,a),r=i.getCoordinates()),this.type_==="MultiPoint"?t.setGeometry(new nrt([r])):this.type_==="MultiLineString"?t.setGeometry(new irt([r])):this.type_==="MultiPolygon"&&t.setGeometry(new art([r])),this.dispatchEvent(new BF(FF.DRAWEND,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new BF(FF.DRAWABORT,t))},e.prototype.appendCoordinates=function(t){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(t[0]);var a;if(r===xo.LINE_STRING||r===xo.CIRCLE)a=this.sketchCoords_;else if(r===xo.POLYGON)a=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&a.shift(),a.pop();for(var o=0;o<t.length;o++)this.addToDrawing_(t[o]);var s=t[t.length-1];this.addToDrawing_(s),this.modifyDrawing_(s)},e.prototype.extend=function(t){var r=t.getGeometry(),i=r;this.sketchFeature_=t,this.sketchCoords_=i.getCoordinates();var a=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=a.slice(),this.sketchCoords_.push(a.slice()),this.sketchPoint_=new E1(new Qb(a)),this.updateSketchFeatures_(),this.dispatchEvent(new BF(FF.DRAWSTART,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var r=this.overlay_.getSource();r.clear(!0),r.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),r=this.getActive();(!t||!r)&&this.abortDrawing(),this.overlay_.setMap(r?t:null)},e}(bI);function Oit(){var n=ort();return function(e,t){return n[e.getGeometry().getType()]}}function Rit(n){switch(n){case"Point":case"MultiPoint":return xo.POINT;case"LineString":case"MultiLineString":return xo.LINE_STRING;case"Polygon":case"MultiPolygon":return xo.POLYGON;case"Circle":return xo.CIRCLE;default:throw new Error("Invalid type: "+n)}}const zde=Pit;function JPe(n){var e=n||{},t=new Jg,r=new xit(-.005,.05,100),i=e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0;i&&t.push(new iit);var a=e.doubleClickZoom!==void 0?e.doubleClickZoom:!0;a&&t.push(new Xnt({delta:e.zoomDelta,duration:e.zoomDuration}));var o=e.dragPan!==void 0?e.dragPan:!0;o&&t.push(new tit({onFocusOnly:e.onFocusOnly,kinetic:r}));var s=e.pinchRotate!==void 0?e.pinchRotate:!0;s&&t.push(new Tit);var l=e.pinchZoom!==void 0?e.pinchZoom:!0;l&&t.push(new Mit({duration:e.zoomDuration}));var u=e.keyboard!==void 0?e.keyboard:!0;u&&(t.push(new pit),t.push(new mit({delta:e.zoomDelta,duration:e.zoomDuration})));var h=e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0;h&&t.push(new qPe({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration}));var c=e.shiftDragZoom!==void 0?e.shiftDragZoom:!0;return c&&t.push(new fit({duration:e.zoomDuration})),t}var Dit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Nit=function(n){Dit(e,n);function e(t){return t=Tp({},t),t.controls||(t.controls=Unt()),t.interactions||(t.interactions=JPe({onFocusOnly:!0})),n.call(this,t)||this}return e.prototype.createRenderer=function(){return new NPe(this)},e}(UPe);const kit=Nit,GF={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var Fit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Bit=function(n){Fit(e,n);function e(t){var r=this,i=t||{},a=Tp({},i);return delete a.preload,delete a.useInterimTilesOnError,r=n.call(this,a)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(GF.PRELOAD)},e.prototype.setPreload=function(t){this.set(GF.PRELOAD,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(GF.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(t){this.set(GF.USE_INTERIM_TILES_ON_ERROR,t)},e.prototype.getData=function(t){return n.prototype.getData.call(this,t)},e}(hne);const Git=Bit;var zit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Uit=function(n){zit(e,n);function e(t,r,i){var a=n.call(this)||this,o=i||{};return a.tileCoord=t,a.state=r,a.interimTile=null,a.key="",a.transition_=o.transition===void 0?250:o.transition,a.transitionStarts_={},a.interpolate=!!o.interpolate,a}return e.prototype.changed=function(){this.dispatchEvent(zo.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Hi.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,r=this;do{if(t.getState()==Hi.LOADED){t.interimTile=null;break}else t.getState()==Hi.LOADING?r=t:t.getState()==Hi.IDLE?r.interimTile=t.interimTile:r=t;t=r.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Hi.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){tB()},e.prototype.getAlpha=function(t,r){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(!i)i=r,this.transitionStarts_[t]=i;else if(i===-1)return 1;var a=r-i+1e3/60;return a>=this.transition_?1:BPe(a/this.transition_)},e.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(TPe);const QPe=Uit;var Vit=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$it=function(n){Vit(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,s)||this;return l.crossOrigin_=a,l.src_=i,l.key=i,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.tileLoadFunction_=o,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Hi.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Hi.ERROR,this.unlistenImage_(),this.image_=Wit(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Hi.LOADED:this.state=Hi.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Hi.ERROR&&(this.state=Hi.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Hi.IDLE&&(this.state=Hi.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=srt(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(QPe);function Wit(){var n=HZ(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Hit=$it;var jit=.5,Xit=10,Ude=.25,Yit=function(){function n(e,t,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;var s={},l=lrt(this.targetProj_,this.sourceProj_);this.transformInv_=function(_){var x=_[0]+"/"+_[1];return s[x]||(s[x]=l(_)),s[x]},this.maxSourceExtent_=i,this.errorThresholdSquared_=a*a,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&nv(i)==nv(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?nv(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?nv(this.targetProj_.getExtent()):null;var u=e3(r),h=urt(r),c=MPe(r),f=hrt(r),d=this.transformInv_(u),v=this.transformInv_(h),p=this.transformInv_(c),g=this.transformInv_(f),m=Xit+(o?Math.max(0,Math.ceil(crt(jZ(r)/(o*o*256*256)))):0);if(this.addQuad_(u,h,c,f,d,v,p,g,m),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(_,x,S){y=Math.min(y,_.source[0][0],_.source[1][0],_.source[2][0])}),this.triangles_.forEach(function(_){if(Math.max(_.source[0][0],_.source[1][0],_.source[2][0])-y>this.sourceWorldWidth_/2){var x=[[_.source[0][0],_.source[0][1]],[_.source[1][0],_.source[1][1]],[_.source[2][0],_.source[2][1]]];x[0][0]-y>this.sourceWorldWidth_/2&&(x[0][0]-=this.sourceWorldWidth_),x[1][0]-y>this.sourceWorldWidth_/2&&(x[1][0]-=this.sourceWorldWidth_),x[2][0]-y>this.sourceWorldWidth_/2&&(x[2][0]-=this.sourceWorldWidth_);var S=Math.min(x[0][0],x[1][0],x[2][0]),w=Math.max(x[0][0],x[1][0],x[2][0]);w-S<this.sourceWorldWidth_/2&&(_.source=x)}}.bind(this))}s={}}return n.prototype.addTriangle_=function(e,t,r,i,a,o){this.triangles_.push({source:[i,a,o],target:[e,t,r]})},n.prototype.addQuad_=function(e,t,r,i,a,o,s,l,u){var h=Mde([a,o,s,l]),c=this.sourceWorldWidth_?nv(h)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&c>.5&&c<1,v=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var p=Mde([e,t,r,i]),g=nv(p)/this.targetWorldWidth_;v=g>Ude||v}!d&&this.sourceProj_.isGlobal()&&c&&(v=c>Ude||v)}if(!(!v&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!fne(h,this.maxSourceExtent_))){var m=0;if(!v&&(!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)v=!0;else if(m=(!isFinite(a[0])||!isFinite(a[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!v){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],_=this.transformInv_(y),x=void 0;if(d){var S=(UO(a[0],f)+UO(s[0],f))/2;x=S-UO(_[0],f)}else x=(a[0]+s[0])/2-_[0];var w=(a[1]+s[1])/2-_[1],b=x*x+w*w;v=b>this.errorThresholdSquared_}if(v){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var E=[(t[0]+r[0])/2,(t[1]+r[1])/2],T=this.transformInv_(E),C=[(i[0]+e[0])/2,(i[1]+e[1])/2],A=this.transformInv_(C);this.addQuad_(e,t,E,C,a,o,T,A,u-1),this.addQuad_(C,E,r,i,A,T,s,l,u-1)}else{var M=[(e[0]+t[0])/2,(e[1]+t[1])/2],I=this.transformInv_(M),R=[(r[0]+i[0])/2,(r[1]+i[1])/2],k=this.transformInv_(R);this.addQuad_(e,M,R,i,a,I,k,l,u-1),this.addQuad_(M,t,r,R,I,o,s,k,u-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(e,r,i,a,s,l),(m&14)==0&&this.addTriangle_(e,r,t,a,s,o),m&&((m&13)==0&&this.addTriangle_(t,i,e,o,l,a),(m&7)==0&&this.addTriangle_(t,i,r,o,l,s))}},n.prototype.calculateSourceExtent=function(){var e=dne();return this.triangles_.forEach(function(t,r,i){var a=t.source;RW(e,a[0]),RW(e,a[1]),RW(e,a[2])}),e},n.prototype.getTriangles=function(){return this.triangles_},n}();const qit=Yit;var KZ={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Zit={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},VW,eOe=[];function Vde(n,e,t,r,i){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(r,i),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,r)+1,Math.max(t,i)),n.restore()}function $W(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function Kit(){if(VW===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Vde(n,4,5,4,0),Vde(n,4,5,0,5);var e=n.getImageData(0,0,3,3).data;VW=$W(e,0)||$W(e,4)||$W(e,8)}return VW}function $de(n,e,t,r){var i=lA(t,e,n),a=Ide(e,r,t),o=e.getMetersPerUnit();o!==void 0&&(a*=o);var s=n.getMetersPerUnit();s!==void 0&&(a/=s);var l=n.getExtent();if(!l||LPe(l,i)){var u=Ide(n,a,i)/a;isFinite(u)&&u>0&&(a/=u)}return a}function Jit(n,e,t,r){var i=UZ(t),a=$de(n,e,i,r);return(!isFinite(a)||a<=0)&&IPe(t,function(o){return a=$de(n,e,o,r),isFinite(a)&&a>0}),a}function Qit(n,e,t,r,i,a,o,s,l,u,h,c){var f=HZ(Math.round(t*n),Math.round(t*e),eOe);if(c||Tp(f,KZ),l.length===0)return f.canvas;f.scale(t,t);function d(x){return Math.round(x*t)/t}f.globalCompositeOperation="lighter";var v=dne();l.forEach(function(x,S,w){frt(v,x.extent)});var p=nv(v),g=hM(v),m=HZ(Math.round(t*p/r),Math.round(t*g/r));c||Tp(m,KZ);var y=t/r;l.forEach(function(x,S,w){var b=x.extent[0]-v[0],E=-(x.extent[3]-v[3]),T=nv(x.extent),C=hM(x.extent);x.image.width>0&&x.image.height>0&&m.drawImage(x.image,u,u,x.image.width-2*u,x.image.height-2*u,b*y,E*y,T*y,C*y)});var _=e3(o);return s.getTriangles().forEach(function(x,S,w){var b=x.source,E=x.target,T=b[0][0],C=b[0][1],A=b[1][0],M=b[1][1],I=b[2][0],R=b[2][1],k=d((E[0][0]-_[0])/a),D=d(-(E[0][1]-_[1])/a),G=d((E[1][0]-_[0])/a),W=d(-(E[1][1]-_[1])/a),z=d((E[2][0]-_[0])/a),V=d(-(E[2][1]-_[1])/a),q=T,Y=C;T=0,C=0,A-=q,M-=Y,I-=q,R-=Y;var le=[[A,M,0,0,G-k],[I,R,0,0,z-k],[0,0,A,M,W-D],[0,0,I,R,V-D]],j=drt(le);if(!!j){if(f.save(),f.beginPath(),Kit()||!c){f.moveTo(G,W);for(var Q=4,ie=k-G,oe=D-W,se=0;se<Q;se++)f.lineTo(G+d((se+1)*ie/Q),W+d(se*oe/(Q-1))),se!=Q-1&&f.lineTo(G+d((se+1)*ie/Q),W+d((se+1)*oe/(Q-1)));f.lineTo(z,V)}else f.moveTo(G,W),f.lineTo(k,D),f.lineTo(z,V);f.clip(),f.transform(j[0],j[2],j[1],j[3],k,D),f.translate(v[0]-q,v[3]-Y),f.scale(r/t,-r/t),f.drawImage(m.canvas,0,0),f.restore()}}),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,s.getTriangles().forEach(function(x,S,w){var b=x.target,E=(b[0][0]-_[0])/a,T=-(b[0][1]-_[1])/a,C=(b[1][0]-_[0])/a,A=-(b[1][1]-_[1])/a,M=(b[2][0]-_[0])/a,I=-(b[2][1]-_[1])/a;f.beginPath(),f.moveTo(C,A),f.lineTo(E,T),f.lineTo(M,I),f.closePath(),f.stroke()}),f.restore()),f.canvas}var eat=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),tat=function(n){eat(e,n);function e(t,r,i,a,o,s,l,u,h,c,f,d){var v=n.call(this,o,Hi.IDLE,{interpolate:!!d})||this;v.renderEdges_=f!==void 0?f:!1,v.pixelRatio_=l,v.gutter_=u,v.canvas_=null,v.sourceTileGrid_=r,v.targetTileGrid_=a,v.wrappedTileCoord_=s||o,v.sourceTiles_=[],v.sourcesListenerKeys_=null,v.sourceZ_=0;var p=a.getTileCoordExtent(v.wrappedTileCoord_),g=v.targetTileGrid_.getExtent(),m=v.sourceTileGrid_.getExtent(),y=g?zO(p,g):p;if(jZ(y)===0)return v.state=Hi.EMPTY,v;var _=t.getExtent();_&&(m?m=zO(m,_):m=_);var x=a.getResolution(v.wrappedTileCoord_[0]),S=Jit(t,i,y,x);if(!isFinite(S)||S<=0)return v.state=Hi.EMPTY,v;var w=c!==void 0?c:jit;if(v.triangulation_=new qit(t,i,y,m,S*w,x),v.triangulation_.getTriangles().length===0)return v.state=Hi.EMPTY,v;v.sourceZ_=r.getZForResolution(S);var b=v.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(b[1]=bv(b[1],m[1],m[3]),b[3]=bv(b[3],m[1],m[3])):b=zO(b,m)),!jZ(b))v.state=Hi.EMPTY;else{for(var E=r.getTileRangeForExtentAndZ(b,v.sourceZ_),T=E.minX;T<=E.maxX;T++)for(var C=E.minY;C<=E.maxY;C++){var A=h(v.sourceZ_,T,C,l);A&&v.sourceTiles_.push(A)}v.sourceTiles_.length===0&&(v.state=Hi.EMPTY)}return v}return e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(h,c,f){h&&h.getState()==Hi.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(h.tileCoord),image:h.getImage()})}.bind(this)),this.sourceTiles_.length=0,t.length===0)this.state=Hi.ERROR;else{var r=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(r),a=typeof i=="number"?i:i[0],o=typeof i=="number"?i:i[1],s=this.targetTileGrid_.getResolution(r),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Qit(a,o,this.pixelRatio_,l,this.sourceTileGrid_.getExtent(),s,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Hi.LOADED}this.changed()},e.prototype.load=function(){if(this.state==Hi.IDLE){this.state=Hi.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(r,i,a){var o=r.getState();if(o==Hi.IDLE||o==Hi.LOADING){t++;var s=Ks(r,zo.CHANGE,function(l){var u=r.getState();(u==Hi.LOADED||u==Hi.ERROR||u==Hi.EMPTY)&&(Pf(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(s)}}.bind(this)),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(r,i,a){var o=r.getState();o==Hi.IDLE&&r.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Pf),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(vrt(this.canvas_.getContext("2d")),eOe.push(this.canvas_),this.canvas_=null),n.prototype.release.call(this)},e}(QPe);const rat=tat;var tOe=function(){function n(e,t,r,i){this.minX=e,this.maxX=t,this.minY=r,this.maxY=i}return n.prototype.contains=function(e){return this.containsXY(e[1],e[2])},n.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},n.prototype.containsXY=function(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY},n.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},n.prototype.extend=function(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},n}();function GT(n,e,t,r,i){return i!==void 0?(i.minX=n,i.maxX=e,i.minY=t,i.maxY=r,i):new tOe(n,e,t,r)}const rOe=tOe;var nat=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),iat=function(n){nat(e,n);function e(t){var r=n.call(this,t)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=dne(),r.tmpTileRange_=new rOe(0,0,0,0),r}return e.prototype.isDrawableTile=function(t){var r=this.getLayer(),i=t.getState(),a=r.getUseInterimTilesOnError();return i==Hi.LOADED||i==Hi.EMPTY||i==Hi.ERROR&&!a},e.prototype.getTile=function(t,r,i,a){var o=a.pixelRatio,s=a.viewState.projection,l=this.getLayer(),u=l.getSource(),h=u.getTile(t,r,i,o,s);return h.getState()==Hi.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):h.setState(Hi.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},e.prototype.getData=function(t){var r=this.frameState;if(!r)return null;var i=this.getLayer(),a=R8(r.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!LPe(o,a))return null;for(var s=r.pixelRatio,l=r.viewState.projection,u=r.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(u.projection),f=h.getTilePixelRatio(r.pixelRatio),d=c.getZForResolution(u.resolution);d>=c.getMinZoom();--d){var v=c.getTileCoordForCoordAndZ(a,d),p=h.getTile(d,v[1],v[2],s,l);if(!(p instanceof Hit||p instanceof rat))return null;if(p.getState()===Hi.LOADED){var g=c.getOrigin(d),m=NC(c.getTileSize(d)),y=c.getResolution(d),_=Math.floor(f*((a[0]-g[0])/y-v[1]*m[0])),x=Math.floor(f*((g[1]-a[1])/y-v[2]*m[1])),S=Math.round(f*h.getGutterForProjection(u.projection));return this.getImageData(p.getImage(),_+S,x+S)}}return null},e.prototype.loadedTileCallback=function(t,r,i){return this.isDrawableTile(i)?n.prototype.loadedTileCallback.call(this,t,r,i):!1},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,r){var i=t.layerStatesArray[t.layerIndex],a=t.viewState,o=a.projection,s=a.resolution,l=a.center,u=a.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),d=f.getRevision(),v=f.getTileGridForProjection(o),p=v.getZForResolution(s,f.zDirection),g=v.getResolution(p),m=t.extent,y=t.viewState.resolution,_=f.getTilePixelRatio(h),x=Math.round(nv(m)/y*h),S=Math.round(hM(m)/y*h),w=i.extent&&sA(i.extent);w&&(m=zO(m,sA(i.extent)));var b=g*x/2/_,E=g*S/2/_,T=[l[0]-b,l[1]-E,l[0]+b,l[1]+E],C=v.getTileRangeForExtentAndZ(m,p),A={};A[p]={};var M=this.createLoadedTileFinder(f,o,A),I=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var k=u?Lde(a.center,y,u,t.size):void 0,D=C.minX;D<=C.maxX;++D)for(var G=C.minY;G<=C.maxY;++G)if(!(u&&!v.tileCoordIntersectsViewport([p,D,G],k))){var W=this.getTile(p,D,G,t);if(this.isDrawableTile(W)){var z=_1(this);if(W.getState()==Hi.LOADED){A[p][W.tileCoord.toString()]=W;var V=W.inTransition(z);V&&i.opacity!==1&&(W.endTransition(z),V=!1),!this.newTiles_&&(V||this.renderedTiles.indexOf(W)===-1)&&(this.newTiles_=!0)}if(W.getAlpha(z,t.time)===1)continue}var q=v.getTileCoordChildTileRange(W.tileCoord,R,I),Y=!1;q&&(Y=M(p+1,q)),Y||v.forEachTileCoordParentTileRange(W.tileCoord,M,R,I)}var le=g/s*h/_;FZ(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,u,-x/2,-S/2);var j=prt(this.pixelTransform);this.useContainer(r,j,this.getBackground(t));var Q=this.context,ie=Q.canvas;xPe(this.inversePixelTransform,this.pixelTransform),FZ(this.tempTransform,x/2,S/2,le,le,0,-x/2,-S/2),ie.width!=x||ie.height!=S?(ie.width=x,ie.height=S):this.containerReused||Q.clearRect(0,0,x,S),w&&this.clipUnrotated(Q,t,w),f.getInterpolate()||Tp(Q,KZ),this.preRender(Q,t),this.renderedTiles.length=0;var oe=Object.keys(A).map(Number);oe.sort(grt);var se,me,Ce;i.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?oe=oe.reverse():(se=[],me=[]);for(var Le=oe.length-1;Le>=0;--Le){var re=oe[Le],yt=f.getTilePixelSize(re,h,o),je=v.getResolution(re),st=je/g,Nt=yt[0]*st*le,Zt=yt[1]*st*le,qe=v.getTileCoordForCoordAndZ(e3(T),re),ur=v.getTileCoordExtent(qe),Dt=R8(this.tempTransform,[_*(ur[0]-T[0])/g,_*(T[3]-ur[3])/g]),ft=_*f.getGutterForProjection(o),Oe=A[re];for(var J in Oe){var W=Oe[J],We=W.tileCoord,Tt=qe[1]-We[1],Qe=Math.round(Dt[0]-(Tt-1)*Nt),zt=qe[2]-We[2],mt=Math.round(Dt[1]-(zt-1)*Zt),D=Math.round(Dt[0]-Tt*Nt),G=Math.round(Dt[1]-zt*Zt),wt=Qe-D,pt=mt-G,ar=p===re,V=ar&&W.getAlpha(_1(this),t.time)!==1,kt=!1;if(!V)if(se){Ce=[D,G,D+wt,G,D+wt,G+pt,D,G+pt];for(var Dr=0,Sr=se.length;Dr<Sr;++Dr)if(p!==re&&re<me[Dr]){var jr=se[Dr];fne([D,G,D+wt,G+pt],[jr[0],jr[3],jr[4],jr[7]])&&(kt||(Q.save(),kt=!0),Q.beginPath(),Q.moveTo(Ce[0],Ce[1]),Q.lineTo(Ce[2],Ce[3]),Q.lineTo(Ce[4],Ce[5]),Q.lineTo(Ce[6],Ce[7]),Q.moveTo(jr[6],jr[7]),Q.lineTo(jr[4],jr[5]),Q.lineTo(jr[2],jr[3]),Q.lineTo(jr[0],jr[1]),Q.clip())}se.push(Ce),me.push(re)}else Q.clearRect(D,G,wt,pt);this.drawTileImage(W,t,D,G,wt,pt,ft,ar),se&&!V?(kt&&Q.restore(),this.renderedTiles.unshift(W)):this.renderedTiles.push(W),this.updateUsedTiles(t.usedTiles,f,W)}}return this.renderedRevision=d,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!D8(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=h,this.renderedProjection=o,this.manageTilePyramid(t,f,v,h,o,m,p,c.getPreload()),this.scheduleExpireCache(t,f),this.postRender(Q,t),i.extent&&Q.restore(),Tp(Q,Zit),j!==ie.style.transform&&(ie.style.transform=j),this.container},e.prototype.drawTileImage=function(t,r,i,a,o,s,l,u){var h=this.getTileImage(t);if(!!h){var c=_1(this),f=r.layerStatesArray[r.layerIndex],d=f.opacity*(u?t.getAlpha(c,r.time):1),v=d!==this.context.globalAlpha;v&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(h,l,l,h.width-2*l,h.height-2*l,i,a,o,s),v&&this.context.restore(),d!==f.opacity?r.animate=!0:u&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,r){if(r.canExpireCache()){var i=function(a,o,s){var l=_1(a);l in s.usedTiles&&a.expireCache(s.viewState.projection,s.usedTiles[l])}.bind(null,r);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,r,i){var a=_1(r);a in t||(t[a]={}),t[a][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,r,i,a,o,s,l,u,h){var c=_1(r);c in t.wantedTiles||(t.wantedTiles[c]={});var f=t.wantedTiles[c],d=t.tileQueue,v=i.getMinZoom(),p=t.viewState.rotation,g=p?Lde(t.viewState.center,t.viewState.resolution,p,t.size):void 0,m=0,y,_,x,S,w,b;for(b=v;b<=l;++b)for(_=i.getTileRangeForExtentAndZ(s,b,_),x=i.getResolution(b),S=_.minX;S<=_.maxX;++S)for(w=_.minY;w<=_.maxY;++w)p&&!i.tileCoordIntersectsViewport([b,S,w],g)||(l-b<=u?(++m,y=r.getTile(b,S,w,a,o),y.getState()==Hi.IDLE&&(f[y.getKey()]=!0,d.isKeyQueued(y.getKey())||d.enqueue([y,c,i.getTileCoordCenter(y.tileCoord),x])),h!==void 0&&h(y)):r.useTile(b,S,w,o));r.updateCacheSize(m,o)},e}(yrt);const aat=iat;var oat=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),sat=function(n){oat(e,n);function e(t){return n.call(this,t)||this}return e.prototype.createRenderer=function(){return new aat(this)},e}(Git);const Wde=sat;function Hde(n,e,t,r){return r!==void 0?(r[0]=n,r[1]=e,r[2]=t,r):[n,e,t]}var lat=[0,0,0],tx=5,uat=function(){function n(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,hc(mrt(this.resolutions_,function(o,s){return s-o},!0),17);var t;if(!e.origins){for(var r=0,i=this.resolutions_.length-1;r<i;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,hc(this.origins_.length==this.resolutions_.length,20));var a=e.extent;a!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=e3(a)),hc(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,hc(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:FPe,hc(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=a!==void 0?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(o,s){var l=new rOe(Math.min(0,o[0]),Math.max(o[0]-1,-1),Math.min(0,o[1]),Math.max(o[1]-1,-1));if(a){var u=this.getTileRangeForExtentAndZ(a,s);l.minX=Math.max(u.minX,l.minX),l.maxX=Math.min(u.maxX,l.maxX),l.minY=Math.max(u.minY,l.minY),l.maxY=Math.min(u.maxY,l.maxY)}return l},this):a&&this.calculateTileRanges_(a)}return n.prototype.forEachTileCoord=function(e,t,r){for(var i=this.getTileRangeForExtentAndZ(e,t),a=i.minX,o=i.maxX;a<=o;++a)for(var s=i.minY,l=i.maxY;s<=l;++s)r([t,a,s])},n.prototype.forEachTileCoordParentTileRange=function(e,t,r,i){var a,o,s,l=null,u=e[0]-1;for(this.zoomFactor_===2?(o=e[1],s=e[2]):l=this.getTileCoordExtent(e,i);u>=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),s=Math.floor(s/2),a=GT(o,o,s,s,r)):a=this.getTileRangeForExtentAndZ(l,u,r),t(u,a))return!0;--u}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},n.prototype.getResolution=function(e){return this.resolutions_[e]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(e,t,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){var i=e[1]*2,a=e[2]*2;return GT(i,i+1,a,a+1,t)}var o=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e[0]+1,t)}return null},n.prototype.getTileRangeForTileCoordAndZ=function(e,t,r){if(t>this.maxZoom||t<this.minZoom)return null;var i=e[0],a=e[1],o=e[2];if(t===i)return GT(a,o,a,o,r);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,t-i),l=Math.floor(a*s),u=Math.floor(o*s);if(t<i)return GT(l,l,u,u,r);var h=Math.floor(s*(a+1))-1,c=Math.floor(s*(o+1))-1;return GT(l,h,u,c,r)}var f=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(f,t,r)},n.prototype.getTileRangeExtent=function(e,t,r){var i=this.getOrigin(e),a=this.getResolution(e),o=NC(this.getTileSize(e),this.tmpSize_),s=i[0]+t.minX*o[0]*a,l=i[0]+(t.maxX+1)*o[0]*a,u=i[1]+t.minY*o[1]*a,h=i[1]+(t.maxY+1)*o[1]*a;return WZ(s,u,l,h,r)},n.prototype.getTileRangeForExtentAndZ=function(e,t,r){var i=lat;this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,i);var a=i[1],o=i[2];return this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,i),GT(a,i[1],o,i[2],r)},n.prototype.getTileCoordCenter=function(e){var t=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=NC(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*i[0]*r,t[1]-(e[2]+.5)*i[1]*r]},n.prototype.getTileCoordExtent=function(e,t){var r=this.getOrigin(e[0]),i=this.getResolution(e[0]),a=NC(this.getTileSize(e[0]),this.tmpSize_),o=r[0]+e[1]*a[0]*i,s=r[1]-(e[2]+1)*a[1]*i,l=o+a[0]*i,u=s+a[1]*i;return WZ(o,s,l,u,t)},n.prototype.getTileCoordForCoordAndResolution=function(e,t,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,r)},n.prototype.getTileCoordForXYAndResolution_=function(e,t,r,i,a){var o=this.getZForResolution(r),s=r/this.getResolution(o),l=this.getOrigin(o),u=NC(this.getTileSize(o),this.tmpSize_),h=s*(e-l[0])/r/u[0],c=s*(l[1]-t)/r/u[1];return i?(h=PF(h,tx)-1,c=PF(c,tx)-1):(h=OF(h,tx),c=OF(c,tx)),Hde(o,h,c,a)},n.prototype.getTileCoordForXYAndZ_=function(e,t,r,i,a){var o=this.getOrigin(r),s=this.getResolution(r),l=NC(this.getTileSize(r),this.tmpSize_),u=(e-o[0])/s/l[0],h=(o[1]-t)/s/l[1];return i?(u=PF(u,tx)-1,h=PF(h,tx)-1):(u=OF(u,tx),h=OF(h,tx)),Hde(r,u,h,a)},n.prototype.getTileCoordForCoordAndZ=function(e,t,r){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,r)},n.prototype.getTileCoordResolution=function(e){return this.resolutions_[e[0]]},n.prototype.getTileSize=function(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]},n.prototype.getFullTileRange=function(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null},n.prototype.getZForResolution=function(e,t){var r=sne(this.resolutions_,e,t||0);return bv(r,this.minZoom,this.maxZoom)},n.prototype.tileCoordIntersectsViewport=function(e,t){return _rt(t,0,t.length,2,this.getTileCoordExtent(e))},n.prototype.calculateTileRanges_=function(e){for(var t=this.resolutions_.length,r=new Array(t),i=this.minZoom;i<t;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r},n}();const hat=uat;var ae=window.SuperMap=window.SuperMap||{};ae.Components=window.SuperMap.Components||{};var Ni={GEOJSON:"GEOJSON",ISERVER:"ISERVER",FGB:"FGB"},KP={ISERVER:"ISERVER",IPORTAL:"IPORTAL",ONLINE:"ONLINE"},Lc={LINE:"LINE",LINEM:"LINEM",POINT:"POINT",REGION:"REGION",POINTEPS:"POINTEPS",LINEEPS:"LINEEPS",REGIONEPS:"REGIONEPS",ELLIPSE:"ELLIPSE",CIRCLE:"CIRCLE",TEXT:"TEXT",RECTANGLE:"RECTANGLE",UNKNOWN:"UNKNOWN",GEOCOMPOUND:"GEOCOMPOUND"},dz={ATTRIBUTE:"ATTRIBUTE",ATTRIBUTEANDGEOMETRY:"ATTRIBUTEANDGEOMETRY",GEOMETRY:"GEOMETRY"},cat={INNERJOIN:"INNERJOIN",LEFTJOIN:"LEFTJOIN"},n3={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"},fat={CONTAIN:"CONTAIN",INTERSECT:"INTERSECT",WITHIN:"WITHIN"},JZ={DISTANCE:"DISTANCE",AREA:"AREA"},Wl={METER:"METER",KILOMETER:"KILOMETER",MILE:"MILE",YARD:"YARD",DEGREE:"DEGREE",MILLIMETER:"MILLIMETER",CENTIMETER:"CENTIMETER",INCH:"INCH",DECIMETER:"DECIMETER",FOOT:"FOOT",SECOND:"SECOND",MINUTE:"MINUTE",RADIAN:"RADIAN"},nOe={CENTIMETER:"CENTIMETER",DECIMETER:"DECIMETER",FOOT:"FOOT",INCH:"INCH",KILOMETER:"KILOMETER",METER:"METER",MILE:"MILE",MILLIMETER:"MILLIMETER",YARD:"YARD"},dat={IMAGEPLUGINS:"IMAGEPLUGINS",OGC:"OGC",ORACLEPLUS:"ORACLEPLUS",SDBPLUS:"SDBPLUS",SQLPLUS:"SQLPLUS",UDB:"UDB"},iOe={CAPTION:"CAPTION",CAPTION_PERCENT:"CAPTION_PERCENT",CAPTION_VALUE:"CAPTION_VALUE",PERCENT:"PERCENT",VALUE:"VALUE"},aOe={AREA:"AREA",BAR:"BAR",BAR3D:"BAR3D",LINE:"LINE",PIE:"PIE",PIE3D:"PIE3D",POINT:"POINT",RING:"RING",ROSE:"ROSE",ROSE3D:"ROSE3D",STACK_BAR:"STACK_BAR",STACK_BAR3D:"STACK_BAR3D",STEP:"STEP"},oOe={ALL:"ALL",NONE:"NONE",YAXES:"YAXES"},B8={CONSTANT:"CONSTANT",LOGARITHM:"LOGARITHM",SQUAREROOT:"SQUAREROOT"},vz={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"},vat={DOTDENSITY:"DOTDENSITY",GRADUATEDSYMBOL:"GRADUATEDSYMBOL",GRAPH:"GRAPH",LABEL:"LABEL",RANGE:"RANGE",UNIQUE:"UNIQUE"},i3={BLACK_WHITE:"BLACKWHITE",BLUE_BLACK:"BLUEBLACK",BLUE_RED:"BLUERED",BLUE_WHITE:"BLUEWHITE",CYAN_BLACK:"CYANBLACK",CYAN_BLUE:"CYANBLUE",CYAN_GREEN:"CYANGREEN",CYAN_WHITE:"CYANWHITE",GREEN_BLACK:"GREENBLACK",GREEN_BLUE:"GREENBLUE",GREEN_ORANGE_VIOLET:"GREENORANGEVIOLET",GREEN_RED:"GREENRED",GREEN_WHITE:"GREENWHITE",PINK_BLACK:"PINKBLACK",PINK_BLUE:"PINKBLUE",PINK_RED:"PINKRED",PINK_WHITE:"PINKWHITE",RAIN_BOW:"RAINBOW",RED_BLACK:"REDBLACK",RED_WHITE:"REDWHITE",SPECTRUM:"SPECTRUM",TERRAIN:"TERRAIN",YELLOW_BLACK:"YELLOWBLACK",YELLOW_BLUE:"YELLOWBLUE",YELLOW_GREEN:"YELLOWGREEN",YELLOW_RED:"YELLOWRED",YELLOW_WHITE:"YELLOWWHITE"},sOe={TOPLEFT:"TOPLEFT",TOPCENTER:"TOPCENTER",TOPRIGHT:"TOPRIGHT",BASELINELEFT:"BASELINELEFT",BASELINECENTER:"BASELINECENTER",BASELINERIGHT:"BASELINERIGHT",BOTTOMLEFT:"BOTTOMLEFT",BOTTOMCENTER:"BOTTOMCENTER",BOTTOMRIGHT:"BOTTOMRIGHT",MIDDLELEFT:"MIDDLELEFT",MIDDLECENTER:"MIDDLECENTER",MIDDLERIGHT:"MIDDLERIGHT"},pat={NONE:"NONE",LINEAR:"LINEAR",RADIAL:"RADIAL",CONICAL:"CONICAL",SQUARE:"SQUARE"},lOe={NORMAL:"ALONG_LINE_NORMAL",LB_TO_RT:"LEFT_BOTTOM_TO_RIGHT_TOP",LT_TO_RB:"LEFT_TOP_TO_RIGHT_BOTTOM",RB_TO_LT:"RIGHT_BOTTOM_TO_LEFT_TOP",RT_TO_LB:"RIGHT_TOP_TO_LEFT_BOTTOM"},uOe={DIAMOND:"DIAMOND",ELLIPSE:"ELLIPSE",MARKER:"MARKER",NONE:"NONE",RECT:"RECT",ROUNDRECT:"ROUNDRECT",TRIANGLE:"TRIANGLE"},hOe={NEWLINE:"NEWLINE",NONE:"NONE",OMIT:"OMIT"},gat={EAST:"EAST",NONE:"NONE",NORTH:"NORTH",SOURTH:"SOURTH",WEST:"WEST"},yat={LEFT:"LEFT",MIDDLE:"MIDDLE",NONE:"NONE",RIGHT:"RIGHT"},mat={FIXEDCENTER:"FIXEDCENTER",NULL:"NULL",OPTIONALCENTER:"OPTIONALCENTER"},_at={AHEAD:"AHEAD",BACK:"BACK",END:"END",LEFT:"LEFT",NONE:"NONE",RIGHT:"RIGHT"},cOe={FLAT:"FLAT",ROUND:"ROUND"},fOe={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"},dOe={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},vOe={BSPLINE:"BSPLINE",POLISH:"POLISH"},pOe={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"},gOe={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"},GR={ADD:"add",UPDATE:"update",DELETE:"delete"},yOe={LESS_TIME:"LESS_TIME",LESS_TRANSFER:"LESS_TRANSFER",LESS_WALK:"LESS_WALK",MIN_DISTANCE:"MIN_DISTANCE"},mOe={BUS:"BUS",SUBWAY:"SUBWAY",NO_SUBWAY:"NO_SUBWAY",NONE:"NONE"},xat={CROSS:"CROSS",GRID:"GRID",POINT:"POINT"},Sat={CMYK:"CMYK",RGB:"RGB"},wat={UGC:"UGC",WMS:"WMS",WFS:"WFS",CUSTOM:"CUSTOM"},bat={THEME:"THEME",VECTOR:"VECTOR",GRID:"GRID",IMAGE:"IMAGE"},Eat={AVERAGE:"AVERAGE",MAX:"MAX",MIN:"MIN",STDDEVIATION:"STDDEVIATION",SUM:"SUM",VARIANCE:"VARIANCE"},Tat={BIT16:"BIT16",BIT32:"BIT32",BIT64:"BIT64",SINGLE:"SINGLE",DOUBLE:"DOUBLE",UBIT1:"UBIT1",UBIT4:"UBIT4",UBIT8:"UBIT8",UBIT24:"UBIT24",UBIT32:"UBIT32"},Cat={KDTREE_FIXED_COUNT:"KDTREE_FIXED_COUNT",KDTREE_FIXED_RADIUS:"KDTREE_FIXED_RADIUS",NONE:"NONE",QUADTREE:"QUADTREE"},Aat={KRIGING:"KRIGING",SimpleKriging:"SimpleKriging",UniversalKriging:"UniversalKriging"},_Oe={EXPONENTIAL:"EXPONENTIAL",GAUSSIAN:"GAUSSIAN",SPHERICAL:"SPHERICAL"},xOe={EXP1:"EXP1",EXP2:"EXP2"},bne={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"},Mat={BAR:"Bar",BAR3D:"Bar3D",CIRCLE:"Circle",PIE:"Pie",POINT:"Point",LINE:"Line",RING:"Ring"},SOe={CLIP:"clip",INTERSECT:"intersect"},wOe={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"},zR={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"},bOe={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},Ene={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},EOe={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"},TOe={GEOHASH_GRID:"geohash_grid"},COe={AVG:"avg",MAX:"max",MIN:"min",SUM:"sum"},Iat={BOUNDS:"BOUNDS",BUFFER:"BUFFER",ID:"ID",SPATIAL:"SPATIAL",SQL:"SQL"},Tne={NDVI:"NDVI",HILLSHADE:"HILLSHADE"},Lat={MAP:"MAP",SERVICE:"SERVICE",SCENE:"SCENE",DATA:"DATA",INSIGHTS_WORKSPACE:"INSIGHTS_WORKSPACE",MAP_DASHBOARD:"MAP_DASHBOARD"},Pat={UPDATETIME:"UPDATETIME",HEATLEVEL:"HEATLEVEL",RELEVANCE:"RELEVANCE"},Oat={ASC:"ASC",DESC:"DESC"},Rat={PUBLIC:"PUBLIC",MY_RES:"MY_RES",MYGROUP_RES:"MYGROUP_RES",MYDEPARTMENT_RES:"MYDEPARTMENT_RES",SHARETOME_RES:"SHARETOME_RES"},Dat={TAG:"TAG",TYPE:"TYPE"},Nat={SEARCH:"SEARCH",READ:"READ",READWRITE:"READWRITE",DELETE:"DELETE",DOWNLOAD:"DOWNLOAD"},kat={DEPARTMENT:"DEPARTMENT",GROUP:"GROUP",IPORTALGROUP:"IPORTALGROUP",ROLE:"ROLE",USER:"USER"},Fat={GEOJSON:"GEOJSON",UGCV5_MVT:"UGCV5_MVT",JSON:"JSON",AUDIO:"AUDIO",COLOR:"COLOR",COLORSCHEME:"COLORSCHEME",CSV:"CSV",EXCEL:"EXCEL",FILLSYMBOL:"FILLSYMBOL",IMAGE:"IMAGE",LAYERTEMPLATE:"LAYERTEMPLATE",LAYOUTTEMPLATE:"LAYOUTTEMPLATE",LINESYMBOL:"LINESYMBOL",MAPTEMPLATE:"MAPTEMPLATE",MARKERSYMBOL:"MARKERSYMBOL",MBTILES:"MBTILES",PHOTOS:"PHOTOS",SHP:"SHP",SMTILES:"SMTILES",SVTILES:"SVTILES",THEMETEMPLATE:"THEMETEMPLATE",TPK:"TPK",UDB:"UDB",UGCV5:"UGCV5",UNKNOWN:"UNKNOWN",VIDEO:"VIDEO",WORKENVIRONMENT:"WORKENVIRONMENT",WORKSPACE:"WORKSPACE"},Bat={PNG:"PNG",PDF:"PDF"},Gat={HORIZONTALLABELSBELOW:"HORIZONTALLABELSBELOW",HORIZONTALLABELSABOVE:"HORIZONTALLABELSABOVE",VERTICALLABELSLEFT:"VERTICALLABELSLEFT",VERTICALLABELSRIGHT:"VERTICALLABELSRIGHT"},zat={LINE:"LINE",BAR:"BAR",BAR_SUB:"BAR_SUB"},Uat={METER:"METER",FOOT:"FOOT",DEGREES:"DEGREES"},AOe={CUSTOM:"CUSTOM",INTERSECTION:"INTERSECTION",UNION:"UNION"},MOe={CUSTOM:"CUSTOM",MAX:"MAX",MIN:"MIN"};class a3{constructor(e,t){this.w=e?parseFloat(e):0,this.h=e?parseFloat(t):0,this.CLASS_NAME="SuperMap.Size"}toString(){return"w="+this.w+",h="+this.h}clone(){return new a3(this.w,this.h)}equals(e){var t=!1;return e!=null&&(t=this.w===e.w&&this.h===e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t}destroy(){this.w=null,this.h=null}}class WE{constructor(e,t,r){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=r,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new WE(this.x,this.y,this.mode)}equals(e){var t=!1;return e!=null&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){if(e==null||t==null)throw new TypeError("Pixel.add cannot receive null values");return new WE(this.x+e,this.y+t)}offset(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t}destroy(){this.x=null,this.y=null,this.mode=null}}WE.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var Vat=function(n,e){var t=function(){};t.prototype=e.prototype,n.prototype=new t;var r,i,a;for(r=2,i=arguments.length;r<i;r++)a=arguments[r],typeof a=="function"&&(a=a.prototype),H.extend(n.prototype,a)},Cne=function(...n){class e{constructor(o){for(var s=0;s<n.length;s++)i(this,new n[s](o))}}for(var t=0;t<n.length;t++){var r=n[t];i(e,r),i(e.prototype,r.prototype),i(e.prototype,new r)}return e;function i(a,o){var s=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(o)));for(var l=0;l<s.length;l++){var u=s[l];if(u!=="constructor"&&u!=="prototype"&&u!=="name"&&u!=="length"){let h=Object.getOwnPropertyDescriptor(o,u);window.ActiveXObject?Object.defineProperty(a,u,h||{}):Object.defineProperty(a,u,h)}}}},ad={startsWith:function(n,e){return n.indexOf(e)==0},contains:function(n,e){return n.indexOf(e)!=-1},trim:function(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(n){for(var e=n.split("-"),t=e[0],r=1,i=e.length;r<i;r++){var a=e[r];t+=a.charAt(0).toUpperCase()+a.substring(1)}return t},format:function(n,e,t){e||(e=window);var r=function(i,a){for(var o,s=a.split(/\.+/),l=0;l<s.length;l++)l==0&&(o=e),o=o[s[l]];return typeof o=="function"&&(o=t?o.apply(null,t):o()),typeof o>"u"?"undefined":o};return n.replace(ad.tokenRegEx,r)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(n){return ad.numberRegEx.test(n)},numericIf:function(n){return ad.isNumeric(n)?parseFloat(n):n}},G8={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(n,e){var t=0;return e>0&&(t=parseFloat(n.toPrecision(e))),t},format:function(n,e,t,r){e=typeof e<"u"?e:0,t=typeof t<"u"?t:G8.thousandsSeparator,r=typeof r<"u"?r:G8.decimalSeparator,e!=null&&(n=parseFloat(n.toFixed(e)));var i=n.toString().split(".");i.length===1&&e==null&&(e=0);var a=i[0];if(t)for(var o=/(-?[0-9]+)([0-9]{3})/;o.test(a);)a=a.replace(o,"$1"+t+"$2");var s;if(e==0)s=a;else{var l=i.length>1?i[1]:"0";e!=null&&(l=l+new Array(e-l.length+1).join("0")),s=a+r+l}return s}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(n){return G8.limitSigDigs(this,n)});var UR={bind:function(n,e){var t=Array.prototype.slice.apply(arguments,[2]);return function(){var r=t.concat(Array.prototype.slice.apply(arguments,[0]));return n.apply(e,r)}},bindAsEventListener:function(n,e){return function(t){return n.call(e,t||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},$at={filter:function(n,e,t){var r=[];if(Array.prototype.filter)r=n.filter(e,t);else{var i=n.length;if(typeof e!="function")throw new TypeError;for(var a=0;a<i;a++)if(a in n){var o=n[a];e.call(t,o,a,n)&&r.push(o)}}return r}};class rg{constructor(){this.CLASS_NAME="SuperMap.Geometry",this.id=H.createUniqueID(this.CLASS_NAME+"_"),this.parent=null,this.bounds=null,this.SRID=null}destroy(){this.id=null,this.bounds=null,this.SRID=null}clone(){return new rg}setBounds(e){e&&(this.bounds=e.clone())}clearBounds(){this.bounds=null,this.parent&&this.parent.clearBounds()}extendBounds(e){var t=this.getBounds();t?this.bounds.extend(e):this.setBounds(e)}getBounds(){return this.bounds==null&&this.calculateBounds(),this.bounds}calculateBounds(){}getVertices(e){}getArea(){return 0}}const Ane=function(){var n="",e="",t="pc",r,i=navigator.userAgent.toLowerCase();return i.indexOf("msie")>-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(n="msie",r=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(n="chrome",r=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(n="firefox",r=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(n="opera",r=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(n="safari",r=i.match(/version\/([\d.]+)/)),e=r?r[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?t="apple":i.indexOf("android")>-1&&(r=i.match(/version\/([\d.]+)/),e=r?r[1]:"",t="android"),{name:n,version:e,device:t}}(),Wat=function(){var n=!0,e=Ane;return document.createElement("canvas").getContext?(e.name==="firefox"&&parseFloat(e.version)<5&&(n=!1),e.name==="safari"&&parseFloat(e.version)<4&&(n=!1),e.name==="opera"&&parseFloat(e.version)<10&&(n=!1),e.name==="msie"&&parseFloat(e.version)<9&&(n=!1)):n=!1,n}(),Hat=function(){var n=navigator.userAgent.toLowerCase();return n.indexOf("webkit")===-1&&n.indexOf("gecko")!==-1}(),eE=96,H={assign(n){for(var e=0;e<Object.getOwnPropertyNames(arguments).length;e++){var t=Object.getOwnPropertyNames(arguments)[e];if(!(t=="caller"||t=="callee"||t=="length"||t=="arguments")){var r=arguments[t];if(r)for(var i=0;i<Object.getOwnPropertyNames(r).length;i++){var a=Object.getOwnPropertyNames(r)[i];t=="caller"||t=="callee"||t=="length"||t=="arguments"||(n[a]=r[a])}}}return n},extend:function(n,e){if(n=n||{},e){for(var t in e){var r=e[t];r!==void 0&&(n[t]=r)}var i=typeof window.Event=="function"&&e instanceof window.Event;!i&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&(n.toString=e.toString)}return n},copy:function(n,e){n=n||{};var t;if(e)for(var r in n)t=e[r],typeof t<"u"&&(n[r]=t)},reset:function(n){n=n||{};for(var e in n)if(n.hasOwnProperty(e)){if(typeof n[e]=="object"&&n[e]instanceof Array){for(var t in n[e])n[e][t].destroy&&n[e][t].destroy();n[e].length=0}else typeof n[e]=="object"&&n[e]instanceof Object&&n[e].destroy&&n[e].destroy();n[e]=null}},getElement:function(){for(var n=[],e=0,t=arguments.length;e<t;e++){var r=arguments[e];if(typeof r=="string"&&(r=document.getElementById(r)),arguments.length===1)return r;n.push(r)}return n},isElement:function(n){return!!(n&&n.nodeType===1)},isArray:function(n){return Object.prototype.toString.call(n)==="[object Array]"},removeItem:function(n,e){for(var t=n.length-1;t>=0;t--)n[t]===e&&n.splice(t,1);return n},indexOf:function(n,e){if(n==null)return-1;if(typeof n.indexOf=="function")return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1},modifyDOMElement:function(n,e,t,r,i,a,o,s){e&&(n.id=e),t&&(n.style.left=t.x+"px",n.style.top=t.y+"px"),r&&(n.style.width=r.w+"px",n.style.height=r.h+"px"),i&&(n.style.position=i),a&&(n.style.border=a),o&&(n.style.overflow=o),parseFloat(s)>=0&&parseFloat(s)<1?(n.style.filter="alpha(opacity="+s*100+")",n.style.opacity=s):parseFloat(s)===1&&(n.style.filter="",n.style.opacity="")},applyDefaults:function(n,e){n=n||{};var t=typeof window.Event=="function"&&e instanceof window.Event;for(var r in e)(n[r]===void 0||!t&&e.hasOwnProperty&&e.hasOwnProperty(r)&&!n.hasOwnProperty(r))&&(n[r]=e[r]);return!t&&e&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&!n.hasOwnProperty("toString")&&(n.toString=e.toString),n},getParameterString:function(n){var e=[];for(var t in n){var r=n[t];if(r!=null&&typeof r!="function"){var i;Array.isArray(r)||r.toString()==="[object Object]"?i=encodeURIComponent(JSON.stringify(r)):i=encodeURIComponent(r),e.push(encodeURIComponent(t)+"="+i)}}return e.join("&")},urlAppend:function(n,e){var t=n;if(e){e.indexOf("?")===0&&(e=e.substring(1));var r=(n+" ").split(/[?&]/);t+=r.pop()===" "?e:r.length?"&"+e:"?"+e}return t},urlPathAppend:function(n,e){let t=n;if(!e)return t;e.indexOf("/")===0&&(e=e.substring(1));const r=n.split("?");return r[0].indexOf("/",r[0].length-1)<0&&(r[0]+="/"),t=`${r[0]}${e}${r.length>1?`?${r[1]}`:""}`,t},DEFAULT_PRECISION:14,toFloat:function(n,e){return e==null&&(e=H.DEFAULT_PRECISION),typeof n!="number"&&(n=parseFloat(n)),e===0?n:parseFloat(n.toPrecision(e))},rad:function(n){return n*Math.PI/180},getParameters:function(n){n=n==null?window.location.href:n;var e="";if(ad.contains(n,"?")){var t=n.indexOf("?")+1,r=ad.contains(n,"#")?n.indexOf("#"):n.length;e=n.substring(t,r)}for(var i={},a=e.split(/[&;]/),o=0,s=a.length;o<s;++o){var l=a[o].split("=");if(l[0]){var u=l[0];try{u=decodeURIComponent(u)}catch{u=unescape(u)}var h=(l[1]||"").replace(/\+/g," ");try{h=decodeURIComponent(h)}catch{h=unescape(h)}h=h.split(","),h.length==1&&(h=h[0]),i[u]=h}}return i},lastSeqID:0,createUniqueID:function(n){return n==null&&(n="id_"),H.lastSeqID+=1,n+H.lastSeqID},normalizeScale:function(n){var e=n>1?1/n:n;return e},getResolutionFromScale:function(n,e){var t;if(n){e==null&&(e="degrees");var r=H.normalizeScale(n);t=1/(r*Ii[e]*eE)}return t},getScaleFromResolution:function(n,e){e==null&&(e="degrees");var t=n*Ii[e]*eE;return t},getBrowser:function(){return Ane},isSupportCanvas:Wat,supportCanvas:function(){return H.isSupportCanvas},isInTheSameDomain:function(n){if(!n)return!0;var e=n.indexOf("//"),t=document.location.toString(),r=t.indexOf("//");if(e===-1)return!0;var i,a=i=n.substring(0,e),o=t.substring(r+2);r=o.indexOf("/");var s=o.indexOf(":"),l=o.substring(0,r),u=document.location.protocol;if(s!==-1||(l+=":"+(u.toLowerCase()==="http:"?80:443)),u.toLowerCase()!==a.toLowerCase())return!1;a=n.substring(e+2);var h=a.indexOf(":");e=a.indexOf("/");var c=a.substring(0,e),f;h!==-1?f=a.substring(0,h):(f=a.substring(0,e),c+=":"+(i.toLowerCase()==="http:"?80:443));var d=document.domain;return f===d&&c===l},calculateDpi:function(n,e,t,r,i){if(!(!n||!e||!t)){var a=1e4,o=n.getWidth(),s=n.getHeight(),l=e.w,u=e.h;i=i||6378137,r=r||"degrees";var h;if(r.toLowerCase()==="degree"||r.toLowerCase()==="degrees"||r.toLowerCase()==="dd"){let c=o/l,f=s/u,d=c>f?c:f;h=.0254*a/d/t/(Math.PI*2*i/360)/a}else{let c=o/l;h=.0254*a/c/t/a}return h}},toJSON:function(n){var e=n;if(e==null)return null;switch(e.constructor){case String:return e='"'+e.replace(/(["\\])/g,"\\$1")+'"',e=e.replace(/\n/g,"\\n"),e=e.replace(/\r/g,"\\r"),e=e.replace("<","&lt;"),e=e.replace(">","&gt;"),e=e.replace(/%/g,"%25"),e=e.replace(/&/g,"%26"),e;case Array:for(var t="",r=0,i=e.length;r<i;r++)t+=H.toJSON(e[r]),r!==e.length-1&&(t+=",");return"["+t+"]";case Number:return isFinite(e)?String(e):null;case Boolean:return String(e);case Date:var a=`{'__type':"System.DateTime",'Year':`+e.getFullYear()+",'Month':"+(e.getMonth()+1)+",'Day':"+e.getDate()+",'Hour':"+e.getHours()+",'Minute':"+e.getMinutes()+",'Second':"+e.getSeconds()+",'Millisecond':"+e.getMilliseconds()+",'TimezoneOffset':"+e.getTimezoneOffset()+"}";return a;default:if(e.toJSON!=null&&typeof e.toJSON=="function")return e.toJSON();if(typeof e=="object"){if(e.length){let s=[];for(let l=0,u=e.length;l<u;l++)s.push(H.toJSON(e[l]));return"["+s.join(",")+"]"}let o=[];for(let s in e)typeof e[s]!="function"&&s!=="CLASS_NAME"&&s!=="parent"&&o.push("'"+s+"':"+H.toJSON(e[s]));return o.length>0?"{"+o.join(",")+"}":"{}"}return e.toString()}},getResolutionFromScaleDpi:function(n,e,t,r){var i=null,a=1e4;return r=r||6378137,t=t||"",n>0&&e>0?(n=H.normalizeScale(n),t.toLowerCase()==="degree"||t.toLowerCase()==="degrees"||t.toLowerCase()==="dd"?(i=.0254*a/e/n/(Math.PI*2*r/360)/a,i):(i=.0254*a/e/n/a,i)):-1},getScaleFromResolutionDpi:function(n,e,t,r){var i=null,a=1e4;return r=r||6378137,t=t||"",n>0&&e>0?t.toLowerCase()==="degree"||t.toLowerCase()==="degrees"||t.toLowerCase()==="dd"?(i=.0254*a/e/n/(Math.PI*2*r/360)/a,i):(i=.0254*a/e/n/a,i):-1},transformResult:function(n){return n.responseText&&typeof n.responseText=="string"&&(n=JSON.parse(n.responseText)),n},copyAttributes:function(n,e){if(n=n||{},e)for(var t in e){var r=e[t];r!==void 0&&t!=="CLASS_NAME"&&typeof r!="function"&&(n[t]=r)}return n},copyAttributesWithClip:function(n,e,t){if(n=n||{},e)for(var r in e){var i=!1;if(t&&t.length){for(var a=0,o=t.length;a<o;a++)if(r===t[a]){i=!0;break}}if(i!==!0){var s=e[r];s!==void 0&&r!=="CLASS_NAME"&&typeof s!="function"&&(n[r]=s)}}return n},cloneObject:function(n){if(n===null||typeof n!="object")return n;if(n instanceof Date){let t=new Date;return t.setTime(n.getTime()),t}if(n instanceof Array)return n.slice(0);if(n instanceof Object){let t={};for(var e in n)n.hasOwnProperty(e)&&(t[e]=H.cloneObject(n[e]));return t}throw new Error("Unable to copy obj! Its type isn't supported.")},lineIntersection:function(n,e,t,r){var i=null,a,o,s=(r.x-t.x)*(n.y-t.y)-(r.y-t.y)*(n.x-t.x),l=(e.x-n.x)*(n.y-t.y)-(e.y-n.y)*(n.x-t.x),u=(r.y-t.y)*(e.x-n.x)-(r.x-t.x)*(e.y-n.y);if(u!=0)a=s/u,o=l/u,a>=0&&o<=1&&a<=1&&o>=0?i=new rg.Point(n.x+a*(e.x-n.x),n.y+a*(e.y-n.y)):i="No Intersection";else if(s==0&&l==0){var h=Math.max(n.y,e.y),c=Math.min(n.y,e.y),f=Math.max(n.x,e.x),d=Math.min(n.x,e.x);(t.y>=c&&t.y<=h||r.y>=c&&r.y<=h)&&t.x>=d&&t.x<=f||r.x>=d&&r.x<=f?i="Coincident":i="Parallel"}else i="Parallel";return i},getTextBounds:function(n,e,t){document.body.appendChild(t),t.style.width="auto",t.style.height="auto",n.fontSize&&(t.style.fontSize=n.fontSize),n.fontFamily&&(t.style.fontFamily=n.fontFamily),n.fontWeight&&(t.style.fontWeight=n.fontWeight),t.style.position="relative",t.style.visibility="hidden",t.style.display="inline-block",t.innerHTML=e;var r=t.clientWidth,i=t.clientHeight;return document.body.removeChild(t),{textWidth:r,textHeight:i}},convertPath:function(n,e){return e?n.replace(/\{([\w-\.]+)\}/g,(t,r)=>{var i;return e.hasOwnProperty(r)?i=jat(e[r]):i=t,encodeURIComponent(i)}):n}},Ii={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};Ii.in=Ii.inches;Ii.degrees=Ii.dd;Ii.nmi=1852*Ii.m;const Fn=.0254000508001016;H.extend(Ii,{Inch:Ii.inches,Meter:1/Fn,Foot:.3048006096012192/Fn,IFoot:.3048/Fn,ClarkeFoot:.3047972651151/Fn,SearsFoot:.30479947153867626/Fn,GoldCoastFoot:.3047997101815088/Fn,IInch:.0254/Fn,MicroInch:254e-7/Fn,Mil:254e-10/Fn,Centimeter:.01/Fn,Kilometer:1e3/Fn,Yard:.9144018288036576/Fn,SearsYard:.914398414616029/Fn,IndianYard:.9143985307444408/Fn,IndianYd37:.91439523/Fn,IndianYd62:.9143988/Fn,IndianYd75:.9143985/Fn,IndianFoot:.30479951/Fn,IndianFt37:.30479841/Fn,IndianFt62:.3047996/Fn,IndianFt75:.3047995/Fn,Mile:1609.3472186944373/Fn,IYard:.9144/Fn,IMile:1609.344/Fn,NautM:1852/Fn,"Lat-66":110943.31648893273/Fn,"Lat-83":110946.25736872235/Fn,Decimeter:.1/Fn,Millimeter:.001/Fn,Dekameter:10/Fn,Decameter:10/Fn,Hectometer:100/Fn,GermanMeter:1.0000135965/Fn,CaGrid:.999738/Fn,ClarkeChain:20.1166194976/Fn,GunterChain:20.11684023368047/Fn,BenoitChain:20.116782494375872/Fn,SearsChain:20.11676512155/Fn,ClarkeLink:.201166194976/Fn,GunterLink:.2011684023368047/Fn,BenoitLink:.20116782494375873/Fn,SearsLink:.2011676512155/Fn,Rod:5.02921005842012/Fn,IntnlChain:20.1168/Fn,IntnlLink:.201168/Fn,Perch:5.02921005842012/Fn,Pole:5.02921005842012/Fn,Furlong:201.1684023368046/Fn,Rood:3.778266898/Fn,CapeFoot:.3047972615/Fn,Brealey:375/Fn,ModAmFt:.304812252984506/Fn,Fathom:1.8288/Fn,"NautM-UK":1853.184/Fn,"50kilometers":5e4/Fn,"150kilometers":15e4/Fn});H.extend(Ii,{mm:Ii.Meter/1e3,cm:Ii.Meter/100,dm:Ii.Meter*100,km:Ii.Meter*1e3,kmi:Ii.nmi,fath:Ii.Fathom,ch:Ii.IntnlChain,link:Ii.IntnlLink,"us-in":Ii.inches,"us-ft":Ii.Foot,"us-yd":Ii.Yard,"us-ch":Ii.GunterChain,"us-mi":Ii.Mile,"ind-yd":Ii.IndianYd37,"ind-ft":Ii.IndianFt37,"ind-ch":20.11669506/Fn});Ii.degree=Ii.dd;Ii.meter=Ii.m;Ii.foot=Ii.ft;Ii.inch=Ii.inches;Ii.mile=Ii.mi;Ii.kilometer=Ii.km;Ii.yard=Ii.yd;function jat(n){return n==null||n==null?"":n instanceof Date?n.toJSON():Xat(n)?JSON.stringify(n):n.toString()}function Xat(n){if(typeof n!="string"&&typeof n!="object")return!1;try{const e=n.toString();return e==="[object Object]"||e==="[object Array]"}catch{return!1}}class vd{constructor(e,t){H.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?H.toFloat(e):0,this.lat=t?H.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new vd(this.lon,this.lat)}add(e,t){if(e==null||t==null)throw new TypeError("LonLat.add cannot receive null values");return new vd(this.lon+H.toFloat(e),this.lat+H.toFloat(t))}equals(e){var t=!1;return e!=null&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lon<e.left;)t.lon+=e.getWidth();for(;t.lon>e.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new vd(t[0],t[1])}static fromArray(e){var t=H.isArray(e),r=t&&e[0],i=t&&e[1];return new vd(r,i)}}class po{constructor(e,t,r,i){H.isArray(e)&&(i=e[3],r=e[2],t=e[1],e=e[0]),this.left=e!=null?H.toFloat(e):this.left,this.bottom=t!=null?H.toFloat(t):this.bottom,this.right=r!=null?H.toFloat(r):this.right,this.top=i!=null?H.toFloat(i):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new po(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return e!=null&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return e===!0?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){e==null&&(e=6);var r=Math.pow(10,e),i=Math.round(this.left*r)/r,a=Math.round(this.bottom*r)/r,o=Math.round(this.right*r)/r,s=Math.round(this.top*r)/r;return t===!0?a+","+i+","+s+","+o:i+","+a+","+o+","+s}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new a3(this.getWidth(),this.getHeight())}getCenterPixel(){return new WE((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new vd((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){e=e||1,t==null&&(t=this.getCenterLonLat());var r,i;t.CLASS_NAME==="SuperMap.LonLat"?(r=t.lon,i=t.lat):(r=t.x,i=t.y);var a=(this.left-r)*e+r,o=(this.bottom-i)*e+i,s=(this.right-r)*e+r,l=(this.top-i)*e+i;return new po(a,o,s,l)}add(e,t){if(e==null||t==null)throw new TypeError("Bounds.add cannot receive null values");return new po(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new po(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new po(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e;break}t&&(this.centerLonLat=null,(this.left==null||t.left<this.left)&&(this.left=t.left),(this.bottom==null||t.bottom<this.bottom)&&(this.bottom=t.bottom),(this.right==null||t.right>this.right)&&(this.right=t.right),(this.top==null||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){typeof t=="boolean"&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),i=t.worldBounds;if(i&&!r){var a=i.getWidth(),o=(i.left+i.right)/2,s=Math.round((e.lon-o)/a);r=this.containsLonLat({lon:e.lon-s*a,lat:e.lat},{inclusive:t.inclusive})}return r}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,r){if(r==null&&(r=!0),e==null||t==null)return!1;var i=!1;return r?i=e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:i=e>this.left&&e<this.right&&t>this.bottom&&t<this.top,i}intersectsBounds(e,t){if(typeof t=="boolean"&&(t={inclusive:t}),t=t||{},t.worldBounds){var r=this.wrapDateLine(t.worldBounds);e=e.wrapDateLine(t.worldBounds)}else r=this;t.inclusive==null&&(t.inclusive=!0);var i=!1,a=r.left===e.right||r.right===e.left||r.top===e.bottom||r.bottom===e.top;if(t.inclusive||!a){var o=e.bottom>=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,s=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top<e.top,l=e.left>=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,u=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;i=(o||s)&&(l||u)}if(t.worldBounds&&!i){var h=t.worldBounds,c=h.getWidth(),f=!h.containsBounds(r),d=!h.containsBounds(e);f&&!d?(e=e.add(-c,0),i=r.intersectsBounds(e,{inclusive:t.inclusive})):d&&!f&&(r=r.add(-c,0),i=e.intersectsBounds(r,{inclusive:t.inclusive}))}return i}containsBounds(e,t,r){t==null&&(t=!1),r==null&&(r=!0);var i=this.contains(e.left,e.bottom,r),a=this.contains(e.right,e.bottom,r),o=this.contains(e.left,e.top,r),s=this.contains(e.right,e.top,r);return t?i||a||o||s:i&&a&&o&&s}determineQuadrant(e){var t="",r=this.getCenterLonLat();return t+=e.lat<r.lat?"b":"t",t+=e.lon<r.lon?"l":"r",t}wrapDateLine(e,t){t=t||{};var r=t.leftTolerance||0,i=t.rightTolerance||0,a=this.clone();if(e){for(var o=e.getWidth();a.left<e.left&&a.right-i<=e.left;)a=a.add(o,0);for(;a.left+r>=e.right&&a.right>e.right;)a=a.add(-o,0);var s=a.left+r;s<e.right&&s>e.left&&a.right-i>e.right&&(a=a.add(-o,0))}return a}toServerJSONObject(){var e={rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom};return e}destroy(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}static fromString(e,t){var r=e.split(",");return po.fromArray(r,t)}static fromArray(e,t){return t===!0?new po(e[1],e[0],e[3],e[2]):new po(e[0],e[1],e[2],e[3])}static fromSize(e){return new po(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return t+=e.charAt(0)==="t"?"b":"t",t+=e.charAt(1)==="l"?"r":"l",t}}class O0 extends rg{constructor(e){super(),this.components=[],this.componentTypes=null,e!=null&&this.addComponents(e),this.CLASS_NAME="SuperMap.Geometry.Collection",this.geometryType="Collection"}destroy(){this.components.length=0,this.components=null,super.destroy()}clone(){for(var e=new O0,t=0,r=this.components.length;t<r;t++)e.addComponent(this.components[t].clone());return H.applyDefaults(e,this),e}getComponentsString(){for(var e=[],t=0,r=this.components.length;t<r;t++)e.push(this.components[t].toShortString());return e.join(",")}calculateBounds(){this.bounds=null;var e=new po,t=this.components;if(t)for(var r=0,i=t.length;r<i;r++)e.extend(t[r].getBounds());e.left!=null&&e.bottom!=null&&e.right!=null&&e.top!=null&&this.setBounds(e)}addComponents(e){H.isArray(e)||(e=[e]);for(var t=0,r=e.length;t<r;t++)this.addComponent(e[t])}addComponent(e,t){var r=!1;if(e&&(this.componentTypes==null||H.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(t!=null&&t<this.components.length){var i=this.components.slice(0,t),a=this.components.slice(t,this.components.length);i.push(e),this.components=i.concat(a)}else this.components.push(e);e.parent=this,this.clearBounds(),r=!0}return r}removeComponents(e){var t=!1;H.isArray(e)||(e=[e]);for(var r=e.length-1;r>=0;--r)t=this.removeComponent(e[r])||t;return t}removeComponent(e){return H.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,r=this.components.length;t<r;t++)e+=this.components[t].getArea();return e}equals(e){var t=!0;if(!e||!e.CLASS_NAME||this.CLASS_NAME!==e.CLASS_NAME)t=!1;else if(!H.isArray(e.components)||e.components.length!==this.components.length)t=!1;else for(var r=0,i=this.components.length;r<i;++r)if(!this.components[r].equals(e.components[r])){t=!1;break}return t}getVertices(e){for(var t=[],r=0,i=this.components.length;r<i;++r)Array.prototype.push.apply(t,this.components[r].getVertices(e));return t}}class HE extends O0{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.MultiPoint",this.geometryType="MultiPoint"}addPoint(e,t){this.addComponent(e,t)}removePoint(e){this.removeComponent(e)}}class Mne extends HE{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point","SuperMap.PointWithMeasure"],this.CLASS_NAME="SuperMap.Geometry.Curve",this.geometryType="Curve"}}class Ki extends rg{constructor(e,t,r,i){super(e,t,r,i),this.x=parseFloat(e),this.y=parseFloat(t),this.tag=i||i==0?parseFloat(i):null,this.type=r||"Point",this.CLASS_NAME="SuperMap.Geometry.Point",this.geometryType="Point"}clone(e){return e==null&&(e=new Ki(this.x,this.y)),H.applyDefaults(e,this),e}calculateBounds(){this.bounds=new po(this.x,this.y,this.x,this.y)}equals(e){var t=!1;return e!=null&&(t=this.x===e.x&&this.y===e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}move(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()}toShortString(){return this.x+", "+this.y}destroy(){this.x=null,this.y=null,this.tag=null,super.destroy()}getVertices(){return[this]}}class Vl extends Mne{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry.LineString",this.geometryType="LineString"}removeComponent(e){var t=this.components&&this.components.length>2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e=this.components.length-1,t=new Array(e),r,i,a=0;a<e;++a)r=this.components[a],i=this.components[a+1],r.x<i.x?t[a]={x1:r.x,y1:r.y,x2:i.x,y2:i.y}:t[a]={x1:i.x,y1:i.y,x2:r.x,y2:r.y};function o(s,l){return s.x1-l.x1}return t.sort(o)}getVertices(e){var t;return e===!0?t=[this.components[0],this.components[this.components.length-1]]:e===!1?t=this.components.slice(1,this.components.length-1):t=this.components.slice(),t}static calculateCircle(e){if(e.length<3)return e;var t={},r=e[0],i=e[1],a=e[2],o=0,s=0,l=!0,u=0,h=0,c=0,f=72,d=[],v=(a.y-r.y)/(a.x-r.x),p=a.y-v*a.x;if(a.x!=r.x&&a.y!=r.y&&i.y==v*i.x+p||a.x==r.x&&i.x==r.x||a.y==r.y&&i.y==r.y||a.x==r.x&&a.y==r.y||a.x==i.x&&a.y==i.y||r.x==i.x&&r.y==i.y)d.push(r),d.push(i),d.push(a);else{var g=(i.x*i.x+i.y*i.y-(r.x*r.x+r.y*r.y))*(2*(a.y-r.y))-(a.x*a.x+a.y*a.y-(r.x*r.x+r.y*r.y))*(2*(i.y-r.y)),m=2*(i.x-r.x)*(a.x*a.x+a.y*a.y-(r.x*r.x+r.y*r.y))-2*(a.x-r.x)*(i.x*i.x+i.y*i.y-(r.x*r.x+r.y*r.y)),y=4*((i.x-r.x)*(a.y-r.y)-(a.x-r.x)*(i.y-r.y));t.x=g/y,t.y=m/y,o=Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y));var _=(r.x-a.x)*(r.x-a.x)+(r.y-a.y)*(r.y-a.y),x=(2*o*o-_)/(2*o*o);x=x>=1?1:x,x=x<=-1?-1:x,c=Math.acos(x)*180/Math.PI,a.x==r.x?c=t.x>r.x&&i.x>r.x||t.x<r.x&&i.x<r.x?360-c:c:c=t.y>v*t.x+p&&i.y>v*i.x+p||t.y<v*t.x+p&&i.y<v*i.x+p?360-c:c,s=c/72,a.y!=r.y?a.x==r.x?a.y>r.y?i.x<r.x&&(l=!1):i.x>r.x&&(l=!1):a.x<r.x?i.y<v*i.x+p&&(l=!1):i.y>v*i.x+p&&(l=!1):a.x>r.x?i.y>r.y&&(l=!1):i.y<r.y&&(l=!1);var S=(r.y-t.y)/(r.x-t.x),w=S>=0?Math.atan(S)*180/Math.PI:Math.abs(Math.atan(S)*180/Math.PI)+90,b=Math.abs(t.y);r.y==b&&b==a.y&&r.x<a.x&&(w=w+180);var E=r.y-t.y;d.push(r);for(var T=1;T<f;T++){u=s*T,h=w,l?E>=0?S>=0?h=h+u:h=180-(h-90)+u:S>0?h=h-180+u:h=90-h+u:E>=0?S>=0?h=h-u:h=180-(h-90)-u:S>=0?h=h-180-u:h=90-h-u,h=h*Math.PI/180;var C=t.x+o*Math.cos(h),A=t.y+o*Math.sin(h);d.push(new Ki(C,A))}d.push(a)}return d}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var i=0;i<r;){var a=e[i].type;if(a=="LTypeArc"){var o=Vl.createLineArc(t,i,r,e);t=o[0],i=o[1]}else t.push(e[i]),i++}return t}static createLineArc(e,t,r,i){if(t==0){let s=Vl.addPointEPS(i,t,r,"LTypeArc");Array.prototype.push.apply(e,s[0]),t=s[1]+1}else if(t==r-1){var a=[i[t-1],i[t]],o=Vl.calculateCircle(a);Array.prototype.push.apply(e,o),t++}else{let s=Vl.addPointEPS(i,t,r,"LTypeArc");e.pop(),Array.prototype.push.apply(e,s[0]),t=s[1]+1}return[e,t]}static addPointEPS(e,t,r,i){var a=[],o=t+1;t==0?Array.prototype.push.apply(a,[e[t],e[t+1]]):t==r-1?Array.prototype.push.apply(a,[e[t-1],e[t]]):Array.prototype.push.apply(a,[e[t-1],e[t],e[t+1]]);var s;return i=="LTypeCurve"?s=Vl.calculatePointsFBZN(a):i=="LTypeArc"&&(s=Vl.calculateCircle(a)),[s,o]}}class O_ extends rg{constructor(e,t,r){super(e,t,r),this.x=parseFloat(e),this.y=parseFloat(t),this.text=r.toString(),this.bsInfo={h:null,w:null},this.element=document.createElement("span"),this.CLASS_NAME="SuperMap.Geometry.GeoText",this.geometryType="GeoText"}destroy(){super.destroy(),this.x=null,this.y=null,this.text=null}getCentroid(){return new Ki(this.x,this.y)}clone(e){return e==null&&(e=new O_(this.x,this.y,this.text)),H.applyDefaults(e,this),e}calculateBounds(){this.bounds=new po(this.x,this.y,this.x,this.y)}getLabelPxBoundsByLabel(e,t,r,i){var a,o,s,l,u,h=H.cloneObject(e),c=i.label||this.text,f=c.split(`
`),d=f.length;if(t=parseFloat(t),r=parseFloat(r),d>1&&(r=parseFloat(r)*d),i.labelAlign&&i.labelAlign!=="cm")switch(i.labelAlign){case"lt":h.x+=t/2,h.y+=r/2;break;case"lm":h.x+=t/2;break;case"lb":h.x+=t/2,h.y-=r/2;break;case"ct":h.y+=r/2;break;case"cb":h.y-=r/2;break;case"rt":h.x-=t/2,h.y+=r/2;break;case"rm":h.x-=t/2;break;case"rb":h.x-=t/2,h.y-=r/2;break}return this.bsInfo.h=r,this.bsInfo.w=t,o=h.x-parseFloat(t)/2,s=h.y+parseFloat(r)/2,u=h.x+parseFloat(t)/2,l=h.y-parseFloat(r)/2,a=new po(o,s,u,l),a}getLabelPxBoundsByText(e,t){var r,i,a,o,s,l=this.getLabelPxSize(t),u=H.cloneObject(e);if(t.labelAlign&&t.labelAlign!=="cm")switch(t.labelAlign){case"lt":u.x+=l.w/2,u.y+=l.h/2;break;case"lm":u.x+=l.w/2;break;case"lb":u.x+=l.w/2,u.y-=l.h/2;break;case"ct":u.y+=l.h/2;break;case"cb":u.y-=l.h/2;break;case"rt":u.x-=l.w/2,u.y+=l.h/2;break;case"rm":u.x-=l.w/2;break;case"rb":u.x-=l.w/2,u.y-=l.h/2;break}return this.bsInfo.h=l.h,this.bsInfo.w=l.w,i=u.x-l.w/2,a=u.y+l.h/2,t.fontStyle&&t.fontStyle==="italic"?s=u.x+l.w/2+parseInt(parseFloat(t.fontSize)/2):s=u.x+l.w/2,o=u.y-l.h/2,r=new po(i,a,s,o),r}getLabelPxSize(e){var t,r,i=1,a=.2,o=parseFloat(e.strokeWidth);t=e.label||this.text,e.fontSize?r=parseFloat(e.fontSize):r=parseFloat("12px");var s,l,u=t.split(`
`),h=u.length;h>1?l=r*h+h+o+a*r:l=r+o+a*r+1,s=0,this.labelWTmp&&s<this.labelWTmp&&(s=this.labelWTmp);for(var c=0;c<h;c++){var f=this.getTextCount(u[c]),d=this.labelWTmp=H.getTextBounds(e,u[c],this.element).textWidth+f.textC*i+o;s<d&&(s=d)}var v=new Object;return v.h=l,v.w=s,v}getTextCount(e){for(var t={},r=0,i=0,a=0;a<e.length;a++)e.charCodeAt(a)>255?r++:i++;return t.cnC=r,t.enC=i,t.textC=e.length,t}}class tv extends Vl{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var r=!1,i=this.components.pop();(t!=null||!e.equals(i))&&(r=super.addComponent.apply(this,arguments));var a=this.components[0];return super.addComponent.apply(this,[a]),r}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var r=this.components[0];super.addComponent.apply(this,[r])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,i=this.components.length;r<i-1;r++){var a=this.components[r],o=this.components[r+1];t+=(a.x+o.x)*(o.y-a.y)}e=-t/2}return e}getVertices(e){return e===!0?[]:this.components.slice(0,this.components.length-1)}}class _E extends O0{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LineString"],this.CLASS_NAME="SuperMap.Geometry.MultiLineString",this.geometryType="MultiLineString"}}class A1 extends O0{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Polygon"],this.CLASS_NAME="SuperMap.Geometry.MultiPolygon",this.geometryType="MultiPolygon"}}class _p extends O0{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LinearRing"],this.CLASS_NAME="SuperMap.Geometry.Polygon",this.geometryType="Polygon"}getArea(){var e=0;if(this.components&&this.components.length>0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t<r;t++)e-=Math.abs(this.components[t].getArea())}return e}}class IOe extends rg{constructor(e,t,r,i){super(e,t,r,i),this.x=e,this.y=t,this.width=r,this.height=i,this.CLASS_NAME="SuperMap.Geometry.Rectangle",this.geometryType="Rectangle"}calculateBounds(){this.bounds=new po(this.x,this.y,this.x+this.width,this.y+this.height)}getArea(){var e=this.width*this.height;return e}}class z8{constructor(e,t){this.value=e||"",this.name=t||"token",this.CLASS_NAME="SuperMap.Credential"}getUrlParameters(){return this.name+"="+this.value}getValue(){return this.value}destroy(){this.value=null,this.name=null}}z8.CREDENTIAL=null;var Yat={toISOString:function(){if("toISOString"in Date.prototype)return function(n){return n.toISOString()};{let n=function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r};return function(e){var t;return isNaN(e.getTime())?t="Invalid Date":t=e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1,2)+"-"+n(e.getUTCDate(),2)+"T"+n(e.getUTCHours(),2)+":"+n(e.getUTCMinutes(),2)+":"+n(e.getUTCSeconds(),2)+"."+n(e.getUTCMilliseconds(),3)+"Z",t}}}(),parse:function(n){var e,t=n.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);if(t&&(t[1]||t[7])){var r=parseInt(t[1],10)||0,i=parseInt(t[2],10)-1||0,a=parseInt(t[3],10)||1;e=new Date(Date.UTC(r,i,a));var o=t[7];if(o){var s=parseInt(t[4],10),l=parseInt(t[5],10),u=parseFloat(t[6]),h=u|0,c=Math.round(1e3*(u-h));if(e.setUTCHours(s,l,h,c),o!=="Z"){var f=parseInt(o,10),d=parseInt(t[8],10)||0,v=-1e3*(60*(f*60)+d*60);e=new Date(e.getTime()+v)}}}else e=new Date("invalid");return e}},Ul={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(n){return n.target||n.srcElement},isSingleTouch:function(n){return n.touches&&n.touches.length===1},isMultiTouch:function(n){return n.touches&&n.touches.length>1},isLeftClick:function(n){return n.which&&n.which===1||n.button&&n.button===1},isRightClick:function(n){return n.which&&n.which===3||n.button&&n.button===2},stop:function(n,e){e||(n.preventDefault?n.preventDefault():n.returnValue=!1),n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},findElement:function(n,e){for(var t=Ul.element(n);t.parentNode&&(!t.tagName||t.tagName.toUpperCase()!=e.toUpperCase());)t=t.parentNode;return t},observe:function(n,e,t,r){var i=H.getElement(n);if(r=r||!1,e==="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!i._eventCacheID){var a="eventCacheID_";i.id&&(a=i.id+"_"+a),i._eventCacheID=H.createUniqueID(a)}var o=i._eventCacheID;this.observers[o]||(this.observers[o]=[]),this.observers[o].push({element:i,name:e,observer:t,useCapture:r}),i.addEventListener?e==="mousewheel"?i.addEventListener(e,t,{useCapture:r,passive:!1}):i.addEventListener(e,t,r):i.attachEvent&&i.attachEvent("on"+e,t)},stopObservingElement:function(n){var e=H.getElement(n),t=e._eventCacheID;this._removeElementObservers(Ul.observers[t])},_removeElementObservers:function(n){if(n)for(var e=n.length-1;e>=0;e--){var t=n[e],r=new Array(t.element,t.name,t.observer,t.useCapture);Ul.stopObserving.apply(this,r)}},stopObserving:function(n,e,t,r){r=r||!1;var i=H.getElement(n),a=i._eventCacheID;e==="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(e="keydown");var o=!1,s=Ul.observers[a];if(s)for(var l=0;!o&&l<s.length;){var u=s[l];if(u.name===e&&u.observer===t&&u.useCapture===r){s.splice(l,1),s.length==0&&delete Ul.observers[a],o=!0;break}l++}return o&&(i.removeEventListener?i.removeEventListener(e,t,r):i&&i.detachEvent&&i.detachEvent("on"+e,t)),o},unloadCache:function(){if(Ul&&Ul.observers){for(var n in Ul.observers){var e=Ul.observers[n];Ul._removeElementObservers.apply(this,[e])}Ul.observers=!1}},CLASS_NAME:"SuperMap.Event"};Ul.observe(window,"resize",Ul.unloadCache,!1);class y0{constructor(e,t,r,i,a){if(this.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"],this.listeners={},this.object=e,this.element=null,this.eventTypes=[],this.eventHandler=null,this.fallThrough=i,this.includeXY=!1,this.extensions={},this.extensionCount={},this.clearMouseListener=null,H.extend(this,a),r!=null)for(var o=0,s=r.length;o<s;o++)this.addEventType(r[o]);t!=null&&this.attachToElement(t),this.CLASS_NAME="SuperMap.Events"}destroy(){for(var e in this.extensions)typeof this.extensions[e]!="boolean"&&this.extensions[e].destroy();this.extensions=null,this.element&&(Ul.stopObservingElement(this.element),this.element.hasScrollEvent&&Ul.stopObserving(window,"scroll",this.clearMouseListener)),this.element=null,this.listeners=null,this.object=null,this.eventTypes=null,this.fallThrough=null,this.eventHandler=null}addEventType(e){this.listeners[e]||(this.eventTypes.push(e),this.listeners[e]=[])}attachToElement(e){this.element?Ul.stopObservingElement(this.element):(this.eventHandler=UR.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=UR.bind(this.clearMouseCache,this)),this.element=e;for(var t=0,r=this.BROWSER_EVENTS.length;t<r;t++){var i=this.BROWSER_EVENTS[t];this.addEventType(i),Ul.observe(e,i,this.eventHandler)}Ul.observe(e,"dragstart",Ul.stop)}on(e){for(var t in e)t!=="scope"&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])}register(e,t,r,i){if(e in y0&&!this.extensions[e]&&(this.extensions[e]=new y0[e](this)),r!=null&&H.indexOf(this.eventTypes,e)!==-1){t==null&&(t=this.object);var a=this.listeners[e];a||(a=[],this.listeners[e]=a,this.extensionCount[e]=0);var o={obj:t,func:r};i?(a.splice(this.extensionCount[e],0,o),typeof i=="object"&&i.extension&&this.extensionCount[e]++):a.push(o)}}registerPriority(e,t,r){this.register(e,t,r,!0)}un(e){for(var t in e)t!=="scope"&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])}unregister(e,t,r){t==null&&(t=this.object);var i=this.listeners[e];if(i!=null){for(var a=0,o=i.length;a<o;a++)if(i[a].obj===t&&i[a].func===r){i.splice(a,1);break}}}remove(e){this.listeners[e]!=null&&(this.listeners[e]=[])}triggerEvent(e,t){var r=this.listeners[e];if(!(!r||r.length==0)){t==null&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e),r=r.slice();for(var i,a=0,o=r.length;a<o;a++){var s=r[a];if(i=s.func.apply(s.obj,[t]),i!=null&&i===!1)break}return this.fallThrough||Ul.stop(t,!0),i}}handleBrowserEvent(e){var t=e.type,r=this.listeners[t];if(!(!r||r.length==0)){var i=e.touches;if(i&&i[0]){for(var a=0,o=0,s=i.length,l,u=0;u<s;++u)l=i[u],a+=l.clientX,o+=l.clientY;e.clientX=a/s,e.clientY=o/s}this.includeXY&&(e.xy=this.getMousePosition(e)),this.triggerEvent(t,e)}}clearMouseCache(){this.element.scrolls=null,this.element.lefttop=null;var e=document.body;e&&!((e.scrollTop!=0||e.scrollLeft!=0)&&navigator.userAgent.match(/iPhone/i))&&(this.element.offsets=null)}getMousePosition(e){if(this.includeXY?this.element.hasScrollEvent||(Ul.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=H.getViewportElement();this.element.scrolls=[t.scrollLeft,t.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=H.pagePosition(this.element)),new WE(e.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],e.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])}}y0.prototype.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"];class LOe{constructor(e,t,r){this.CLASS_NAME="SuperMap.Feature",this.layer=e,this.id=H.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=t,this.data=r!=null?r:{}}destroy(){this.id=null,this.lonlat=null,this.data=null}}class Js{constructor(e,t,r){this.red=!e&&e!=0?255:e,this.green=t||0,this.blue=r||0,this.CLASS_NAME="SuperMap.ServerColor"}destroy(){var e=this;e.red=null,e.green=null,e.blue=null}static fromJson(e){if(!!e){var t=new Js,r=255;e.red!==null&&(r=Number(e.red)),t.red=r;var i=0;e.green!==null&&(i=Number(e.green)),t.green=i;var a=0;return e.blue!==null&&(a=Number(e.blue)),t.blue=a,t}}}class gs{constructor(e){this.fillBackColor=new Js(255,255,255),this.fillBackOpaque=!1,this.fillForeColor=new Js(255,0,0),this.fillGradientMode=null,this.fillGradientAngle=0,this.fillGradientOffsetRatioX=0,this.fillGradientOffsetRatioY=0,this.fillOpaqueRate=100,this.fillSymbolID=0,this.lineColor=new Js(0,0,0),this.lineSymbolID=0,this.lineWidth=1,this.markerAngle=0,this.markerSize=1,this.markerSymbolID=-1,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ServerStyle"}destroy(){var e=this;e.fillBackColor&&(e.fillBackColor.destroy(),e.fillBackColor=null),e.fillBackOpaque=null,e.fillForeColor&&(e.fillForeColor.destroy(),e.fillForeColor=null),e.fillGradientMode=null,e.fillGradientAngle=null,e.fillGradientOffsetRatioX=null,e.fillGradientOffsetRatioY=null,e.fillOpaqueRate=null,e.fillSymbolID=null,e.lineColor&&(e.lineColor.destroy(),e.lineColor=null),e.lineSymbolID=null,e.lineWidth=null,e.markerAngle=null,e.markerSize=null,e.markerSymbolID=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e}static fromJson(e){if(!!e)return new gs({fillBackColor:Js.fromJson(e.fillBackColor),fillBackOpaque:e.fillBackOpaque,fillForeColor:Js.fromJson(e.fillForeColor),fillGradientMode:e.fillGradientMode,fillGradientAngle:e.fillGradientAngle,fillGradientOffsetRatioX:e.fillGradientOffsetRatioX,fillGradientOffsetRatioY:e.fillGradientOffsetRatioY,fillOpaqueRate:e.fillOpaqueRate,fillSymbolID:e.fillSymbolID,lineColor:Js.fromJson(e.lineColor),lineSymbolID:e.lineSymbolID,lineWidth:e.lineWidth,markerAngle:e.markerAngle,markerSize:e.markerSize,markerSymbolID:e.markerSymbolID})}}class pz extends Ki{constructor(e){super(e),this.measure=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.PointWithMeasure"}equals(e){var t=!1;if(e!=null){var r=this.x===e.x&&this.y===e.y&&this.measure===e.measure,i=isNaN(this.x)&&isNaN(this.y)&&isNaN(this.measure),a=isNaN(e.x)&&isNaN(e.y)&&isNaN(e.measure);t=r||i&&a}return t}toJson(){var e="{";return this.measure!=null&&this.measure!=null&&(e+='"measure":'+this.measure+","),e+='"x":'+this.x+",",e+='"y":'+this.y,e+="}",e}destroy(){var e=this;e.measure=null,e.x=null,e.y=null}static fromJson(e){if(!!e)return new pz({x:e.x,y:e.y,measure:e.measure})}}class gz extends O0{constructor(e,t){super(e,t),this.id=null,this.center=null,this.style=null,this.length=null,this.maxM=null,this.minM=null,this.parts=null,this.points=null,this.type=null,this.componentTypes=["SuperMap.Geometry.LinearRing","SuperMap.Geometry.LineString"],t&&H.extend(this,t),this.CLASS_NAME="SuperMap.Route",this.geometryType="LINEM"}toJson(){var e="{";if(this.id!=null&&this.id!=null&&(e+='"id":'+this.id+","),this.center!=null&&this.center!=null&&(e+='"center":'+this.center+","),this.style!=null&&this.style!=null&&(e+='"style":'+this.style+","),this.length!=null&&this.length!=null&&(e+='"length":'+this.length+","),this.maxM!=null&&this.maxM!=null&&(e+='"maxM":'+this.maxM+","),this.minM!=null&&this.minM!=null&&(e+='"minM":'+this.minM+","),this.type!=null&&this.type!=null&&(e+='"type":"'+this.type+'",'),this.parts!=null&&this.parts!=null){e+='"parts":['+this.parts[0];for(var t=1;t<this.parts.length;t++)e+=","+this.parts[t];e+="],"}if(this.components!=null&&this.components.length>0){e+='"points":[';for(var r=0,i=this.components.length;r<i;r++)for(var a=0,o=this.components[r].components.length;a<o;a++)e+=this.components[r].components[a].toJson()+",";e=e.replace(/,$/g,""),e+="]"}return e=e.replace(/,$/g,""),e+="}",e}destroy(){var e=this;e.id=null,e.center=null,e.style=null,e.length=null,e.maxM=null,e.minM=null,e.type=null,e.parts=null,e.components.length=0,e.components=null,e.componentTypes=null}static fromJson(e){if(!!e){var t=e.parts||[],r=e.points||[],i=t.length,a=[];if(i>0)for(var o=0,s=0,l=[];o<i;o++){for(var u=0;u<t[o];u++)l.push(pz.fromJson(r[s+u]));s+=t[o],l[0].equals(l[t[o]-1])?a.push(new tv(l)):a.push(new Vl(l)),l=[]}else return null;return new gz(a,{id:e.id,center:e.center,style:e.style,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type,parts:e.parts})}}}class Vo{constructor(e){this.id=0,this.style=null,this.parts=null,this.points=null,this.type=null,this.prjCoordSys=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ServerGeometry"}destroy(){var e=this;e.id=null,e.style=null,e.parts=null,e.partTopo=null,e.points=null,e.type=null,e.prjCoordSys=null}toGeometry(){var e=this,t=e.type;switch(t.toUpperCase()){case Lc.POINT:return e.toGeoPoint();case Lc.LINE:return e.toGeoLine();case Lc.LINEM:return e.toGeoLinem();case Lc.REGION:return e.toGeoRegion();case Lc.POINTEPS:return e.toGeoPoint();case Lc.LINEEPS:return e.toGeoLineEPS();case Lc.REGIONEPS:return e.toGeoRegionEPS();case Lc.GEOCOMPOUND:return e.transformGeoCompound()}}toGeoPoint(){var e=this,t=e.parts||[],r=e.points||[],i=t.length;if(i>0){if(i===1)return new Ki(r[0].x,r[0].y);var a=[];for(let o=0;o<i;o++)a.push(new Ki(r[o].x,r[o].y));return new HE(a)}else return null}toGeoLine(){var e=this,t=e.parts||[],r=e.points||[],i=t.length;if(i>0)if(i===1){let a=[];for(let o=0;o<t[0];o++)a.push(new Ki(r[o].x,r[o].y));return a[0].equals(a[t[0]-1])?new tv(a):new Vl(a)}else{let a=[];for(let o=0;o<i;o++){let s=[];for(let l=0;l<t[o];l++)s.push(new Ki(r[l].x,r[l].y));a.push(new Vl(s)),r.splice(0,t[o])}return new _E(a)}else return null}toGeoLineEPS(){var e=this,t=e.parts||[],r=e.points||[],i,a,o,s,l,u=t.length;if(u>0)if(u===1){for(i=0,o=[];i<t[0];i++)o.push(new Ki(r[i].x,r[i].y,r[i].type));return o[0].equals(o[t[0]-1])?(l=Vl.createLineEPS(o),new tv(l)):(l=Vl.createLineEPS(o),new Vl(l))}else{for(i=0,s=[];i<u;i++){for(a=0,o=[];a<t[i];a++)o.push(new Ki(r[a].x,r[a].y));l=Vl.createLineEPS(o),s.push(new Vl(l)),r.splice(0,t[i])}return new _E(s)}else return null}toGeoLinem(){var e=this;return gz.fromJson(e)}toGeoRegion(){var e=this,t=e.parts||[],r=e.partTopo||[],i=e.points||[],a=t.length;if(a<=0)return null;var o=[],s=[];if(a==1){for(let g=0;g<i.length;g++)s.push(new Ki(i[g].x,i[g].y));return o.push(new _p([new tv(s)])),new A1(o)}var l=[],u=[],h=[],c=[],f=[];for(let g=0,m=0;g<a;g++){for(let y=0;y<t[g];y++)s.push(new Ki(i[m+y].x,i[m+y].y));m+=t[g];var d=new _p([new tv(s)]);s=[],h.push(d),r.length===0&&c.push(d.getBounds()),f.push(1),u.push(d.getArea())}if(r.length===0){Vo.bubbleSort(u,h,r,c);var v=[];for(let g=1;g<h.length;g++)for(let m=g-1;m>=0;m--)if(v[g]=-1,c[m].containsBounds(c[g])){f[g]=f[m]*-1,f[g]<0&&(v[g]=m);break}for(let g=0;g<h.length;g++)f[g]>0?o.push(h[g]):(o[v[g]].components=o[v[g]].components.concat(h[g].components),o.push(""))}else{o=new Array;for(let g=0;g<h.length;g++)if(r[g]&&r[g]==-1?l=l.concat(h[g].components):(l.length>0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(l),l=[]),o.push(h[g])),g==a-1){var p=o.length;if(p)o[p-1].components=o[p-1].components.concat(l);else for(let m=0,y=l.length;m<y;m++)o.push(new _p(l))}}return new A1(o)}toGeoRegionEPS(){var e=this,t=e.parts||[],r=e.partTopo||[],i=e.points||[],a=t.length;if(a<=0)return null;var o=[],s=[],l;if(a==1){for(var u=0;u<i.length;u++)s.push(new Ki(i[u].x,i[u].y));return l=Vl.createLineEPS(s),o.push(new _p([new tv(l)])),new A1(o)}var h=[],c=[],f=[],d=[],v=[];for(let y=0,_=0;y<a;y++){for(let x=0;x<t[y];x++)s.push(new Ki(i[_+x].x,i[_+x].y));_+=t[y],l=Vl.createLineEPS(s);var p=new _p([new tv(l)]);s=[],f.push(p),r.length===0&&d.push(p.getBounds()),v.push(1),c.push(p.getArea())}if(r.length===0){Vo.bubbleSort(c,f,r,d);var g=[];for(let y=1;y<f.length;y++)for(let _=y-1;_>=0;_--)if(g[y]=-1,d[_].containsBounds(d[y])){v[y]=v[_]*-1,v[y]<0&&(g[y]=_);break}for(let y=0;y<f.length;y++)v[y]>0?o.push(f[y]):(o[g[y]].components=o[g[y]].components.concat(f[y].components),o.push(""))}else{o=new Array;for(let y=0;y<f.length;y++)if(r[y]&&r[y]==-1?h=h.concat(f[y].components):(h.length>0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(h),h=[]),o.push(f[y])),y==a-1){var m=o.length;if(m)o[m-1].components=o[m-1].components.concat(h);else for(let _=0,x=h.length;_<x;_++)o.push(new _p(h))}}return new A1(o)}transformGeoCompound(){const e=this,t=e.geoParts||[],r=t.length;if(r<=0)return null;const i=[];for(let a=0;a<r;a++){const o=t[a];i.push(new Vo(o).toGeometry())}return new O0(i)}static fromJson(e){if(!!e)return new Vo({id:e.id,style:gs.fromJson(e.style),parts:e.parts,partTopo:e.partTopo,points:e.points,center:e.center,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type})}static fromGeometry(e){if(!!e){var t=0,r=[],i=[],a=null,o=e.components,s=e.CLASS_NAME,l={epsgCode:e.SRID};if(isNaN(e.id)||(t=e.id),s!="SuperMap.Geometry.LinearRing"&&s!="SuperMap.Geometry.LineString"&&(e instanceof HE||e instanceof _E)){let u=o.length;for(let h=0;h<u;h++){const c=o[h].getVertices();let f=c.length;r.push(f);for(let d=0;d<f;d++)i.push(new Ki(c[d].x,c[d].y))}a=s=="SuperMap.Geometry.MultiPoint"?Lc.POINT:Lc.LINE}else if(e instanceof A1){let u=o.length;for(let h=0;h<u;h++){let c=o[h],f=c.components,d=f.length;for(let v=0;v<d;v++){const p=f[v].getVertices(),g=p.length+1;r.push(g);for(let m=0;m<g-1;m++)i.push(new Ki(p[m].x,p[m].y));i.push(new Ki(p[0].x,p[0].y))}}a=Lc.REGION}else if(e instanceof _p){let u=o.length;for(let h=0;h<u;h++){const c=o[h].getVertices();let f=c.length+1;r.push(f);for(let d=0;d<f-1;d++)i.push(new Ki(c[d].x,c[d].y));i.push(new Ki(c[0].x,c[0].y))}a=Lc.REGION}else{const u=e.getVertices();let h=u.length;for(let c=0;c<h;c++)i.push(new Ki(u[c].x,u[c].y));e instanceof tv&&(i.push(new Ki(u[0].x,u[0].y)),h++),r.push(h),a=e instanceof Ki?Lc.POINT:Lc.LINE}return new Vo({id:t,style:null,parts:r,points:i,type:a,prjCoordSys:l})}}static IsClockWise(e){var t=e.length;if(t<3)return 0;var r=e[0].y*(e[t-1].x-e[1].x);e.push(e[0]);for(var i=1;i<t;i++)r+=e[i].y*(e[i-1].x-e[i+1].x);return r*.5}static bubbleSort(e,t,r,i){for(var a=0;a<e.length;a++)for(var o=0;o<e.length;o++)if(e[a]>e[o]){var s=e[o];e[o]=e[a],e[a]=s;var l=t[o];if(t[o]=t[a],t[a]=l,r&&r.length>0){var u=r[o];r[o]=r[a],r[a]=u}if(i&&i.length>0){var h=i[o];i[o]=i[a],i[a]=h}}}}class qat extends Vo{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry3D",this.position=null,this.rotationX=null,this.rotationY=null,this.rotationZ=null,this.scaleX=null,this.scaleY=null,this.scaleZ=null,H.extend(this,e)}destroy(){this.position=null,this.rotationX=null,this.rotationY=null,this.rotationZ=null,this.scaleX=null,this.scaleY=null,this.scaleZ=null}}const bg={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};class sc extends LOe{constructor(e,t,r){super(null,null,t),this.fid=null,this.geometry=e||null,this.attributes={},t&&(this.attributes=H.extend(this.attributes,t)),this.bounds=null,this.state=null,this.style=r||null,this.url=null,this.lonlat=null,this.CLASS_NAME="SuperMap.Feature.Vector",sc.style={default:{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"default",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},delete:{display:"none"}}}destroy(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.geometry=null,super.destroy()}clone(){return new sc(this.geometry?this.geometry.clone():null,this.attributes,this.style)}toState(e){if(e===bg.UPDATE)switch(this.state){case bg.UNKNOWN:case bg.DELETE:this.state=e;break}else if(e===bg.INSERT)switch(this.state){case bg.UNKNOWN:break;default:this.state=e;break}else if(e===bg.DELETE)switch(this.state){case bg.INSERT:break;case bg.DELETE:break;case bg.UNKNOWN:case bg.UPDATE:this.state=e;break}else e===bg.UNKNOWN&&(this.state=e)}}class Ine{constructor(e){this.data=null,this.keepData=!1,H.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class yz extends Ine{constructor(e){super(e),this.indent=" ",this.space=" ",this.newline=`
`,this.level=0,this.pretty=!1,this.nativeJSON=function(){return!!(window.JSON&&typeof JSON.parse=="function"&&typeof JSON.stringify=="function")}(),this.CLASS_NAME="SuperMap.Format.JSON",this.serialize={object:function(t){if(t==null)return"null";if(t.constructor===Date)return this.serialize.date.apply(this,[t]);if(t.constructor===Array)return this.serialize.array.apply(this,[t]);var r=["{"];this.level+=1;var i,a,o,s=!1;for(i in t)t.hasOwnProperty(i)&&(a=this.write.apply(this,[i,this.pretty]),o=this.write.apply(this,[t[i],this.pretty]),a!=null&&o!=null&&(s&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),a,":",this.writeSpace(),o),s=!0));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"}"),r.join("")},array:function(t){var r,i=["["];this.level+=1;for(var a=0,o=t.length;a<o;++a)r=this.write.apply(this,[t[a],this.pretty]),r!=null&&(a>0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),r));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(t){var r={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(t)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(i,a){var o=r[a];return o||(o=a.charCodeAt(),"\\u00"+Math.floor(o/16).toString(16)+(o%16).toString(16))})+'"':'"'+t+'"'},number:function(t){return isFinite(t)?String(t):"null"},boolean:function(t){return String(t)},date:function(t){function r(i){return i<10?"0"+i:i}return'"'+t.getFullYear()+"-"+r(t.getMonth()+1)+"-"+r(t.getDate())+"T"+r(t.getHours())+":"+r(t.getMinutes())+":"+r(t.getSeconds())+'"'}}}read(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch{return{data:e}}return this.keepData&&(this.data=r),r}write(e,t){this.pretty=!!t;var r=null,i=typeof e;if(this.serialize[i])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[i].apply(this,[e])}catch{}return r}writeIndent(){var e=[];if(this.pretty)for(var t=0;t<this.level;++t)e.push(this.indent);return e.join("")}writeNewline(){return this.pretty?this.newline:""}writeSpace(){return this.pretty?this.space:""}}class uh extends yz{constructor(e){super(e),this.ignoreExtraDims=!0,this.CLASS_NAME="SuperMap.Format.GeoJSON",this.parseCoords={point:function(t){if(this.ignoreExtraDims===!1&&t.length!=2)throw"Only 2D points are supported: "+t;return new Ki(t[0],t[1])},multipoint:function(t){for(var r=[],i=null,a=0,o=t.length;a<o;++a){try{i=this.parseCoords.point.apply(this,[t[a]])}catch(s){throw s}r.push(i)}return new HE(r)},linestring:function(t){for(var r=[],i=null,a=0,o=t.length;a<o;++a){try{i=this.parseCoords.point.apply(this,[t[a]])}catch(s){throw s}r.push(i)}return new Vl(r)},multilinestring:function(t){for(var r=[],i=null,a=0,o=t.length;a<o;++a){try{i=this.parseCoords.linestring.apply(this,[t[a]])}catch(s){throw s}r.push(i)}return new _E(r)},polygon:function(t){for(var r=[],i,a,o=0,s=t.length;o<s;++o){try{a=this.parseCoords.linestring.apply(this,[t[o]])}catch(l){throw l}i=new tv(a.components),r.push(i)}return new _p(r)},multipolygon:function(t){for(var r=[],i=null,a=0,o=t.length;a<o;++a){try{i=this.parseCoords.polygon.apply(this,[t[a]])}catch(s){throw s}r.push(i)}return new A1(r)},box:function(t){if(t.length!=2)throw"GeoJSON box coordinates must have 2 elements";return new _p([new tv([new Ki(t[0][0],t[0][1]),new Ki(t[1][0],t[0][1]),new Ki(t[1][0],t[1][1]),new Ki(t[0][0],t[1][1]),new Ki(t[0][0],t[0][1])])])}},this.extract={feature:function(t){var r=this.extract.geometry.apply(this,[t.geometry]),i={type:"Feature",properties:this.createAttributes(t),geometry:r};return t.geometry&&t.geometry.type==="TEXT"&&(i.properties.texts=t.geometry.texts,i.properties.textStyle=t.geometry.textStyle),t.fid&&(i.id=t.fid),t.ID&&(i.id=t.ID),i},geometry:function(t){if(t==null)return null;!t.parts&&t.points&&(t.parts=[t.points.length]);var r=t.hasOwnProperty("geometryType")?t:new Vo(t).toGeometry()||t,i=r.geometryType||r.type,a;i==="LinearRing"&&(i="LineString"),i==="LINEM"&&(i="MultiLineString"),a=this.extract[i.toLowerCase()].apply(this,[r]),i=i==="TEXT"?"Point":i;var o;return i==="Collection"?o={type:"GeometryCollection",geometries:a}:o={type:i,coordinates:a},o},point:function(t){var r=[t.x,t.y];for(var i in t)i!=="x"&&i!=="y"&&t[i]!==null&&!isNaN(t[i])&&r.push(t[i]);return r},text:function(t){return[t.points[0].x,t.points[0].y]},multipoint:function(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extract.point.apply(this,[t.components[i]]));return r},linestring:function(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extract.point.apply(this,[t.components[i]]));return r},multilinestring:function(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extract.linestring.apply(this,[t.components[i]]));return r},polygon:function(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extract.linestring.apply(this,[t.components[i]]));return r},multipolygon:function(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extract.polygon.apply(this,[t.components[i]]));return r},collection:function(t){for(var r=t.components.length,i=new Array(r),a=0;a<r;++a)i[a]=this.extract.geometry.apply(this,[t.components[a]]);return i}}}read(e,t,r){t=t||"FeatureCollection";var i=null,a=null;if(typeof e=="string"?a=super.read(e,r):a=e,a){if(typeof a.type=="string"){if(this.isValidType(a,t))switch(t){case"Geometry":try{i=this.parseGeometry(a)}catch{}break;case"Feature":try{i=this.parseFeature(a),i.type="Feature"}catch{}break;case"FeatureCollection":switch(i=[],a.type){case"Feature":try{i.push(this.parseFeature(a))}catch{i=null}break;case"FeatureCollection":for(var o=0,s=a.features.length;o<s;++o)try{i.push(this.parseFeature(a.features[o]))}catch{i=null}break;default:try{var l=this.parseGeometry(a);i.push(new sc(l))}catch{i=null}}break}}}return i}write(e,t){return super.write(this.toGeoJSON(e),t)}fromGeoJSON(e,t,r){let i=this.read(e,t,r);return H.isArray(i)?i.map(a=>this._toiSevrerFeature(a)):this._toiSevrerFeature(i)}toGeoJSON(e){var t={type:null};if(H.isArray(e)){t.type="FeatureCollection";var r=e.length;t.features=new Array(r);for(var i=0;i<r;++i){var a=e[i];if(o(a)){let s={};s.geometry=a,t.features[i]=this.extract.feature.apply(this,[s])}else t.features[i]=this.extract.feature.apply(this,[a])}}else if(o(e)){let s={};s.geometry=e,t=this.extract.feature.apply(this,[s])}else t=this.extract.feature.apply(this,[e]);function o(s){return s.hasOwnProperty("parts")&&s.hasOwnProperty("points")||s.hasOwnProperty("geoParts")}return t}isValidType(e,t){var r=!1;switch(t){case"Geometry":H.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],e.type)==-1||(r=!0);break;case"FeatureCollection":r=!0;break;default:e.type==t&&(r=!0)}return r}parseFeature(e){var t,r,i,a;i=e.properties?e.properties:{},a=e.geometry&&e.geometry.bbox||e.bbox;try{r=this.parseGeometry(e.geometry)}catch(o){throw o}return t=new sc(r,i),a&&(t.bounds=po.fromArray(a)),e.id&&(t.geometry.id=e.id,t.fid=e.id),t}parseGeometry(e){if(e==null)return null;var t;if(e.type=="GeometryCollection"){if(!H.isArray(e.geometries))throw"GeometryCollection must have geometries array: "+e;for(var r=e.geometries.length,i=new Array(r),a=0;a<r;++a)i[a]=this.parseGeometry.apply(this,[e.geometries[a]]);t=new O0(i)}else{if(!H.isArray(e.coordinates))throw"Geometry must have coordinates array: "+e;if(!this.parseCoords[e.type.toLowerCase()])throw"Unsupported geometry type: "+e.type;try{t=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(o){throw o}}return t}createCRSObject(e){var t=e.layer.projection.toString(),r={};if(t.match(/epsg:/i)){var i=parseInt(t.substring(t.indexOf(":")+1));i==4326?r={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:r={type:"name",properties:{name:"EPSG:"+i}}}return r}_toiSevrerFeature(e){const t=e.attributes,r=[],i=[];for(var a in t)r.push(a),i.push(t[a]);const o={fieldNames:r,fieldValues:i,geometry:Vo.fromGeometry(e.geometry)};return o.geometry.id=e.fid,o}createAttributes(e){if(!e)return null;var t={};a(e,t);var r=["fieldNames","fieldValues","geometry","stringID","ID"];for(var i in e)r.indexOf(i)>-1||(t[i]=e[i]);function a(o,s){if(!!(o.hasOwnProperty("fieldNames")&&o.hasOwnProperty("fieldValues"))){var l=o.fieldNames,u=o.fieldValues;for(var h in l)s[l[h]]=u[h]}}return t}}class Zat extends Ine{constructor(e){super(e),this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},this.CLASS_NAME="SuperMap.Format.WKT",this.extract={point:function(t){return t.x+" "+t.y},multipoint(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push("("+this.extract.point.apply(this,[t.components[i]])+")");return r.join(",")},linestring(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extract.point.apply(this,[t.components[i]]));return r.join(",")},multilinestring(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push("("+this.extract.linestring.apply(this,[t.components[i]])+")");return r.join(",")},polygon(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push("("+this.extract.linestring.apply(this,[t.components[i]])+")");return r.join(",")},multipolygon(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push("("+this.extract.polygon.apply(this,[t.components[i]])+")");return r.join(",")},collection(t){for(var r=[],i=0,a=t.components.length;i<a;++i)r.push(this.extractGeometry.apply(this,[t.components[i]]));return r.join(",")}},this.parse={point:function(t){var r=ad.trim(t).split(this.regExes.spaces);return new sc(new Ki(r[0],r[1]))},multipoint:function(t){for(var r,i=ad.trim(t).split(","),a=[],o=0,s=i.length;o<s;++o)r=i[o].replace(this.regExes.trimParens,"$1"),a.push(this.parse.point.apply(this,[r]).geometry);return new sc(new HE(a))},linestring:function(t){for(var r=ad.trim(t).split(","),i=[],a=0,o=r.length;a<o;++a)i.push(this.parse.point.apply(this,[r[a]]).geometry);return new sc(new Vl(i))},multilinestring:function(t){for(var r,i=ad.trim(t).split(this.regExes.parenComma),a=[],o=0,s=i.length;o<s;++o)r=i[o].replace(this.regExes.trimParens,"$1"),a.push(this.parse.linestring.apply(this,[r]).geometry);return new sc(new _E(a))},polygon:function(t){for(var r,i,a,o=ad.trim(t).split(this.regExes.parenComma),s=[],l=0,u=o.length;l<u;++l)r=o[l].replace(this.regExes.trimParens,"$1"),i=this.parse.linestring.apply(this,[r]).geometry,a=new tv(i.components),s.push(a);return new sc(new _p(s))},multipolygon:function(t){for(var r,i=ad.trim(t).split(this.regExes.doubleParenComma),a=[],o=0,s=i.length;o<s;++o)r=i[o].replace(this.regExes.trimParens,"$1"),a.push(this.parse.polygon.apply(this,[r]).geometry);return new sc(new A1(a))},geometrycollection:function(t){t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=ad.trim(t).split("|"),i=[],a=0,o=r.length;a<o;++a)i.push(this.read(r[a]));return i}}}read(e){var t,r,i;e=e.replace(/[\n\r]/g," ");var a=this.regExes.typeStr.exec(e);return a&&(r=a[1].toLowerCase(),i=a[2],this.parse[r]&&(t=this.parse[r].apply(this,[i]))),t}write(e){var t,r,i;e.constructor===Array?(t=e,i=!0):(t=[e],i=!1);var a=[];i&&a.push("GEOMETRYCOLLECTION(");for(var o=0,s=t.length;o<s;++o)i&&o>0&&a.push(","),r=t[o].geometry,a.push(this.extractGeometry(r));return i&&a.push(")"),a.join("")}extractGeometry(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[t])return null;var r=t==="collection"?"GEOMETRYCOLLECTION":t.toUpperCase(),i=r+"("+this.extract[t].apply(this,[e])+")";return i}}var Kat="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII=";class POe{constructor(e){var t=this;e=e||{},this.speed=e.speed&&e.speed>=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&e.startTime!=null?e.startTime:0,this.endTime=e.endTime&&e.endTime!=null&&e.endTime>=t.startTime?e.endTime:+new Date,this.repeat=e.repeat!==void 0?e.repeat:!0,this.reverse=e.reverse!==void 0?e.reverse:!1,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],t.events=new y0(this,null,this.EVENT_TYPES),t.speed=Number(t.speed),t.frequency=Number(t.frequency),t.startTime=Number(t.startTime),t.endTime=Number(t.endTime),t.startTime=Date.parse(new Date(t.startTime)),t.endTime=Date.parse(new Date(t.endTime)),t.currentTime=t.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"}updateOptions(e){var t=this;e=e||{},e.speed&&e.speed>=0&&(t.speed=e.speed,t.speed=Number(t.speed)),e.speed&&e.frequency>=0&&(t.frequency=e.frequency,t.frequency=Number(t.frequency)),e.startTime&&e.startTime!=null&&(t.startTime=e.startTime,t.startTime=Date.parse(new Date(t.startTime))),e.endTime&&e.endTime!=null&&e.endTime>=t.startTime&&(t.endTime=e.endTime,t.endTime=Date.parse(new Date(t.endTime))),e.repeat!=null&&(t.repeat=e.repeat),e.reverse!=null&&(t.reverse=e.reverse)}start(){var e=this;e.running||(e.running=!0,e.tick(),e.events.triggerEvent("start",e.currentTime))}pause(){var e=this;e.running=!1,e.events.triggerEvent("pause",e.currentTime)}stop(){var e=this;e.currentTime=e.startTime,e.running&&(e.running=!1),e.events.triggerEvent("stop",e.currentTime)}toggle(){var e=this;e.running?e.pause():e.start()}setSpeed(e){var t=this;return e>=0?(t.speed=e,!0):!1}getSpeed(){return this.speed}setFrequency(e){var t=this;return e>=0?(t.frequency=e,!0):!1}getFrequency(){return this.frequency}setStartTime(e){var t=this;return e=Date.parse(new Date(e)),e>t.endTime?!1:(t.startTime=e,t.currentTime<t.startTime&&(t.currentTime=t.startTime,t.tick()),!0)}getStartTime(){return this.startTime}setEndTime(e){var t=this;return t.endTime=Date.parse(new Date(t.endTime)),e<t.startTime?!1:(t.endTime=e,t.currentTime>=t.endTime&&(t.currentTime=t.startTime,t.tick()),!0)}getEndTime(){return this.endTime}setCurrentTime(e){var t=this;return t.currentTime=Date.parse(new Date(t.currentTime)),e>=t.startTime&&e<=t.endTime?(t.currentTime=e,t.startTime=t.currentTime,t.tick(),!0):!1}getCurrentTime(){return this.currentTime}setRepeat(e){this.repeat=e}getRepeat(){return this.repeat}setReverse(e){this.reverse=e}getReverse(){return this.reverse}getRunning(){return this.running}destroy(){var e=this;e.speed=null,e.frequency=null,e.startTime=null,e.endTime=null,e.currentTime=null,e.repeat=null,e.running=!1,e.reverse=null}tick(){}}class Jat extends POe{constructor(e,t){super(t);var r=this;r.callback=e,Function.prototype.bind||(Function.prototype.bind=function(i){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var a=Array.prototype.slice.call(arguments,1),o=this,s=function(){},l=function(){return o.apply(this instanceof s&&i?this:i,a.concat(Array.prototype.slice.call(arguments)))};return s.prototype=this.prototype,l.prototype=new s,l}),r.update=r.update.bind(r),r.oldTime=r.currentTime,r.CLASS_NAME="SuperMap.TimeFlowControl"}updateOptions(e){e=e||{},super.updateOptions(e)}start(){var e=this;e.running||(e.running=!0,e.reverse?e.currentTime===e.startTime&&(e.oldTime=e.endTime,e.currentTime=e.oldTime):e.oldTime===e.endTime&&(e.currentTime=e.startTime,e.oldTime=e.currentTime),e.tick())}stop(){super.stop();var e=this;e.oldTime=e.currentTime,e.running&&(e.running=!1),e.intervalId&&window.clearTimeout(e.intervalId)}destroy(){super.destroy();var e=this;e.oldTime=null,e.callback=null}tick(){var e=this;e.intervalId&&window.clearInterval(e.intervalId),e.intervalId=null,e.update(),e.intervalId=window.setInterval(e.update,e.frequency)}update(){var e=this;if(!!e.running)if(e.callback&&e.callback(e.currentTime),e.reverse){if(e.currentTime===e.startTime){if(!e.repeat)return e.running=!1,null;e.oldTime=e.endTime,e.currentTime=e.oldTime}else e.currentTime=e.oldTime,e.oldTime-=e.speed;e.oldTime<=e.startTime&&(e.oldTime=e.startTime)}else{if(e.currentTime===e.endTime){if(!e.repeat)return e.running=!1,e.stop(),null;e.stop(),e.currentTime=e.startTime,e.oldTime=e.currentTime,e.start()}else e.oldTime=e.currentTime,e.currentTime+=e.speed;e.currentTime>=e.endTime&&(e.currentTime=e.endTime)}}}(function(n,e){(function(t,r){r()})(at,function(){function t(g){var m=this.constructor;return this.then(function(y){return m.resolve(g()).then(function(){return y})},function(y){return m.resolve(g()).then(function(){return m.reject(y)})})}function r(g){var m=this;return new m(function(y,_){if(!(g&&typeof g.length<"u"))return _(new TypeError(typeof g+" "+g+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var x=Array.prototype.slice.call(g);if(x.length===0)return y([]);var S=x.length;function w(E,T){if(T&&(typeof T=="object"||typeof T=="function")){var C=T.then;if(typeof C=="function"){C.call(T,function(A){w(E,A)},function(A){x[E]={status:"rejected",reason:A},--S===0&&y(x)});return}}x[E]={status:"fulfilled",value:T},--S===0&&y(x)}for(var b=0;b<x.length;b++)w(b,x[b])})}var i=setTimeout;function a(g){return Boolean(g&&typeof g.length<"u")}function o(){}function s(g,m){return function(){g.apply(m,arguments)}}function l(g){if(!(this instanceof l))throw new TypeError("Promises must be constructed via new");if(typeof g!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],v(g,this)}function u(g,m){for(;g._state===3;)g=g._value;if(g._state===0){g._deferreds.push(m);return}g._handled=!0,l._immediateFn(function(){var y=g._state===1?m.onFulfilled:m.onRejected;if(y===null){(g._state===1?h:c)(m.promise,g._value);return}var _;try{_=y(g._value)}catch(x){c(m.promise,x);return}h(m.promise,_)})}function h(g,m){try{if(m===g)throw new TypeError("A promise cannot be resolved with itself.");if(m&&(typeof m=="object"||typeof m=="function")){var y=m.then;if(m instanceof l){g._state=3,g._value=m,f(g);return}else if(typeof y=="function"){v(s(y,m),g);return}}g._state=1,g._value=m,f(g)}catch(_){c(g,_)}}function c(g,m){g._state=2,g._value=m,f(g)}function f(g){g._state===2&&g._deferreds.length===0&&l._immediateFn(function(){g._handled||l._unhandledRejectionFn(g._value)});for(var m=0,y=g._deferreds.length;m<y;m++)u(g,g._deferreds[m]);g._deferreds=null}function d(g,m,y){this.onFulfilled=typeof g=="function"?g:null,this.onRejected=typeof m=="function"?m:null,this.promise=y}function v(g,m){var y=!1;try{g(function(_){y||(y=!0,h(m,_))},function(_){y||(y=!0,c(m,_))})}catch(_){if(y)return;y=!0,c(m,_)}}l.prototype.catch=function(g){return this.then(null,g)},l.prototype.then=function(g,m){var y=new this.constructor(o);return u(this,new d(g,m,y)),y},l.prototype.finally=t,l.all=function(g){return new l(function(m,y){if(!a(g))return y(new TypeError("Promise.all accepts an array"));var _=Array.prototype.slice.call(g);if(_.length===0)return m([]);var x=_.length;function S(b,E){try{if(E&&(typeof E=="object"||typeof E=="function")){var T=E.then;if(typeof T=="function"){T.call(E,function(C){S(b,C)},y);return}}_[b]=E,--x===0&&m(_)}catch(C){y(C)}}for(var w=0;w<_.length;w++)S(w,_[w])})},l.allSettled=r,l.resolve=function(g){return g&&typeof g=="object"&&g.constructor===l?g:new l(function(m){m(g)})},l.reject=function(g){return new l(function(m,y){y(g)})},l.race=function(g){return new l(function(m,y){if(!a(g))return y(new TypeError("Promise.race accepts an array"));for(var _=0,x=g.length;_<x;_++)l.resolve(g[_]).then(m,y)})},l._immediateFn=typeof setImmediate=="function"&&function(g){setImmediate(g)}||function(g){i(g,0)},l._unhandledRejectionFn=function(m){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",m)};var p=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof at<"u")return at;throw new Error("unable to locate global object")}();typeof p.Promise!="function"?p.Promise=l:(p.Promise.prototype.finally||(p.Promise.prototype.finally=t),p.Promise.allSettled||(p.Promise.allSettled=r))})})();var Qat={exports:{}};(function(n){(function(e){if(!e.__disableNativeFetch&&e.fetch)return;function t(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(y))throw new TypeError("Invalid character in header field name");return y.toLowerCase()}function r(y){return typeof y!="string"&&(y=String(y)),y}function i(y){this.map={},y instanceof i?y.forEach(function(_,x){this.append(x,_)},this):y&&Object.getOwnPropertyNames(y).forEach(function(_){this.append(_,y[_])},this)}i.prototype.append=function(y,_){y=t(y),_=r(_);var x=this.map[y];x||(x=[],this.map[y]=x),x.push(_)},i.prototype.delete=function(y){delete this.map[t(y)]},i.prototype.get=function(y){var _=this.map[t(y)];return _?_[0]:null},i.prototype.getAll=function(y){return this.map[t(y)]||[]},i.prototype.has=function(y){return this.map.hasOwnProperty(t(y))},i.prototype.set=function(y,_){this.map[t(y)]=[r(_)]},i.prototype.forEach=function(y,_){Object.getOwnPropertyNames(this.map).forEach(function(x){this.map[x].forEach(function(S){y.call(_,S,x,this)},this)},this)};function a(y){if(y.bodyUsed)return Promise.reject(new TypeError("Already read"));y.bodyUsed=!0}function o(y){return new Promise(function(_,x){y.onload=function(){_(y.result)},y.onerror=function(){x(y.error)}})}function s(y){var _=new FileReader;return _.readAsArrayBuffer(y),o(_)}function l(y,_){var x=new FileReader,S=_.headers.map["content-type"]?_.headers.map["content-type"].toString():"",w=/charset\=[0-9a-zA-Z\-\_]*;?/,b=y.type.match(w)||S.match(w),E=[y];return b&&E.push(b[0].replace(/^charset\=/,"").replace(/;$/,"")),x.readAsText.apply(x,E),o(x)}var u={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};function h(){return this.bodyUsed=!1,this._initBody=function(y,_){if(this._bodyInit=y,typeof y=="string")this._bodyText=y;else if(u.blob&&Blob.prototype.isPrototypeOf(y))this._bodyBlob=y,this._options=_;else if(u.formData&&FormData.prototype.isPrototypeOf(y))this._bodyFormData=y;else if(!y)this._bodyText="";else if(!(u.arrayBuffer&&ArrayBuffer.prototype.isPrototypeOf(y)))throw new Error("unsupported BodyInit type")},u.blob?(this.blob=function(){var y=a(this);if(y)return y;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var y=a(this);if(y)return y;if(this._bodyBlob)return l(this._bodyBlob,this._options);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var y=a(this);return y||Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(y){var _=y.toUpperCase();return c.indexOf(_)>-1?_:y}function d(y,_){_=_||{};var x=_.body;if(d.prototype.isPrototypeOf(y)){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,_.headers||(this.headers=new i(y.headers)),this.method=y.method,this.mode=y.mode,x||(x=y._bodyInit,y.bodyUsed=!0)}else this.url=y;if(this.credentials=_.credentials||this.credentials||"omit",(_.headers||!this.headers)&&(this.headers=new i(_.headers)),this.method=f(_.method||this.method||"GET"),this.mode=_.mode||this.mode||null,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x,_)}d.prototype.clone=function(){return new d(this)};function v(y){var _=new FormData;return y.trim().split("&").forEach(function(x){if(x){var S=x.split("="),w=S.shift().replace(/\+/g," "),b=S.join("=").replace(/\+/g," ");_.append(decodeURIComponent(w),decodeURIComponent(b))}}),_}function p(y){var _=new i,x=y.getAllResponseHeaders().trim().split(`
`);return x.forEach(function(S){var w=S.trim().split(":"),b=w.shift().trim(),E=w.join(":").trim();_.append(b,E)}),_}h.call(d.prototype);function g(y,_){_||(_={}),this._initBody(y,_),this.type="default",this.status=_.status,this.ok=this.status>=200&&this.status<300,this.statusText=_.statusText,this.headers=_.headers instanceof i?_.headers:new i(_.headers),this.url=_.url||""}h.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},g.error=function(){var y=new g(null,{status:0,statusText:""});return y.type="error",y};var m=[301,302,303,307,308];g.redirect=function(y,_){if(m.indexOf(_)===-1)throw new RangeError("Invalid status code");return new g(null,{status:_,headers:{location:y}})},e.Headers=i,e.Request=d,e.Response=g,e.fetch=function(y,_){return new Promise(function(x,S){var w;d.prototype.isPrototypeOf(y)&&!_?w=y:w=new d(y,_);var b=new XMLHttpRequest;function E(){if("responseURL"in b)return b.responseURL;if(/^X-Request-URL:/m.test(b.getAllResponseHeaders()))return b.getResponseHeader("X-Request-URL")}var T=!1;function C(){if(b.readyState===4){var A=b.status===1223?204:b.status;if(A<100||A>599){if(T)return;T=!0,S(new TypeError("Network request failed"));return}var M={status:A,statusText:b.statusText,headers:p(b),url:E()},I="response"in b?b.response:b.responseText;T||(T=!0,x(new g(I,M)))}}b.onreadystatechange=C,b.onload=C,b.onerror=function(){T||(T=!0,S(new TypeError("Network request failed")))},b.open(w.method,w.url,!0);try{w.credentials==="include"&&("withCredentials"in b?b.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(A){console&&console.warn&&console.warn("set withCredentials error:"+A)}"responseType"in b&&u.blob&&(b.responseType="blob"),w.headers.forEach(function(A,M){b.setRequestHeader(M,A)}),b.send(typeof w._bodyInit>"u"?null:w._bodyInit)})},e.fetch.polyfill=!0,n.exports&&(n.exports=e.fetch)})(typeof self<"u"?self:at)})(Qat);var QZ={exports:{}};(function(n,e){(function(t,r){r(e,n)})(at,function(t,r){var i={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function a(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function o(u){try{delete window[u]}catch{window[u]=void 0}}function s(u){var h=document.getElementById(u);h&&document.getElementsByTagName("head")[0].removeChild(h)}function l(u){var h=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],c=u,f=h.timeout||i.timeout,d=h.jsonpCallback||i.jsonpCallback,v=void 0;return new Promise(function(p,g){var m=h.jsonpCallbackFunction||a(),y=d+"_"+m;window[m]=function(x){p({ok:!0,json:function(){return Promise.resolve(x)}}),v&&clearTimeout(v),s(y),o(m)},c+=c.indexOf("?")===-1?"?":"&";var _=document.createElement("script");_.setAttribute("src",""+c+d+"="+m),h.charset&&_.setAttribute("charset",h.charset),_.id=y,document.getElementsByTagName("head")[0].appendChild(_),v=setTimeout(function(){g(new Error("JSONP request to "+u+" timed out")),o(m),s(y),window[m]=function(){o(m)}},f),_.onerror=function(){g(new Error("JSONP request to "+u+" failed")),o(m),s(y),v&&clearTimeout(v)}})}r.exports=l})})(QZ,QZ.exports);const OOe=QZ.exports;let jde=window.fetch;var zF={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(n){var e=this;for(var t in n){e.queryKeys.push(t),typeof n[t]!="string"&&(n[t]=H.toJSON(n[t]));var r=encodeURIComponent(n[t]);e.queryValues.push(r)}},issue:function(n){for(var e=this,t=e.getUid(),r=n.url,i=[],a=r,o=0,s=e.queryKeys?e.queryKeys.length:0,l=0;l<s;l++)if(a.length+e.queryKeys[l].length+2>=e.limitLength){if(o==0)return!1;i.push(a),a=r,o=0,l--}else if(a.length+e.queryKeys[l].length+2+e.queryValues[l].length>e.limitLength)for(var u=e.queryValues[l];u.length>0;){var h=e.limitLength-a.length-e.queryKeys[l].length-2;a.indexOf("?")>-1?a+="&":a+="?";var c=u.substring(0,h);c.substring(h-1,h)==="%"?(h-=1,c=u.substring(0,h)):c.substring(h-2,h-1)==="%"&&(h-=2,c=u.substring(0,h)),a+=e.queryKeys[l]+"="+c,u=u.substring(h),c.length>0&&(i.push(a),a=r,o=0)}else o++,a.indexOf("?")>-1?a+="&":a+="?",a+=e.queryKeys[l]+"="+e.queryValues[l];return i.push(a),e.send(i,"SuperMapJSONPCallbacks_"+t,n&&n.proxy)},getUid:function(){var n=new Date().getTime(),e=Math.floor(Math.random()*1e17);return n*1e3+e},send:function(n,e,t){var r=n.length;if(r>0)return new Promise(i=>{for(var a=new Date().getTime(),o=0;o<r;o++){var s=n[o];s.indexOf("?")>-1?s+="&":s+="?",s+="sectionCount="+r,s+="&sectionIndex="+o,s+="&jsonpUserID="+a,t&&(s=decodeURIComponent(s),s=t+encodeURIComponent(s)),OOe(s,{jsonpCallbackFunction:e,timeout:3e4}).then(l=>{i(l.json())})}})},GET:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings(n.params),e.issue(n)},POST:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings({requestEntity:n.data}),e.issue(n)},PUT:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings({requestEntity:n.data}),e.issue(n)},DELETE:function(n){var e=this;return e.queryKeys.length=0,e.queryValues.length=0,e.addQueryStrings({requestEntity:n.data}),e.issue(n)}},eK,ROe,eot=function(n){eK=n},DOe=function(){return eK!=null?eK:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},tot=function(n){return ROe=n},tK=function(){return ROe||45e3},li={commit:function(n,e,t,r){switch(n=n&&n.toUpperCase(),n){case"GET":return this.get(e,t,r);case"POST":return this.post(e,t,r);case"PUT":return this.put(e,t,r);case"DELETE":return this.delete(e,t,r);default:return this.get(e,t,r)}},supportDirectRequest:function(n,e){return H.isInTheSameDomain(n)?!0:e.crossOrigin!=null?e.crossOrigin:DOe()||e.proxy},get:function(n,e,t){t=t||{};var r="GET";if(n=H.urlAppend(n,this._getParameterString(e||{})),n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var i={url:n,data:e};return zF.GET(i)}return this.urlIsLong(n)?this._postSimulatie(r,n.substring(0,n.indexOf("?")),e,t):this._fetch(n,e,t,r)},delete:function(n,e,t){t=t||{};var r="DELETE";if(n=H.urlAppend(n,this._getParameterString(e||{})),n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var i={url:n+="&_method=DELETE",data:e};return zF.DELETE(i)}return this.urlIsLong(n)?this._postSimulatie(r,n.substring(0,n.indexOf("?")),e,t):this._fetch(n,e,t,r)},post:function(n,e,t){if(t=t||{},n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var r={url:H.urlAppend(n,"_method=POST"),data:e};return zF.POST(r)}return this._fetch(n,e,t,"POST")},put:function(n,e,t){if(t=t||{},n=this._processUrl(n,t),!this.supportDirectRequest(n,t)){n=n.replace(".json",".jsonp");var r={url:n+="&_method=PUT",data:e};return zF.PUT(r)}return this._fetch(n,e,t,"PUT")},urlIsLong:function(n){for(var e=0,t=null,r=0,i=n.length;r<i;r++)t=n.charCodeAt(r),t<127?e++:128<=t&&t<=2047?e+=2:2048<=t&&t<=65535&&(e+=3);return!(e<2e3)},_postSimulatie:function(n,e,t,r){var i=e.indexOf("?")>-1?"&":"?";return e+=i+"_method="+n,typeof t!="string"&&(t=JSON.stringify(t)),this.post(e,t,r)},_processUrl:function(n,e){if(this._isMVTRequest(n))return n;if(n.indexOf(".json")===-1&&!e.withoutFormatSuffix)if(n.indexOf("?")<0)n+=".json";else{var t=n.split("?");t.length===2&&(n=t[0]+".json?"+t[1])}return e&&e.proxy&&(typeof e.proxy=="function"?n=e.proxy(n):(n=decodeURIComponent(n),n=e.proxy+encodeURIComponent(n))),n},_fetch:function(n,e,t,r){return t=t||{},t.headers=t.headers||{},!t.headers["Content-Type"]&&!FormData.prototype.isPrototypeOf(e)&&(t.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),t.timeout?this._timeout(t.timeout,jde(n,{method:r,headers:t.headers,body:r==="PUT"||r==="POST"?e:void 0,credentials:this._getWithCredentials(t),mode:"cors",timeout:tK()}).then(function(i){return i})):jde(n,{method:r,body:r==="PUT"||r==="POST"?e:void 0,headers:t.headers,credentials:this._getWithCredentials(t),mode:"cors",timeout:tK()}).then(function(i){return i})},_getWithCredentials:function(n){return n.withCredentials===!0?"include":n.withCredentials===!1?"omit":"same-origin"},_fetchJsonp:function(n,e){return e=e||{},OOe(n,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(n,e){return new Promise(function(t,r){setTimeout(function(){r(new Error("timeout"))},n),e.then(t,r)})},_getParameterString:function(n){var e=[];for(var t in n){var r=n[t];if(r!=null&&typeof r!="function"){var i;Array.isArray(r)||r.toString()==="[object Object]"?i=encodeURIComponent(JSON.stringify(r)):i=encodeURIComponent(r),e.push(encodeURIComponent(t)+"="+i)}}return e.join("&")},_isMVTRequest:function(n){return n.indexOf(".mvt")>-1||n.indexOf(".pbf")>-1}};class xs{static generateToken(e,t){var r=this.servers[e];if(!!r)return li.post(r.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(i){return i.text()})}static registerServers(e){this.servers=this.servers||{},H.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var r=e[t];this.servers[r.server]=r}}static registerToken(e,t){if(this.tokens=this.tokens||{},!(!e||!t)){var r=this._getTokenStorageKey(e);this.tokens[r]=t}}static registerKey(e,t){if(this.keys=this.keys||{},!(!e||e.length<1||!t)){e=H.isArray(e)?e:[e];for(var r=0;r<e.length;r++){var i=this._getUrlRestString(e[0])||e[0];this.keys[i]=t}}}static getServerInfo(e){return this.servers=this.servers||{},this.servers[e]}static getToken(e){if(!!e){this.tokens=this.tokens||{};var t=this._getTokenStorageKey(e);return this.tokens[t]}}static getKey(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;return this.keys[t]}static loginiServer(e,t,r,i){e=H.urlPathAppend(e,"services/security/login");var a={username:t&&t.toString(),password:r&&r.toString(),rememberme:i};a=JSON.stringify(a);var o={headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}};return li.post(e,a,o).then(function(s){return s.json()})}static logoutiServer(e){e=H.urlPathAppend(e,"services/security/logout");var t={headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withoutFormatSuffix:!0};return li.get(e,"",t).then(function(){return!0}).catch(function(){return!1})}static loginOnline(e,t){var r=xs.SSO+"/login?service="+e;this._open(r,t)}static loginiPortal(e,t,r){e=H.urlPathAppend(e,"web/login");var i={username:t&&t.toString(),password:r&&r.toString()};i=JSON.stringify(i);var a={headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!1};return li.post(e,i,a).then(function(o){return o.json()})}static logoutiPortal(e){e=H.urlPathAppend(e,"services/security/logout");var t={headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!0,withoutFormatSuffix:!0};return li.get(e,"",t).then(function(){return!0}).catch(function(){return!1})}static loginManager(e,t){var r=H.urlPathAppend(e,"/security/tokens"),i=t||{},a={username:i.userName&&i.userName.toString(),password:i.password&&i.password.toString()};a=JSON.stringify(a);var o={headers:{Accept:"*/*","Content-Type":"application/json; charset=UTF-8"}},s=this;return li.post(r,a,o).then(function(l){return l.text()}).then(function(l){return s.imanagerToken=l,l})}static destroyAllCredentials(){this.keys=null,this.tokens=null,this.servers=null}static destroyToken(e){if(!!e){var t=this._getTokenStorageKey(e);this.tokens=this.tokens||{},this.tokens[t]&&delete this.tokens[t]}}static destroyKey(e){if(!!e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;this.keys[t]&&delete this.keys[t]}}static appendCredential(e){var t=e,r=this.getToken(e),i=r?new z8(r,"token"):null;return i||(r=this.getKey(e),i=r?new z8(r,"key"):null),i&&(t=H.urlAppend(t,i.getUrlParameters())),t}static _open(e,t){t=t!=null?t:!0;var r=window.screen.availWidth/2-this.INNER_WINDOW_WIDTH/2,i=window.screen.availHeight/2-this.INNER_WINDOW_HEIGHT/2,a="height="+this.INNER_WINDOW_HEIGHT+", width="+this.INNER_WINDOW_WIDTH+",top="+i+", left="+r+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";t?window.open(e,"login"):window.open(e,"login",a)}static _getTokenStorageKey(e){var t=/(.*?):\/\/([^\/]+)/i,r=e.match(t);return r?r[0]:e}static _getUrlRestString(e){if(!e)return e;var t=/(http|https):\/\/(.*\/rest)/i,r=e.match(t);return r?r[0]:e}}xs.INNER_WINDOW_WIDTH=600;xs.INNER_WINDOW_HEIGHT=600;xs.SSO="https://sso.supermap.com";xs.ONLINE="https://www.supermapol.com";class NOe{constructor(e,t){if(e){var r=e.substr(e.length-1,1);this.serviceUrl=r==="/"?e.substr(0,e.length-2):e}this.options=t||{},this.CLASS_NAME="SuperMap.iManagerServiceBase"}request(e,t,r,i){i=i||{headers:{Accept:"*/*","Content-Type":"application/json"}},i.crossOrigin=this.options.crossOrigin,i.headers=this.options.headers;var a=xs.imanagerToken;return a&&(i.headers||(i.headers={}),i.headers["X-Auth-Token"]=a),r&&(r=JSON.stringify(r)),li.commit(e,t,r,i).then(function(o){return o.json()})}}class rK{constructor(e){e=e||{},this.nodeSpec="SMALL",this.nodeCount=1,this.nodeName="",this.password="",this.description="",this.physicalMachineName="",this.ips=[],this.userName="",H.extend(this,e)}}class rot extends NOe{constructor(e){super(e)}load(){return this.request("GET",this.serviceUrl+"/web/api/service.json")}createIServer(e){return this.request("POST",this.serviceUrl+"/cloud/web/nodes/server.json",new rK(e))}createIPortal(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/portal.json",new rK(e))}iServerList(){return this.request("GET",this.serviceUrl+"/cloud/web/nodes/server.json")}iPortalList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/portal.json")}startNodes(e){return this.request("POST",this.serviceUrl+"/cloud/web/nodes/started.json",e)}stopNodes(e){return this.request("POST",this.serviceUrl+"/cloud/web/nodes/stopped.json",e)}}class mz{constructor(e,t){t=t||{},this.serviceUrl=e,this.CLASS_NAME="SuperMap.iPortalServiceBase",this.withCredentials=t.withCredentials||!1,this.crossOrigin=t.crossOrigin,this.headers=t.headers}request(e,t,r,i={headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials}){return t=xs.appendCredential(t),li.commit(e,t,r,i).then(function(a){return a.json()})}}class kOe{constructor(e){e=e||{},this.resourceType="",this.pageSize=12,this.currentPage=1,this.orderBy="UPDATETIME",this.orderType="DESC",this.searchType="PUBLIC",this.tags=[],this.dirIds=[],this.resourceSubTypes=[],this.aggregationTypes=[],this.text="",this.groupIds=[],this.departmentIds=[],H.extend(this,e)}}class FOe{constructor(e){e=e||{},this.content=[],this.total=0,this.currentPage=1,this.pageSize=12,this.aggregations=null,H.extend(this,e)}}class BOe extends mz{constructor(e,t){super(e),t=t||{},this.authorizeSetting=[],this.bounds="",this.bounds4326="",this.checkStatus="",this.createTime=0,this.description=null,this.dirId=null,this.epsgCode=0,this.heatLevel=0,this.id=0,this.name="",this.personalDirId=null,this.resourceId=0,this.resourceSubType=null,this.resourceType=null,this.serviceRootUrlId=null,this.tags=null,this.thumbnail=null,this.updateTime=0,this.userName="",this.sourceJSON={},H.extend(this,t),this.resourceUrl=e+"/web/"+this.resourceType.replace("_","").toLowerCase()+"s/"+this.resourceId,this.withCredentials&&(this.resourceUrl=e+"/web/mycontent/"+this.resourceType.replace("_","").toLowerCase()+"s/"+this.resourceId)}load(){var e=this;return e.request("GET",e.resourceUrl+".json").then(function(t){if(t.error)return t;e.sourceJSON=t})}update(){var e=this.resourceType.replace("_","").toLowerCase(),t={headers:{"Content-Type":"application/x-www-form-urlencoded"}};e==="data"&&(this.resourceUrl=this.resourceUrl+"/attributes.json");var r=JSON.stringify(this.sourceJSON);if(e==="service"){var i={authorizeSetting:this.sourceJSON.authorizeSetting,metadata:this.sourceJSON.metadata,tags:this.sourceJSON.tags,thumbnail:this.sourceJSON.thumbnail,tokenRefreshUrl:this.sourceJSON.tokenRefreshUrl};r=JSON.stringify(i)}return this.request("PUT",this.resourceUrl,r,t)}}class GOe{constructor(e){e=e||{},this.ids=[],this.entities=[],this.resourceType="",H.extend(this,e)}}class not extends mz{constructor(e,t){super(e,t),this.iportalUrl=e,t=t||{},this.withCredentials=t.withCredentials||!1}load(){return li.get(this.iportalUrl+"/web")}queryResources(e){if(!(e instanceof kOe))return new Promise(function(i){i("queryParams is not instanceof iPortalQueryParam !")});var t=this,r=this.iportalUrl+"/gateway/catalog/resource/search.json";return e.t=new Date().getTime(),this.request("GET",r,e).then(function(i){var a=[];(i.content||[]).forEach(function(s){a.push(new BOe(t.iportalUrl,s))});let o=new FOe;return o.content=a,o.total=i.total,o.currentPage=i.currentPage,o.pageSize=i.pageSize,o.aggregations=i.aggregations,o})}updateResourcesShareSetting(e){if(!(e instanceof GOe))return new Promise(function(a){a("shareParams is not instanceof iPortalShareParam !")});var t=e.resourceType.replace("_","").toLowerCase()+"s";t==="datas"&&(t="mycontent/"+t);var r={ids:e.ids,entities:e.entities},i=this.iportalUrl+"/web/"+t+"/sharesetting.json";return this.request("PUT",i,JSON.stringify(r)).then(function(a){return a})}}class iot{constructor(e){e=e||{},this.permissionType="",this.entityType="",this.entityName="GUEST",this.entityId=null,H.extend(this,e)}}class nK{constructor(e){e=e||{},this.rootUrl="",this.tags=[],this.entities=[],H.extend(this,e)}}class zOe{constructor(e){e=e||{},this.type="",this.tags=[],this.entities=[],this.metadata={},this.addedMapNames=[],this.addedSceneNames=[],H.extend(this,e)}}class UOe{constructor(e){e=e||{},this.fileName="",this.type="",this.tags=[],this.dataMetaInfo={},H.extend(this,e)}}class iK{constructor(e){e=e||{},this.xField="",this.yField="",this.fileEncoding="UTF-8",this.xIndex=1,this.yIndex=1,this.fieldTypes=[],this.separator="",this.firstRowIsHead=!0,this.url="",this.dataStoreInfo={},H.extend(this,e)}}class VOe{constructor(e){e=e||{},this.type="",this.url="",this.connectionInfo={},H.extend(this,e)}}class $Oe{constructor(e){e=e||{},this.dataBase="",this.server="",H.extend(this,e)}}class aot extends mz{constructor(e){super(e),this.iportalUrl=e}deleteResources(e){var t=e.resourceType.replace("_","").toLowerCase(),r=this.iportalUrl+"/web/"+t+"s.json?ids="+encodeURI(JSON.stringify(e.ids));return t==="data"?(r=this.iportalUrl+"/web/mycontent/datas/delete.json",this.request("POST",r,JSON.stringify(e.ids))):this.request("DELETE",r)}addMap(e){if(!(e instanceof nK))return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},r=this.iportalUrl+"/web/maps/batchaddmaps.json";return this.request("POST",r,JSON.stringify(t)).then(function(i){return i})}addScene(e){if(!(e instanceof nK))return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},r=this.iportalUrl+"/web/scenes/batchaddscenes.json";return this.request("POST",r,JSON.stringify(t)).then(function(i){return i})}registerService(e){if(!(e instanceof zOe))return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");let t={type:e.type,tags:e.tags,authorizeSetting:e.entities,metadata:e.metadata,addedMapNames:e.addedMapNames,addedSceneNames:e.addedSceneNames},r=this.iportalUrl+"/web/services.json";return this.request("POST",r,JSON.stringify(t)).then(i=>i)}getErrMsgPromise(e){return new Promise(t=>{t(e)})}uploadDataRequest(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/upload.json";return this.request("POST",r,t)}addData(e,t){if(!(e instanceof UOe))return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");var r=this.iportalUrl+"/web/mycontent/datas.json",i={fileName:e.fileName,tags:e.tags,type:e.type},a=e.type.toLowerCase(),o;if(a==="excel"||a==="csv"){if(!(e.dataMetaInfo instanceof iK))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");o={xField:e.dataMetaInfo.xField,yField:e.dataMetaInfo.yField},a==="csv"&&(o.fileEncoding=e.dataMetaInfo.fileEncoding),i.coordType="WGS84",i.dataMetaInfo=o}else if(a==="hdfs"||a==="hbase"){if(!(e.dataMetaInfo instanceof iK))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof VOe))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");var s={type:e.dataMetaInfo.dataStoreInfo.type};switch(a){case"hdfs":s.url=e.dataMetaInfo.dataStoreInfo.url,o={url:e.dataMetaInfo.url,dataStoreInfo:s};break;case"hbase":if(!(e.dataMetaInfo.dataStoreInfo.connectionInfo instanceof $Oe))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");s.connectionInfo={dataBase:e.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,server:e.dataMetaInfo.dataStoreInfo.connectionInfo.server,engineType:"HBASE"},s.datastoreType="SPATIAL",o={dataStoreInfo:s};break}i.dataMetaInfo=o}return this.request("POST",r,JSON.stringify(i)).then(l=>a==="hdfs"||a==="hbase"?l:l.childID?this.uploadDataRequest(l.childID,t):l.customResult)}publishOrUnpublish(e,t){if(!e.dataId||!e.serviceType)return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");var r=e.dataId,i=e.dataServiceId,a=e.serviceType,o=this.iportalUrl+"/web/mycontent/datas/"+r+"/publishstatus.json?serviceType="+a;return i&&(o+="&dataServiceId="+i),this.request("PUT",o,JSON.stringify(t)).then(s=>t?(i||(i=s.customResult),i):s)}getDataPublishedStatus(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/publishstatus.json?dataServiceId="+t+"&forPublish=true";return this.request("GET",r)}unPublishDataService(e){return this.publishOrUnpublish(e,!1)}publishDataService(e){return this.publishOrUnpublish(e,!0)}}class ra{constructor(e,t){let r=this;this.EVENT_TYPES=["processCompleted","processFailed"],this.events=null,this.eventListeners=null,this.url=null,this.urls=null,this.proxy=null,this.index=null,this.length=null,this.totalTimes=null,this.POLLING_TIMES=3,this.isInTheSameDomain=null,this.withCredentials=!1,H.isArray(e)?(r.urls=e,r.length=e.length,r.totalTimes=r.length,r.length===1?r.url=e[0]:(r.index=parseInt(Math.random()*r.length),r.url=e[r.index])):(r.totalTimes=1,r.url=e),H.isArray(e)&&!r.isServiceSupportPolling()&&(r.url=e[0],r.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,H.extend(this,t),r.isInTheSameDomain=H.isInTheSameDomain(r.url),r.events=new y0(r,null,r.EVENT_TYPES,!0),r.eventListeners instanceof Object&&r.events.on(r.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;H.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){let t=e.scope.format;if(typeof e.success=="string"&&(e.scope.format=e.success,t=e.success,e.success=null,e.failure=null),t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let r=this;return e.url=e.url||r.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=H.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||r.proxy,e.withCredentials=e.withCredentials!=null?e.withCredentials:r.withCredentials,e.crossOrigin=e.crossOrigin!=null?e.crossOrigin:r.crossOrigin,e.headers=e.headers||r.headers,e.isInTheSameDomain=r.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=xs.appendCredential(e.url),r.calculatePollingTimes(),e.scope=r,r.totalTimes>0?(r.totalTimes--,r.ajaxPolling(e)):r._commit(e)}ajaxPolling(e){let t=this,r=e.url,i=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(i,i.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=H.isInTheSameDomain(r),t._commit(e)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.times<e.totalTimes&&(e.totalTimes=e.times):e.totalTimes>e.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){let e=this;return!(e.CLASS_NAME==="SuperMap.REST.ThemeService"||e.CLASS_NAME==="SuperMap.REST.EditFeaturesService")}transformResult(e,t){return e=H.transformResult(e),{result:e,options:t}}transformErrorResult(e,t){return e=H.transformResult(e),{error:e.error||e,options:t}}serviceProcessCompleted(e,t){e=this.transformResult(e).result,this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){e=this.transformErrorResult(e).error;let r=e.error||e;this.events.triggerEvent("processFailed",{error:r,options:t})}_returnContent(e){return e.scope.format===Ni.FGB?!1:!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER]}_commit(e){if(e.method==="POST"||e.method==="PUT"||e.method==="PATCH")if(e.params&&(e.url=H.urlAppend(e.url,H.getParameterString(e.params||{}))),typeof e.data=="object")try{e.params=H.toJSON(e.data)}catch{console.log("\u4E0D\u662Fjson\u5BF9\u8C61")}else e.params=e.data;return li.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(t){let r=t;return typeof t=="string"&&(r=new yz().read(t)),(!r||r.error||r.code>=300&&r.code!==304)&&(r&&r.error?r={error:r.error}:r={error:r}),r&&e.scope.format===Ni.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(t=>{let r={object:this};if(t.error){const o="processFailed";if(this.events&&this.events.listeners[o]&&this.events.listeners[o].length){var i=e.failure&&(e.scope?UR.bind(e.failure,e.scope):e.failure);i?i(t,e):this.serviceProcessFailed(t,e)}else r={...r,...this.transformErrorResult(t,e)},r.type=o,e.failure&&e.failure(r)}else{const o="processCompleted";if(this.events&&this.events.listeners[o]&&this.events.listeners[o].length){var a=e.success&&(e.scope?UR.bind(e.success,e.scope):e.success);a?a(t,e):this.serviceProcessCompleted(t,e)}else t.succeed=t.succeed==null?!0:t.succeed,r={...r,...this.transformResult(t,e)},r.type=o,e.success&&e.success(r)}return r})}}class WOe{constructor(e){e.filters&&typeof e.filters=="string"&&(e.filters=e.filters.split(",")),this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,H.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class HOe{constructor(e){e.filters&&(e.filters=e.filters.split(",")),this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null,H.extend(this,e)}destroy(){this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null}}class jOe extends ra{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,r){if(t instanceof WOe)return this.processAsync(e,t,r)}decode(e,t,r){if(t instanceof HOe)return this.processAsync(e,t,r)}processAsync(e,t,r){return this.request({method:"GET",url:e,params:t,scope:this,success:r,failure:r})}transformResult(e,t){return e.succeed&&delete e.succeed,{result:e,options:t}}}class Lne{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",H.extend(this,e)}destroy(){var e=this;e.aggName=null,e.aggFieldName=null,e.aggType=null}}class XOe extends Lne{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",H.extend(this,e)}destroy(){var e=this;e.subAggs&&(e.subAggs=null)}}class oot extends Lne{constructor(e){super(),this.aggType=COe.AVG,H.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy();var e=this;e.aggType=null}}class iB{constructor(e){this.dataset=null,this.targetDatasourceName=null,this.totalGridName=null,this.diffuseDatasetGridName=null,this.durationDatasetGridName=null,this.directDatasetGridName=null,this.latitude=null,this.timeMode="MULTIDAYS",this.dayStart=null,this.dayEnd=null,this.hourStart=null,this.hourEnd=null,this.transmittance=null,this.hourInterval=null,this.dayInterval=null,this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.AreaSolarRadiationParameters"}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){var r={};for(var i in e)if(i!=="dataset"){var a=i==="latitude"||i==="timeMode"||i==="dayStart",o=i==="dayEnd"||i==="hourStart"||i==="hourEnd",s=i==="transmittance"||i==="hourInterval"||i==="dayInterval";a||o||s?r[i]=e[i]:t[i]=e[i]}t.parameter=r}}class Hu extends ra{constructor(e,t){super(e,t),this.format=t&&t.format||Ni.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}transformResult(e,t){var r=this,i;if(e=H.transformResult(e),e&&r.format===Ni.GEOJSON&&typeof r.toGeoJSONResult=="function")if(H.isArray(e)){for(var a=0;a<e.length;a++)e[a]=r.toGeoJSONResult(e[a]);i=e}else i=r.toGeoJSONResult(e);return i||(i=e),{result:i,options:t}}toGeoJSONResult(e){if(!e)return null;e.result&&e.result.resultGeometry&&(e=e.result);var t=new uh;if(e.recordsets)for(var r=0,i=e.recordsets,a=i.length;r<a;r++)i[r].features&&(i[r].features=t.toGeoJSON(i[r].features));else e.recordset&&e.recordset.features&&(e.recordset.features=t.toGeoJSON(e.recordset.features));return e.resultGeometry&&(e.resultGeometry=t.toGeoJSON(e.resultGeometry)),e.regions&&(e.regions=t.toGeoJSON(e.regions)),e}}class YOe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.AreaSolarRadiationService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof iB){var r=this,i={};e instanceof iB&&(r.url=H.urlPathAppend(r.url,`datasets/${e.dataset}/solarradiation`)),r.url=H.urlAppend(r.url,"returnContent=true"),iB.toObject(e,i);var a=H.toJSON(i);return r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}}class aK{constructor(e){this.exp=null,this.value=100,H.extend(this,e),this.CLASS_NAME="SuperMap.BufferDistance"}destroy(){this.exp=null,this.value=null}}class qOe{constructor(e){this.endType=cOe.FLAT,this.leftDistance=new aK,this.rightDistance=new aK,this.semicircleLineSegment=4,this.radiusUnit=nOe.METER,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.BufferSetting"}destroy(){let e=this;e.endType=null,e.leftDistance&&(e.leftDistance.destroy(),e.leftDistance=null),e.rightDistance&&(e.rightDistance.destroy(),e.rightDistance=null),e.semicircleLineSegment=null,e.radiusUnit=null}}class Pne{constructor(e){var t=this;t.bufferSetting=new qOe,H.extend(this,e),this.CLASS_NAME="SuperMap.BufferAnalystParameters"}destroy(){var e=this;e.bufferSetting&&(e.bufferSetting.destroy(),e.bufferSetting=null)}}class _z{constructor(e){this.expectCount=1e3,this.dataset=null,this.dataReturnMode=gOe.RECORDSET_ONLY,this.deleteExistResultDataset=!0,H.extend(this,e),this.CLASS_NAME="SuperMap.DataReturnOption"}destroy(){var e=this;e.expectCount=null,e.dataset=null,e.dataReturnMode=null,e.deleteExistResultDataset=null}}class Of{constructor(e){this.attributeFilter=null,this.name=null,this.joinItems=null,this.linkItems=null,this.ids=null,this.orderBy=null,this.groupBy=null,this.fields=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.FilterParameter"}destroy(){var e=this;if(e.attributeFilter=null,e.name=null,e.joinItems){for(let t=0,r=e.joinItems,i=r.length;t<i;t++)r[t].destroy();e.joinItems=null}if(e.linkItems){for(let t=0,r=e.linkItems,i=r.length;t<i;t++)r[t].destroy();e.linkItems=null}e.ids=null,e.orderBy=null,e.groupBy=null,e.fields=null}}class oK extends Pne{constructor(e){super(e),this.dataset=null,this.filterQueryParameter=new Of,this.resultSetting=new _z,this.isAttributeRetained=!0,this.isUnion=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetBufferAnalystParameters"}destroy(){super.destroy();var e=this;e.dataset=null,e.filterQueryParameter&&(e.filterQueryParameter.destroy(),e.filterQueryParameter=null),e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.isAttributeRetained=null,e.isUnion=null}static toObject(e,t){for(var r in e)if(r==="bufferSetting")e.bufferSetting.radiusUnit=e.bufferSetting.radiusUnit.toUpperCase(),t.bufferAnalystParameter=e.bufferSetting;else if(r==="resultSetting")t.dataReturnOption=e.resultSetting;else{if(r==="dataset")continue;t[r]=e[r]}}}class U8 extends Pne{constructor(e){super(e),this.sourceGeometry=null,this.sourceGeometrySRID=null,e&&H.extend(this,e),this.CLASS_NAME=" SuperMap.GeometryBufferAnalystParameters"}destroy(){super.destroy();var e=this;e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null)}static toObject(e,t){for(var r in e)if(r==="bufferSetting"){var i={};for(var a in e.bufferSetting)i[a]=e.bufferSetting[a];t.analystParameter=i}else r==="sourceGeometry"?t.sourceGeometry=Vo.fromGeometry(e.sourceGeometry):t[r]=e[r]}}class ZOe extends Hu{constructor(e,t){super(e,t),this.mode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.BufferAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof oK?(i.mode="datasets",i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/buffer"),oK.toObject(e,r)):e instanceof U8&&(i.mode="geometry",i.url=H.urlPathAppend(i.url,"geometry/buffer"),U8.toObject(e,r));var a=H.toJSON(r);return this.returnContent=!0,i.request({method:"POST",data:a,scope:i,success:t,failure:t})}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class One{constructor(e){this.alias=null,this.connect=null,this.dataBase=null,this.driver=null,this.engineType=null,this.exclusive=null,this.OpenLinkTable=null,this.password=null,this.readOnly=null,this.server=null,this.user=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.DatasourceConnectionInfo"}destroy(){var e=this;e.alias=null,e.connect=null,e.dataBase=null,e.driver=null,e.engineType=null,e.exclusive=null,e.OpenLinkTable=null,e.password=null,e.readOnly=null,e.server=null,e.user=null}}class Cm{constructor(e){this.type=dOe.UDB,this.datasetName="analystResult",this.datasourceInfo=null,this.outputPath="",H.extend(this,e),this.CLASS_NAME="SuperMap.OutputSetting"}destroy(){var e=this;e.type=null,e.datasetName=null,e.outputPath=null,e.datasourceInfo instanceof One&&(e.datasourceInfo.destroy(),e.datasourceInfo=null)}}class Am{constructor(e){this.items=null,this.numericPrecision=1,this.rangeMode=vz.EQUALINTERVAL,this.rangeCount="",this.colorGradientType=i3.YELLOW_RED,H.extend(this,e),this.CLASS_NAME="SuperMap.MappingParameters"}destroy(){var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}class KOe{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=zR.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;H.extend(this,e),this.CLASS_NAME="SuperMap.BuffersAnalystJobsParameter"}destroy(){this.datasetName=null,this.bounds=null,this.distance=null,this.distanceField=null,this.distanceUnit=null,this.dissolveField=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},r==="bounds"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class Mm extends ra{constructor(e,t){t=t||{},super(e,t),this.CLASS_NAME="SuperMap.ProcessingServiceBase"}destroy(){super.destroy()}getJobs(e,t){var r=this;return li.get(xs.appendCredential(e),null,{proxy:r.proxy}).then(function(i){return i.json()}).then(function(i){const a={result:i,object:r,type:"processCompleted"};return t(a),a}).catch(function(i){const a={error:i,object:r,type:"processFailed"};return t(a),a})}addJob(e,t,r,i,a,o){var s=this,l=null;t&&t instanceof r&&(l=new Object,r.toObject(t,l));let u=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s.headers||{});var h={proxy:s.proxy,headers:u,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,isInTheSameDomain:s.isInTheSameDomain};return li.post(xs.appendCredential(e),JSON.stringify(l),h).then(function(c){return c.json()}).then(function(c){return c.succeed?s.transformResult(c,i,a,o):(c=s.transformErrorResult(c),c.options=s,c.type="processFailed",a(c),c)}).catch(function(c){return c=s.transformErrorResult({error:c}),c.options=s,c.type="processFailed",a(c),c})}transformResult(e,t,r,i){e=H.transformResult(e),t=t||1e3;var a=this;if(e)return new Promise(o=>{var s=setInterval(function(){li.get(xs.appendCredential(e.newResourceLocation),{_t:new Date().getTime()}).then(function(l){return l.json()}).then(function(l){if(o({object:a,id:l.id,state:l.state}),i({id:l.id,state:l.state,object:a}),l.state.runState==="LOST"||l.state.runState==="KILLED"||l.state.runState==="FAILED"){clearInterval(s);const u={error:l.state.errorMsg,state:l.state.runState,object:a,type:"processFailed"};o(u),r(u)}if(l.state.runState==="FINISHED"&&l.setting.serviceInfo){clearInterval(s);const u={result:l,object:a,type:"processCompleted"};o(u),r(u)}}).catch(function(l){clearInterval(s);const u={error:l,object:a,type:"processFailed"};o(u),r(u)})},t)})}}class aB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(e){return super.getJobs(this.url,e)}getBuffersJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addBuffersJob(e,t,r,i){return super.addJob(this.url,e,KOe,t,r,i)}}class JOe{constructor(e){var t=this;this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,H.extend(t,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){var e=this;e.sourceNodeIDs=null,e.edgeID=null,e.nodeID=null,e.isUncertainDirectionValid=null}}class Bd extends ra{constructor(e,t){super(e,t),this.format=Ni.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}transformResult(e,t){var r=this,i;return e=H.transformResult(e),e&&r.format===Ni.GEOJSON&&typeof r.toGeoJSONResult=="function"&&(i=r.toGeoJSONResult(e)),i||(i=e),{result:i,options:t}}toGeoJSONResult(e){return null}}class QOe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(!(e instanceof JOe))return null;var r=this,i;if(r.url=H.urlPathAppend(r.url,"burstAnalyse"),i={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},e.edgeID!==null&&e.nodeID!==null)throw new Error("edgeID and nodeID cannot be null at the same time.");if(e.edgeID===null&&e.nodeID===null)throw new Error("edgeID and nodeID cannot be null at the same time.");return e.edgeID!==null?i.edgeID=e.edgeID:i.nodeID=e.nodeID,r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}class eRe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ChartFeatureInfoSpecsService"}destroy(){super.destroy(),H.reset(this)}processAsync(e){var t=this,r="GET";return t.isTempLayers||H.urlPathAppend(t.url,"chartFeatureInfoSpecs"),t.request({method:r,params:null,scope:t,success:e,failure:e})}}class tRe{constructor(e){this.isQueryPoint=null,this.isQueryLine=null,this.isQueryRegion=null,this.attributeFilter=null,this.chartFeatureInfoSpecCode=null,H.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryFilterParameter"}destroy(){var e=this;e.isQueryPoint=null,e.isQueryLine=null,e.isQueryRegion=null,e.attributeFilter=null,e.chartFeatureInfoSpecCode=null}toJson(){var e="";return e+='"isQueryPoint":'+this.isQueryPoint+",",e+='"isQueryLine":'+this.isQueryLine+",",e+='"isQueryRegion":'+this.isQueryRegion+",",this.attributeFilter&&(e+='"attributeFilter": "'+this.attributeFilter+'",'),e+='"chartFeatureInfoSpecCode":'+this.chartFeatureInfoSpecCode,e="{"+e+"}",e}}class rRe{constructor(e){this.queryMode=null,this.bounds=null,this.chartLayerNames=null,this.chartQueryFilterParameters=null,this.returnContent=!0,this.startRecord=0,this.expectCount=null,H.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryParameters"}destroy(){var e=this;e.queryMode=null,e.bounds=null,e.chartLayerNames=null,e.chartQueryFilterParameters=null,e.returnContent=!0,e.startRecord=0,e.expectCount=null}getVariablesJson(){var e="";if(e+='"queryMode":"'+this.queryMode+'",',this.chartLayerNames&&this.chartLayerNames.length){for(var t=[],r=this.chartLayerNames.length,i=0;i<r;i++)t.push('"'+this.chartLayerNames[i]+'"');var a="["+t.join(",")+"]";e+='"chartLayerNames":'+a+","}if(this.queryMode==="ChartBoundsQuery"&&this.bounds&&(e+='"bounds":{"leftBottom":{"x":'+this.bounds.left+',"y":'+this.bounds.bottom+'},"rightTop":{"x":'+this.bounds.right+',"y":'+this.bounds.top+"}},"),this.chartQueryFilterParameters&&this.chartQueryFilterParameters.length){for(var o=[],s=this.chartQueryFilterParameters.length,l=0;l<s;l++){var u=this.chartQueryFilterParameters[l];u instanceof tRe&&o.push(u.toJson())}var h="["+o.join(",")+"]";h='"chartQueryParams":'+h+",",h+='"startRecord":'+this.startRecord+",",h+='"expectCount":'+this.expectCount,h="{"+h+"}",e+='"chartQueryParameters":'+h}return e="{"+e+"}",e}}class OS{constructor(e){!e||(this.customParams=null,this.prjCoordSys=null,this.expectCount=1e5,this.networkType=Lc.LINE,this.queryOption=dz.ATTRIBUTEANDGEOMETRY,this.queryParams=null,this.startRecord=0,this.holdTime=10,this.returnCustomResult=!1,this.returnFeatureWithFieldCaption=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryParameters")}destroy(){var e=this;if(e.customParams=null,e.expectCount=null,e.networkType=null,e.queryOption=null,e.queryParams){for(var t=0,r=e.queryParams,i=r.length;t<i;t++)r[t].destroy();e.queryParams=null}e.startRecord=null,e.holdTime=null,e.returnCustomResult=null,e.prjCoordSys=null}}class nRe extends ra{constructor(e,t){super(e,t),t=t||{},this.returnContent=null,this.format=Ni.GEOJSON,H.extend(this,t);var r=this;t.format&&(r.format=t.format.toUpperCase()),r.url&&(r.url=H.urlPathAppend(r.url,"queryResults"),this.CLASS_NAME="SuperMap.ChartQueryService")}destroy(){var e=this;ra.prototype.destroy.apply(this,arguments),e.returnContent=null,e.format=null}processAsync(e,t){if(e instanceof rRe){var r=this,i;return r.returnContent=e.returnContent,i=e.getVariablesJson(),r.returnContent&&(r.url=H.urlAppend(r.url,"returnContent=true")),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}transformResult(e,t){var r=this;if(e=H.transformResult(e),e&&e.recordsets&&r.format===Ni.GEOJSON){for(var i=0,a=e.recordsets,o=a.length;i<o;i++)if(a[i].features){var s=new uh;a[i].features=s.toGeoJSON(a[i].features)}}return{result:e,options:t}}getQueryParameters(e){return new OS({queryMode:e.queryMode,bounds:e.bounds,chartLayerNames:e.chartLayerNames,chartQueryFilterParameters:e.chartQueryFilterParameters,returnContent:e.returnContent})}}class sot{constructor(e){this.clipDatasetName=null,this.clipDatasourceName=null,this.clipRegion=null,this.isClipInRegion=!0,this.isExactClip=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ClipParameter"}destroy(){var e=this;e.clipDatasetName=null,e.clipDatasourceName=null,e.clipRegion=null,e.isClipInRegion=null,e.isExactClip=null}toJSON(){return H.toJSON({isClipInRegion:this.isClipInRegion,clipDatasetName:this.clipDatasetName,clipDatasourceName:this.clipDatasourceName,isExactClip:this.isExactClip,clipRegion:Vo.fromGeometry(this.clipRegion)})}}class iRe{constructor(e){e=e||{},this.elevation=null,this.color=null,H.extend(this,e);var t=this,r=t.color;r&&(t.color=new Js(r.red,r.green,r.blue)),this.CLASS_NAME="SuperMap.ColorDictionary"}destroy(){H.reset(this)}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e}}class aRe{constructor(e){!e||(this.returnEdgeFeatures=!1,this.returnEdgeGeometry=!1,this.returnEdgeIDs=!1,this.returnNodeFeatures=!1,this.returnNodeGeometry=!1,this.returnNodeIDs=!1,this.returnPathGuides=!1,this.returnRoutes=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.TransportationAnalystResultSetting")}destroy(){var e=this;e.returnEdgeFeatures=null,e.returnEdgeGeometry=null,e.returnEdgeIDs=null,e.returnNodeFeatures=null,e.returnNodeGeometry=null,e.returnNodeIDs=null,e.returnPathGuides=null,e.returnRoutes=null}}class $2{constructor(e){!e||(this.barrierEdgeIDs=null,this.barrierNodeIDs=null,this.barrierPoints=null,this.weightFieldName=null,this.turnWeightField=null,this.resultSetting=new aRe,H.extend(this,e),this.CLASS_NAME="SuperMap.TransportationAnalystParameter")}destroy(){var e=this;if(e.barrierEdgeIDs=null,e.barrierNodeIDs=null,e.weightFieldName=null,e.turnWeightField=null,e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.barrierPoints&&e.barrierPoints.length)for(var t in e.barrierPoints)e.barrierPoints[t].destroy();e.barrierPoints=null}}class oRe{constructor(e){this.isAnalyzeById=!1,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.ComputeWeightMatrixParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class sRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ComputeWeightMatrixService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof oRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"weightmatrix"),i={parameter:H.toJSON(e.parameter),nodes:r.getJson(e.isAnalyzeById,e.nodes)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a<i;a++)a>0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a<i;a++)a>0&&(r+=","),r+=t[a];return r+="]",r}}class lRe extends ra{constructor(e,t){t=t||{},t.EVENT_TYPES=["broadcastSocketConnected","broadcastSocketClosed","broadcastSocketError","broadcastFailed","broadcastSucceeded","subscribeSocketConnected","subscribeSocketClosed","subscribeSocketError","messageSucceeded","setFilterParamSucceeded"],super(e,t),this.geometry=null,this.prjCoordSys=null,this.excludeField=null,H.extend(this,t),this.CLASS_NAME="SuperMap.DataFlowService"}initBroadcast(){var e=this;return this.broadcastWebSocket=this._connect(H.urlPathAppend(e.url,"broadcast")),this.broadcastWebSocket.onopen=function(t){e.broadcastWebSocket.isOpen=!0,t.eventType="broadcastSocketConnected",e.events.triggerEvent("broadcastSocketConnected",t)},this.broadcastWebSocket.onclose=function(t){e.broadcastWebSocket&&(e.broadcastWebSocket.isOpen=!1),t.eventType="broadcastSocketClosed",e.events.triggerEvent("broadcastSocketClosed",t)},this.broadcastWebSocket.onerror=function(t){t.eventType="broadcastSocketError",e.events.triggerEvent("broadcastSocketError",t)},this}broadcast(e){if(!this.broadcastWebSocket||!this.broadcastWebSocket.isOpen){this.events.triggerEvent("broadcastFailed");return}this.broadcastWebSocket.send(JSON.stringify(e)),this.events.triggerEvent("broadcastSucceeded")}initSubscribe(){var e=this;return this.subscribeWebSocket=this._connect(H.urlPathAppend(e.url,"subscribe")),this.subscribeWebSocket.onopen=function(t){e.subscribeWebSocket.send(e._getFilterParams()),t.eventType="subscribeSocketConnected",e.events.triggerEvent("subscribeSocketConnected",t)},this.subscribeWebSocket.onclose=function(t){t.eventType="subscribeWebSocketClosed",e.events.triggerEvent("subscribeWebSocketClosed",t)},this.subscribeWebSocket.onerror=function(t){t.eventType="subscribeSocketError",e.events.triggerEvent("subscribeSocketError",t)},this.subscribeWebSocket.onmessage=function(t){e._onMessage(t)},this}setExcludeField(e){return this.excludeField=e,this.subscribeWebSocket.send(this._getFilterParams()),this}setGeometry(e){return this.geometry=e,this.subscribeWebSocket.send(this._getFilterParams()),this}unSubscribe(){!this.subscribeWebSocket||(this.subscribeWebSocket.close(),this.subscribeWebSocket=null)}unBroadcast(){!this.broadcastWebSocket||(this.broadcastWebSocket.close(),this.broadcastWebSocket=null)}destroy(){ra.prototype.destroy.apply(this,arguments);var e=this;e.geometry=null,e.prjCoordSys=null,e.excludeField=null,this.unBroadcast(),this.unSubscribe()}_getFilterParams(){var e={filterParam:{prjCoordSys:this.prjCoordSys,excludeField:this.excludeField,geometry:this.geometry}};return H.toJSON(e)}_onMessage(e){if(e.data&&e.data.indexOf("filterParam")>=0){var t=JSON.parse(e.data);e.filterParam=t,e.eventType="setFilterParamSucceeded",this.events.triggerEvent("setFilterParamSucceeded",e);return}var r=JSON.parse(e.data);e.featureResult=r,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}_connect(e){if(e=xs.appendCredential(e),"WebSocket"in window)return new WebSocket(e);if("MozWebSocket"in window){var t=window.MozWebSocket;return new t(e)}else return console.log("no WebSocket"),null}}class uRe{constructor(e){e=e||{},this.bounds=null,this.dataSourceName=null,this.description=null,this.encodeType=null,this.isReadOnly=null,this.name=null,this.prjCoordSys=null,this.tableName=null,this.type=null,H.extend(this,e);var t=this.bounds;t&&(this.bounds=new po(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y)),this.CLASS_NAME="SuperMap.DatasetInfo"}destroy(){H.reset(this)}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class Rne{constructor(e){this.operation=fOe.UNION,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.OverlayAnalystParameters"}destroy(){var e=this;e.operation=null}}class sK extends Rne{constructor(e){super(e),this.operateDataset=null,this.operateDatasetFields=[],this.operateDatasetFilter=new Of,this.operateRegions=[],this.sourceDataset=null,this.sourceDatasetFields=[],this.sourceDatasetFilter=new Of,this.tolerance=0,this.resultSetting=new _z,H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetOverlayAnalystParameters"}destroy(){super.destroy();var e=this;if(e.operateDataset=null,e.operateDatasetFields=null,e.operateDatasetFilter&&(e.operateDatasetFilter.destroy(),e.operateDatasetFilter=null),e.operateRegions){for(var t=0,r=e.operateRegions,i=r.length;t<i;t++)r[t].destroy();e.operateRegions=null}e.sourceDataset=null,e.sourceDatasetFields=null,e.sourceDatasetFilter&&(e.sourceDatasetFilter.destroy(),e.sourceDatasetFilter=null),e.tolerance=null,e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null)}static toObject(e,t){for(var r in e)if(r!=="sourceDataset")if(r==="operateRegions"){t.operateRegions=[];var i=e.operateRegions;for(var a in i)i.hasOwnProperty(a)&&(t.operateRegions[a]=Vo.fromGeometry(i[a]))}else r==="resultSetting"?t.dataReturnOption=e.resultSetting:t[r]=e[r]}}class hRe{constructor(e){this.clipRegion=null,this.datumValue=0,this.expectedZValues=null,this.interval=0,this.resampleTolerance=0,this.smoothMethod=vOe.BSPLINE,this.smoothness=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.SurfaceAnalystParametersSetting"}destroy(){var e=this;e.clipRegion&&(e.clipRegion.destroy(),e.clipRegion=null),e.datumValue=null,e.expectedZValues=null,e.interval=null,e.resampleTolerance=null,e.smoothMethod=null,e.smoothness=null}toJSON(){let e="'datumValue':"+H.toJSON(this.datumValue);if(e+=",'interval':"+H.toJSON(this.interval),e+=",'resampleTolerance':"+H.toJSON(this.resampleTolerance),e+=",'smoothMethod':"+H.toJSON(this.smoothMethod),e+=",'smoothness':"+H.toJSON(this.smoothness),this.expectedZValues!=null&&(e+=",'expectedZValues':"+H.toJSON(this.expectedZValues)),this.clipRegion!=null){var t=this.clipRegion;this.clipRegion instanceof rg&&this.clipRegion.components&&(t=Vo.fromGeometry(this.clipRegion)),e+=",'clipRegion':"+H.toJSON(t)}return"{"+e+"}"}}class xz{constructor(e){this.resolution=0,this.extractParameter=new hRe,this.resultSetting=new _z,this.surfaceAnalystMethod=pOe.ISOLINE,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.SurfaceAnalystParameters"}destroy(){var e=this;e.resolution=null,e.extractParameter&&(e.extractParameter.destroy(),e.extractParameter=null),e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.surfaceAnalystMethod=null}}class lK extends xz{constructor(e){super(e),this.dataset=null,this.filterQueryParameter=new Of,this.zValueFieldName=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetSurfaceAnalystParameters"}destroy(){super.destroy();var e=this;e.dataset=null,e.filterQueryParameter&&(e.filterQueryParameter.destroy(),e.filterQueryParameter=null),e.zValueFieldName=null}static toObject(e,t){for(var r in e)if(r==="filterQueryParameter"&&(t.filterQueryParameter=e.filterQueryParameter),r==="extractParameter")e.extractParameter.clipRegion instanceof rg&&e.extractParameter.clipRegion.components&&(e.extractParameter.clipRegion=Vo.fromGeometry(e.extractParameter.clipRegion)),t.extractParameter=e.extractParameter;else{if(r==="dataset")continue;if(r==="surfaceAnalystMethod")continue;t[r]=e[r]}}}class Dne{constructor(e){!e||(this.clipRegion=null,this.createResultDataset=!1,this.resultDatasetName=null,this.resultDatasourceName=null,this.returnResultRegion=!0,H.extend(this,e),this.CLASS_NAME="SuperMap.ThiessenAnalystParameters")}destroy(){var e=this;e.clipRegion&&(e.clipRegion.destroy(),e.clipRegion=null),e.createResultDataset=null,e.resultDatasetName=null,e.resultDatasourceName=null,e.returnResultRegion=null}}class uK extends Dne{constructor(e){super(e),this.filterQueryParameter=null,this.dataset=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetThiessenAnalystParameters"}destroy(){super.destroy();var e=this;e.filterQueryParameter&&(e.filterQueryParameter.destroy(),e.filterQueryParameter=null)}static toObject(e,t){for(var r in e)r==="clipRegion"?t.clipRegion=Vo.fromGeometry(e.clipRegion):t[r]=e[r]}}class cRe extends ra{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.DatasourceService"}destroy(){super.destroy()}getDatasourceService(e,t){let r=H.urlPathAppend(this.url,`datasources/name/${e}`);return this.processAsync(r,"GET",t)}getDatasourcesService(e){let t=H.urlPathAppend(this.url,"datasources");return this.processAsync(t,"GET",e)}setDatasourceService(e,t){if(!e)return;const r=H.urlPathAppend(this.url,`datasources/name/${e.datasourceName}`);return this.processAsync(r,"PUT",t,e)}processAsync(e,t,r,i){var a=this;let o={url:e,method:t,scope:a,success:r,failure:r};return i&&(o.data=H.toJSON(i)),a.request(o)}}class hK{constructor(e){this.dataset=null,this.bounds=null,this.fieldName=null,this.resultGridDatasetResolution=null,this.searchRadius=null,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.DensityKernelAnalystParameters"}destroy(){var e=this;e.dataset=null,e.bounds=null,e.fieldName=null,e.resultGridDatasetResolution=null,e.searchRadius=null,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var r in e)r!=="dataset"&&(t[r]=e[r])}}class fRe extends Hu{constructor(e,t){super(e,t),this.mode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.DensityAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r=this,i=new Object;e instanceof hK&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/densityanalyst/kernel"),r.mode="kernel"),hK.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class cK{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.features=null,this.editType=GR.ADD,this.IDs=null,this.returnContent=!1,this.isUseBatch=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.EditFeaturesParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.features=null,e.editType=null,e.IDs=null,e.returnContent=null}static toJsonParameters(e){var t,r,i,a=e.editType;if(a===GR.DELETE){if(e.IDs===null)return;i={ids:e.IDs}}else if(i=[],e.features){r=e.features.length;for(var o=0;o<r;o++)t=e.features[o],t.geometry=Vo.fromGeometry(t.geometry),i.push(t)}return H.toJSON(i)}}class V8 extends ra{constructor(e,t){super(e,t),this.returnContent=!1,this.isUseBatch=!1,t&&H.extend(this,t),this.url=H.urlPathAppend(this.url,"features"),this.CLASS_NAME="SuperMap.EditFeaturesService"}destroy(){super.destroy();var e=this;e.returnContent=null,e.isUseBatch=null,e.fromIndex=null,e.toIndex=null}processAsync(e,t){if(e instanceof cK){var r=this,i="POST",a="",o=e.editType,s=null;if(r.returnContent=e.returnContent,r.isUseBatch=e.isUseBatch,s=cK.toJsonParameters(e),o===GR.DELETE){a=H.toJSON(e.IDs),s=a;var l=H.urlAppend(r.url,H.getParameterString({ids:a}));li.urlIsLong(l)?(r.url=H.urlAppend(r.url,H.getParameterString({_method:"DELETE"})),i="POST"):(r.url=l,i="DELETE")}else o===GR.UPDATE?i="PUT":(r.isUseBatch&&(r.url=H.urlAppend(r.url,`isUseBatch=${r.isUseBatch}`),r.returnContent=!1),r.returnContent&&(r.url=H.urlAppend(r.url,"returnContent=true"),i="POST"));return r.request({method:i,data:s,scope:r,success:t,failure:t})}}getMetaData(e,t){var r=this,i=e.featureId;return r.url=H.urlPathAppend(r.url,i+"/metadata"),r.request({method:"GET",data:null,scope:r,success:t,failure:t})}}class EI{constructor(e){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalyst3DParameters"}destroy(){var e=this;e.edgeID=null,e.nodeID=null,e.weightName=null,e.isUncertainDirectionValid=null}}class dRe extends EI{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DParameters"}destroy(){super.destroy()}}class vRe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DService"}destroy(){ra.prototype.destroy.apply(this,arguments)}processAsync(e,t){if(e instanceof dRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"sinks"),i={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}}class pRe extends EI{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DParameters"}destroy(){super.destroy()}}class gRe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof pRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"sources"),i={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}}class yRe{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,this.queryType=null,H.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystStreamParameters"}destroy(){var e=this;e.edgeID=null,e.nodeID=null,e.weightName=null,e.isUncertainDirectionValid=null,e.type=null}}class mRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystStreamService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof yRe){var r=this,i;if(e.queryType===0)r.url=H.urlPathAppend(r.url,"upstreamcirticalfaclilities");else if(e.queryType===1)r.url=H.urlPathAppend(r.url,"downstreamcirticalfaclilities");else return;if(i={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},!(e.edgeID!==null&&e.nodeID!==null)&&!(e.edgeID===null&&e.nodeID===null))return e.edgeID!==null?i.edgeID=e.edgeID:i.nodeID=e.nodeID,r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}}class _Re extends EI{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DParameters"}destroy(){super.destroy()}}class xRe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof _Re){var r=this,i;return r.url=H.urlPathAppend(r.url,"tracedownresult"),i={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}}class SRe extends EI{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DParameters"}destroy(){super.destroy()}}class wRe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof SRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"traceupresult"),i={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}}class bRe extends EI{constructor(e){super(e),e=e||{},this.sourceNodeIDs=null,H.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DParameters"}destroy(){super.destroy(),this.sourceNodeIDs=null}}class ERe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof bRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"upstreamcirticalfaclilities"),i={sourceNodeIDs:e.sourceNodeIDs,edgeID:e.edgeID,nodeID:e.nodeID,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}}class TRe{constructor(e){this.datasource=null,this.dataset=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.FieldParameters"}destroy(){var e=this;e.datasource=null,e.dataset=null}}class CRe extends TRe{constructor(e){super(e),this.fieldName=null,this.statisticMode=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.FieldStatisticsParameters"}destroy(){var e=this;e.fieldName=null,e.statisticMode=null}}class ARe extends ra{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.FieldStatisticService"}destroy(){super.destroy();var e=this;e.datasource=null,e.dataset=null,e.field=null,e.statisticMode=null}processAsync(e){var t=this,r="datasources/"+t.datasource+"/datasets/"+t.dataset+"/fields/"+t.field+"/"+t.statisticMode;return t.url=H.urlPathAppend(t.url,r),t.request({method:"GET",data:null,scope:t,success:e,failure:e})}}class MRe{constructor(e){this.event=null,this.expectFacilityCount=1,this.facilities=null,this.fromEvent=!1,this.isAnalyzeById=!1,this.maxWeight=0,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindClosestFacilitiesParameters"}destroy(){var e=this;e.event=null,e.expectFacilityCount=null,e.facilities=null,e.fromEvent=null,e.isAnalyzeById=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class IRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindClosestFacilitiesService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof MRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"closestfacility"),i={expectFacilityCount:e.expectFacilityCount,fromEvent:e.fromEvent,maxWeight:e.maxWeight,parameter:H.toJSON(e.parameter),event:H.toJSON(e.event),facilities:r.getJson(e.isAnalyzeById,e.facilities)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a<i;a++)a>0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a<i;a++)a>0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.facilityPathList)return e;var t=new uh;return e.facilityPathList.map(function(r){return r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures)),r}),e}}class LRe{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,H.extend(this,e),this.CLASS_NAME="SuperMap.FindLocationParameters"}destroy(){var e=this;if(e.expectedSupplyCenterCount=null,e.isFromCenter=null,e.turnWeightField=null,e.weightName=null,e.supplyCenters){for(var t=0,r=e.supplyCenters,i=r.length;t<i;t++)r[t].destroy();e.supplyCenters=null}}}class PRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindLocationService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof LRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"location"),i={isFromCenter:e.isFromCenter,expectedSupplyCenterCount:e.expectedSupplyCenterCount,weightName:e.weightName,turnWeightField:e.turnWeightField,returnEdgeFeature:!0,returnEdgeGeometry:!0,returnNodeFeature:!0,mapParameter:H.toJSON(e.mapParameter),supplyCenters:r.getCentersJson(e.supplyCenters)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getCentersJson(e){for(var t="[",r=e?e.length:0,i=0;i<r;i++)i>0&&(t+=","),t+=H.toJSON(e[i]);return t+="]",t}toGeoJSONResult(e){if(!e)return null;var t=new uh;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class ORe{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindMTSPPathsParameters"}destroy(){var e=this;e.centers=null,e.hasLeastTotalCost=null,e.isAnalyzeById=null,e.nodes=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class RRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof ORe){var r=this,i,a=r.getJson(e.isAnalyzeById,e.centers),o=r.getJson(e.isAnalyzeById,e.nodes);return r.url=H.urlPathAppend(r.url,"mtsppath"),i={centers:a,nodes:o,parameter:H.toJSON(e.parameter),hasLeastTotalCost:e.hasLeastTotalCost},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a<i;a++)a>0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a<i;a++)a>0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.pathList)return null;var t=new uh;return e.pathList.map(function(r){return r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures)),r}),e}}class DRe{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindPathParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.hasLeastEdgeCount=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class NRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof DRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"path"),i={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:H.toJSON(e.parameter),nodes:r.getJson(e.isAnalyzeById,e.nodes)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a<i;a++)a>0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a<i;a++)a>0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new uh;return e.pathList.forEach(function(r){r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures))}),e}}class kRe{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindServiceAreasParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.isCenterMutuallyExclusive=null,e.centers=null,e.isFromCenter=null,e.weights=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class FRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof kRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"servicearea"),i={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:H.toJSON(e.parameter),centers:r.getJson(e.isAnalyzeById,e.centers),weights:r.getJson(!0,e.weights)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getJson(e,t){var r="[",i=t?t.length:0;if(e===!1)for(let a=0;a<i;a++)a>0&&(r+=","),r+='{"x":'+t[a].x+',"y":'+t[a].y+"}";else if(e===!0)for(let a=0;a<i;a++)a>0&&(r+=","),r+=t[a];return r+="]",r}toGeoJSONResult(e){if(!e||!e.serviceAreaList)return e;var t=new uh;return e.serviceAreaList.map(function(r){return r.serviceRegion&&(r.serviceRegion=t.toGeoJSON(r.serviceRegion)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures)),r.routes&&(r.routes=t.toGeoJSON(r.routes)),r}),e}}class BRe{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new $2,H.extend(this,e),this.CLASS_NAME="SuperMap.FindTSPPathsParameters"}destroy(){var e=this;e.endNodeAssigned=null,e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class GRe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof BRe){var r=this,i;return r.url=H.urlPathAppend(r.url,"tsppath"),i={parameter:H.toJSON(e.parameter),endNodeAssigned:e.endNodeAssigned,nodes:r.getNodesJson(e)},r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}getNodesJson(e){var t="",r,i,a,o;if(e.isAnalyzeById===!1){for(r="[",i=0,o=e.nodes,a=o.length;i<a;i++)i>0&&(r+=","),r+='{"x":'+o[i].x+',"y":'+o[i].y+"}";r+="]",t+=r}else if(e.isAnalyzeById===!0){let s="[",l=e.nodes,u=l.length;for(let h=0;h<u;h++)h>0&&(s+=","),s+=l[h];s+="]",t+=s}return t}toGeoJSONResult(e){if(!e||!e.tspPathList)return null;var t=new uh;return e.tspPathList.forEach(function(r){r.route&&(r.route=t.toGeoJSON(r.route)),r.pathGuideItems&&(r.pathGuideItems=t.toGeoJSON(r.pathGuideItems)),r.edgeFeatures&&(r.edgeFeatures=t.toGeoJSON(r.edgeFeatures)),r.nodeFeatures&&(r.nodeFeatures=t.toGeoJSON(r.nodeFeatures))}),e}}class zRe{constructor(e){this.routeTable=null,this.routeIDField=null,this.attributeFilter=null,this.eventTable=null,this.eventRouteIDField=null,this.measureField=null,this.measureStartField=null,this.measureEndField=null,this.measureOffsetField=null,this.errorInfoField=null,this.retainedFields=null,this.dataReturnOption=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GenerateSpatialDataParameters"}destroy(){var e=this;e.routeTable&&(e.routeTable=null),e.routeIDField=null,e.attributeFilter=null,e.eventTable=null,e.eventRouteIDField=null,e.measureField=null,e.measureStartField=null,e.measureEndField=null,e.measureOffsetField=null,e.errorInfoField=null,e.dataReturnOption&&(e.dataReturnOption.destroy(),e.dataReturnOption=null)}}class URe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GenerateSpatialDataService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof zRe){var r=this,i;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t="",r="datasets/"+e.routeTable+"/linearreferencing/generatespatialdata",i=this;return i.url=H.urlPathAppend(i.url,r),i.url=H.urlAppend(i.url,"returnContent=true"),t=H.toJSON(e),t}}class lot extends XOe{constructor(e){super(),this.precision=5,H.extend(this,e),this.aggType=TOe.GEOHASH_GRID,this.CLASS_NAME="SuperMap.GeoHashGridAggParameter"}destroy(){super.destroy(),this.aggType=null,this.precision=null}static toJsonParameters(e){var t={aggName:e.aggName,aggFieldName:e.aggFieldName,aggType:e.aggType,precision:e.precision};return H.toJson(t)}}class $8 extends Rne{constructor(e){super(e),e&&e.operateGeometry&&(this.operateGeometry=e.operateGeometry),e&&e.sourceGeometry&&(this.sourceGeometry=e.sourceGeometry),e&&e.operateGeometries&&(this.operateGeometries=e.operateGeometries),e&&e.sourceGeometries&&(this.sourceGeometries=e.sourceGeometries),e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeometryOverlayAnalystParameters"}destroy(){super.destroy();var e=this;e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.sourceGeometries&&(e.sourceGeometries.destroy(),e.sourceGeometries=null),e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.operateGeometries&&(e.operateGeometries.destroy(),e.operateGeometries=null)}static toObject(e,t){for(var r in e)if(r==="sourceGeometry")t.sourceGeometry=Vo.fromGeometry(e.sourceGeometry);else if(r==="sourceGeometries"){for(var i=[],a=0;a<e.sourceGeometries.length;a++)i.push(Vo.fromGeometry(e.sourceGeometries[a]));t.sourceGeometries=i}else if(r==="operateGeometry")t.operateGeometry=Vo.fromGeometry(e.operateGeometry);else if(r==="operateGeometries"){for(var o=[],s=0;s<e.operateGeometries.length;s++)o.push(Vo.fromGeometry(e.operateGeometries[s]));t.operateGeometries=o}else t[r]=e[r]}}class VRe extends xz{constructor(e){super(e),this.points=null,this.zValues=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeometrySurfaceAnalystParameters"}destroy(){super.destroy();var e=this;if(e.points){for(var t=0,r=e.points,i=r.length;t<i;t++)r[t].destroy();e.points=null}e.zValues=null}}class W8 extends Dne{constructor(e){super(e),this.points=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeometryThiessenAnalystParameters"}destroy(){super.destroy();var e=this;if(e.points){for(var t=e.points.length-1;t>=0;t--)e.points[t].destroy();e.points=null}}static toObject(e,t){for(var r in e)r==="clipRegion"?t.clipRegion=Vo.fromGeometry(e.clipRegion):t[r]=e[r]}}class $Re extends ra{constructor(e,t){t=t||{},super(e,t),this.CLASS_NAME="SuperMap.GeoprocessingService",this.headers={},this.crossOrigin=!0}getTools(e){return this._processAsync({url:`${this.url}/list`,callback:e})}getTool(e,t){return this._processAsync({url:`${this.url}/${e}`,callback:t})}execute(e,t,r,i){t=t||null,r=r||null;const a={parameter:t,environment:r};return this._processAsync({url:`${this.url}/${e}/execute`,executeParamter:a,callback:i})}submitJob(e,t,r,i){t=t||null,r=r||null;const a=JSON.stringify({parameter:t,environments:r});return this._processAsync({url:`${this.url}/${e}/jobs`,method:"POST",callback:i,params:a})}waitForJobCompletion(e,t,r,i){const a=this,o=setInterval(function(){const s=function(l){const u=l.result.state.runState;l.options.statusCallback&&l.options.statusCallback(u),["FINISHED","FAILED","CANCELED"].indexOf(u)!==-1&&(clearInterval(o),i(l))};a._processAsync({url:`${a.url}/${t}/jobs/${e}`,callback:s})},r.interval)}getJobInfo(e,t,r){return this._processAsync({url:`${this.url}/${e}/jobs/${t}`,callback:r})}cancelJob(e,t,r){return this._processAsync({url:`${this.url}/${e}/jobs/${t}/cancel`,callback:r})}getJobs(e,t){let r=`${this.url}/jobs`;e&&typeof e=="string"?r=`${this.url}/${e}/jobs`:t=e,this._processAsync({url:r,callback:t})}getResults(e,t,r,i){let a=`${this.url}/${e}/jobs/${t}/results`;return r&&(typeof r=="string"?a=`${a}/${r}`:i=r),this._processAsync({url:a,callback:i})}_processAsync({url:e,method:t,callback:r,paramter:i}){return this.request({url:e,method:t||"GET",params:i,headers:{"Content-type":"application/json"},scope:this,success:r,failure:r})}}class WRe{constructor(e){this.dataset=null,this.sourceFilter=null,this.referenceFilter=null,this.spatialRelationType=null,this.isBorderInside=null,this.returnFeature=null,this.returnGeoRelatedOnly=null,this.startRecord=0,this.expectCount=500,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeoRelationAnalystParameters"}destroy(){var e=this;e.sourceFilter&&e.sourceFilter.destroy(),e.sourceFilter=null,e.referenceFilter&&e.referenceFilter.destroy(),e.referenceFilter=null,e.dataset=null,e.spatialRelationType=null,e.isBorderInside=null,e.returnFeature=null,e.returnGeoRelatedOnly=null,e.startRecord=null,e.expectCount=null}}class HRe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GeoRelationAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof WRe){var r=this;r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/georelation");var i=H.toJSON(e);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}}class jRe extends ra{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();var e=this;e.datasource=null,e.dataset=null}getDatasetsService(e,t){const r=H.urlPathAppend(this.url,`datasources/name/${e}/datasets`);return this.processAsync(r,"GET",t)}getDatasetService(e,t,r){const i=H.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);return this.processAsync(i,"GET",r)}setDatasetService(e,t){if(!e)return;const r=H.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);return delete e.datasourceName,this.processAsync(r,"PUT",t,e)}deleteDatasetService(e,t,r){const i=H.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);return this.processAsync(i,"DELETE",r)}processAsync(e,t,r,i){var a=this;let o={url:e,method:t,scope:a,success:r,failure:r};return i&&(o.data=H.toJSON(i)),a.request(o)}}class TI{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnCountOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class xE extends TI{constructor(e){super(e),this.getFeatureMode=xE.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=n3.CONTAIN,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsParameters"}destroy(){super.destroy();var e=this;if(e.bounds&&(e.bounds.destroy(),e.bounds=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,i;return r={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},i={datasetNames:e.datasetNames,getFeatureMode:xE.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&(t=new Of,t.name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode=xE.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(i.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(i.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(i.targetPrj=e.targetPrj),e.aggregations&&(i.aggregations=e.aggregations),H.toJSON(i)}}xE.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class CI extends ra{constructor(e,t){super(e,t),t=t||{},this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=Ni.GEOJSON,H.extend(this,t),this.url=H.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e,t){if(!!e){var r=this,i=null,a=!0;r.returnContent=e.returnContent,r.fromIndex=e.fromIndex,r.toIndex=e.toIndex,r.maxFeatures=e.maxFeatures,r.hasGeometry=e.hasGeometry,r.returnContent&&(a=!1);var o=r.fromIndex!=null&&r.toIndex!=null&&!isNaN(r.fromIndex)&&!isNaN(r.toIndex);return o&&r.fromIndex>=0&&r.toIndex>=0&&!a&&(r.url=H.urlAppend(r.url,`fromIndex=${r.fromIndex}&toIndex=${r.toIndex}`)),e.returnCountOnly&&(r.url=H.urlAppend(r.url,"&returnCountOnly="+e.returnContent)),i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}transformResult(e,t){var r=this;if(e=H.transformResult(e),r.format===Ni.GEOJSON&&e.features){var i=new uh;e.features=i.toGeoJSON(e.features)}return{result:e,options:t}}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class XRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return xE.toJsonParameters(e)}}class fK extends TI{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBufferParameters"}destroy(){super.destroy();var e=this;if(e.bufferDistance=null,e.attributeFilter=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}static toJsonParameters(e){var t,r,i;return i=Vo.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:i},e.fields&&(t=new Of,t.name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),H.toJSON(r)}}class YRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof fK)return fK.toJsonParameters(e)}}class qRe extends TI{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=n3.CONTAIN,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryParameters"}destroy(){super.destroy();var e=this;if(e.geometry&&(e.geometry.destroy(),e.geometry=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,i;return r=Vo.fromGeometry(e.geometry),i={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&(t=new Of,t.name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(i.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(i.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(i.targetPrj=e.targetPrj),e.aggregations&&(i.aggregations=e.aggregations),H.toJSON(i)}}class ZRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return qRe.toJsonParameters(e)}}class KRe extends TI{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&(r=new Of,r.name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),typeof e.hasGeometry=="boolean"&&(t.hasGeometry=e.hasGeometry),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),H.toJSON(t)}}class JRe extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return KRe.toJsonParameters(e)}}class VR extends TI{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesBySQLParameters"}destroy(){super.destroy();var e=this;e.getFeatureMode=null,e.queryParameter&&(e.queryParameter.destroy(),e.queryParameter=null)}static toJsonParameters(e){var t={datasetNames:e.datasetNames,getFeatureMode:"SQL",queryParameter:e.queryParameter};return e.maxFeatures&&!isNaN(e.maxFeatures)&&(t.maxFeatures=e.maxFeatures),typeof e.hasGeometry=="boolean"&&(t.hasGeometry=e.hasGeometry),e.aggregations&&(t.aggregations=e.aggregations),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),H.toJSON(t)}}class H8 extends CI{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return VR.toJsonParameters(e)}}class QRe extends ra{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();var e=this;e.datasource=null,e.dataset=null}processAsync(e){var t=this;return t.url=H.urlPathAppend(t.url,`datasources/${t.datasource}/datasets/${t.dataset}/fields`),t.request({method:"GET",data:null,scope:t,success:e,failure:e})}}class eDe{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){var e=this;e.datasetName=null,e.dataSourceName=null,e.X=null,e.Y=null}}class tDe extends ra{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GetGridCellInfosService"}destroy(){super.destroy();var e=this;e.X=null,e.Y=null,e.datasetName=null,e.dataSourceName=null,e.datasetType=null}processAsync(e,t){if(e instanceof eDe){H.extend(this,e);var r=this;return r.url=H.urlPathAppend(r.url,`datasources/${r.dataSourceName}/datasets/${r.datasetName}`),r.request({method:"GET",data:null,scope:r,success({result:i}){t&&r.getDatasetInfoCompleted(i,t)},failure:t}).then(({result:i})=>r.getDatasetInfoCompleted(i))}}getDatasetInfoCompleted(e,t){var r=this;return e=H.transformResult(e),r.datasetType=e.datasetInfo.type,r.queryGridInfos(t)}queryGridInfos(e){var t=this,r=H.urlPathAppend(t.url,t.datasetType=="GRID"?"gridValue":"imageValue");return t.X!=null&&t.Y!=null&&(r=H.urlAppend(r,`x=${t.X}&y=${t.Y}`)),t.request({url:r,method:"GET",data:null,scope:t,success:e,failure:e})}}class R_{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){var e=this;e.memoryData&&(e.memoryData.destroy(),e.memoryData=null),e.type=null}toServerJSONObject(){}}class md{constructor(e){this.align=sOe.BASELINECENTER,this.backColor=new Js(255,255,255),this.foreColor=new Js(0,0,0),this.backOpaque=!1,this.sizeFixed=!0,this.fontHeight=6,this.fontWidth=0,this.fontWeight=400,this.fontName="Times New Roman",this.bold=!1,this.italic=!1,this.italicAngle=0,this.shadow=!1,this.strikeout=!1,this.outline=!1,this.opaqueRate=0,this.underline=!1,this.rotation=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ServerTextStyle"}destroy(){var e=this;e.align=null,e.backColor&&(e.backColor.destroy(),e.backColor=null),e.foreColor&&(e.foreColor.destroy(),e.foreColor=null),e.backOpaque=null,e.sizeFixed=null,e.fontHeight=null,e.fontWidth=null,e.fontWeight=null,e.fontName=null,e.bold=null,e.italic=null,e.italicAngle=null,e.shadow=null,e.strikeout=null,e.outline=null,e.opaqueRate=null,e.underline=null,e.rotation=null}static fromObj(e){var t=new md(e);return H.copy(t,e),t.backColor=Js.fromJson(e.backColor),t.foreColor=Js.fromJson(e.foreColor),t}}class Sz{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}static fromObj(e){if(!!e){var t=new Sz;return H.copy(t,e),t}}}class o3{constructor(e){this.caption=null,this.style=new gs,this.unique=null,this.visible=!0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeUniqueItem"}destroy(){var e=this;e.caption=null,e.unique=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new o3;return H.copy(t,e),t.style=gs.fromJson(e.style),t}}class o_{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeOffset"}destroy(){var e=this;e.offsetFixed=null,e.offsetX=null,e.offsetY=null}static fromObj(e){if(!!e){var t=new o_;return H.copy(t,e),t}}}class wz{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.LabelMixedTextStyle"}destroy(){var e=this;if(e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null),e.separator=null,e.separatorEnabled=null,e.splitIndexes&&(e.splitIndexes=null),e.styles){for(var t=0,r=e.styles,i=r.length;t<i;t++)r[t].destroy();e.styles=null}}static fromObj(e){if(!!e){var t=new wz,r=e.styles;if(H.copy(t,e),t.defaultStyle=new md(e.defaultStyle),r){t.styles=[];for(var i=0,a=r.length;i<a;i++)t.styles.push(new md(r[i]))}return t}}}class $R{constructor(e){this.maxTextHeight=0,this.maxTextWidth=0,this.minTextHeight=0,this.minTextWidth=0,this.uniformStyle=new md,this.uniformMixedStyle=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelText"}destroy(){var e=this;e.maxTextHeight=null,e.maxTextWidth=null,e.minTextHeight=null,e.minTextWidth=null,e.uniformStyle&&(e.uniformStyle.destroy(),e.uniformStyle=null),e.uniformMixedStyle&&(e.uniformMixedStyle.destroy(),e.uniformMixedStyle=null)}static fromObj(e){if(!!e){var t=new $R;return H.copy(t,e),t.uniformStyle=md.fromObj(e.uniformStyle),t.uniformMixedStyle=wz.fromObj(e.uniformMixedStyle),t}}}class WR{constructor(e){this.isAlongLine=!0,this.alongLineDirection=lOe.LB_TO_RT,this.angleFixed=!1,this.repeatedLabelAvoided=!1,this.repeatIntervalFixed=!1,this.labelRepeatInterval=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelAlongLine"}destroy(){var e=this;e.isAlongLine=null,e.alongLineDirection=null,e.angleFixed=null,e.repeatedLabelAvoided=null,e.repeatIntervalFixed=null,e.labelRepeatInterval=null}static fromObj(e){if(!!e){var t=new WR;return H.copy(t,e),t}}}class HR{constructor(e){this.labelBackShape=uOe.NONE,this.backStyle=new gs,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelBackground"}destroy(){var e=this;e.labelBackShape=null,e.backStyle&&(e.backStyle.destroy(),e.backStyle=null)}static fromObj(e){if(!!e){var t=new HR;return t.labelBackShape=e.labelBackShape,t.backStyle=gs.fromJson(e.backStyle),t}}}class s3 extends R_{constructor(e){super("LABEL",e),this.alongLine=new WR,this.background=new HR,this.items=null,this.uniqueItems=null,this.labelExpression=null,this.labelOverLengthMode=hOe.NONE,this.matrixCells=null,this.maxLabelLength=256,this.numericPrecision=0,this.offset=new o_,this.overlapAvoided=!0,this.rangeExpression=null,this.uniqueExpression=null,this.smallGeometryLabeled=!1,this.text=new $R,this.textSpace=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabel"}destroy(){super.destroy();var e=this;if(e.alongLine=null,e.background&&(e.background.destroy(),e.background=null),e.items){for(var t=0,r=e.items,i=r.length;t<i;t++)r[t].destroy();e.items=null}if(e.uniqueItems){for(var a=0,o=e.uniqueItems,s=o.length;a<s;a++)o[a].destory();e.uniqueItems=null}e.labelExpression=null,e.labelOverLengthMode=null,e.matrixCells=null,e.maxLabelLength=null,e.numericPrecision=null,e.overlapAvoided=null,e.rangeExpression=null,e.uniqueExpression=null,e.offset&&(e.offset.destroy(),e.offset=null),e.overlapAvoided=null,e.smallGeometryLabeled=null,e.text&&(e.text.destroy(),e.text=null),e.textSpace=null}toJSON(){return H.toJSON(this.toServerJSONObject())}toServerJSONObject(){var e={};return e.type=this.type,e.memoryData=this.memoryData,this.alongLine&&(e.alongLine=this.alongLine.isAlongLine,e.alongLineDirection=this.alongLine.alongLineDirection,e.angleFixed=this.alongLine.angleFixed,e.isLabelRepeated=this.alongLine.isLabelRepeated,e.labelRepeatInterval=this.alongLine.labelRepeatInterval,e.repeatedLabelAvoided=this.alongLine.repeatedLabelAvoided,e.repeatIntervalFixed=this.alongLine.repeatIntervalFixed),this.offset&&(e.offsetFixed=this.offset.offsetFixed,e.offsetX=this.offset.offsetX,e.offsetY=this.offset.offsetY),this.text&&(e.maxTextHeight=this.text.maxTextHeight,e.maxTextWidth=this.text.maxTextWidth,e.minTextHeight=this.text.minTextHeight,e.minTextWidth=this.text.minTextWidth,e.uniformStyle=this.text.uniformStyle,e.uniformMixedStyle=this.text.uniformMixedStyle),this.background&&(e.labelBackShape=this.background.labelBackShape,e.backStyle=this.background.backStyle),e.labelOverLengthMode=this.labelOverLengthMode,e.maxLabelLength=this.maxLabelLength,e.smallGeometryLabeled=this.smallGeometryLabeled,e.rangeExpression=this.rangeExpression,e.uniqueExpression=this.uniqueExpression,e.numericPrecision=this.numericPrecision,e.items=this.items,e.uniqueItems=this.uniqueItems,e.labelExpression=this.labelExpression,e.overlapAvoided=this.overlapAvoided,e.matrixCells=this.matrixCells,e.textSpace=this.textSpace,e}static fromObj(e){if(!!e){var t=new s3,r=e.items,i=e.uniqueItems,a=e.matrixCells;if(e.matrixCells=null,H.copy(t,e),t.alongLine=WR.fromObj(e),t.background=HR.fromObj(e),r){t.items=[];for(var o=0,s=r.length;o<s;o++)t.items.push(Sz.fromObj(r[o]))}if(i){t.uniqueItems=[];for(let l=0,u=i.length;l<u;l++)t.uniqueItems.push(o3.fromObj(i[l]))}if(a){t.matrixCells=[];for(let l=0,u=a.length;l<u;l++);}return t.offset=o_.fromObj(e),t.text=$R.fromObj(e),t}}}class bz extends R_{constructor(e){super("UNIQUE",e),this.defaultStyle=new gs,this.items=null,this.uniqueExpression=null,this.colorGradientType=i3.YELLOW_RED,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeUnique"}destroy(){super.destroy();var e=this;if(e.uniqueExpression=null,e.colorGradientType=null,e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null)}toServerJSONObject(){var e={};if(e=H.copyAttributes(e,this),e.defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,i=0;i<r;i++)t.push(e.items[i].toServerJSONObject());e.items=t}return e}static fromObj(e){var t=new bz,r=e.items,i=r?r.length:0;H.extend(t,e),t.items=[],t.defaultStyle=gs.fromJson(e.defaultStyle);for(var a=0;a<i;a++)t.items.push(o3.fromObj(r[a]));return t}}class jR{constructor(e){this.axesColor=new Js(0,0,0),this.axesDisplayed=!1,this.axesGridDisplayed=!1,this.axesTextDisplayed=!1,this.axesTextStyle=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphAxes"}destroy(){var e=this;e.axesColor&&(e.axesColor.destroy(),e.axesColor=null),e.axesDisplayed=null,e.axesGridDisplayed=null,e.axesTextDisplayed=null,e.axesTextStyle&&(e.axesTextStyle.destroy(),e.axesTextStyle=null)}static fromObj(e){if(!!e){var t=new jR;return H.copy(t,e),t.axesColor=Js.fromJson(e.axesColor),t.axesTextStyle=md.fromObj(e.axesTextStyle),t}}}class XR{constructor(e){this.maxGraphSize=0,this.minGraphSize=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphSize"}destroy(){var e=this;e.maxGraphSize=null,e.minGraphSize=null}static fromObj(e){var t=new XR;return H.copy(t,e),t}}class YR{constructor(e){this.graphTextDisplayed=!1,this.graphTextFormat=iOe.CAPTION,this.graphTextStyle=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphText"}destroy(){var e=this;e.graphTextDisplayed=null,e.graphTextFormat=null,e.graphTextStyle&&(e.graphTextStyle.destroy(),e.graphTextStyle=null)}static fromObj(e){var t=new YR;return H.copy(t,e),t.graphTextStyle=md.fromObj(e.graphTextStyle),t}}class Ez{constructor(e){this.caption=null,this.graphExpression=null,this.memoryDoubleValues=null,this.uniformStyle=new gs,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraphItem"}destroy(){var e=this;e.caption=null,e.graphExpression=null,e.memoryDoubleValues=null,e.uniformStyle=null}static fromObj(e){if(!!e){var t=new Ez;return H.copy(t,e),t.uniformStyle=gs.fromJson(e.uniformStyle),t}}}class Tz extends R_{constructor(e){super("GRAPH",e),this.barWidth=0,this.graduatedMode=B8.CONSTANT,this.graphAxes=new jR,this.graphSize=new XR,this.graphSizeFixed=!1,this.graphText=new YR,this.graphType=aOe.AREA,this.graphAxesTextDisplayMode=oOe.NONE,this.items=null,this.memoryKeys=null,this.negativeDisplayed=!1,this.offset=new o_,this.overlapAvoided=!0,this.roseAngle=0,this.startAngle=0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraph"}destroy(){super.destroy();var e=this;if(e.barWidth=null,e.graduatedMode=null,e.graphAxes&&(e.graphAxes.destroy(),e.graphAxes=null),e.graphSize&&(e.graphSize.destroy(),e.graphSize=null),e.graphSizeFixed=null,e.graphText&&(e.graphText.destroy(),e.graphText=null),e.graphType=null,e.items){for(var t=0,r=e.items,i=r.length;t<i;t++)r[t].destroy();e.items=null}e.memoryKeys=null,e.negativeDisplayed=null,e.offset&&(e.offset.destroy(),e.offset=null),e.overlapAvoided=null,e.roseAngle=null,e.startAngle=null,e.graphAxesTextDisplayMode=null}toJSON(){return H.toJSON(this.toServerJSONObject())}toServerJSONObject(){var e={};return e.type=this.type,this.graphText&&(e.graphTextDisplayed=this.graphText.graphTextDisplayed,e.graphTextFormat=this.graphText.graphTextFormat,e.graphTextStyle=this.graphText.graphTextStyle),this.graphAxes&&(e.axesColor=this.graphAxes.axesColor,e.axesDisplayed=this.graphAxes.axesDisplayed,e.axesGridDisplayed=this.graphAxes.axesGridDisplayed,e.axesTextDisplayed=this.graphAxes.axesTextDisplayed,e.axesTextStyle=this.graphAxes.axesTextStyle),this.graphSize&&(e.maxGraphSize=this.graphSize.maxGraphSize,e.minGraphSize=this.graphSize.minGraphSize),this.offset&&(e.offsetFixed=this.offset.offsetFixed,e.offsetX=this.offset.offsetX,e.offsetY=this.offset.offsetY),e.barWidth=this.barWidth,e.graduatedMode=this.graduatedMode,e.graphSizeFixed=this.graphSizeFixed,e.graphType=this.graphType,e.graphAxesTextDisplayMode=this.graphAxesTextDisplayMode,e.items=this.items,e.memoryKeys=this.memoryKeys,e.negativeDisplayed=this.negativeDisplayed,e.overlapAvoided=this.overlapAvoided,e.roseAngle=this.roseAngle,e.startAngle=this.startAngle,e}static fromObj(e){var t=new Tz,r=e.items,i=r?r.length:0;H.copy(t,e),t.items=[],t.graphAxes=jR.fromObj(e),t.graphSize=XR.fromObj(e),t.graphText=YR.fromObj(e),t.offset=o_.fromObj(e);for(var a=0;a<i;a++)t.items.push(Ez.fromObj(r[a]));return t}}class Cz extends R_{constructor(e){super("DOTDENSITY",e),this.dotExpression=null,this.style=new gs,this.value=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeDotDensity"}destroy(){var e=this;e.dotExpression=null,e.value=null,e.style&&(e.style.destroy(),e.style=null)}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){if(!!e){var t=new Cz;return H.copy(t,e),t.style=gs.fromJson(e.style),t}}}class qR{constructor(e){this.negativeDisplayed=!1,this.negativeStyle=new gs,this.positiveStyle=new gs,this.zeroDisplayed=!1,this.zeroStyle=new gs,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraduatedSymbolStyle"}destroy(){var e=this;e.negativeDisplayed=null,e.negativeStyle=null,e.positiveStyle=null,e.zeroDisplayed=null,e.zeroStyle=null}static fromObj(e){if(!!e){var t=new qR;return H.copy(t,e),t.negativeStyle=gs.fromJson(e.negativeStyle),t.positiveStyle=gs.fromJson(e.positiveStyle),t.zeroStyle=gs.fromJson(e.zeroStyle),t}}}class Az extends R_{constructor(e){super("GRADUATEDSYMBOL",e),this.baseValue=0,this.expression=null,this.graduatedMode=B8.CONSTAN,this.offset=new o_,this.style=new qR,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGraduatedSymbol"}destroy(){super.destroy();var e=this;e.expression=null,e.graduatedMode=B8.CONSTANT,e.offset&&(e.offset.destroy(),e.offset=null),e.style&&(e.style.destroy(),e.style=null)}toJSON(){return H.toJSON(this.toServerJSONObject())}toServerJSONObject(){var e={};return e.type=this.type,e.memoryData=this.memoryData,e.baseValue=this.baseValue,e.expression=this.expression,e.graduatedMode=this.graduatedMode,this.offset&&(e.offsetFixed=this.offset.offsetFixed,e.offsetX=this.offset.offsetX,e.offsetY=this.offset.offsetY),this.style&&(e.negativeStyle=this.style.negativeStyle,e.negativeDisplayed=this.style.negativeDisplayed,e.positiveStyle=this.style.positiveStyle,e.zeroDisplayed=this.style.zeroDisplayed,e.zeroStyle=this.style.zeroStyle),e}static fromObj(e){if(!!e){var t=new Az;return H.copy(t,e),t.offset=o_.fromObj(e),t.style=qR.fromObj(e),t}}}class Mz{constructor(e){this.caption=null,this.end=0,this.start=0,this.style=new gs,this.visible=!0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeRangeItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){if(!!e){var t=new Mz;return H.copy(t,e),t.style=gs.fromJson(e.style),t}}}class Iz extends R_{constructor(e){super("RANGE",e),this.precision="1.0E-12",this.items=null,this.rangeExpression=null,this.rangeMode=vz.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=i3.YELLOW_RED,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeRange"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.rangeExpression=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(!!e){var t=new Iz;H.copy(t,e);var r=e.items,i=r?r.length:0;t.items=[];for(var a=0;a<i;a++)t.items.push(Mz.fromObj(r[a]));return t}}}class Nne{constructor(e){e=e||{},this.bounds=null,this.caption=null,this.description=null,this.name=null,this.queryable=null,this.subLayers=null,this.type=null,this.visible=null,H.extend(this,e),this.CLASS_NAME="SuperMap.UGCLayer"}destroy(){var e=this;H.reset(e)}fromJson(e){e=e||{},H.extend(this,e);var t=this.bounds;t&&(this.bounds=new po(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y))}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class rDe extends Nne{constructor(e){e=e||{},super(e),this.completeLineSymbolDisplayed=null,this.maxScale=null,this.minScale=null,this.minVisibleGeometrySize=null,this.opaqueRate=null,this.symbolScalable=null,this.symbolScale=null,this.overlapDisplayed=null,this.overlapDisplayedOptions=null,this.CLASS_NAME="SuperMap.UGCMapLayer"}destroy(){super.destroy(),H.reset(this)}fromJson(e){super.fromJson(e)}toServerJSONObject(){return super.toServerJSONObject()}}class nDe{constructor(e){this.foreignTableName=null,this.joinFilter=null,this.joinType=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.JoinItem"}destroy(){var e=this;e.foreignTableName=null,e.joinFilter=null,e.joinType=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e}}class l3 extends rDe{constructor(e){e=e||{},super(e),this.datasetInfo=null,this.displayFilter=null,this.joinItems=null,this.representationField=null,this.ugcLayerType=null,this.CLASS_NAME="SuperMap.UGCSubLayer"}fromJson(e){if(super.fromJson(e),this.datasetInfo&&(this.datasetInfo=new uRe(this.datasetInfo)),this.joinItems&&this.joinItems.length){for(var t=[],r=0;r<this.joinItems.length;r++)t[r]=new nDe(this.joinItems[r]);this.joinItems=t}}destroy(){super.destroy(),H.reset(this)}toServerJSONObject(){var e=super.toServerJSONObject();if(e.joinItems){for(var t=[],r=0;r<e.joinItems.length;r++)e.joinItems[r].toServerJSONObject&&(t[r]=e.joinItems[r].toServerJSONObject());e.joinItems=t}return e.datasetInfo&&e.datasetInfo.toServerJSONObject&&(e.datasetInfo=e.datasetInfo.toServerJSONObject()),e}}class iDe extends l3{constructor(e){e=e||{},super(e),this.theme=null,this.themeElementPosition=null,this.CLASS_NAME="SuperMap.ServerTheme"}destroy(){super.destroy(),H.reset(this)}fromJson(e){super.fromJson(e);var t=this.theme,r=t&&t.type;switch(r){case"LABEL":this.theme=s3.fromObj(t);break;case"UNIQUE":this.theme=bz.fromObj(t);break;case"GRAPH":this.theme=Tz.fromObj(t);break;case"DOTDENSITY":this.theme=Cz.fromObj(t);break;case"GRADUATEDSYMBOL":this.theme=Az.fromObj(t);break;case"RANGE":this.theme=Iz.fromObj(t);break}this.themeElementPosition&&(this.themeElementPosition=new vd(this.themeElementPosition.x,this.themeElementPosition.y))}toServerJSONObject(){var e=super.toServerJSONObject();return e.themeElementPosition&&e.themeElementPosition.toServerJSONObject&&(e.themeElementPosition=e.themeElementPosition.toServerJSONObject()),e.theme&&e.theme.toServerJSONObject&&(e.theme=e.theme.toServerJSONObject()),e}}class aDe extends l3{constructor(e){e=e||{},super(e),this.colorDictionarys=null,this.brightness=null,this.colorGradientType=null,this.colors=null,this.contrast=null,this.dashStyle=null,this.gridType=null,this.horizontalSpacing=null,this.sizeFixed=null,this.solidStyle=null,this.specialColor=null,this.specialValue=null,this.specialValueTransparent=null,this.verticalSpacing=null,this.CLASS_NAME="SuperMap.Grid"}destroy(){super.destroy(),H.reset(this)}fromJson(e){if(super.fromJson(e),this.specialColor&&(this.specialColor=new Js(this.specialColor.red,this.specialColor.green,this.specialColor.blue)),this.colors){var t=[],r;for(var i in this.colors)r=this.colors[i],t.push(new Js(r.red,r.green,r.blue));this.colors=t}if(this.dashStyle&&(this.dashStyle=new gs(this.dashStyle)),this.solidStyle&&(this.solidStyle=new gs(this.solidStyle)),this.colorDictionary){var a=[],o;for(var s in this.colorDictionary)o=this.colorDictionary[s],a.push(new iRe({elevation:s,color:o}));this.colorDictionarys=a}delete this.colorDictionary}toServerJSONObject(){var e=super.toServerJSONObject();return e.dashStyle&&e.dashStyle.toServerJSONObject&&(e.dashStyle=e.dashStyle.toServerJSONObject()),e.solidStyle&&e.solidStyle.toServerJSONObject&&(e.solidStyle=e.solidStyle.toServerJSONObject()),e}}class oDe extends l3{constructor(e){e=e||{},super(e),this.brightness=null,this.colorSpaceType=null,this.contrast=null,this.displayBandIndexes=null,this.transparent=null,this.transparentColor=null,this.transparentColorTolerance=null,this.CLASS_NAME="SuperMap.Image"}destroy(){super.destroy(),H.reset(this)}fromJson(e){super.fromJson(e),this.transparentColor&&(this.transparentColor=new Js(this.transparentColor.red,this.transparentColor.green,this.transparentColor.blue))}toServerJSONObject(){return super.toServerJSONObject()}}class sDe extends l3{constructor(e){e=e||{},super(e),this.style=null,this.CLASS_NAME="SuperMap.Vector"}destroy(){super.destroy(),H.reset(this)}fromJson(e){super.fromJson(e);var t=this.style;t&&(this.style=new gs(t))}toServerJSONObject(){var e=super.toServerJSONObject();return e.style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}}class lDe extends ra{constructor(e,t){super(e,t),this.isTempLayers=!1,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GetLayersInfoService"}destroy(){super.destroy(),H.reset(this)}processAsync(e){var t=this,r="GET";return t.isTempLayers||(t.url=H.urlPathAppend(t.url,"layers")),t.request({method:r,params:null,scope:t,success:e,failure:e})}transformResult(e,t){var r=this,i,a,o;return e=H.transformResult(e),i=!!e&&e.length>0,a=i?e[0].subLayers.layers:null,o=a?a.length:0,r.handleLayers(o,a),{result:e[0],options:t}}handleLayers(e,t){var r=this,i;if(e)for(var a=0;a<e;a++)if(t[a].subLayers&&t[a].subLayers.layers&&t[a].subLayers.layers.length>0)r.handleLayers(t[a].subLayers.layers.length,t[a].subLayers.layers);else{var o=t[a].ugcLayerType;switch(o){case"THEME":i=new iDe,i.fromJson(t[a]),t[a]=i;break;case"GRID":i=new aDe,i.fromJson(t[a]),t[a]=i;break;case"IMAGE":i=new oDe,i.fromJson(t[a]),t[a]=i;break;case"VECTOR":i=new sDe,i.fromJson(t[a]),t[a]=i;break}}}}class Dy{constructor(e){!e||(this.bounds=null,this.searchRadius=0,this.zValueFieldName=null,this.zValueScale=1,this.resolution=null,this.filterQueryParameter=null,this.outputDatasetName=null,this.outputDatasourceName=null,this.pixelFormat=null,this.dataset=null,this.inputPoints=null,this.InterpolationAnalystType="dataset",this.clipParam=null,H.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationAnalystParameters")}destroy(){var e=this;e.bounds=null,e.searchRadius=null,e.zValueFieldName=null,e.zValueScale=null,e.resolution=null,e.filterQueryParameter=null,e.outputDatasetName=null,e.pixelFormat=null}static toObject(e,t){for(var r in e)if(r==="inputPoints"&&e.InterpolationAnalystType==="geometry"){for(var i=[],a=0;a<e.inputPoints.length;a++){var o=e.inputPoints[a],s={x:o.x,y:o.y,z:o.tag};i.push(s)}t[r]=i}else t[r]=e[r]}}class uDe extends Dy{constructor(e){super(e),this.smooth=.1,this.tension=40,this.searchMode=null,this.expectedCount=12,this.maxPointCountForInterpolation=200,this.maxPointCountInNode=50,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationRBFAnalystParameters"}destroy(){super.destroy();var e=this;e.smooth=null,e.tension=null,e.searchMode=null,e.expectedCount=null,e.maxPointCountForInterpolation=null,e.maxPointCountInNode=null}static toObject(e,t){for(var r in e)t[r]=e[r]}}class hDe extends Dy{constructor(e){super(e),e&&H.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationDensityAnalystParameters"}destroy(){super.destroy()}}class cDe extends Dy{constructor(e){super(e),this.power=2,this.searchMode=null,this.expectedCount=12,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationIDWAnalystParameters"}destroy(){super.destroy();var e=this;e.power=null,e.searchMode=null,e.expectedCount=null}}class fDe extends Dy{constructor(e){super(e),this.type=null,this.mean=null,this.angle=0,this.nugget=0,this.range=0,this.sill=0,this.variogramMode=_Oe.SPHERICAL,this.exponent=xOe.EXP1,this.searchMode=null,this.expectedCount=12,this.maxPointCountForInterpolation=200,this.maxPointCountInNode=50,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationKrigingAnalystParameters"}destroy(){super.destroy();var e=this;e.type=null,e.mean=null,e.angle=null,e.nugget=null,e.range=null,e.sill=null,e.variogramMode=null,e.exponent=null,e.searchMode=null,e.expectedCount=null,e.maxPointCountForInterpolation=null,e.maxPointCountInNode=null}}class dDe extends Hu{constructor(e,t){super(e,t),this.mode=null,t&&H.extend(this,t)}destroy(){super.destroy(),this.mode=null,this.CLASS_NAME="SuperMap.InterpolationAnalystService"}processAsync(e,t){var r={},i=this;e instanceof hDe?(i.mode="Density",e.InterpolationAnalystType==="geometry"?i.url=H.urlPathAppend(i.url,"geometry/interpolation/density"):i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/density")):e instanceof cDe?(i.mode="IDW",e.InterpolationAnalystType==="geometry"?i.url=H.urlPathAppend(i.url,"geometry/interpolation/idw"):i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/idw")):e instanceof uDe?(i.mode="RBF",e.InterpolationAnalystType==="geometry"?i.url=H.urlPathAppend(i.url,"geometry/interpolation/rbf"):i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/rbf")):e instanceof fDe&&(i.mode="Kriging",e.InterpolationAnalystType==="geometry"?i.url=H.urlPathAppend(i.url,"geometry/interpolation/kriging"):i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/interpolation/kriging")),Dy.toObject(e,r);var a=H.toJSON(r);return i.url=H.urlAppend(i.url,"returnContent=true"),i.request({method:"POST",data:a,scope:i,success:t,failure:t})}}class vDe{constructor(e){!e||(this.datasetName="",this.query="",this.resolution=80,this.method=0,this.meshType=0,this.fields="",this.radius=300,this.meshSizeUnit=zR.METER,this.radiusUnit=zR.METER,this.areaUnit=wOe.SQUAREMILE,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.KernelDensityJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.method=null,this.radius=null,this.meshType=null,this.fields=null,this.meshSizeUnit=null,this.radiusUnit=null,this.areaUnit=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},r==="query"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class oB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/density"),this.CLASS_NAME="SuperMap.KernelDensityJobsService"}destroy(){super.destroy()}getKernelDensityJobs(e){return super.getJobs(this.url,e)}getKernelDensityJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addKernelDensityJob(e,t,r,i){return super.addJob(this.url,e,vDe,t,r,i)}}class Lz{constructor(){this.CLASS_NAME="LabelMatrixCell"}}class uot extends Lz{constructor(e){super(e),this.height=0,this.pathField=null,this.rotation=0,this.width=0,this.sizeFixed=!1,this.type="IMAGE",e&&H.extend(this,e),this.CLASS_NAME="SuperMap.LabelImageCell"}destroy(){var e=this;e.height=null,e.pathField=null,e.rotation=null,e.width=null,e.sizeFixed=null}}class hot extends Lz{constructor(e){super(e),this.style=new gs,this.symbolIDField=null,this.type="SYMBOL",e&&H.extend(this,e),this.CLASS_NAME="SuperMap.LabelSymbolCell"}destroy(){var e=this;e.style&&(e.style.destroy(),e.style=null),e.symbolIDField=null}}class cot extends Lz{constructor(e){super(e),this.themeLabel=new s3,this.type="THEME",e&&H.extend(this,e),this.CLASS_NAME=" SuperMap.LabelThemeCell"}destroy(){var e=this;e.themeLabel&&(e.themeLabel.destroy(),e.themeLabel=null)}}class fot{constructor(e){this.layerName=null,this.isVisible=null,this.displayFilter=null,this.fieldValuesDisplayFilter=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.LayerStatus"}destroy(){var e=this;e.layerName=null,e.isVisible=null,e.displayFilter=null}toJSON(){var e="{";e+='"type":"UGC",';var t=[];return this.layerName&&(t.push('"name":"'+this.layerName+'"'),t.push('"visible":'+this.isVisible)),this.displayFilter&&t.push('"displayFilter":"'+this.displayFilter+'"'),(this.minScale||this.minScale==0)&&t.push('"minScale":'+this.minScale),(this.maxScale||this.maxScale==0)&&t.push('"maxScale":'+this.maxScale),this.fieldValuesDisplayFilter&&t.push('"fieldValuesDisplayFilter":'+H.toJSON(this.fieldValuesDisplayFilter)),e+=t,e+="}",e}}class dot{constructor(e){this.datasourceConnectionInfo=null,this.foreignKeys=null,this.foreignTable=null,this.linkFields=null,this.linkFilter=null,this.name=null,this.primaryKeys=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.LinkItem"}destroy(){var e=this;e.datasourceConnectionInfo instanceof One&&(e.datasourceConnectionInfo.destroy(),e.datasourceConnectionInfo=null),e.foreignKeys=null,e.foreignTable=null,e.linkFields=null,e.linkFilter=null,e.name=null,e.primaryKeys=null}}class dK extends ra{constructor(e,t){super(e,t),this.projection=null,this.CLASS_NAME="SuperMap.MapService",t&&H.extend(this,t);var r=this;if(r.projection){var i=r.projection.split(":");i instanceof Array&&(i.length===2&&(r.url=H.urlAppend(r.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${i[1]}"}`)}`)),i.length===1&&(r.url=H.urlAppend(r.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${i[0]}"}`)}`)))}}destroy(){super.destroy()}processAsync(e){var t=this;return t.request({method:"GET",scope:t,success:e,failure:e})}transformResult(e,t){e=H.transformResult(e);var r=e.code>=200&&e.code<300||e.code==0||e.code===304,i=e.code&&r;return!e.code||i?{result:e,options:t}:{error:e,options:t}}}class vK{constructor(e){!e||(this.dataset=null,this.extractRegion=null,this.expression=null,this.isZip=!1,this.ignoreNoValue=!1,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.MathExpressionAnalysisParameters")}destroy(){var e=this;e.dataset=null,e.bounds=null,e.expression=null,e.isZip=!0,e.ignoreNoValue=!0,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var r in e)if(r!=="dataset"&&(t[r]=e[r]),r==="extractRegion"&&e[r]){for(var i=e[r].components[0].components,a={},o=[],s="REGION",l=i.length,u=0;u<l-1;u++){var h={};h.x=i[u].x,h.y=i[u].y,o.push(h)}a.points=o,a.type=s,t[r]=a}}}class pDe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.MathExpressionAnalysisService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof vK&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/mathanalyst")),vK.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class gDe{constructor(e,t){!e||(this.geometry=e,this.unit=Wl.METER,this.prjCoordSys=null,this.distanceMode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.MeasureParameters")}destroy(){var e=this;e.geometry=null,e.unit=null,e.prjCoordSys=null}}class yDe extends ra{constructor(e,t){super(e,t),this.measureMode=JZ.DISTANCE,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.MeasureService"}destroy(){super.destroy();var e=this;e.measureMode=null}processAsync(e,t){if(e instanceof gDe){var r=this,i=e.geometry,a=0,o=null;if(!!i){r.url=H.urlPathAppend(r.url,r.measureMode===JZ.AREA?"area":"distance");var s=Vo.fromGeometry(i);if(!!s){a=s.parts[0],o=s.points.splice(0,a);var l,u,h;return e.prjCoordSys?(typeof e.prjCoordSys=="object"?(u=e.prjCoordSys.projCode,l='{"epsgCode"'+u.substring(u.indexOf(":"),u.length)+"}"):typeof e.prjCoordSys=="string"&&(l='{"epsgCode"'+e.prjCoordSys.substring(e.prjCoordSys.indexOf(":"),e.prjCoordSys.length)+"}"),h={point2Ds:H.toJSON(o),unit:e.unit,prjCoordSys:l,distanceMode:e.distanceMode||"Geodesic"}):h={point2Ds:H.toJSON(o),unit:e.unit,distanceMode:e.distanceMode||"Geodesic"},r.request({method:"GET",params:h,scope:r,success:t,failure:t})}}}}}class vot{constructor(e){e=e||{},this.allowPointOverlap=!0,this.allowPointWithTextDisplay=!0,this.allowTextOverlap=!1,this.allowTextAndPointOverlap=!0,this.allowThemeGraduatedSymbolOverlap=!1,this.allowThemeGraphOverlap=!1,this.horizontalOverlappedSpaceSize=0,this.verticalOverlappedSpaceSize=0,H.extend(this,e),this.ugcLayer=new Nne(e),this.CLASS_NAME="SuperMap.OverlapDisplayedOptions"}destroy(){H.reset(this)}fromJson(e){this.ugcLayer.fromJson.apply(this,[e])}toServerJSONObject(){var e=this.ugcLayer.toServerJSONObject.apply(this,arguments);return e}toString(){var e=this.ugcLayer.toServerJSONObject.apply(this,arguments),t="{";for(var r in e)e.hasOwnProperty(r)&&(t+="'"+r+"':"+e[r]+",");return t=t.substr(0,t.length-1),t+="}",t}}class mDe extends Hu{constructor(e,t){super(e,t),this.mode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.OverlayAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof sK?(i.mode="datasets",i.url=H.urlPathAppend(i.url,"datasets/"+e.sourceDataset+"/overlay"),sK.toObject(e,r)):e instanceof $8&&(i.mode="geometry",e.operateGeometries&&e.sourceGeometries?(i.url=H.urlPathAppend(i.url,"geometry/overlay/batch"),i.url=H.urlAppend(i.url,"ignoreAnalystParam=true")):i.url=H.urlPathAppend(i.url,"geometry/overlay"),$8.toObject(e,r)),this.returnContent=!0;var a=H.toJSON(r);return i.request({method:"POST",data:a,scope:i,success:t,failure:t})}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class _De{constructor(e){!e||(this.datasetName="",this.datasetOverlay="",this.mode="",this.srcFields="",this.overlayFields="",this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.OverlayGeoJobParameter")}destroy(){this.datasetName=null,this.datasetOverlay=null,this.mode=null,this.srcFields=null,this.overlayFields=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r=="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class sB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/overlay"),this.CLASS_NAME="SuperMap.OverlayGeoJobsService"}destroy(){super.destroy()}getOverlayGeoJobs(e){return super.getJobs(this.url,e)}getOverlayGeoJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addOverlayGeoJob(e,t,r,i){return super.addJob(this.url,e,_De,t,r,i)}}class xDe extends OS{constructor(e){e=e||{},super(e),this.returnContent=!0,this.bounds=null,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryByBoundsParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.bounds&&(e.bounds=null)}}class Pz extends ra{constructor(e,t){super(e,t),this.returnContent=!1,this.format=Ni.GEOJSON,this.returnFeatureWithFieldCaption=!1,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.QueryService",this.url&&(t&&t.format&&(this.format=t.format.toUpperCase()),this.url=H.urlPathAppend(this.url,"queryResults"))}destroy(){super.destroy();var e=this;e.returnContent=null,e.format=null}processAsync(e,t){if(e instanceof OS){var r=this,i=null,a=null;return r.returnContent=e.returnContent,a=r.getJsonParameters(e),r.returnContent||(i=e.returnCustomResult,i&&(r.url=H.urlAppend(r.url,"returnCustomResult="+i))),r.returnFeatureWithFieldCaption=e.returnFeatureWithFieldCaption,r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}transformResult(e,t){var r=this;e=H.transformResult(e);var i=new uh;if(e&&e.recordsets)for(var a=0,o=e.recordsets,s=o.length;a<s;a++)o[a].features&&(r.returnFeatureWithFieldCaption===!0&&o[a].features.map(l=>(l.fieldNames=o[a].fieldCaptions,l)),r.format===Ni.GEOJSON&&(o[a].features=i.toGeoJSON(o[a].features)));return{result:e,options:t}}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}getQueryParameters(e){return new OS({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class SDe extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof xDe))return null;var t=this,r="",i=null,a=e.bounds;return i=t.getQueryParameters(e),r+="'queryMode':'BoundsQuery','queryParameters':",r+=H.toJSON(i),r+=",'bounds': {'rightTop':{'y':"+a.top+",'x':"+a.right+"},'leftBottom':{'y':"+a.bottom+",'x':"+a.left+"}}",r="{"+r+"}",r}}class wDe extends OS{constructor(e){e=e||{},super(e),this.geometry=null,this.isNearest=null,this.returnContent=!0,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryByDistanceParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.distance=null,e.isNearest=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}}class bDe extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof wDe){var t=this,r="",i=t.getQueryParameters(e),a=Vo.fromGeometry(e.geometry);return r+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",r+=H.toJSON(i),r+=",'geometry':"+H.toJSON(a)+",'distance':"+e.distance,r="{"+r+"}",r}}}class EDe extends OS{constructor(e){e=e||{},super(e),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=n3.INTERSECT,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.geometry=null,e.spatialQueryMode=null}}class TDe extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof EDe){var t=this,r="",i=null,a=e.geometry,o=Vo.fromGeometry(a);return i=t.getQueryParameters(e),r+="'queryMode':'SpatialQuery','queryParameters':",r+=H.toJSON(i)+",'geometry':"+H.toJSON(o)+",'spatialQueryMode':"+H.toJSON(e.spatialQueryMode),r="{"+r+"}",r}}}class ZR extends OS{constructor(e){e=e||{},super(e),this.returnContent=!0,H.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();var e=this;e.returnContent=null}}class j8 extends Pz{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof ZR){var t=this,r="",i=null;return i=t.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':",r+=H.toJSON(i),r="{"+r+"}",r}}}class CDe{constructor(e){this.referenceDatasetName=null,this.referenceFilterQueryParameter=null,this.createResultDataset=null,this.resultDatasetName=null,this.resultDatasourceName=null,this.minDistance=null,this.maxDistance=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.MinDistanceAnalystParameters"}destroy(){var e=this;e.referenceDatasetName=null,e.dataset=null,e.referenceFilterQueryParameter=null,e.createResultDataset=null,e.resultDatasetName=null,e.resultDatasourceName=null,e.minDistance=null,e.maxDistance=null}}class ADe extends CDe{constructor(e){super(e),this.dataset=null,this.inputFilterQueryParameter=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.DatasetMinDistanceAnalystParameters"}destroy(){super.destroy();var e=this;this.dataset=null,e.inputFilterQueryParameter=null}}class pK extends CDe{constructor(e){super(e),this.inputGeometries=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.GeometryMinDistanceAnalystParameters"}destroy(){super.destroy();var e=this;e.inputGeometries=null}static toObject(e,t){for(var r in e)if(r==="inputGeometries"&&e.inputGeometries){for(var i=[],a=0;a<e.inputGeometries.length;a++)i.push(Vo.fromGeometry(e.inputGeometries[a]));t.inputGeometries=i}else t[r]=e[r]}}class MDe extends Hu{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.MinDistanceAnalystService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof ADe?(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/mindistance"),i=e):e instanceof pK&&(r.url=H.urlPathAppend(r.url,"geometry/mindistance"),pK.toObject(e,i));var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class gK{constructor(e){!e||(this.dataset=null,this.cutFillType="GRID",this.afterCutFillDataset=null,this.resultDataset=null,this.buildPyramid=null,this.deleteExistResultDataset=null,this.bufferRadius=null,this.isRoundHead=null,this.line3D=null,this.region=null,this.region3D=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCutFillCalculationParameters")}destroy(){var e=this;e.cutFillType=null,e.afterCutFillDataset=null,e.resultDataset=null,e.buildPyramid=null,e.deleteExistResultDataset=null,e.bufferRadius=null,e.isRoundHead=null,e.line3D=null,e.region=null,e.region3D=null}static toObject(e,t){for(var r in e)r!=="dataset"&&(t[r]=e[r])}}class IDe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCutFillCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof gK&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/cutfill")),gK.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class yK{constructor(e){!e||(this.dataset=null,this.terrainAnalystSetting=null,this.resultDatasetName=null,this.deleteExistResultDataset=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TerrainAspectCalculationParameters")}destroy(){var e=this;e.terrainAnalystSetting=null,e.resultDatasetName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var r in e)r!=="dataset"&&(t[r]=e[r])}}class LDe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainAspectCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof yK&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/aspect")),yK.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class mK{constructor(e){!e||(this.dataset=null,this.terrainAnalystSetting=null,this.resultDatasetName=null,this.deleteExistResultDataset=null,this.zFactor=null,this.slopeType=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TerrainSlopeCalculationParameters")}destroy(){var e=this;e.terrainAnalystSetting=null,e.resultDatasetName=null,e.deleteExistResultDataset=null,e.zFactor=null,e.slopeType=null}static toObject(e,t){for(var r in e)r!=="dataset"&&(t[r]=e[r])}}class PDe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainSlopeCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof mK&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/slope")),mK.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class pot{constructor(e){this.model=null,this.resultSetting=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ConvexHullAnalystParameters"}destroy(){var e=this;e.model=null,e.resultSetting=null}}class ODe extends Hu{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ConvexHullAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r=this;r.url=H.urlPathAppend(r.url,"geometry/3d/convexhull");var i=H.toJSON(e);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}class RDe{constructor(e){this.edgeID=null,this.nodeID=null,this.weightName=null,this.returnFeatures=!0,this.isUncertainDirectionValid=!0,this.traceType=null,this.withIndex=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TraceAnalystParameters"}destroy(){var e=this;e.edgeID=null,e.nodeID=null,e.weightName=null,e.returnFeatures=null,e.isUncertainDirectionValid=null,e.type=null,e.withIndex=null}}class DDe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TraceAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof RDe){var r=this,i;if(e.traceType===0)r.url=H.urlPathAppend(r.url,"traceup");else if(e.traceType===1)r.url=H.urlPathAppend(r.url,"tracedown");else return;if(i={weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid,returnFeatures:e.returnFeatures},!(e.edgeID!==null&&e.nodeID!==null)&&!(e.edgeID===null&&e.nodeID===null))return e.edgeID!==null?i.edgeID=e.edgeID:i.nodeID=e.nodeID,r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}toGeoJSONResult(e){if(!e)return null;var t=new uh;return e.edgesFeatures&&(e.edgesFeatures=t.toGeoJSON(e.edgesFeatures)),e.nodesFeatures&&(e.nodesFeatures=t.toGeoJSON(e.nodesFeatures)),e}}class NDe{constructor(e){this.connected=null,this.returnFeatures=!0,this.edgeIDs=null,this.nodeIDs=null,this.withIndex=null,H.extend(this,e),this.CLASS_NAME="SuperMap.ConnectedEdgesAnalystParameters"}destroy(){var e=this;e.edgeIDs=null,e.nodeIDs=null,e.connected=null,e.returnFeatures=null,e.withIndex=null}}class kDe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ConnectedEdgesAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof NDe){var r=this,i;if(r.url=H.urlPathAppend(r.url,"connectededges"),i={connected:e.connected,returnFeatures:e.returnFeatures},!(e.edgeIDs!==null&&e.nodeIDs!==null)&&!(e.edgeIDs===null&&e.nodeIDs===null))return e.edgeIDs!==null?i.edgeIDs=e.edgeIDs:i.nodeIDs=e.nodeIDs,r.request({method:"GET",params:i,scope:r,success:t,failure:t})}}toGeoJSONResult(e){if(!e)return null;var t=new uh;return e.edgesFeatures&&(e.edgesFeatures=t.toGeoJSON(e.edgesFeatures)),e.nodesFeatures&&(e.nodesFeatures=t.toGeoJSON(e.nodesFeatures)),e}}class got{constructor(e){this.bbox=null,this.layers=null,this.transparent=null,this.mapScale=null,this.returnVisibleOnly=null,this.width=null,this.height=null,H.extend(this,e),this.CLASS_NAME="SuperMap.GetLayersLegendInfoParameters"}destroy(){var e=this;e.bbox=null,e.layers=null,e.transparent=null,e.mapScale=null,e.returnVisibleOnly=null,e.width=null,e.height=null}}class FDe extends ra{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GetLayersLegendInfoService"}destroy(){super.destroy(),H.reset(this)}processAsync(e,t){var r=this,i="GET";return r.url=H.urlPathAppend(r.url,"/legend"),r.request({method:i,params:e,scope:r,success:t,failure:t})}}class BDe{constructor(e,t){this.options=t||{},this.url=e}queryByBounds(e,t,r){var i=this,a=new SDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}queryByDistance(e,t,r){var i=this,a=new bDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r});return a.processAsync(e,t)}queryBySQL(e,t,r){var i=this,a=new j8(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r});return a.processAsync(e,t)}queryByGeometry(e,t,r){var i=this,a=new TDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r});return a.processAsync(e,t)}_processFormat(e){return e||Ni.GEOJSON}}class GDe{constructor(e){if(!e)return this;this.sourceRoute=null,this.point=null,this.tolerance=null,this.isIgnoreGap=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.RouteCalculateMeasureParameters"}destroy(){var e=this;e.sourceRoute=null,e.point=null,e.tolerance&&(e.tolerance=null),e.isIgnoreGap&&(e.isIgnoreGap=!1)}}class zDe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteCalculateMeasureService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof GDe){var r=this,i;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t,r="geometry/calculatemeasure",i=this;return i.url=H.urlPathAppend(i.url,r),i.url=H.urlAppend(i.url,"returnContent=true"),t=H.toJSON(e),t}}class UDe{constructor(e){if(!e)return this;this.sourceRoute=null,this.dataset=null,this.routeIDField=null,this.routeID=null,this.type=null,this.measure=null,this.offset=0,this.isIgnoreGap=!1,this.startMeasure=null,this.endMeasure=null;var t=e.sourceRoute,r={};if(t&&t instanceof rg&&t.components){r.type=t.type,r.parts=t.parts;for(var i=[],a=0,o=t.components.length;a<o;a++)i=i.concat(t.components[a].components);r.points=i,e.sourceRoute=r}H.extend(this,e),this.CLASS_NAME="SuperMap.RouteLocatorParameters"}destroy(){var e=this;e.sourceRoute=null,e.type=null,e.measure=null,e.offset=0,e.isIgnoreGap=!1,e.startMeasure=null,e.endMeasure=null,e.dataset=null,e.routeID=null,e.routeIDField=null}}class VDe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteLocatorService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof UDe){var r=this,i;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t,r="geometry/routelocator",i=this;return e.dataset&&(r="datasets/"+e.dataset+"/linearreferencing/routelocator",e.sourceRoute=null),i.url=H.urlPathAppend(i.url,r),i.url=H.urlAppend(i.url,"returnContent=true"),t=H.toJSON(e),t}}class u3{constructor(e){this.fieldNames=null,this.fieldValues=null,this.geometry=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ServerFeature"}destroy(){var e=this;e.fieldNames=null,e.fieldValues=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}toFeature(){var e,t,r,i={},a=this,o;e=a.fieldNames,t=a.fieldValues;for(var s in e)i[e[s]]=t[s];return a.geometry&&(r=a.geometry.toGeometry()),o=new sc(r,i),a.geometry&&a.geometry.id&&(o.fid=a.geometry.id),o}static fromJson(e){var t=null;if(!!e)return t=e.geometry,t&&(t=Vo.fromJson(t)),new u3({fieldNames:e.fieldNames,fieldValues:e.fieldValues,geometry:t})}}class $De{constructor(e){!e||(this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.SetDatasourceParameters")}destroy(){var e=this;e.datasourceName=null,e.description=null,e.coordUnit=null,e.distanceUnit=null}}class yot{constructor(e){e=e||{},this.resourceID=null,this.tempLayerName=null,this.layerInfo=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SetLayerInfoParameters"}destroy(){var e=this;e.resourceID=null,e.tempLayerName=null,e.layerInfo=null}}class WDe extends ra{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerInfoService"}destroy(){super.destroy(),H.reset(this)}processAsync(e,t){if(!!e){var r=this,i=H.toJSON(e);return r.request({method:"PUT",data:i,scope:r,success:t,failure:t})}}}class mot{constructor(e){e=e||{},this.isTempLayers=null,this.resourceID=null,this.layersInfo=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SetLayersInfoParameters"}destroy(){var e=this;e.isTempLayers=null,e.resourceID=null,e.layersInfo=null}}class HDe extends ra{constructor(e,t){super(e,t),this.resourceID=null,this.isTempLayers=!1,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.SetLayersInfoService"}destroy(){super.destroy(),H.reset(this)}processAsync(e,t){if(!!e){var r,i=[],a=this,o="";a.isTempLayers?(a.url=H.urlPathAppend(a.url,"tempLayersSet/"+a.resourceID),o="PUT"):(a.url=H.urlPathAppend(a.url,"tempLayersSet"),o="POST"),e.subLayers||(e.subLayers={layers:[]}),e.subLayers.layers||(e.subLayers.layers=[]);var s=e.subLayers.layers,l=s.length;for(let v in s){if(s[v].ugcLayerType==="GRID"){var u={},h=s[v].colorDictionarys;for(var c in h){var f=h[c].elevation;u[f]=h[c].color}}s[v].colorDictionary=u,delete s[v].colorDictionarys}for(let v=0;v<l;v++)s[v].toJsonObject?i.push(s[v].toJsonObject()):i.push(s[v]);r=H.extend(r,e),r.subLayers={layers:i},r.object=null;var d=H.toJSON([r]);return a.request({method:o,data:d,scope:a,success:t,failure:t})}}}class jDe{constructor(e){this.layerStatusList=[],this.holdTime=15,this.resourceID=null,e&&H.extend(this,e)}destroy(){var e=this;e.layerStatusList=null,e.holdTime=null,e.resourceID=null}toJSON(){var e="{";e+='"layers":[';for(var t=[],r=0,i=this.layerStatusList.length;r<i;r++)t.push(this.layerStatusList[r].toJSON());return e+=t,e+="]",e+="}",e}}class XDe extends ra{constructor(e,t){super(e,t),this.lastparams=null,this.mapUrl=e,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerStatusService"}destroy(){super.destroy(),H.reset(this)}processAsync(e,t){if(e instanceof jDe){var r=this,i="POST";if(r.url=r.mapUrl,e.resourceID==null)return r.url=H.urlPathAppend(r.url,"tempLayersSet"),r.lastparams=e,r.request({method:i,scope:r,success:r.createTempLayerComplete.bind(r,t),failure:t});r.url=H.urlPathAppend(r.url,"tempLayersSet/"+e.resourceID),r.url=H.urlAppend(r.url,"elementRemain=true&reference="+e.resourceID+"&holdTime="+e.holdTime.toString());var a="[{";return a+='"type":"UGC",',e.layerStatusList!=null&&e.layerStatusList.length>0&&(a+='"subLayers":'+e.toJSON()),a+=',"visible":'+!0+",",a+='"name":"'+this.getMapName(this.mapUrl)+'"',a+="}]",r.request({method:"PUT",data:a,scope:r,success:t,failure:t})}}createTempLayerComplete(e,t){var r=this;return t.result=H.transformResult(t.result),t.result.succeed&&(r.lastparams.resourceID=t.result.newResourceID),r.processAsync(r.lastparams,e)}getMapName(e){var t=e;t.charAt(t.length-1)==="/"&&(t=t.substr(0,t.length-1));var r=t.lastIndexOf("/"),i=t.substring(r+1,t.length);return i}transformResult(e,t){var r=this;return e=H.transformResult(e),e!=null&&r.lastparams!=null&&r.lastparams.resourceID!=null&&(e.newResourceID=r.lastparams.resourceID),{result:e,options:t}}}class YDe{constructor(e){!e||(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=n3.CONTAIN,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class lB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(e){return super.getJobs(this.url,e)}getQueryJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addQueryJob(e,t,r,i){return super.addJob(this.url,e,YDe,t,r,i)}}class qDe{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){H.reset(this)}}class ZDe extends ra{constructor(e,t){super(e,t),t=t||{},H.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),H.reset(this)}processAsync(e,t){if(e instanceof qDe){var r=this;return r.url=H.urlPathAppend(r.url,"stops/keyword/"+e.keyWord),r.request({method:"GET",params:{returnPosition:e.returnPosition},scope:r,success:t,failure:t})}}}class KDe{constructor(e){!e||(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class uB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(e){return super.getJobs(this.url,e)}getSummaryAttributesJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addSummaryAttributesJob(e,t,r,i){return super.addJob(this.url,e,KDe,t,r,i)}}class JDe{constructor(e){!e||(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=bOe.AVERAGE,this.fields="",this.type=Ene.SUMMARYMESH,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SummaryMeshJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.statisticModes=null,this.meshType=null,this.fields=null,this.regionDataset=null,this.type=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="type"){t.type=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}(e.type==="SUMMARYMESH"&&r!=="regionDataset"||e.type==="SUMMARYREGION"&&!i(["meshType","resolution","query"],r))&&(t.analyst=t.analyst||{},r==="query"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r]))}function i(a,o){for(var s=a.length;s--;)if(a[s]===o)return!0;return!1}}}class hB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(e){return super.getJobs(this.url,e)}getSummaryMeshJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addSummaryMeshJob(e,t,r,i){return super.addJob(this.url,e,JDe,t,r,i)}}class QDe{constructor(e){!e||(this.datasetName="",this.regionDataset="",this.sumShape=!0,this.query="",this.standardSummaryFields=!1,this.standardFields="",this.standardStatisticModes="",this.weightedSummaryFields=!1,this.weightedFields="",this.weightedStatisticModes="",this.meshType=0,this.resolution=100,this.meshSizeUnit=zR.METER,this.type=Ene.SUMMARYMESH,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.SummaryRegionJobParameter")}destroy(){this.datasetName=null,this.sumShape=null,this.regionDataset=null,this.query=null,this.standardSummaryFields=null,this.standardFields=null,this.standardStatisticModes=null,this.weightedSummaryFields=null,this.weightedFields=null,this.weightedStatisticModes=null,this.meshType=null,this.resolution=null,this.meshSizeUnit=null,this.type=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="type"){t.type=e[r];continue}if(r==="type"){t.type=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}(e.type==="SUMMARYREGION"||e.type==="SUMMARYMESH"&&r!=="regionDataset")&&(t.analyst=t.analyst||{},r==="query"&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r]))}}}class cB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(e){return super.getJobs(this.url,e)}getSummaryRegionJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addSummaryRegionJob(e,t,r,i){return super.addJob(this.url,e,QDe,t,r,i)}}class kne{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.SupplyCenter"}destroy(){var e=this;e.maxWeight=null,e.nodeID=null,e.resourceValue=null,e.type=null}static fromJson(e){if(!!e)return new kne({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class _ot{constructor(e){this.bounds=null,this.boundsType=AOe.MAX,this.cellSize=null,this.cellSizeType=MOe.UNION,H.extend(this,e),this.CLASS_NAME="SuperMap.terrainAnalystSetting"}destroy(){var e=this;e.bounds=null,e.boundsType=null,e.cellSize=null,e.cellSizeType=null}}class eNe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.SurfaceAnalystService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof xz){var r=this,i;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t="",r={},i=this;if(e instanceof lK)i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/"+e.surfaceAnalystMethod.toLowerCase()),lK.toObject(e,r),t=H.toJSON(r);else if(e instanceof VRe)i.url=H.urlPathAppend(i.url,"geometry/"+e.surfaceAnalystMethod.toLowerCase()),t=H.toJSON(e);else return;return this.returnContent=!0,t}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class _K{constructor(e){!e||(this.dataset=null,this.zFactor=1,this.averageCurvatureName=null,this.profileCurvatureName="",this.planCurvatureName="",this.deleteExistResultDataset=!1,H.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationParameters")}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){for(var r in e)r!=="dataset"&&(t[r]=e[r])}}class tNe extends Hu{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationService"}destroy(){super.destroy()}processAsync(e,t){var r=this,i={};e instanceof _K&&(r.url=H.urlPathAppend(r.url,"datasets/"+e.dataset+"/terraincalculation/curvature")),_K.toObject(e,i);var a=H.toJSON(i);return r.url=H.urlAppend(r.url,"returnContent=true"),r.request({method:"POST",data:a,scope:r,success:t,failure:t})}}class Fne{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new gs,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeFlow"}destroy(){var e=this;e.flowEnabled=null,e.leaderLineDisplayed=null,e.leaderLineStyle&&(e.leaderLineStyle.destroy(),e.leaderLineStyle=null)}static fromObj(e){if(!!e){var t=new Fne;return H.copy(t,e),t.leaderLineStyle=gs.fromJson(e.leaderLineStyle),t}}}class Oz{constructor(e){this.caption=null,this.color=new Js,this.end=0,this.start=0,this.visible=!0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRangeItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.color&&(e.color.destroy(),e.color=null),e.visible=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(!!e){var t=new Oz;return H.copy(t,e),t.color=Js.fromJson(e.color),t}}}class Bne extends R_{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=vz.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=i3.YELLOW_RED,this.reverseColor=!1,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRange"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.reverseColor=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(!!e){var t=new Bne;H.copy(t,e);var r=e.items,i=r?r.length:0;t.items=[];for(var a=0;a<i;a++)t.items.push(Oz.fromObj(r[a]));return t}}}class Rz{constructor(e){this.caption=null,this.color=new Js,this.unique=null,this.visible=!0,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridUniqueItem"}destroy(){var e=this;e.caption=null,e.unique=null,e.color&&(e.color.destroy(),e.color=null),e.visible=null}toServerJSONObject(){var e={};return e=H.copyAttributes(e,this),e.color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){var t=new Rz;return H.copy(t,e),t.color=Js.fromJson(e.color),t}}class Gne extends R_{constructor(e){super("GRIDUNIQUE",e),this.defaultcolor=new Js,this.items=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridUnique"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultcolor&&(e.defaultcolor.destroy(),e.defaultcolor=null)}toServerJSONObject(){var e={};if(e=H.copyAttributes(e,this),e.defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,i=0;i<r;i++)t.push(e.items[i].toServerJSONObject());e.items=t}return e}static fromObj(e){var t=new Gne,r=e.items,i=r?r.length:0;H.extend(t,e),t.items=[],t.defaultcolor=Js.fromJson(e.defaultcolor);for(var a=0;a<i;a++)t.items.push(Rz.fromObj(r[a]));return t}}class zne{constructor(e){this.caption=null,this.unique=null,this.offsetX=0,this.offsetY=0,this.visible=!0,this.style=new md,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelUniqueItem"}destroy(){var e=this;e.unique=null,e.caption=null,e.offsetX=null,e.offsetY=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}static fromObj(e){if(!!e){var t=new zne;return H.copy(t,e),t}}}class xot{constructor(e,t){this.srcData=e,this.targetData=t,this.CLASS_NAME="SuperMap.ThemeMemoryData"}destroy(){var e=this;e.srcData=null,e.targetData=null}toJSON(){if(this.srcData&&this.targetData){for(var e="",t=Math.min(this.srcData.length,this.targetData.length),r=0;r<t;r++)e+="'"+this.srcData[r]+"':'"+this.targetData[r]+"',";return r>0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}else return null}}class rNe{constructor(e){this.datasetNames=null,this.dataSourceNames=null,this.joinItems=null,this.themes=null,this.displayFilters=null,this.displayOrderBys=null,this.fieldValuesDisplayFilter=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.ThemeParameters"}destroy(){var e=this;if(e.datasetNames=null,e.dataSourceNames=null,e.joinItems){for(let t=0,r=e.joinItems,i=r.length;t<i;t++)r[t].destroy();e.joinItems=null}if(e.themes){for(let t=0,r=e.themes,i=r.length;t<i;t++)r[t].destroy();e.themes=null}}}class nNe extends ra{constructor(e,t){super(e,t),t&&H.extend(this,t),this.url=H.urlPathAppend(this.url,"tempLayersSet"),this.CLASS_NAME="SuperMap.ThemeService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof rNe){var r=this,i=null;return i=r.getJsonParameters(e),r.request({method:"POST",data:i,scope:r,success:t,failure:t})}}getJsonParameters(e){var t="",r=null,i=null,a=null,o;t+="[{'type': 'UGC','subLayers': {'layers': [";for(var s=0;s<e.themes.length;s++){r=e.themes[s];var l=H.toJSON(r);if(l=l.slice(0,-1),t+="{'theme': "+l+"},'type': 'UGC','ugcLayerType': 'THEME',",i=e.displayFilters,i&&i.length>0&&(i.length===1?t+=`'displayFilter':"`+i[0]+'",':t+=`'displayFilter':"`+i[s]+'",'),a=e.displayOrderBy,a&&a.length>0&&(a.length===1?t+="'displayOrderBy':'"+a[0]+"',":t+="'displayOrderBy':'"+a[s]+"',"),o=e.fieldValuesDisplayFilter,o&&(t+="'fieldValuesDisplayFilter':"+H.toJSON(o)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[s]&&(t+="'joinItems':["+H.toJSON(e.joinItems[s])+"],"),e.datasetNames&&e.dataSourceNames){var u=e.datasetNames[s]?s:e.datasetNames.length-1,h=e.dataSourceNames[s]?s:e.dataSourceNames.length-1;t+="'datasetInfo': {'name': '"+e.datasetNames[u]+"','dataSourceName': '"+e.dataSourceNames[h]+"'}},"}else t+="},"}e.themes&&e.themes.length>0&&(t=t.substring(0,t.length-1)),t+="]},";var c=this.url.split("/"),f=c[c.length-2];return t+="'name': '"+f+"'}]",t}}class iNe extends Hu{constructor(e,t){super(e,t),this.mode=null,t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e,t){var r={},i=this;e instanceof uK?(i.mode="datasets",i.url=H.urlPathAppend(i.url,"datasets/"+e.dataset+"/thiessenpolygon"),uK.toObject(e,r)):e instanceof W8&&(i.mode="geometry",i.url=H.urlPathAppend(i.url,"geometry/thiessenpolygon"),W8.toObject(e,r));var a=H.toJSON(r);return this.returnContent=!0,i.request({method:"POST",data:a,scope:i,success:t,failure:t})}dataFormat(){return[Ni.GEOJSON,Ni.ISERVER,Ni.FGB]}}class aNe extends Hu{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e,t){var r=this;r.url=H.urlPathAppend(r.url,"geometry/batchanalyst"),r.url=H.urlAppend(r.url,"returnContent=true&ignoreAnalystParam=true");var i=r._processParams(e),a=H.toJSON(i);return r.request({method:"POST",data:a,scope:r,success:t,failure:t})}_processParams(e){var t=this;if(!!H.isArray(e)){var r=[];return e.map(function(i){return r.push(t._toJSON(i)),i}),r}}_toJSON(e){var t={};if(e.analystName==="buffer")t.analystName="buffer",t.param={},U8.toObject(e.param,t.param);else if(e.analystName==="overlay")t.analystName="overlay",t.param={},$8.toObject(e.param,t.param);else if(e.analystName==="interpolationDensity")t.analystName="interpolationDensity",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="interpolationidw")t.analystName="interpolationidw",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="interpolationRBF")t.analystName="interpolationRBF",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="interpolationKriging")t.analystName="interpolationKriging",t.param={},Dy.toObject(e.param,t.param);else if(e.analystName==="thiessenpolygon")t.analystName="thiessenpolygon",t.param={},W8.toObject(e.param,t.param);else return e;return t}destroy(){super.destroy()}}class oNe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(e){if(!!this.url){var t=this;return t.url=H.urlPathAppend(t.url,"tilesets"),t.request({method:"GET",scope:t,success:e,failure:e})}}}class sNe{constructor(e){!e||(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=EOe.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class fB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(e){return super.getJobs(this.url,e)}getTopologyValidatorJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addTopologyValidatorJob(e,t,r,i){return super.addJob(this.url,e,sNe,t,r,i)}}class Une{constructor(e){e=e||{},this.lineID=null,this.lineName=null,this.lineAliasName=null,this.startStopIndex=null,this.startStopName=null,this.startStopAliasName=null,this.endStopIndex=null,this.endStopName=null,this.endStopAliasName=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TransferLine"}destroy(){H.reset(this)}static fromJson(e){if(!!e)return new Une({lineID:e.lineID,lineName:e.lineName,lineAliasName:e.lineAliasName,startStopIndex:e.startStopIndex,startStopName:e.startStopName,startStopAliasName:e.startStopAliasName,endStopIndex:e.endStopIndex,endStopName:e.endStopName,endStopAliasName:e.endStopAliasName})}}class lNe{constructor(e){e=e||{},this.transferLines=null,this.points=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){H.reset(this)}static toJson(e){if(e)return H.toJSON(e)}}class uNe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof lNe){var r=this,i="GET",a;return r.url=H.urlPathAppend(r.url,"path"),a={points:H.toJSON(e.points),transferLines:H.toJSON(e.transferLines)},r.request({method:i,params:a,scope:r,success:t,failure:t})}}}class hNe{constructor(e){e=e||{},this.solutionCount=6,this.transferPreference=mOe.NONE,this.transferTactic=yOe.LESS_TIME,this.walkingRatio=null,this.points=!1,this.evadeLines=null,this.evadeStops=null,this.priorLines=null,this.priorStops=null,this.travelTime=null,H.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){H.reset(this)}static toJson(e){if(e)return H.toJSON(e)}}class cNe extends ra{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof hNe){var r=this,i="GET",a;return r.url=H.urlPathAppend(r.url,"solutions"),a={points:H.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(a.evadeLines=H.toJSON(e.evadeLines)),e.evadeStops&&(a.evadeStops=H.toJSON(e.evadeStops)),e.priorLines&&(a.priorLines=H.toJSON(e.priorLines)),e.priorStops&&(a.priorStops=H.toJSON(e.priorStops)),e.travelTime&&(a.travelTime=e.travelTime),r.request({method:i,params:a,scope:r,success:t,failure:t})}}}class fNe{constructor(e){!e||(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",H.extend(this,e),this.CLASS_NAME="SuperMap.UpdateEdgeWeightParameters")}destroy(){this.edgeId=null,this.fromNodeId=null,this.toNodeId=null,this.weightField=null,this.edgeWeight=null}}class xK{constructor(e){!e||(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){var e=this;e.datasourceName=null,e.datasetName=null,e.datasetType=null}}class dNe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof fNe){var r=this,i=r.parse(e);r.url=H.urlPathAppend(r.url,i);var a=e.edgeWeight?e.edgeWeight:null;return r.request({method:"PUT",scope:r,data:a,success:t,failure:t})}}parse(e){if(!!e){var t="";for(var r in e)if(!(e[r]===""||e[r]==="edgeWeight"))switch(r){case"edgeId":t+="/edgeweight/"+e[r];break;case"fromNodeId":t+="/fromnode/"+e[r];break;case"toNodeId":t+="/tonode/"+e[r];break;case"weightField":t+="/weightfield/"+e[r];break}return t}}}class vNe{constructor(e){!e||(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",H.extend(this,e),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightParameters")}destroy(){this.nodeId=null,this.fromEdgeId=null,this.toEdgeId=null,this.weightField=null,this.turnNodeWeight=null}}class pNe extends Bd{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof vNe){var r=this,i=r.parse(e);r.url=H.urlPathAppend(r.url,i);var a=e.turnNodeWeight?e.turnNodeWeight:null;return r.request({method:"PUT",scope:r,data:a,success:t,failure:t})}}parse(e){if(!!e){var t="";for(var r in e)if(!(e[r]===""||e[r]==="turnNodeWeight"))switch(r){case"nodeId":t+="/turnnodeweight/"+e[r];break;case"fromEdgeId":t+="/fromedge/"+e[r];break;case"toEdgeId":t+="/toedge/"+e[r];break;case"weightField":t+="/weightfield/"+e[r];break}return t}}}class SK{constructor(e){!e||(this.datasourceName=null,this.datasetName=null,this.isFileCache=null,this.description=null,this.prjCoordSys=null,this.charset=null,this.palette=null,this.noValue=null,e&&H.extend(this,e),this.CLASS_NAME="SuperMap.UpdateDatasetParameters")}destroy(){var e=this;e.datasourceName=null,e.datasetName=null,e.isFileCache=null,e.prjCoordSys=null,e.charset=null,e.palette=null,e.noValue=null}}class gNe{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=SOe.CLIP,this.output=null,this.mappingParameters=null,H.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof Cm&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof Am&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e){if(r==="datasetName"){t.input=t.input||{},t.input[r]=e[r];continue}if(r==="output"){t.output=t.output||{},t.output=e[r];continue}t.analyst=t.analyst||{},t.analyst[r]=e[r],r==="mappingParameters"&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])}}}class dB extends Mm{constructor(e,t){super(e,t),this.url=H.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(e){return super.getJobs(this.url,e)}getVectorClipJob(e,t){return super.getJobs(H.urlPathAppend(this.url,e),t)}addVectorClipJob(e,t,r,i){return super.addJob(this.url,e,gNe,t,r,i)}}class Vne{constructor(e){e=e||{},this.type=null,H.extend(this,e),this.CLASS_NAME="SuperMap.RasterFunctionParameter"}destroy(){this.type=null}}class Sot extends Vne{constructor(e){super(e),this.redIndex=0,this.nirIndex=1,this.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff",this.type=Tne.NDVI,H.extend(this,e),this.CLASS_NAME="SuperMap.NDVIParameter"}destroy(){super.destroy(),this.redIndex=null,this.nirIndex=null,this.colorMap=null}toJSON(){return{redIndex:this.redIndex,nirIndex:this.nirIndex,colorMap:this.colorMap,type:this.type}}}class wot extends Vne{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=Tne.HILLSHADE,H.extend(this,e),this.CLASS_NAME="SuperMap.HillshadeParameter"}destroy(){super.destroy(),this.altitude=null,this.azimuth=null,this.zFactor=null}toJSON(){return{altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,type:this.type}}}class yNe{constructor(e){this.name=null,this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobCustomItems",H.extend(this,e)}destroy(){var e=this;e.name=null,e.picAsUrl=null,e.picAsBase64=null}toJSON(){var e={name:this.name};return this.title&&(e.title=this.title),this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),H.toJSON(e)}}class mNe{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobImage",H.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl&&(e.picAsUrl=this.picAsUrl),this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),H.toJSON(e)}}class $ne{constructor(e){this.name=null,this.layerType=null,this.url=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayers",H.extend(this,e)}destroy(){this.name=null,this.layerType=null,this.url=null}}class _Ne{constructor(e){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers=null,this.customItems=null,this.CLASS_NAME="SuperMap.WebPrintingJobLegendOptions",H.extend(this,e)}destroy(){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers instanceof $ne&&(this.layers.destroy(),this.layers=null),this.customItems instanceof yNe&&(this.customItems.destroy(),this.customItems=null)}toJSON(){var e={title:this.title||""};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64?e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,""):this.customItems&&(e.customItems=this.customItems),H.toJSON(e)}}class xNe{constructor(e){this.center=null,this.scale=null,this.layerNames=null,this.image=null,this.layers=null,this.CLASS_NAME="SuperMap.WebPrintingJobLittleMapOptions",H.extend(this,e)}destroy(){this.center=null,this.scale=null,this.layerNames=null,this.image instanceof mNe&&(this.image.destroy(),this.image=null),this.layers instanceof $ne&&(this.layers.destroy(),this.layers=null)}toJSON(){var e={scale:this.scale,center:this.center};return this.layerNames?e.layerNames=this.layerNames:this.layers&&(e.layers=this.layers),this.image&&(e.image=this.image),H.toJSON(e)}}class SNe{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobNorthArrowOptions",H.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),H.toJSON(e)}}class wNe{constructor(e){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null,this.CLASS_NAME="SuperMap.WebPrintingJobScaleBarOptions",H.extend(this,e)}destroy(){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null}toJSON(){var e={scaleText:this.scaleText||"",type:this.type||"BAR",intervals:this.intervals||"",unit:this.unit||"METER"};return this.orientation&&(e.orientation=this.orientation),H.toJSON(e)}}class bNe{constructor(e){this.type=null,this.url=null,this.token=null,this.value=null,this.CLASS_NAME="SuperMap.WebPrintingJobContent",H.extend(this,e)}destroy(){this.type="WEBMAP",this.url=null,this.token=null,this.value=null}toJSON(){var e={type:this.type};return this.token&&(e.token=this.token),this.url?e.url=this.url:this.value&&(e.value=this.value),H.toJSON(e)}}class ENe{constructor(e){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions=null,this.northArrowOptions=null,this.littleMapOptions=null,this.legendOptions=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayoutOptions",H.extend(this,e)}destroy(){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions instanceof wNe&&(this.scaleBarOptions.destroy(),this.scaleBarOptions=null),this.northArrowOptions instanceof SNe&&(this.northArrowOptions.destroy(),this.northArrowOptions=null),this.littleMapOptions instanceof xNe&&(this.littleMapOptions.destroy(),this.littleMapOptions=null),this.legendOptions instanceof _Ne&&(this.legendOptions.destroy(),this.legendOptions=null)}toJSON(){var e={templateName:this.templateName,title:this.title,subTitle:this.subTitle,author:this.author,copyright:this.copyright};return this.scaleBarOptions&&(e.scaleBarOptions=this.scaleBarOptions),this.northArrowOptions&&(e.northArrowOptions=this.northArrowOptions),this.littleMapOptions&&(e.littleMapOptions=this.littleMapOptions),this.legendOptions&&(e.legendOptions=this.legendOptions),H.toJSON(e)}}class TNe{constructor(e){this.format=null,this.dpi=96,this.scale=null,this.rotation=null,this.center=null,this.CLASS_NAME="SuperMap.WebPrintingJobExportOptions",H.extend(this,e)}destroy(){this.format=null,this.dpi=null,this.scale=null,this.rotation=null,this.center=null,this.outputSize=null}toJSON(){var e={format:this.format||"PDF",dpi:this.dpi,scale:this.scale,center:this.center};return this.rotation&&(e.rotation=this.rotation),this.outputSize&&(e.outputSize=this.outputSize),H.toJSON(e)}}class bot{constructor(e){!e||(this.content=null,this.layoutOptions=null,this.exportOptions=null,H.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof bNe&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof ENe&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof TNe&&(this.exportOptions.destroy(),this.exportOptions=null)}}class CNe extends ra{constructor(e,t){super(e,t),t&&H.extend(this,t),this.CLASS_NAME="SuperMap.WebPrintingService",this.url}destroy(){super.destroy()}createWebPrintingJob(e,t){if(!!e)return e.layoutOptions&&e.layoutOptions.legendOptions&&(!e.layoutOptions.legendOptions.title&&(e.layoutOptions.legendOptions.title=""),e.layoutOptions.legendOptions.picAsBase64=e.layoutOptions.legendOptions.picAsBase64&&e.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/,""),e.layoutOptions.legendOptions.customItems&&e.layoutOptions.legendOptions.customItems.hasOwnProperty("picAsBase64")&&(e.layoutOptions.legendOptions.customItems.picAsBase64=e.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/,""))),this.processAsync("jobs","POST",t,e)}getPrintingJob(e,t){var r=this;r.processAsync(`jobs/${e}`,"GET",function(i){r.rollingProcess(i,r._processUrl(`jobs/${e}`),t)})}getPrintingJobResult(e,t){return this.processAsync(`jobs/${e}/result`,"GET",t)}getLayoutTemplates(e){return this.processAsync("layouts","GET",e)}rollingProcess(e,t,r){var i=this;!e||(this.id&&clearInterval(this.id),this.id=setInterval(function(){i.request({url:t,method:"GET",scope:i,success:r,failure:r})},1e3))}processAsync(e,t,r,i){var a=this;let o={url:a._processUrl(e),method:t,scope:a,success:r,failure:r};return i&&(o.data=H.toJSON(i)),a.request(o)}transformResult(e,t){return e=H.transformResult(e),(e.status==="FINISHED"||e.status==="ERROR")&&clearInterval(this.id),{result:e,options:t}}_processUrl(e){return e?H.urlPathAppend(this.url,e):this.url}}class ANe extends ra{constructor(e,t){super(e,t),this.options=t||{},t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e,t){var r=this,i={collectionId:r.options.collectionId};typeof e=="function"&&(t=e,e=null);var a=H.convertPath("/collections/{collectionId}/legend",i),o=H.urlPathAppend(r.url,a);return this._processAsync({url:o,method:"GET",params:e,callback:t})}getStatistics(e){var t=this,r={collectionId:t.options.collectionId},i=H.convertPath("/collections/{collectionId}/statistics",r),a=H.urlPathAppend(t.url,i);return this._processAsync({url:a,method:"GET",callback:e})}getTileInfo(e){var t=this,r={collectionId:t.options.collectionId},i=H.convertPath("/collections/{collectionId}/tileInfo",r),a=H.urlPathAppend(t.url,i);return this._processAsync({url:a,method:"GET",callback:e})}deleteItemByID(e,t){var r=this,i={collectionId:r.options.collectionId,featureId:e},a=H.convertPath("/collections/{collectionId}/items/{featureId}",i),o=H.urlPathAppend(r.url,a);return this._processAsync({url:o,method:"DELETE",callback:t})}getItemByID(e,t){var r=this,i={collectionId:r.options.collectionId,featureId:e},a=H.convertPath("/collections/{collectionId}/items/{featureId}",i),o=H.urlPathAppend(r.url,a);return this._processAsync({url:o,method:"GET",callback:t})}_processAsync({url:e,method:t,callback:r,params:i}){return this.request({method:t||"GET",url:e,params:i,scope:this,success:r,failure:r})}}class MNe extends ra{constructor(e,t){super(e,t),this.options=t||{},t&&H.extend(this,t),this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(e){var t=this,r=H.convertPath("/collections"),i=H.urlPathAppend(t.url,r);return this._processAsync({url:i,mehtod:"GET",callback:e})}getCollectionByID(e,t){var r={collectionId:e},i=this,a=H.convertPath("/collections/{collectionId}",r),o=H.urlPathAppend(i.url,a);return this._processAsync({url:o,mehtod:"GET",callback:t})}search(e,t){var r={...e||{}},i=this,a=H.convertPath("/search"),o=H.urlPathAppend(i.url,a);return this._processAsync({url:o,method:"POST",data:r,callback:t})}_processAsync({url:e,method:t,callback:r,data:i}){return this.request({method:t||"GET",url:e,data:i,scope:this,success:r,failure:r})}}class KR{constructor(e){this.include=void 0,this.exclude=void 0,this.CLASS_NAME="SuperMap.FieldsFilter",H.extend(this,e)}destroy(){var e=this;e.include=void 0,e.exclude=void 0}static constructFromObject(e,t){return e&&(t=t||new KR,e.hasOwnProperty("include")&&(t.include=e.include),e.hasOwnProperty("exclude")&&(t.exclude=e.exclude)),t}}class jE{constructor(e){this.field=void 0,this.direction=jE.Direction.ASC,this.CLASS_NAME="SuperMap.Sortby",H.extend(this,e)}destroy(){var e=this;e.field=void 0,e.direction="ASC"}static constructFromObject(e,t){return e&&(t=t||new jE,e.hasOwnProperty("field")&&(t.field=e.field),e.hasOwnProperty("direction")&&(t.direction=e.direction)),t}}jE.Direction={ASC:"ASC",DESC:"DESC"};class Wne{constructor(e){this.bbox=void 0,this.collections=void 0,this.ids=void 0,this.limit=void 0,this.fields=void 0,this.query=void 0,this.sortby=void 0,this.CLASS_NAME="SuperMap.ImageSearchParameter",H.extend(this,e)}destroy(){var e=this;e.bbox=void 0,e.collections=void 0,e.ids=void 0,e.limit=void 0,e.fields=void 0,e.query=void 0,e.sortby=void 0}static constructFromObject(e,t){return e&&(t=t||new Wne,e.hasOwnProperty("bbox")&&(t.bbox=e.bbox),e.hasOwnProperty("collections")&&(t.collections=e.collections),e.hasOwnProperty("ids")&&(t.ids=e.ids),e.hasOwnProperty("limit")&&(t.limit=e.limit),e.hasOwnProperty("fields")&&(t.fields=KR.constructFromObject&&KR.constructFromObject(e.fields,{})||e.fields),e.hasOwnProperty("query")&&(t.query=e.query),e.hasOwnProperty("sortby")&&(t.sortby=e.sortby,e.sortby&&(t.sortby=e.sortby.map(r=>jE.constructFromObject&&jE.constructFromObject(r,{})||r)))),t}}class cM{constructor(e){this.stretchType=void 0,this.stdevCoefficient=void 0,this.gaussianCoefficient=void 0,this.useMedianValue=void 0,this.minPercent=void 0,this.maxPercent=void 0,this.CLASS_NAME="SuperMap.ImageStretchOption",H.extend(this,e)}destroy(){var e=this;e.stretchType=void 0,e.stdevCoefficient=void 0,e.gaussianCoefficient=void 0,e.useMedianValue=void 0,e.minPercent=void 0,e.maxPercent=void 0}static constructFromObject(e,t){return e&&(t=t||new cM,e.hasOwnProperty("stretchType")&&(t.stretchType=e.stretchType),e.hasOwnProperty("stdevCoefficient")&&(t.stdevCoefficient=e.stdevCoefficient),e.hasOwnProperty("gaussianCoefficient")&&(t.gaussianCoefficient=e.gaussianCoefficient),e.hasOwnProperty("useMedianValue")&&(t.useMedianValue=e.useMedianValue),e.hasOwnProperty("minPercent")&&(t.minPercent=e.minPercent),e.hasOwnProperty("maxPercent")&&(t.maxPercent=e.maxPercent)),t}}cM.StretchType={NONE:"NONE",GAUSSIAN:"GAUSSIAN",PERCENTCLIP:"PERCENTCLIP",MINIMUMMAXIMUM:"MINIMUMMAXIMUM",STANDARDDEVIATION:"STANDARDDEVIATION"};class h3{constructor(e){this.displayMode=void 0,this.displayBands=void 0,this.stretchOption=void 0,this.interpolationMode=void 0,this.colorScheme=void 0,this.colorTable=void 0,this.brightness=void 0,this.contrast=void 0,this.noData=void 0,this.noDataColor=void 0,this.noDataTransparent=void 0,this.backgroundValue=void 0,this.backgroundColor=void 0,this.backgroundTransparent=void 0,this.gridFunctions=void 0,this.CLASS_NAME="SuperMap.ImageRenderingRule",H.extend(this,e)}destroy(){var e=this;e.displayMode=void 0,e.displayBands=void 0,e.stretchOption=void 0,e.interpolationMode=void 0,e.colorScheme=void 0,e.colorTable=void 0,e.brightness=void 0,e.contrast=void 0,e.noData=void 0,e.noDataColor=void 0,e.noDataTransparent=void 0,e.backgroundValue=void 0,e.backgroundColor=void 0,e.backgroundTransparent=void 0,e.gridFuncOptions=void 0}static constructFromObject(e,t){return e&&(t=t||new h3,e.hasOwnProperty("displayMode")&&(t.displayMode=e.displayMode),e.hasOwnProperty("displayBands")&&(t.displayBands=e.displayBands),e.hasOwnProperty("stretchOption")&&(t.stretchOption=cM.constructFromObject&&cM.constructFromObject(e.stretchOption,{})||e.stretchOption),e.hasOwnProperty("interpolationMode")&&(t.interpolationMode=e.interpolationMode),e.hasOwnProperty("colorScheme")&&(t.colorScheme=e.colorScheme),e.hasOwnProperty("colorTable")&&(t.colorTable=e.colorTable),e.hasOwnProperty("brightness")&&(t.brightness=e.brightness),e.hasOwnProperty("contrast")&&(t.contrast=e.contrast),e.hasOwnProperty("noData")&&(t.noData=e.noData),e.hasOwnProperty("noDataColor")&&(t.noDataColor=e.noDataColor),e.hasOwnProperty("backgroundValue")&&(t.backgroundValue=e.backgroundValue),e.hasOwnProperty("noDataTransparent")&&(t.noDataTransparent=e.noDataTransparent),e.hasOwnProperty("backgroundColor")&&(t.backgroundColor=e.backgroundColor),e.hasOwnProperty("backgroundTransparent")&&(t.backgroundTransparent=e.backgroundTransparent),e.hasOwnProperty("gridFunctions")&&(t.gridFunctions=e.gridFunctions)),t}}h3.DisplayMode={COMPOSITE:"COMPOSITE",STRETCHED:"Stretched"};h3.InterpolationMode={NEARESTNEIGHBOR:"NEARESTNEIGHBOR",HIGHQUALITYBILINEAR:"HIGHQUALITYBILINEAR",DEFAULT:"DEFAULT"};class Hne{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFHillShade",e.Azimuth=315,e.Altitude=45,e.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new Hne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class jne{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFAspect",e.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new jne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class Xne{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new Xne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class Yne{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",H.extend(this,e)}destroy(){var e=this;e.girdFuncName="GFSlope",e.Altitude=45,e.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new Yne,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class Eot extends ra{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.KnowledgeGraphService"}destroy(){super.destroy()}query(e,t){const r="cypherQuery",i=H.urlAppend(this.url+"/query.json",`${r}=${encodeURI(e)}`);this.processAsync({url:i,method:"GET",callback:t})}getGraphMaps(e){const t=this.url+"/graphmaps.json";this.processAsync({url:t,method:"GET",callback:e})}getGraphMap(e,t){const r=this.url+`/graphmaps/${e}.json`;this.processAsync({url:r,method:"GET",callback:t})}async getGraphMapData(e){let t=[];const r=await this._getGraphMapData(e);if(!r)return;const i=r.dataContent.queries&&r.dataContent.queries.query||[];let a=[];typeof i=="string"?a=[i]:a=i;const o=this._getGraphMapExpandQuery(r);o.length&&a.push(...o);for(let s=0;s<a.length;s++){const l=a[s],u=await this._queryDataBySql(l);t=t.concat([],u)}return{data:t,graphMap:r}}_getGraphMapExpandQuery(e){const t=[];return(e.dataContent.expand&&JSON.parse(e.dataContent.expand)||[]).forEach(i=>{t.push(`match p=(n)-[]-(m) where id(n)=${i} return p;`)}),t}processAsync({url:e,params:t,method:r,callback:i}){const a={method:r,url:e,scope:this,success:i,failure:i};return t&&(a.params=t),this.request(a)}_getGraphMapData(e){return new Promise((t,r)=>{this.getGraphMap(e,i=>{i.type==="processFailed"?r(i.error):i.result.data===""?r("\u65E0\u6570\u636E"):t(i.result.graphMap)})})}_queryDataBySql(e){return new Promise((t,r)=>{this.query(e,i=>{i.type==="processFailed"?r(i.error):t(i.result)})})}}var Tot={DOES_NOT_INVOLVE:"DOES_NOT_INVOLVE",PUBLISH_FAILED:"PUBLISH_FAILED",PUBLISHED:"PUBLISHED",PUBLISHING:"PUBLISHING",UNPUBLISHED:"UNPUBLISHED",UNPUBLISHED_FAILED:"UNPUBLISHED_FAILED"},Cot={FILENAME:"FILENAME",ID:"ID",LASTMODIFIEDTIME:"LASTMODIFIEDTIME",NICKNAME:"NICKNAME",SERVICESTATUS:"SERVICESTATUS",SIZE:"SIZE",STATUS:"STATUS",TYPE:"TYPE",UPDATETIME:"UPDATETIME",USERNAME:"USERNAME"},Aot={LINKPAGE:"LINKPAGE",MAPTITLE:"MAPTITLE",NICKNAME:"NICKNAME",RESTITLE:"RESTITLE",USERNAME:"USERNAME"};class INe{constructor(e){e=e||{},H.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,r,i={}){return t=xs.appendCredential(t),i.crossOrigin=this.options.crossOrigin,i.headers=this.options.headers,li.commit(e,t,r,i).then(function(a){return a.json()})}}class LNe extends INe{constructor(e,t){super(e),t=t||{},this.MD5=null,this.type=null,this.userName=null,this.fileName=null,this.size=null,this.serviceStatus=null,this.serviceId=null,this.id=null,this.lastModfiedTime=null,this.status=null,this.storageId=null,this.publishInfo=null,this.authorizeSetting=null,this.nickname=null,this.tags=[],this.description=null,this.dataItemServices=null,this.coordType=null,this.dataCheckResult=null,this.dataMetaInfo=null,this.thumbnail=null,H.extend(this,t),this.id&&(this.serviceUrl=e+"/"+this.id),this.CLASS_NAME="SuperMap.OnlineData"}load(){if(!!this.serviceUrl){var e=this;return e.request("GET",this.serviceUrl).then(function(t){H.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}class Mot{constructor(){this.rootUrl="https://www.supermapol.com",this.webUrl=this.rootUrl+"/web";var e=this.webUrl+"/mycontent";this.mDatasUrl=e+"/datas",this.CLASS_NAME="SuperMap.Online"}load(){return li.get(this.rootUrl).then(function(e){return e})}login(){xs.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,r=t.mDatasUrl;return e&&(e=e.toJSON()),li.get(r,e).then(function(i){if(!(!i||!i.content||i.content.length<1)){for(var a=[],o=i.content,s=o.length,l=0;l<s;l++){var u=o[l],h=new LNe(t.mDatasUrl,u);a.push(h)}return a}})}}class Iot{constructor(e){e=e||{},this.userNames=null,this.types=null,this.fileName=null,this.serviceStatuses=null,this.serviceId=null,this.ids=null,this.keywords=null,this.orderBy=null,this.tags=null,this.filterFields=null,H.extend(this,e),this.CLASS_NAME="SuperMap.OnlineQueryDatasParameter"}toJSON(){var e=this,t={types:e.types,fileName:e.fileName,serviceStatuses:e.serviceStatuses,serviceId:e.serviceId,ids:e.ids,keywords:e.keywords,orderBy:e.orderBy,tags:e.tags,filterFields:e.filterFields};for(var r in t)t[r]==null&&delete t[r];return t}}class Lot{constructor(e){this.name=null,this.serviceIds=null,this.clientType=bne.SERVER,this.limitation=null,H.extend(this,e),this.CLASS_NAME="SuperMap.KeyServiceParameter"}toJSON(){return{name:this.name,serviceIds:this.serviceIds,clientType:this.clientType,limitation:this.limitation}}}class Pot{constructor(e,t){this.type=e,this.server=null,this.tokenServiceUrl=null,this.keyServiceUrl=null,H.extend(this,t),this.CLASS_NAME="SuperMap.ServerInfo",this.type=this.type||KP.ISERVER,this.server||console.error("server url require is not undefined");var r="/services/security/tokens";this.type===KP.ISERVER&&this.server.indexOf("iserver")<0&&(r="/iserver"+r),this.tokenServiceUrl||(this.tokenServiceUrl=H.urlPathAppend(this.server,r)),this.keyServiceUrl||(this.type===KP.IPORTAL?this.keyServiceUrl=H.urlPathAppend(this.server,"/web/mycontent/keys/register"):this.type===KP.ONLINE&&(this.keyServiceUrl=H.urlPathAppend(this.server,"/web/mycontent/keys")))}}class Oot{constructor(e){this.userName=null,this.password=null,this.clientType=bne.NONE,this.ip=null,this.referer=null,this.expiration=60,H.extend(this,e),this.CLASS_NAME="SuperMap.TokenServiceParameter"}toJSON(){return{userName:this.userName,password:this.password,clientType:this.clientType,ip:this.ip,referer:this.referer,expiration:this.expiration}}}class Rot{constructor(e,t,r){if(!t||typeof t!="function"&&typeof t!="object"||typeof t.Client!="function")throw Error("Please enter the global variable of @elastic/elasticsearch@5.6.22 or elasticsearch@16.7.3 for the second parameter!");r=r||{},this.url=e;try{this.client=new t.Client({host:this.url})}catch{this.client=new t.Client({node:{url:new URL(this.url)}})}this.change=null,this.openGeoFence=!1,this.outOfGeoFence=null,this.geoFence=null,this.EVENT_TYPES=["change","error","outOfGeoFence"],this.events=new y0(this,null,this.EVENT_TYPES),this.eventListeners=null,H.extend(this,r),this.eventListeners instanceof Object&&this.events.on(this.eventListeners)}setGeoFence(e){this.geoFence=e}bulk(e,t){return this.client.bulk(e,this._handleCallback(t))}clearScroll(e,t){return this.client.clearScroll(e,this._handleCallback(t))}count(e,t){return this.client.count(e,this._handleCallback(t))}create(e,t){return this.client.create(e,this._handleCallback(t))}delete(e,t){return this.client.delete(e,this._handleCallback(t))}deleteByQuery(e,t){return this.client.deleteByQuery(e,this._handleCallback(t))}deleteScript(e,t){return this.client.deleteScript(e,this._handleCallback(t))}deleteTemplate(e,t){return this.client.deleteTemplate(e,this._handleCallback(t))}exists(e,t){return this.client.exists(e,this._handleCallback(t))}existsSource(e,t){return this.client.existsSource(e,this._handleCallback(t))}explain(e,t){return this.client.explain(e,this._handleCallback(t))}fieldCaps(e,t){return this.client.fieldCaps(e,this._handleCallback(t))}get(e,t){return this.client.get(e,this._handleCallback(t))}getScript(e,t){return this.client.getScript(e,this._handleCallback(t))}getSource(e,t){return this.client.getSource(e,this._handleCallback(t))}getTemplate(e,t){return this.client.getTemplate(e,this._handleCallback(t))}index(e,t){return this.client.index(e,this._handleCallback(t))}info(e,t){return this.client.info(e,this._handleCallback(t))}mget(e,t){return this.client.mget(e,this._handleCallback(t))}msearch(e,t){let r=this;return r.client.msearch(e).then(function(i){return i=i.body||i,r._update(i.responses,t),i},function(i){return t(i),r.events.triggerEvent("error",{error:i}),i})}msearchTemplate(e,t){return this.client.msearchTemplate(e,this._handleCallback(t))}mtermvectors(e,t){return this.client.mtermvectors(e,this._handleCallback(t))}ping(e,t){return this.client.ping(e,this._handleCallback(t))}putScript(e,t){return this.client.putScript(e,this._handleCallback(t))}putTemplate(e,t){return this.client.putTemplate(e,this._handleCallback(t))}reindex(e,t){return this.client.reindex(e,this._handleCallback(t))}reindexRessrottle(e,t){return this.client.reindexRessrottle(e,this._handleCallback(t))}renderSearchTemplate(e,t){return this.client.renderSearchTemplate(e,this._handleCallback(t))}scroll(e,t){return this.client.scroll(e,this._handleCallback(t))}search(e,t){let r=this;return r.client.search(e).then(function(i){return i=i.body||i,r._update(i,t),i},function(i){return t&&t(i),r.events.triggerEvent("error",{error:i}),i})}searchShards(e,t){return this.client.searchShards(e,this._handleCallback(t))}searchTemplate(e,t){return this.client.searchTemplate(e,this._handleCallback(t))}suggest(e,t){return this.client.suggest(e,this._handleCallback(t))}termvectors(e,t){return this.client.termvectors(e,this._handleCallback(t))}update(e,t){return this.client.update(e,this._handleCallback(t))}updateByQuery(e,t){return this.client.updateByQuery(e,this._handleCallback(t))}_handleCallback(e){return function(){let t=Array.from(arguments);const r=t.shift();let i=t.shift();const a=i&&i.body;if(a){const{statusCode:o,headers:s}=i;t=[o,s],i=a}e.call(this,r,i,...t)}}_update(e,t){let r=this;!e||(r.data=e,r.openGeoFence&&r.geoFence&&r._validateDatas(e),r.events.triggerEvent("change",{data:r.data}),r.change?r.change&&r.change(e):t&&t(void 0,{responses:e}))}_validateDatas(e){if(!!e){e instanceof Array||(e=[e]);var t,r=e.length;for(t=0;t<r;t++)this._validateData(e[t])}}_validateData(e){let t=this;e.hits.hits.map(function(r){let i=r._source,a=t._getMeterPerMapUnit(t.geoFence.unit),o=t.geoFence.center[0]*a,s=t.geoFence.center[1]*a,l=i.x*a,u=i.y*a,h=t._distance(l,u,o,s),c=t.geoFence.radius;return h>c&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),r})}_distance(e,t,r,i){return Math.sqrt((e-r)*(e-r)+(t-i)*(t-i))}_getMeterPerMapUnit(e){let t=6378137,r;return e==="meter"?r=1:e==="degree"&&(r=Math.PI*2*t/360),r}}class Pp{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Util"}clone(e){var t=this.BUILTIN_OBJECT;if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,a=e.length;i<a;i++)r[i]=this.clone(e[i])}else if(!t[Object.prototype.toString.call(e)]){r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]=this.clone(e[o]))}return r}return e}mergeItem(e,t,r,i){var a=this.BUILTIN_OBJECT;t.hasOwnProperty(r)&&(typeof e[r]=="object"&&!a[Object.prototype.toString.call(e[r])]?this.merge(e[r],t[r],i):(i||!(r in e))&&(e[r]=t[r]))}merge(e,t,r){for(var i in t)this.mergeItem(e,t,i,r);return e}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(e,t){var r=this._canvas,i=this._pixelCtx,a=this._width,o=this._height,s=this._offsetX,l=this._offsetY,u=100,h;e+s>a&&(a=e+s+u,r.width=a,h=!0),t+l>o&&(o=t+l+u,r.height=o,h=!0),e<-s&&(s=Math.ceil(-e/u)*u,a+=s,r.width=a,h=!0),t<-l&&(l=Math.ceil(-t/u)*u,o+=l,r.height=o,h=!0),h&&i.translate(s,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}inherits(e,t){var r=e.prototype;function i(){}i.prototype=t.prototype,e.prototype=new i;for(var a in r)e.prototype[a]=r[a];e.constructor=e}}class SE{constructor(){this.util=new Pp,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Color"}customPalette(e){this.palette=e}resetPalette(){this.palette=this._palette}getColor(e,t){return e=e|0,t=t||this.palette,t[e%t.length]}customHighlight(e){this.highlightColor=e}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(e,t,r,i,a,o,s){var l=this.util;this._ctx||(this._ctx=l.getContext());for(var u=this._ctx.createRadialGradient(e,t,r,i,a,o),h=0,c=s.length;h<c;h++)u.addColorStop(s[h][0],s[h][1]);return u.__nonRecursion=!0,u}getLinearGradient(e,t,r,i,a){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var s=this._ctx.createLinearGradient(e,t,r,i),l=0,u=a.length;l<u;l++)s.addColorStop(a[l][0],a[l][1]);return s.__nonRecursion=!0,s}getStepColors(e,t,r){e=this.toRGBA(e),t=this.toRGBA(t),e=this.getData(e),t=this.getData(t);for(var i=[],a=(t[0]-e[0])/r,o=(t[1]-e[1])/r,s=(t[2]-e[2])/r,l=(t[3]-e[3])/r,u=0,h=e[0],c=e[1],f=e[2],d=e[3];u<r;u++)i[u]=this.toColor([this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(c),[0,255]),this.adjust(Math.floor(f),[0,255]),d.toFixed(4)-0],"rgba"),h+=a,c+=o,f+=s,d+=l;return h=t[0],c=t[1],f=t[2],d=t[3],i[u]=this.toColor([h,c,f,d],"rgba"),i}getGradientColors(e,t){var r=[],i=e.length;if(t===void 0&&(t=20),i===1)r=this.getStepColors(e[0],e[0],t);else if(i>1)for(var a=0,o=i-1;a<o;a++){var s=this.getStepColors(e[a],e[a+1],t);a<o-1&&s.pop(),r=r.concat(s)}return r}toColor(e,t){if(t=t||"rgb",e&&(e.length===3||e.length===4)){if(e=this.map(e,function(i){return i>1?Math.ceil(i):i}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),function(i){return i+"%"});e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}toArray(e){e=this.trim(e),e.indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,function(i){r<3?i=i|0:i=+i,t[r++]=i}),t}convert(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),i=r[3];return typeof i>"u"&&(i=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=i,this.toColor(r,t)}toRGBA(e){return this.convert(e,"rgba")}toRGB(e){return this.convert(e,"rgb")}toHex(e){return this.convert(e,"hex")}toHSVA(e){return this.convert(e,"hsva")}toHSV(e){return this.convert(e,"hsv")}toHSBA(e){return this.convert(e,"hsba")}toHSB(e){return this.convert(e,"hsb")}toHSLA(e){return this.convert(e,"hsla")}toHSL(e){return this.convert(e,"hsl")}toName(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}trim(e){return String(e).replace(/\s+/g,"")}normalize(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=this.trim(e),e=e.replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,r=(e&240)<<4,i=e&15;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(i<<4)+i).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;typeof t>"u"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var i=this.getData(e),a=0;a<3;a++)r===1?i[a]=i[a]*(1-t)|0:i[a]=(255-i[a])*t+i[a]|0;return"rgb("+i.join(",")+")"}reverse(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,function(r){return 255-r}),this.toColor(t,"rgb")}mix(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;typeof r>"u"&&(r=.5),r=1-this.adjust(r,[0,1]);for(var i=r*2-1,a=this.getData(this.toRGBA(e)),o=this.getData(this.toRGBA(t)),s=a[3]-o[3],l=((i*s===-1?i:(i+s)/(1+i*s))+1)/2,u=1-l,h=[],c=0;c<3;c++)h[c]=a[c]*l+o[c]*u;var f=a[3]*r+o[3]*(1-r);return f=Math.max(0,Math.min(1,f)),a[3]===1&&o[3]===1?this.toColor(h,"rgb"):(h[3]=f,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(e){e=this.normalize(e);var t=e.match(this.colorRegExp);if(t===null)throw new Error("The color format error");var r,i,a=[],o;if(t[2])r=t[2].replace("#","").split(""),o=[r[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(o,function(f){return SE.prototype.adjust.call(this,parseInt(f,16),[0,255])});else if(t[4]){var s=t[4].split(",");i=s[3],o=s.slice(0,3),a=this.map(o,function(f){return f=Math.floor(f.indexOf("%")>0?parseInt(f,0)*2.55:f),SE.prototype.adjust.call(this,f,[0,255])}),typeof i<"u"&&a.push(this.adjust(parseFloat(i),[0,1]))}else if(t[5]||t[6]){var l=(t[5]||t[6]).split(","),u=parseInt(l[0],0)/360,h=l[1],c=l[2];i=l[3],a=this.map([h,c],function(f){return SE.prototype.adjust.call(this,parseFloat(f)/100,[0,1])}),a.unshift(u),typeof i<"u"&&a.push(this.adjust(parseFloat(i),[0,1]))}return a}alpha(e,t){if(!this.isCalculableColor(e))return e;t===null&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}map(e,t){if(typeof t!="function")throw new TypeError;for(var r=e?e.length:0,i=0;i<r;i++)e[i]=t(e[i]);return e}adjust(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||typeof e=="string"}_HSV_2_RGB(e){var t=e[0],r=e[1],i=e[2],a,o,s;if(r===0)a=i*255,o=i*255,s=i*255;else{var l=t*6;l===6&&(l=0);var u=l|0,h=i*(1-r),c=i*(1-r*(l-u)),f=i*(1-r*(1-(l-u))),d=0,v=0,p=0;u===0?(d=i,v=f,p=h):u===1?(d=c,v=i,p=h):u===2?(d=h,v=i,p=f):u===3?(d=h,v=c,p=i):u===4?(d=f,v=h,p=i):(d=i,v=h,p=c),a=d*255,o=v*255,s=p*255}return[a,o,s]}_HSL_2_RGB(e){var t=e[0],r=e[1],i=e[2],a,o,s;if(r===0)a=i*255,o=i*255,s=i*255;else{var l;i<.5?l=i*(1+r):l=i+r-r*i;var u=2*i-l;a=255*this._HUE_2_RGB(u,l,t+1/3),o=255*this._HUE_2_RGB(u,l,t),s=255*this._HUE_2_RGB(u,l,t-1/3)}return[a,o,s]}_HUE_2_RGB(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+(t-e)*6*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}_RGB_2_HSB(e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.min(t,r,i),o=Math.max(t,r,i),s=o-a,l=o,u,h;if(s===0)u=0,h=0;else{h=s/o;var c=((o-t)/6+s/2)/s,f=((o-r)/6+s/2)/s,d=((o-i)/6+s/2)/s;t===o?u=d-f:r===o?u=1/3+c-d:i===o&&(u=2/3+f-c),u<0&&(u+=1),u>1&&(u-=1)}return u=u*360,h=h*100,l=l*100,[u,h,l]}_RGB_2_HSL(e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.min(t,r,i),o=Math.max(t,r,i),s=o-a,l=(o+a)/2,u,h;if(s===0)u=0,h=0;else{l<.5?h=s/(o+a):h=s/(2-o-a);var c=((o-t)/6+s/2)/s,f=((o-r)/6+s/2)/s,d=((o-i)/6+s/2)/s;t===o?u=d-f:r===o?u=1/3+c-d:i===o&&(u=2/3+f-c),u<0&&(u+=1),u>1&&(u-=1)}return u=u*360,h=h*100,l=l*100,[u,h,l]}}var Ym=new SE;class vB{static createCanvas(e,t){var r=document.createElement("canvas");return r.height=e,r.width=t,r.getContext("2d")}static getLinearGradient(e,t,r,i,a){this._ctx||(this._ctx=this.getContext());for(var o=this._ctx.createLinearGradient(e,t,r,i),s=a.length,l=1/(s-1),u=0,h=0;h<s;h++)o.addColorStop(u,a[h]),u+=l;return o.__nonRecursion=!0,o}static getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}static getStepColors(e,t,r){e=Ym.toRGBA(e),t=Ym.toRGBA(t),e=Ym.getData(e),t=Ym.getData(t);for(var i=[],a=(t[0]-e[0])/r,o=(t[1]-e[1])/r,s=(t[2]-e[2])/r,l=(t[3]-e[3])/r,u=0,h=e[0],c=e[1],f=e[2],d=e[3];u<r;u++)i[u]=Ym.toColor([Ym.adjust(Math.floor(h),[0,255]),Ym.adjust(Math.floor(c),[0,255]),Ym.adjust(Math.floor(f),[0,255]),d.toFixed(4)-0],"hex"),h+=a,c+=o,f+=s,d+=l;return h=t[0],c=t[1],f=t[2],d=t[3],i[u]=Ym.toColor([h,c,f,d],"hex"),i}static getGradientColors(e,t,r){var i=[],a,o,s,l=e.length;if(t!==void 0){if(l>=t)if(r==="RANGE")for(o=0;o<t;o++)i.push(e[o]);else for(o=0;o<t;o++){let d=Math.floor(o/2);if(o%2===0)i.push(e[d]);else{let v=e.length-1-d;i.push(e[v])}}else{for(a=Math.ceil(t/(l-1)),o=0,s=l-1;o<s;o++){var u=this.getStepColors(e[o],e[o+1],a);o<s-1&&u.pop(),i=i.concat(u)}for(var h=i.length-t,c=0,f=0;c<h;c++)i.splice(f+2,1)}return i}}}class pB{static newInstance(){return this.geostatsInstance||(this.geostatsInstance=new window.geostats),this.geostatsInstance}static getInstance(e){let t=this.newInstance();return t.setSerie(e),t}static getArrayStatistic(e,t){if(!e.length)return 0;if(t==="Sum"||t==="\u6C42\u548C")return this.getSum(e);if(t==="Maximum"||t==="\u6700\u5927\u503C")return this.getMax(e);if(t==="Minimum"||t==="\u6700\u5C0F\u503C")return this.getMin(e);if(t==="Average"||t==="\u5E73\u5747\u503C")return this.getMean(e);if(t==="Median"||t==="\u4E2D\u4F4D\u6570")return this.getMedian(e);if(t==="times"||t==="\u8BA1\u6570")return this.getTimes(e)}static getArraySegments(e,t,r){if(t==="offset")return this.getEqInterval(e,r);if(t==="jenks")return this.getJenks(e,r);if(t==="square")return this.getMin(e)>=0?this.getSqrtInterval(e,r):!1;if(t==="logarithm")return this.getMin(e)>0?this.getGeometricProgression(e,r):!1}static getSum(e){return this.getInstance(e).sum()}static getMax(e){return this.getInstance(e).max()}static getMin(e){return this.getInstance(e).min()}static getMean(e){return this.getInstance(e).mean()}static getMedian(e){return this.getInstance(e).median()}static getTimes(e){return e.length}static getEqInterval(e,t){return this.getInstance(e).getClassEqInterval(t)}static getJenks(e,t){return this.getInstance(e).getClassJenks(t)}static getSqrtInterval(e,t){return e=e.map(function(i){return Math.sqrt(i)}),this.getInstance(e).getClassEqInterval(t).map(function(i){return i*i})}static getGeometricProgression(e,t){return this.getInstance(e).getClassGeometricProgression(t)}}var gB=function(n){var e=6378137,t;if(n===Wl.METER)t=1;else if(n===Wl.DEGREE)t=Math.PI*2*e/360;else if(n===Wl.KILOMETER)t=.001;else if(n===Wl.INCH)t=1/.025399999918;else if(n===Wl.FOOT)t=.3048;else return t;return t};function Dot(n,e,t,r,i=22){var a=[];if(n&&n.length>0)for(let o=0;o<n.length;o++)a.push(kot(n[o],t,r));else{const o=Math.abs(e.left-e.right)/256;for(let s=0;s<i;s++)a.push(o/Math.pow(2,s))}return a.sort(function(o,s){return s-o})}function Not(n,e){let t=0,r;for(let i=0;i<e.length;i++)i===0&&(r=Math.abs(n-e[i])),r>Math.abs(n-e[i])&&(r=Math.abs(n-e[i]),t=i);return t}function kot(n,e,t){const r=39.37007874015748,i=gB(t);return 1/(n*e*r*i)}function Fot(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Bot(n,e){const t=[];return Fot(n,e)&&(n[0]>e[0]?t[0]=n[0]:t[0]=e[0],n[1]>e[1]?t[1]=n[1]:t[1]=e[1],n[2]<e[2]?t[2]=n[2]:t[2]=e[2],n[3]<e[3]?t[3]=n[3]:t[3]=e[3]),t}var PNe=9007199254740991,Got="[object Arguments]",zot="[object Function]",Uot="[object GeneratorFunction]",wK="[object Map]",Vot="[object Object]",Xde="[object Promise]",bK="[object Set]",Yde="[object WeakMap]",qde="[object DataView]",$ot=/[\\^$.*+?()[\]{}|]/g,Wot=/^\[object .+?Constructor\]$/,Hot=/^(?:0|[1-9]\d*)$/,jot=typeof at=="object"&&at&&at.Object===Object&&at,Xot=typeof self=="object"&&self&&self.Object===Object&&self,AI=jot||Xot||Function("return this")();function Yot(n,e){for(var t=-1,r=n?n.length:0,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}function qot(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}function Zot(n,e){return Yot(e,function(t){return[t,n[t]]})}function Kot(n,e){return n==null?void 0:n[e]}function Jot(n){var e=!1;if(n!=null&&typeof n.toString!="function")try{e=!!(n+"")}catch{}return e}function Qot(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function est(n,e){return function(t){return n(e(t))}}function tst(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=[r,r]}),t}var rst=Function.prototype,Dz=Object.prototype,WW=AI["__core-js_shared__"],Zde=function(){var n=/[^.]+$/.exec(WW&&WW.keys&&WW.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ONe=rst.toString,Nz=Dz.hasOwnProperty,kz=Dz.toString,nst=RegExp("^"+ONe.call(Nz).replace($ot,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ist=Dz.propertyIsEnumerable,ast=est(Object.keys,Object),EK=c3(AI,"DataView"),TK=c3(AI,"Map"),CK=c3(AI,"Promise"),AK=c3(AI,"Set"),MK=c3(AI,"WeakMap"),ost=W2(EK),sst=W2(TK),lst=W2(CK),ust=W2(AK),hst=W2(MK);function cst(n,e){var t=xst(n)||_st(n)?qot(n.length,String):[],r=t.length,i=!!r;for(var a in n)(e||Nz.call(n,a))&&!(i&&(a=="length"||gst(a,r)))&&t.push(a);return t}function fst(n){return kz.call(n)}function dst(n){if(!NNe(n)||yst(n))return!1;var e=DNe(n)||Jot(n)?nst:Wot;return e.test(W2(n))}function vst(n){if(!mst(n))return ast(n);var e=[];for(var t in Object(n))Nz.call(n,t)&&t!="constructor"&&e.push(t);return e}function pst(n){return function(e){var t=Mb(e);return t==wK?Qot(e):t==bK?tst(e):Zot(e,n(e))}}function c3(n,e){var t=Kot(n,e);return dst(t)?t:void 0}var Mb=fst;(EK&&Mb(new EK(new ArrayBuffer(1)))!=qde||TK&&Mb(new TK)!=wK||CK&&Mb(CK.resolve())!=Xde||AK&&Mb(new AK)!=bK||MK&&Mb(new MK)!=Yde)&&(Mb=function(n){var e=kz.call(n),t=e==Vot?n.constructor:void 0,r=t?W2(t):void 0;if(r)switch(r){case ost:return qde;case sst:return wK;case lst:return Xde;case ust:return bK;case hst:return Yde}return e});function gst(n,e){return e=e==null?PNe:e,!!e&&(typeof n=="number"||Hot.test(n))&&n>-1&&n%1==0&&n<e}function yst(n){return!!Zde&&Zde in n}function mst(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Dz;return n===t}function W2(n){if(n!=null){try{return ONe.call(n)}catch{}try{return n+""}catch{}}return""}function _st(n){return Sst(n)&&Nz.call(n,"callee")&&(!ist.call(n,"callee")||kz.call(n)==Got)}var xst=Array.isArray;function RNe(n){return n!=null&&wst(n.length)&&!DNe(n)}function Sst(n){return bst(n)&&RNe(n)}function DNe(n){var e=NNe(n)?kz.call(n):"";return e==zot||e==Uot}function wst(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=PNe}function NNe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function bst(n){return!!n&&typeof n=="object"}function Est(n){return RNe(n)?cst(n):vst(n)}var Tst=pst(Est),Cst=Tst;class Pt{constructor(e){this.env=null,this.parser=null,this.ruleSet=null,this.cartoStr="",this.shaders=null,typeof e=="string"&&(this.cartoStr=e,this.env={frames:[],errors:[],error:function(t){this.errors.push(t)}},this.parser=this.getParser(this.env),this.parse(e),this.shaders=this.toShaders())}getParser(e){var t,r,i,a,o,s,l,u,h,c=this;function f(){a=l[i],o=r,u=r}function d(){l[i]=a,r=o,u=r}function v(){r>u&&(l[i]=l[i].slice(r-u),u=r)}function p(y){var _,x,S,w;if(y instanceof Function)return y.call(h.parsers);if(typeof y=="string")_=t.charAt(r)===y?y:null,x=1,v();else if(v(),_=y.exec(l[i]),_)x=_[0].length;else return null;if(_){var b=r+=x;for(w=r+l[i].length-x;r<w&&(S=t.charCodeAt(r),S===32||S===10||S===9);)r++;return l[i]=l[i].slice(x+(r-b)),u=r,l[i].length===0&&i<l.length-1&&i++,typeof _=="string"?_:_.length===1?_[0]:_}}function g(y){return typeof y=="string"?t.charAt(r)===y:!!y.test(l[i])}function m(y){var _,x={index:s,filename:e.filename,message:"Parse error.",line:0,column:-1};for(var S in x)y[S]===0&&(y[S]=x[S]);y.filename&&c.env.inputs&&c.env.inputs[y.filename]?_=c.env.inputs[y.filename]:_=t,y.line=(_.slice(0,y.index).match(/\n/g)||"").length+1;for(var w=y.index;w>=0&&_.charAt(w)!==`
`;w--)y.column++;return new Error([y.filename,y.line,y.column,y.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},h={parse:function(y){var _,x=null;if(r=i=u=s=0,l=[],t=y.replace(/\r\n/g,`
`),e.filename&&(c.env.inputs[e.filename]=t),l=function(w){for(var b=0,E=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,T=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,C=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,A=0,M,I=w[0],R,k=0,D,G;k<t.length;){if(E.lastIndex=k,(M=E.exec(t))&&M.index===k&&(k+=M[0].length,I.push(M[0])),D=t.charAt(k),T.lastIndex=C.lastIndex=k,(M=C.exec(t))&&M.index===k){k+=M[0].length,I.push(M[0]);continue}if(!R&&D==="/"&&(G=t.charAt(k+1),(G==="/"||G==="*")&&(M=T.exec(t))&&M.index===k)){k+=M[0].length,I.push(M[0]);continue}switch(D){case"{":if(!R){A++,I.push(D);break}case"}":if(!R){A--,I.push(D),w[++b]=I=[];break}case"(":if(!R){R=!0,I.push(D);break}case")":if(R){R=!1,I.push(D);break}default:I.push(D);break}k++}return A!==0&&(x={index:k-1,type:"Parse",message:A>0?"missing closing `}`":"missing opening `{`"}),w.map(function(W){return W.join("")})}([[]]),x)throw m(x);var S=function(w,b){var E=w.specificity,T=b.specificity;return E[0]!=T[0]?T[0]-E[0]:E[1]!=T[1]?T[1]-E[1]:E[2]!=T[2]?T[2]-E[2]:T[3]-E[3]};return _=new Pt.Tree.Ruleset([],p(this.parsers.primary)),_.root=!0,_.toList=function(){return function(w){w.error=function(E){w.errors||(w.errors=new Error("")),w.errors.message?w.errors.message+=`
`+m(E).message:w.errors.message=m(E).message},w.frames=w.frames||[];var b=this.flatten([],[],w);return b.sort(S),b}}(),_},parsers:{primary:function(){for(var y,_=[];(y=p(this.rule)||p(this.ruleset)||p(this.comment))||p(/^[\s\n]+/)||(y=p(this.invalid));)y&&_.push(y);return _},invalid:function(){var y=p(/^[^;\n]*[;\n]/);if(y)return new Pt.Tree.Invalid(y,o)},comment:function(){var y;if(t.charAt(r)==="/"){if(t.charAt(r+1)==="/")return new Pt.Tree.Comment(p(/^\/\/.*/),!0);if(y=p(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new Pt.Tree.Comment(y)}},entities:{quoted:function(){if(!(t.charAt(r)!=='"'&&t.charAt(r)!=="'")){var y=p(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);if(y)return new Pt.Tree.Quoted(y[1]||y[2])}},field:function(){var y="[",_="]";if(!!p(y)){var x=p(/(^[^\]]+)/);if(!!p(_)&&x)return new Pt.Tree.Field(x[1])}},comparison:function(){var y=p(/^=~|=|!=|<=|>=|<|>/);if(y)return y},keyword:function(){var y=p(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(y)return new Pt.Tree.Keyword(y)},call:function(){var y,_;if(!!(y=/^([\w\-]+|%)\(/.exec(l[i]))){if(y=y[1],y==="url")return null;r+=y.length;var x="(",S=")";if(p(x),_=p(this.entities.arguments),!!p(S)&&y)return new Pt.Tree.Call(y,_,r)}},arguments:function(){for(var y=[],_;_=p(this.expression);){y.push(_);var x=",";if(!p(x))break}return y},literal:function(){return p(this.entities.dimension)||p(this.entities.keywordcolor)||p(this.entities.hexcolor)||p(this.entities.quoted)},url:function(){var y;if(!(t.charAt(r)!=="u"||!p(/^url\(/))){y=p(this.entities.quoted)||p(this.entities.variable)||p(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";var _=")";return p(_)?new Pt.Tree.URL(typeof y.value<"u"||y instanceof Pt.Tree.Variable?y:new Pt.Tree.Quoted(y)):new Pt.Tree.Invalid(y,o,"Missing closing ) in URL.")}},variable:function(){var y,_=r;if(t.charAt(r)==="@"&&(y=p(/^@[\w-]+/)))return new Pt.Tree.Variable(y,_,e.filename)},hexcolor:function(){var y;if(t.charAt(r)==="#"&&(y=p(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new Pt.Tree.Color(y[1])},keywordcolor:function(){var y=l[i].match(/^[a-z]+/);if(y&&y[0]in Pt.Tree.Reference.data.colors)return new Pt.Tree.Color(Pt.Tree.Reference.data.colors[p(/^[a-z]+/)])},dimension:function(){var y=t.charCodeAt(r);if(!(y>57||y<45||y===47)){var _=p(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);if(_)return new Pt.Tree.Dimension(_[1],_[2],o)}}},variable:function(){var y;if(t.charAt(r)==="@"&&(y=p(/^(@[\w-]+)\s*:/)))return y[1]},entity:function(){var y=p(this.entities.call)||p(this.entities.literal),_=p(this.entities.field)||p(this.entities.variable),x=p(this.entities.url)||p(this.entities.keyword);return y||_||x},end:function(){var y=";";return p(y)||g("}")},element:function(){var y=p(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(y)return new Pt.Tree.Element(y)},attachment:function(){var y=p(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(y)return y[1]},selector:function(){for(var y,_,x,S=[],w,b=new Pt.Tree.Filterset,E,T=[],C=0,A=0;(x=p(this.element))||(E=p(this.zoom))||(w=p(this.filter))||(y=p(this.attachment));){if(C++,x)S.push(x);else if(E)T.push(E),A++;else if(w){var M=b.add(w);if(M)throw m({message:M,index:r-1});A++}else{if(_)throw m({message:"Encountered second attachment name.",index:r-1});_=y}var I=t.charAt(r);if(I==="{"||I==="}"||I===";"||I===",")break}if(C)return new Pt.Tree.Selector(b,T,S,_,A,o)},filter:function(){f();var y,_,x,S="[",w="]";if(!!p(S)&&(y=p(/^[a-zA-Z0-9\-_]+/)||p(this.entities.quoted)||p(this.entities.variable)||p(this.entities.keyword)||p(this.entities.field))&&(y instanceof Pt.Tree.Quoted&&(y=new Pt.Tree.Field(y.toString())),(_=p(this.entities.comparison))&&(x=p(this.entities.quoted)||p(this.entities.variable)||p(this.entities.dimension)||p(this.entities.keyword)||p(this.entities.field)))){if(!p(w))throw m({message:"Missing closing ] of filter.",index:o-1});return y.is||(y=new Pt.Tree.Field(y)),new Pt.Tree.Filter(y,_,x,o,e.filename)}},zoom:function(){f();var y,_,x="]";if(p(/^\[\s*zoom/g)&&(y=p(this.entities.comparison))&&(_=p(this.entities.variable)||p(this.entities.dimension))&&p(x))return new Pt.Tree.Zoom(y,_,o);d()},block:function(){var y,_="{",x="}";if(p(_)&&(y=p(this.primary))&&p(x))return y},ruleset:function(){var y=[],_,x,S=",";for(f();_=p(this.selector);){for(y.push(_);p(this.comment););if(!p(S))break;for(;p(this.comment););}if(_)for(;p(this.comment););if(y.length>0&&(x=p(this.block))){if(y.length===1&&y[0].elements.length&&y[0].elements[0].value==="Map"){var w=new Pt.Tree.Ruleset(y,x);return w.isMap=!0,w}return new Pt.Tree.Ruleset(y,x)}else d()},rule:function(){var y,_,x=t.charAt(r);if(f(),!(x==="."||x==="#")&&(y=p(this.variable)||p(this.property))){if(_=p(this.value),_&&p(this.end))return new Pt.Tree.Rule(y,_,o,e.filename);s=r,d()}},font:function(){for(var y=[],_=[],x,S=",";x=p(this.entity);)_.push(x);if(y.push(new Pt.Tree.Expression(_)),p(S))for(;(x=p(this.expression))&&(y.push(x),!!p(S)););return new Pt.Tree.Value(y)},value:function(){for(var y,_=[],x=",";(y=p(this.expression))&&(_.push(y),!!p(x)););if(_.length>1)return new Pt.Tree.Value(_.map(function(S){return S.value[0]}));if(_.length===1)return new Pt.Tree.Value(_)},sub:function(){var y,_="(",x=")";if(p(_)&&(y=p(this.expression))&&p(x))return y},multiplication:function(){var y,_,x,S,w="/";if(y=p(this.operand)){for(;(x=p(w)||p("*")||p("%"))&&(_=p(this.operand));)S=new Pt.Tree.Operation(x,[S||y,_],o);return S||y}},addition:function(){var y,_,x,S,w="+";if(y=p(this.multiplication)){for(;(x=p(/^[-+]\s+/)||t.charAt(r-1)!=" "&&(p(w)||p("-")))&&(_=p(this.multiplication));)S=new Pt.Tree.Operation(x,[S||y,_],o);return S||y}},operand:function(){return p(this.sub)||p(this.entity)},expression:function(){for(var y,_=[];y=p(this.addition)||p(this.entity);)_.push(y);if(_.length>0)return new Pt.Tree.Expression(_)},property:function(){var y=p(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(y)return y[1]}}},h}parse(e){var t=this.parser,r=this.ruleSet=t.parse(e);return r}toShaders(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var r={},i=[];this._toShaders(r,i,t);for(var a=[],o={},s=0,l=t.length;s<l;++s){var u=t[s],h=u.attachment,c=r[i[s]],f=[];if(!o[h]){var d=0;for(var v in c)if(v!=="zoom"&&v!=="frames"&&v!=="attachment"&&v!="elements")if(v==="layer-index"){var p=function(m,y){var _=null;return c[v].join(`
`),_},g=p();Object.defineProperty(f,"layerIndex",{configurable:!0,enumerable:!1,value:g})}else f[d++]=function(m,y){if(!Array.isArray(m))return m;var _=m.join(`
`),x='attributes["FEATUREID"]&&attributes["FEATUREID"]',S=_.indexOf(x);if(S>=0){if(!y.featureFilter){var w=S+x.length,b=_.indexOf(")",w+1),E="featureId&&(featureId"+_.substring(w,b)+")",T=function(C){return!!E};Object.defineProperty(y,"featureFilter",{configurable:!0,enumerable:!1,value:T})}return{property:v,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+_+";} return _value; ")}}else return{property:v,getValue:Function("attributes","zoom","var _value = null;"+_+"; return _value; ")}}(c[v],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:h}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),a.push(f),o[i[s]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return a}}return null}_toShaders(e,t,r){for(let i=0,a=r.length;i<a;++i){let o=r[i],s=[];for(let d=0,v=o.elements.length;d<v;d++)s.push(o.elements[d]);let l=o.filters.filters,u=[];for(let d in l)u.push(l[d].id);let h=s.join("/")+"::"+o.attachment+"_"+u.join("_");t.push(h);let c=e[h]=e[h]||{};c.zoom=Pt.Tree.Zoom.all;let f=o.toJS(this.env);for(let d in f)(c[d]=c[d]||[]).push(f[d].join(`
`))}}getShaders(){return this.shaders}destroy(){this.cartoStr=null,this.env=null,this.ruleSet=null,this.parser=null,this.shaders=null}}var Kde={version:"2.1.1",style:{"filter-mode":{type:["all","first"],doc:"Control the processing behavior of Rule filters within a Style. If 'all' is used then all Rules are processed sequentially independent of whether any previous filters matched. If 'first' is used then it means processing ends after the first match (a positive filter evaluation) and no further Rules in the Style are processed ('first' is usually the default for CSS implementations on top of Mapnik to simplify translation from CSS to Mapnik XML)","default-value":"all","default-meaning":"All Rules in a Style are processed whether they have filters or not and whether or not the filter conditions evaluate to true."},"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},layer:{name:{"default-value":"",type:"string",required:!0,"default-meaning":"No layer name has been provided",doc:"The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"},srs:{"default-value":"",type:"string","default-meaning":"No srs value is provided and the value will be inherited from the Map's srs",doc:"The spatial reference system definition for the layer, aka the projection. Can either be a proj4 literal string like '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' or, if the proper proj4 epsg/nad/etc identifier files are installed, a string that uses an id like: '+init=epsg:4326'"},status:{"default-value":!0,type:"boolean","default-meaning":"This layer will be marked as active and available for processing",doc:"A property that can be set to false to disable this layer from being processed"},minzoom:{"default-value":"0",type:"float","default-meaning":"The layer will be visible at the minimum possible scale",doc:"The minimum scale denominator that this layer will be visible at. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};Pt.mapnik_reference={version:{latest:Kde,"2.1.1":Kde}};Pt.Tree={};Pt.Tree.operate=function(n,e,t){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"%":return e%t;case"/":return e/t}};Pt.Tree.functions={rgb:function(n,e,t){return this.rgba(n,e,t,1)},rgba:function(n,e,t,r){var i=this,a=[n,e,t].map(function(o){return i.number(o)});return r=i.number(r),a.some(isNaN)||isNaN(r)?null:new Pt.Tree.Color(a,r)},stop:function(n){var e,t;return arguments.length>1&&(e=arguments[1]),arguments.length>2&&(t=arguments[2]),{is:"tag",val:n,color:e,mode:t,toString(r){return`
<stop value="`+n.ev(r)+'"'+(e?' color="'+e.ev(r)+'" ':"")+(t?' mode="'+t.ev(r)+'" ':"")+"/>"}}},hsl:function(n,e,t){return this.hsla(n,e,t,1)},hsla:function(n,e,t,r){if(n=this.number(n)%360/360,e=this.number(e),t=this.number(t),r=this.number(r),[n,e,t,r].some(isNaN))return null;var i=t<=.5?t*(e+1):t+e-t*e,a=t*2-i;return this.rgba(o(n+1/3)*255,o(n)*255,o(n-1/3)*255,r);function o(s){return s=s<0?s+1:s>1?s-1:s,s*6<1?a+(i-a)*s*6:s*2<1?i:s*3<2?a+(i-a)*(2/3-s)*6:a}},hue:function(n){return"toHSL"in n?new Pt.Tree.Dimension(Math.round(n.toHSL().h)):null},saturation:function(n){return"toHSL"in n?new Pt.Tree.Dimension(Math.round(n.toHSL().s*100),"%"):null},lightness:function(n){return"toHSL"in n?new Pt.Tree.Dimension(Math.round(n.toHSL().l*100),"%"):null},alpha:function(n){return"toHSL"in n?new Pt.Tree.Dimension(n.toHSL().a):null},saturate:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.s+=e.value/100,t.s=this.clamp(t.s),this.hsla_simple(t)},desaturate:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.s-=e.value/100,t.s=this.clamp(t.s),this.hsla_simple(t)},lighten:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.l+=e.value/100,t.l=this.clamp(t.l),this.hsla_simple(t)},darken:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.l-=e.value/100,t.l=this.clamp(t.l),this.hsla_simple(t)},fadein:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.a+=e.value/100,t.a=this.clamp(t.a),this.hsla_simple(t)},fadeout:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL();return t.a-=e.value/100,t.a=this.clamp(t.a),this.hsla_simple(t)},spin:function(n,e){if(!("toHSL"in n))return null;var t=n.toHSL(),r=(t.h+e.value)%360;return t.h=r<0?360+r:r,this.hsla_simple(t)},replace:function(n,e,t){return n.is==="field"?n.toString+".replace("+e.toString()+", "+t.toString()+")":n.replace(e,t)},mix:function(n,e,t){var r=t.value/100,i=r*2-1,a=n.toHSL().a-e.toHSL().a,o=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,s=1-o,l=[n.rgb[0]*o+e.rgb[0]*s,n.rgb[1]*o+e.rgb[1]*s,n.rgb[2]*o+e.rgb[2]*s],u=n.alpha*r+e.alpha*(1-r);return new Pt.Tree.Color(l,u)},greyscale:function(n){return this.desaturate(n,new Pt.Tree.Dimension(100))},"%":function(n){for(var e=Array.prototype.slice.call(arguments,1),t=n.value,r=0;r<e.length;r++)t=t.replace(/%s/,e[r].value).replace(/%[da]/,e[r].toString());return t=t.replace(/%%/g,"%"),new Pt.Tree.Quoted(t)},hsla_simple:function(n){return this.hsla(n.h,n.s,n.l,n.a)},number:function(n){return n instanceof Pt.Tree.Dimension?parseFloat(n.unit==="%"?n.value/100:n.value):typeof n=="number"?n:NaN},clamp:function(n){return Math.min(1,Math.max(0,n))}};Pt.Tree.Call=class{constructor(e,t,r){this.is="call",this.name=e,this.args=t,this.index=r}ev(e){for(var t=this.args.map(function(u){return u.ev(e)}),r=0;r<t.length;r++)if(t[r].is==="undefined")return{is:"undefined",value:"undefined"};if(this.name in Pt.Tree.functions)if(Pt.Tree.functions[this.name].length<=t.length){var i=Pt.Tree.functions[this.name].apply(Pt.Tree.functions,t);return i===null?(e.error({message:"incorrect arguments given to "+this.name+"()",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):i}else return e.error({message:"incorrect number of arguments for "+this.name+"(). "+Pt.Tree.functions[this.name].length+" expected.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"};else{var a=Pt.Tree.Reference.mapnikFunctions[this.name];if(a===void 0){var o=Cst(Pt.Tree.Reference.mapnikFunctions),s=this.name,l=o.map(function(u){return[u[0],Pt.Tree.Reference.editDistance(s,u[0]),u[1]]}).sort(function(u,h){return u[1]-h[1]});return e.error({message:"unknown function "+this.name+"(), did you mean "+l[0][0]+"("+l[0][2]+")",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}}return a!==t.length&&a!==-1?(e.error({message:"function "+this.name+"() takes "+a+" arguments and was given "+t.length,index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):(this.args=t,this)}}toString(e,t){return this.args.length?this.name+"("+this.args.join(",")+")":this.name}};Pt.Tree.Color=class{constructor(e,t){this.is="color",Array.isArray(e)?this.rgb=e.slice(0,3):e.length==6?this.rgb=e.match(/.{2}/g).map(function(r){return parseInt(r,16)}):this.rgb=e.split("").map(function(r){return parseInt(r+r,16)}),typeof t=="number"?this.alpha=t:e.length===4?this.alpha=e[3]:this.alpha=1}ev(){return this}toString(){return"rgba("+this.rgb.map(function(e){return Math.round(e)}).concat(this.alpha).join(", ")+")"}operate(e,t,r){var i=[];r instanceof Pt.Tree.Color||(r=r.toColor());for(var a=0;a<3;a++)i[a]=Pt.Tree.operate(t,this.rgb[a],r.rgb[a]);return new Pt.Tree.Color(i)}toHSL(){var e=this.rgb[0]/255,t=this.rgb[1]/255,r=this.rgb[2]/255,i=this.alpha,a=Math.max(e,t,r),o=Math.min(e,t,r),s,l,u=(a+o)/2,h=a-o;if(a===o)s=l=0;else{switch(l=u>.5?h/(2-a-o):h/(a+o),a){case e:s=(t-r)/h+(t<r?6:0);break;case t:s=(r-e)/h+2;break;case r:s=(e-t)/h+4;break}s/=6}return{h:s*360,s:l,l:u,a:i}}};Pt.Tree.Comment=class{constructor(e,t){this.value=e,this.silent=!!t}toString(e){return"<!--"+this.value+"-->"}ev(){return this}};Pt.Tree.Definition=class{constructor(e,t){this.elements=e.elements,this.rules=t,this.ruleIndex={};for(var r=0;r<this.rules.length;r++)"zoom"in this.rules[r]&&(this.rules[r]=this.rules[r].clone()),this.rules[r].zoom=e.zoom,this.ruleIndex[this.rules[r].updateID()]=!0;this.filters=e.filters,this.zoom=e.zoom,this.attachment=e.attachment||"__default__",this.specificity=e.specificity()}toString(){for(var e=this.filters.toString(),t=0;t<this.rules.length;t++)e+=`
`+this.rules[t];return e}toJS(e){var t={},r=this.zoom,i=this.filters.toJS(e),a=[r];i&&a.push(i),i=a.join(" && ");function o(l){if(l instanceof Pt.Tree.Rule)t[l.name]=t[l.name]||[],i?t[l.name].push("if("+i+"){"+l.value.toJS(e)+"}"):t[l.name].push(l.value.toJS(e));else if(l instanceof Pt.Tree.Ruleset){var u=l.toJS(e);for(var h in u){t[h]=t[h]||[];for(var c in u[h])t[h].push(u[h][c])}}}for(var s in this.rules)o(this.rules[s]);return t}};Pt.Tree.Dimension=class{constructor(e,t,r){this.is="float",this.physical_units=["m","cm","in","mm","pt","pc"],this.screen_units=["px","%"],this.all_units=["m","cm","in","mm","pt","pc","px","%"],this.densities={m:.0254,mm:25.4,cm:2.54,pt:72,pc:6},this.value=parseFloat(e),this.unit=t||null,this.index=r}ev(e){if(this.unit&&this.all_units.indexOf(this.unit)<0)return e.error({message:"Invalid unit: '"+this.unit+"'",index:this.index}),{is:"undefined",value:"undefined"};if(this.unit&&this.physical_units.indexOf(this.unit)>=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}toColor(){return new Pt.Tree.Color([this.value,this.value,this.value])}round(){return this.value=Math.round(this.value),this}toString(){return this.value.toString()}operate(e,t,r){return this.unit==="%"&&r.unit!=="%"?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):this.unit!=="%"&&r.unit==="%"?t==="*"||t==="/"||t==="%"?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new Pt.Tree.Dimension(Pt.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new Pt.Tree.Dimension(Pt.Tree.operate(t,this.value,r.value),this.unit||r.unit)}};Pt.Tree.Element=class{constructor(e){this.value=e.trim(),this.value[0]==="#"&&(this.type="id",this.clean=this.value.replace(/^#/,"")),this.value[0]==="."&&(this.type="class",this.clean=this.value.replace(/^\./,"")),this.value.indexOf("*")!==-1&&(this.type="wildcard")}specificity(){return[this.type==="id"?1:0,this.type==="class"?1:0]}toString(){return this.value}};Pt.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new Pt.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}toString(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}};Pt.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}};Pt.Tree.Filter=class{constructor(e,t,r,i,a){this.ops={"<":[" &lt; ","numeric"],">":[" &gt; ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" &lt;= ","numeric"],">=":[" &gt;= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=t,this.val=r,this.index=i,this.filename=a,this.id=this.key+this.op+this.val}ev(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}toString(){return"["+this.id+"]"}};Pt.Tree.Filterset=class{constructor(){this.filters={}}toJS(e){function t(a){var o=a.op;o==="="&&(o="==");var s=a.val;a._val!==void 0&&(s=a._val.toString(!0)),a.key&&a.key.value==="scale"?s=+s:(typeof s=="string"||typeof s=="object")&&(s="'"+s+"'");var l="attributes";return l+"&&"+l+a.key+"&&"+l+a.key+" "+o+s}var r=[];for(var i in this.filters)r.push(t(this.filters[i]));return r.join(" && ")}toString(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join(" ")}ev(e){for(var t in this.filters)this.filters[t].ev(e);return this}clone(){var e=new Pt.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}cloneWith(e){var t=[];for(var r in e.filters){var i=this.addable(e.filters[r]);if(i===!1)return!1;i===!0&&t.push(e.filters[r])}if(!t.length)return null;var a=new Pt.Tree.Filterset;for(r in this.filters)a.filters[r]=this.filters[r];for(;r=t.shift();)a.add(r);return a}addable(e){var t=e.key.toString(),r=e.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),e.op){case"=":return this.filters[t+"="]!==void 0?this.filters[t+"="].val.toString()!=r?!1:null:!(this.filters[t+"!="+r]!==void 0||this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<r);case"=~":return!0;case"!=":return this.filters[t+"="]!==void 0?this.filters[t+"="].val===r?!1:null:this.filters[t+"!="+r]!==void 0||this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<r?null:!0;case">":return t+"="in this.filters?this.filters[t+"="].val<=r?!1:null:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<=r?!1:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r?null:!0;case">=":return this.filters[t+"="]!==void 0?this.filters[t+"="].val<r?!1:null:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<r?!1:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>=r?null:!0;case"<":return this.filters[t+"="]!==void 0?this.filters[t+"="].val>=r?!1:null:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>=r?!1:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<r?null:!0;case"<=":return this.filters[t+"="]!==void 0?this.filters[t+"="].val>r?!1:null:this.filters[t+">"]!==void 0&&this.filters[t+">"].val>=r||this.filters[t+">="]!==void 0&&this.filters[t+">="].val>r?!1:this.filters[t+"<"]!==void 0&&this.filters[t+"<"].val<=r||this.filters[t+"<="]!==void 0&&this.filters[t+"<="].val<=r?null:!0}}conflict(e){var t=e.key.toString(),r=e.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),e.op==="="&&this.filters[t+"="]!==void 0&&r!=this.filters[t+"="].val.toString()||e.op==="!="&&this.filters[t+"="]!==void 0&&r==this.filters[t+"="].val.toString()||e.op==="="&&this.filters[t+"!="]!==void 0&&r===this.filters[t+"!="].val.toString()?e.toString()+" added to "+this.toString()+" produces an invalid filter":!1}add(e,t){var r=e.key.toString(),i=e.op,a=this.conflict(e),o;if(a)return a;if(i==="="){for(var s in this.filters)this.filters[s].key===r&&delete this.filters[s];this.filters[r+"="]=e}else if(i==="!=")this.filters[r+"!="+e.val]=e;else if(i==="=~")this.filters[r+"=~"+e.val]=e;else if(i===">"){for(var l in this.filters)this.filters[l].key===r&&this.filters[l].val<=e.val&&delete this.filters[l];this.filters[r+">"]=e}else if(i===">="){for(var u in this.filters)o=+this.filters[u].val.toString(),this.filters[u].key===r&&o<e.val&&delete this.filters[u];this.filters[r+"!="+e.val]!==void 0?(delete this.filters[r+"!="+e.val],e.op=">",this.filters[r+">"]=e):this.filters[r+">="]=e}else if(i==="<"){for(var h in this.filters)o=+this.filters[h].val.toString(),this.filters[h].key===r&&o>=e.val&&delete this.filters[h];this.filters[r+"<"]=e}else if(i==="<="){for(var c in this.filters)o=+this.filters[c].val.toString(),this.filters[c].key===r&&o>e.val&&delete this.filters[c];this.filters[r+"!="+e.val]!==void 0?(delete this.filters[r+"!="+e.val],e.op="<",this.filters[r+"<"]=e):this.filters[r+"<="]=e}}};Pt.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}};Pt.Tree.Invalid=class{constructor(e,t,r){this.is="invalid",this.chunk=e,this.index=t,this.type="syntax",this.message=r||"Invalid code: "+this.chunk}ev(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}};Pt.Tree.Keyword=class{ev(){return this}constructor(e){this.value=e;var t={transparent:"color",true:"boolean",false:"boolean"};this.is=t[e]?t[e]:"keyword"}toString(){return this.value}};Pt.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}};Pt.Tree.Operation=class{constructor(e,t,r){this.is="operation",this.op=e.trim(),this.operands=t,this.index=r}ev(e){var t=this.operands[0].ev(e),r=this.operands[1].ev(e),i;return t.is==="undefined"||r.is==="undefined"?{is:"undefined",value:"undefined"}:(t instanceof Pt.Tree.Dimension&&r instanceof Pt.Tree.Color&&(this.op==="*"||this.op==="+"?(i=r,r=t,t=i):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),t instanceof Pt.Tree.Quoted&&r instanceof Pt.Tree.Quoted&&this.op!=="+"?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):t instanceof Pt.Tree.Field||r instanceof Pt.Tree.Field||t instanceof Pt.Tree.Literal||r instanceof Pt.Tree.Literal?t.is==="color"||r.is==="color"?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new Pt.Tree.Literal(t.ev(e).toString(!0)+this.op+r.ev(e).toString(!0)):t.operate===void 0?(e.error({message:"Cannot do math with type "+t.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):t.operate(e,this.op,r))}};Pt.Tree.Quoted=class{constructor(e){this.is="string",this.value=e||""}toString(e){var t=this.value.replace(/&/g,"&amp;"),r=t.replace(/\'/g,"\\'").replace(/\"/g,"&quot;").replace(/</g,"&lt;").replace(/\>/g,"&gt;");return e===!0?"'"+r+"'":t}ev(){return this}operate(e,t,r){return new Pt.Tree.Quoted(Pt.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}};Pt.Tree.Reference={_validateValue:{font:function(n,e){return n.validation_data&&n.validation_data.fonts?n.validation_data.fonts.indexOf(e)!=-1:!0}},setData:function(n){this.data=n,this.selector_cache=e(n),this.mapnikFunctions=t(n),this.required_cache=r(n);function e(i){var a={};for(var o in i.symbolizers)for(var s in i.symbolizers[o])i.symbolizers[o][s].hasOwnProperty("css")&&(a[i.symbolizers[o][s].css]=[i.symbolizers[o][s],o,s]);return a}function t(i){var a={};for(var o in i.symbolizers)for(var s in i.symbolizers[o])if(i.symbolizers[o][s].type==="functions")for(var l=0;l<i.symbolizers[o][s].functions.length;l++){var u=i.symbolizers[o][s].functions[l];a[u[0]]=u[1]}return a}function r(i){var a={};for(var o in i.symbolizers){a[o]=[];for(var s in i.symbolizers[o])i.symbolizers[o][s].required&&a[o].push(i.symbolizers[o][s].css)}return a}},setVersion:function(n){return Pt.mapnik_reference.version.hasOwnProperty(n)?(this.setData(Pt.mapnik_reference.version[n]),!0):!1},selectorData:function(n,e){if(this.selector_cache&&this.selector_cache[n])return this.selector_cache[n][e]},validSelector:function(n){return!!this.selector_cache[n]},selectorName:function(n){return this.selectorData(n,2)},selector:function(n){return this.selectorData(n,0)},symbolizer:function(n){return this.selectorData(n,1)},requiredProperties:function(n,e){var t=this.required_cache[n];for(var r in t)if(!(t[r]in e))return"Property "+t[r]+" required for defining "+n+" styles."},isFont:function(n){return this.selector(n).validate==="font"},editDistance:function(n,e){if(n.length===0)return e.length;if(e.length===0)return n.length;for(var t=[],r=0;r<=e.length;r++)t[r]=[r];for(var i=0;i<=n.length;i++)t[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=n.length;i++)e.charAt(r-1)===n.charAt(i-1)?t[r][i]=t[r-1][i-1]:t[r][i]=Math.min(t[r-1][i-1]+1,Math.min(t[r][i-1]+1,t[r-1][i]+1));return t[e.length][n.length]},validValue:function(n,e,t){function r(s,l){if(s.value[0].is==="string")return!0;for(var u in s.value)for(var h in s.value[u].value){if(s.value[u].value[h].is!=="call")return!1;var c=find(this.selector(l).functions,function(f){return f[0]===s.value[u].value[h].name});if(!(c&&c[1]===-1)&&(!c||c[1]!==s.value[u].value[h].args.length))return!1}return!0}function i(s,l){return typeof this.selector(l).type=="object"?this.selector(l).type.indexOf(s.value[0].value)!==-1:this.selector(l).type==="string"}var a;if(this.selector(e)){if(t.value[0].is==="keyword")return i(t,e);if(t.value[0].is==="undefined")return!0;if(this.selector(e).type==="numbers"){for(a in t.value)if(t.value[a].is!=="float")return!1;return!0}else if(this.selector(e).type==="tags"){if(!t.value)return!1;if(!t.value[0].value)return t.value[0].is==="tag";for(a=0;a<t.value[0].value.length;a++)if(t.value[0].value[a].is!=="tag")return!1;return!0}else{if(this.selector(e).type=="functions")return r(t,e);if(this.selector(e).type==="expression")return!0;if(this.selector(e).type==="unsigned")return t.value[0].is==="float"?(t.value[0].round(),!0):!1;if(this.selector(e).validate){var o=!1;for(a=0;a<t.value.length;a++)if(this.selector(e).type===t.value[a].is&&this._validateValue[this.selector(e).validate](n,t.value[a].value))return!0;return o}else return this.selector(e).type===t.value[0].is}}else return!1}};Pt.Tree.Reference.setVersion("latest");Pt.Tree.Rule=class{constructor(e,t,r,i){this.is="rule";var a=e.split("/");this.name=a.pop(),this.instance=a.length?a[0]:"__default__",this.value=t instanceof Pt.Tree.Value?t:new Pt.Tree.Value([t]),this.index=r,this.symbolizer=Pt.Tree.Reference.symbolizer(this.name),this.filename=i,this.variable=e.charAt(0)==="@"}clone(){var e=Object.create(Pt.Tree.Rule.prototype);return e.name=this.name,e.value=this.value,e.index=this.index,e.instance=this.instance,e.symbolizer=this.symbolizer,e.filename=this.filename,e.variable=this.variable,e}updateID(){return this.id=this.zoom+"#"+this.instance+"#"+this.name}toString(){return"["+Pt.Tree.Zoom.toString(this.zoom)+"] "+this.name+": "+this.value}ev(e){return new Pt.Tree.Rule(this.name,this.value.ev(e),this.index,this.filename)}};Pt.Tree.Ruleset=class{constructor(e,t){this.is="ruleset",this.selectors=e,this.rules=t,this._lookups={}}ev(e){var t,r,i=new Pt.Tree.Ruleset(this.selectors,this.rules.slice(0));for(i.root=this.root,e.frames.unshift(i),t=0,r;t<i.rules.length;t++)r=i.rules[t],i.rules[t]=r.ev?r.ev(e):r;return e.frames.shift(),i}match(e){return!e||e.length===0}variables(){return this._variables?this._variables:this._variables=this.rules.reduce(function(e,t){return t instanceof Pt.Tree.Rule&&t.variable===!0&&(e[t.name]=t),e},{})}variable(e){return this.variables()[e]}rulesets(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(e){return e instanceof Pt.Tree.Ruleset})}find(e,t){t=t||this;var r=[],i,a=e.toString();return a in this._lookups?this._lookups[a]:(this.rulesets().forEach(function(o){if(o!==t){for(var s=0;s<o.selectors.length;s++)if(i=e.match(o.selectors[s]),i){e.elements.length>1?Array.prototype.push.apply(r,o.find(new Pt.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(o);break}}}),this._lookups[a]=r)}evZooms(e){for(var t=0;t<this.selectors.length;t++){for(var r=Pt.Tree.Zoom.all,i=0;i<this.selectors[t].zoom.length;i++)r=this.selectors[t].zoom[i].ev(e).zoom;this.selectors[t].zoom=r}}flatten(e,t,r){var i=[],a,o;for(this.selectors.length===0&&(r.frames=r.frames.concat(this.rules)),this.evZooms(r),a=0;a<this.selectors.length;a++){var s=this.selectors[a];if(!!s.filters)if(t.length)for(o=0;o<t.length;o++){var l=t[o],u=l.filters.cloneWith(s.filters);if(u===null)if(l.zoom===s.zoom&&l.attachment===s.attachment&&l.elements.join()===s.elements.join()){i.push(l);continue}else u=l.filters;else if(!u)continue;var h=Object.create(Pt.Tree.Selector.prototype);h.filters=u,h.zoom=s.zoom,h.elements=l.elements.concat(s.elements),l.attachment&&s.attachment?h.attachment=l.attachment+"/"+s.attachment:h.attachment=s.attachment||l.attachment,h.conditions=l.conditions+s.conditions,h.index=s.index,i.push(h)}else i.push(s)}var c=[];for(a=0;a<this.rules.length;a++){var f=this.rules[a];f instanceof Pt.Tree.Ruleset?f.flatten(e,i,r):f instanceof Pt.Tree.Rule?c.push(f):f instanceof Pt.Tree.Invalid&&r.error(f)}var d=c.length?c[0].index:!1;for(a=0;a<i.length;a++)d!==!1&&(i[a].index=d),e.push(new Pt.Tree.Definition(i[a],c.slice()));return e}};Pt.Tree.Selector=class{constructor(e,t,r,i,a,o){this.elements=r||[],this.attachment=i,this.filters=e||{},this.zoom=typeof t<"u"?t:Pt.Tree.Zoom.all,this.conditions=a,this.index=o}specificity(){return this.elements.reduce(function(e,t){var r=t.specificity();return e[0]+=r[0],e[1]+=r[1],e},[0,0,this.conditions,this.index])}};Pt.Tree.URL=class{constructor(e,t){this.is="uri",this.value=e,this.paths=t}toString(){return this.value.toString()}ev(e){return new Pt.Tree.URL(this.value.ev(e),this.paths)}};Pt.Tree.Value=class{constructor(e){this.is="value",this.value=e}ev(e){return this.value.length===1?this.value[0].ev(e):new Pt.Tree.Value(this.value.map(function(t){return t.ev(e)}))}toJS(e){var t=this.ev(e),r=t.toString();return t.is==="color"||t.is==="uri"||t.is==="string"||t.is==="keyword"?r="'"+r+"'":t.is==="field"?r=r.replace(/\[(.*)\]/g,"attributes['_match1']"):t.value&&typeof t.value=="object"&&(r="["+r+"]"),"_value = "+r+";"}toString(e,t,r,i){return this.value.map(function(a){return a.toString(e,i)}).join(r||", ")}clone(){var e=Object.create(Pt.Tree.Value.prototype);return Array.isArray(e)?e.value=this.value.slice():e.value=this.value,e.is=this.is,e}};Pt.Tree.Variable=class{constructor(e,t,r){this.is="variable",this.name=e,this.index=t,this.filename=r}toString(){return this.name}ev(e){if(this._css)return this._css;var t=e.frames.filter(function(r){return r.name===this.name}.bind(this));return t.length?t[0].value.ev(e):(e.error({message:"variable "+this.name+" is undefined",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"})}};Pt.Tree.Zoom=class{constructor(e,t,r){this.op=e,this.value=t,this.index=r}setZoom(e){return this.zoom=e,this}ev(e){var t=parseInt(this.value.ev(e).toString(),10);switch((t>Pt.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+Pt.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t;break}return this}toString(){for(var e="",t=0;t<=Pt.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<<t?"X":".";return e}};Pt.Tree.Zoom.all=23;Pt.Tree.Zoom.maxZoom=22;Pt.Tree.Zoom.ranges={0:1e9,1:5e8,2:2e8,3:1e8,4:5e7,5:25e6,6:125e5,7:65e5,8:3e6,9:15e5,10:75e4,11:4e5,12:2e5,13:1e5,14:5e4,15:25e3,16:12500,17:5e3,18:2500,19:1500,20:750,21:500,22:250,23:100};class Ast{constructor(e){e=e||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,H.extend(this,e)}}class D_{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="SuperMap.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class Fz extends D_{constructor(e,t){super(e,t),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=6,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class VO extends D_{constructor(e){super(e),this.pointList=e,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class I1 extends D_{constructor(e){super(e),this.pointList=e,this.holePolygonPointLists=null,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class IK extends D_{constructor(e,t,r,i){super(e,t,r,i),this.x=isNaN(e)?0:e,this.y=isNaN(e)?0:t,this.width=isNaN(r)?0:r,this.height=isNaN(i)?0:i,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class Bz extends D_{constructor(e,t,r,i,a,o,s){super(e,t,r,i,a,o,s),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(r)?0:r,this.startAngle=isNaN(i)?0:i,this.endAngle=isNaN(a)?0:a,this.r0=isNaN(o)?0:o,this.clockWise=s,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class Ib extends D_{constructor(e,t,r){super(e,t,r),this.x=e,this.y=t,this.text=r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class kNe extends D_{constructor(e,t,r,i,a,o,s,l,u){super(e,t,r,i,a,o,s,l,u),this.x=e,this.y=t,this.image=r,this.width=i,this.height=a,this.sx=o,this.sy=s,this.sWidth=l,this.sHeight=u,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class qne extends D_{constructor(e,t,r){super(e,t,r),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(r)?0:r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class JR{constructor(){this._handlers={},this.CLASS_NAME="SuperMap.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(e,t,r){var i=this._handlers;return!t||!e?this:(i[e]||(i[e]=[]),i[e].push({h:t,one:!0,ctx:r||this}),this)}bind(e,t,r){var i=this._handlers;return!t||!e?this:(i[e]||(i[e]=[]),i[e].push({h:t,one:!1,ctx:r||this}),this)}unbind(e,t){var r=this._handlers;if(!e)return this._handlers={},this;if(t){if(r[e]){for(var i=[],a=0,o=r[e].length;a<o;a++)r[e][a].h!=t&&i.push(r[e][a]);r[e]=i}r[e]&&r[e].length===0&&delete r[e]}else delete r[e];return this}dispatch(e){if(this._handlers[e]){var t=arguments,r=t.length;r>3&&(t=Array.prototype.slice.call(t,1));for(var i=this._handlers[e],a=i.length,o=0;o<a;){switch(r){case 1:i[o].h.call(i[o].ctx);break;case 2:i[o].h.call(i[o].ctx,t[1]);break;case 3:i[o].h.call(i[o].ctx,t[1],t[2]);break;default:i[o].h.apply(i[o].ctx,t);break}i[o].one?(i.splice(o,1),a--):o++}}return this}dispatchWithContext(e){if(this._handlers[e]){var t=arguments,r=t.length;r>4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var i=t[t.length-1],a=this._handlers[e],o=a.length,s=0;s<o;){switch(r){case 1:a[s].h.call(i);break;case 2:a[s].h.call(i,t[1]);break;case 3:a[s].h.call(i,t[1],t[2]);break;default:a[s].h.apply(i,t);break}a[s].one?(a.splice(s,1),o--):s++}}return this}}class Zne{constructor(){this.ArrayCtor=typeof Float32Array>"u"?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Vector"}create(e,t){var r=this.ArrayCtor,i=new r(2);return i[0]=e||0,i[1]=t||0,i}copy(e,t){return e[0]=t[0],e[1]=t[1],e}set(e,t,r){return e[0]=t,e[1]=r,e}add(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}scaleAndAdd(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e}sub(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}len(e){return Math.sqrt(this.lenSquare(e))}lenSquare(e){return e[0]*e[0]+e[1]*e[1]}mul(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e}div(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e}dot(e,t){return e[0]*t[0]+e[1]*t[1]}scale(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}normalize(e,t){var r=this.len(t);return r===0?(e[0]=0,e[1]=0):(e[0]=t[0]/r,e[1]=t[1]/r),e}distance(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}distanceSquare(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}negate(e,t){return e[0]=-t[0],e[1]=-t[1],e}lerp(e,t,r,i){return e[0]=t[0]+i*(r[0]-t[0]),e[1]=t[1]+i*(r[1]-t[1]),e}applyTransform(e,t,r){var i=t[0],a=t[1];return e[0]=r[0]*i+r[2]*a+r[4],e[1]=r[1]*i+r[3]*a+r[5],e}min(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}max(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}length(e){return this.len(e)}lengthSquare(e){return this.lenSquare(e)}dist(e,t){return this.distance(e,t)}distSquare(e,t){return this.distanceSquare(e,t)}}class X8{constructor(){this.vector=new Zne,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Curve"}isAroundZero(e){return e>-this.EPSILON&&e<this.EPSILON}isNotAroundZero(e){return e>this.EPSILON||e<-this.EPSILON}cubicAt(e,t,r,i,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*i+3*o*r)}cubicDerivativeAt(e,t,r,i,a){var o=1-a;return 3*(((t-e)*o+2*(r-t)*a)*o+(i-r)*a*a)}cubicRootAt(e,t,r,i,a,o){var s=i+3*(t-r)-e,l=3*(r-t*2+e),u=3*(t-e),h=e-a,c=l*l-3*s*u,f=l*u-9*s*h,d=u*u-3*l*h,v=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(l))o[0]=0;else{let S=-u/l;S>=0&&S<=1&&(o[v++]=S)}else{var p=f*f-4*c*d;if(this.isAroundZero(p)){var g=f/c;let S=-l/s+g,w=-g/2;S>=0&&S<=1&&(o[v++]=S),w>=0&&w<=1&&(o[v++]=w)}else if(p>0){let S=Math.sqrt(p),w=c*l+1.5*s*(-f+S),b=c*l+1.5*s*(-f-S);w<0?w=-Math.pow(-w,this.ONE_THIRD):w=Math.pow(w,this.ONE_THIRD),b<0?b=-Math.pow(-b,this.ONE_THIRD):b=Math.pow(b,this.ONE_THIRD);let E=(-l-(w+b))/(3*s);E>=0&&E<=1&&(o[v++]=E)}else{var m=(2*c*l-3*s*f)/(2*Math.sqrt(c*c*c)),y=Math.acos(m)/3,_=Math.sqrt(c),x=Math.cos(y);let S=(-l-2*_*x)/(3*s),w=(-l+_*(x+this.THREE_SQRT*Math.sin(y)))/(3*s),b=(-l+_*(x-this.THREE_SQRT*Math.sin(y)))/(3*s);S>=0&&S<=1&&(o[v++]=S),w>=0&&w<=1&&(o[v++]=w),b>=0&&b<=1&&(o[v++]=b)}}return v}cubicExtrema(e,t,r,i,a){var o=6*r-12*t+6*e,s=9*t+3*i-3*e-9*r,l=3*t-3*e,u=0;if(this.isAroundZero(s)){if(this.isNotAroundZero(o)){let c=-l/o;c>=0&&c<=1&&(a[u++]=c)}}else{var h=o*o-4*s*l;if(this.isAroundZero(h))a[0]=-o/(2*s);else if(h>0){let c=Math.sqrt(h),f=(-o+c)/(2*s),d=(-o-c)/(2*s);f>=0&&f<=1&&(a[u++]=f),d>=0&&d<=1&&(a[u++]=d)}}return u}cubicSubdivide(e,t,r,i,a,o){var s=(t-e)*a+e,l=(r-t)*a+t,u=(i-r)*a+r,h=(l-s)*a+s,c=(u-l)*a+l,f=(c-h)*a+h;o[0]=e,o[1]=s,o[2]=h,o[3]=f,o[4]=f,o[5]=c,o[6]=u,o[7]=i}cubicProjectPoint(e,t,r,i,a,o,s,l,u,h,c){var f=this.vector.create(),d=this.vector.create(),v=this.vector.create(),p,g=.005,m=1/0;f[0]=u,f[1]=h;for(let y=0;y<1;y+=.05){d[0]=this.cubicAt(e,r,a,s,y),d[1]=this.cubicAt(t,i,o,l,y);let _=this.vector.distSquare(f,d);_<m&&(p=y,m=_)}m=1/0;for(let y=0;y<32&&!(g<this.EPSILON);y++){let _=p-g,x=p+g;d[0]=this.cubicAt(e,r,a,s,_),d[1]=this.cubicAt(t,i,o,l,_);let S=this.vector.distSquare(d,f);if(_>=0&&S<m)p=_,m=S;else{v[0]=this.cubicAt(e,r,a,s,x),v[1]=this.cubicAt(t,i,o,l,x);let w=this.vector.distSquare(v,f);x<=1&&w<m?(p=x,m=w):g*=.5}}return c&&(c[0]=this.cubicAt(e,r,a,s,p),c[1]=this.cubicAt(t,i,o,l,p)),Math.sqrt(m)}quadraticAt(e,t,r,i){var a=1-i;return a*(a*e+2*i*t)+i*i*r}quadraticDerivativeAt(e,t,r,i){return 2*((1-i)*(t-e)+i*(r-t))}quadraticRootAt(e,t,r,i,a){var o=e-2*t+r,s=2*(t-e),l=e-i,u=0;if(this.isAroundZero(o)){if(this.isNotAroundZero(s)){var h=-l/s;h>=0&&h<=1&&(a[u++]=h)}}else{var c=s*s-4*o*l;if(this.isAroundZero(c)){let f=-s/(2*o);f>=0&&f<=1&&(a[u++]=f)}else if(c>0){let f=Math.sqrt(c),d=(-s+f)/(2*o),v=(-s-f)/(2*o);d>=0&&d<=1&&(a[u++]=d),v>=0&&v<=1&&(a[u++]=v)}}return u}quadraticExtremum(e,t,r){var i=e+r-2*t;return i===0?.5:(e-t)/i}quadraticProjectPoint(e,t,r,i,a,o,s,l,u){var h=this.vector.create(),c=this.vector.create(),f=this.vector.create(),d,v=.005,p=1/0;h[0]=s,h[1]=l;for(let g=0;g<1;g+=.05){c[0]=this.quadraticAt(e,r,a,g),c[1]=this.quadraticAt(t,i,o,g);let m=this.vector.distSquare(h,c);m<p&&(d=g,p=m)}p=1/0;for(let g=0;g<32&&!(v<this.EPSILON);g++){let m=d-v,y=d+v;c[0]=this.quadraticAt(e,r,a,m),c[1]=this.quadraticAt(t,i,o,m);let _=this.vector.distSquare(c,h);if(m>=0&&_<p)d=m,p=_;else{f[0]=this.quadraticAt(e,r,a,y),f[1]=this.quadraticAt(t,i,o,y);let x=this.vector.distSquare(f,h);y<=1&&x<p?(d=y,p=x):v*=.5}}return u&&(u[0]=this.quadraticAt(e,r,a,d),u[1]=this.quadraticAt(t,i,o,d)),Math.sqrt(p)}}class Mst{constructor(){this.util=new Pp,this.curve=new X8,this._ctx=null,this._textWidthCache={},this._textHeightCache={},this._textWidthCacheCounter=0,this._textHeightCacheCounter=0,this.TEXT_CACHE_MAX=5e3,this.PI2=Math.PI*2,this.roots=[-1,-1,-1],this.extrema=[-1,-1],this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Area"}normalizeRadian(e){return e%=this.PI2,e<0&&(e+=this.PI2),e}isInside(e,t,r,i){if(!t||!e)return!1;var a=e.type;this._ctx=this._ctx||this.util.getContext();var o=this._mathMethod(e,t,r,i);if(typeof o<"u")return o;if(e.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(e,this._ctx,t,r,i);switch(a){case"ellipse":case"smicellipse":return!0;case"trochoid":var s=t.location=="out"?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return this.isInsideCircle(t,r,i,s);case"rose":return this.isInsideCircle(t,r,i,t.maxr);default:return!1}}_mathMethod(e,t,r,i){var a=e.type;switch(a){case"bezier-curve":return typeof t.cpX2>"u"?this.isInsideQuadraticStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,r,i):this.isInsideCubicStroke(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,r,i);case"line":return this.isInsideLine(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,r,i);case"broken-line":return this.isInsideBrokenLine(t.pointList,t.lineWidth,r,i);case"smicbroken-line":{let p=r,g=i;return e.refOriginalPosition&&(p=r-e.refOriginalPosition[0],g=i-e.refOriginalPosition[1]),this.isInsideBrokenLine(t.pointList,t.lineWidth,p,g)}case"ring":return this.isInsideRing(t.x,t.y,t.r0,t.r,r,i);case"smicring":{let p=t.x,g=t.y;return e.refOriginalPosition&&(p=t.x+e.refOriginalPosition[0],g=t.y+e.refOriginalPosition[1]),this.isInsideRing(p,g,t.r0,t.r,r,i)}case"circle":return this.isInsideCircle(t.x,t.y,t.r,r,i);case"smicpoint":{let p=r,g=i;return e.refOriginalPosition&&(p=r-e.refOriginalPosition[0],g=i-e.refOriginalPosition[1]),this.isInsideCircle(t.x,t.y,t.r,p,g)}case"sector":{let p=t.startAngle*Math.PI/180,g=t.endAngle*Math.PI/180;return t.clockWise||(p=-p,g=-g),this.isInsideSector(t.x,t.y,t.r0,t.r,p,g,!t.clockWise,r,i)}case"smicsector":{let p=t.startAngle*Math.PI/180,g=t.endAngle*Math.PI/180;t.clockWise||(p=-p,g=-g);let m=t.x,y=t.y;return e.refOriginalPosition&&(m=t.x+e.refOriginalPosition[0],y=t.y+e.refOriginalPosition[1]),this.isInsideSector(m,y,t.r0,t.r,p,g,!t.clockWise,r,i)}case"path":return this.isInsidePath(t.pathArray,Math.max(t.lineWidth,5),t.brushType,r,i);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(t.pointList,r,i);case"smicpolygon":{let p=r,g=i;if(e.refOriginalPosition&&(p=r-e.refOriginalPosition[0],g=i-e.refOriginalPosition[1]),e.holePolygonPointLists&&e.holePolygonPointLists.length>0){for(var o=this.isInsidePolygon(t.pointList,p,g),s=e.holePolygonPointLists,l=!1,u=0,h=s.length;u<h;u++){var c=s[u],f=this.isInsidePolygon(c,p,g);f===!0&&(l=!0)}return o===!0&&l===!1}else return this.isInsidePolygon(t.pointList,p,g)}case"text":var d=t.__rect||e.getRect(t);return this.isInsideRect(d.x,d.y,d.width,d.height,r,i);case"smictext":var v=e.getTextBackground(t);return this.isInsidePolygon(v,r,i);case"rectangle":case"image":return this.isInsideRect(t.x,t.y,t.width,t.height,r,i);case"smicimage":{let p=t.x,g=t.y;return e.refOriginalPosition&&(p=t.x+e.refOriginalPosition[0],g=t.y+e.refOriginalPosition[1]),this.isInsideRect(p,g,t.width,t.height,r,i)}}}_buildPathMethod(e,t,r,i,a){return t.beginPath(),e.buildPath(t,r),t.closePath(),t.isPointInPath(i,a)}isOutside(e,t,r,i){return!this.isInside(e,t,r,i)}isInsideLine(e,t,r,i,a,o,s){if(a===0)return!1;var l=Math.max(a,5),u=0,h=0;if(s>t+l&&s>i+l||s<t-l&&s<i-l||o>e+l&&o>r+l||o<e-l&&o<r-l)return!1;if(e!==r)u=(t-i)/(e-r),h=(e*i-r*t)/(e-r);else return Math.abs(o-e)<=l/2;var c=u*o-s+h,f=c*c/(u*u+1);return f<=l/2*l/2}isInsideCubicStroke(e,t,r,i,a,o,s,l,u,h,c){if(u===0)return!1;var f=Math.max(u,5);if(c>t+f&&c>i+f&&c>o+f&&c>l+f||c<t-f&&c<i-f&&c<o-f&&c<l-f||h>e+f&&h>r+f&&h>a+f&&h>s+f||h<e-f&&h<r-f&&h<a-f&&h<s-f)return!1;var d=this.curve.cubicProjectPoint(e,t,r,i,a,o,s,l,h,c,null);return d<=f/2}isInsideQuadraticStroke(e,t,r,i,a,o,s,l,u){if(s===0)return!1;var h=Math.max(s,5);if(u>t+h&&u>i+h&&u>o+h||u<t-h&&u<i-h&&u<o-h||l>e+h&&l>r+h&&l>a+h||l<e-h&&l<r-h&&l<a-h)return!1;var c=this.curve.quadraticProjectPoint(e,t,r,i,a,o,l,u,null);return c<=h/2}isInsideArcStroke(e,t,r,i,a,o,s,l,u){var h=this.PI2;if(s===0)return!1;var c=Math.max(s,5);l-=e,u-=t;var f=Math.sqrt(l*l+u*u);if(f-c>r||f+c<r)return!1;if(Math.abs(i-a)>=h)return!0;if(o){var d=i;i=this.normalizeRadian(a),a=this.normalizeRadian(d)}else i=this.normalizeRadian(i),a=this.normalizeRadian(a);i>a&&(a+=h);var v=Math.atan2(u,l);return v<0&&(v+=h),v>=i&&v<=a||v+h>=i&&v+h<=a}isInsideBrokenLine(e,t,r,i){for(var a=Math.max(t,10),o=0,s=e.length-1;o<s;o++){var l=e[o][0],u=e[o][1],h=e[o+1][0],c=e[o+1][1];if(this.isInsideLine(l,u,h,c,a,r,i))return!0}return!1}isInsideRing(e,t,r,i,a,o){var s=(a-e)*(a-e)+(o-t)*(o-t);return s<i*i&&s>r*r}isInsideRect(e,t,r,i,a,o){return a>=e&&a<=e+r&&o>=t&&o<=t+i}isInsideCircle(e,t,r,i,a){return(i-e)*(i-e)+(a-t)*(a-t)<r*r}isInsideSector(e,t,r,i,a,o,s,l,u){return this.isInsideArcStroke(e,t,(r+i)/2,a,o,s,i-r,l,u)}isInsidePolygon(e,t,r){for(var i=e.length,a=0,o=0,s=i-1;o<i;o++){var l=e[s][0],u=e[s][1],h=e[o][0],c=e[o][1];a+=this.windingLine(l,u,h,c,t,r),s=o}return a!==0}windingLine(e,t,r,i,a,o){if(o>t&&o>i||o<t&&o<i||i==t)return 0;var s=i<t?1:-1,l=(o-t)/(i-t),u=l*(r-e)+e;return u>a?s:0}swapExtrema(){var e=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=e}windingCubic(e,t,r,i,a,o,s,l,u,h){var c=this.curve,f=this.roots,d=this.extrema;if(h>t&&h>i&&h>o&&h>l||h<t&&h<i&&h<o&&h<l)return 0;var v=c.cubicRootAt(t,i,o,l,h,f);if(v===0)return 0;for(var p=0,g=-1,m,y,_=0;_<v;_++){var x=f[_],S=c.cubicAt(e,r,a,s,x);S<u||(g<0&&(g=c.cubicExtrema(t,i,o,l,d),d[1]<d[0]&&g>1&&this.swapExtrema(),m=c.cubicAt(t,i,o,l,d[0]),g>1&&(y=c.cubicAt(t,i,o,l,d[1]))),g==2?x<d[0]?p+=m<t?1:-1:x<d[1]?p+=y<m?1:-1:p+=l<y?1:-1:x<d[0]?p+=m<t?1:-1:p+=l<m?1:-1)}return p}windingQuadratic(e,t,r,i,a,o,s,l){var u=this.curve,h=this.roots;if(l>t&&l>i&&l>o||l<t&&l<i&&l<o)return 0;var c=u.quadraticRootAt(t,i,o,l,h);if(c===0)return 0;var f=u.quadraticExtremum(t,i,o);if(f>=0&&f<=1){var d=0,v=u.quadraticAt(t,i,o,f);for(let p=0;p<c;p++)u.quadraticAt(e,r,a,h[p])>s||(h[p]<f?d+=v<t?1:-1:d+=o<v?1:-1);return d}else return u.quadraticAt(e,r,a,h[0])>s?0:o<t?1:-1}windingArc(e,t,r,i,a,o,s,l){var u=this.roots,h=this.PI2;if(l-=t,l>r||l<-r)return 0;let c=Math.sqrt(r*r-l*l);if(u[0]=-c,u[1]=c,Math.abs(i-a)>=h){i=0,a=h;var f=o?1:-1;return s>=u[0]+e&&s<=u[1]+e?f:0}if(o){let p=i;i=this.normalizeRadian(a),a=this.normalizeRadian(p)}else i=this.normalizeRadian(i),a=this.normalizeRadian(a);i>a&&(a+=h);var d=0;for(let p=0;p<2;p++){var v=u[p];if(v+e>s){let g=Math.atan2(l,v),m=o?1:-1;g<0&&(g=h+g),(g>=i&&g<=a||g+h>=i&&g+h<=a)&&(g>Math.PI/2&&g<Math.PI*1.5&&(m=-m),d+=m)}}return d}isInsidePath(e,t,r,i,a){var o=0,s=0,l=0,u=0,h=0,c=!0,f=!0;r=r||"fill";for(var d=r==="stroke"||r==="both",v=r==="fill"||r==="both",p=0;p<e.length;p++){var g=e[p],m=g.points;if(c||g.command==="M"){if(p>0&&(v&&(o+=this.windingLine(s,l,u,h,i,a)),o!==0))return!0;u=m[m.length-2],h=m[m.length-1],c=!1,f&&g.command!=="A"&&(f=!1,s=u,l=h)}switch(g.command){case"M":s=m[0],l=m[1];break;case"L":if(d&&this.isInsideLine(s,l,m[0],m[1],t,i,a))return!0;v&&(o+=this.windingLine(s,l,m[0],m[1],i,a)),s=m[0],l=m[1];break;case"C":if(d&&this.isInsideCubicStroke(s,l,m[0],m[1],m[2],m[3],m[4],m[5],t,i,a))return!0;v&&(o+=this.windingCubic(s,l,m[0],m[1],m[2],m[3],m[4],m[5],i,a)),s=m[4],l=m[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(s,l,m[0],m[1],m[2],m[3],t,i,a))return!0;v&&(o+=this.windingQuadratic(s,l,m[0],m[1],m[2],m[3],i,a)),s=m[2],l=m[3];break;case"A":var y=m[0],_=m[1],x=m[2],S=m[3],w=m[4],b=m[5],E=Math.cos(w)*x+y,T=Math.sin(w)*S+_;f?(f=!1,u=E,h=T):o+=this.windingLine(s,l,E,T);var C=(i-y)*S/x+y;if(d&&this.isInsideArcStroke(y,_,S,w,w+b,1-m[7],t,C,a))return!0;v&&(o+=this.windingArc(y,_,S,w,w+b,1-m[7],C,a)),s=Math.cos(w+b)*x+y,l=Math.sin(w+b)*S+_;break;case"z":if(d&&this.isInsideLine(s,l,u,h,t,i,a))return!0;c=!0;break}}return v&&(o+=this.windingLine(s,l,u,h,i,a)),o!==0}getTextWidth(e,t){var r=e+":"+t;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split(`
`);for(var i=0,a=0,o=e.length;a<o;a++)i=Math.max(this._ctx.measureText(e[a]).width,i);return this._ctx.restore(),this._textWidthCache[r]=i,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),i}getTextHeight(e,t){var r=e+":"+t;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split(`
`);var i=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[r]=i,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),i}}class Ist{constructor(){arguments.length===3&&this.computeBoundingBox(arguments),this.CLASS_NAME="SuperMap.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(e,t,r){if(e.length!==0){for(var i=e[0][0],a=e[0][0],o=e[0][1],s=e[0][1],l=1;l<e.length;l++){var u=e[l];u[0]<i&&(i=u[0]),u[0]>a&&(a=u[0]),u[1]<o&&(o=u[1]),u[1]>s&&(s=u[1])}t[0]=i,t[1]=o,r[0]=a,r[1]=s}}cubeBezier(e,t,r,i,a,o){var s=new X8,l=[];s.cubicExtrema(e[0],t[0],r[0],i[0],l);for(let v=0;v<l.length;v++)l[v]=s.cubicAt(e[0],t[0],r[0],i[0],l[v]);var u=[];s.cubicExtrema(e[1],t[1],r[1],i[1],u);for(let v=0;v<u.length;v++)u[v]=s.cubicAt(e[1],t[1],r[1],i[1],u[v]);l.push(e[0],i[0]),u.push(e[1],i[1]);var h=Math.min.apply(null,l),c=Math.max.apply(null,l),f=Math.min.apply(null,u),d=Math.max.apply(null,u);a[0]=h,a[1]=f,o[0]=c,o[1]=d}quadraticBezier(e,t,r,i,a){var o=new X8,s=o.quadraticExtremum(e[0],t[0],r[0]),l=o.quadraticExtremum(e[1],t[1],r[1]);s=Math.max(Math.min(s,1),0),l=Math.max(Math.min(l,1),0);var u=1-s,h=1-l,c=u*u*e[0]+2*u*s*t[0]+s*s*r[0],f=u*u*e[1]+2*u*s*t[1]+s*s*r[1],d=h*h*e[0]+2*h*l*t[0]+l*l*r[0],v=h*h*e[1]+2*h*l*t[1]+l*l*r[1];i[0]=Math.min(e[0],r[0],c,d),i[1]=Math.min(e[1],r[1],f,v),a[0]=Math.max(e[0],r[0],c,d),a[1]=Math.max(e[1],r[1],f,v)}arc(e,t,r,i,a,o,s,l){var u=new Zne,h=u.create(),c=u.create(),f=u.create();if(h[0]=Math.cos(i)*r+e,h[1]=Math.sin(i)*r+t,c[0]=Math.cos(a)*r+e,c[1]=Math.sin(a)*r+t,u.min(s,h,c),u.max(l,h,c),i=i%(Math.PI*2),i<0&&(i=i+Math.PI*2),a=a%(Math.PI*2),a<0&&(a=a+Math.PI*2),i>a&&!o?a+=Math.PI*2:i<a&&o&&(i+=Math.PI*2),o){var d=a;a=i,i=d}for(var v=0;v<a;v+=Math.PI/2)v>i&&(f[0]=Math.cos(v)*r+e,f[1]=Math.sin(v)*r+t,u.min(s,f,s),u.max(l,f,l))}}class Lst{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Env";var e=this;function t(r){var i=e.os={},a=e.browser={},o=r.match(/Web[kK]it[\/]{0,1}([\d.]+)/),s=r.match(/(Android);?[\s\/]+([\d.]+)?/),l=r.match(/(iPad).*OS\s([\d_]+)/),u=r.match(/(iPod)(.*OS\s([\d_]+))?/),h=!l&&r.match(/(iPhone\sOS)\s([\d_]+)/),c=r.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=c&&r.match(/TouchPad/),d=r.match(/Kindle\/([\d.]+)/),v=r.match(/Silk\/([\d._]+)/),p=r.match(/(BlackBerry).*Version\/([\d.]+)/),g=r.match(/(BB10).*Version\/([\d.]+)/),m=r.match(/(RIM\sTablet\sOS)\s([\d.]+)/),y=r.match(/PlayBook/),_=r.match(/Chrome\/([\d.]+)/)||r.match(/CriOS\/([\d.]+)/),x=r.match(/Firefox\/([\d.]+)/),S=r.match(/MSIE ([\d.]+)/),w=o&&r.match(/Mobile\//)&&!_,b=r.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!_;return(a.webkit=!!o)&&(a.version=o[1]),s&&(i.android=!0,i.version=s[2]),h&&!u&&(i.ios=i.iphone=!0,i.version=h[2].replace(/_/g,".")),l&&(i.ios=i.ipad=!0,i.version=l[2].replace(/_/g,".")),u&&(i.ios=i.ipod=!0,i.version=u[3]?u[3].replace(/_/g,"."):null),c&&(i.webos=!0,i.version=c[2]),f&&(i.touchpad=!0),p&&(i.blackberry=!0,i.version=p[2]),g&&(i.bb10=!0,i.version=g[2]),m&&(i.rimtabletos=!0,i.version=m[2]),y&&(a.playbook=!0),d&&(i.kindle=!0,i.version=d[1]),v&&(a.silk=!0,a.version=v[1]),!v&&i.android&&r.match(/Kindle Fire/)&&(a.silk=!0),_&&(a.chrome=!0,a.version=_[1]),x&&(a.firefox=!0,a.version=x[1]),S&&(a.ie=!0,a.version=S[1]),w&&(r.match(/Safari/)||!!i.ios)&&(a.safari=!0),b&&(a.webview=!0),S&&(a.ie=!0,a.version=S[1]),i.tablet=!!(l||y||s&&!r.match(/Mobile/)||x&&r.match(/Tablet/)||S&&!r.match(/Phone/)&&r.match(/Touch/)),i.phone=!!(!i.tablet&&!i.ipod&&(s||h||c||p||g||_&&r.match(/Android/)||_&&r.match(/CriOS\/([\d.]+)/)||x&&r.match(/Mobile/)||S&&r.match(/Touch/))),{browser:a,os:i,canvasSupported:!!document.createElement("canvas").getContext}}return t(navigator.userAgent)}destory(){return!0}}class Pst{constructor(){this.stop=typeof window.addEventListener=="function"?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Event"}getX(e){return typeof e.zrenderX<"u"&&e.zrenderX||typeof e.offsetX<"u"&&e.offsetX||typeof e.layerX<"u"&&e.layerX||typeof e.clientX<"u"&&e.clientX}getY(e){return typeof e.zrenderY<"u"&&e.zrenderY||typeof e.offsetY<"u"&&e.offsetY||typeof e.layerY<"u"&&e.layerY||typeof e.clientY<"u"&&e.clientY}getDelta(e){return typeof e.zrenderDelta<"u"&&e.zrenderDelta||typeof e.wheelDelta<"u"&&e.wheelDelta||typeof e.detail<"u"&&-e.detail}}class Ost{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Http"}get(e,t,r){if(typeof e=="object"){var i=e;e=i.url,t=i.onsuccess,r=i.onerror}var a=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");a.open("GET",e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status>=200&&a.status<300||a.status===304?t&&t(a.responseText):r&&r(),a.onreadystatechange=new Function,a=null)},a.send(null)}}class ds{}ds.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300};ds.catchBrushException=!1;ds.debugMode=0;class Rst{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(+ds.debugMode!=0){if(+ds.debugMode==1)for(let e in arguments)throw new Error(arguments[e]);else if(+ds.debugMode>1)for(let e in arguments)console.log(arguments[e])}}}destory(){return!0}}class Dst{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Math"}sin(e,t){return window.Math.sin(t?e*this._radians:e)}cos(e,t){return window.Math.cos(t?e*this._radians:e)}degreeToRadian(e){return e*this._radians}radianToDegree(e){return e/this._radians}}class Nst{constructor(){this.ArrayCtor=typeof Float32Array>"u"?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Matrix"}create(){var e=this.ArrayCtor,t=new e(6);return this.identity(t),t}identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}mul(e,t,r){return e[0]=t[0]*r[0]+t[2]*r[1],e[1]=t[1]*r[0]+t[3]*r[1],e[2]=t[0]*r[2]+t[2]*r[3],e[3]=t[1]*r[2]+t[3]*r[3],e[4]=t[0]*r[4]+t[2]*r[5]+t[4],e[5]=t[1]*r[4]+t[3]*r[5]+t[5],e}translate(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}rotate(e,t,r){var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],h=Math.sin(r),c=Math.cos(r);return e[0]=i*c+s*h,e[1]=-i*h+s*c,e[2]=a*c+l*h,e[3]=-a*h+c*l,e[4]=c*o+h*u,e[5]=c*u-h*o,e}scale(e,t,r){var i=r[0],a=r[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e}invert(e,t){var r=t[0],i=t[2],a=t[4],o=t[1],s=t[3],l=t[5],u=r*s-o*i;return u?(u=1/u,e[0]=s*u,e[1]=-o*u,e[2]=-i*u,e[3]=r*u,e[4]=(i*l-s*a)*u,e[5]=(o*a-r*l)*u,e):null}mulVector(e,t,r){var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5];return e[0]=r[0]*i+r[1]*a+o,e[1]=r[0]*s+r[1]*l+u,e}}class cr{static SUtil_smoothBezier(e,t,r,i,a){(!a||a.length!==2)&&(a=[0,0]);var o=a,s=[],l=[],u=[],h=[],c=!!i,f,d;if(c){f=[1/0,1/0],d=[-1/0,-1/0];let p=e.length;for(let g=0;g<p;g++)cr.Util_vector.min(f,f,[e[g][0]+o[0],e[g][1]+o[1]]),cr.Util_vector.max(d,d,[e[g][0]+o[0],e[g][1]+o[1]]);cr.Util_vector.min(f,f,i[0]),cr.Util_vector.max(d,d,i[1])}let v=e.length;for(let p=0;p<v;p++){let g=[e[p][0]+o[0],e[p][1]+o[1]],m,y;if(r)m=[e[p?p-1:v-1][0]+o[0],e[p?p-1:v-1][1]+o[1]],y=[e[(p+1)%v][0]+o[0],e[(p+1)%v][1]+o[1]];else if(p===0||p===v-1){s.push([e[p][0]+o[0],e[p][1]+o[1]]);continue}else m=[e[p-1][0]+o[0],e[p-1][1]+o[1]],y=[e[p+1][0]+o[0],e[p+1][1]+o[1]];cr.Util_vector.sub(l,y,m),cr.Util_vector.scale(l,l,t);let _=cr.Util_vector.distance(g,m),x=cr.Util_vector.distance(g,y),S=_+x;S!==0&&(_/=S,x/=S),cr.Util_vector.scale(u,l,-_),cr.Util_vector.scale(h,l,x);let w=cr.Util_vector.add([],g,u),b=cr.Util_vector.add([],g,h);c&&(cr.Util_vector.max(w,w,f),cr.Util_vector.min(w,w,d),cr.Util_vector.max(b,b,f),cr.Util_vector.min(b,b,d)),s.push(w),s.push(b)}return r&&s.push(s.shift()),s}static SUtil_smoothSpline(e,t,r,i){(!i||i.length!==2)&&(i=[0,0]);var a=i,o=e.length,s=[],l=0;for(let c=1;c<o;c++)l+=cr.Util_vector.distance([e[c-1][0]+a[0],e[c-1][1]+a[1]],[e[c][0]+a[0],e[c][1]+a[1]]);var u=l/5;u=u<o?o:u;for(let c=0;c<u;c++){let f=c/(u-1)*(t?o:o-1),d=Math.floor(f),v=f-d,p,g=[e[d%o][0]+a[0],e[d%o][1]+a[1]],m,y;t?(p=[e[(d-1+o)%o][0]+a[0],e[(d-1+o)%o][1]+a[1]],m=[e[(d+1)%o][0]+a[0],e[(d+1)%o][1]+a[1]],y=[e[(d+2)%o][0]+a[0],e[(d+2)%o][1]+a[1]]):(p=[e[d===0?d:d-1][0]+a[0],e[d===0?d:d-1][1]+a[1]],m=[e[d>o-2?o-1:d+1][0]+a[0],e[d>o-2?o-1:d+1][1]+a[1]],y=[e[d>o-3?o-1:d+2][0]+a[0],e[d>o-3?o-1:d+2][1]+a[1]]);let _=v*v,x=v*_;s.push([h(p[0],g[0],m[0],y[0],v,_,x),h(p[1],g[1],m[1],y[1],v,_,x)])}return s;function h(c,f,d,v,p,g,m){var y=(d-c)*.5,_=(v-f)*.5;return(2*(f-d)+y+_)*m+(-3*(f-d)-2*y-_)*g+y*p+f}}static SUtil_dashedLineTo(e,t,r,i,a,o,s){var l=[5,5];if(o=typeof o!="number"?5:o,e.setLineDash){l[0]=o,l[1]=o,s&&s instanceof Array?e.setLineDash(s):e.setLineDash(l),e.moveTo(t,r),e.lineTo(i,a);return}var u=i-t,h=a-r,c=Math.floor(Math.sqrt(u*u+h*h)/o);u=u/c,h=h/c;for(var f=!0,d=0;d<c;++d)f?e.moveTo(t,r):e.lineTo(t,r),f=!f,t+=u,r+=h;e.lineTo(i,a)}}cr.Util_area=new Mst;cr.Util_color=new SE;cr.Util_computeBoundingBox=new Ist;cr.Util_curve=new X8;cr.Util_env=new Lst;cr.Util_event=new Pst;cr.Util_http=new Ost;cr.Util_log=new Rst;cr.Util_math=new Dst;cr.Util_matrix=new Nst;cr.Util=new Pp;cr.Util_vector=new Zne;class Y8{constructor(){this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="SuperMap.LevelRenderer.Transformable",this.lookAt=function(){var e=cr.Util_vector.create();return function(t){this.transform||(this.transform=cr.Util_matrix.create());var r=this.transform;if(cr.Util_vector.sub(e,t,this.position),i(e[0])&&i(e[1]))return;cr.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform();function i(a){var o=5e-5;return a>-o&&a<o}}}()}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){this.needLocalTransform=e(this.rotation[0])||e(this.position[0])||e(this.position[1])||e(this.scale[0]-1)||e(this.scale[1]-1);function e(t){var r=5e-5;return t>r||t<-r}}updateTransform(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,!this.needTransform)return;var e=[0,0],t=this.transform||cr.Util_matrix.create();if(cr.Util_matrix.identity(t),this.needLocalTransform){if(r(this.scale[0])||r(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;let i=r(e[0])||r(e[1]);i&&cr.Util_matrix.translate(t,t,e),cr.Util_matrix.scale(t,t,this.scale),i&&(e[0]=-e[0],e[1]=-e[1],cr.Util_matrix.translate(t,t,e))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){e[0]=-this.rotation[1]||0,e[1]=-this.rotation[2]||0;let i=r(e[0])||r(e[1]);i&&cr.Util_matrix.translate(t,t,e),cr.Util_matrix.rotate(t,t,this.rotation[0]),i&&(e[0]=-e[0],e[1]=-e[1],cr.Util_matrix.translate(t,t,e))}}else+this.rotation!=0&&cr.Util_matrix.rotate(t,t,this.rotation);(r(this.position[0])||r(this.position[1]))&&cr.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?cr.Util_matrix.mul(this.transform,this.parent.transform,this.transform):cr.Util_matrix.copy(this.transform,this.parent.transform));function r(i){var a=5e-5;return i>a||i<-a}}setTransform(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}decomposeTransform(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],r=this.position,i=this.scale,a=this.rotation;s(t-1)&&(t=Math.sqrt(t));var o=e[2]*e[2]+e[3]*e[3];s(o-1)&&(o=Math.sqrt(o)),r[0]=e[4],r[1]=e[5],i[0]=t,i[1]=o,i[2]=i[3]=0,a[0]=Math.atan2(-e[1]/o,e[0]/t),a[1]=a[2]=0;function s(l){var u=5e-5;return l>u||l<-u}}}class m0 extends Cne(JR,Y8){constructor(e){super(e),e=e||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,H.extend(this,e),this.id=this.id||H.createUniqueID("smShape_"),this.CLASS_NAME="SuperMap.LevelRenderer.Shape",this.getTansform=function(){var t=[];return function(r,i){var a=[r,i];return this.needTransform&&this.transform&&(cr.Util_matrix.invert(t,this.transform),cr.Util_matrix.mulVector(a,t,[r,i,1]),r==a[0]&&i==a[1]&&this.updateNeedTransform()),a}}()}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(e,t){var r=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,r),r.brushType){case"both":this.setCtxGlobalAlpha(e,"fill",r),e.fill(),r.lineWidth>0&&(this.setCtxGlobalAlpha(e,"stroke",r),e.stroke()),this.setCtxGlobalAlpha(e,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",r);break;default:this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r);break}this.drawText(e,r,this.style),this.afterBrush(e)}beforeBrush(e,t){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),t&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),this.brushTypeOnly=="stroke"&&(r.strokeColor=r.strokeColor||r.color),e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r}afterBrush(e){e.restore()}setContext(e,t){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],i=0,a=r.length;i<a;i++){var o=r[i][0],s=t[o],l=r[i][1];typeof s<"u"&&(e[l]=s)}}doClip(e){var t=cr.Util_matrix.create();if(this.__clipShapes)for(var r=0;r<this.__clipShapes.length;r++){var i=this.__clipShapes[r];if(i.needTransform){let a=i.transform;cr.Util_matrix.invert(t,a),e.transform(a[0],a[1],a[2],a[3],a[4],a[5])}if(e.beginPath(),i.buildPath(e,i.style),e.clip(),i.needTransform){let a=t;e.transform(a[0],a[1],a[2],a[3],a[4],a[5])}}}getHighlightStyle(e,t,r){var i={};for(let o in e)i[o]=e[o];var a=cr.Util_color.getHighlightColor();e.brushType!="stroke"?(i.strokeColor=a,i.lineWidth=e.lineWidth||1,i.brushType="both"):r!="stroke"?(i.strokeColor=a,i.lineWidth=e.lineWidth||1):i.strokeColor=t.strokeColor||cr.Util_color.mix(e.strokeColor,cr.Util_color.toRGB(a));for(let o in t)typeof t[o]<"u"&&(i[o]=t[o]);return i}getHighlightZoom(){return this.type!="text"?6:2}drift(e,t){this.position[0]+=e,this.position[1]+=t}buildPath(e,t){cr.Util_log("buildPath not implemented in "+this.type)}getRect(e){cr.Util_log("getRect not implemented in "+this.type)}isCover(e,t){var r=this.getTansform(e,t);e=r[0],t=r[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?cr.Util_area.isInside(this,this.style,e,t):!1}drawText(e,t,r){if(!(typeof t.text>"u"||t.text===!1)){var i=t.textColor||t.color||t.strokeColor;e.fillStyle=i;var a=10,o,s,l,u,h=t.textPosition||this.textPosition||"top",c=[];switch(!this.refOriginalPosition||this.refOriginalPosition.length!==2?c=[0,0]:c=this.refOriginalPosition,h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var f=(r||t).__rect||this.getRect(r||t);switch(h){case"inside":l=f.x+f.width/2,u=f.y+f.height/2,o="center",s="middle",t.brushType!="stroke"&&i==t.color&&(e.fillStyle="#fff");break;case"left":l=f.x-a,u=f.y+f.height/2,o="end",s="middle";break;case"right":l=f.x+f.width+a,u=f.y+f.height/2,o="start",s="middle";break;case"top":l=f.x+f.width/2,u=f.y-a,o="center",s="bottom";break;case"bottom":l=f.x+f.width/2,u=f.y+f.height+a,o="center",s="top";break}}break;case"start":case"end":var d=0,v=0,p=0,g=0;if(typeof t.pointList<"u"){var m=t.pointList;if(m.length<2)return;var y=m.length;switch(h){case"start":d=m[0][0]+c[0],v=m[1][0]+c[0],p=m[0][1]+c[1],g=m[1][1]+c[1];break;case"end":d=m[y-2][0]+c[0],v=m[y-1][0]+c[0],p=m[y-2][1]+c[1],g=m[y-1][1]+c[1];break}}else d=t.xStart+c[0]||0,v=t.xEnd+c[0]||0,p=t.yStart+c[1]||0,g=t.yEnd+c[1]||0;switch(h){case"start":o=d<v?"end":"start",s=p<g?"bottom":"top",l=d,u=p;break;case"end":o=d<v?"start":"end",s=p<g?"top":"bottom",l=v,u=g;break}a-=4,d&&v&&d!=v?l-=o=="end"?a:-a:o="center",p!=g?u-=s=="bottom"?a:-a:s="middle";break;case"specific":l=t.textX||0,u=t.textY||0,o="start",s="middle";break}t.labelXOffset&&!isNaN(t.labelXOffset)&&(l+=t.labelXOffset),t.labelYOffset&&!isNaN(t.labelYOffset)&&(u+=t.labelYOffset),l!=null&&u!=null&&m0._fillText(e,t.text,l,u,t.textFont,t.textAlign||o,t.textBaseline||s)}}modSelf(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)}isSilent(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)}setCtxGlobalAlpha(e,t,r){t==="fill"?e.globalAlpha=typeof r.fillOpacity>"u"?typeof r.opacity>"u"?1:r.opacity:r.fillOpacity:t==="stroke"?e.globalAlpha=typeof r.strokeOpacity>"u"?typeof r.opacity>"u"?1:r.opacity:r.strokeOpacity:e.globalAlpha=typeof r.opacity>"u"?1:r.opacity}static _fillText(e,t,r,i,a,o,s){a&&(e.font=a),e.textAlign=o,e.textBaseline=s;var l=m0._getTextRect(t,r,i,a,o,s);t=(t+"").split(`
`);var u=cr.Util_area.getTextHeight("ZH",a);switch(s){case"top":i=l.y;break;case"bottom":i=l.y+u;break;default:i=l.y+u/2}for(var h=0,c=t.length;h<c;h++)e.fillText(t[h],r,i),i+=u}static _getTextRect(e,t,r,i,a,o){var s=cr.Util_area.getTextWidth(e,i),l=cr.Util_area.getTextHeight("ZH",i);switch(e=(e+"").split(`
`),a){case"end":case"right":t-=s;break;case"center":t-=s/2;break}switch(o){case"top":break;case"bottom":r-=l*e.length;break;default:r-=l*e.length/2}return{x:t,y:r,width:s,height:l*e.length}}}class LK extends m0{constructor(e){super(e),this.type="smicpoint",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.arc(t.x+r[0],t.y+r[1],t.r,0,Math.PI*2,!0)}getRect(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;if(e.__rect)return e.__rect;var r;return e.brushType=="stroke"||e.brushType=="fill"?r=e.lineWidth||1:r=0,e.__rect={x:Math.round(e.x+t[0]-e.r-r/2),y:Math.round(e.y+t[1]-e.r-r/2),width:e.r*2+r,height:e.r*2+r},e.__rect}}class FNe extends m0{constructor(e){super(e),this.type="smictext",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicText"}destroy(){this.type=null,super.destroy()}brush(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=this.style;if(t&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),!(typeof i.text>"u"||i.text===!1)){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var a=(i.text+"").split(`
`),o=cr.Util_area.getTextHeight("ZH",i.textFont),s=this.getRectNoRotation(i),l=i.x+r[0],u;i.textBaseline=="top"?u=s.y:i.textBaseline=="bottom"?u=s.y+o:u=s.y+o/2;for(var h=i.x+r[0],c=i.y+r[1],f=0,d=a.length;f<d;f++){switch(i.labelRect&&(e.fillRect(s.x-2,s.y,s.width+4,s.height),e.fillStyle=i.strokeColor,e.strokeRect(s.x-2,s.y,s.width+4,s.height),e.fillStyle=i.textColor),i.brushType){case"stroke":this.setCtxGlobalAlpha(e,"stroke",i),i.textRotation&&i.textRotation!==0?(e.save(),e.translate(h,c),e.rotate(i.textRotation*Math.PI/180),i.textBaseline=="top"?i.maxWidth?e.strokeText(a[f],0,o*f,i.maxWidth):e.strokeText(a[f],0,o*f):i.textBaseline=="bottom"?i.maxWidth?e.strokeText(a[f],0,o*(f+1)-s.height,i.maxWidth):e.strokeText(a[f],0,o*(f+1)-s.height):i.maxWidth?e.strokeText(a[f],0,o*(f+1)-s.height/2-o/2,i.maxWidth):e.strokeText(a[f],0,o*(f+1)-s.height/2-o/2),e.restore()):i.maxWidth?e.strokeText(a[f],l,u,i.maxWidth):e.strokeText(a[f],l,u),this.setCtxGlobalAlpha(e,"reset",i);break;case"both":i.textRotation&&i.textRotation!==0?(e.save(),e.translate(h,c),e.rotate(i.textRotation*Math.PI/180),i.textBaseline=="top"?i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],0,o*f,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],0,o*f,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],0,o*f),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],0,o*f),this.setCtxGlobalAlpha(e,"reset",i)):i.textBaseline=="bottom"?i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],0,o*(f+1)-s.height,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],0,o*(f+1)-s.height,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],0,o*(f+1)-s.height),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],0,o*(f+1)-s.height),this.setCtxGlobalAlpha(e,"reset",i)):i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],0,o*(f+1)-s.height/2-o/2,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],0,o*(f+1)-s.height/2-o/2,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],0,o*(f+1)-s.height/2-o/2),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],0,o*(f+1)-s.height/2-o/2),this.setCtxGlobalAlpha(e,"reset",i)),e.restore()):i.maxWidth?(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],l,u,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],l,u,i.maxWidth),this.setCtxGlobalAlpha(e,"reset",i)):(this.setCtxGlobalAlpha(e,"fill",i),e.fillText(a[f],l,u),this.setCtxGlobalAlpha(e,"reset",i),this.setCtxGlobalAlpha(e,"stroke",i),e.strokeText(a[f],l,u),this.setCtxGlobalAlpha(e,"reset",i));break;default:this.setCtxGlobalAlpha(e,"fill",i),i.textRotation&&i.textRotation!==0?(e.save(),e.translate(h,c),e.rotate(i.textRotation*Math.PI/180),i.textBaseline=="top"?i.maxWidth?e.fillText(a[f],0,o*f,i.maxWidth):e.fillText(a[f],0,o*f):i.textBaseline=="bottom"?i.maxWidth?e.fillText(a[f],0,o*(f+1)-s.height,i.maxWidth):e.fillText(a[f],0,o*(f+1)-s.height):i.maxWidth?e.fillText(a[f],0,o*(f+1)-s.height/2-o/2,i.maxWidth):e.fillText(a[f],0,o*(f+1)-s.height/2-o/2),e.restore()):i.maxWidth?e.fillText(a[f],l,u,i.maxWidth):e.fillText(a[f],l,u),this.setCtxGlobalAlpha(e,"reset",i)}u+=o}e.restore()}}getRect(e){if(e.__rect)return e.__rect;for(var t,r,i,a,o=this.getTextBackground(e,!0),s=0,l=o.length;s<l;s++){var u=o[s];s==0?(t=u[0],i=u[0],r=u[1],a=u[1]):(u[0]<t&&(t=u[0]),u[0]>i&&(i=u[0]),u[1]<r&&(r=u[1]),u[1]>a&&(a=u[1]))}return e.__rect={x:t,y:r,width:i-t,height:a-r},e.__rect}getRectNoRotation(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=cr.Util_area.getTextHeight("ZH",e.textFont),i=cr.Util_area.getTextWidth(e.text,e.textFont),a=cr.Util_area.getTextHeight(e.text,e.textFont),o=e.x+t[0];e.textAlign=="end"||e.textAlign=="right"?o-=i:e.textAlign=="center"&&(o-=i/2);var s;e.textBaseline=="top"?s=e.y+t[1]:e.textBaseline=="bottom"?s=e.y+t[1]-a:s=e.y+t[1]-a/2;var l=!1,u;if(e.maxWidth){var h=parseInt(e.maxWidth);h<i&&(u=i,l=!0,i=h),o=e.x+t[0],e.textAlign=="end"||e.textAlign=="right"?o-=i:e.textAlign=="center"&&(o-=i/2)}if(e.textFont){var c=e.textFont,f=c.toLowerCase();f.indexOf("italic")>-1&&(l===!0?i+=r/3*(i/u):i+=r/3)}var d={x:o,y:s,width:i,height:a};return d}getTextBackground(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var i=this.getRectNoRotation(e),a=e.x+r[0],o=e.y+r[1],s=[];if(e.textRotation&&e.textRotation!==0){let l=e.textRotation,u=this.getRotatedLocation(i.x,i.y,a,o,l),h=this.getRotatedLocation(i.x+i.width,i.y,a,o,l),c=this.getRotatedLocation(i.x+i.width,i.y+i.height,a,o,l),f=this.getRotatedLocation(i.x,i.y+i.height,a,o,l);s.push(u),s.push(h),s.push(c),s.push(f)}else{let l=[i.x,i.y],u=[i.x+i.width,i.y],h=[i.x+i.width,i.y+i.height],c=[i.x,i.y+i.height];s.push(l),s.push(u),s.push(h),s.push(c)}return e.__textBackground=s,e.__textBackground}getRotatedLocation(e,t,r,i,a){var o=new Array,s,l;return t=-t,i=-i,a=-a,s=(e-r)*Math.cos(a/180*Math.PI)-(t-i)*Math.sin(a/180*Math.PI)+r,l=(e-r)*Math.sin(a/180*Math.PI)+(t-i)*Math.cos(a/180*Math.PI)+i,o[0]=s,o[1]=-l,o}}class kst extends m0{constructor(e){super(e),this.type="smiccircle",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.x+r[0],a=t.y+r[1];return e.moveTo(i+t.r,a),e.arc(i,a,t.r,0,Math.PI*2,!0),!0}getRect(e){if(e.__rect)return e.__rect;(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=e.x+t[0],i=e.y+t[1],a=e.r,o;return e.brushType=="stroke"||e.brushType=="fill"?o=e.lineWidth||1:o=0,e.__rect={x:Math.round(r-a-o/2),y:Math.round(i-a-o/2),width:a*2+o,height:a*2+o},e.__rect}}class Kne extends m0{constructor(e){super(e),this.type="smicpolygon",this.holePolygonPointLists=null,(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.style;t&&(r=this.getHighlightStyle(r,this.highlightStyle||{})),e.save(),this.setContext(e,r),this.setTransform(e);var i=!1;(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType>"u")&&(e.beginPath(),r.lineType=="dashed"||r.lineType=="dotted"||r.lineType=="dot"||r.lineType=="dash"||r.lineType=="dashdot"||r.lineType=="longdash"||r.lineType=="longdashdot"?this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(e,r),i=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)),r.lineWidth>0&&(r.brushType=="stroke"||r.brushType=="both")&&(i||(e.beginPath(),this.buildPath(e,r)),this.setCtxGlobalAlpha(e,"stroke",r),e.stroke(),this.setCtxGlobalAlpha(e,"reset",r)),this.drawText(e,r,this.style);var a=H.cloneObject(r);if(a.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,l=0;l<s;l++){var u=o[l];a.pointList=u,e.globalCompositeOperation="destination-out",i=!1,(a.brushType=="fill"||a.brushType=="both"||typeof a.brushType>"u")&&(e.beginPath(),a.lineType=="dashed"||a.lineType=="dotted"||a.lineType=="dot"||a.lineType=="dash"||a.lineType=="dashdot"||a.lineType=="longdash"||a.lineType=="longdashdot"?this.buildPath(e,{lineType:"solid",lineWidth:a.lineWidth,pointList:a.pointList}):(this.buildPath(e,a),i=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",a),e.fill(),this.setCtxGlobalAlpha(e,"reset",a)),a.lineWidth>0&&(a.brushType=="stroke"||a.brushType=="both")?(i||(e.beginPath(),this.buildPath(e,a)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",a),e.stroke(),this.setCtxGlobalAlpha(e,"reset",a)):e.globalCompositeOperation="source-over"}e.restore()}buildPath(e,t){t.showShadow&&(e.shadowBlur=t.shadowBlur,e.shadowColor=t.shadowColor,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY),(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.pointList;if(!(i.length<2)){if(t.smooth&&t.smooth!=="spline"){var a=cr.SUtil_smoothBezier(i,t.smooth,!0,t.smoothConstraint,r);e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(var o,s,l,u=i.length,h=0;h<u;h++)o=a[h*2],s=a[h*2+1],l=[i[(h+1)%u][0]+r[0],i[(h+1)%u][1]+r[1]],e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}else if(t.smooth==="spline"&&(i=cr.SUtil_smoothSpline(i,!0,null,r)),!t.lineType||t.lineType=="solid"){e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let c=1;c<i.length;c++)e.lineTo(i[c][0]+r[0],i[c][1]+r[1]);e.lineTo(i[0][0]+r[0],i[0][1]+r[1])}else if(t.lineType==="dashed"||t.lineType==="dotted"||t.lineType==="dot"||t.lineType==="dash"||t.lineType==="longdash"){let c=t._dashLength||(t.lineWidth||1)*(t.lineType=="dashed"?5:1);t._dashLength=c;let f=t.lineWidth||1,d=f,v=f;t.lineType==="dashed"&&(d*=5,v*=5,t.lineCap&&t.lineCap!=="butt"&&(d-=f,v+=f)),t.lineType==="dotted"&&t.lineCap&&t.lineCap!=="butt"&&(d=1,v+=f),t.lineType==="dot"&&(v*=4,t.lineCap&&t.lineCap!=="butt"&&(d=1,v+=f)),t.lineType==="dash"&&(d*=4,v*=4,t.lineCap&&t.lineCap!=="butt"&&(d-=f,v+=f)),t.lineType==="longdash"&&(d*=8,v*=4,t.lineCap&&t.lineCap!=="butt"&&(d-=f,v+=f)),e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let p=1;p<i.length;p++)cr.SUtil_dashedLineTo(e,i[p-1][0]+r[0],i[p-1][1]+r[1],i[p][0]+r[0],i[p][1]+r[1],f,[d,v]);cr.SUtil_dashedLineTo(e,i[i.length-1][0]+r[0],i[i.length-1][1]+r[1],i[0][0]+r[0],i[0][1]+r[1],f,[d,v])}else if(t.lineType==="dashdot"||t.lineType==="longdashdot"){let c=t._dashLength||(t.lineWidth||1)*(t.lineType=="dashed"?5:1);t._dashLength=c;let f=t.lineWidth||1,d=f,v=f,p=f,g=f;t.lineType==="dashdot"&&(d*=4,v*=4,g*=4,t.lineCap&&t.lineCap!=="butt"&&(d-=f,v+=f,p=1,g+=f)),t.lineType==="longdashdot"&&(d*=8,v*=4,g*=4,t.lineCap&&t.lineCap!=="butt"&&(d-=f,v+=f,p=1,g+=f)),e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let m=1;m<i.length;m++)cr.SUtil_dashedLineTo(e,i[m-1][0]+r[0],i[m-1][1]+r[1],i[m][0]+r[0],i[m][1]+r[1],f,[d,v,p,g]);cr.SUtil_dashedLineTo(e,i[i.length-1][0]+r[0],i[i.length-1][1]+r[1],i[0][0]+r[0],i[0][1]+r[1],f,[d,v,p,g])}}}getRect(e,t){var r;if(t?r=t:((!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),r=this.refOriginalPosition),e.__rect)return e.__rect;for(var i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=Number.MAX_VALUE,s=Number.MIN_VALUE,l=e.pointList,u=0,h=l.length;u<h;u++)l[u][0]+r[0]<i&&(i=l[u][0]+r[0]),l[u][0]+r[0]>a&&(a=l[u][0]+r[0]),l[u][1]+r[1]<o&&(o=l[u][1]+r[1]),l[u][1]+r[1]>s&&(s=l[u][1]+r[1]);var c;return e.brushType=="stroke"||e.brushType=="fill"?c=e.lineWidth||1:c=0,e.__rect={x:Math.round(i-c/2),y:Math.round(o-c/2),width:a-i+c,height:s-o+c},e.__rect}}class BNe extends m0{constructor(e){super(e),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.pointList;if(!(i.length<2)){var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var o=cr.SUtil_smoothBezier(i,t.smooth,!1,t.smoothConstraint,r);e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);var s,l,u;for(let c=0;c<a-1;c++)s=o[c*2],l=o[c*2+1],u=[i[c+1][0]+r[0],i[c+1][1]+r[1]],e.bezierCurveTo(s[0],s[1],l[0],l[1],u[0],u[1])}else if(t.smooth==="spline"&&(i=cr.SUtil_smoothSpline(i,null,null,r),a=i.length),!t.lineType||t.lineType==="solid"){e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let c=1;c<a;c++)e.lineTo(i[c][0]+r[0],i[c][1]+r[1])}else if(t.lineType==="dashed"||t.lineType==="dotted"||t.lineType==="dot"||t.lineType==="dash"||t.lineType==="longdash"){let c=t.lineWidth||1,f=c,d=c;t.lineType==="dashed"&&(f*=5,d*=5,t.lineCap&&t.lineCap!=="butt"&&(f-=c,d+=c)),t.lineType==="dotted"&&t.lineCap&&t.lineCap!=="butt"&&(f=1,d+=c),t.lineType==="dot"&&(d*=4,t.lineCap&&t.lineCap!=="butt"&&(f=1,d+=c)),t.lineType==="dash"&&(f*=4,d*=4,t.lineCap&&t.lineCap!=="butt"&&(f-=c,d+=c)),t.lineType==="longdash"&&(f*=8,d*=4,t.lineCap&&t.lineCap!=="butt"&&(f-=c,d+=c)),e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(var h=1;h<a;h++)cr.SUtil_dashedLineTo(e,i[h-1][0]+r[0],i[h-1][1]+r[1],i[h][0]+r[0],i[h][1]+r[1],c,[f,d])}else if(t.lineType==="dashdot"||t.lineType==="longdashdot"){let c=t.lineWidth||1,f=c,d=c,v=c,p=c;t.lineType==="dashdot"&&(f*=4,d*=4,p*=4,t.lineCap&&t.lineCap!=="butt"&&(f-=c,d+=c,v=1,p+=c)),t.lineType==="longdashdot"&&(f*=8,d*=4,p*=4,t.lineCap&&t.lineCap!=="butt"&&(f-=c,d+=c,v=1,p+=c)),c=(t.lineWidth||1)*(t.lineType==="dashed"?5:1),e.moveTo(i[0][0]+r[0],i[0][1]+r[1]);for(let g=1;g<a;g++)cr.SUtil_dashedLineTo(e,i[g-1][0]+r[0],i[g-1][1]+r[1],i[g][0]+r[0],i[g][1]+r[1],c,[f,d,v,p])}}}getRect(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;return Kne.prototype.getRect.apply(this,[e,t])}}class My extends m0{constructor(e){super(e),this.type="smicimage",this._imageCache={},(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicImage"}destroy(){this.type=null,this._imageCache=null,super.destroy()}brush(e,t,r){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,a=this.style||{};t&&(a=this.getHighlightStyle(a,this.highlightStyle||{}));var o=a.image,s=this;if(typeof o=="string"){var l=o;this._imageCache[l]?o=this._imageCache[l]:(o=new Image,o.onload=function(){o.onload=null,clearTimeout(My._refreshTimeout),My._needsRefresh.push(s),My._refreshTimeout=setTimeout(function(){r&&r(My._needsRefresh),My._needsRefresh=[]},10)},o.src=l,this._imageCache[l]=o)}if(o){if(o.nodeName.toUpperCase()=="IMG"){if(window.ActiveXObject){if(o.readyState!="complete")return}else if(!o.complete)return}var u=a.width||o.width,h=a.height||o.height,c=a.x+i[0],f=a.y+i[1];if(!o.width||!o.height)return;if(e.save(),this.doClip(e),this.setContext(e,a),this.setTransform(e),a.sWidth&&a.sHeight){let p=a.sx+i[0]||0,g=a.sy+i[1]||0;e.drawImage(o,p,g,a.sWidth,a.sHeight,c,f,u,h)}else if(a.sx&&a.sy){let p=a.sx+i[0],g=a.sy+i[1];var d=u-p,v=h-g;e.drawImage(o,p,g,d,v,c,f,u,h)}else e.drawImage(o,c,f,u,h);a.width||(a.width=u),a.height||(a.height=h),this.style.width||(this.style.width=u),this.style.height||(this.style.height=h),this.drawText(e,a,this.style),e.restore()}}getRect(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;return{x:e.x+t[0],y:e.y+t[1],width:e.width,height:e.height}}clearCache(){this._imageCache={}}}My._needsRefresh=[];My._refreshTimeout=null;class GNe extends m0{constructor(e){super(e),this.type="smicrectangle",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicRectangle"}destroy(){this.type=null,super.destroy()}_buildRadiusPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.x+r[0],a=t.y+r[1],o=t.width,s=t.height,l=t.radius,u,h,c,f;typeof l=="number"?u=h=c=f=l:l instanceof Array?l.length===1?u=h=c=f=l[0]:l.length===2?(u=c=l[0],h=f=l[1]):l.length===3?(u=l[0],h=f=l[1],c=l[2]):(u=l[0],h=l[1],c=l[2],f=l[3]):u=h=c=f=0;var d;u+h>o&&(d=u+h,u*=o/d,h*=o/d),c+f>o&&(d=c+f,c*=o/d,f*=o/d),h+c>s&&(d=h+c,h*=s/d,c*=s/d),u+f>s&&(d=u+f,u*=s/d,f*=s/d),e.moveTo(i+u,a),e.lineTo(i+o-h,a),h!==0&&e.quadraticCurveTo(i+o,a,i+o,a+h),e.lineTo(i+o,a+s-c),c!==0&&e.quadraticCurveTo(i+o,a+s,i+o-c,a+s),e.lineTo(i+f,a+s),f!==0&&e.quadraticCurveTo(i,a+s,i,a+s-f),e.lineTo(i,a+u),u!==0&&e.quadraticCurveTo(i,a,i+u,a)}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+r[0],t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1])),e.closePath()}getRect(e){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition;if(e.__rect)return e.__rect;var r;return e.brushType=="stroke"||e.brushType=="fill"?r=e.lineWidth||1:r=0,e.__rect={x:Math.round(e.x+t[0]-r/2),y:Math.round(e.y+t[1]-r/2),width:e.width+r,height:e.height+r},e.__rect}}class Fst extends m0{constructor(e){super(e),this.type="smicsector",(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(e,t){(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,i=t.x+r[0],a=t.y+r[1],o=t.r0||0,s=t.r,l=t.startAngle,u=t.endAngle,h=t.clockWise||!1;l=cr.Util_math.degreeToRadian(l),u=cr.Util_math.degreeToRadian(u),h||(l=-l,u=-u);var c=cr.Util_math.cos(l),f=cr.Util_math.sin(l);e.moveTo(c*o+i,f*o+a),e.lineTo(c*s+i,f*s+a),e.arc(i,a,s,l,u,!h),e.lineTo(cr.Util_math.cos(u)*o+i,cr.Util_math.sin(u)*o+a),o!==0&&e.arc(i,a,o,u,l,h),e.closePath()}getRect(e){if(e.__rect)return e.__rect;(!this.refOriginalPosition||this.refOriginalPosition.length!==2)&&(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=cr.Util_vector.create(),i=cr.Util_vector.create(),a=cr.Util_vector.create(),o=cr.Util_vector.create(),s=e.x+t[0],l=e.y+t[1],u=e.r0||0,h=e.r,c=cr.Util_math.degreeToRadian(e.startAngle),f=cr.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(c=-c,f=-f),u>1?cr.Util_computeBoundingBox.arc(s,l,u,c,f,!d,r,a):(r[0]=a[0]=s,r[1]=a[1]=l),cr.Util_computeBoundingBox.arc(s,l,h,c,f,!d,i,o),cr.Util_vector.min(r,r,i),cr.Util_vector.max(a,a,o),e.__rect={x:r[0],y:r[1],width:a[0]-r[0],height:a[1]-r[1]},e.__rect}}class Vn{constructor(e){this.shapeParameters=e,this.CLASS_NAME="SuperMap.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(e){if(e&&(this.shapeParameters=e),!this.shapeParameters)return null;var t=this.shapeParameters;if(t instanceof Fz){let r=new Object;r.x=t.x,r.y=t.y,r.r=t.r,r=H.copyAttributesWithClip(r,t.style,["x","y"]);let i=new LK;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","style","highlightStyle"]),i}else if(t instanceof VO){if(!t.pointList)return null;let r=new Object;r.pointList=t.pointList,r=H.copyAttributesWithClip(r,t.style,["pointList"]);let i=new BNe;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}else if(t instanceof I1){if(!t.pointList)return null;let r=new Object;r.pointList=t.pointList,r=H.copyAttributesWithClip(r,t.style,["pointList"]);let i=new Kne;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}else if(t instanceof IK){if(!t.x&&!t.y&!t.width&!t.height)return null;let r=new Object;r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height,r=H.copyAttributesWithClip(r,t.style,["x","y","width","height"]);let i=new GNe;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","width","height","style","highlightStyle"]),i}else if(t instanceof Bz){let r=new Object;r.x=t.x,r.y=t.y,r.r=t.r,r.startAngle=t.startAngle,r.endAngle=t.endAngle,t.r0&&(r.r0=t.r0),t.clockWise&&(r.clockWise=t.clockWise),r=H.copyAttributesWithClip(r,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new Fst;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}else if(t instanceof Ib){let r=new Object;r.x=t.x,r.y=t.y,r.text=t.text,r=H.copyAttributesWithClip(r,t.style,["x","y","text"]);let i=new FNe;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","text","style","highlightStyle"]),i}else if(t instanceof kNe){let r=new Object;r.x=t.x,r.y=t.y,t.image&&(r.image=t.image),t.width&&(r.width=t.width),t.height&&(r.height=t.height),t.sx&&(r.sx=t.sx),t.sy&&(r.sy=t.sy),t.sWidth&&(r.sWidth=t.sWidth),t.sHeight&&(r.sHeight=t.sHeight),r=H.copyAttributesWithClip(r,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new My;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","image","width","height","style","highlightStyle"]),i}else if(t instanceof qne){let r=new Object;r.x=t.x,r.r=t.r,r.y=t.y,r=H.copyAttributesWithClip(r,t.style,["x","y","r"]);let i=new kst;return i.style=Vn.transformStyle(r),i.highlightStyle=Vn.transformStyle(t.highlightStyle),H.copyAttributesWithClip(i,t,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(e){var t={},r=["normal","normal","normal","12","arial,sans-serif"],i=[!0,!1];for(var a in e)switch(a){case"fill":i[0]=e[a];break;case"fillColor":t.color=e[a];break;case"stroke":i[1]=e[a];break;case"strokeWidth":t.lineWidth=e[a];break;case"strokeLinecap":t.lineCap=e[a];break;case"strokeLineJoin":t.lineJoin=e[a];break;case"strokeDashstyle":t.lineType=e[a];break;case"pointRadius":t.r=e[a];break;case"label":t.text=e[a];break;case"labelRect":t.labelRect=e[a];break;case"fontColor":t.textColor=e[a];break;case"fontStyle":r[0]=e[a];break;case"fontVariant":r[1]=e[a];break;case"fontWeight":r[2]=e[a];break;case"fontSize":var o="";e[a]&&e[a].toString().indexOf("px")<0&&(o="px"),r[3]=e[a]+o;break;case"fontFamily":r[4]=e[a];break;case"fontOpacity":t.opacity=e[a];break;case"labelPosition":t.textPosition=e[a];break;case"labelAlign":t.textAlign=e[a];break;case"labelBaseline":t.textBaseline=e[a];break;case"labelRotation":t.textRotation=e[a];break;default:t[a]=e[a];break}return t.textFont=r.join(" "),i[0]===!0&&i[1]===!1?t.brushType="fill":i[0]===!1&&i[1]===!0?t.brushType="stroke":i[0]===!0&&i[1]===!0?t.brushType="both":t.brushType="fill",t.lineWidth==null&&(t.lineWidth=1),t}static Background(e,t,r){var i=r||{},a=new IK(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return a.style={fillColor:"#f3f3f3"},i.backgroundStyle&&H.copyAttributesWithClip(a.style,i.backgroundStyle),i.backgroundRadius&&(a.style.radius=i.backgroundRadius),a.clickable=!1,a.hoverable=!1,e.createShape(a)}static GraphAxis(e,t,r,i){var a=t,o=r||{},s=[],l=[],u=o.useXReferenceLine?o.useXReferenceLine:!1,h=o.axisYTick&&!isNaN(o.axisYTick)?o.axisYTick:0,c=[],f=[],d=[];if(h==0){if(d.push([a[0],a[3]-5]),d.push([a[0],a[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let D=parseInt(o.axis3DParameter),G=[a[0]-D,a[1]+D];o.axisUseArrow?(f.push([G[0]+1.5,G[1]-7.5]),f.push([G[0]-1,G[1]+1]),f.push([G[0]+7.5,G[1]-1.5]),d.push([G[0],G[1]])):d.push([G[0],G[1]]),d.push([a[0],a[1]])}d.push([a[2]+5,a[1]])}else{var v=Math.abs(a[1]-a[3])/h,p=a[3];d.push([a[0],p-5]);for(var g=0;g<h;g++){if(d.push([a[0],p]),d.push([a[0]-5,p]),d.push([a[0],p]),u){var m=new VO([[a[0],p],[a[2],p]]);m.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},m.clickable=!1,m.hoverable=!1,o.xReferenceLineStyle&&H.copyAttributesWithClip(m.style,o.xReferenceLineStyle),s.push(e.createShape(m))}p+=v}if(d.push([a[0],a[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let D=parseInt(o.axis3DParameter),G=[a[0]-D,a[1]+D];o.axisUseArrow?(f.push([G[0]+1.5,G[1]-7.5]),f.push([G[0]-1,G[1]+1]),f.push([G[0]+7.5,G[1]-1.5]),d.push([G[0],G[1]])):d.push([G[0],G[1]]),d.push([a[0],a[1]])}d.push([a[2]+5,a[1]])}if(o.axisUseArrow){var y=[[a[2]+5,a[1]+4],[a[2]+13,a[1]],[a[2]+5,a[1]-4]],_=[[a[0]-4,a[3]-5],[a[0],a[3]-13],[a[0]+4,a[3]-5]],x=new I1(y);x.style={fillColor:"#008acd"},H.copyAttributesWithClip(x.style,o.axisStyle),l.push(e.createShape(x));var S=new I1(_);if(S.style={fillColor:"#008acd"},H.copyAttributesWithClip(S.style,o.axisStyle),l.push(e.createShape(S)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var w=new I1(f);w.style={fillColor:"#008acd"},H.copyAttributesWithClip(w.style,o.axisStyle),l.push(e.createShape(w))}}c=d;var b=new VO(c);b.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&H.copyAttributesWithClip(b.style,o.axisStyle),b.clickable=!1,b.hoverable=!1;var E=[e.createShape(b)],T=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var C=o.axisYLabels;let D=C.length;var A=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(A=o.axisYLabelsOffset),D==1){let G=new Ib(a[0]-5+A[0],a[3]+A[1],C[0]);G.style={labelAlign:"right"},o.axisYLabelsStyle&&H.copyAttributesWithClip(G.style,o.axisYLabelsStyle),G.clickable=!1,G.hoverable=!1,T.push(e.createShape(G))}else for(var M=a[3],I=Math.abs(a[1]-a[3])/(D-1),R=0;R<D;R++){let G=new Ib(a[0]-5+A[0],M+A[1],C[R]);G.style={labelAlign:"right"},o.axisYLabelsStyle&&H.copyAttributesWithClip(G.style,o.axisYLabelsStyle),G.clickable=!1,G.hoverable=!1,T.push(e.createShape(G)),M+=I}}var k=[];if(o.axisXLabels&&o.axisXLabels.length&&o.axisXLabels.length>0){let D=o.axisXLabels,G=D.length,W=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(W=o.axisXLabelsOffset),i&&i.xPositions&&i.xPositions.length&&i.xPositions.length==G){let z=i.xPositions;for(let V=0;V<G;V++){let q=new Ib(z[V]+W[0],a[1]+W[1],D[V]);q.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&H.copyAttributesWithClip(q.style,o.axisXLabelsStyle),q.clickable=!1,q.hoverable=!1,k.push(e.createShape(q))}}else if(G==1){let z=new Ib(a[0]-5+W[0],a[1]+W[0],D[0]);z.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&H.copyAttributesWithClip(z.style,o.axisXLabelsStyle),z.clickable=!1,z.hoverable=!1,k.push(e.createShape(z))}else{let z=a[0],V=Math.abs(a[2]-a[0])/(G-1);for(let q=0;q<G;q++){let Y=new Ib(z+W[0],a[1]+W[1],D[q]);Y.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&H.copyAttributesWithClip(Y.style,o.axisXLabelsStyle),Y.clickable=!1,Y.hoverable=!1,k.push(e.createShape(Y)),z+=V}}}return s.concat(E).concat(T).concat(k).concat(l)}static ShapeStyleTool(e,t,r,i,a,o){var s=e||{};if(t&&H.copyAttributesWithClip(s,t),r&&r.length&&typeof a<"u"&&!isNaN(a)&&a>=0&&r[a]&&H.copyAttributesWithClip(s,r[a]),i&&i.length&&typeof o<"u"){for(var l=i,u=l.length,h=parseFloat(o),c=0;c<u;c++)if(l[c].start<=h&&h<l[c].end){H.copyAttributesWithClip(s,l[c].style);break}}return s}}class am{constructor(e,t){!e||!t||!t.map||!t.renderer||(this.id=H.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=null,this.location=[],this.data=e,this.shapes=[],this.layer=t,this.CLASS_NAME="SuperMap.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}getLocalXY(e){var t=this.layer.map.getResolution(),r=this.layer.map.getExtent();if(e instanceof Ki||e instanceof O_){let i=e.x/t+-r.left/t,a=r.top/t-e.y/t;return[i,a]}else if(e instanceof vd){let i=e.lon/t+-r.left/t,a=r.top/t-e.lat/t;return[i,a]}else return null}}class mw extends am{constructor(e,t,r,i,a,o){super(e,t,r,i,a,o),this.shapeFactory=new Vn,this.shapeParameters=null,this.RelativeCoordinate=!1,this.setting=null,this.origonPoint=null,this.chartBox=null,this.chartBounds=null,this.width=null,this.height=null,this.XOffset=0,this.YOffset=0,this.DVBParameter=null,this.dataViewBox=null,this.DVBCodomain=null,this.DVBCenterPoint=null,this.DVBUnitValue=null,this.DVBOrigonPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.origonPointOffset=null,this.fields=r||[],this.dataValues=null,a?this.lonlat=a:this.lonlat=this.data.geometry.getBounds().getCenterLonLat(),i&&i.width&&i.height&&i.codomain&&(this.setting=i),this.CLASS_NAME="SuperMap.Feature.Theme.Graph"}destroy(){this.shapeFactory=null,this.shapeParameters=null,this.width=null,this.height=null,this.origonPoint=null,this.chartBox=null,this.dataViewBox=null,this.chartBounds=null,this.DVBParameter=null,this.DVBOrigonPoint=null,this.DVBCenterPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.DVBCodomain=null,this.DVBUnitValue=null,this.origonPointOffset=null,this.XOffset=null,this.YOffset=null,this.fields=null,this.dataValues=null,this.setting=null,super.destroy()}initBaseParameter(){var e=!0;if(!this.setting)return!1;var t=this.setting;if(!(t.width&&t.height&&t.codomain))return!1;var r=typeof t.decimalNumber<"u"&&!isNaN(t.decimalNumber)?t.decimalNumber:-1,i=am.getDataValues(this.data,this.fields,r);this.dataValues=i||[],this.width=parseFloat(t.width),this.height=parseFloat(t.height),this.DVBCodomain=t.codomain,this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var a=this.width,o=this.height,s=this.location;this.origonPoint=[s[0]-a/2,s[1]-o/2];var l=this.origonPoint;this.chartBox=[l[0],l[1]+o,l[0]+a,l[1]];var u=this.chartBox,h=this.DVBParameter;this.dataViewBox=[u[0]+h[0],u[1]-h[1],u[2]-h[2],u[3]+h[3]];var c=this.dataViewBox;return c[0]>=c[2]||c[1]<=c[3]?!1:(this.DVBOrigonPoint=[c[0],c[3]],this.DVBWidth=Math.abs(c[2]-c[0]),this.DVBHeight=Math.abs(c[1]-c[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-l[0],this.DVBOrigonPoint[1]-l[1]],e)}resetLocation(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var r=this.width,i=this.height,a=this.location;return this.chartBounds=new po(a[0]-r/2,a[1]+i/2,a[0]+r/2,a[1]-i/2),this.resetLinearGradient(),a}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var e=this.shapes,t=this.location,r=0,i=e.length;r<i;r++){e[r].refOriginalPosition=t;var a=e[r].style;for(var o in a)switch(o){case"pointList":for(var s=a[o],l=0,u=s.length;l<u;l++)s[l][0]-=t[0],s[l][1]-=t[1];break;case"x":a[o]-=t[0];break;case"y":a[o]-=t[1];break}}this.RelativeCoordinate=!0}assembleShapes(){}getLocalXY(e){return this.layer.getLocalXY(e)}}am.getDataValues=function(n,e,t){if(!n.attributes)return!1;for(var r=[],i=n.attributes,a=0;a<e.length;a++)for(var o in i)if(o===e[a])try{!isNaN(t)&&t>=0?r.push(parseFloat(i[o].toString()).toFixed(t)):r.push(parseFloat(i[o].toString()))}catch{throw new Error("not a number")}return r.length===e.length?r:!1};class Bst extends mw{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){var e=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]],t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},r=this.setting;if(r.barLinearGradient||(r.barLinearGradient=e),r.dataViewBoxParameter||(typeof r.useAxis>"u"||r.useAxis?r.dataViewBoxParameter=[45,15,15,15]:r.dataViewBoxParameter=[5,5,5,5]),!!this.initBaseParameter()){var i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var a=this.dataViewBox,o=this.dataValues;if(!(o.length<1)){for(let p=0,g=o.length;p<g;p++)if(o[p]<i[0]||o[p]>i[1])return;var s=this.calculateXShapeInfo();if(!!s){var l=s.xPositions,u=s.width;(typeof r.useBackground>"u"||r.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,r)),(typeof r.useAxis>"u"||r.useAxis)&&(this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,a,r,s)));for(var h=0;h<o.length;h++){var c=a[1]-(o[h]-i[0])/this.DVBUnitValue,f=[[l[h]-u/2,a[1]-1],[l[h]+u/2,a[1]-1],[l[h]+u/2,c],[l[h]-u/2,c]],d=new I1(f);if(typeof r.showShadow>"u"||r.showShadow){if(r.barShadowStyle){var v=r.barShadowStyle;v.shadowBlur&&(t.shadowBlur=v.shadowBlur),v.shadowColor&&(t.shadowColor=v.shadowColor),v.shadowOffsetX&&(t.shadowOffsetX=v.shadowOffsetX),v.shadowOffsetY&&(t.shadowOffsetY=v.shadowOffsetY)}d.style={},H.copyAttributesWithClip(d.style,t)}d.refDataID=this.data.id,d.dataInfo={field:this.fields[h],value:o[h]},typeof r.barHoverAble<"u"&&(d.hoverable=r.barHoverAble),typeof r.barClickAble<"u"&&(d.clickable=r.barClickAble),this.shapes.push(this.shapeFactory.createShape(d))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==3){i=t.xShapeBlank;var l=s-(i[0]+i[2]+(r-1)*i[1]);if(l<=r)return null;o=l/r}else o=s/(2*r+1),i=[o,o,o];for(var u=0,h=0;h<r;h++)h==0?u=i[0]+o/2:u+=o+i[1],a.push(e[0]+u);return{xPositions:a,width:o}}resetLinearGradient(){if(this.RelativeCoordinate)for(var e=this.shapes.length,t=this.setting.barLinearGradient,r=-1,i=0;i<e;i++){var a=this.shapes[i];if(a.CLASS_NAME==="SuperMap.LevelRenderer.Shape.SmicPolygon"){var o=a.style,s=this.location[0]+o.pointList[0][0],l=this.location[0]+o.pointList[1][0];r++,r>=t.length&&(r=r%t.length);var u=t[r][0],h=t[r][1],c=new SE,f=c.getLinearGradient(s,0,l,0,[[0,u],[1,h]]);a.style.color=f}}}}class Gst extends mw{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(typeof e.useAxis>"u"||e.useAxis?e.dataViewBoxParameter=[45,25,20,20]:e.dataViewBoxParameter=[5,5,5,5]),e.axisUseArrow=typeof e.axisUseArrow<"u"?e.axisUseArrow:!0,e.axisXLabelsOffset=typeof e.axisXLabelsOffset<"u"?e.axisXLabelsOffset:[-10,10],!!this.initBaseParameter()){var t=this.DVBCodomain;this.DVBUnitValue=(t[1]-t[0])/this.DVBHeight;var r=this.dataViewBox,i=this.dataValues;if(!(i.length<1)){for(let y=0,_=i.length;y<_;y++)if(i[y]<t[0]||i[y]>t[1])return;var a=this.calculateXShapeInfo();if(!!a){var o=a.xPositions,s=a.width;(typeof e.useBackground>"u"||e.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e)),(!e.axis3DParameter||isNaN(e.axis3DParameter)||e.axis3DParameter<15)&&(e.axis3DParameter=20),(typeof e.useAxis>"u"||e.useAxis)&&(this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,r,e,a)));var l=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10;for(let y=0;y<i.length;y++){var u=r[1]-(i[y]-t[0])/this.DVBUnitValue,h=o[y]-s/2,c=o[y]+s/2,f=[[h,u],[c,u],[c-l,u+l],[h-l,u+l]],d=[[c,u],[c-l,u+l],[c-l,r[1]+l],[c,r[1]]],v=[[h-l,r[1]+l],[c-l,r[1]+l],[c-l,u+l],[h-l,u+l]];l<=0&&(v=[[h,r[1]],[c,r[1]],[c,u],[h,u]]);var p=new I1(f),g=new I1(d),m=new I1(v);e.barSideStyle=e.barSideStyle?e.barSideStyle:e.barFaceStyle,e.barSideStyleByFields=e.barSideStyleByFields?e.barSideStyleByFields:e.barFaceStyleByFields,e.barSideStyleByCodomain=e.barSideStyleByCodomain?e.barSideStyleByCodomain:e.barFaceStyleByCodomain,e.barTopStyle=e.barTopStyle?e.barTopStyle:e.barFaceStyle,e.barTopStyleByFields=e.barTopStyleByFields?e.barTopStyleByFields:e.barFaceStyleByFields,e.barTopStyleByCodomain=e.barTopStyleByCodomain?e.barTopStyleByCodomain:e.barFaceStyleByCodomain,m.style=Vn.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barFaceStyle,e.barFaceStyleByFields,e.barFaceStyleByCodomain,y,i[y]),g.style=Vn.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barSideStyle,e.barSideStyleByFields,e.barSideStyleByCodomain,y,i[y]),p.style=Vn.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},e.barTopStyle,e.barTopStyleByFields,e.barTopStyleByCodomain,y,i[y]),e.barSideHoverStyle=e.barSideHoverStyle?e.barSideHoverStyle:e.barFaceHoverStyle,e.barTopHoverStyle=e.barTopHoverStyle?e.barTopHoverStyle:e.barFaceHoverStyle,m.highlightStyle=Vn.ShapeStyleTool({stroke:!0},e.barFaceHoverStyle),g.highlightStyle=Vn.ShapeStyleTool({stroke:!0},e.barSideHoverStyle),p.highlightStyle=Vn.ShapeStyleTool({stroke:!0},e.barTopHoverStyle),p.refDataID=g.refDataID=m.refDataID=this.data.id,p.isHoverByRefDataID=g.isHoverByRefDataID=m.isHoverByRefDataID=!0,p.refDataHoverGroup=g.refDataHoverGroup=m.refDataHoverGroup=H.createUniqueID("lr_shg"),p.dataInfo=g.dataInfo=m.dataInfo={field:this.fields[y],value:i[y]},typeof e.barHoverAble<"u"&&(p.hoverable=g.hoverable=m.hoverable=e.barHoverAble),typeof e.barClickAble<"u"&&(p.clickable=g.clickable=m.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(g)),this.shapes.push(this.shapeFactory.createShape(p)),this.shapes.push(this.shapeFactory.createShape(m))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==3){i=t.xShapeBlank;var l=s-(i[0]+i[2]+(r-1)*i[1]);if(l<=r)return null;o=l/r}else o=s/(2*r+1),i=[o,o,o];for(var u=0,h=0;h<r;h++)h==0?u=i[0]+o/2:u+=o+i[1],a.push(e[0]+u);return{xPositions:a,width:o}}}class zNe extends mw{constructor(e,t,r,i,a,o){super(e,t,r,i,a,o),this.setting=null,i&&i.codomain&&(this.setting=i,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="SuperMap.Feature.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){var e=!0;if(!this.setting)return!1;var t=this.setting;t.XOffset&&(this.XOffset=t.XOffset),t.YOffset&&(this.YOffset=t.YOffset),this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var r=this.width,i=this.height,a=this.location;this.origonPoint=[a[0]-r/2,a[1]-i/2];var o=this.origonPoint;this.chartBox=[o[0],o[1]+i,o[0]+r,o[1]];var s=this.chartBox,l=this.DVBParameter;this.dataViewBox=[s[0]+l[0],s[1]-l[1],s[2]-l[2],s[3]+l[3]];var u=this.dataViewBox;return u[0]>=u[2]||u[1]<=u[3]?!1:(this.DVBOrigonPoint=[u[0],u[3]],this.DVBWidth=Math.abs(u[2]-u[0]),this.DVBHeight=Math.abs(u[1]-u[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-o[0],this.DVBOrigonPoint[1]-o[1]],e)}}class zst extends zNe{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){var e="#ff9277";if(!this.setting)return!1;var t=this.setting;if(!t.codomain)return!1;var r=typeof t.decimalNumber<"u"&&!isNaN(t.decimalNumber)?t.decimalNumber:-1,i=am.getDataValues(this.data,this.fields,r);this.dataValues=i||[];var a=this.dataValues;t.maxR||(t.maxR=100),t.minR||(t.minR=0);var o=this.DVBCodomain;o&&o[1]-o[0]>0?this.DVBUnitValue=t.maxR/(o[1]-o[0]):this.DVBUnitValue=t.maxR;var s=this.DVBUnitValue,l=a[0]*s+t.minR;if(this.width=2*l,this.height=2*l,!!this.initBaseParameter()&&!(o&&(a[0]<o[0]||a[0]>o[1]))){var u=this.DVBCenterPoint,h=new qne(u[0],u[1],l);h.style=Vn.ShapeStyleTool(null,t.circleStyle,null,null,0),typeof t.fillColor<"u"?h.style.fillColor=t.fillColor:h.style.fillColor=e,h.highlightStyle=Vn.ShapeStyleTool(null,t.circleHoverStyle),typeof t.circleHoverAble<"u"&&(h.hoverable=t.circleHoverAble),typeof t.circleClickAble<"u"&&(h.clickable=t.circleClickAble),h.refDataID=this.data.id,h.dataInfo={field:this.fields[0],r:l,value:a[0]},this.shapes.push(this.shapeFactory.createShape(h)),this.shapesConvertToRelativeCoordinate()}}}class Ust extends mw{constructor(e,t,r,i,a,o){super(e,t,r,i,a,o),this.CLASS_NAME="SuperMap.Feature.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(typeof e.useAxis>"u"||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),!!this.initBaseParameter()){var t=this.dataViewBox,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=this.DVBUnitValue,a=this.dataValues;if(!(a.length<1)){var o=this.calculateXShapeInfo();if(!!o){var s=o.xPositions;(typeof e.useBackground>"u"||e.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,t,e,o));for(var l,u,h=[],c=[],f=0,d=a.length;f<d;f++){if(a[f]<r[0]||a[f]>r[1])return null;l=s[f],u=t[1]-(a[f]-r[0])/i;var v=new Fz(l,u);v.style=Vn.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,f,a[f]),v.highlightStyle=Vn.ShapeStyleTool(null,e.pointHoverStyle),typeof e.pointHoverAble<"u"&&(v.hoverable=e.pointHoverAble),typeof e.pointClickAble<"u"&&(v.clickable=e.pointClickAble),v.refDataID=this.data.id,v.dataInfo={field:this.fields[f],value:a[f]},c.push(this.shapeFactory.createShape(v));var p=[l,u];h.push(p)}var g=new VO(h);g.style=Vn.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),g.clickable=!1,g.hoverable=!1;var m=this.shapeFactory.createShape(g);this.shapes.push(m),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth,l=0;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==2){i=t.xShapeBlank;var u=s-(i[0]+i[1]);if(u<=r)return null;l=u/(r-1)}else l=s/(r+1),i=[l,l,l];for(var h=0,c=0;c<r;c++)c==0?h=i[0]:h+=l,a.push(e[0]+h);return{xPositions:a,width:o}}}class Vst extends mw{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Pie"}destroy(){super.destroy()}assembleShapes(){var e=this.setting,t=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}];if(!!this.initBaseParameter()){e.useBackground&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e));var r=this.dataValues;if(!(r.length<1)){var i=this.DVBCodomain;for(let g=0;g<r.length;g++)if(r[g]<i[0]||r[g]>i[1])return;var a=0;for(let g=0;g<r.length;g++)a+=Math.abs(r[g]);this.DVBUnitValue=360/a;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,l=0,u=0,h=l,c=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,f=0;f<r.length;f++){var d=Math.abs(r[f]);f===0?u=l+d*o:f===d.length-1?u=h:u=l+d*o,u-l>=360&&(u=359.9999999);var v=new Bz(s[0],s[1],c,l,u);if(typeof e.sectorStyleByFields>"u"){var p=f%t.length;v.style=Vn.ShapeStyleTool(null,e.sectorStyle,t,null,p)}else v.style=Vn.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,f,r[f]);v.highlightStyle=Vn.ShapeStyleTool(null,e.sectorHoverStyle),typeof e.sectorHoverAble<"u"&&(v.hoverable=e.sectorHoverAble),typeof e.sectorClickAble<"u"&&(v.clickable=e.sectorClickAble),v.refDataID=this.data.id,v.dataInfo={field:this.fields[f],value:r[f]},this.shapes.push(this.shapeFactory.createShape(v)),l=u}this.shapesConvertToRelativeCoordinate()}}}}class $st extends mw{constructor(e,t,r,i,a,o){super(e,t,r,i,a,o),this.CLASS_NAME="SuperMap.Feature.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(typeof e.useAxis>"u"||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),!!this.initBaseParameter()){var t=this.dataViewBox,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var i=this.DVBUnitValue,a=this.dataValues,o=this.calculateXShapeInfo();if(!!o){var s=o.xPositions;(typeof e.useBackground>"u"||e.useBackground)&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(Vn.GraphAxis(this.shapeFactory,t,e,o));for(var l,u,h=0,c=a.length;h<c;h++){if(a[h]<r[0]||a[h]>r[1])return null;l=s[h],u=t[1]-(a[h]-r[0])/i;var f=new Fz(l,u);f.style=Vn.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,a[h]),f.highlightStyle=Vn.ShapeStyleTool(null,e.pointHoverStyle),typeof e.pointHoverAble<"u"&&(f.hoverable=e.pointHoverAble),typeof e.pointClickAble<"u"&&(f.clickable=e.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[h],value:a[h]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var e=this.dataViewBox,t=this.setting,r=this.dataValues.length;if(r<1)return null;var i,a=[],o=0,s=this.DVBWidth,l=0;if(t.xShapeBlank&&t.xShapeBlank.length&&t.xShapeBlank.length==2){i=t.xShapeBlank;var u=s-(i[0]+i[1]);if(u<=r)return null;l=u/(r-1)}else l=s/(r+1),i=[l,l,l];for(var h=0,c=0;c<r;c++)c==0?h=i[0]:h+=l,a.push(e[0]+h);return{xPositions:a,width:o}}}class Wst extends mw{constructor(e,t,r,i,a){super(e,t,r,i,a),this.CLASS_NAME="SuperMap.Feature.Theme.Ring"}destroy(){super.destroy()}assembleShapes(){if(!!this.initBaseParameter()){var e=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}],t=this.setting;t.useBackground&&this.shapes.push(Vn.Background(this.shapeFactory,this.chartBox,t));var r=this.dataValues;if(!(r.length<1)){var i=this.DVBCodomain;for(let y=0;y<r.length;y++)if(r[y]<i[0]||r[y]>i[1])return;var a=0;for(let y=0;y<r.length;y++)a+=Math.abs(r[y]);this.DVBUnitValue=360/a;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,l=0,u=0,h=l,c=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,f=t.innerRingRadius>=0&&t.innerRingRadius<c,d=typeof t.innerRingRadius<"u"&&!isNaN(t.innerRingRadius)&&f?t.innerRingRadius:0,v=0;v<r.length;v++){var p=Math.abs(r[v]);v===0?u=l+p*o:v===p.length-1?u=h:u=l+p*o;var g=new Bz(s[0],s[1],c,l,u,d);if(typeof t.sectorStyleByFields>"u"){var m=v%e.length;g.style=Vn.ShapeStyleTool(null,t.sectorStyle,e,null,m)}else g.style=Vn.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,v,r[v]);g.highlightStyle=Vn.ShapeStyleTool(null,t.sectorHoverStyle),typeof t.sectorHoverAble<"u"&&(g.hoverable=t.sectorHoverAble),typeof t.sectorClickAble<"u"&&(g.clickable=t.sectorClickAble),g.refDataID=this.data.id,g.dataInfo={field:this.fields[v],value:r[v]},this.shapes.push(this.shapeFactory.createShape(g)),l=u}this.shapesConvertToRelativeCoordinate()}}}}class f3 extends am{constructor(e,t,r,i,a){if(super(e,t),!!e.geometry&&e.geometry instanceof rg){this.dataBounds=e.geometry.getBounds(),this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=r||{},this.CLASS_NAME="SuperMap.Feature.Theme.Vector",this.style=r||{},i&&H.copyAttributesWithClip(this,i,["shapeOptions","dataBounds"]),a&&H.copyAttributesWithClip(this.shapeOptions,a);var o=e.geometry;this.lonlat=this.dataBounds.getCenterLonLat(),this.location=this.getLocalXY(this.lonlat),o instanceof tv?this.lineToTF(o):o instanceof Vl?this.lineToTF(o):o instanceof Mne||(o instanceof HE?this.multiPointToTF(o):o instanceof _E?this.multiLineStringToTF(o):o instanceof A1?this.multiPolygonToTF(o):o instanceof _p?this.polygonToTF(o):o instanceof O0||(o instanceof Ki?this.pointToTF(o):o instanceof IOe?this.rectangleToTF(o):o instanceof O_&&this.geoTextToTF(o)))}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}lineToTF(e){for(var t=e.components,r=[],i=[],a=this.location,o=[],s=this.nodesClipPixel,l=0;l<t.length;l++){var u=t[l];if(i=[],r=this.getLocalXY(u),i[0]=r[0]-a[0],i[1]=r[1]-a[1],o.length>0){var h=o[o.length-1];if(Math.abs(h[0]-i[0])<=s&&Math.abs(h[1]-i[1])<=s)continue}o.push(i)}if(o.length<2)return null;var c=new Object;c=H.copyAttributesWithClip(c,this.style,["pointList"]),c.pointList=o;var f=new BNe({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}multiPointToTF(e){for(var t=e.components,r=[],i=[],a=this.location,o=[],s=this.nodesClipPixel,l=0;l<t.length;l++){var u=t[l];if(i=[],r=this.getLocalXY(u),i[0]=r[0]-a[0],i[1]=r[1]-a[1],o.length>0){var h=o[o.length-1];if(Math.abs(h[0]-i[0])<=s&&Math.abs(h[1]-i[1])<=s)continue}o.push(i);var c=new Object;c.r=6,c=H.copyAttributesWithClip(c,this.style),c.x=i[0],c.y=i[1];var f=new LK({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=a,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}multiLineStringToTF(e){for(var t=e.components,r=0;r<t.length;r++){var i=t[r];this.lineToTF(i)}}multiPolygonToTF(e){for(var t=e.components,r=0;r<t.length;r++){var i=t[r];this.polygonToTF(i)}}pointToTF(e){var t=this.location,r=this.getLocalXY(e),i=new Object;i.r=6,i=H.copyAttributesWithClip(i,this.style),i.x=r[0]-t[0],i.y=r[1]-t[1];var a=new LK({style:i,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=t,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}polygonToTF(e){for(var t=e.components,r=[],i=[],a=this.location,o=[],s=[],l=[],u=this.nodesClipPixel,h=0;h<t.length;h++){var c=t[h].components;if(h===0){o=[];for(var f=0;f<c.length;f++){if(i=[],r=this.getLocalXY(c[f]),i[0]=r[0]-a[0],i[1]=r[1]-a[1],o.length>0){var d=o[o.length-1];if(Math.abs(d[0]-i[0])<=u&&Math.abs(d[1]-i[1])<=u)continue}o.push(i)}}else{s=[];for(var v=0;v<c.length;v++){if(i=[],r=this.getLocalXY(c[v]),i[0]=r[0]-a[0],i[1]=r[1]-a[1],s.length>0){var p=s[s.length-1];if(Math.abs(p[0]-i[0])<=u&&Math.abs(p[1]-i[1])<=u)continue}s.push(i)}}s.length<2||l.push(s)}if(!(o.length<2)){var g={};g=H.copyAttributesWithClip(g,this.style,["pointList"]),g.pointList=o;var m=new Kne({style:g,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,l.length>0&&(m.holePolygonPointLists=l),this.shapeOptions&&H.copyAttributesWithClip(m,this.shapeOptions),this.shapes.push(m)}}rectangleToTF(e){var t=this.location,r=new vd(e.x,e.y),i=this.layer.map.getResolution(),a=this.getLocalXY(r),o=new Object;o.r=6,o=H.copyAttributesWithClip(o,this.style),o.x=a[0]-t[0],o.y=a[1]-t[1]-2*e.width/i,o.width=e.width/i,o.height=e.height/i;var s=new GNe({style:o,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(s.highlightStyle=this.highlightStyle),s.refOriginalPosition=t,s.refDataID=this.data.id,s.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}geoTextToTF(e){var t=this.location,r=this.getLocalXY(e),i=new Object;i.r=6,i=H.copyAttributesWithClip(i,this.style,["x","y","text"]),i.x=r[0]-t[0],i.y=r[1]-t[1],i.text=e.text;var a=new FNe({style:i,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=t,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&H.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}updateAndAddShapes(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,r=0,i=this.shapes.length;r<i;r++){var a=this.shapes[r];a.refOriginalPosition=e,t.addShape(a)}}getShapesCount(){return this.shapes.length}getLocalXY(e){return this.layer.getLocalXY(e)}}class Xx extends Cne(JR,Y8){constructor(e){super(e),e=e||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,H.extend(this,e),this.id=this.id||H.createUniqueID("smShapeGroup_"),this.CLASS_NAME="SuperMap.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(e){return this._children[e]}addChild(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof Xx&&e.addChildrenToStorage(this._storage)))}removeChild(e){var t=H.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof Xx&&e.delChildrenFromStorage(this._storage))}eachChild(e,t){for(var r=!!t,i=0;i<this._children.length;i++){var a=this._children[i];r?e.call(t,a):e(a)}}traverse(e,t){for(var r=!!t,i=0;i<this._children.length;i++){var a=this._children[i];r?e.call(t,a):e(a),a.type==="group"&&a.traverse(e,t)}}addChildrenToStorage(e){for(var t=0;t<this._children.length;t++){var r=this._children[t];e.addToMap(r),r.type==="group"&&r.addChildrenToStorage(e)}}delChildrenFromStorage(e){for(var t=0;t<this._children.length;t++){var r=this._children[t];e.delFromMap(r.id),r.type==="group"&&r.delChildrenFromStorage(e)}}modSelf(){this.__dirty=!0}}class q8{constructor(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0,this.CLASS_NAME="SuperMap.LevelRenderer.Storage"}destroy(){this.dispose(),this._shapeList=null,this._shapeListOffset=null}iterShape(e,t){if(!t){var r={hover:!1,normal:"down",update:!1};t=r}if(t.hover)for(var i=0,a=this._hoverElements.length;i<a;i++){var o=this._hoverElements[i];if(o.updateTransform(),e(o))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":{let s=this._shapeList.length;for(;s--;)if(e(this._shapeList[s]))return this;break}default:{for(let s=0,l=this._shapeList.length;s<l;s++)if(e(this._shapeList[s]))return this;break}}return this}getHoverShapes(e){var t=[],r=this._hoverElements.length;for(let l=0;l<r;l++){t.push(this._hoverElements[l]);var i=this._hoverElements[l].hoverConnect;if(i){var a;i=i instanceof Array?i:[i];for(var o=0,s=i.length;o<s;o++)a=i[o].id?i[o]:this.get(i[o]),a&&t.push(a)}}if(t.sort(q8.shapeCompareFunc),e)for(let l=0,u=t.length;l<u;l++)t[l].updateTransform();return t}getShapeList(e){return e&&this.updateShapeList(),this._shapeList}updateShapeList(){this._shapeListOffset=0;var e=this._roots.length;for(let r=0;r<e;r++){let i=this._roots[r];this._updateAndAddShape(i)}this._shapeList.length=this._shapeListOffset;var t=this._shapeList.length;for(let r=0;r<t;r++)this._shapeList[r].__renderidx=r;this._shapeList.sort(q8.shapeCompareFunc)}_updateAndAddShape(e,t){if(!e.ignore)if(e.updateTransform(),e.type=="group"){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice(),t.push(e.clipShape)):t=[e.clipShape]);for(var r=0;r<e._children.length;r++){var i=e._children[r];i.__dirty=e.__dirty||i.__dirty,this._updateAndAddShape(i,t)}e.__dirty=!1}else e.__clipShapes=t,this._shapeList[this._shapeListOffset++]=e}mod(e,t){var r=this._elements[e];if(r&&(r.modSelf(),t))if(t.parent||t._storage||t.__startClip){var i={};for(var a in t)a=="parent"||a=="_storage"||a=="__startClip"||t.hasOwnProperty(a)&&(i[a]=t[a]);new Pp().merge(r,i,!0)}else new Pp().merge(r,t,!0);return this}drift(e,t,r){var i=this._elements[e];return i&&(i.needTransform=!0,i.draggable==="horizontal"?r=0:i.draggable==="vertical"&&(t=0),(!i.ondrift||i.ondrift&&!i.ondrift(t,r))&&i.drift(t,r)),this}addHover(e){return e.updateNeedTransform(),this._hoverElements.push(e),this}delHover(){return this._hoverElements=[],this}hasHoverShape(){return this._hoverElements.length>0}addRoot(e){e instanceof Xx&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}delRoot(e){if(typeof e>"u"){for(var t=0;t<this._roots.length;t++){var r=this._roots[t];r instanceof Xx&&r.delChildrenFromStorage(this)}this._elements={},this._hoverElements=[],this._roots=[];return}if(e instanceof Array){var i=e.length;for(let s=0;s<i;s++)this.delRoot(e[s]);return}var a;typeof e=="string"?a=this._elements[e]:a=e;var o=new Pp().indexOf(this._roots,a);o>=0&&(this.delFromMap(a.id),this._roots.splice(o,1),a instanceof Xx&&a.delChildrenFromStorage(this))}addToMap(e){return e instanceof Xx&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this}get(e){return this._elements[e]}delFromMap(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof Xx&&(t._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}}class va{constructor(e,t){this.root=e,this.storage=t,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,va.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="SuperMap.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var r=document.createElement("div");this._domRoot=r,r.style.position="relative",r.style.overflow="hidden",r.style.width=this._width+"px",r.style.height=this._height+"px",this.root.appendChild(r),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=va.createDom(H.createUniqueID("SuperMap.Theme_background_"),"div",this),r.appendChild(this._bgDom),this._bgDom.onselectstart=o,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var i=new Jde(H.createUniqueID("_highLightLayer_"),this);this._layers.hover=i,r.appendChild(i.dom),i.initContext(),i.dom.onselectstart=o,i.dom.style["-webkit-user-select"]="none",i.dom.style["user-select"]="none",i.dom.style["-webkit-touch-callout"]="none";var a=this;this.updatePainter=function(s,l){a.refreshShapes(s,l)};function o(){return!1}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(e){return this.refresh(e,!0),this}refresh(e,t){var r=this.storage.getShapeList(!0);return this._paintList(r,t),typeof e=="function"&&e(),this}_paintList(e,t){typeof t>"u"&&(t=!1),this._updateLayerStatus(e);var r,i,a;for(var o in this._layers)o!=="hover"&&(this._layers[o].unusedCount++,this._layers[o].updateTransform());for(var s=[],l=0,u=e.length;l<u;l++){var h=e[l];if(i!==h.zlevel&&(r&&r.needTransform&&a.restore(),r=this.getLayer(h.zlevel),a=r.ctx,i=h.zlevel,r.unusedCount=0,(r.dirty||t)&&r.clear(),r.needTransform&&(a.save(),r.setTransform(a))),a&&h.__startClip){var c=h.__startClip;if(a.save(),c.needTransform){let d=c.transform;cr.Util_matrix.invert(s,d),a.transform(d[0],d[1],d[2],d[3],d[4],d[5])}if(a.beginPath(),c.buildPath(a,c.style),a.clip(),c.needTransform){let d=s;a.transform(d[0],d[1],d[2],d[3],d[4],d[5])}}if((r&&r.dirty||t)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(a,!1)))if(ds.catchBrushException)try{h.brush(a,!1,this.updatePainter)}catch(d){cr.Util_log(d,"brush error of "+h.type,h)}else h.brush(a,!1,this.updatePainter);a&&h.__stopClip&&a.restore(),h.__dirty=!1}a&&r&&r.needTransform&&a.restore();for(let d in this._layers)if(d!=="hover"){var f=this._layers[d];f.dirty=!1,f.unusedCount==1&&f.clear()}}getLayer(e){var t=this._layers[e];if(!t){var r=this._zlevelList.length,i=null,a=-1;if(r>0&&e>this._zlevelList[0]){for(a=0;a<r-1&&!(this._zlevelList[a]<e&&this._zlevelList[a+1]>e);a++);i=this._layers[this._zlevelList[a]]}this._zlevelList.splice(a+1,0,e),t=new Jde(H.createUniqueID("_levelLayer_"+e),this);var o=i?i.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(t.dom,o.nextSibling):o.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&new Pp().merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}getLayers(){return this._layers}_updateLayerStatus(e){var t=this._layers,r={};for(let s in t)s!=="hover"&&(r[s]=t[s].elCount,t[s].elCount=0);for(let s=0;s<e.length;s++){var i=e[s],a=i.zlevel,o=t[a];if(o){if(o.elCount++,o.dirty)continue;o.dirty=i.__dirty}}for(let s in t)s!=="hover"&&r[s]!==t[s].elCount&&(t[s].dirty=!0)}refreshShapes(e,t){for(var r=0,i=e.length;r<i;r++){var a=e[r];this.storage.mod(a.id)}return this.refresh(t),this}clear(){for(var e in this._layers)e!="hover"&&this._layers[e].clear();return this}modLayer(e,t){if(t){this._layerConfig[e]?new Pp().merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var r=this._layers[e];r&&new Pp().merge(r,this._layerConfig[e],!0)}}delLayer(e){var t=this._layers[e];!t||(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice(new Pp().indexOf(this._zlevelList,e),1))}refreshHover(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,r=e.length;t<r;t++)this._brushHover(e[t]);return this.storage.delHover(),this}clearHover(){var e=this._layers.hover;return e&&e.clear(),this}resize(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),r=this._getHeight();if(e.style.display="",this._width!=t||r!=this._height){this._width=t,this._height=r,e.style.width=t+"px",e.style.height=r+"px";for(var i in this._layers)this._layers[i].resize(t,r);this.refresh(null,!0)}return this}clearLayer(e){var t=this._layers[e];t&&t.clear()}dispose(){this.root.innerHTML="",this.root=null,this.storage=null,this._domRoot=null,this._layers=null}getDomHover(){return this._layers.hover.dom}toDataURL(e,t,r){var i=va.createDom(H.createUniqueID("SuperMap.Theme.image_"),"canvas",this);this._bgDom.appendChild(i);var a=i.getContext("2d");va.devicePixelRatio!=1&&a.scale(va.devicePixelRatio,va.devicePixelRatio),a.fillStyle=t||"#fff",a.rect(0,0,this._width*va.devicePixelRatio,this._height*va.devicePixelRatio),a.fill();var o=this;this.storage.iterShape(function(l){if(!l.invisible&&(!l.onbrush||l.onbrush&&!l.onbrush(a,!1)))if(ds.catchBrushException)try{l.brush(a,!1,o.updatePainter)}catch(u){cr.Util_log(u,"brush error of "+l.type,l)}else l.brush(a,!1,o.updatePainter)},{normal:"up",update:!0});var s=i.toDataURL(e,r);return a=null,this._bgDom.removeChild(i),s}getWidth(){return this._width}getHeight(){return this._height}_getWidth(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0}_getHeight(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0}_brushHover(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var r=this.getLayer(e.zlevel);if(r.needTransform&&(t.save(),r.setTransform(t)),ds.catchBrushException)try{e.brush(t,!0,this.updatePainter)}catch(i){cr.Util_log(i,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.updatePainter);r.needTransform&&t.restore()}}_shapeToImage(e,t,r,i,a){var o=document.createElement("canvas"),s=o.getContext("2d"),l=a||window.devicePixelRatio||1;o.style.width=r+"px",o.style.height=i+"px",o.setAttribute("width",r*l),o.setAttribute("height",i*l),s.clearRect(0,0,r*l,i*l);var u={position:t.position,rotation:t.rotation,scale:t.scale};t.position=[0,0,0],t.rotation=0,t.scale=[1,1],t&&t.brush(s,!1);var h=new My({id:e,style:{x:0,y:0,image:o}});return u.position!=null&&(h.position=t.position=u.position),u.rotation!=null&&(h.rotation=t.rotation=u.rotation),u.scale!=null&&(h.scale=t.scale=u.scale),h}_createShapeToImageProcessor(){var e=this;return function(t,r,i,a){return e._shapeToImage(t,r,i,a,va.devicePixelRatio)}}updateHoverLayer(e){if(!(e instanceof Array))return this;this.clearHover(),this.storage.delHover();for(var t=0;t<e.length;t++)this.storage.addHover(e[t]),this._brushHover(e[t])}static createDom(e,t,r){var i=document.createElement(t),a=r._width,o=r._height;return i.style.position="absolute",i.style.left=0,i.style.top=0,i.style.width=a+"px",i.style.height=o+"px",i.setAttribute("width",a*va.devicePixelRatio),i.setAttribute("height",o*va.devicePixelRatio),i.setAttribute("id",e),i}}class Jde extends Y8{constructor(e,t){super(e,t),this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=t,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,this.ctx=null,this.dom=va.createDom(H.createUniqueID("SuperMap.Theme"+e),"canvas",t),this.dom.onselectstart=r,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none";function r(){return!1}this.CLASS_NAME="SuperMap.LevelRenderer.Painter.Layer"}destroy(){this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=null,this.unusedCount=null,this.config=null,this.dirty=null,this.elCount=null,this.clearColor=null,this.motionBlur=null,this.lastFrameAlpha=null,this.zoomable=null,this.panable=null,this.maxZoom=null,this.minZoom=null,this.ctx=null,Y8.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),va.devicePixelRatio!=1&&this.ctx.scale(va.devicePixelRatio,va.devicePixelRatio)}createBackBuffer(){this.domBack=va.createDom(H.createUniqueID("SuperMap.Theme.back-"+this.id),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),va.devicePixelRatio!=1&&this.ctxBack.scale(va.devicePixelRatio,va.devicePixelRatio)}resize(e,t){this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*va.devicePixelRatio),this.dom.setAttribute("height",t*va.devicePixelRatio),va.devicePixelRatio!=1&&this.ctx.scale(va.devicePixelRatio,va.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",e*va.devicePixelRatio),this.domBack.setAttribute("height",t*va.devicePixelRatio),va.devicePixelRatio!=1&&this.ctxBack.scale(va.devicePixelRatio,va.devicePixelRatio))}clear(){var e=this.dom,t=this.ctx,r=e.width,i=e.height,a=this.clearColor,o=this.motionBlur,s=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,r/va.devicePixelRatio,i/va.devicePixelRatio)),a?(t.save(),t.fillStyle=this.config.clearColor,t.fillRect(0,0,r/va.devicePixelRatio,i/va.devicePixelRatio),t.restore()):t.clearRect(0,0,r/va.devicePixelRatio,i/va.devicePixelRatio),o){var l=this.domBack;t.save(),t.globalAlpha=s,t.drawImage(l,0,0,r/va.devicePixelRatio,i/va.devicePixelRatio),t.restore()}}}class Hst extends JR{constructor(e,t,r){super(e,t,r),this.root=e,this.storage=t,this.painter=r,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=o(l,this),this._domHover=r.getDomHover(),this.CLASS_NAME="SuperMap.LevelRenderer.Handler";var i={resize:function(u){u=u||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(ds.EVENT.RESIZE,u)},click:function(u){u=this._zrenderEventFixed(u);var h=this._lastHover;(h&&h.clickable||!h)&&this._clickThreshold<10&&this._dispatchAgency(h,ds.EVENT.CLICK,u),this._mousemoveHandler(u)},dblclick:function(u){u=u||window.event,u=this._zrenderEventFixed(u);var h=this._lastHover;(h&&h.clickable||!h)&&this._clickThreshold<5&&this._dispatchAgency(h,ds.EVENT.DBLCLICK,u),this._mousemoveHandler(u)},mousewheel:function(u){u=this._zrenderEventFixed(u);var h=u.wheelDelta||-u.detail,c=h>0?1.1:1/1.1,f=this.painter.getLayers(),d=!1;for(var v in f)if(v!=="hover"){var p=f[v],g=p.position;if(p.zoomable){p.__zoom=p.__zoom||1;var m=p.__zoom;m*=c,m=Math.max(Math.min(p.maxZoom,m),p.minZoom),c=m/p.__zoom,p.__zoom=m,g[0]-=(this._mouseX-g[0])*(c-1),g[1]-=(this._mouseY-g[1])*(c-1),p.scale[0]*=c,p.scale[1]*=c,p.dirty=!0,d=!0}}d&&this.painter.refresh(),this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEWHEEL,u),this._mousemoveHandler(u)},mousemove:function(u){this._clickThreshold++,u=this._zrenderEventFixed(u),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=cr.Util_event.getX(u),this._mouseY=cr.Util_event.getY(u);var h=this._mouseX-this._lastX,c=this._mouseY-this._lastY;this._processDragStart(u),this._hasfound=0,this._event=u,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(u),this._processDragLeave(u)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var f="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,h,c),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var d=this.painter.getLayers(),v=!1;for(var p in d)if(p!=="hover"){var g=d[p];g.panable&&(f="move",g.position[0]+=h,g.position[1]+=c,v=!0,g.dirty=!0)}v&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?f="move":this._hasfound&&this._lastHover.clickable&&(f="pointer"),this.root.style.cursor=f,this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEMOVE,u),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(u){u=this._zrenderEventFixed(u);var h=u.toElement||u.relatedTarget;if(h!=this.root)for(;h&&h.nodeType!=9;){if(h==this.root){this._mousemoveHandler(u);return}h=h.parentNode}u.zrenderX=this._lastX,u.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(u),this._processDrop(u),this._processDragEnd(u),this.painter.refreshHover(),this.dispatch(ds.EVENT.GLOBALOUT,u)},mousedown:function(u){if(this._clickThreshold=0,this._lastDownButton==2){this._lastDownButton=u.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,u=this._zrenderEventFixed(u),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEDOWN,u),this._lastDownButton=u.button},mouseup:function(u){u=this._zrenderEventFixed(u),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEUP,u),this._processDrop(u),this._processDragEnd(u)},touchstart:function(u){u=this._zrenderEventFixed(u,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(u),this._mousedownHandler(u)},touchmove:function(u){u=this._zrenderEventFixed(u,!0),this._mousemoveHandler(u),this._isDragging&&cr.Util_event.stop(u)},touchend:function(u){u=this._zrenderEventFixed(u,!0),this._mouseupHandler(u);var h=new Date;h-this._lastTouchMoment<ds.EVENT.touchClickDelay&&(this._mobildFindFixed(u),this._clickHandler(u),h-this._lastClickMoment<ds.EVENT.touchClickDelay/2&&(this._dblclickHandler(u),this._lastHover&&this._lastHover.clickable&&cr.Util_event.stop(u)),this._lastClickMoment=h),this.painter.clearHover()}};s(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),cr.Util_env.os.tablet||cr.Util_env.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("dblclick",this._dblclickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.ondblclick=this._dblclickHandler,e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler));function a(u,h){return function(c){return u.call(h,c)}}function o(u,h){return function(c,f,d){return u.call(h,c,f,d)}}function s(u){for(var h=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],c=h.length;c--;){var f=h[c];u["_"+f+"Handler"]=a(i[f],u)}}function l(u,h,c){var f=this;if(f._draggingTarget&&f._draggingTarget.id==u.id||u.isSilent())return!1;var d=f._event;if(u.isCover(h,c)){if(u.hoverable)if(u.isHoverByRefDataID&&u.isHoverByRefDataID===!0){if(u.refDataID){var v=u.refDataID,p=null;u.refDataHoverGroup&&(p=u.refDataHoverGroup);for(var g=f.storage._shapeList,m=0,y=g.length;m<y;m++){var _=g[m];_.refDataID&&v===_.refDataID&&(p?_.refDataHoverGroup&&p===_.refDataHoverGroup&&f.storage.addHover(_):f.storage.addHover(_))}}}else f.storage.addHover(u);for(var x=u.parent;x;){if(x.clipShape&&!x.clipShape.isCover(f._mouseX,f._mouseY))return!1;x=x.parent}return f._lastHover!=u&&(f._processOutShape(d),f._processDragLeave(d),f._lastHover=u,f._processDragEnter(d)),f._processOverShape(d),f._processDragOver(d),f._hasfound=1,!0}return!1}}destroy(){this.dispose(),this._lastX=null,this._lastY=null,this._mouseX=null,this._mouseY=null,this._findHover=null,JR.prototype.destroy.apply(this,arguments)}on(e,t){return this.bind(e,t),this}un(e,t){return this.unbind(e,t),this}trigger(e,t){var r=ds.EVENT;switch(e){case r.RESIZE:case r.CLICK:case r.DBLCLICK:case r.MOUSEWHEEL:case r.MOUSEMOVE:case r.MOUSEDOWN:case r.MOUSEUP:case r.MOUSEOUT:this["_"+e+"Handler"](t);break}}dispose(){var e=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),cr.Util_env.os.tablet||cr.Util_env.os.phone?(e.removeEventListener("touchstart",this._touchstartHandler),e.removeEventListener("touchmove",this._touchmoveHandler),e.removeEventListener("touchend",this._touchendHandler)):(e.removeEventListener("click",this._clickHandler),e.removeEventListener("dblclick",this._dblclickHandler),e.removeEventListener("mousewheel",this._mousewheelHandler),e.removeEventListener("mousemove",this._mousemoveHandler),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("mouseup",this._mouseupHandler)),e.removeEventListener("DOMMouseScroll",this._mousewheelHandler),e.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),e.detachEvent("onclick",this._clickHandler),e.detachEvent("dblclick",this._dblclickHandler),e.detachEvent("onmousewheel",this._mousewheelHandler),e.detachEvent("onmousemove",this._mousemoveHandler),e.detachEvent("onmouseout",this._mouseoutHandler),e.detachEvent("onmousedown",this._mousedownHandler),e.detachEvent("onmouseup",this._mouseupHandler)),this.root=null,this._domHover=null,this.storage=null,this.painter=null,this.un()}_processDragStart(e){var t=this._lastHover;if(this._isMouseDown&&t&&t.draggable&&!this._draggingTarget&&this._mouseDownTarget==t){if(t.dragEnableTime&&new Date-this._lastMouseDownMoment<t.dragEnableTime)return;var r=t;this._draggingTarget=r,this._isDragging=1,r.invisible=!0,this.storage.mod(r.id),this._dispatchAgency(r,ds.EVENT.DRAGSTART,e),this.painter.refresh()}}_processDragEnter(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,ds.EVENT.DRAGENTER,e,this._draggingTarget)}_processDragOver(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,ds.EVENT.DRAGOVER,e,this._draggingTarget)}_processDragLeave(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,ds.EVENT.DRAGLEAVE,e,this._draggingTarget)}_processDrop(e){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,ds.EVENT.DROP,e,this._draggingTarget))}_processDragEnd(e){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,ds.EVENT.DRAGEND,e),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(e){this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEOVER,e)}_processOutShape(e){this._dispatchAgency(this._lastHover,ds.EVENT.MOUSEOUT,e)}_dispatchAgency(e,t,r,i){var a="on"+t,o={type:t,event:r,target:e,cancelBubble:!1},s=e;for(i&&(o.dragged=i);s&&(s[a]&&(o.cancelBubble=s[a](o)),s.dispatch(t,o),s=s.parent,!o.cancelBubble););e?o.cancelBubble||this.dispatch(t,o):i||this.dispatch(t,{type:t,event:r})}_iterateAndFindHover(){for(var e=cr.Util_matrix.create(),t=this.storage.getShapeList(),r,i,a=[0,0],o=t.length-1;o>=0;o--){var s=t[o];if(r!==s.zlevel&&(i=this.painter.getLayer(s.zlevel,i),a[0]=this._mouseX,a[1]=this._mouseY,i.needTransform&&(cr.Util_matrix.invert(e,i.transform),cr.Util_vector.applyTransform(a,a,e))),this._findHover(s,a[0],a[1]))break}}_mobildFindFixed(e){var t=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r<t.length;r++){var i=t[r];i.x&&(this._mouseX+=i.x),i.y&&(this._mouseX+=i.y),this._iterateAndFindHover()}this._lastHover&&(e.zrenderX=this._mouseX,e.zrenderY=this._mouseY)}_zrenderEventFixed(e,t){if(e.zrenderFixed)return e;if(t){var i=e.type!="touchend"?e.targetTouches[0]:e.changedTouches[0];if(i){var a=this.root.getBoundingClientRect();e.zrenderX=i.clientX-a.left,e.zrenderY=i.clientY-a.top}}else{e=e||window.event;var r=e.toElement||e.relatedTarget||e.srcElement||e.target;r&&r!=this._domHover&&(e.zrenderX=(typeof e.offsetX<"u"?e.offsetX:e.layerX)+r.offsetLeft,e.zrenderY=(typeof e.offsetY<"u"?e.offsetY:e.layerY)+r.offsetTop)}return e.zrenderFixed=1,e}getLastHoverOne(){return this._lastHover?this._lastHover:null}}class jst{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Animation.easing"}destroy(){}Linear(e){return e}QuadraticIn(e){return e*e}QuadraticOut(e){return e*(2-e)}QuadraticInOut(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}CubicIn(e){return e*e*e}CubicOut(e){return--e*e*e+1}CubicInOut(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}QuarticIn(e){return e*e*e*e}QuarticOut(e){return 1- --e*e*e*e}QuarticInOut(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}QuinticIn(e){return e*e*e*e*e}QuinticOut(e){return--e*e*e*e*e+1}QuinticInOut(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}SinusoidalIn(e){return 1-Math.cos(e*Math.PI/2)}SinusoidalOut(e){return Math.sin(e*Math.PI/2)}SinusoidalInOut(e){return .5*(1-Math.cos(Math.PI*e))}ExponentialIn(e){return e===0?0:Math.pow(1024,e-1)}ExponentialOut(e){return e===1?1:1-Math.pow(2,-10*e)}ExponentialInOut(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}CircularIn(e){return 1-Math.sqrt(1-e*e)}CircularOut(e){return Math.sqrt(1- --e*e)}CircularInOut(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}ElasticIn(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)))}ElasticOut(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/i)+1)}ElasticInOut(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)}BackIn(e){var t=1.70158;return e*e*((t+1)*e-t)}BackOut(e){var t=1.70158;return--e*e*((t+1)*e+t)+1}BackInOut(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}BounceIn(e){return 1-this.BounceOut(1-e)}BounceOut(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}BounceInOut(e){return e<.5?this.BounceIn(e*2)*.5:this.BounceOut(e*2-1)*.5+.5}}class Xst{constructor(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=new Date().getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop>"u"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this.CLASS_NAME="SuperMap.LevelRenderer.Animation.Clip"}destroy(){}step(e){var t=new jst,r=(e-this._startTime)/this._life;if(!(r<0)){r=Math.min(r,1);var i=typeof this.easing=="string"?t[this.easing]:this.easing,a=typeof i=="function"?i(r):r;return this.fire("frame",a),r==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var e=new Date().getTime(),t=(e-this._startTime)%this._life;this._startTime=new Date().getTime()-t+this.gap}fire(e,t){for(var r=0,i=this._targetPool.length;r<i;r++)this["on"+e]&&this["on"+e](this._targetPool[r],t)}}class Mh extends JR{constructor(e){super(e),e=e||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,H.extend(this,e),this.CLASS_NAME="SuperMap.LevelRenderer.Animation"}add(e){this._clips.push(e)}remove(e){var t=new Pp().indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)}_update(){var e=new Date().getTime(),t=e-this._time,r=this._clips,i=r.length,a=[],o=[];for(let u=0;u<i;u++){var s=r[u],l=s.step(e);l&&(a.push(l),o.push(s))}this.stage.update&&this.stage.update();for(let u=0;u<i;)r[u]._needsRemove?(r[u]=r[i-1],r.pop(),i--):u++;i=a.length;for(let u=0;u<i;u++)o[u].fire(a[u]);this._time=e,this.onframe(t),this.dispatch("frame",t)}start(){var e=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(i){setTimeout(i,16)},t=this;this._running=!0;function r(){t._running&&(t._update(),e(r))}this._time=new Date().getTime(),e(r)}stop(){this._running=!1}clear(){this._clips=[]}animate(e,t){t=t||{};var r=new Yst(e,t.loop,t.getter,t.setter);return r.animation=this,r}static _interpolateNumber(e,t,r){return(t-e)*r+e}static _interpolateArray(e,t,r,i,a){var o=e.length;if(a==1)for(let l=0;l<o;l++)i[l]=Mh._interpolateNumber(e[l],t[l],r);else{var s=e[0].length;for(let l=0;l<o;l++)for(let u=0;u<s;u++)i[l][u]=Mh._interpolateNumber(e[l][u],t[l][u],r)}}static _isArrayLike(e){switch(typeof e){case"undefined":case"string":return!1}return typeof e.length<"u"}static _catmullRomInterpolateArray(e,t,r,i,a,o,s,l,u){var h=e.length;if(u==1)for(let d=0;d<h;d++)l[d]=Mh._catmullRomInterpolate(e[d],t[d],r[d],i[d],a,o,s);else{var c=e[0].length;for(let d=0;d<h;d++)for(var f=0;f<c;f++)l[d][f]=Mh._catmullRomInterpolate(e[d][f],t[d][f],r[d][f],i[d][f],a,o,s)}}static _catmullRomInterpolate(e,t,r,i,a,o,s){var l=(r-e)*.5,u=(i-t)*.5;return(2*(t-r)+l+u)*s+(-3*(t-r)-2*l-u)*o+l*a+t}static _cloneValue(e){var t=Array.prototype.slice;if(Mh._isArrayLike(e)){var r=e.length;if(Mh._isArrayLike(e[0])){for(var i=[],a=0;a<r;a++)i.push(t.call(e[a]));return i}else return t.call(e)}else return e}static rgba2String(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}}class Yst{constructor(e,t,r,i){this._tracks={},this._target=e,this._loop=t||!1,this._getter=r||a,this._setter=i||o,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="SuperMap.LevelRenderer.Animation.Animator";function a(s,l){return s[l]}function o(s,l,u){s[l]=u}}when(e,t){for(var r in t)this._tracks[r]||(this._tracks[r]=[],e!==0&&this._tracks[r].push({time:0,value:Mh._cloneValue(this._getter(this._target,r))})),this._tracks[r].push({time:parseInt(e,10),value:t[r]});return this}during(e){return this._onframeList.push(e),this}start(e){var t=this,r=this._setter,i=this._getter,a=t._onframeList.length,o=e==="spline",s=function(){if(t._clipCount--,t._clipCount===0){t._tracks={};for(var h=t._doneList.length,c=0;c<h;c++)t._doneList[c].call(t)}},l=function(h,c){var f=h.length;if(!!f){var d=h[0].value,v=Mh._isArrayLike(d),p=!1,g=v&&Mh._isArrayLike(d[0])?2:1;h.sort(function(G,W){return G.time-W.time});var m=h[f-1].time,y=[],_=[];for(let G=0;G<f;G++){y.push(h[G].time/m);var x=h[G].value;typeof x=="string"&&(x=cr.Util_color.toArray(x),x.length===0&&(x[0]=x[1]=x[2]=0,x[3]=1),p=!0),_.push(x)}var S=0,w=0,b,E,T,C,A,M,I;if(p)var R=[0,0,0,0];var k=function(G,W){if(W<w){for(b=Math.min(S+1,f-1),E=b;E>=0&&!(y[E]<=W);E--);E=Math.min(E,f-2)}else{for(E=S;E<f&&!(y[E]>W);E++);E=Math.min(E-1,f-2)}S=E,w=W;var z=y[E+1]-y[E];if(z!==0){if(T=(W-y[E])/z,o)if(A=_[E],C=_[E===0?E:E-1],M=_[E>f-2?f-1:E+1],I=_[E>f-3?f-1:E+2],v)Mh._catmullRomInterpolateArray(C,A,M,I,T,T*T,T*T*T,i(G,c),g);else{let V;p?V=Mh.rgba2String(R):V=Mh._catmullRomInterpolate(C,A,M,I,T,T*T,T*T*T),r(G,c,V)}else if(v)Mh._interpolateArray(_[E],_[E+1],T,i(G,c),g);else{let V;p?(Mh._interpolateArray(_[E],_[E+1],T,R,1),V=Mh.rgba2String(R)):V=Mh._interpolateNumber(_[E],_[E+1],T),r(G,c,V)}for(E=0;E<a;E++)t._onframeList[E](G,W)}},D=new Xst({target:t._target,life:m,loop:t._loop,delay:t._delay,onframe:k,ondestroy:s});e&&e!=="spline"&&(D.easing=e),t._clipList.push(D),t._clipCount++,t.animation.add(D)}};for(var u in this._tracks)l(this._tracks[u],u);return this}stop(){for(var e=0;e<this._clipList.length;e++){var t=this._clipList[e];this.animation.remove(t)}this._clipList=[]}delay(e){return this._delay=e,this}done(e){return e&&this._doneList.push(e),this}}class Jne{constructor(e,t){this.id=e,this.storage=new q8,this.painter=new va(t,this.storage),this.handler=new Hst(t,this.storage,this.painter),this.animatingElements=[],this.animation=new Mh({stage:{update:Jne.getFrameCallback(this)}}),this._needsRefreshNextFrame=!1,this.animation.start(),this.CLASS_NAME="SuperMap.LevelRenderer.Render"}destroy(){this.id=null,this.storage=null,this.painter=null,this.handler=null,this.animatingElements=null,this.animation=null,this._needsRefreshNextFrame=null}getId(){return this.id}addShape(e){return this.storage.addRoot(e),this}addGroup(e){return this.storage.addRoot(e),this}delShape(e){return this.storage.delRoot(e),this}delGroup(e){return this.storage.delRoot(e),this}modShape(e,t){return this.storage.mod(e,t),this}modGroup(e,t){return this.storage.mod(e,t),this}modLayer(e,t){return this.painter.modLayer(e,t),this}addHoverShape(e){return this.storage.addHover(e),this}render(e){return this.painter.render(e),this._needsRefreshNextFrame=!1,this}refresh(e){return this.painter.refresh(e),this._needsRefreshNextFrame=!1,this}refreshNextFrame(){return this._needsRefreshNextFrame=!0,this}refreshHover(e){return this.painter.refreshHover(e),this}refreshShapes(e,t){return this.painter.refreshShapes(e,t),this}resize(){return this.painter.resize(),this}animate(e,t,r){if(typeof e=="string"&&(e=this.storage.get(e)),e){var i;if(t){for(var a=t.split("."),o=e,s=0,l=a.length;s<l;s++)!o||(o=o[a[s]]);o&&(i=o)}else i=e;if(!i){cr.Util_log('Property "'+t+'" is not existed in element '+e.id);return}var u=this.animatingElements;return typeof e.__aniCount>"u"&&(e.__aniCount=0),e.__aniCount===0&&u.push(e),e.__aniCount++,this.animation.animate(i,{loop:r}).done(function(){if(e.__aniCount--,e.__aniCount===0){var h=new Pp().indexOf(u,e);u.splice(h,1)}})}else cr.Util_log("Element not existed")}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(e,t,r){return this.painter.toDataURL(e,t,r)}shapeToImage(e,t,r){var i=H.createUniqueID("SuperMap.LevelRenderer.ToImage_");return this.painter.shapeToImage(i,e,t,r)}on(e,t){return this.handler.on(e,t),this}un(e,t){return this.handler.un(e,t),this}trigger(e,t){return this.handler.trigger(e,t),this.handler.dispatch(e,t),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(e){return this.painter.updateHoverLayer(e),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(e){return function(){var t=e.animatingElements;if(t instanceof Array){for(var r=0,i=t.length;r<i;r++)e.storage.mod(t[r].id);(t.length||e._needsRefreshNextFrame)&&e.refresh()}}}}class Gg{constructor(){Gg._instances={},Gg.Tool={},this.version="2.0.4",this.CLASS_NAME="SuperMap.LevelRenderer"}destroy(){this.dispose(),this.version=null}init(e){var t=new Jne(H.createUniqueID("LRenderer_"),e);return Gg._instances[t.id]=t,t}dispose(e){if(e)e.dispose(),this.delInstance(e.id);else{for(var t in Gg._instances)Gg._instances[t].dispose();Gg._instances={}}return this}getInstance(e){return Gg._instances[e]}delInstance(e){return delete Gg._instances[e],this}}const UF={EXCEL:"EXCEL",CSV:"CSV",ISERVER:"ISERVER",GEOJSON:"GEOJSON",JSON:"JSON"};class UNe{constructor(){this._initView()}_initView(){const e=document.createElement("div");e.hidden=!0,e.setAttribute("class","component-messageboxcontainer component-border-bottom-orange");const t=document.createElement("div");t.setAttribute("class","icon"),this.icon=document.createElement("span"),this.icon.setAttribute("class","supermapol-icons-message-warning"),t.appendChild(this.icon),e.appendChild(t);const r=document.createElement("div");r.setAttribute("class","component-messagebox"),r.innerHTML="",e.appendChild(r),this.messageBox=r;const i=document.createElement("div");i.setAttribute("class","component-messagebox__cancelbtncontainer");const a=document.createElement("button");a.setAttribute("class","component-messagebox__cancelBtn"),a.innerHTML="x",a.onclick=this.closeView.bind(this),i.appendChild(a),e.appendChild(i),this.messageBoxContainer=e,document.body.appendChild(this.messageBoxContainer)}closeView(){this.messageBoxContainer.hidden=!0}showView(e,t="warring"){t==="success"?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):t==="failure"?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):t==="warring"&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=e,this.messageBoxContainer.hidden=!1}}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var PK=function(n,e){return PK=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},PK(n,e)};function $e(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");PK(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var qst=function(){function n(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return n}(),Zst=function(){function n(){this.browser=new qst,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return n}(),Lb=new Zst;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Lb.wxa=!0,Lb.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Lb.worker=!0:typeof navigator>"u"?(Lb.node=!0,Lb.svgSupported=!0):Kst(navigator.userAgent,Lb);function Kst(n,e){var t=e.browser,r=n.match(/Firefox\/([\d.]+)/),i=n.match(/MSIE\s([\d.]+)/)||n.match(/Trident\/.+?rv:(([\d.]+))/),a=n.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(n);r&&(t.firefox=!0,t.version=r[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}const sa=Lb;var Qne=12,VNe="sans-serif",RS=Qne+"px "+VNe,Jst=20,Qst=100,elt="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function tlt(n){var e={};if(typeof JSON>"u")return e;for(var t=0;t<n.length;t++){var r=String.fromCharCode(t+32),i=(n.charCodeAt(t)-Jst)/Qst;e[r]=i}return e}var rlt=tlt(elt),s_={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var n,e;return function(t,r){if(!n){var i=s_.createCanvas();n=i&&i.getContext("2d")}if(n)return e!==r&&(e=n.font=r||RS),n.measureText(t);t=t||"",r=r||RS;var a=/(\d+)px/.exec(r),o=a&&+a[1]||Qne,s=0;if(r.indexOf("mono")>=0)s=o*t.length;else for(var l=0;l<t.length;l++){var u=rlt[t[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(n,e,t){var r=new Image;return r.onload=e,r.onerror=t,r.src=n,r}},$Ne=om(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(n,e){return n["[object "+e+"]"]=!0,n},{}),WNe=om(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(n,e){return n["[object "+e+"Array]"]=!0,n},{}),MI=Object.prototype.toString,Gz=Array.prototype,nlt=Gz.forEach,ilt=Gz.filter,eie=Gz.slice,alt=Gz.map,Qde=function(){}.constructor,VF=Qde?Qde.prototype:null,tie="__proto__",olt=2311;function HNe(){return olt++}function rie(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];typeof console<"u"&&console.error.apply(console,n)}function Sn(n){if(n==null||typeof n!="object")return n;var e=n,t=MI.call(n);if(t==="[object Array]"){if(!$O(n)){e=[];for(var r=0,i=n.length;r<i;r++)e[r]=Sn(n[r])}}else if(WNe[t]){if(!$O(n)){var a=n.constructor;if(a.from)e=a.from(n);else{e=new a(n.length);for(var r=0,i=n.length;r<i;r++)e[r]=n[r]}}}else if(!$Ne[t]&&!$O(n)&&!QR(n)){e={};for(var o in n)n.hasOwnProperty(o)&&o!==tie&&(e[o]=Sn(n[o]))}return e}function ii(n,e,t){if(!dn(e)||!dn(n))return t?Sn(e):n;for(var r in e)if(e.hasOwnProperty(r)&&r!==tie){var i=n[r],a=e[r];dn(a)&&dn(i)&&!Gt(a)&&!Gt(i)&&!QR(a)&&!QR(i)&&!eve(a)&&!eve(i)&&!$O(a)&&!$O(i)?ii(i,a,t):(t||!(r in n))&&(n[r]=Sn(e[r]))}return n}function nie(n,e){for(var t=n[0],r=1,i=n.length;r<i;r++)t=ii(t,n[r],e);return t}function Mt(n,e){if(Object.assign)Object.assign(n,e);else for(var t in e)e.hasOwnProperty(t)&&t!==tie&&(n[t]=e[t]);return n}function sn(n,e,t){for(var r=Li(e),i=0;i<r.length;i++){var a=r[i];(t?e[a]!=null:n[a]==null)&&(n[a]=e[a])}return n}s_.createCanvas;function gi(n,e){if(n){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t}return-1}function slt(n,e){var t=n.prototype;function r(){}r.prototype=e.prototype,n.prototype=new r;for(var i in t)t.hasOwnProperty(i)&&(n.prototype[i]=t[i]);n.prototype.constructor=n,n.superClass=e}function gu(n,e,t){if(n="prototype"in n?n.prototype:n,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var a=r[i];a!=="constructor"&&(t?e[a]!=null:n[a]==null)&&(n[a]=e[a])}else sn(n,e,t)}function Yc(n){return!n||typeof n=="string"?!1:typeof n.length=="number"}function te(n,e,t){if(!!(n&&e))if(n.forEach&&n.forEach===nlt)n.forEach(e,t);else if(n.length===+n.length)for(var r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);else for(var a in n)n.hasOwnProperty(a)&&e.call(t,n[a],a,n)}function Vt(n,e,t){if(!n)return[];if(!e)return iie(n);if(n.map&&n.map===alt)return n.map(e,t);for(var r=[],i=0,a=n.length;i<a;i++)r.push(e.call(t,n[i],i,n));return r}function om(n,e,t,r){if(!!(n&&e)){for(var i=0,a=n.length;i<a;i++)t=e.call(r,t,n[i],i,n);return t}}function To(n,e,t){if(!n)return[];if(!e)return iie(n);if(n.filter&&n.filter===ilt)return n.filter(e,t);for(var r=[],i=0,a=n.length;i<a;i++)e.call(t,n[i],i,n)&&r.push(n[i]);return r}function llt(n,e,t){if(!!(n&&e)){for(var r=0,i=n.length;r<i;r++)if(e.call(t,n[r],r,n))return n[r]}}function Li(n){if(!n)return[];if(Object.keys)return Object.keys(n);var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push(t);return e}function ult(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return function(){return n.apply(e,t.concat(eie.call(arguments)))}}var kr=VF&&rn(VF.bind)?VF.call.bind(VF.bind):ult;function Un(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return function(){return n.apply(this,e.concat(eie.call(arguments)))}}function Gt(n){return Array.isArray?Array.isArray(n):MI.call(n)==="[object Array]"}function rn(n){return typeof n=="function"}function Or(n){return typeof n=="string"}function OK(n){return MI.call(n)==="[object String]"}function ha(n){return typeof n=="number"}function dn(n){var e=typeof n;return e==="function"||!!n&&e==="object"}function eve(n){return!!$Ne[MI.call(n)]}function Ev(n){return!!WNe[MI.call(n)]}function QR(n){return typeof n=="object"&&typeof n.nodeType=="number"&&typeof n.ownerDocument=="object"}function zz(n){return n.colorStops!=null}function hlt(n){return n.image!=null}function clt(n){return MI.call(n)==="[object RegExp]"}function eD(n){return n!==n}function Gh(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=0,r=n.length;t<r;t++)if(n[t]!=null)return n[t]}function ni(n,e){return n!=null?n:e}function qy(n,e,t){return n!=null?n:e!=null?e:t}function iie(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return eie.apply(n,e)}function aie(n){if(typeof n=="number")return[n,n,n,n];var e=n.length;return e===2?[n[0],n[1],n[0],n[1]]:e===3?[n[0],n[1],n[2],n[1]]:n}function Bf(n,e){if(!n)throw new Error(e)}function Qg(n){return n==null?null:typeof n.trim=="function"?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var jNe="__ec_primitive__";function Z8(n){n[jNe]=!0}function $O(n){return n[jNe]}var flt=function(){function n(){this.data={}}return n.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},n.prototype.has=function(e){return this.data.hasOwnProperty(e)},n.prototype.get=function(e){return this.data[e]},n.prototype.set=function(e,t){return this.data[e]=t,this},n.prototype.keys=function(){return Li(this.data)},n.prototype.forEach=function(e){var t=this.data;for(var r in t)t.hasOwnProperty(r)&&e(t[r],r)},n}(),XNe=typeof Map=="function";function dlt(){return XNe?new Map:new flt}var vlt=function(){function n(e){var t=Gt(e);this.data=dlt();var r=this;e instanceof n?e.each(i):e&&te(e,i);function i(a,o){t?r.set(a,o):r.set(o,a)}}return n.prototype.hasKey=function(e){return this.data.has(e)},n.prototype.get=function(e){return this.data.get(e)},n.prototype.set=function(e,t){return this.data.set(e,t),t},n.prototype.each=function(e,t){this.data.forEach(function(r,i){e.call(t,r,i)})},n.prototype.keys=function(){var e=this.data.keys();return XNe?Array.from(e):e},n.prototype.removeKey=function(e){this.data.delete(e)},n}();function $r(n){return new vlt(n)}function K8(n,e){for(var t=new n.constructor(n.length+e.length),r=0;r<n.length;r++)t[r]=n[r];for(var i=n.length,r=0;r<e.length;r++)t[r+i]=e[r];return t}function Uz(n,e){var t;if(Object.create)t=Object.create(n);else{var r=function(){};r.prototype=n,t=new r}return e&&Mt(t,e),t}function YNe(n){var e=n.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function Fr(n,e){return n.hasOwnProperty(e)}function Hl(){}var yB=180/Math.PI;function H2(n,e){return n==null&&(n=0),e==null&&(e=0),[n,e]}function mf(n,e){return n[0]=e[0],n[1]=e[1],n}function V1(n){return[n[0],n[1]]}function plt(n,e,t){return n[0]=e,n[1]=t,n}function tve(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n}function RK(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n}function tE(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function DK(n){return Math.sqrt(glt(n))}function glt(n){return n[0]*n[0]+n[1]*n[1]}function mB(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n}function II(n,e){var t=DK(e);return t===0?(n[0]=0,n[1]=0):(n[0]=e[0]/t,n[1]=e[1]/t),n}function NK(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}var Zx=NK;function ylt(n,e){return(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])}var wE=ylt;function _B(n,e,t,r){return n[0]=e[0]+r*(t[0]-e[0]),n[1]=e[1]+r*(t[1]-e[1]),n}function cc(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[2]*i+t[4],n[1]=t[1]*r+t[3]*i+t[5],n}function Kx(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n}function Jx(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n}var zT=function(){function n(e,t){this.target=e,this.topTarget=t&&t.topTarget}return n}(),mlt=function(){function n(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return n.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new zT(t,e),"dragstart",e.event))},n.prototype._drag=function(e){var t=this._draggingTarget;if(t){var r=e.offsetX,i=e.offsetY,a=r-this._x,o=i-this._y;this._x=r,this._y=i,t.drift(a,o,e),this.handler.dispatchToElement(new zT(t,e),"drag",e.event);var s=this.handler.findHover(r,i,t).target,l=this._dropTarget;this._dropTarget=s,t!==s&&(l&&s!==l&&this.handler.dispatchToElement(new zT(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new zT(s,e),"dragenter",e.event))}},n.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new zT(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new zT(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},n}();const _lt=mlt;var xlt=function(){function n(e){e&&(this._$eventProcessor=e)}return n.prototype.on=function(e,t,r,i){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof t=="function"&&(i=r,r=t,t=null),!r||!e)return this;var o=this._$eventProcessor;t!=null&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),a[e]||(a[e]=[]);for(var s=0;s<a[e].length;s++)if(a[e][s].h===r)return this;var l={h:r,query:t,ctx:i||this,callAtLast:r.zrEventfulCallAtLast},u=a[e].length-1,h=a[e][u];return h&&h.callAtLast?a[e].splice(u,0,l):a[e].push(l),this},n.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},n.prototype.off=function(e,t){var r=this._$handlers;if(!r)return this;if(!e)return this._$handlers={},this;if(t){if(r[e]){for(var i=[],a=0,o=r[e].length;a<o;a++)r[e][a].h!==t&&i.push(r[e][a]);r[e]=i}r[e]&&r[e].length===0&&delete r[e]}else delete r[e];return this},n.prototype.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[e],a=this._$eventProcessor;if(i)for(var o=t.length,s=i.length,l=0;l<s;l++){var u=i[l];if(!(a&&a.filter&&u.query!=null&&!a.filter(e,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);break;case 2:u.h.call(u.ctx,t[0],t[1]);break;default:u.h.apply(u.ctx,t);break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},n.prototype.triggerWithContext=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[e],a=this._$eventProcessor;if(i)for(var o=t.length,s=t[o-1],l=i.length,u=0;u<l;u++){var h=i[u];if(!(a&&a.filter&&h.query!=null&&!a.filter(e,h.query)))switch(o){case 0:h.h.call(s);break;case 1:h.h.call(s,t[0]);break;case 2:h.h.call(s,t[0],t[1]);break;default:h.h.apply(s,t.slice(1,o-1));break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},n}();const ng=xlt;var Slt=Math.log(2);function kK(n,e,t,r,i,a){var o=r+"-"+i,s=n.length;if(a.hasOwnProperty(o))return a[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~i)/Slt);return n[t][l]}for(var u=r|1<<t,h=t+1;r&1<<h;)h++;for(var c=0,f=0,d=0;f<s;f++){var v=1<<f;v&i||(c+=(d%2?-1:1)*n[t][f]*kK(n,e-1,h,u,i|v,a),d++)}return a[o]=c,c}function rve(n,e){var t=[[n[0],n[1],1,0,0,0,-e[0]*n[0],-e[0]*n[1]],[0,0,0,n[0],n[1],1,-e[1]*n[0],-e[1]*n[1]],[n[2],n[3],1,0,0,0,-e[2]*n[2],-e[2]*n[3]],[0,0,0,n[2],n[3],1,-e[3]*n[2],-e[3]*n[3]],[n[4],n[5],1,0,0,0,-e[4]*n[4],-e[4]*n[5]],[0,0,0,n[4],n[5],1,-e[5]*n[4],-e[5]*n[5]],[n[6],n[7],1,0,0,0,-e[6]*n[6],-e[6]*n[7]],[0,0,0,n[6],n[7],1,-e[7]*n[6],-e[7]*n[7]]],r={},i=kK(t,8,0,0,0,r);if(i!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]==null&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*kK(t,7,o===0?1:0,1<<o,1<<s,r)/i*e[o];return function(l,u,h){var c=u*a[6]+h*a[7]+1;l[0]=(u*a[0]+h*a[1]+a[2])/c,l[1]=(u*a[3]+h*a[4]+a[5])/c}}}var nve="___zrEVENTSAVED",HW=[];function wlt(n,e,t,r,i){return FK(HW,e,r,i,!0)&&FK(n,t,HW[0],HW[1])}function FK(n,e,t,r,i){if(e.getBoundingClientRect&&sa.domSupported&&!qNe(e)){var a=e[nve]||(e[nve]={}),o=blt(e,a),s=Elt(o,a,i);if(s)return s(n,t,r),!0}return!1}function blt(n,e){var t=e.markers;if(t)return t;t=e.markers=[];for(var r=["left","right"],i=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,u=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[l]+":0",i[u]+":0",r[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),n.appendChild(o),t.push(o)}return t}function Elt(n,e,t){for(var r=t?"invTrans":"trans",i=e[r],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var h=n[u].getBoundingClientRect(),c=2*u,f=h.left,d=h.top;o.push(f,d),l=l&&a&&f===a[c]&&d===a[c+1],s.push(n[u].offsetLeft,n[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[r]=t?rve(s,o):rve(o,s))}function qNe(n){return n.nodeName.toUpperCase()==="CANVAS"}var Tlt=/([&<>"'])/g,Clt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function od(n){return n==null?"":(n+"").replace(Tlt,function(e,t){return Clt[t]})}var Alt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,jW=[],Mlt=sa.browser.firefox&&+sa.browser.version.split(".")[0]<39;function BK(n,e,t,r){return t=t||{},r?ive(n,e,t):Mlt&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):ive(n,e,t),t}function ive(n,e,t){if(sa.domSupported&&n.getBoundingClientRect){var r=e.clientX,i=e.clientY;if(qNe(n)){var a=n.getBoundingClientRect();t.zrX=r-a.left,t.zrY=i-a.top;return}else if(FK(jW,n,r,i)){t.zrX=jW[0],t.zrY=jW[1];return}}t.zrX=t.zrY=0}function oie(n){return n||window.event}function lp(n,e,t){if(e=oie(e),e.zrX!=null)return e;var r=e.type,i=r&&r.indexOf("touch")>=0;if(i){var o=r!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&BK(n,o,e,t)}else{BK(n,e,e,t);var a=Ilt(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&Alt.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function Ilt(n){var e=n.wheelDelta;if(e)return e;var t=n.deltaX,r=n.deltaY;if(t==null||r==null)return e;var i=Math.abs(r!==0?r:t),a=r>0?-1:r<0?1:t>0?-1:1;return 3*i*a}function GK(n,e,t,r){n.addEventListener(e,t,r)}function Llt(n,e,t,r){n.removeEventListener(e,t,r)}var l_=function(n){n.preventDefault(),n.stopPropagation(),n.cancelBubble=!0};function ave(n){return n.which===2||n.which===3}var Plt=function(){function n(){this._track=[]}return n.prototype.recognize=function(e,t,r){return this._doTrack(e,t,r),this._recognize(e)},n.prototype.clear=function(){return this._track.length=0,this},n.prototype._doTrack=function(e,t,r){var i=e.touches;if(!!i){for(var a={points:[],touches:[],target:t,event:e},o=0,s=i.length;o<s;o++){var l=i[o],u=BK(r,l,{});a.points.push([u.zrX,u.zrY]),a.touches.push(l)}this._track.push(a)}},n.prototype._recognize=function(e){for(var t in XW)if(XW.hasOwnProperty(t)){var r=XW[t](this._track,e);if(r)return r}},n}();function ove(n){var e=n[1][0]-n[0][0],t=n[1][1]-n[0][1];return Math.sqrt(e*e+t*t)}function Olt(n){return[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]}var XW={pinch:function(n,e){var t=n.length;if(!!t){var r=(n[t-1]||{}).points,i=(n[t-2]||{}).points||r;if(i&&i.length>1&&r&&r.length>1){var a=ove(r)/ove(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=Olt(r);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:n[0].target,event:e}}}}};function Up(){return[1,0,0,1,0,0]}function Vz(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n}function sie(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function $1(n,e,t){var r=e[0]*t[0]+e[2]*t[1],i=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n}function sm(n,e,t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4]+t[0],n[5]=e[5]+t[1],n}function j2(n,e,t){var r=e[0],i=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(t),h=Math.cos(t);return n[0]=r*h+o*u,n[1]=-r*u+o*h,n[2]=i*h+s*u,n[3]=-i*u+h*s,n[4]=h*a+u*l,n[5]=h*l-u*a,n}function lie(n,e,t){var r=t[0],i=t[1];return n[0]=e[0]*r,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*i,n}function LI(n,e){var t=e[0],r=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*r;return l?(l=1/l,n[0]=o*l,n[1]=-a*l,n[2]=-r*l,n[3]=t*l,n[4]=(r*s-o*i)*l,n[5]=(a*i-t*s)*l,n):null}function Rlt(n){var e=Up();return sie(e,n),e}var Dlt=function(){function n(e,t){this.x=e||0,this.y=t||0}return n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.set=function(e,t){return this.x=e,this.y=t,this},n.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},n.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},n.prototype.scale=function(e){this.x*=e,this.y*=e},n.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},n.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},n.prototype.dot=function(e){return this.x*e.x+this.y*e.y},n.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},n.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},n.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},n.prototype.distanceSquare=function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},n.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},n.prototype.transform=function(e){if(!!e){var t=this.x,r=this.y;return this.x=e[0]*t+e[2]*r+e[4],this.y=e[1]*t+e[3]*r+e[5],this}},n.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},n.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},n.set=function(e,t,r){e.x=t,e.y=r},n.copy=function(e,t){e.x=t.x,e.y=t.y},n.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},n.lenSquare=function(e){return e.x*e.x+e.y*e.y},n.dot=function(e,t){return e.x*t.x+e.y*t.y},n.add=function(e,t,r){e.x=t.x+r.x,e.y=t.y+r.y},n.sub=function(e,t,r){e.x=t.x-r.x,e.y=t.y-r.y},n.scale=function(e,t,r){e.x=t.x*r,e.y=t.y*r},n.scaleAndAdd=function(e,t,r,i){e.x=t.x+r.x*i,e.y=t.y+r.y*i},n.lerp=function(e,t,r,i){var a=1-i;e.x=a*t.x+i*r.x,e.y=a*t.y+i*r.y},n}();const qn=Dlt;var $F=Math.min,WF=Math.max,Ww=new qn,Hw=new qn,jw=new qn,Xw=new qn,VL=new qn,$L=new qn,Nlt=function(){function n(e,t,r,i){r<0&&(e=e+r,r=-r),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=r,this.height=i}return n.prototype.union=function(e){var t=$F(e.x,this.x),r=$F(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=WF(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=WF(e.y+e.height,this.y+this.height)-r:this.height=e.height,this.x=t,this.y=r},n.prototype.applyTransform=function(e){n.applyTransform(this,this,e)},n.prototype.calculateTransform=function(e){var t=this,r=e.width/t.width,i=e.height/t.height,a=Up();return sm(a,a,[-t.x,-t.y]),lie(a,a,[r,i]),sm(a,a,[e.x,e.y]),a},n.prototype.intersect=function(e,t){if(!e)return!1;e instanceof n||(e=n.create(e));var r=this,i=r.x,a=r.x+r.width,o=r.y,s=r.y+r.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,f=!(a<l||u<i||s<h||c<o);if(t){var d=1/0,v=0,p=Math.abs(a-l),g=Math.abs(u-i),m=Math.abs(s-h),y=Math.abs(c-o),_=Math.min(p,g),x=Math.min(m,y);a<l||u<i?_>v&&(v=_,p<g?qn.set($L,-p,0):qn.set($L,g,0)):_<d&&(d=_,p<g?qn.set(VL,p,0):qn.set(VL,-g,0)),s<h||c<o?x>v&&(v=x,m<y?qn.set($L,0,-m):qn.set($L,0,y)):_<d&&(d=_,m<y?qn.set(VL,0,m):qn.set(VL,0,-y))}return t&&qn.copy(t,f?VL:$L),f},n.prototype.contain=function(e,t){var r=this;return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},n.prototype.clone=function(){return new n(this.x,this.y,this.width,this.height)},n.prototype.copy=function(e){n.copy(this,e)},n.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},n.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},n.prototype.isZero=function(){return this.width===0||this.height===0},n.create=function(e){return new n(e.x,e.y,e.width,e.height)},n.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},n.applyTransform=function(e,t,r){if(!r){e!==t&&n.copy(e,t);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],a=r[3],o=r[4],s=r[5];e.x=t.x*i+o,e.y=t.y*a+s,e.width=t.width*i,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Ww.x=jw.x=t.x,Ww.y=Xw.y=t.y,Hw.x=Xw.x=t.x+t.width,Hw.y=jw.y=t.y+t.height,Ww.transform(r),Xw.transform(r),Hw.transform(r),jw.transform(r),e.x=$F(Ww.x,Hw.x,jw.x,Xw.x),e.y=$F(Ww.y,Hw.y,jw.y,Xw.y);var l=WF(Ww.x,Hw.x,jw.x,Xw.x),u=WF(Ww.y,Hw.y,jw.y,Xw.y);e.width=l-e.x,e.height=u-e.y},n}();const ai=Nlt;var ZNe="silent";function klt(n,e,t){return{type:n,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:Flt}}function Flt(){l_(this.event)}var Blt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(ng),WL=function(){function n(e,t){this.x=e,this.y=t}return n}(),Glt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],YW=new ai(0,0,0,0),KNe=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this)||this;return s._hovered=new WL(0,0),s.storage=t,s.painter=r,s.painterRoot=a,s._pointerSize=o,i=i||new Blt,s.proxy=null,s.setHandlerProxy(i),s._draggingMgr=new _lt(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(te(Glt,function(r){t.on&&t.on(r,this[r],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var r=t.zrX,i=t.zrY,a=JNe(this,r,i),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new WL(r,i):this.findHover(r,i),u=l.target,h=this.proxy;h.setCursor&&h.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var r=t.zrEventControl;r!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),r!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new WL(0,0)},e.prototype.dispatch=function(t,r){var i=this[t];i&&i.call(this,r)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var r=this.proxy;r.setCursor&&r.setCursor(t)},e.prototype.dispatchToElement=function(t,r,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+r,s=klt(r,t,i);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(r,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(r,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(r,s)}))}},e.prototype.findHover=function(t,r,i){var a=this.storage.getDisplayList(),o=new WL(t,r);if(sve(a,o,t,r,i),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,h=new ai(t-u,r-u,l,l),c=a.length-1;c>=0;c--){var f=a[c];f!==i&&!f.ignore&&!f.ignoreCoarsePointer&&(!f.parent||!f.parent.ignoreCoarsePointer)&&(YW.copy(f.getBoundingRect()),f.transform&&YW.applyTransform(f.transform),YW.intersect(h)&&s.push(f))}if(s.length)for(var d=4,v=Math.PI/12,p=Math.PI*2,g=0;g<u;g+=d)for(var m=0;m<p;m+=v){var y=t+g*Math.cos(m),_=r+g*Math.sin(m);if(sve(s,o,y,_,i),o.target)return o}}return o},e.prototype.processGesture=function(t,r){this._gestureMgr||(this._gestureMgr=new Plt);var i=this._gestureMgr;r==="start"&&i.clear();var a=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if(r==="end"&&i.clear(),a){var o=a.type;t.gestureEvent=o;var s=new WL;s.target=a.target,this.dispatchToElement(s,o,a.event)}},e}(ng);te(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(n){KNe.prototype[n]=function(e){var t=e.zrX,r=e.zrY,i=JNe(this,t,r),a,o;if((n!=="mouseup"||!i)&&(a=this.findHover(t,r),o=a.target),n==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(n==="mouseup")this._upEl=o;else if(n==="click"){if(this._downEl!==this._upEl||!this._downPoint||Zx(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,n,e)}});function zlt(n,e,t){if(n[n.rectHover?"rectContain":"contain"](e,t)){for(var r=n,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(e,t))return!1;r.silent&&(i=!0)}var s=r.__hostTarget;r=s||r.parent}return i?ZNe:!0}return!1}function sve(n,e,t,r,i){for(var a=n.length-1;a>=0;a--){var o=n[a],s=void 0;if(o!==i&&!o.ignore&&(s=zlt(o,t,r))&&(!e.topTarget&&(e.topTarget=o),s!==ZNe)){e.target=o;break}}}function JNe(n,e,t){var r=n.painter;return e<0||e>r.getWidth()||t<0||t>r.getHeight()}const Ult=KNe;var QNe=32,HL=7;function Vlt(n){for(var e=0;n>=QNe;)e|=n&1,n>>=1;return n+e}function lve(n,e,t,r){var i=e+1;if(i===t)return 1;if(r(n[i++],n[e])<0){for(;i<t&&r(n[i],n[i-1])<0;)i++;$lt(n,e,i)}else for(;i<t&&r(n[i],n[i-1])>=0;)i++;return i-e}function $lt(n,e,t){for(t--;e<t;){var r=n[e];n[e++]=n[t],n[t--]=r}}function uve(n,e,t,r,i){for(r===e&&r++;r<t;r++){for(var a=n[r],o=e,s=r,l;o<s;)l=o+s>>>1,i(a,n[l])<0?s=l:o=l+1;var u=r-o;switch(u){case 3:n[o+3]=n[o+2];case 2:n[o+2]=n[o+1];case 1:n[o+1]=n[o];break;default:for(;u>0;)n[o+u]=n[o+u-1],u--}n[o]=a}}function qW(n,e,t,r,i,a){var o=0,s=0,l=1;if(a(n,e[t+i])>0){for(s=r-i;l<s&&a(n,e[t+i+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;l<s&&a(n,e[t+i-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o<l;){var h=o+(l-o>>>1);a(n,e[t+h])>0?o=h+1:l=h}return l}function ZW(n,e,t,r,i,a){var o=0,s=0,l=1;if(a(n,e[t+i])<0){for(s=i+1;l<s&&a(n,e[t+i-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=r-i;l<s&&a(n,e[t+i+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o<l;){var h=o+(l-o>>>1);a(n,e[t+h])<0?l=h:o=h+1}return l}function Wlt(n,e){var t=HL,r,i,a=0;n.length;var o=[];r=[],i=[];function s(d,v){r[a]=d,i[a]=v,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]<i[d+1]&&d--;else if(i[d]>i[d+1])break;h(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]<i[d+1]&&d--,h(d)}}function h(d){var v=r[d],p=i[d],g=r[d+1],m=i[d+1];i[d]=p+m,d===a-3&&(r[d+1]=r[d+2],i[d+1]=i[d+2]),a--;var y=ZW(n[g],n,v,p,0,e);v+=y,p-=y,p!==0&&(m=qW(n[v+p-1],n,g,m,m-1,e),m!==0&&(p<=m?c(v,p,g,m):f(v,p,g,m)))}function c(d,v,p,g){var m=0;for(m=0;m<v;m++)o[m]=n[d+m];var y=0,_=p,x=d;if(n[x++]=n[_++],--g===0){for(m=0;m<v;m++)n[x+m]=o[y+m];return}if(v===1){for(m=0;m<g;m++)n[x+m]=n[_+m];n[x+g]=o[y];return}for(var S=t,w,b,E;;){w=0,b=0,E=!1;do if(e(n[_],o[y])<0){if(n[x++]=n[_++],b++,w=0,--g===0){E=!0;break}}else if(n[x++]=o[y++],w++,b=0,--v===1){E=!0;break}while((w|b)<S);if(E)break;do{if(w=ZW(n[_],o,y,v,0,e),w!==0){for(m=0;m<w;m++)n[x+m]=o[y+m];if(x+=w,y+=w,v-=w,v<=1){E=!0;break}}if(n[x++]=n[_++],--g===0){E=!0;break}if(b=qW(o[y],n,_,g,0,e),b!==0){for(m=0;m<b;m++)n[x+m]=n[_+m];if(x+=b,_+=b,g-=b,g===0){E=!0;break}}if(n[x++]=o[y++],--v===1){E=!0;break}S--}while(w>=HL||b>=HL);if(E)break;S<0&&(S=0),S+=2}if(t=S,t<1&&(t=1),v===1){for(m=0;m<g;m++)n[x+m]=n[_+m];n[x+g]=o[y]}else{if(v===0)throw new Error;for(m=0;m<v;m++)n[x+m]=o[y+m]}}function f(d,v,p,g){var m=0;for(m=0;m<g;m++)o[m]=n[p+m];var y=d+v-1,_=g-1,x=p+g-1,S=0,w=0;if(n[x--]=n[y--],--v===0){for(S=x-(g-1),m=0;m<g;m++)n[S+m]=o[m];return}if(g===1){for(x-=v,y-=v,w=x+1,S=y+1,m=v-1;m>=0;m--)n[w+m]=n[S+m];n[x]=o[_];return}for(var b=t;;){var E=0,T=0,C=!1;do if(e(o[_],n[y])<0){if(n[x--]=n[y--],E++,T=0,--v===0){C=!0;break}}else if(n[x--]=o[_--],T++,E=0,--g===1){C=!0;break}while((E|T)<b);if(C)break;do{if(E=v-ZW(o[_],n,d,v,v-1,e),E!==0){for(x-=E,y-=E,v-=E,w=x+1,S=y+1,m=E-1;m>=0;m--)n[w+m]=n[S+m];if(v===0){C=!0;break}}if(n[x--]=o[_--],--g===1){C=!0;break}if(T=g-qW(n[y],o,0,g,g-1,e),T!==0){for(x-=T,_-=T,g-=T,w=x+1,S=_+1,m=0;m<T;m++)n[w+m]=o[S+m];if(g<=1){C=!0;break}}if(n[x--]=n[y--],--v===0){C=!0;break}b--}while(E>=HL||T>=HL);if(C)break;b<0&&(b=0),b+=2}if(t=b,t<1&&(t=1),g===1){for(x-=v,y-=v,w=x+1,S=y+1,m=v-1;m>=0;m--)n[w+m]=n[S+m];n[x]=o[_]}else{if(g===0)throw new Error;for(S=x-(g-1),m=0;m<g;m++)n[S+m]=o[m]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:s}}function xB(n,e,t,r){t||(t=0),r||(r=n.length);var i=r-t;if(!(i<2)){var a=0;if(i<QNe){a=lve(n,t,r,e),uve(n,t,r,t+a,e);return}var o=Wlt(n,e),s=Vlt(i);do{if(a=lve(n,t,r,e),a<s){var l=i;l>s&&(l=s),uve(n,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),i-=a,t+=a}while(i!==0);o.forceMergeRuns()}}var ov=1,JP=2,BC=4,hve=!1;function KW(){hve||(hve=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function cve(n,e){return n.zlevel===e.zlevel?n.z===e.z?n.z2-e.z2:n.z-e.z:n.zlevel-e.zlevel}var Hlt=function(){function n(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=cve}return n.prototype.traverse=function(e,t){for(var r=0;r<this._roots.length;r++)this._roots[r].traverse(e,t)},n.prototype.getDisplayList=function(e,t){t=t||!1;var r=this._displayList;return(e||!r.length)&&this.updateDisplayList(t),r},n.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,r=this._displayList,i=0,a=t.length;i<a;i++)this._updateAndAddDisplayable(t[i],null,e);r.length=this._displayListLen,xB(r,cve)},n.prototype._updateAndAddDisplayable=function(e,t,r){if(!(e.ignore&&!r)){e.beforeUpdate(),e.update(),e.afterUpdate();var i=e.getClipPath();if(e.ignoreClip)t=null;else if(i){t?t=t.slice():t=[];for(var a=i,o=e;a;)a.parent=o,a.updateTransform(),t.push(a),o=a,a=a.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var u=s[l];e.__dirty&&(u.__dirty|=ov),this._updateAndAddDisplayable(u,t,r)}e.__dirty=0}else{var h=e;t&&t.length?h.__clipPaths=t:h.__clipPaths&&h.__clipPaths.length>0&&(h.__clipPaths=[]),isNaN(h.z)&&(KW(),h.z=0),isNaN(h.z2)&&(KW(),h.z2=0),isNaN(h.zlevel)&&(KW(),h.zlevel=0),this._displayList[this._displayListLen++]=h}var c=e.getDecalElement&&e.getDecalElement();c&&this._updateAndAddDisplayable(c,t,r);var f=e.getTextGuideLine();f&&this._updateAndAddDisplayable(f,t,r);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,r)}},n.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},n.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,r=e.length;t<r;t++)this.delRoot(e[t]);return}var i=gi(this._roots,e);i>=0&&this._roots.splice(i,1)},n.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},n.prototype.getRoots=function(){return this._roots},n.prototype.dispose=function(){this._displayList=null,this._roots=null},n}();const jlt=Hlt;var e3e;e3e=sa.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(n){return setTimeout(n,16)};const zK=e3e;var SB={linear:function(n){return n},quadraticIn:function(n){return n*n},quadraticOut:function(n){return n*(2-n)},quadraticInOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},cubicIn:function(n){return n*n*n},cubicOut:function(n){return--n*n*n+1},cubicInOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},quarticIn:function(n){return n*n*n*n},quarticOut:function(n){return 1- --n*n*n*n},quarticInOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)},quinticIn:function(n){return n*n*n*n*n},quinticOut:function(n){return--n*n*n*n*n+1},quinticInOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)},sinusoidalIn:function(n){return 1-Math.cos(n*Math.PI/2)},sinusoidalOut:function(n){return Math.sin(n*Math.PI/2)},sinusoidalInOut:function(n){return .5*(1-Math.cos(Math.PI*n))},exponentialIn:function(n){return n===0?0:Math.pow(1024,n-1)},exponentialOut:function(n){return n===1?1:1-Math.pow(2,-10*n)},exponentialInOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)},circularIn:function(n){return 1-Math.sqrt(1-n*n)},circularOut:function(n){return Math.sqrt(1- --n*n)},circularInOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},elasticIn:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)))},elasticOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*n)*Math.sin((n-e)*(2*Math.PI)/r)+1)},elasticInOut:function(n){var e,t=.1,r=.4;return n===0?0:n===1?1:(!t||t<1?(t=1,e=r/4):e=r*Math.asin(1/t)/(2*Math.PI),(n*=2)<1?-.5*(t*Math.pow(2,10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)):t*Math.pow(2,-10*(n-=1))*Math.sin((n-e)*(2*Math.PI)/r)*.5+1)},backIn:function(n){var e=1.70158;return n*n*((e+1)*n-e)},backOut:function(n){var e=1.70158;return--n*n*((e+1)*n+e)+1},backInOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)},bounceIn:function(n){return 1-SB.bounceOut(1-n)},bounceOut:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},bounceInOut:function(n){return n<.5?SB.bounceIn(n*2)*.5:SB.bounceOut(n*2-1)*.5+.5}};const t3e=SB;var HF=Math.pow,yS=Math.sqrt,J8=1e-8,r3e=1e-4,fve=yS(3),jF=1/3,Iy=H2(),wp=H2(),kA=H2();function Qx(n){return n>-J8&&n<J8}function n3e(n){return n>J8||n<-J8}function Qu(n,e,t,r,i){var a=1-i;return a*a*(a*n+3*i*e)+i*i*(i*r+3*a*t)}function dve(n,e,t,r,i){var a=1-i;return 3*(((e-n)*a+2*(t-e)*i)*a+(r-t)*i*i)}function Q8(n,e,t,r,i,a){var o=r+3*(e-t)-n,s=3*(t-e*2+n),l=3*(e-n),u=n-i,h=s*s-3*o*l,c=s*l-9*o*u,f=l*l-3*s*u,d=0;if(Qx(h)&&Qx(c))if(Qx(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[d++]=v)}else{var p=c*c-4*h*f;if(Qx(p)){var g=c/h,v=-s/o+g,m=-g/2;v>=0&&v<=1&&(a[d++]=v),m>=0&&m<=1&&(a[d++]=m)}else if(p>0){var y=yS(p),_=h*s+1.5*o*(-c+y),x=h*s+1.5*o*(-c-y);_<0?_=-HF(-_,jF):_=HF(_,jF),x<0?x=-HF(-x,jF):x=HF(x,jF);var v=(-s-(_+x))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var S=(2*h*s-3*o*c)/(2*yS(h*h*h)),w=Math.acos(S)/3,b=yS(h),E=Math.cos(w),v=(-s-2*b*E)/(3*o),m=(-s+b*(E+fve*Math.sin(w)))/(3*o),T=(-s+b*(E-fve*Math.sin(w)))/(3*o);v>=0&&v<=1&&(a[d++]=v),m>=0&&m<=1&&(a[d++]=m),T>=0&&T<=1&&(a[d++]=T)}}return d}function i3e(n,e,t,r,i){var a=6*t-12*e+6*n,o=9*e+3*r-3*n-9*t,s=3*e-3*n,l=0;if(Qx(o)){if(n3e(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var h=a*a-4*o*s;if(Qx(h))i[0]=-a/(2*o);else if(h>0){var c=yS(h),u=(-a+c)/(2*o),f=(-a-c)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function DS(n,e,t,r,i,a){var o=(e-n)*i+n,s=(t-e)*i+e,l=(r-t)*i+t,u=(s-o)*i+o,h=(l-s)*i+s,c=(h-u)*i+u;a[0]=n,a[1]=o,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=r}function a3e(n,e,t,r,i,a,o,s,l,u,h){var c,f=.005,d=1/0,v,p,g,m;Iy[0]=l,Iy[1]=u;for(var y=0;y<1;y+=.05)wp[0]=Qu(n,t,i,o,y),wp[1]=Qu(e,r,a,s,y),g=wE(Iy,wp),g<d&&(c=y,d=g);d=1/0;for(var _=0;_<32&&!(f<r3e);_++)v=c-f,p=c+f,wp[0]=Qu(n,t,i,o,v),wp[1]=Qu(e,r,a,s,v),g=wE(wp,Iy),v>=0&&g<d?(c=v,d=g):(kA[0]=Qu(n,t,i,o,p),kA[1]=Qu(e,r,a,s,p),m=wE(kA,Iy),p<=1&&m<d?(c=p,d=m):f*=.5);return h&&(h[0]=Qu(n,t,i,o,c),h[1]=Qu(e,r,a,s,c)),yS(d)}function Xlt(n,e,t,r,i,a,o,s,l){for(var u=n,h=e,c=0,f=1/l,d=1;d<=l;d++){var v=d*f,p=Qu(n,t,i,o,v),g=Qu(e,r,a,s,v),m=p-u,y=g-h;c+=Math.sqrt(m*m+y*y),u=p,h=g}return c}function Ph(n,e,t,r){var i=1-r;return i*(i*n+2*r*e)+r*r*t}function UK(n,e,t,r){return 2*((1-r)*(e-n)+r*(t-e))}function Ylt(n,e,t,r,i){var a=n-2*e+t,o=2*(e-n),s=n-r,l=0;if(Qx(a)){if(n3e(o)){var u=-s/o;u>=0&&u<=1&&(i[l++]=u)}}else{var h=o*o-4*a*s;if(Qx(h)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(h>0){var c=yS(h),u=(-o+c)/(2*a),f=(-o-c)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function o3e(n,e,t){var r=n+t-2*e;return r===0?.5:(n-e)/r}function tD(n,e,t,r,i){var a=(e-n)*r+n,o=(t-e)*r+e,s=(o-a)*r+a;i[0]=n,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=t}function s3e(n,e,t,r,i,a,o,s,l){var u,h=.005,c=1/0;Iy[0]=o,Iy[1]=s;for(var f=0;f<1;f+=.05){wp[0]=Ph(n,t,i,f),wp[1]=Ph(e,r,a,f);var d=wE(Iy,wp);d<c&&(u=f,c=d)}c=1/0;for(var v=0;v<32&&!(h<r3e);v++){var p=u-h,g=u+h;wp[0]=Ph(n,t,i,p),wp[1]=Ph(e,r,a,p);var d=wE(wp,Iy);if(p>=0&&d<c)u=p,c=d;else{kA[0]=Ph(n,t,i,g),kA[1]=Ph(e,r,a,g);var m=wE(kA,Iy);g<=1&&m<c?(u=g,c=m):h*=.5}}return l&&(l[0]=Ph(n,t,i,u),l[1]=Ph(e,r,a,u)),yS(c)}function qlt(n,e,t,r,i,a,o){for(var s=n,l=e,u=0,h=1/o,c=1;c<=o;c++){var f=c*h,d=Ph(n,t,i,f),v=Ph(e,r,a,f),p=d-s,g=v-l;u+=Math.sqrt(p*p+g*g),s=d,l=v}return u}var Zlt=/cubic-bezier\(([0-9,\.e ]+)\)/;function uie(n){var e=n&&Zlt.exec(n);if(e){var t=e[1].split(","),r=+Qg(t[0]),i=+Qg(t[1]),a=+Qg(t[2]),o=+Qg(t[3]);if(isNaN(r+i+a+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Q8(0,r,a,1,l,s)&&Qu(0,i,o,1,s[0])}}}var Klt=function(){function n(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Hl,this.ondestroy=e.ondestroy||Hl,this.onrestart=e.onrestart||Hl,e.easing&&this.setEasing(e.easing)}return n.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var r=this._life,i=e-this._startTime-this._pausedTime,a=i/r;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%r;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},n.prototype.pause=function(){this._paused=!0},n.prototype.resume=function(){this._paused=!1},n.prototype.setEasing=function(e){this.easing=e,this.easingFunc=rn(e)?e:t3e[e]||uie(e)},n}();const Jlt=Klt;var l3e=function(){function n(e){this.value=e}return n}(),Qlt=function(){function n(){this._len=0}return n.prototype.insert=function(e){var t=new l3e(e);return this.insertEntry(t),t},n.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},n.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._len--},n.prototype.len=function(){return this._len},n.prototype.clear=function(){this.head=this.tail=null,this._len=0},n}(),eut=function(){function n(e){this._list=new Qlt,this._maxSize=10,this._map={},this._maxSize=e}return n.prototype.put=function(e,t){var r=this._list,i=this._map,a=null;if(i[e]==null){var o=r.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=r.head;r.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new l3e(t),s.key=e,r.insertEntry(s),i[e]=s}return a},n.prototype.get=function(e){var t=this._map[e],r=this._list;if(t!=null)return t!==r.tail&&(r.remove(t),r.insertEntry(t)),t.value},n.prototype.clear=function(){this._list.clear(),this._map={}},n.prototype.len=function(){return this._list.len()},n}();const d3=eut;var vve={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function l0(n){return n=Math.round(n),n<0?0:n>255?255:n}function tut(n){return n=Math.round(n),n<0?0:n>360?360:n}function rD(n){return n<0?0:n>1?1:n}function JW(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?l0(parseFloat(e)/100*255):l0(parseInt(e,10))}function bE(n){var e=n;return e.length&&e.charAt(e.length-1)==="%"?rD(parseFloat(e)/100):rD(parseFloat(e))}function QW(n,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?n+(e-n)*t*6:t*2<1?e:t*3<2?n+(e-n)*(2/3-t)*6:n}function eS(n,e,t){return n+(e-n)*t}function tp(n,e,t,r,i){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function VK(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}var u3e=new d3(20),XF=null;function UT(n,e){XF&&VK(XF,e),XF=u3e.put(n,XF||e.slice())}function gv(n,e){if(!!n){e=e||[];var t=u3e.get(n);if(t)return VK(e,t);n=n+"";var r=n.replace(/ /g,"").toLowerCase();if(r in vve)return VK(e,vve[r]),UT(n,e),e;var i=r.length;if(r.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){tp(e,0,0,0,1);return}return tp(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),UT(n,e),e}else if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){tp(e,0,0,0,1);return}return tp(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),UT(n,e),e}return}var o=r.indexOf("("),s=r.indexOf(")");if(o!==-1&&s+1===i){var l=r.substr(0,o),u=r.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?tp(e,+u[0],+u[1],+u[2],1):tp(e,0,0,0,1);h=bE(u.pop());case"rgb":if(u.length>=3)return tp(e,JW(u[0]),JW(u[1]),JW(u[2]),u.length===3?h:bE(u[3])),UT(n,e),e;tp(e,0,0,0,1);return;case"hsla":if(u.length!==4){tp(e,0,0,0,1);return}return u[3]=bE(u[3]),$K(u,e),UT(n,e),e;case"hsl":if(u.length!==3){tp(e,0,0,0,1);return}return $K(u,e),UT(n,e),e;default:return}}tp(e,0,0,0,1)}}function $K(n,e){var t=(parseFloat(n[0])%360+360)%360/360,r=bE(n[1]),i=bE(n[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return e=e||[],tp(e,l0(QW(o,a,t+1/3)*255),l0(QW(o,a,t)*255),l0(QW(o,a,t-1/3)*255),1),n.length===4&&(e[3]=n[3]),e}function rut(n){if(!!n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.min(e,t,r),a=Math.max(e,t,r),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var h=((a-e)/6+o/2)/o,c=((a-t)/6+o/2)/o,f=((a-r)/6+o/2)/o;e===a?l=f-c:t===a?l=1/3+h-f:r===a&&(l=2/3+c-h),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return n[3]!=null&&d.push(n[3]),d}}function WK(n,e){var t=gv(n);if(t){for(var r=0;r<3;r++)e<0?t[r]=t[r]*(1-e)|0:t[r]=(255-t[r])*e+t[r]|0,t[r]>255?t[r]=255:t[r]<0&&(t[r]=0);return W1(t,t.length===4?"rgba":"rgb")}}function eH(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){t=t||[];var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),o=e[i],s=e[a],l=r-i;return t[0]=l0(eS(o[0],s[0],l)),t[1]=l0(eS(o[1],s[1],l)),t[2]=l0(eS(o[2],s[2],l)),t[3]=rD(eS(o[3],s[3],l)),t}}function nut(n,e,t){if(!(!(e&&e.length)||!(n>=0&&n<=1))){var r=n*(e.length-1),i=Math.floor(r),a=Math.ceil(r),o=gv(e[i]),s=gv(e[a]),l=r-i,u=W1([l0(eS(o[0],s[0],l)),l0(eS(o[1],s[1],l)),l0(eS(o[2],s[2],l)),rD(eS(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:r}:u}}function WO(n,e,t,r){var i=gv(n);if(n)return i=rut(i),e!=null&&(i[0]=tut(e)),t!=null&&(i[1]=bE(t)),r!=null&&(i[2]=bE(r)),W1($K(i),"rgba")}function eG(n,e){var t=gv(n);if(t&&e!=null)return t[3]=rD(e),W1(t,"rgba")}function W1(n,e){if(!(!n||!n.length)){var t=n[0]+","+n[1]+","+n[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+n[3]),e+"("+t+")"}}function tG(n,e){var t=gv(n);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var rG=Math.round;function nD(n){var e;if(!n||n==="transparent")n="none";else if(typeof n=="string"&&n.indexOf("rgba")>-1){var t=gv(n);t&&(n="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:n,opacity:e==null?1:e}}var pve=1e-4;function tS(n){return n<pve&&n>-pve}function YF(n){return rG(n*1e3)/1e3}function HK(n){return rG(n*1e4)/1e4}function iut(n){return"matrix("+YF(n[0])+","+YF(n[1])+","+YF(n[2])+","+YF(n[3])+","+HK(n[4])+","+HK(n[5])+")"}var aut={left:"start",right:"end",center:"middle",middle:"middle"};function out(n,e,t){return t==="top"?n+=e/2:t==="bottom"&&(n-=e/2),n}function sut(n){return n&&(n.shadowBlur||n.shadowOffsetX||n.shadowOffsetY)}function lut(n){var e=n.style,t=n.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function h3e(n){return n&&!!n.image}function uut(n){return n&&!!n.svgElement}function hie(n){return h3e(n)||uut(n)}function c3e(n){return n.type==="linear"}function f3e(n){return n.type==="radial"}function d3e(n){return n&&(n.type==="linear"||n.type==="radial")}function $z(n){return"url(#"+n+")"}function v3e(n){var e=n.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function p3e(n){var e=n.x||0,t=n.y||0,r=(n.rotation||0)*yB,i=ni(n.scaleX,1),a=ni(n.scaleY,1),o=n.skewX||0,s=n.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),r&&l.push("rotate("+r+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+rG(o*yB)+"deg, "+rG(s*yB)+"deg)"),l.join(" ")}var hut=function(){return sa.hasGlobalWindow&&rn(window.btoa)?function(n){return window.btoa(unescape(encodeURIComponent(n)))}:typeof Buffer<"u"?function(n){return Buffer.from(n).toString("base64")}:function(n){return null}}(),jK=Array.prototype.slice;function p1(n,e,t){return(e-n)*t+n}function tH(n,e,t,r){for(var i=e.length,a=0;a<i;a++)n[a]=p1(e[a],t[a],r);return n}function cut(n,e,t,r){for(var i=e.length,a=i&&e[0].length,o=0;o<i;o++){n[o]||(n[o]=[]);for(var s=0;s<a;s++)n[o][s]=p1(e[o][s],t[o][s],r)}return n}function qF(n,e,t,r){for(var i=e.length,a=0;a<i;a++)n[a]=e[a]+t[a]*r;return n}function gve(n,e,t,r){for(var i=e.length,a=i&&e[0].length,o=0;o<i;o++){n[o]||(n[o]=[]);for(var s=0;s<a;s++)n[o][s]=e[o][s]+t[o][s]*r}return n}function fut(n,e){for(var t=n.length,r=e.length,i=t>r?e:n,a=Math.min(t,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(t,r);s++)i.push({offset:o.offset,color:o.color.slice()})}function dut(n,e,t){var r=n,i=e;if(!(!r.push||!i.push)){var a=r.length,o=i.length;if(a!==o){var s=a>o;if(s)r.length=o;else for(var l=a;l<o;l++)r.push(t===1?i[l]:jK.call(i[l]))}for(var u=r[0]&&r[0].length,l=0;l<r.length;l++)if(t===1)isNaN(r[l])&&(r[l]=i[l]);else for(var h=0;h<u;h++)isNaN(r[l][h])&&(r[l][h]=i[l][h])}}function HO(n){if(Yc(n)){var e=n.length;if(Yc(n[0])){for(var t=[],r=0;r<e;r++)t.push(jK.call(n[r]));return t}return jK.call(n)}return n}function wB(n){return n[0]=Math.floor(n[0])||0,n[1]=Math.floor(n[1])||0,n[2]=Math.floor(n[2])||0,n[3]=n[3]==null?1:n[3],"rgba("+n.join(",")+")"}function vut(n){return Yc(n&&n[0])?2:1}var ZF=0,bB=1,g3e=2,QP=3,XK=4,YK=5,yve=6;function mve(n){return n===XK||n===YK}function KF(n){return n===bB||n===g3e}var jL=[0,0,0,0],put=function(){function n(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return n.prototype.isFinished=function(){return this._finished},n.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},n.prototype.needsAnimate=function(){return this.keyframes.length>=1},n.prototype.getAdditiveTrack=function(){return this._additiveTrack},n.prototype.addKeyframe=function(e,t,r){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=yve,l=t;if(Yc(t)){var u=vut(t);s=u,(u===1&&!ha(t[0])||u===2&&!ha(t[0][0]))&&(o=!0)}else if(ha(t)&&!eD(t))s=ZF;else if(Or(t))if(!isNaN(+t))s=ZF;else{var h=gv(t);h&&(l=h,s=QP)}else if(zz(t)){var c=Mt({},l);c.colorStops=Vt(t.colorStops,function(d){return{offset:d.offset,color:gv(d.color)}}),c3e(t)?s=XK:f3e(t)&&(s=YK),l=c}a===0?this.valType=s:(s!==this.valType||s===yve)&&(o=!0),this.discrete=this.discrete||o;var f={time:e,value:l,rawValue:t,percent:0};return r&&(f.easing=r,f.easingFunc=rn(r)?r:t3e[r]||uie(r)),i.push(f),f},n.prototype.prepare=function(e,t){var r=this.keyframes;this._needsSort&&r.sort(function(p,g){return p.time-g.time});for(var i=this.valType,a=r.length,o=r[a-1],s=this.discrete,l=KF(i),u=mve(i),h=0;h<a;h++){var c=r[h],f=c.value,d=o.value;c.percent=c.time/e,s||(l&&h!==a-1?dut(f,d,i):u&&fut(f.colorStops,d.colorStops))}if(!s&&i!==YK&&t&&this.needsAnimate()&&t.needsAnimate()&&i===t.valType&&!t._finished){this._additiveTrack=t;for(var v=r[0].value,h=0;h<a;h++)i===ZF?r[h].additiveValue=r[h].value-v:i===QP?r[h].additiveValue=qF([],r[h].value,v,-1):KF(i)&&(r[h].additiveValue=i===bB?qF([],r[h].value,v,-1):gve([],r[h].value,v,-1))}},n.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var r=this._additiveTrack!=null,i=r?"additiveValue":"value",a=this.valType,o=this.keyframes,s=o.length,l=this.propName,u=a===QP,h,c=this._lastFr,f=Math.min,d,v;if(s===1)d=v=o[0];else{if(t<0)h=0;else if(t<this._lastFrP){var p=f(c+1,s-1);for(h=p;h>=0&&!(o[h].percent<=t);h--);h=f(h,s-2)}else{for(h=c;h<s&&!(o[h].percent>t);h++);h=f(h-1,s-2)}v=o[h+1],d=o[h]}if(!!(d&&v)){this._lastFr=h,this._lastFrP=t;var g=v.percent-d.percent,m=g===0?1:f((t-d.percent)/g,1);v.easingFunc&&(m=v.easingFunc(m));var y=r?this._additiveValue:u?jL:e[l];if((KF(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=m<1?d.rawValue:v.rawValue;else if(KF(a))a===bB?tH(y,d[i],v[i],m):cut(y,d[i],v[i],m);else if(mve(a)){var _=d[i],x=v[i],S=a===XK;e[l]={type:S?"linear":"radial",x:p1(_.x,x.x,m),y:p1(_.y,x.y,m),colorStops:Vt(_.colorStops,function(b,E){var T=x.colorStops[E];return{offset:p1(b.offset,T.offset,m),color:wB(tH([],b.color,T.color,m))}}),global:x.global},S?(e[l].x2=p1(_.x2,x.x2,m),e[l].y2=p1(_.y2,x.y2,m)):e[l].r=p1(_.r,x.r,m)}else if(u)tH(y,d[i],v[i],m),r||(e[l]=wB(y));else{var w=p1(d[i],v[i],m);r?this._additiveValue=w:e[l]=w}r&&this._addToTarget(e)}}},n.prototype._addToTarget=function(e){var t=this.valType,r=this.propName,i=this._additiveValue;t===ZF?e[r]=e[r]+i:t===QP?(gv(e[r],jL),qF(jL,jL,i,1),e[r]=wB(jL)):t===bB?qF(e[r],e[r],i,1):t===g3e&&gve(e[r],e[r],i,1)},n}(),cie=function(){function n(e,t,r,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){rie("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=r}return n.prototype.getMaxTime=function(){return this._maxTime},n.prototype.getDelay=function(){return this._delay},n.prototype.getLoop=function(){return this._loop},n.prototype.getTarget=function(){return this._target},n.prototype.changeTarget=function(e){this._target=e},n.prototype.when=function(e,t,r){return this.whenWithKeys(e,t,Li(t),r)},n.prototype.whenWithKeys=function(e,t,r,i){for(var a=this._tracks,o=0;o<r.length;o++){var s=r[o],l=a[s];if(!l){l=a[s]=new put(s);var u=void 0,h=this._getAdditiveTrack(s);if(h){var c=h.keyframes,f=c[c.length-1];u=f&&f.value,h.valType===QP&&u&&(u=wB(u))}else u=this._target[s];if(u==null)continue;e>0&&l.addKeyframe(0,HO(u),i),this._trackKeys.push(s)}l.addKeyframe(e,HO(t[s]),i)}return this._maxTime=Math.max(this._maxTime,e),this},n.prototype.pause=function(){this._clip.pause(),this._paused=!0},n.prototype.resume=function(){this._clip.resume(),this._paused=!1},n.prototype.isPaused=function(){return!!this._paused},n.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},n.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,r=0;r<t;r++)e[r].call(this)},n.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var r=0;r<t.length;r++)t[r].call(this)},n.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,r=0;r<t.length;r++)e[t[r]].setFinished()},n.prototype._getAdditiveTrack=function(e){var t,r=this._additiveAnimators;if(r)for(var i=0;i<r.length;i++){var a=r[i].getTrack(e);a&&(t=a)}return t},n.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,r=[],i=this._maxTime||0,a=0;a<this._trackKeys.length;a++){var o=this._trackKeys[a],s=this._tracks[o],l=this._getAdditiveTrack(o),u=s.keyframes,h=u.length;if(s.prepare(i,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var c=u[h-1];c&&(t._target[s.propName]=c.rawValue),s.setFinished()}else r.push(s)}if(r.length||this._force){var f=new Jlt({life:i,loop:this._loop,delay:this._delay||0,onframe:function(d){t._started=2;var v=t._additiveAnimators;if(v){for(var p=!1,g=0;g<v.length;g++)if(v[g]._clip){p=!0;break}p||(t._additiveAnimators=null)}for(var g=0;g<r.length;g++)r[g].step(t._target,d);var m=t._onframeCbs;if(m)for(var g=0;g<m.length;g++)m[g](t._target,d)},ondestroy:function(){t._doneCallback()}});this._clip=f,this.animation&&this.animation.addClip(f),e&&f.setEasing(e)}else this._doneCallback();return this}},n.prototype.stop=function(e){if(!!this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},n.prototype.delay=function(e){return this._delay=e,this},n.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},n.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},n.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},n.prototype.getClip=function(){return this._clip},n.prototype.getTrack=function(e){return this._tracks[e]},n.prototype.getTracks=function(){var e=this;return Vt(this._trackKeys,function(t){return e._tracks[t]})},n.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var r=this._tracks,i=this._trackKeys,a=0;a<e.length;a++){var o=r[e[a]];o&&!o.isFinished()&&(t?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,a=0;a<i.length;a++)if(!r[i[a]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},n.prototype.saveTo=function(e,t,r){if(!!e){t=t||this._trackKeys;for(var i=0;i<t.length;i++){var a=t[i],o=this._tracks[a];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[r?0:s.length-1];l&&(e[a]=HO(l.rawValue))}}}},n.prototype.__changeFinalValue=function(e,t){t=t||Li(e);for(var r=0;r<t.length;r++){var i=t[r],a=this._tracks[i];if(!!a){var o=a.keyframes;if(o.length>1){var s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},n}();function hA(){return new Date().getTime()}var gut=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,t=t||{},r.stage=t.stage||{},r}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var r=t.getClip();r&&this.addClip(r)},e.prototype.removeClip=function(t){if(!!t.animation){var r=t.prev,i=t.next;r?r.next=i:this._head=i,i?i.prev=r:this._tail=r,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var r=t.getClip();r&&this.removeClip(r),t.animation=null},e.prototype.update=function(t){for(var r=hA()-this._pausedTime,i=r-this._time,a=this._head;a;){var o=a.next,s=a.step(r,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=r,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function r(){t._running&&(zK(r),!t._paused&&t.update())}zK(r)},e.prototype.start=function(){this._running||(this._time=hA(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=hA(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=hA()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var r=t.next;t.prev=t.next=t.animation=null,t=r}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,r){r=r||{},this.start();var i=new cie(t,r.loop);return this.addAnimator(i),i},e}(ng);const yut=gut;var mut=300,rH=sa.domSupported,nH=function(){var n=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},r=Vt(n,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:n,touch:e,pointer:r}}(),_ve={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},xve=!1;function qK(n){var e=n.pointerType;return e==="pen"||e==="touch"}function _ut(n){n.touching=!0,n.touchTimer!=null&&(clearTimeout(n.touchTimer),n.touchTimer=null),n.touchTimer=setTimeout(function(){n.touching=!1,n.touchTimer=null},700)}function iH(n){n&&(n.zrByTouch=!0)}function xut(n,e){return lp(n.dom,new Sut(n,e),!0)}function y3e(n,e){for(var t=e,r=!1;t&&t.nodeType!==9&&!(r=t.domBelongToZr||t!==e&&t===n.painterRoot);)t=t.parentNode;return r}var Sut=function(){function n(e,t){this.stopPropagation=Hl,this.stopImmediatePropagation=Hl,this.preventDefault=Hl,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return n}(),Dg={mousedown:function(n){n=lp(this.dom,n),this.__mayPointerCapture=[n.zrX,n.zrY],this.trigger("mousedown",n)},mousemove:function(n){n=lp(this.dom,n);var e=this.__mayPointerCapture;e&&(n.zrX!==e[0]||n.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",n)},mouseup:function(n){n=lp(this.dom,n),this.__togglePointerCapture(!1),this.trigger("mouseup",n)},mouseout:function(n){n=lp(this.dom,n);var e=n.toElement||n.relatedTarget;y3e(this,e)||(this.__pointerCapturing&&(n.zrEventControl="no_globalout"),this.trigger("mouseout",n))},wheel:function(n){xve=!0,n=lp(this.dom,n),this.trigger("mousewheel",n)},mousewheel:function(n){xve||(n=lp(this.dom,n),this.trigger("mousewheel",n))},touchstart:function(n){n=lp(this.dom,n),iH(n),this.__lastTouchMoment=new Date,this.handler.processGesture(n,"start"),Dg.mousemove.call(this,n),Dg.mousedown.call(this,n)},touchmove:function(n){n=lp(this.dom,n),iH(n),this.handler.processGesture(n,"change"),Dg.mousemove.call(this,n)},touchend:function(n){n=lp(this.dom,n),iH(n),this.handler.processGesture(n,"end"),Dg.mouseup.call(this,n),+new Date-+this.__lastTouchMoment<mut&&Dg.click.call(this,n)},pointerdown:function(n){Dg.mousedown.call(this,n)},pointermove:function(n){qK(n)||Dg.mousemove.call(this,n)},pointerup:function(n){Dg.mouseup.call(this,n)},pointerout:function(n){qK(n)||Dg.mouseout.call(this,n)}};te(["click","dblclick","contextmenu"],function(n){Dg[n]=function(e){e=lp(this.dom,e),this.trigger(n,e)}});var ZK={pointermove:function(n){qK(n)||ZK.mousemove.call(this,n)},pointerup:function(n){ZK.mouseup.call(this,n)},mousemove:function(n){this.trigger("mousemove",n)},mouseup:function(n){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",n),e&&(n.zrEventControl="only_globalout",this.trigger("mouseout",n))}};function wut(n,e){var t=e.domHandlers;sa.pointerEventsSupported?te(nH.pointer,function(r){EB(e,r,function(i){t[r].call(n,i)})}):(sa.touchEventsSupported&&te(nH.touch,function(r){EB(e,r,function(i){t[r].call(n,i),_ut(e)})}),te(nH.mouse,function(r){EB(e,r,function(i){i=oie(i),e.touching||t[r].call(n,i)})}))}function but(n,e){sa.pointerEventsSupported?te(_ve.pointer,t):sa.touchEventsSupported||te(_ve.mouse,t);function t(r){function i(a){a=oie(a),y3e(n,a.target)||(a=xut(n,a),e.domHandlers[r].call(n,a))}EB(e,r,i,{capture:!0})}}function EB(n,e,t,r){n.mounted[e]=t,n.listenerOpts[e]=r,GK(n.domTarget,e,t,r)}function aH(n){var e=n.mounted;for(var t in e)e.hasOwnProperty(t)&&Llt(n.domTarget,t,e[t],n.listenerOpts[t]);n.mounted={}}var Sve=function(){function n(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return n}(),Eut=function(n){$e(e,n);function e(t,r){var i=n.call(this)||this;return i.__pointerCapturing=!1,i.dom=t,i.painterRoot=r,i._localHandlerScope=new Sve(t,Dg),rH&&(i._globalHandlerScope=new Sve(document,ZK)),wut(i,i._localHandlerScope),i}return e.prototype.dispose=function(){aH(this._localHandlerScope),rH&&aH(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,rH&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var r=this._globalHandlerScope;t?but(this,r):aH(r)}},e}(ng);const Tut=Eut;var m3e=1;sa.hasGlobalWindow&&(m3e=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var nG=m3e,KK=.4,JK="#333",QK="#ccc",Cut="#eee",wve=Vz,bve=5e-5;function Yw(n){return n>bve||n<-bve}var qw=[],VT=[],oH=Up(),sH=Math.abs,Aut=function(){function n(){}return n.prototype.getLocalTransform=function(e){return n.getLocalTransform(this,e)},n.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},n.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},n.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},n.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},n.prototype.needLocalTransform=function(){return Yw(this.rotation)||Yw(this.x)||Yw(this.y)||Yw(this.scaleX-1)||Yw(this.scaleY-1)||Yw(this.skewX)||Yw(this.skewY)},n.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),r=this.transform;if(!(t||e)){r&&(wve(r),this.invTransform=null);return}r=r||Up(),t?this.getLocalTransform(r):wve(r),e&&(t?$1(r,e,r):sie(r,e)),this.transform=r,this._resolveGlobalScaleRatio(r)},n.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(qw);var r=qw[0]<0?-1:1,i=qw[1]<0?-1:1,a=((qw[0]-r)*t+r)/qw[0]||0,o=((qw[1]-i)*t+i)/qw[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Up(),LI(this.invTransform,e)},n.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},n.prototype.setLocalTransform=function(e){if(!!e){var t=e[0]*e[0]+e[1]*e[1],r=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);r=Math.sqrt(r)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=r,this.originX=0,this.originY=0}},n.prototype.decomposeTransform=function(){if(!!this.transform){var e=this.parent,t=this.transform;e&&e.transform&&($1(VT,e.invTransform,t),t=VT);var r=this.originX,i=this.originY;(r||i)&&(oH[4]=r,oH[5]=i,$1(VT,t,oH),VT[4]-=r,VT[5]-=i,t=VT),this.setLocalTransform(t)}},n.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},n.prototype.transformCoordToLocal=function(e,t){var r=[e,t],i=this.invTransform;return i&&cc(r,r,i),r},n.prototype.transformCoordToGlobal=function(e,t){var r=[e,t],i=this.transform;return i&&cc(r,r,i),r},n.prototype.getLineScale=function(){var e=this.transform;return e&&sH(e[0]-1)>1e-10&&sH(e[3]-1)>1e-10?Math.sqrt(sH(e[0]*e[3]-e[2]*e[1])):1},n.prototype.copyTransform=function(e){_3e(this,e)},n.getLocalTransform=function(e,t){t=t||[];var r=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,h=e.x,c=e.y,f=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(r||i||s||l){var v=r+s,p=i+l;t[4]=-v*a-f*p*o,t[5]=-p*o-d*v*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=d*a,t[2]=f*o,u&&j2(t,t,u),t[4]+=r+h,t[5]+=i+c,t},n.initDefaultProps=function(){var e=n.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),n}(),lm=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function _3e(n,e){for(var t=0;t<lm.length;t++){var r=lm[t];n[r]=e[r]}}const L1=Aut;var Eve={};function yv(n,e){e=e||RS;var t=Eve[e];t||(t=Eve[e]=new d3(500));var r=t.get(n);return r==null&&(r=s_.measureText(n,e).width,t.put(n,r)),r}function Tve(n,e,t,r){var i=yv(n,e),a=Wz(e),o=eO(0,i,t),s=GC(0,a,r),l=new ai(o,s,i,a);return l}function v3(n,e,t,r){var i=((n||"")+"").split(`
`),a=i.length;if(a===1)return Tve(i[0],e,t,r);for(var o=new ai(0,0,0,0),s=0;s<i.length;s++){var l=Tve(i[s],e,t,r);s===0?o.copy(l):o.union(l)}return o}function eO(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function GC(n,e,t){return t==="middle"?n-=e/2:t==="bottom"&&(n-=e),n}function Wz(n){return yv("\u56FD",n)}function _0(n,e){return typeof n=="string"?n.lastIndexOf("%")>=0?parseFloat(n)/100*e:parseFloat(n):n}function iG(n,e,t){var r=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,h="left",c="top";if(r instanceof Array)l+=_0(r[0],t.width),u+=_0(r[1],t.height),h=null,c=null;else switch(r){case"left":l-=i,u+=s,h="right",c="middle";break;case"right":l+=i+o,u+=s,c="middle";break;case"top":l+=o/2,u-=i,h="center",c="bottom";break;case"bottom":l+=o/2,u+=a+i,h="center";break;case"inside":l+=o/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=i,u+=s,c="middle";break;case"insideRight":l+=o-i,u+=s,h="right",c="middle";break;case"insideTop":l+=o/2,u+=i,h="center";break;case"insideBottom":l+=o/2,u+=a-i,h="center",c="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=a-i,c="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,h="right",c="bottom";break}return n=n||{},n.x=l,n.y=u,n.align=h,n.verticalAlign=c,n}var lH="__zr_normal__",uH=lm.concat(["ignore"]),Mut=om(lm,function(n,e){return n[e]=!0,n},{ignore:!1}),$T={},Iut=new ai(0,0,0,0),fie=function(){function n(e){this.id=HNe(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return n.prototype._init=function(e){this.attr(e)},n.prototype.drift=function(e,t,r){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},n.prototype.beforeUpdate=function(){},n.prototype.afterUpdate=function(){},n.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},n.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var r=this.textConfig,i=r.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),r.position!=null){var h=Iut;r.layoutRect?h.copy(r.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition($T,r,h):iG($T,r,h),a.x=$T.x,a.y=$T.y,o=$T.align,s=$T.verticalAlign;var c=r.origin;if(c&&r.rotation!=null){var f=void 0,d=void 0;c==="center"?(f=h.width*.5,d=h.height*.5):(f=_0(c[0],h.width),d=_0(c[1],h.height)),u=!0,a.originX=-a.x+f+(i?0:h.x),a.originY=-a.y+d+(i?0:h.y)}}r.rotation!=null&&(a.rotation=r.rotation);var v=r.offset;v&&(a.x+=v[0],a.y+=v[1],u||(a.originX=-v[0],a.originY=-v[1]));var p=r.inside==null?typeof r.position=="string"&&r.position.indexOf("inside")>=0:r.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,_=void 0;p&&this.canBeInsideText()?(m=r.insideFill,y=r.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(m),_=!0)):(m=r.outsideFill,y=r.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(m),_=!0)),m=m||"#000",(m!==g.fill||y!==g.stroke||_!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=m,g.stroke=y,g.autoStroke=_,g.align=o,g.verticalAlign=s,t.setDefaultTextStyle(g)),t.__dirty|=ov,l&&t.dirtyStyle(!0)}},n.prototype.canBeInsideText=function(){return!0},n.prototype.getInsideTextFill=function(){return"#fff"},n.prototype.getInsideTextStroke=function(e){return"#000"},n.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?QK:JK},n.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),r=typeof t=="string"&&gv(t);r||(r=[255,255,255,1]);for(var i=r[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)r[o]=r[o]*i+(a?0:255)*(1-i);return r[3]=1,W1(r,"rgba")},n.prototype.traverse=function(e,t){},n.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},Mt(this.extra,t)):this[e]=t},n.prototype.hide=function(){this.ignore=!0,this.markRedraw()},n.prototype.show=function(){this.ignore=!1,this.markRedraw()},n.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(dn(e))for(var r=e,i=Li(r),a=0;a<i.length;a++){var o=i[a];this.attrKV(o,e[o])}return this.markRedraw(),this},n.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,r=0;r<this.animators.length;r++){var i=this.animators[r],a=i.__fromStateTransition;if(!(i.getLoop()||a&&a!==lH)){var o=i.targetName,s=o?t[o]:t;i.saveTo(s)}}},n.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,uH)},n.prototype._savePrimaryToNormal=function(e,t,r){for(var i=0;i<r.length;i++){var a=r[i];e[a]!=null&&!(a in t)&&(t[a]=this[a])}},n.prototype.hasState=function(){return this.currentStates.length>0},n.prototype.getState=function(e){return this.states[e]},n.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},n.prototype.clearStates=function(e){this.useState(lH,!1,e)},n.prototype.useState=function(e,t,r,i){var a=e===lH,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(gi(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){rie("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=!!(u&&u.hoverLayer||i);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!r&&!this.__inHover&&l&&l.duration>0,l);var c=this._textContent,f=this._textGuide;return c&&c.useState(e,t,r,h),f&&f.useState(e,t,r,h),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ov),u}}},n.prototype.useStates=function(e,t,r){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l<o;l++)if(e[l]!==a[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var u=e[l],h=void 0;this.stateProxy&&(h=this.stateProxy(u,e)),h||(h=this.states[u]),h&&i.push(h)}var c=i[o-1],f=!!(c&&c.hoverLayer||r);f&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(i),v=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&v&&v.duration>0,v);var p=this._textContent,g=this._textGuide;p&&p.useStates(e,t,f),g&&g.useStates(e,t,f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ov)}},n.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},n.prototype.removeState=function(e){var t=gi(this.currentStates,e);if(t>=0){var r=this.currentStates.slice();r.splice(t,1),this.useStates(r)}},n.prototype.replaceState=function(e,t,r){var i=this.currentStates.slice(),a=gi(i,e),o=gi(i,t)>=0;a>=0?o?i.splice(a,1):i[a]=t:r&&!o&&i.push(t),this.useStates(i)},n.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},n.prototype._mergeStates=function(e){for(var t={},r,i=0;i<e.length;i++){var a=e[i];Mt(t,a),a.textConfig&&(r=r||{},Mt(r,a.textConfig))}return r&&(t.textConfig=r),t},n.prototype._applyStateObj=function(e,t,r,i,a,o){var s=!(t&&i);t&&t.textConfig?(this.textConfig=Mt({},i?this.textConfig:r.textConfig),Mt(this.textConfig,t.textConfig)):s&&r.textConfig&&(this.textConfig=r.textConfig);for(var l={},u=!1,h=0;h<uH.length;h++){var c=uH[h],f=a&&Mut[c];t&&t[c]!=null?f?(u=!0,l[c]=t[c]):this[c]=t[c]:s&&r[c]!=null&&(f?(u=!0,l[c]=r[c]):this[c]=r[c])}if(!a)for(var h=0;h<this.animators.length;h++){var d=this.animators[h],v=d.targetName;d.getLoop()||d.__changeFinalValue(v?(t||r)[v]:t||r)}u&&this._transitionState(e,l,o)},n.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},n.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},n.prototype.getClipPath=function(){return this._clipPath},n.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},n.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},n.prototype.getTextContent=function(){return this._textContent},n.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new L1,this._attachComponent(e),this._textContent=e,this.markRedraw())},n.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),Mt(this.textConfig,e),this.markRedraw()},n.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},n.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},n.prototype.getTextGuideLine=function(){return this._textGuide},n.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},n.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},n.prototype.markRedraw=function(){this.__dirty|=ov;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},n.prototype.dirty=function(){this.markRedraw()},n.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,r=this._textGuide;t&&(t.__inHover=e),r&&(r.__inHover=e)},n.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var r=0;r<t.length;r++)e.animation.addAnimator(t[r]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},n.prototype.removeSelfFromZr=function(e){if(!!this.__zr){this.__zr=null;var t=this.animators;if(t)for(var r=0;r<t.length;r++)e.animation.removeAnimator(t[r]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},n.prototype.animate=function(e,t,r){var i=e?this[e]:this,a=new cie(i,t,r);return e&&(a.targetName=e),this.addAnimator(a,e),a},n.prototype.addAnimator=function(e,t){var r=this.__zr,i=this;e.during(function(){i.updateDuringAnimation(t)}).done(function(){var a=i.animators,o=gi(a,e);o>=0&&a.splice(o,1)}),this.animators.push(e),r&&r.animation.addAnimator(e),r&&r.wakeUp()},n.prototype.updateDuringAnimation=function(e){this.markRedraw()},n.prototype.stopAnimation=function(e,t){for(var r=this.animators,i=r.length,a=[],o=0;o<i;o++){var s=r[o];!e||e===s.scope?s.stop(t):a.push(s)}return this.animators=a,this},n.prototype.animateTo=function(e,t,r){hH(this,e,t,r)},n.prototype.animateFrom=function(e,t,r){hH(this,e,t,r,!0)},n.prototype._transitionState=function(e,t,r,i){for(var a=hH(this,t,r,i),o=0;o<a.length;o++)a[o].__fromStateTransition=e},n.prototype.getBoundingRect=function(){return null},n.prototype.getPaintRect=function(){return null},n.initDefaultProps=function(){var e=n.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=ov;function t(r,i,a,o){Object.defineProperty(e,r,{get:function(){if(!this[i]){var l=this[i]=[];s(this,l)}return this[i]},set:function(l){this[a]=l[0],this[o]=l[1],this[i]=l,s(this,l)}});function s(l,u){Object.defineProperty(u,0,{get:function(){return l[a]},set:function(h){l[a]=h}}),Object.defineProperty(u,1,{get:function(){return l[o]},set:function(h){l[o]=h}})}}Object.defineProperty&&(t("position","_legacyPos","x","y"),t("scale","_legacyScale","scaleX","scaleY"),t("origin","_legacyOrigin","originX","originY"))}(),n}();gu(fie,ng);gu(fie,L1);function hH(n,e,t,r,i){t=t||{};var a=[];x3e(n,"",n,e,t,r,a,i);var o=a.length,s=!1,l=t.done,u=t.aborted,h=function(){s=!0,o--,o<=0&&(s?l&&l():u&&u())},c=function(){o--,o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&t.during&&a[0].during(function(v,p){t.during(p)});for(var f=0;f<a.length;f++){var d=a[f];h&&d.done(h),c&&d.aborted(c),t.force&&d.duration(t.duration),d.start(t.easing)}return a}function cH(n,e,t){for(var r=0;r<t;r++)n[r]=e[r]}function Lut(n){return Yc(n[0])}function Put(n,e,t){if(Yc(e[t]))if(Yc(n[t])||(n[t]=[]),Ev(e[t])){var r=e[t].length;n[t].length!==r&&(n[t]=new e[t].constructor(r),cH(n[t],e[t],r))}else{var i=e[t],a=n[t],o=i.length;if(Lut(i))for(var s=i[0].length,l=0;l<o;l++)a[l]?cH(a[l],i[l],s):a[l]=Array.prototype.slice.call(i[l]);else cH(a,i,o);a.length=i.length}else n[t]=e[t]}function Out(n,e){return n===e||Yc(n)&&Yc(e)&&Rut(n,e)}function Rut(n,e){var t=n.length;if(t!==e.length)return!1;for(var r=0;r<t;r++)if(n[r]!==e[r])return!1;return!0}function x3e(n,e,t,r,i,a,o,s){for(var l=Li(r),u=i.duration,h=i.delay,c=i.additive,f=i.setToFinal,d=!dn(a),v=n.animators,p=[],g=0;g<l.length;g++){var m=l[g],y=r[m];if(y!=null&&t[m]!=null&&(d||a[m]))if(dn(y)&&!Yc(y)&&!zz(y)){if(e){s||(t[m]=y,n.updateDuringAnimation(e));continue}x3e(n,m,t[m],y,i,a&&a[m],o,s)}else p.push(m);else s||(t[m]=y,n.updateDuringAnimation(e),p.push(m))}var _=p.length;if(!c&&_)for(var x=0;x<v.length;x++){var S=v[x];if(S.targetName===e){var w=S.stopTracks(p);if(w){var b=gi(v,S);v.splice(b,1)}}}if(i.force||(p=To(p,function(A){return!Out(r[A],t[A])}),_=p.length),_>0||i.force&&!o.length){var E=void 0,T=void 0,C=void 0;if(s){T={},f&&(E={});for(var x=0;x<_;x++){var m=p[x];T[m]=t[m],f?E[m]=r[m]:t[m]=r[m]}}else if(f){C={};for(var x=0;x<_;x++){var m=p[x];C[m]=HO(t[m]),Put(t,r,m)}}var S=new cie(t,!1,!1,c?To(v,function(M){return M.targetName===e}):null);S.targetName=e,i.scope&&(S.scope=i.scope),f&&E&&S.whenWithKeys(0,E,p),C&&S.whenWithKeys(0,C,p),S.whenWithKeys(u==null?500:u,s?T:r,p).delay(h||0),n.addAnimator(S,e),o.push(S)}}const S3e=fie;var w3e=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r.isGroup=!0,r._children=[],r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var r=this._children,i=0;i<r.length;i++)if(r[i].name===t)return r[i]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},e.prototype.addBefore=function(t,r){if(t&&t!==this&&t.parent!==this&&r&&r.parent===this){var i=this._children,a=i.indexOf(r);a>=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,r){var i=gi(this._children,t);return i>=0&&this.replaceAt(r,i),this},e.prototype.replaceAt=function(t,r){var i=this._children,a=i[r];if(t&&t!==this&&t.parent!==this&&t!==a){i[r]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var r=this.__zr;r&&r!==t.__zr&&t.addSelfToZr(r),r&&r.refresh()},e.prototype.remove=function(t){var r=this.__zr,i=this._children,a=gi(i,t);return a<0?this:(i.splice(a,1),t.parent=null,r&&t.removeSelfFromZr(r),r&&r.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,r=this.__zr,i=0;i<t.length;i++){var a=t[i];r&&a.removeSelfFromZr(r),a.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,r){for(var i=this._children,a=0;a<i.length;a++){var o=i[a];t.call(r,o,a)}return this},e.prototype.traverse=function(t,r){for(var i=0;i<this._children.length;i++){var a=this._children[i],o=t.call(r,a);a.isGroup&&!o&&a.traverse(t,r)}return this},e.prototype.addSelfToZr=function(t){n.prototype.addSelfToZr.call(this,t);for(var r=0;r<this._children.length;r++){var i=this._children[r];i.addSelfToZr(t)}},e.prototype.removeSelfFromZr=function(t){n.prototype.removeSelfFromZr.call(this,t);for(var r=0;r<this._children.length;r++){var i=this._children[r];i.removeSelfFromZr(t)}},e.prototype.getBoundingRect=function(t){for(var r=new ai(0,0,0,0),i=t||this._children,a=[],o=null,s=0;s<i.length;s++){var l=i[s];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),h=l.getLocalTransform(a);h?(ai.applyTransform(r,u,h),o=o||r.clone(),o.union(r)):(o=o||u.clone(),o.union(u))}}return o||r},e}(S3e);w3e.prototype.type="group";const Cn=w3e;/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/var TB={},b3e={};function Dut(n){delete b3e[n]}function Nut(n){if(!n)return!1;if(typeof n=="string")return tG(n,1)<KK;if(n.colorStops){for(var e=n.colorStops,t=0,r=e.length,i=0;i<r;i++)t+=tG(e[i].color,1);return t/=r,t<KK}return!1}var kut=function(){function n(e,t,r){var i=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,r=r||{},this.dom=t,this.id=e;var a=new jlt,o=r.renderer||"canvas";TB[o]||(o=Li(TB)[0]),r.useDirtyRect=r.useDirtyRect==null?!1:r.useDirtyRect;var s=new TB[o](t,a,r,e),l=r.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!sa.node&&!sa.worker&&!l?new Tut(s.getViewportRoot(),s.root):null,h=r.useCoarsePointer,c=h==null||h==="auto"?sa.touchEventsSupported:!!h,f=44,d;c&&(d=ni(r.pointerSize,f)),this.handler=new Ult(a,s,u,s.root,d),this.animation=new yut({stage:{update:l?null:function(){return i._flush(!0)}}}),l||this.animation.start()}return n.prototype.add=function(e){!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},n.prototype.remove=function(e){!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},n.prototype.configLayer=function(e,t){this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh()},n.prototype.setBackgroundColor=function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=Nut(e)},n.prototype.getBackgroundColor=function(){return this._backgroundColor},n.prototype.setDarkMode=function(e){this._darkMode=e},n.prototype.isDarkMode=function(){return this._darkMode},n.prototype.refreshImmediately=function(e){e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},n.prototype.refresh=function(){this._needsRefresh=!0,this.animation.start()},n.prototype.flush=function(){this._flush(!1)},n.prototype._flush=function(e){var t,r=hA();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var i=hA();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-r})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},n.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},n.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},n.prototype.refreshHover=function(){this._needsRefreshHover=!0},n.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},n.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},n.prototype.clearAnimation=function(){this.animation.clear()},n.prototype.getWidth=function(){return this.painter.getWidth()},n.prototype.getHeight=function(){return this.painter.getHeight()},n.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},n.prototype.findHover=function(e,t){return this.handler.findHover(e,t)},n.prototype.on=function(e,t,r){return this.handler.on(e,t,r),this},n.prototype.off=function(e,t){this.handler.off(e,t)},n.prototype.trigger=function(e,t){this.handler.trigger(e,t)},n.prototype.clear=function(){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Cn&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()},n.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,Dut(this.id)},n}();function Cve(n,e){var t=new kut(HNe(),n,e);return b3e[t.id]=t,t}function Fut(n,e){TB[n]=e}var Ave=1e-4,E3e=20;function But(n){return n.replace(/^\s+|\s+$/g,"")}function go(n,e,t,r){var i=e[0],a=e[1],o=t[0],s=t[1],l=a-i,u=s-o;if(l===0)return u===0?o:(o+s)/2;if(r)if(l>0){if(n<=i)return o;if(n>=a)return s}else{if(n>=i)return o;if(n<=a)return s}else{if(n===i)return o;if(n===a)return s}return(n-i)/l*u+o}function xr(n,e){switch(n){case"center":case"middle":n="50%";break;case"left":case"top":n="0%";break;case"right":case"bottom":n="100%";break}return Or(n)?But(n).match(/%$/)?parseFloat(n)/100*e:parseFloat(n):n==null?NaN:+n}function Pl(n,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),E3e),n=(+n).toFixed(e),t?n:+n}function Op(n){return n.sort(function(e,t){return e-t}),n}function Ny(n){if(n=+n,isNaN(n))return 0;if(n>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(n*e)/e===n)return t}return Gut(n)}function Gut(n){var e=n.toString().toLowerCase(),t=e.indexOf("e"),r=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-r)}function T3e(n,e){var t=Math.log,r=Math.LN10,i=Math.floor(t(n[1]-n[0])/r),a=Math.round(t(Math.abs(e[1]-e[0]))/r),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function zut(n,e){var t=om(n,function(d,v){return d+(isNaN(v)?0:v)},0);if(t===0)return[];for(var r=Math.pow(10,e),i=Vt(n,function(d){return(isNaN(d)?0:d)/t*r*100}),a=r*100,o=Vt(i,function(d){return Math.floor(d)}),s=om(o,function(d,v){return d+v},0),l=Vt(i,function(d,v){return d-o[v]});s<a;){for(var u=Number.NEGATIVE_INFINITY,h=null,c=0,f=l.length;c<f;++c)l[c]>u&&(u=l[c],h=c);++o[h],l[h]=0,++s}return Vt(o,function(d){return d/r})}function Uut(n,e){var t=Math.max(Ny(n),Ny(e)),r=n+e;return t>E3e?r:Pl(r,t)}var Mve=9007199254740991;function C3e(n){var e=Math.PI*2;return(n%e+e)%e}function aG(n){return n>-Ave&&n<Ave}var Vut=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function um(n){if(n instanceof Date)return n;if(Or(n)){var e=Vut.exec(n);if(!e)return new Date(NaN);if(e[8]){var t=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(t-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,t,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(n==null)return new Date(NaN);return new Date(Math.round(n))}function $ut(n){return Math.pow(10,die(n))}function die(n){if(n===0)return 0;var e=Math.floor(Math.log(n)/Math.LN10);return n/Math.pow(10,e)>=10&&e++,e}function A3e(n,e){var t=die(n),r=Math.pow(10,t),i=n/r,a;return e?i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10:i<1?a=1:i<2?a=2:i<3?a=3:i<5?a=5:a=10,n=a*r,t>=-20?+n.toFixed(t<0?-t:0):n}function fH(n,e){var t=(n.length-1)*e+1,r=Math.floor(t),i=+n[r-1],a=t-r;return a?i+a*(n[r]-i):i}function Ive(n){n.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,r=0;r<n.length;){for(var i=n[r].interval,a=n[r].close,o=0;o<2;o++)i[o]<=e&&(i[o]=e,a[o]=o?1:1-t),e=i[o],t=a[o];i[0]===i[1]&&a[0]*a[1]!==1?n.splice(r,1):r++}return n;function s(l,u,h){return l.interval[h]<u.interval[h]||l.interval[h]===u.interval[h]&&(l.close[h]-u.close[h]===(h?-1:1)||!h&&s(l,u,1))}}function u_(n){var e=parseFloat(n);return e==n&&(e!==0||!Or(n)||n.indexOf("x")<=0)?e:NaN}function M3e(n){return!isNaN(u_(n))}function I3e(){return Math.round(Math.random()*9)}function L3e(n,e){return e===0?n:L3e(e,n%e)}function Lve(n,e){return n==null?e:e==null?n:n*e/L3e(n,e)}function ao(n){throw new Error(n)}function Pve(n,e,t){return(e-n)*t+n}var P3e="series\0",O3e="\0_ec_\0";function Do(n){return n instanceof Array?n:n==null?[]:[n]}function XE(n,e,t){if(n){n[e]=n[e]||{},n.emphasis=n.emphasis||{},n.emphasis[e]=n.emphasis[e]||{};for(var r=0,i=t.length;r<i;r++){var a=t[r];!n.emphasis[e].hasOwnProperty(a)&&n[e].hasOwnProperty(a)&&(n.emphasis[e][a]=n[e][a])}}}var Ove=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function PI(n){return dn(n)&&!Gt(n)&&!(n instanceof Date)?n.value:n}function Wut(n){return dn(n)&&!(n instanceof Array)}function R3e(n,e,t){var r=t==="normalMerge",i=t==="replaceMerge",a=t==="replaceAll";n=n||[],e=(e||[]).slice();var o=$r();te(e,function(l,u){if(!dn(l)){e[u]=null;return}});var s=Hut(n,o,t);return(r||i)&&jut(s,n,o,e),r&&Xut(s,e),r||i?Yut(s,e,i):a&&qut(s,e),Zut(s),s}function Hut(n,e,t){var r=[];if(t==="replaceAll")return r;for(var i=0;i<n.length;i++){var a=n[i];a&&a.id!=null&&e.set(a.id,i),r.push({existing:t==="replaceMerge"||iD(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return r}function jut(n,e,t,r){te(r,function(i,a){if(!(!i||i.id==null)){var o=jO(i.id),s=t.get(o);if(s!=null){var l=n[s];Bf(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=i,l.existing=e[s],r[a]=null}}})}function Xut(n,e){te(e,function(t,r){if(!(!t||t.name==null))for(var i=0;i<n.length;i++){var a=n[i].existing;if(!n[i].newOption&&a&&(a.id==null||t.id==null)&&!iD(t)&&!iD(a)&&D3e("name",a,t)){n[i].newOption=t,e[r]=null;return}}})}function Yut(n,e,t){te(e,function(r){if(!!r){for(var i,a=0;(i=n[a])&&(i.newOption||iD(i.existing)||i.existing&&r.id!=null&&!D3e("id",r,i.existing));)a++;i?(i.newOption=r,i.brandNew=t):n.push({newOption:r,brandNew:t,existing:null,keyInfo:null}),a++}})}function qut(n,e){te(e,function(t){n.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function Zut(n){var e=$r();te(n,function(t){var r=t.existing;r&&e.set(r.id,t)}),te(n,function(t){var r=t.newOption;Bf(!r||r.id==null||!e.get(r.id)||e.get(r.id)===t,"id duplicates: "+(r&&r.id)),r&&r.id!=null&&e.set(r.id,t),!t.keyInfo&&(t.keyInfo={})}),te(n,function(t,r){var i=t.existing,a=t.newOption,o=t.keyInfo;if(!!dn(a)){if(o.name=a.name!=null?jO(a.name):i?i.name:P3e+r,i)o.id=jO(i.id);else if(a.id!=null)o.id=jO(a.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,t)}})}function D3e(n,e,t){var r=Ru(e[n],null),i=Ru(t[n],null);return r!=null&&i!=null&&r===i}function jO(n){return Ru(n,"")}function Ru(n,e){return n==null?e:Or(n)?n:ha(n)||OK(n)?n+"":e}function vie(n){var e=n.name;return!!(e&&e.indexOf(P3e))}function iD(n){return n&&n.id!=null&&jO(n.id).indexOf(O3e)===0}function Kut(n){return O3e+n}function Jut(n,e,t){te(n,function(r){var i=r.newOption;dn(i)&&(r.keyInfo.mainType=e,r.keyInfo.subType=Qut(e,i,r.existing,t))})}function Qut(n,e,t,r){var i=e.type?e.type:t?t.subType:r.determineSubType(n,e);return i}function eht(n,e){var t={},r={};return i(n||[],t),i(e||[],r,t),[a(t),a(r)];function i(o,s,l){for(var u=0,h=o.length;u<h;u++){var c=Ru(o[u].seriesId,null);if(c==null)return;for(var f=Do(o[u].dataIndex),d=l&&l[c],v=0,p=f.length;v<p;v++){var g=f[v];d&&d[g]?d[g]=null:(s[c]||(s[c]={}))[g]=1}}}function a(o,s){var l=[];for(var u in o)if(o.hasOwnProperty(u)&&o[u]!=null)if(s)l.push(+u);else{var h=a(o[u],!0);h.length&&l.push({seriesId:u,dataIndex:h})}return l}}function YE(n,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return Gt(e.dataIndex)?Vt(e.dataIndex,function(t){return n.indexOfRawIndex(t)}):n.indexOfRawIndex(e.dataIndex);if(e.name!=null)return Gt(e.name)?Vt(e.name,function(t){return n.indexOfName(t)}):n.indexOfName(e.name)}function na(){var n="__ec_inner_"+tht++;return function(e){return e[n]||(e[n]={})}}var tht=I3e();function XO(n,e,t){var r=pie(e,t),i=r.mainTypeSpecified,a=r.queryOptionMap,o=r.others,s=o,l=t?t.defaultMainType:null;return!i&&l&&a.set(l,{}),a.each(function(u,h){var c=p3(n,h,u,{useDefault:l===h,enableAll:t&&t.enableAll!=null?t.enableAll:!0,enableNone:t&&t.enableNone!=null?t.enableNone:!0});s[h+"Models"]=c.models,s[h+"Model"]=c.models[0]}),s}function pie(n,e){var t;if(Or(n)){var r={};r[n+"Index"]=0,t=r}else t=n;var i=$r(),a={},o=!1;return te(t,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){a[l]=s;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],h=u[1],c=(u[2]||"").toLowerCase();if(!(!h||!c||e&&e.includeMainTypes&&gi(e.includeMainTypes,h)<0)){o=o||!!h;var f=i.get(h)||i.set(h,{});f[c]=s}}),{mainTypeSpecified:o,queryOptionMap:i,others:a}}var uu={useDefault:!0,enableAll:!1,enableNone:!1},rht={useDefault:!1,enableAll:!0,enableNone:!0};function p3(n,e,t,r){r=r||uu;var i=t.index,a=t.id,o=t.name,s={models:null,specified:i!=null||a!=null||o!=null};if(!s.specified){var l=void 0;return s.models=r.useDefault&&(l=n.getComponent(e))?[l]:[],s}return i==="none"||i===!1?(Bf(r.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(i==="all"&&(Bf(r.enableAll,'`"all"` is not a valid value on index option.'),i=a=o=null),s.models=n.queryComponents({mainType:e,index:i,id:a,name:o}),s)}function N3e(n,e,t){n.setAttribute?n.setAttribute(e,t):n[e]=t}function nht(n,e){return n.getAttribute?n.getAttribute(e):n[e]}function iht(n){return n==="auto"?sa.domSupported?"html":"richText":n||"html"}function eJ(n,e){var t=$r(),r=[];return te(n,function(i){var a=e(i);(t.get(a)||(r.push(a),t.set(a,[]))).push(i)}),{keys:r,buckets:t}}function k3e(n,e,t,r,i){var a=e==null||e==="auto";if(r==null)return r;if(ha(r)){var o=Pve(t||0,r,i);return Pl(o,a?Math.max(Ny(t||0),Ny(r)):e)}else{if(Or(r))return i<1?t:r;for(var s=[],l=t,u=r,h=Math.max(l?l.length:0,u.length),c=0;c<h;++c){var f=n.getDimensionInfo(c);if(f&&f.type==="ordinal")s[c]=(i<1&&l?l:u)[c];else{var d=l&&l[c]?l[c]:0,v=u[c],o=Pve(d,v,i);s[c]=Pl(o,a?Math.max(Ny(d),Ny(v)):e)}}return s}}var aht=".",Zw="___EC__COMPONENT__CONTAINER___",F3e="___EC__EXTENDED_CLASS___";function ky(n){var e={main:"",sub:""};if(n){var t=n.split(aht);e.main=t[0]||"",e.sub=t[1]||""}return e}function oht(n){Bf(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n),'componentType "'+n+'" illegal')}function sht(n){return!!(n&&n[F3e])}function gie(n,e){n.$constructor=n,n.extend=function(t){var r=this,i;return lht(r)?i=function(a){$e(o,a);function o(){return a.apply(this,arguments)||this}return o}(r):(i=function(){(t.$constructor||r).apply(this,arguments)},slt(i,this)),Mt(i.prototype,t),i[F3e]=!0,i.extend=this.extend,i.superCall=cht,i.superApply=fht,i.superClass=r,i}}function lht(n){return rn(n)&&/^class\s/.test(Function.prototype.toString.call(n))}function B3e(n,e){n.extend=e.extend}var uht=Math.round(Math.random()*10);function hht(n){var e=["__\0is_clz",uht++].join("_");n.prototype[e]=!0,n.isInstance=function(t){return!!(t&&t[e])}}function cht(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return this.superClass.prototype[e].apply(n,t)}function fht(n,e,t){return this.superClass.prototype[e].apply(n,t)}function Hz(n){var e={};n.registerClass=function(r){var i=r.type||r.prototype.type;if(i){oht(i),r.prototype.type=i;var a=ky(i);if(!a.sub)e[a.main]=r;else if(a.sub!==Zw){var o=t(a);o[a.sub]=r}}return r},n.getClass=function(r,i,a){var o=e[r];if(o&&o[Zw]&&(o=i?o[i]:null),a&&!o)throw new Error(i?"Component "+r+"."+(i||"")+" is used but not imported.":r+".type should be specified.");return o},n.getClassesByMainType=function(r){var i=ky(r),a=[],o=e[i.main];return o&&o[Zw]?te(o,function(s,l){l!==Zw&&a.push(s)}):a.push(o),a},n.hasClass=function(r){var i=ky(r);return!!e[i.main]},n.getAllClassMainTypes=function(){var r=[];return te(e,function(i,a){r.push(a)}),r},n.hasSubTypes=function(r){var i=ky(r),a=e[i.main];return a&&a[Zw]};function t(r){var i=e[r.main];return(!i||!i[Zw])&&(i=e[r.main]={},i[Zw]=!0),i}}function qE(n,e){for(var t=0;t<n.length;t++)n[t][1]||(n[t][1]=n[t][0]);return e=e||!1,function(r,i,a){for(var o={},s=0;s<n.length;s++){var l=n[s][1];if(!(i&&gi(i,l)>=0||a&&gi(a,l)<0)){var u=r.getShallow(l,e);u!=null&&(o[n[s][0]]=u)}}return o}}var dht=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],vht=qE(dht),pht=function(){function n(){}return n.prototype.getAreaStyle=function(e,t){return vht(this,e,t)},n}(),tJ=new d3(50);function ght(n){if(typeof n=="string"){var e=tJ.get(n);return e&&e.image}else return n}function yie(n,e,t,r,i){if(n)if(typeof n=="string"){if(e&&e.__zrImageSrc===n||!t)return e;var a=tJ.get(n),o={hostEl:t,cb:r,cbPayload:i};return a?(e=a.image,!jz(e)&&a.pending.push(o)):(e=s_.loadImage(n,Rve,Rve),e.__zrImageSrc=n,tJ.put(n,e.__cachedImgObj={image:e,pending:[o]})),e}else return n;else return e}function Rve(){var n=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<n.pending.length;e++){var t=n.pending[e],r=t.cb;r&&r(this,t.cbPayload),t.hostEl.dirty()}n.pending.length=0}function jz(n){return n&&n.width&&n.height}var dH=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function yht(n,e,t,r,i){if(!e)return"";var a=(n+"").split(`
`);i=G3e(e,t,r,i);for(var o=0,s=a.length;o<s;o++)a[o]=z3e(a[o],i);return a.join(`
`)}function G3e(n,e,t,r){r=r||{};var i=Mt({},r);i.font=e,t=ni(t,"..."),i.maxIterations=ni(r.maxIterations,2);var a=i.minChar=ni(r.minChar,0);i.cnCharWidth=yv("\u56FD",e);var o=i.ascCharWidth=yv("a",e);i.placeholder=ni(r.placeholder,"");for(var s=n=Math.max(0,n-1),l=0;l<a&&s>=o;l++)s-=o;var u=yv(t,e);return u>s&&(t="",u=0),s=n-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=n,i}function z3e(n,e){var t=e.containerWidth,r=e.font,i=e.contentWidth;if(!t)return"";var a=yv(n,r);if(a<=t)return n;for(var o=0;;o++){if(a<=i||o>=e.maxIterations){n+=e.ellipsis;break}var s=o===0?mht(n,i,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(n.length*i/a):0;n=n.substr(0,s),a=yv(n,r)}return n===""&&(n=e.placeholder),n}function mht(n,e,t,r){for(var i=0,a=0,o=n.length;a<o&&i<e;a++){var s=n.charCodeAt(a);i+=0<=s&&s<=127?t:r}return a}function _ht(n,e){n!=null&&(n+="");var t=e.overflow,r=e.padding,i=e.font,a=t==="truncate",o=Wz(i),s=ni(e.lineHeight,o),l=!!e.backgroundColor,u=e.lineOverflow==="truncate",h=e.width,c;h!=null&&(t==="break"||t==="breakAll")?c=n?U3e(n,e.font,h,t==="breakAll",0).lines:[]:c=n?n.split(`
`):[];var f=c.length*s,d=ni(e.height,f);if(f>d&&u){var v=Math.floor(d/s);c=c.slice(0,v)}if(n&&a&&h!=null)for(var p=G3e(h,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g=0;g<c.length;g++)c[g]=z3e(c[g],p);for(var m=d,y=0,g=0;g<c.length;g++)y=Math.max(yv(c[g],i),y);h==null&&(h=y);var _=y;return r&&(m+=r[0]+r[2],_+=r[1]+r[3],h+=r[1]+r[3]),l&&(_=h),{lines:c,height:d,outerWidth:_,outerHeight:m,lineHeight:s,calculatedLineHeight:o,contentWidth:y,contentHeight:f,width:h}}var xht=function(){function n(){}return n}(),Dve=function(){function n(e){this.tokens=[],e&&(this.tokens=e)}return n}(),Sht=function(){function n(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]}return n}();function wht(n,e){var t=new Sht;if(n!=null&&(n+=""),!n)return t;for(var r=e.width,i=e.height,a=e.overflow,o=(a==="break"||a==="breakAll")&&r!=null?{width:r,accumWidth:0,breakAll:a==="breakAll"}:null,s=dH.lastIndex=0,l;(l=dH.exec(n))!=null;){var u=l.index;u>s&&vH(t,n.substring(s,u),e,o),vH(t,l[2],e,o,l[1]),s=dH.lastIndex}s<n.length&&vH(t,n.substring(s,n.length),e,o);var h=[],c=0,f=0,d=e.padding,v=a==="truncate",p=e.lineOverflow==="truncate";function g(W,z,V){W.width=z,W.lineHeight=V,c+=V,f=Math.max(f,z)}e:for(var m=0;m<t.lines.length;m++){for(var y=t.lines[m],_=0,x=0,S=0;S<y.tokens.length;S++){var w=y.tokens[S],b=w.styleName&&e.rich[w.styleName]||{},E=w.textPadding=b.padding,T=E?E[1]+E[3]:0,C=w.font=b.font||e.font;w.contentHeight=Wz(C);var A=ni(b.height,w.contentHeight);if(w.innerHeight=A,E&&(A+=E[0]+E[2]),w.height=A,w.lineHeight=qy(b.lineHeight,e.lineHeight,A),w.align=b&&b.align||e.align,w.verticalAlign=b&&b.verticalAlign||"middle",p&&i!=null&&c+w.lineHeight>i){S>0?(y.tokens=y.tokens.slice(0,S),g(y,x,_),t.lines=t.lines.slice(0,m+1)):t.lines=t.lines.slice(0,m);break e}var M=b.width,I=M==null||M==="auto";if(typeof M=="string"&&M.charAt(M.length-1)==="%")w.percentWidth=M,h.push(w),w.contentWidth=yv(w.text,C);else{if(I){var R=b.backgroundColor,k=R&&R.image;k&&(k=ght(k),jz(k)&&(w.width=Math.max(w.width,k.width*A/k.height)))}var D=v&&r!=null?r-x:null;D!=null&&D<w.width?!I||D<T?(w.text="",w.width=w.contentWidth=0):(w.text=yht(w.text,D-T,C,e.ellipsis,{minChar:e.truncateMinChar}),w.width=w.contentWidth=yv(w.text,C)):w.contentWidth=yv(w.text,C)}w.width+=T,x+=w.width,b&&(_=Math.max(_,w.lineHeight))}g(y,x,_)}t.outerWidth=t.width=ni(r,f),t.outerHeight=t.height=ni(i,c),t.contentHeight=c,t.contentWidth=f,d&&(t.outerWidth+=d[1]+d[3],t.outerHeight+=d[0]+d[2]);for(var m=0;m<h.length;m++){var w=h[m],G=w.percentWidth;w.width=parseInt(G,10)/100*t.width}return t}function vH(n,e,t,r,i){var a=e==="",o=i&&t.rich[i]||{},s=n.lines,l=o.font||t.font,u=!1,h,c;if(r){var f=o.padding,d=f?f[1]+f[3]:0;if(o.width!=null&&o.width!=="auto"){var v=_0(o.width,r.width)+d;s.length>0&&v+r.accumWidth>r.width&&(h=e.split(`
`),u=!0),r.accumWidth=v}else{var p=U3e(e,l,r.width,r.breakAll,r.accumWidth);r.accumWidth=p.accumWidth+d,c=p.linesWidths,h=p.lines}}else h=e.split(`
`);for(var g=0;g<h.length;g++){var m=h[g],y=new xht;if(y.styleName=i,y.text=m,y.isLineHolder=!m&&!a,typeof o.width=="number"?y.width=o.width:y.width=c?c[g]:yv(m,l),!g&&!u){var _=(s[s.length-1]||(s[0]=new Dve)).tokens,x=_.length;x===1&&_[0].isLineHolder?_[0]=y:(m||!x||a)&&_.push(y)}else s.push(new Dve([y]))}}function bht(n){var e=n.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Eht=om(",&?/;] ".split(""),function(n,e){return n[e]=!0,n},{});function Tht(n){return bht(n)?!!Eht[n]:!0}function U3e(n,e,t,r,i){for(var a=[],o=[],s="",l="",u=0,h=0,c=0;c<n.length;c++){var f=n.charAt(c);if(f===`
`){l&&(s+=l,h+=u),a.push(s),o.push(h),s="",l="",u=0,h=0;continue}var d=yv(f,e),v=r?!1:!Tht(f);if(a.length?h+d>t:i+h+d>t){h?(s||l)&&(v?(s||(s=l,l="",u=0,h=u),a.push(s),o.push(h-u),l+=f,u+=d,s="",h=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(h),s=f,h=d)):v?(a.push(l),o.push(u),l=f,u=d):(a.push(f),o.push(d));continue}h+=d,v?(l+=f,u+=d):(l&&(s+=l,l="",u=0),s+=f)}return!a.length&&!s&&(s=n,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(h)),a.length===1&&(h+=i),{accumWidth:h,lines:a,linesWidths:o}}var rJ="__zr_style_"+Math.round(Math.random()*10),EE={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Xz={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};EE[rJ]=!0;var Nve=["z","z2","invisible"],Cht=["invisible"],Aht=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype._init=function(t){for(var r=Li(t),i=0;i<r.length;i++){var a=r[i];a==="style"?this.useStyle(t[a]):n.prototype.attrKV.call(this,a,t[a])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,r,i,a){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&Mht(this,t,r)||o&&!o[0]&&!o[3])return!1;if(i&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(t,r){return this.rectContain(t,r)},e.prototype.traverse=function(t,r){t.call(r,this)},e.prototype.rectContain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();return a.contain(i[0],i[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var r=this.transform,i=this.getBoundingRect(),a=this.style,o=a.shadowBlur||0,s=a.shadowOffsetX||0,l=a.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new ai(0,0,0,0)),r?ai.applyTransform(t,i,r):t.copy(i),(o||s||l)&&(t.width+=o*2+Math.abs(s),t.height+=o*2+Math.abs(l),t.x=Math.min(t.x,t.x+s-o),t.y=Math.min(t.y,t.y+l-o));var u=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-u),t.y=Math.floor(t.y-u),t.width=Math.ceil(t.width+1+u*2),t.height=Math.ceil(t.height+1+u*2))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new ai(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(t,r){t!=="style"?n.prototype.attrKV.call(this,t,r):this.style?this.setStyle(r):this.useStyle(r)},e.prototype.setStyle=function(t,r){return typeof t=="string"?this.style[t]=r:Mt(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=JP,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&JP)},e.prototype.styleUpdated=function(){this.__dirty&=~JP},e.prototype.createStyle=function(t){return Uz(EE,t)},e.prototype.useStyle=function(t){t[rJ]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[rJ]},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.style&&!r.style&&(r.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,r,Nve)},e.prototype._applyStateObj=function(t,r,i,a,o,s){n.prototype._applyStateObj.call(this,t,r,i,a,o,s);var l=!(r&&a),u;if(r&&r.style?o?a?u=r.style:(u=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(u,r.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:i.style),this._mergeStyle(u,r.style)):l&&(u=i.style),u)if(o){var h=this.style;if(this.style=this.createStyle(l?{}:h),l)for(var c=Li(h),f=0;f<c.length;f++){var d=c[f];d in u&&(u[d]=u[d],this.style[d]=h[d])}for(var v=Li(u),f=0;f<v.length;f++){var d=v[f];this.style[d]=this.style[d]}this._transitionState(t,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var p=this.__inHover?Cht:Nve,f=0;f<p.length;f++){var d=p[f];r&&r[d]!=null?this[d]=r[d]:l&&i[d]!=null&&(this[d]=i[d])}},e.prototype._mergeStates=function(t){for(var r=n.prototype._mergeStates.call(this,t),i,a=0;a<t.length;a++){var o=t[a];o.style&&(i=i||{},this._mergeStyle(i,o.style))}return i&&(r.style=i),r},e.prototype._mergeStyle=function(t,r){return Mt(t,r),t},e.prototype.getAnimationStyleProps=function(){return Xz},e.initDefaultProps=function(){var t=e.prototype;t.type="displayable",t.invisible=!1,t.z=0,t.z2=0,t.zlevel=0,t.culling=!1,t.cursor="pointer",t.rectHover=!1,t.incremental=!1,t._rect=null,t.dirtyRectTolerance=0,t.__dirty=ov|JP}(),e}(S3e),pH=new ai(0,0,0,0),gH=new ai(0,0,0,0);function Mht(n,e,t){return pH.copy(n.getBoundingRect()),n.transform&&pH.applyTransform(n.transform),gH.width=e,gH.height=t,!pH.intersect(gH)}const Vp=Aht;var sd=Math.min,ld=Math.max,yH=Math.sin,mH=Math.cos,Kw=Math.PI*2,JF=H2(),QF=H2(),e4=H2();function Yz(n,e,t){if(n.length!==0){for(var r=n[0],i=r[0],a=r[0],o=r[1],s=r[1],l=1;l<n.length;l++)r=n[l],i=sd(i,r[0]),a=ld(a,r[0]),o=sd(o,r[1]),s=ld(s,r[1]);e[0]=i,e[1]=o,t[0]=a,t[1]=s}}function kve(n,e,t,r,i,a){i[0]=sd(n,t),i[1]=sd(e,r),a[0]=ld(n,t),a[1]=ld(e,r)}var Fve=[],Bve=[];function Iht(n,e,t,r,i,a,o,s,l,u){var h=i3e,c=Qu,f=h(n,t,i,o,Fve);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var d=0;d<f;d++){var v=c(n,t,i,o,Fve[d]);l[0]=sd(v,l[0]),u[0]=ld(v,u[0])}f=h(e,r,a,s,Bve);for(var d=0;d<f;d++){var p=c(e,r,a,s,Bve[d]);l[1]=sd(p,l[1]),u[1]=ld(p,u[1])}l[0]=sd(n,l[0]),u[0]=ld(n,u[0]),l[0]=sd(o,l[0]),u[0]=ld(o,u[0]),l[1]=sd(e,l[1]),u[1]=ld(e,u[1]),l[1]=sd(s,l[1]),u[1]=ld(s,u[1])}function Lht(n,e,t,r,i,a,o,s){var l=o3e,u=Ph,h=ld(sd(l(n,t,i),1),0),c=ld(sd(l(e,r,a),1),0),f=u(n,t,i,h),d=u(e,r,a,c);o[0]=sd(n,i,f),o[1]=sd(e,a,d),s[0]=ld(n,i,f),s[1]=ld(e,a,d)}function Pht(n,e,t,r,i,a,o,s,l){var u=Kx,h=Jx,c=Math.abs(i-a);if(c%Kw<1e-4&&c>1e-4){s[0]=n-t,s[1]=e-r,l[0]=n+t,l[1]=e+r;return}if(JF[0]=mH(i)*t+n,JF[1]=yH(i)*r+e,QF[0]=mH(a)*t+n,QF[1]=yH(a)*r+e,u(s,JF,QF),h(l,JF,QF),i=i%Kw,i<0&&(i=i+Kw),a=a%Kw,a<0&&(a=a+Kw),i>a&&!o?a+=Kw:i<a&&o&&(i+=Kw),o){var f=a;a=i,i=f}for(var d=0;d<a;d+=Math.PI/2)d>i&&(e4[0]=mH(d)*t+n,e4[1]=yH(d)*r+e,u(s,e4,s),h(l,e4,l))}var Ho={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Jw=[],Qw=[],J0=[],rx=[],Q0=[],ey=[],_H=Math.min,xH=Math.max,eb=Math.cos,tb=Math.sin,qm=Math.abs,nJ=Math.PI,Tx=nJ*2,SH=typeof Float32Array<"u",XL=[];function wH(n){var e=Math.round(n/nJ*1e8)/1e8;return e%2*nJ}function V3e(n,e){var t=wH(n[0]);t<0&&(t+=Tx);var r=t-n[0],i=n[1];i+=r,!e&&i-t>=Tx?i=t+Tx:e&&t-i>=Tx?i=t-Tx:!e&&t>i?i=t+(Tx-wH(t-i)):e&&t<i&&(i=t-(Tx-wH(i-t))),n[0]=t,n[1]=i}var Oht=function(){function n(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return n.prototype.increaseVersion=function(){this._version++},n.prototype.getVersion=function(){return this._version},n.prototype.setScale=function(e,t,r){r=r||0,r>0&&(this._ux=qm(r/nG/e)||0,this._uy=qm(r/nG/t)||0)},n.prototype.setDPR=function(e){this.dpr=e},n.prototype.setContext=function(e){this._ctx=e},n.prototype.getContext=function(){return this._ctx},n.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},n.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},n.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Ho.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},n.prototype.lineTo=function(e,t){var r=qm(e-this._xi),i=qm(t-this._yi),a=r>this._ux||i>this._uy;if(this.addData(Ho.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=r*r+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},n.prototype.bezierCurveTo=function(e,t,r,i,a,o){return this._drawPendingPt(),this.addData(Ho.C,e,t,r,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,r,i,a,o),this._xi=a,this._yi=o,this},n.prototype.quadraticCurveTo=function(e,t,r,i){return this._drawPendingPt(),this.addData(Ho.Q,e,t,r,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,r,i),this._xi=r,this._yi=i,this},n.prototype.arc=function(e,t,r,i,a,o){this._drawPendingPt(),XL[0]=i,XL[1]=a,V3e(XL,o),i=XL[0],a=XL[1];var s=a-i;return this.addData(Ho.A,e,t,r,r,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,r,i,a,o),this._xi=eb(a)*r+e,this._yi=tb(a)*r+t,this},n.prototype.arcTo=function(e,t,r,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,r,i,a),this},n.prototype.rect=function(e,t,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,r,i),this.addData(Ho.R,e,t,r,i),this},n.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ho.Z);var e=this._ctx,t=this._x0,r=this._y0;return e&&e.closePath(),this._xi=t,this._yi=r,this},n.prototype.fill=function(e){e&&e.fill(),this.toStatic()},n.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},n.prototype.len=function(){return this._len},n.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&SH&&(this.data=new Float32Array(t));for(var r=0;r<t;r++)this.data[r]=e[r];this._len=t},n.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,r=0,i=this._len,a=0;a<t;a++)r+=e[a].len();SH&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+r));for(var a=0;a<t;a++)for(var o=e[a].data,s=0;s<o.length;s++)this.data[i++]=o[s];this._len=i},n.prototype.addData=function(e,t,r,i,a,o,s,l,u){if(!!this._saveData){var h=this.data;this._len+arguments.length>h.length&&(this._expandData(),h=this.data);for(var c=0;c<arguments.length;c++)h[this._len++]=arguments[c]}},n.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},n.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},n.prototype.toStatic=function(){if(!!this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,SH&&this._len>11&&(this.data=new Float32Array(e)))}},n.prototype.getBoundingRect=function(){J0[0]=J0[1]=Q0[0]=Q0[1]=Number.MAX_VALUE,rx[0]=rx[1]=ey[0]=ey[1]=-Number.MAX_VALUE;var e=this.data,t=0,r=0,i=0,a=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(t=e[o],r=e[o+1],i=t,a=r),s){case Ho.M:t=i=e[o++],r=a=e[o++],Q0[0]=i,Q0[1]=a,ey[0]=i,ey[1]=a;break;case Ho.L:kve(t,r,e[o],e[o+1],Q0,ey),t=e[o++],r=e[o++];break;case Ho.C:Iht(t,r,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Q0,ey),t=e[o++],r=e[o++];break;case Ho.Q:Lht(t,r,e[o++],e[o++],e[o],e[o+1],Q0,ey),t=e[o++],r=e[o++];break;case Ho.A:var u=e[o++],h=e[o++],c=e[o++],f=e[o++],d=e[o++],v=e[o++]+d;o+=1;var p=!e[o++];l&&(i=eb(d)*c+u,a=tb(d)*f+h),Pht(u,h,c,f,d,v,p,Q0,ey),t=eb(v)*c+u,r=tb(v)*f+h;break;case Ho.R:i=t=e[o++],a=r=e[o++];var g=e[o++],m=e[o++];kve(i,a,i+g,a+m,Q0,ey);break;case Ho.Z:t=i,r=a;break}Kx(J0,J0,Q0),Jx(rx,rx,ey)}return o===0&&(J0[0]=J0[1]=rx[0]=rx[1]=0),new ai(J0[0],J0[1],rx[0]-J0[0],rx[1]-J0[1])},n.prototype._calculateLength=function(){var e=this.data,t=this._len,r=this._ux,i=this._uy,a=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,h=0,c=0,f=0;f<t;){var d=e[f++],v=f===1;v&&(a=e[f],o=e[f+1],s=a,l=o);var p=-1;switch(d){case Ho.M:a=s=e[f++],o=l=e[f++];break;case Ho.L:{var g=e[f++],m=e[f++],y=g-a,_=m-o;(qm(y)>r||qm(_)>i||f===t-1)&&(p=Math.sqrt(y*y+_*_),a=g,o=m);break}case Ho.C:{var x=e[f++],S=e[f++],g=e[f++],m=e[f++],w=e[f++],b=e[f++];p=Xlt(a,o,x,S,g,m,w,b,10),a=w,o=b;break}case Ho.Q:{var x=e[f++],S=e[f++],g=e[f++],m=e[f++];p=qlt(a,o,x,S,g,m,10),a=g,o=m;break}case Ho.A:var E=e[f++],T=e[f++],C=e[f++],A=e[f++],M=e[f++],I=e[f++],R=I+M;f+=1,e[f++],v&&(s=eb(M)*C+E,l=tb(M)*A+T),p=xH(C,A)*_H(Tx,Math.abs(I)),a=eb(R)*C+E,o=tb(R)*A+T;break;case Ho.R:{s=a=e[f++],l=o=e[f++];var k=e[f++],D=e[f++];p=k*2+D*2;break}case Ho.Z:{var y=s-a,_=l-o;p=Math.sqrt(y*y+_*_),a=s,o=l;break}}p>=0&&(u[c++]=p,h+=p)}return this._pathLen=h,h},n.prototype.rebuildPath=function(e,t){var r=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,h,c,f,d=t<1,v,p,g=0,m=0,y,_=0,x,S;if(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,p=this._pathLen,y=t*p,!y))return;e:for(var w=0;w<o;){var b=r[w++],E=w===1;switch(E&&(u=r[w],h=r[w+1],s=u,l=h),b!==Ho.L&&_>0&&(e.lineTo(x,S),_=0),b){case Ho.M:s=u=r[w++],l=h=r[w++],e.moveTo(u,h);break;case Ho.L:{c=r[w++],f=r[w++];var T=qm(c-u),C=qm(f-h);if(T>i||C>a){if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;e.lineTo(u*(1-M)+c*M,h*(1-M)+f*M);break e}g+=A}e.lineTo(c,f),u=c,h=f,_=0}else{var I=T*T+C*C;I>_&&(x=c,S=f,_=I)}break}case Ho.C:{var R=r[w++],k=r[w++],D=r[w++],G=r[w++],W=r[w++],z=r[w++];if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;DS(u,R,D,W,M,Jw),DS(h,k,G,z,M,Qw),e.bezierCurveTo(Jw[1],Qw[1],Jw[2],Qw[2],Jw[3],Qw[3]);break e}g+=A}e.bezierCurveTo(R,k,D,G,W,z),u=W,h=z;break}case Ho.Q:{var R=r[w++],k=r[w++],D=r[w++],G=r[w++];if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;tD(u,R,D,M,Jw),tD(h,k,G,M,Qw),e.quadraticCurveTo(Jw[1],Qw[1],Jw[2],Qw[2]);break e}g+=A}e.quadraticCurveTo(R,k,D,G),u=D,h=G;break}case Ho.A:var V=r[w++],q=r[w++],Y=r[w++],le=r[w++],j=r[w++],Q=r[w++],ie=r[w++],oe=!r[w++],se=Y>le?Y:le,me=qm(Y-le)>.001,Ce=j+Q,Le=!1;if(d){var A=v[m++];g+A>y&&(Ce=j+Q*(y-g)/A,Le=!0),g+=A}if(me&&e.ellipse?e.ellipse(V,q,Y,le,ie,j,Ce,oe):e.arc(V,q,se,j,Ce,oe),Le)break e;E&&(s=eb(j)*Y+V,l=tb(j)*le+q),u=eb(Ce)*Y+V,h=tb(Ce)*le+q;break;case Ho.R:s=u=r[w],l=h=r[w+1],c=r[w++],f=r[w++];var re=r[w++],yt=r[w++];if(d){var A=v[m++];if(g+A>y){var je=y-g;e.moveTo(c,f),e.lineTo(c+_H(je,re),f),je-=re,je>0&&e.lineTo(c+re,f+_H(je,yt)),je-=yt,je>0&&e.lineTo(c+xH(re-je,0),f+yt),je-=re,je>0&&e.lineTo(c,f+xH(yt-je,0));break e}g+=A}e.rect(c,f,re,yt);break;case Ho.Z:if(d){var A=v[m++];if(g+A>y){var M=(y-g)/A;e.lineTo(u*(1-M)+s*M,h*(1-M)+l*M);break e}g+=A}e.closePath(),u=s,h=l}}},n.prototype.clone=function(){var e=new n,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},n.CMD=Ho,n.initDefaultProps=function(){var e=n.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),n}();const hm=Oht;function Nx(n,e,t,r,i,a,o){if(i===0)return!1;var s=i,l=0,u=n;if(o>e+s&&o>r+s||o<e-s&&o<r-s||a>n+s&&a>t+s||a<n-s&&a<t-s)return!1;if(n!==t)l=(e-r)/(n-t),u=(n*r-t*e)/(n-t);else return Math.abs(a-n)<=s/2;var h=l*a-o+u,c=h*h/(l*l+1);return c<=s/2*s/2}function Rht(n,e,t,r,i,a,o,s,l,u,h){if(l===0)return!1;var c=l;if(h>e+c&&h>r+c&&h>a+c&&h>s+c||h<e-c&&h<r-c&&h<a-c&&h<s-c||u>n+c&&u>t+c&&u>i+c&&u>o+c||u<n-c&&u<t-c&&u<i-c&&u<o-c)return!1;var f=a3e(n,e,t,r,i,a,o,s,u,h,null);return f<=c/2}function $3e(n,e,t,r,i,a,o,s,l){if(o===0)return!1;var u=o;if(l>e+u&&l>r+u&&l>a+u||l<e-u&&l<r-u&&l<a-u||s>n+u&&s>t+u&&s>i+u||s<n-u&&s<t-u&&s<i-u)return!1;var h=s3e(n,e,t,r,i,a,s,l,null);return h<=u/2}var Gve=Math.PI*2;function e0(n){return n%=Gve,n<0&&(n+=Gve),n}var YL=Math.PI*2;function Dht(n,e,t,r,i,a,o,s,l){if(o===0)return!1;var u=o;s-=n,l-=e;var h=Math.sqrt(s*s+l*l);if(h-u>t||h+u<t)return!1;if(Math.abs(r-i)%YL<1e-4)return!0;if(a){var c=r;r=e0(i),i=e0(c)}else r=e0(r),i=e0(i);r>i&&(i+=YL);var f=Math.atan2(l,s);return f<0&&(f+=YL),f>=r&&f<=i||f+YL>=r&&f+YL<=i}function g1(n,e,t,r,i,a){if(a>e&&a>r||a<e&&a<r||r===e)return 0;var o=(a-e)/(r-e),s=r<e?1:-1;(o===1||o===0)&&(s=r<e?.5:-.5);var l=o*(t-n)+n;return l===i?1/0:l>i?s:0}var nx=hm.CMD,rb=Math.PI*2,Nht=1e-4;function kht(n,e){return Math.abs(n-e)<Nht}var Sf=[-1,-1,-1],gp=[-1,-1];function Fht(){var n=gp[0];gp[0]=gp[1],gp[1]=n}function Bht(n,e,t,r,i,a,o,s,l,u){if(u>e&&u>r&&u>a&&u>s||u<e&&u<r&&u<a&&u<s)return 0;var h=Q8(e,r,a,s,u,Sf);if(h===0)return 0;for(var c=0,f=-1,d=void 0,v=void 0,p=0;p<h;p++){var g=Sf[p],m=g===0||g===1?.5:1,y=Qu(n,t,i,o,g);y<l||(f<0&&(f=i3e(e,r,a,s,gp),gp[1]<gp[0]&&f>1&&Fht(),d=Qu(e,r,a,s,gp[0]),f>1&&(v=Qu(e,r,a,s,gp[1]))),f===2?g<gp[0]?c+=d<e?m:-m:g<gp[1]?c+=v<d?m:-m:c+=s<v?m:-m:g<gp[0]?c+=d<e?m:-m:c+=s<d?m:-m)}return c}function Ght(n,e,t,r,i,a,o,s){if(s>e&&s>r&&s>a||s<e&&s<r&&s<a)return 0;var l=Ylt(e,r,a,s,Sf);if(l===0)return 0;var u=o3e(e,r,a);if(u>=0&&u<=1){for(var h=0,c=Ph(e,r,a,u),f=0;f<l;f++){var d=Sf[f]===0||Sf[f]===1?.5:1,v=Ph(n,t,i,Sf[f]);v<o||(Sf[f]<u?h+=c<e?d:-d:h+=a<c?d:-d)}return h}else{var d=Sf[0]===0||Sf[0]===1?.5:1,v=Ph(n,t,i,Sf[0]);return v<o?0:a<e?d:-d}}function zht(n,e,t,r,i,a,o,s){if(s-=e,s>t||s<-t)return 0;var l=Math.sqrt(t*t-s*s);Sf[0]=-l,Sf[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=rb-1e-4){r=0,i=rb;var h=a?1:-1;return o>=Sf[0]+n&&o<=Sf[1]+n?h:0}if(r>i){var c=r;r=i,i=c}r<0&&(r+=rb,i+=rb);for(var f=0,d=0;d<2;d++){var v=Sf[d];if(v+n>o){var p=Math.atan2(s,v),h=a?1:-1;p<0&&(p=rb+p),(p>=r&&p<=i||p+rb>=r&&p+rb<=i)&&(p>Math.PI/2&&p<Math.PI*1.5&&(h=-h),f+=h)}}return f}function W3e(n,e,t,r,i){for(var a=n.data,o=n.len(),s=0,l=0,u=0,h=0,c=0,f,d,v=0;v<o;){var p=a[v++],g=v===1;switch(p===nx.M&&v>1&&(t||(s+=g1(l,u,h,c,r,i))),g&&(l=a[v],u=a[v+1],h=l,c=u),p){case nx.M:h=a[v++],c=a[v++],l=h,u=c;break;case nx.L:if(t){if(Nx(l,u,a[v],a[v+1],e,r,i))return!0}else s+=g1(l,u,a[v],a[v+1],r,i)||0;l=a[v++],u=a[v++];break;case nx.C:if(t){if(Rht(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],e,r,i))return!0}else s+=Bht(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],r,i)||0;l=a[v++],u=a[v++];break;case nx.Q:if(t){if($3e(l,u,a[v++],a[v++],a[v],a[v+1],e,r,i))return!0}else s+=Ght(l,u,a[v++],a[v++],a[v],a[v+1],r,i)||0;l=a[v++],u=a[v++];break;case nx.A:var m=a[v++],y=a[v++],_=a[v++],x=a[v++],S=a[v++],w=a[v++];v+=1;var b=!!(1-a[v++]);f=Math.cos(S)*_+m,d=Math.sin(S)*x+y,g?(h=f,c=d):s+=g1(l,u,f,d,r,i);var E=(r-m)*x/_+m;if(t){if(Dht(m,y,x,S,S+w,b,e,E,i))return!0}else s+=zht(m,y,x,S,S+w,b,E,i);l=Math.cos(S+w)*_+m,u=Math.sin(S+w)*x+y;break;case nx.R:h=l=a[v++],c=u=a[v++];var T=a[v++],C=a[v++];if(f=h+T,d=c+C,t){if(Nx(h,c,f,c,e,r,i)||Nx(f,c,f,d,e,r,i)||Nx(f,d,h,d,e,r,i)||Nx(h,d,h,c,e,r,i))return!0}else s+=g1(f,c,f,d,r,i),s+=g1(h,d,h,c,r,i);break;case nx.Z:if(t){if(Nx(l,u,h,c,e,r,i))return!0}else s+=g1(l,u,h,c,r,i);l=h,u=c;break}}return!t&&!kht(u,c)&&(s+=g1(l,u,h,c,r,i)||0),s!==0}function Uht(n,e,t){return W3e(n,0,!1,e,t)}function Vht(n,e,t,r){return W3e(n,e,!0,t,r)}var oG=sn({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},EE),$ht={style:sn({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Xz.style)},bH=lm.concat(["invisible","culling","z","z2","zlevel","parent"]),Wht=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.update=function(){var t=this;n.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){t.buildPath(l,t.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s<bH.length;++s)i[bH[s]]=this[bH[s]];i.__dirty|=ov}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(t){var r=Li(t);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];o==="style"?this.style?Mt(this.style,s):this.useStyle(s):o==="shape"?Mt(this.shape,s):n.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var t=this.style.fill;if(t!=="none"){if(Or(t)){var r=tG(t,0);return r>.5?JK:r>.2?Cut:QK}else if(t)return QK}return JK},e.prototype.getInsideTextStroke=function(t){var r=this.style.fill;if(Or(r)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=tG(t,0)<KK;if(a===o)return r}},e.prototype.buildPath=function(t,r,i){},e.prototype.pathUpdated=function(){this.__dirty&=~BC},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new hm(!1)},e.prototype.hasStroke=function(){var t=this.style,r=t.stroke;return!(r==null||r==="none"||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,r=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&BC)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){s.copy(t);var l=r.strokeNoScale?this.getLineScale():1,u=r.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;u=Math.max(u,h==null?4:h)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect(),o=this.style;if(t=i[0],r=i[1],a.contain(t,r)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Vht(s,l/u,t,r)))return!0}if(this.hasFill())return Uht(s,t,r)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=BC,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,r){t==="shape"?this.setShape(r):n.prototype.attrKV.call(this,t,r)},e.prototype.setShape=function(t,r){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=r:Mt(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&BC)},e.prototype.createStyle=function(t){return Uz(oG,t)},e.prototype._innerSaveToNormal=function(t){n.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.shape&&!r.shape&&(r.shape=Mt({},this.shape))},e.prototype._applyStateObj=function(t,r,i,a,o,s){n.prototype._applyStateObj.call(this,t,r,i,a,o,s);var l=!(r&&a),u;if(r&&r.shape?o?a?u=r.shape:(u=Mt({},i.shape),Mt(u,r.shape)):(u=Mt({},a?this.shape:i.shape),Mt(u,r.shape)):l&&(u=i.shape),u)if(o){this.shape=Mt({},this.shape);for(var h={},c=Li(u),f=0;f<c.length;f++){var d=c[f];typeof u[d]=="object"?this.shape[d]=u[d]:h[d]=u[d]}this._transitionState(t,{shape:h},s)}else this.shape=u,this.dirtyShape()},e.prototype._mergeStates=function(t){for(var r=n.prototype._mergeStates.call(this,t),i,a=0;a<t.length;a++){var o=t[a];o.shape&&(i=i||{},this._mergeStyle(i,o.shape))}return i&&(r.shape=i),r},e.prototype.getAnimationStyleProps=function(){return $ht},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var r=function(a){$e(o,a);function o(s){var l=a.call(this,s)||this;return t.init&&t.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return Sn(t.style)},o.prototype.getDefaultShape=function(){return Sn(t.shape)},o}(e);for(var i in t)typeof t[i]=="function"&&(r.prototype[i]=t[i]);return r},e.initDefaultProps=function(){var t=e.prototype;t.type="path",t.strokeContainThreshold=5,t.segmentIgnoreThreshold=0,t.subPixelOptimize=!1,t.autoBatch=!1,t.__dirty=ov|JP|BC}(),e}(Vp);const Si=Wht;var Hht=sn({strokeFirst:!0,font:RS,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},oG),H3e=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var t=this.style,r=t.stroke;return r!=null&&r!=="none"&&t.lineWidth>0},e.prototype.hasFill=function(){var t=this.style,r=t.fill;return r!=null&&r!=="none"},e.prototype.createStyle=function(t){return Uz(Hht,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var r=t.text;r!=null?r+="":r="";var i=v3(r,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a}this._rect=i}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(Vp);H3e.prototype.type="tspan";const aD=H3e;var jht=sn({x:0,y:0},EE),Xht={style:sn({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Xz.style)};function Yht(n){return!!(n&&typeof n!="string"&&n.width&&n.height)}var j3e=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return Uz(jht,t)},e.prototype._getSize=function(t){var r=this.style,i=r[t];if(i!=null)return i;var a=Yht(r.image)?r.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=r[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Xht},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new ai(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Vp);j3e.prototype.type="image";const xc=j3e;function qht(n,e){var t=e.x,r=e.y,i=e.width,a=e.height,o=e.r,s,l,u,h;i<0&&(t=t+i,i=-i),a<0&&(r=r+a,a=-a),typeof o=="number"?s=l=u=h=o:o instanceof Array?o.length===1?s=l=u=h=o[0]:o.length===2?(s=u=o[0],l=h=o[1]):o.length===3?(s=o[0],l=h=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],h=o[3]):s=l=u=h=0;var c;s+l>i&&(c=s+l,s*=i/c,l*=i/c),u+h>i&&(c=u+h,u*=i/c,h*=i/c),l+u>a&&(c=l+u,l*=a/c,u*=a/c),s+h>a&&(c=s+h,s*=a/c,h*=a/c),n.moveTo(t+s,r),n.lineTo(t+i-l,r),l!==0&&n.arc(t+i-l,r+l,l,-Math.PI/2,0),n.lineTo(t+i,r+a-u),u!==0&&n.arc(t+i-u,r+a-u,u,0,Math.PI/2),n.lineTo(t+h,r+a),h!==0&&n.arc(t+h,r+a-h,h,Math.PI/2,Math.PI),n.lineTo(t,r+s),s!==0&&n.arc(t+s,r+s,s,Math.PI,Math.PI*1.5)}var cA=Math.round;function X3e(n,e,t){if(!!e){var r=e.x1,i=e.x2,a=e.y1,o=e.y2;n.x1=r,n.x2=i,n.y1=a,n.y2=o;var s=t&&t.lineWidth;return s&&(cA(r*2)===cA(i*2)&&(n.x1=n.x2=rE(r,s,!0)),cA(a*2)===cA(o*2)&&(n.y1=n.y2=rE(a,s,!0))),n}}function Y3e(n,e,t){if(!!e){var r=e.x,i=e.y,a=e.width,o=e.height;n.x=r,n.y=i,n.width=a,n.height=o;var s=t&&t.lineWidth;return s&&(n.x=rE(r,s,!0),n.y=rE(i,s,!0),n.width=Math.max(rE(r+a,s,!1)-n.x,a===0?0:1),n.height=Math.max(rE(i+o,s,!1)-n.y,o===0?0:1)),n}}function rE(n,e,t){if(!e)return n;var r=cA(n*2);return(r+cA(e))%2===0?r/2:(r+(t?1:-1))/2}var Zht=function(){function n(){this.x=0,this.y=0,this.width=0,this.height=0}return n}(),Kht={},q3e=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Zht},e.prototype.buildPath=function(t,r){var i,a,o,s;if(this.subPixelOptimize){var l=Y3e(Kht,r,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=r.r,r=l}else i=r.x,a=r.y,o=r.width,s=r.height;r.r?qht(t,r):t.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Si);q3e.prototype.type="rect";const ta=q3e;var zve={fill:"#000"},Uve=2,Jht={style:sn({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Xz.style)},Z3e=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=zve,r.attr(t),r}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){n.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var r=this._children[t];r.zlevel=this.zlevel,r.z=this.z,r.z2=this.z2,r.culling=this.culling,r.cursor=this.cursor,r.invisible=this.invisible}},e.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):n.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(t){var r=this.innerTransformable;return r?r.getLocalTransform(t):n.prototype.getLocalTransform.call(this,t)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),n.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,tct(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(t){n.prototype.addSelfToZr.call(this,t);for(var r=0;r<this._children.length;r++)this._children[r].__zr=t},e.prototype.removeSelfFromZr=function(t){n.prototype.removeSelfFromZr.call(this,t);for(var r=0;r<this._children.length;r++)this._children[r].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new ai(0,0,0,0),r=this._children,i=[],a=null,o=0;o<r.length;o++){var s=r[o],l=s.getBoundingRect(),u=s.getLocalTransform(i);u?(t.copy(l),t.applyTransform(u),a=a||t.clone(),a.union(t)):(a=a||l.clone(),a.union(l))}this._rect=a||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||zve},e.prototype.setTextContent=function(t){},e.prototype._mergeStyle=function(t,r){if(!r)return t;var i=r.rich,a=t.rich||i&&{};return Mt(t,r),i&&a?(this._mergeRich(a,i),t.rich=a):a&&(t.rich=a),t},e.prototype._mergeRich=function(t,r){for(var i=Li(r),a=0;a<i.length;a++){var o=i[a];t[o]=t[o]||{},Mt(t[o],r[o])}},e.prototype.getAnimationStyleProps=function(){return Jht},e.prototype._getOrCreateChild=function(t){var r=this._children[this._childCursor];return(!r||!(r instanceof t))&&(r=new t),this._children[this._childCursor++]=r,r.__zr=this.__zr,r.parent=this,r},e.prototype._updatePlainTexts=function(){var t=this.style,r=t.font||RS,i=t.padding,a=Yve(t),o=_ht(a,t),s=EH(t),l=!!t.backgroundColor,u=o.outerHeight,h=o.outerWidth,c=o.contentWidth,f=o.lines,d=o.lineHeight,v=this._defaultStyle,p=t.x||0,g=t.y||0,m=t.align||v.align||"left",y=t.verticalAlign||v.verticalAlign||"top",_=p,x=GC(g,o.contentHeight,y);if(s||i){var S=eO(p,h,m),w=GC(g,u,y);s&&this._renderBackground(t,t,S,w,h,u)}x+=d/2,i&&(_=Xve(p,m,i),y==="top"?x+=i[0]:y==="bottom"&&(x-=i[2]));for(var b=0,E=!1,T=jve("fill"in t?t.fill:(E=!0,v.fill)),C=Hve("stroke"in t?t.stroke:!l&&(!v.autoStroke||E)?(b=Uve,v.stroke):null),A=t.textShadowBlur>0,M=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),I=o.calculatedLineHeight,R=0;R<f.length;R++){var k=this._getOrCreateChild(aD),D=k.createStyle();k.useStyle(D),D.text=f[R],D.x=_,D.y=x,m&&(D.textAlign=m),D.textBaseline="middle",D.opacity=t.opacity,D.strokeFirst=!0,A&&(D.shadowBlur=t.textShadowBlur||0,D.shadowColor=t.textShadowColor||"transparent",D.shadowOffsetX=t.textShadowOffsetX||0,D.shadowOffsetY=t.textShadowOffsetY||0),D.stroke=C,D.fill=T,C&&(D.lineWidth=t.lineWidth||b,D.lineDash=t.lineDash,D.lineDashOffset=t.lineDashOffset||0),D.font=r,$ve(D,t),x+=d,M&&k.setBoundingRect(new ai(eO(D.x,t.width,D.textAlign),GC(D.y,I,D.textBaseline),c,I))}},e.prototype._updateRichTexts=function(){var t=this.style,r=Yve(t),i=wht(r,t),a=i.width,o=i.outerWidth,s=i.outerHeight,l=t.padding,u=t.x||0,h=t.y||0,c=this._defaultStyle,f=t.align||c.align,d=t.verticalAlign||c.verticalAlign,v=eO(u,o,f),p=GC(h,s,d),g=v,m=p;l&&(g+=l[3],m+=l[0]);var y=g+a;EH(t)&&this._renderBackground(t,t,v,p,o,s);for(var _=!!t.backgroundColor,x=0;x<i.lines.length;x++){for(var S=i.lines[x],w=S.tokens,b=w.length,E=S.lineHeight,T=S.width,C=0,A=g,M=y,I=b-1,R=void 0;C<b&&(R=w[C],!R.align||R.align==="left");)this._placeToken(R,t,E,m,A,"left",_),T-=R.width,A+=R.width,C++;for(;I>=0&&(R=w[I],R.align==="right");)this._placeToken(R,t,E,m,M,"right",_),T-=R.width,M-=R.width,I--;for(A+=(a-(A-g)-(y-M)-T)/2;C<=I;)R=w[C],this._placeToken(R,t,E,m,A+R.width/2,"center",_),A+=R.width,C++;m+=E}},e.prototype._placeToken=function(t,r,i,a,o,s,l){var u=r.rich[t.styleName]||{};u.text=t.text;var h=t.verticalAlign,c=a+i/2;h==="top"?c=a+t.height/2:h==="bottom"&&(c=a+i-t.height/2);var f=!t.isLineHolder&&EH(u);f&&this._renderBackground(u,r,s==="right"?o-t.width:s==="center"?o-t.width/2:o,c-t.height/2,t.width,t.height);var d=!!u.backgroundColor,v=t.textPadding;v&&(o=Xve(o,s,v),c-=t.height/2-v[0]-t.innerHeight/2);var p=this._getOrCreateChild(aD),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,y=!1,_=0,x=jve("fill"in u?u.fill:"fill"in r?r.fill:(y=!0,m.fill)),S=Hve("stroke"in u?u.stroke:"stroke"in r?r.stroke:!d&&!l&&(!m.autoStroke||y)?(_=Uve,m.stroke):null),w=u.textShadowBlur>0||r.textShadowBlur>0;g.text=t.text,g.x=o,g.y=c,w&&(g.shadowBlur=u.textShadowBlur||r.textShadowBlur||0,g.shadowColor=u.textShadowColor||r.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||r.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||r.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=t.font||RS,g.opacity=qy(u.opacity,r.opacity,1),$ve(g,u),S&&(g.lineWidth=qy(u.lineWidth,r.lineWidth,_),g.lineDash=ni(u.lineDash,r.lineDash),g.lineDashOffset=r.lineDashOffset||0,g.stroke=S),x&&(g.fill=x);var b=t.contentWidth,E=t.contentHeight;p.setBoundingRect(new ai(eO(g.x,b,g.textAlign),GC(g.y,E,g.textBaseline),b,E))},e.prototype._renderBackground=function(t,r,i,a,o,s){var l=t.backgroundColor,u=t.borderWidth,h=t.borderColor,c=l&&l.image,f=l&&!c,d=t.borderRadius,v=this,p,g;if(f||t.lineHeight||u&&h){p=this._getOrCreateChild(ta),p.useStyle(p.createStyle()),p.style.fill=null;var m=p.shape;m.x=i,m.y=a,m.width=o,m.height=s,m.r=d,p.dirtyShape()}if(f){var y=p.style;y.fill=l||null,y.fillOpacity=ni(t.fillOpacity,1)}else if(c){g=this._getOrCreateChild(xc),g.onload=function(){v.dirtyStyle()};var _=g.style;_.image=l.image,_.x=i,_.y=a,_.width=o,_.height=s}if(u&&h){var y=p.style;y.lineWidth=u,y.stroke=h,y.strokeOpacity=ni(t.strokeOpacity,1),y.lineDash=t.borderDash,y.lineDashOffset=t.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(p||g).style;x.shadowBlur=t.shadowBlur||0,x.shadowColor=t.shadowColor||"transparent",x.shadowOffsetX=t.shadowOffsetX||0,x.shadowOffsetY=t.shadowOffsetY||0,x.opacity=qy(t.opacity,r.opacity,1)},e.makeFont=function(t){var r="";return J3e(t)&&(r=[t.fontStyle,t.fontWeight,K3e(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),r&&Qg(r)||t.textFont||t.font},e}(Vp),Qht={left:!0,right:1,center:1},ect={top:1,bottom:1,middle:1},Vve=["fontStyle","fontWeight","fontSize","fontFamily"];function K3e(n){return typeof n=="string"&&(n.indexOf("px")!==-1||n.indexOf("rem")!==-1||n.indexOf("em")!==-1)?n:isNaN(+n)?Qne+"px":n+"px"}function $ve(n,e){for(var t=0;t<Vve.length;t++){var r=Vve[t],i=e[r];i!=null&&(n[r]=i)}}function J3e(n){return n.fontSize!=null||n.fontFamily||n.fontWeight}function tct(n){return Wve(n),te(n.rich,Wve),n}function Wve(n){if(n){n.font=Z3e.makeFont(n);var e=n.align;e==="middle"&&(e="center"),n.align=e==null||Qht[e]?e:"left";var t=n.verticalAlign;t==="center"&&(t="middle"),n.verticalAlign=t==null||ect[t]?t:"top";var r=n.padding;r&&(n.padding=aie(n.padding))}}function Hve(n,e){return n==null||e<=0||n==="transparent"||n==="none"?null:n.image||n.colorStops?"#000":n}function jve(n){return n==null||n==="none"?null:n.image||n.colorStops?"#000":n}function Xve(n,e,t){return e==="right"?n-t[1]:e==="center"?n+t[3]/2-t[1]/2:n+t[3]}function Yve(n){var e=n.text;return e!=null&&(e+=""),e}function EH(n){return!!(n.backgroundColor||n.lineHeight||n.borderWidth&&n.borderColor)}const la=Z3e;var Bn=na(),iJ=function(n,e,t,r){if(r){var i=Bn(r);i.dataIndex=t,i.dataType=e,i.seriesIndex=n,r.type==="group"&&r.traverse(function(a){var o=Bn(a);o.seriesIndex=n,o.dataIndex=t,o.dataType=e})}},qve=1,Zve={},Q3e=na(),mie=na(),_ie=0,g3=1,qz=2,Gf=["emphasis","blur","select"],oD=["normal","emphasis","blur","select"],OI=10,rct=9,TE="highlight",CB="downplay",YO="select",AB="unselect",qO="toggleSelect";function WT(n){return n!=null&&n!=="none"}var Kve=new d3(100);function Jve(n){if(Or(n)){var e=Kve.get(n);return e||(e=WK(n,-.1),Kve.put(n,e)),e}else if(zz(n)){var t=Mt({},n);return t.colorStops=Vt(n.colorStops,function(r){return{offset:r.offset,color:WK(r.color,-.1)}}),t}return n}function Zz(n,e,t){n.onHoverStateChange&&(n.hoverState||0)!==t&&n.onHoverStateChange(e),n.hoverState=t}function eke(n){Zz(n,"emphasis",qz)}function tke(n){n.hoverState===qz&&Zz(n,"normal",_ie)}function xie(n){Zz(n,"blur",g3)}function rke(n){n.hoverState===g3&&Zz(n,"normal",_ie)}function nct(n){n.selected=!0}function ict(n){n.selected=!1}function Qve(n,e,t){e(n,t)}function N_(n,e,t){Qve(n,e,t),n.isGroup&&n.traverse(function(r){Qve(r,e,t)})}function sG(n,e){switch(e){case"emphasis":n.hoverState=qz;break;case"normal":n.hoverState=_ie;break;case"blur":n.hoverState=g3;break;case"select":n.selected=!0}}function act(n,e,t,r){for(var i=n.style,a={},o=0;o<e.length;o++){var s=e[o],l=i[s];a[s]=l==null?r&&r[s]:l}for(var o=0;o<n.animators.length;o++){var u=n.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(t)<0&&u.targetName==="style"&&u.saveTo(a,e)}return a}function oct(n,e,t,r){var i=t&&gi(t,"select")>=0,a=!1;if(n instanceof Si){var o=Q3e(n),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(WT(s)||WT(l)){r=r||{};var u=r.style||{};u.fill==="inherit"?(a=!0,r=Mt({},r),u=Mt({},u),u.fill=s):!WT(u.fill)&&WT(s)?(a=!0,r=Mt({},r),u=Mt({},u),u.fill=Jve(s)):!WT(u.stroke)&&WT(l)&&(a||(r=Mt({},r),u=Mt({},u)),u.stroke=Jve(l)),r.style=u}}if(r&&r.z2==null){a||(r=Mt({},r));var h=n.z2EmphasisLift;r.z2=n.z2+(h!=null?h:OI)}return r}function sct(n,e,t){if(t&&t.z2==null){t=Mt({},t);var r=n.z2SelectLift;t.z2=n.z2+(r!=null?r:rct)}return t}function lct(n,e,t){var r=gi(n.currentStates,e)>=0,i=n.style.opacity,a=r?null:act(n,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=Mt({},t),o=Mt({opacity:r?i:a.opacity*.1},o),t.style=o),t}function TH(n,e){var t=this.states[n];if(this.style){if(n==="emphasis")return oct(this,n,e,t);if(n==="blur")return lct(this,n,t);if(n==="select")return sct(this,n,t)}return t}function ZE(n){n.stateProxy=TH;var e=n.getTextContent(),t=n.getTextGuideLine();e&&(e.stateProxy=TH),t&&(t.stateProxy=TH)}function epe(n,e){!oke(n,e)&&!n.__highByOuter&&N_(n,eke)}function tpe(n,e){!oke(n,e)&&!n.__highByOuter&&N_(n,tke)}function h_(n,e){n.__highByOuter|=1<<(e||0),N_(n,eke)}function c_(n,e){!(n.__highByOuter&=~(1<<(e||0)))&&N_(n,tke)}function nke(n){N_(n,xie)}function Sie(n){N_(n,rke)}function ike(n){N_(n,nct)}function ake(n){N_(n,ict)}function oke(n,e){return n.__highDownSilentOnTouch&&e.zrByTouch}function ske(n){var e=n.getModel(),t=[],r=[];e.eachComponent(function(i,a){var o=mie(a),s=i==="series",l=s?n.getViewOfSeriesModel(a):n.getViewOfComponentModel(a);!s&&r.push(l),o.isBlured&&(l.group.traverse(function(u){rke(u)}),s&&t.push(a)),o.isBlured=!1}),te(r,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function aJ(n,e,t,r){var i=r.getModel();t=t||"coordinateSystem";function a(u,h){for(var c=0;c<h.length;c++){var f=u.getItemGraphicEl(h[c]);f&&Sie(f)}}if(n!=null&&!(!e||e==="none")){var o=i.getSeriesByIndex(n),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];i.eachSeries(function(u){var h=o===u,c=u.coordinateSystem;c&&c.master&&(c=c.master);var f=c&&s?c===s:h;if(!(t==="series"&&!h||t==="coordinateSystem"&&!f||e==="series"&&h)){var d=r.getViewOfSeriesModel(u);if(d.group.traverse(function(g){g.__highByOuter&&h&&e==="self"||xie(g)}),Yc(e))a(u.getData(),e);else if(dn(e))for(var v=Li(e),p=0;p<v.length;p++)a(u.getData(v[p]),e[v[p]]);l.push(u),mie(u).isBlured=!0}}),i.eachComponent(function(u,h){if(u!=="series"){var c=r.getViewOfComponentModel(h);c&&c.toggleBlurSeries&&c.toggleBlurSeries(l,!0,i)}})}}function oJ(n,e,t){if(!(n==null||e==null)){var r=t.getModel().getComponent(n,e);if(!!r){mie(r).isBlured=!0;var i=t.getViewOfComponentModel(r);!i||!i.focusBlurEnabled||i.group.traverse(function(a){xie(a)})}}}function uct(n,e,t){var r=n.seriesIndex,i=n.getData(e.dataType);if(!!i){var a=YE(i,e);a=(Gt(a)?a[0]:a)||0;var o=i.getItemGraphicEl(a);if(!o)for(var s=i.count(),l=0;!o&&l<s;)o=i.getItemGraphicEl(l++);if(o){var u=Bn(o);aJ(r,u.focus,u.blurScope,t)}else{var h=n.get(["emphasis","focus"]),c=n.get(["emphasis","blurScope"]);h!=null&&aJ(r,h,c,t)}}}function wie(n,e,t,r){var i={focusSelf:!1,dispatchers:null};if(n==null||n==="series"||e==null||t==null)return i;var a=r.getModel().getComponent(n,e);if(!a)return i;var o=r.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return i;for(var s=o.findHighDownDispatchers(t),l,u=0;u<s.length;u++)if(Bn(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function hct(n,e,t){var r=Bn(n),i=wie(r.componentMainType,r.componentIndex,r.componentHighDownName,t),a=i.dispatchers,o=i.focusSelf;a?(o&&oJ(r.componentMainType,r.componentIndex,t),te(a,function(s){return epe(s,e)})):(aJ(r.seriesIndex,r.focus,r.blurScope,t),r.focus==="self"&&oJ(r.componentMainType,r.componentIndex,t),epe(n,e))}function cct(n,e,t){ske(t);var r=Bn(n),i=wie(r.componentMainType,r.componentIndex,r.componentHighDownName,t).dispatchers;i?te(i,function(a){return tpe(a,e)}):tpe(n,e)}function fct(n,e,t){if(!!lJ(e)){var r=e.dataType,i=n.getData(r),a=YE(i,e);Gt(a)||(a=[a]),n[e.type===qO?"toggleSelect":e.type===YO?"select":"unselect"](a,r)}}function rpe(n){var e=n.getAllData();te(e,function(t){var r=t.data,i=t.type;r.eachItemGraphicEl(function(a,o){n.isSelected(o,i)?ike(a):ake(a)})})}function dct(n){var e=[];return n.eachSeries(function(t){var r=t.getAllData();te(r,function(i){i.data;var a=i.type,o=t.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:t.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function CE(n,e,t){nE(n,!0),N_(n,ZE),sJ(n,e,t)}function vct(n){nE(n,!1)}function vl(n,e,t,r){r?vct(n):CE(n,e,t)}function sJ(n,e,t){var r=Bn(n);e!=null?(r.focus=e,r.blurScope=t):r.focus&&(r.focus=null)}var npe=["emphasis","blur","select"],pct={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function dc(n,e,t,r){t=t||"itemStyle";for(var i=0;i<npe.length;i++){var a=npe[i],o=e.getModel([a,t]),s=n.ensureState(a);s.style=r?r(o):o[pct[t]]()}}function nE(n,e){var t=e===!1,r=n;n.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=n.highDownSilentOnTouch),(!t||r.__highDownDispatcher)&&(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!t)}function sD(n){return!!(n&&n.__highDownDispatcher)}function gct(n,e,t){var r=Bn(n);r.componentMainType=e.mainType,r.componentIndex=e.componentIndex,r.componentHighDownName=t}function yct(n){var e=Zve[n];return e==null&&qve<=32&&(e=Zve[n]=qve++),e}function lJ(n){var e=n.type;return e===YO||e===AB||e===qO}function ipe(n){var e=n.type;return e===TE||e===CB}function mct(n){var e=Q3e(n);e.normalFill=n.style.fill,e.normalStroke=n.style.stroke;var t=n.states.select||{};e.selectFill=t.style&&t.style.fill||null,e.selectStroke=t.style&&t.style.stroke||null}var HT=hm.CMD,_ct=[[],[],[]],ape=Math.sqrt,xct=Math.atan2;function lke(n,e){if(!!e){var t=n.data,r=n.len(),i,a,o,s,l,u,h=HT.M,c=HT.C,f=HT.L,d=HT.R,v=HT.A,p=HT.Q;for(o=0,s=0;o<r;){switch(i=t[o++],s=o,a=0,i){case h:a=1;break;case f:a=1;break;case c:a=3;break;case p:a=2;break;case v:var g=e[4],m=e[5],y=ape(e[0]*e[0]+e[1]*e[1]),_=ape(e[2]*e[2]+e[3]*e[3]),x=xct(-e[1]/_,e[0]/y);t[o]*=y,t[o++]+=g,t[o]*=_,t[o++]+=m,t[o++]*=y,t[o++]*=_,t[o++]+=x,t[o++]+=x,o+=2,s=o;break;case d:u[0]=t[o++],u[1]=t[o++],cc(u,u,e),t[s++]=u[0],t[s++]=u[1],u[0]+=t[o++],u[1]+=t[o++],cc(u,u,e),t[s++]=u[0],t[s++]=u[1]}for(l=0;l<a;l++){var S=_ct[l];S[0]=t[o++],S[1]=t[o++],cc(S,S,e),t[s++]=S[0],t[s++]=S[1]}}n.increaseVersion()}}var CH=Math.sqrt,t4=Math.sin,r4=Math.cos,qL=Math.PI;function ope(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function uJ(n,e){return(n[0]*e[0]+n[1]*e[1])/(ope(n)*ope(e))}function spe(n,e){return(n[0]*e[1]<n[1]*e[0]?-1:1)*Math.acos(uJ(n,e))}function lpe(n,e,t,r,i,a,o,s,l,u,h){var c=l*(qL/180),f=r4(c)*(n-t)/2+t4(c)*(e-r)/2,d=-1*t4(c)*(n-t)/2+r4(c)*(e-r)/2,v=f*f/(o*o)+d*d/(s*s);v>1&&(o*=CH(v),s*=CH(v));var p=(i===a?-1:1)*CH((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,g=p*o*d/s,m=p*-s*f/o,y=(n+t)/2+r4(c)*g-t4(c)*m,_=(e+r)/2+t4(c)*g+r4(c)*m,x=spe([1,0],[(f-g)/o,(d-m)/s]),S=[(f-g)/o,(d-m)/s],w=[(-1*f-g)/o,(-1*d-m)/s],b=spe(S,w);if(uJ(S,w)<=-1&&(b=qL),uJ(S,w)>=1&&(b=0),b<0){var E=Math.round(b/qL*1e6)/1e6;b=qL*2+E%2*qL}h.addData(u,y,_,o,s,x,b,c,a)}var Sct=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,wct=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function bct(n){var e=new hm;if(!n)return e;var t=0,r=0,i=t,a=r,o,s=hm.CMD,l=n.match(Sct);if(!l)return e;for(var u=0;u<l.length;u++){for(var h=l[u],c=h.charAt(0),f=void 0,d=h.match(wct)||[],v=d.length,p=0;p<v;p++)d[p]=parseFloat(d[p]);for(var g=0;g<v;){var m=void 0,y=void 0,_=void 0,x=void 0,S=void 0,w=void 0,b=void 0,E=t,T=r,C=void 0,A=void 0;switch(c){case"l":t+=d[g++],r+=d[g++],f=s.L,e.addData(f,t,r);break;case"L":t=d[g++],r=d[g++],f=s.L,e.addData(f,t,r);break;case"m":t+=d[g++],r+=d[g++],f=s.M,e.addData(f,t,r),i=t,a=r,c="l";break;case"M":t=d[g++],r=d[g++],f=s.M,e.addData(f,t,r),i=t,a=r,c="L";break;case"h":t+=d[g++],f=s.L,e.addData(f,t,r);break;case"H":t=d[g++],f=s.L,e.addData(f,t,r);break;case"v":r+=d[g++],f=s.L,e.addData(f,t,r);break;case"V":r=d[g++],f=s.L,e.addData(f,t,r);break;case"C":f=s.C,e.addData(f,d[g++],d[g++],d[g++],d[g++],d[g++],d[g++]),t=d[g-2],r=d[g-1];break;case"c":f=s.C,e.addData(f,d[g++]+t,d[g++]+r,d[g++]+t,d[g++]+r,d[g++]+t,d[g++]+r),t+=d[g-2],r+=d[g-1];break;case"S":m=t,y=r,C=e.len(),A=e.data,o===s.C&&(m+=t-A[C-4],y+=r-A[C-3]),f=s.C,E=d[g++],T=d[g++],t=d[g++],r=d[g++],e.addData(f,m,y,E,T,t,r);break;case"s":m=t,y=r,C=e.len(),A=e.data,o===s.C&&(m+=t-A[C-4],y+=r-A[C-3]),f=s.C,E=t+d[g++],T=r+d[g++],t+=d[g++],r+=d[g++],e.addData(f,m,y,E,T,t,r);break;case"Q":E=d[g++],T=d[g++],t=d[g++],r=d[g++],f=s.Q,e.addData(f,E,T,t,r);break;case"q":E=d[g++]+t,T=d[g++]+r,t+=d[g++],r+=d[g++],f=s.Q,e.addData(f,E,T,t,r);break;case"T":m=t,y=r,C=e.len(),A=e.data,o===s.Q&&(m+=t-A[C-4],y+=r-A[C-3]),t=d[g++],r=d[g++],f=s.Q,e.addData(f,m,y,t,r);break;case"t":m=t,y=r,C=e.len(),A=e.data,o===s.Q&&(m+=t-A[C-4],y+=r-A[C-3]),t+=d[g++],r+=d[g++],f=s.Q,e.addData(f,m,y,t,r);break;case"A":_=d[g++],x=d[g++],S=d[g++],w=d[g++],b=d[g++],E=t,T=r,t=d[g++],r=d[g++],f=s.A,lpe(E,T,t,r,w,b,_,x,S,f,e);break;case"a":_=d[g++],x=d[g++],S=d[g++],w=d[g++],b=d[g++],E=t,T=r,t+=d[g++],r+=d[g++],f=s.A,lpe(E,T,t,r,w,b,_,x,S,f,e);break}}(c==="z"||c==="Z")&&(f=s.Z,e.addData(f),t=i,r=a),o=f}return e.toStatic(),e}var uke=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.applyTransform=function(t){},e}(Si);function hke(n){return n.setData!=null}function cke(n,e){var t=bct(n),r=Mt({},e);return r.buildPath=function(i){if(hke(i)){i.setData(t.data);var a=i.getContext();a&&i.rebuildPath(a,1)}else{var a=i;t.rebuildPath(a,1)}},r.applyTransform=function(i){lke(t,i),this.dirtyShape()},r}function fke(n,e){return new uke(cke(n,e))}function Ect(n,e){var t=cke(n,e),r=function(i){$e(a,i);function a(o){var s=i.call(this,o)||this;return s.applyTransform=t.applyTransform,s.buildPath=t.buildPath,s}return a}(uke);return r}function Tct(n,e){for(var t=[],r=n.length,i=0;i<r;i++){var a=n[i];t.push(a.getUpdatedPathProxy(!0))}var o=new Si(e);return o.createPathProxy(),o.buildPath=function(s){if(hke(s)){s.appendPath(t);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}function bie(n,e){e=e||{};var t=new Si;return n.shape&&t.setShape(n.shape),t.setStyle(n.style),e.bakeTransform?lke(t.path,n.getComputedTransform()):e.toLocal?t.setLocalTransform(n.getComputedTransform()):t.copyTransform(n),t.buildPath=n.buildPath,t.applyTransform=t.applyTransform,t.z=n.z,t.z2=n.z2,t.zlevel=n.zlevel,t}var Cct=function(){function n(){this.cx=0,this.cy=0,this.r=0}return n}(),dke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Cct},e.prototype.buildPath=function(t,r){t.moveTo(r.cx+r.r,r.cy),t.arc(r.cx,r.cy,r.r,0,Math.PI*2)},e}(Si);dke.prototype.type="circle";const cm=dke;var Act=function(){function n(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return n}(),vke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Act},e.prototype.buildPath=function(t,r){var i=.5522848,a=r.cx,o=r.cy,s=r.rx,l=r.ry,u=s*i,h=l*i;t.moveTo(a-s,o),t.bezierCurveTo(a-s,o-h,a-u,o-l,a,o-l),t.bezierCurveTo(a+u,o-l,a+s,o-h,a+s,o),t.bezierCurveTo(a+s,o+h,a+u,o+l,a,o+l),t.bezierCurveTo(a-u,o+l,a-s,o+h,a-s,o),t.closePath()},e}(Si);vke.prototype.type="ellipse";const Eie=vke;var pke=Math.PI,AH=pke*2,nb=Math.sin,jT=Math.cos,Mct=Math.acos,Tc=Math.atan2,upe=Math.abs,ZO=Math.sqrt,tO=Math.max,ty=Math.min,Pg=1e-4;function Ict(n,e,t,r,i,a,o,s){var l=t-n,u=r-e,h=o-i,c=s-a,f=c*l-h*u;if(!(f*f<Pg))return f=(h*(e-a)-c*(n-i))/f,[n+f*l,e+f*u]}function n4(n,e,t,r,i,a,o){var s=n-t,l=e-r,u=(o?a:-a)/ZO(s*s+l*l),h=u*l,c=-u*s,f=n+h,d=e+c,v=t+h,p=r+c,g=(f+v)/2,m=(d+p)/2,y=v-f,_=p-d,x=y*y+_*_,S=i-a,w=f*p-v*d,b=(_<0?-1:1)*ZO(tO(0,S*S*x-w*w)),E=(w*_-y*b)/x,T=(-w*y-_*b)/x,C=(w*_+y*b)/x,A=(-w*y+_*b)/x,M=E-g,I=T-m,R=C-g,k=A-m;return M*M+I*I>R*R+k*k&&(E=C,T=A),{cx:E,cy:T,x0:-h,y0:-c,x1:E*(i/S-1),y1:T*(i/S-1)}}function Lct(n){var e;if(Gt(n)){var t=n.length;if(!t)return n;t===1?e=[n[0],n[0],0,0]:t===2?e=[n[0],n[0],n[1],n[1]]:t===3?e=n.concat(n[2]):e=n}else e=[n,n,n,n];return e}function Pct(n,e){var t,r=tO(e.r,0),i=tO(e.r0||0,0),a=r>0,o=i>0;if(!(!a&&!o)){if(a||(r=i,i=0),i>r){var s=r;r=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var h=e.cx,c=e.cy,f=!!e.clockwise,d=upe(u-l),v=d>AH&&d%AH;if(v>Pg&&(d=v),!(r>Pg))n.moveTo(h,c);else if(d>AH-Pg)n.moveTo(h+r*jT(l),c+r*nb(l)),n.arc(h,c,r,l,u,!f),i>Pg&&(n.moveTo(h+i*jT(u),c+i*nb(u)),n.arc(h,c,i,u,l,f));else{var p=void 0,g=void 0,m=void 0,y=void 0,_=void 0,x=void 0,S=void 0,w=void 0,b=void 0,E=void 0,T=void 0,C=void 0,A=void 0,M=void 0,I=void 0,R=void 0,k=r*jT(l),D=r*nb(l),G=i*jT(u),W=i*nb(u),z=d>Pg;if(z){var V=e.cornerRadius;V&&(t=Lct(V),p=t[0],g=t[1],m=t[2],y=t[3]);var q=upe(r-i)/2;if(_=ty(q,m),x=ty(q,y),S=ty(q,p),w=ty(q,g),T=b=tO(_,x),C=E=tO(S,w),(b>Pg||E>Pg)&&(A=r*jT(u),M=r*nb(u),I=i*jT(l),R=i*nb(l),d<pke)){var Y=Ict(k,D,I,R,A,M,G,W);if(Y){var le=k-Y[0],j=D-Y[1],Q=A-Y[0],ie=M-Y[1],oe=1/nb(Mct((le*Q+j*ie)/(ZO(le*le+j*j)*ZO(Q*Q+ie*ie)))/2),se=ZO(Y[0]*Y[0]+Y[1]*Y[1]);T=ty(b,(r-se)/(oe+1)),C=ty(E,(i-se)/(oe-1))}}}if(!z)n.moveTo(h+k,c+D);else if(T>Pg){var me=ty(m,T),Ce=ty(y,T),Le=n4(I,R,k,D,r,me,f),re=n4(A,M,G,W,r,Ce,f);n.moveTo(h+Le.cx+Le.x0,c+Le.cy+Le.y0),T<b&&me===Ce?n.arc(h+Le.cx,c+Le.cy,T,Tc(Le.y0,Le.x0),Tc(re.y0,re.x0),!f):(me>0&&n.arc(h+Le.cx,c+Le.cy,me,Tc(Le.y0,Le.x0),Tc(Le.y1,Le.x1),!f),n.arc(h,c,r,Tc(Le.cy+Le.y1,Le.cx+Le.x1),Tc(re.cy+re.y1,re.cx+re.x1),!f),Ce>0&&n.arc(h+re.cx,c+re.cy,Ce,Tc(re.y1,re.x1),Tc(re.y0,re.x0),!f))}else n.moveTo(h+k,c+D),n.arc(h,c,r,l,u,!f);if(!(i>Pg)||!z)n.lineTo(h+G,c+W);else if(C>Pg){var me=ty(p,C),Ce=ty(g,C),Le=n4(G,W,A,M,i,-Ce,f),re=n4(k,D,I,R,i,-me,f);n.lineTo(h+Le.cx+Le.x0,c+Le.cy+Le.y0),C<E&&me===Ce?n.arc(h+Le.cx,c+Le.cy,C,Tc(Le.y0,Le.x0),Tc(re.y0,re.x0),!f):(Ce>0&&n.arc(h+Le.cx,c+Le.cy,Ce,Tc(Le.y0,Le.x0),Tc(Le.y1,Le.x1),!f),n.arc(h,c,i,Tc(Le.cy+Le.y1,Le.cx+Le.x1),Tc(re.cy+re.y1,re.cx+re.x1),f),me>0&&n.arc(h+re.cx,c+re.cy,me,Tc(re.y1,re.x1),Tc(re.y0,re.x0),!f))}else n.lineTo(h+G,c+W),n.arc(h,c,i,u,l,f)}n.closePath()}}}var Oct=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return n}(),gke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Oct},e.prototype.buildPath=function(t,r){Pct(t,r)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Si);gke.prototype.type="sector";const wd=gke;var Rct=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return n}(),yke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Rct},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,o=Math.PI*2;t.moveTo(i+r.r,a),t.arc(i,a,r.r,0,o,!1),t.moveTo(i+r.r0,a),t.arc(i,a,r.r0,0,o,!0)},e}(Si);yke.prototype.type="ring";const Kz=yke;function Dct(n,e,t,r){var i=[],a=[],o=[],s=[],l,u,h,c;if(r){h=[1/0,1/0],c=[-1/0,-1/0];for(var f=0,d=n.length;f<d;f++)Kx(h,h,n[f]),Jx(c,c,n[f]);Kx(h,h,r[0]),Jx(c,c,r[1])}for(var f=0,d=n.length;f<d;f++){var v=n[f];if(t)l=n[f?f-1:d-1],u=n[(f+1)%d];else if(f===0||f===d-1){i.push(V1(n[f]));continue}else l=n[f-1],u=n[f+1];tE(a,u,l),mB(a,a,e);var p=NK(v,l),g=NK(v,u),m=p+g;m!==0&&(p/=m,g/=m),mB(o,a,-p),mB(s,a,g);var y=tve([],v,o),_=tve([],v,s);r&&(Jx(y,y,h),Kx(y,y,c),Jx(_,_,h),Kx(_,_,c)),i.push(y),i.push(_)}return t&&i.push(i.shift()),i}function mke(n,e,t){var r=e.smooth,i=e.points;if(i&&i.length>=2){if(r){var a=Dct(i,r,t,e.smoothConstraint);n.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],h=i[(s+1)%o];n.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{n.moveTo(i[0][0],i[0][1]);for(var s=1,c=i.length;s<c;s++)n.lineTo(i[s][0],i[s][1])}t&&n.closePath()}}var Nct=function(){function n(){this.points=null,this.smooth=0,this.smoothConstraint=null}return n}(),_ke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Nct},e.prototype.buildPath=function(t,r){mke(t,r,!0)},e}(Si);_ke.prototype.type="polygon";const bd=_ke;var kct=function(){function n(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return n}(),xke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new kct},e.prototype.buildPath=function(t,r){mke(t,r,!1)},e}(Si);xke.prototype.type="polyline";const Gd=xke;var Fct={},Bct=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return n}(),Ske=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Bct},e.prototype.buildPath=function(t,r){var i,a,o,s;if(this.subPixelOptimize){var l=X3e(Fct,r,this.style);i=l.x1,a=l.y1,o=l.x2,s=l.y2}else i=r.x1,a=r.y1,o=r.x2,s=r.y2;var u=r.percent;u!==0&&(t.moveTo(i,a),u<1&&(o=i*(1-u)+o*u,s=a*(1-u)+s*u),t.lineTo(o,s))},e.prototype.pointAt=function(t){var r=this.shape;return[r.x1*(1-t)+r.x2*t,r.y1*(1-t)+r.y2*t]},e}(Si);Ske.prototype.type="line";const zh=Ske;var ed=[],Gct=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return n}();function hpe(n,e,t){var r=n.cpx2,i=n.cpy2;return r!=null||i!=null?[(t?dve:Qu)(n.x1,n.cpx1,n.cpx2,n.x2,e),(t?dve:Qu)(n.y1,n.cpy1,n.cpy2,n.y2,e)]:[(t?UK:Ph)(n.x1,n.cpx1,n.x2,e),(t?UK:Ph)(n.y1,n.cpy1,n.y2,e)]}var wke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Gct},e.prototype.buildPath=function(t,r){var i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=r.cpx1,u=r.cpy1,h=r.cpx2,c=r.cpy2,f=r.percent;f!==0&&(t.moveTo(i,a),h==null||c==null?(f<1&&(tD(i,l,o,f,ed),l=ed[1],o=ed[2],tD(a,u,s,f,ed),u=ed[1],s=ed[2]),t.quadraticCurveTo(l,u,o,s)):(f<1&&(DS(i,l,h,o,f,ed),l=ed[1],h=ed[2],o=ed[3],DS(a,u,c,s,f,ed),u=ed[1],c=ed[2],s=ed[3]),t.bezierCurveTo(l,u,h,c,o,s)))},e.prototype.pointAt=function(t){return hpe(this.shape,t,!1)},e.prototype.tangentAt=function(t){var r=hpe(this.shape,t,!0);return II(r,r)},e}(Si);wke.prototype.type="bezier-curve";const Jz=wke;var zct=function(){function n(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),bke=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new zct},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,o=Math.max(r.r,0),s=r.startAngle,l=r.endAngle,u=r.clockwise,h=Math.cos(s),c=Math.sin(s);t.moveTo(h*o+i,c*o+a),t.arc(i,a,o,s,l,!u)},e}(Si);bke.prototype.type="arc";const Tie=bke;var Uct=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="compound",t}return e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,r=this.shapeChanged(),i=0;i<t.length;i++)r=r||t[i].shapeChanged();r&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],r=this.getGlobalScale(),i=0;i<t.length;i++)t[i].path||t[i].createPathProxy(),t[i].path.setScale(r[0],r[1],t[i].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,r){for(var i=r.paths||[],a=0;a<i.length;a++)i[a].buildPath(t,i[a].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],r=0;r<t.length;r++)t[r].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Si.prototype.getBoundingRect.call(this)},e}(Si);const Cie=Uct;var Vct=function(){function n(e){this.colorStops=e||[]}return n.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},n}();const Eke=Vct;var $ct=function(n){$e(e,n);function e(t,r,i,a,o,s){var l=n.call(this,o)||this;return l.x=t==null?0:t,l.y=r==null?0:r,l.x2=i==null?1:i,l.y2=a==null?0:a,l.type="linear",l.global=s||!1,l}return e}(Eke);const y3=$ct;var Wct=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this,a)||this;return s.x=t==null?.5:t,s.y=r==null?.5:r,s.r=i==null?.5:i,s.type="radial",s.global=o||!1,s}return e}(Eke);const Tke=Wct;var ib=[0,0],ab=[0,0],i4=new qn,a4=new qn,Hct=function(){function n(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var r=0;r<4;r++)this._corners[r]=new qn;for(var r=0;r<2;r++)this._axes[r]=new qn;e&&this.fromBoundingRect(e,t)}return n.prototype.fromBoundingRect=function(e,t){var r=this._corners,i=this._axes,a=e.x,o=e.y,s=a+e.width,l=o+e.height;if(r[0].set(a,o),r[1].set(s,o),r[2].set(s,l),r[3].set(a,l),t)for(var u=0;u<4;u++)r[u].transform(t);qn.sub(i[0],r[1],r[0]),qn.sub(i[1],r[3],r[0]),i[0].normalize(),i[1].normalize();for(var u=0;u<2;u++)this._origin[u]=i[u].dot(r[0])},n.prototype.intersect=function(e,t){var r=!0,i=!t;return i4.set(1/0,1/0),a4.set(0,0),!this._intersectCheckOneSide(this,e,i4,a4,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(e,this,i4,a4,i,-1)&&(r=!1,i)||i||qn.copy(t,r?i4:a4),r},n.prototype._intersectCheckOneSide=function(e,t,r,i,a,o){for(var s=!0,l=0;l<2;l++){var u=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,ib),this._getProjMinMaxOnAxis(l,t._corners,ab),ib[1]<ab[0]||ib[0]>ab[1]){if(s=!1,a)return s;var h=Math.abs(ab[0]-ib[1]),c=Math.abs(ib[0]-ab[1]);Math.min(h,c)>i.len()&&(h<c?qn.scale(i,u,-h*o):qn.scale(i,u,c*o))}else if(r){var h=Math.abs(ab[0]-ib[1]),c=Math.abs(ib[0]-ab[1]);Math.min(h,c)<r.len()&&(h<c?qn.scale(r,u,h*o):qn.scale(r,u,-c*o))}}return s},n.prototype._getProjMinMaxOnAxis=function(e,t,r){for(var i=this._axes[e],a=this._origin,o=t[0].dot(i)+a[e],s=o,l=o,u=1;u<t.length;u++){var h=t[u].dot(i)+a[e];s=Math.min(h,s),l=Math.max(h,l)}r[0]=s,r[1]=l},n}();const lG=Hct;var jct=[],Xct=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return e.prototype.traverse=function(t,r){t.call(r,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(t,r){r?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,r){r=r||!1;for(var i=0;i<t.length;i++)this.addDisplayable(t[i],r)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var r=this._cursor;r<this._displayables.length;r++)t&&t(this._displayables[r]);for(var r=0;r<this._temporaryDisplayables.length;r++)t&&t(this._temporaryDisplayables[r])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){var r=this._displayables[t];r.parent=this,r.update(),r.parent=null}for(var t=0;t<this._temporaryDisplayables.length;t++){var r=this._temporaryDisplayables[t];r.parent=this,r.update(),r.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new ai(1/0,1/0,-1/0,-1/0),r=0;r<this._displayables.length;r++){var i=this._displayables[r],a=i.getBoundingRect().clone();i.needLocalTransform()&&a.applyTransform(i.getLocalTransform(jct)),t.union(a)}this._rect=t}return this._rect},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(a.contain(i[0],i[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(t,r))return!0}return!1},e}(Vp);const Yct=Xct;var Cke=na();function RI(n,e,t,r,i){var a;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();a=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=n==="update";if(s){var u=void 0,h=void 0,c=void 0;r?(u=ni(r.duration,200),h=ni(r.easing,"cubicOut"),c=0):(u=e.getShallow(l?"animationDurationUpdate":"animationDuration"),h=e.getShallow(l?"animationEasingUpdate":"animationEasing"),c=e.getShallow(l?"animationDelayUpdate":"animationDelay")),a&&(a.duration!=null&&(u=a.duration),a.easing!=null&&(h=a.easing),a.delay!=null&&(c=a.delay)),rn(c)&&(c=c(t,i)),rn(u)&&(u=u(t));var f={duration:u||0,delay:c,easing:h};return f}else return null}function Aie(n,e,t,r,i,a,o){var s=!1,l;rn(i)?(o=a,a=i,i=null):dn(i)&&(a=i.cb,o=i.during,s=i.isFrom,l=i.removeOpt,i=i.dataIndex);var u=n==="leave";u||e.stopAnimation("leave");var h=RI(n,r,i,u?l||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(e,i):null);if(h&&h.duration>0){var c=h.duration,f=h.delay,d=h.easing,v={duration:c,delay:f||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:n,during:o};s?e.animateFrom(t,v):e.animateTo(t,v)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function ma(n,e,t,r,i,a){Aie("update",n,e,t,r,i,a)}function Is(n,e,t,r,i,a){Aie("enter",n,e,t,r,i,a)}function FA(n){if(!n.__zr)return!0;for(var e=0;e<n.animators.length;e++){var t=n.animators[e];if(t.scope==="leave")return!0}return!1}function NS(n,e,t,r,i,a){FA(n)||Aie("leave",n,e,t,r,i,a)}function cpe(n,e,t,r){n.removeTextContent(),n.removeTextGuideLine(),NS(n,{style:{opacity:0}},e,t,r)}function lD(n,e,t){function r(){n.parent&&n.parent.remove(n)}n.isGroup?n.traverse(function(i){i.isGroup||cpe(i,e,t,r)}):cpe(n,e,t,r)}function x0(n){Cke(n).oldStyle=n.style}function qct(n){return Cke(n).oldStyle}var uG=Math.max,hG=Math.min,hJ={};function Zct(n){return Si.extend(n)}var Kct=Ect;function Jct(n,e){return Kct(n,e)}function R0(n,e){hJ[n]=e}function Mie(n){if(hJ.hasOwnProperty(n))return hJ[n]}function Qz(n,e,t,r){var i=fke(n,e);return t&&(r==="center"&&(t=Mke(t,i.getBoundingRect())),Ike(i,t)),i}function Ake(n,e,t){var r=new xc({style:{image:n,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(i){if(t==="center"){var a={width:i.width,height:i.height};r.setStyle(Mke(e,a))}}});return r}function Mke(n,e){var t=e.width/e.height,r=n.height*t,i;r<=n.width?i=n.height:(r=n.width,i=r/t);var a=n.x+n.width/2,o=n.y+n.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var Cp=Tct;function Ike(n,e){if(!!n.applyTransform){var t=n.getBoundingRect(),r=t.calculateTransform(e);n.applyTransform(r)}}function fM(n,e){return X3e(n,n,{lineWidth:e}),n}function Qct(n){return Y3e(n.shape,n.shape,n.style),n}var MB=rE;function AE(n,e){for(var t=Vz([]);n&&n!==e;)$1(t,n.getLocalTransform(),t),n=n.parent;return t}function u0(n,e,t){return e&&!Yc(e)&&(e=L1.getLocalTransform(e)),t&&(e=LI([],e)),cc([],n,e)}function eU(n,e,t){var r=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),i=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),a=[n==="left"?-r:n==="right"?r:0,n==="top"?-i:n==="bottom"?i:0];return a=u0(a,e,t),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function fpe(n){return!n.isGroup}function eft(n){return n.shape!=null}function m3(n,e,t){if(!n||!e)return;function r(o){var s={};return o.traverse(function(l){fpe(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return eft(o)&&(s.shape=Mt({},o.shape)),s}var a=r(n);e.traverse(function(o){if(fpe(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ma(o,l,t,Bn(o).dataIndex)}}})}function Lke(n,e){return Vt(n,function(t){var r=t[0];r=uG(r,e.x),r=hG(r,e.x+e.width);var i=t[1];return i=uG(i,e.y),i=hG(i,e.y+e.height),[r,i]})}function tft(n,e){var t=uG(n.x,e.x),r=hG(n.x+n.width,e.x+e.width),i=uG(n.y,e.y),a=hG(n.y+n.height,e.y+e.height);if(r>=t&&a>=i)return{x:t,y:i,width:r-t,height:a-i}}function _3(n,e,t){var r=Mt({rectHover:!0},e),i=r.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},n)return n.indexOf("image://")===0?(i.image=n.slice(8),sn(i,t),new xc(r)):Qz(n.replace("path://",""),r,t,"center")}function rO(n,e,t,r,i){for(var a=0,o=i[i.length-1];a<i.length;a++){var s=i[a];if(Pke(n,e,t,r,s[0],s[1],o[0],o[1]))return!0;o=s}}function Pke(n,e,t,r,i,a,o,s){var l=t-n,u=r-e,h=o-i,c=s-a,f=MH(h,c,l,u);if(rft(f))return!1;var d=n-i,v=e-a,p=MH(d,v,l,u)/f;if(p<0||p>1)return!1;var g=MH(d,v,h,c)/f;return!(g<0||g>1)}function MH(n,e,t,r){return n*r-t*e}function rft(n){return n<=1e-6&&n>=-1e-6}function DI(n){var e=n.itemTooltipOption,t=n.componentModel,r=n.itemName,i=Or(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:r,$vars:["name"]};s[a+"Index"]=o;var l=n.formatterParamsExtra;l&&te(Li(l),function(h){Fr(s,h)||(s[h]=l[h],s.$vars.push(h))});var u=Bn(n.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:r,option:sn({content:r,formatterParams:s},i)}}function dpe(n,e){var t;n.isGroup&&(t=e(n)),t||n.traverse(e)}function _w(n,e){if(n)if(Gt(n))for(var t=0;t<n.length;t++)dpe(n[t],e);else dpe(n,e)}R0("circle",cm);R0("ellipse",Eie);R0("sector",wd);R0("ring",Kz);R0("polygon",bd);R0("polyline",Gd);R0("rect",ta);R0("line",zh);R0("bezierCurve",Jz);R0("arc",Tie);const x3=Object.freeze(Object.defineProperty({__proto__:null,updateProps:ma,initProps:Is,removeElement:NS,removeElementWithFadeOut:lD,isElementRemoved:FA,extendShape:Zct,extendPath:Jct,registerShape:R0,getShapeClass:Mie,makePath:Qz,makeImage:Ake,mergePath:Cp,resizePath:Ike,subPixelOptimizeLine:fM,subPixelOptimizeRect:Qct,subPixelOptimize:MB,getTransform:AE,applyTransform:u0,transformDirection:eU,groupTransition:m3,clipPointsByRect:Lke,clipRectByRect:tft,createIcon:_3,linePolygonIntersect:rO,lineLineIntersect:Pke,setTooltipConfig:DI,traverseElements:_w,Group:Cn,Image:xc,Text:la,Circle:cm,Ellipse:Eie,Sector:wd,Ring:Kz,Polygon:bd,Polyline:Gd,Rect:ta,Line:zh,BezierCurve:Jz,Arc:Tie,IncrementalDisplayable:Yct,CompoundPath:Cie,LinearGradient:y3,RadialGradient:Tke,BoundingRect:ai,OrientedBoundingRect:lG,Point:qn,Path:Si},Symbol.toStringTag,{value:"Module"}));var tU={};function Oke(n,e){for(var t=0;t<Gf.length;t++){var r=Gf[t],i=e[r],a=n.ensureState(r);a.style=a.style||{},a.style.text=i}var o=n.currentStates.slice();n.clearStates(!0),n.setStyle({text:e.normal}),n.useStates(o,!0)}function cJ(n,e,t){var r=n.labelFetcher,i=n.labelDataIndex,a=n.labelDimIndex,o=e.normal,s;r&&(s=r.getFormattedLabel(i,"normal",null,a,o&&o.get("formatter"),t!=null?{interpolatedValue:t}:null)),s==null&&(s=rn(n.defaultText)?n.defaultText(i,n,t):n.defaultText);for(var l={normal:s},u=0;u<Gf.length;u++){var h=Gf[u],c=e[h];l[h]=ni(r?r.getFormattedLabel(i,h,null,a,c&&c.get("formatter")):null,s)}return l}function vc(n,e,t,r){t=t||tU;for(var i=n instanceof la,a=!1,o=0;o<oD.length;o++){var s=e[oD[o]];if(s&&s.getShallow("show")){a=!0;break}}var l=i?n:n.getTextContent();if(a){i||(l||(l=new la,n.setTextContent(l)),n.stateProxy&&(l.stateProxy=n.stateProxy));var u=cJ(t,e),h=e.normal,c=!!h.getShallow("show"),f=is(h,r&&r.normal,t,!1,!i);f.text=u.normal,i||n.setTextConfig(cG(h,t,!1));for(var o=0;o<Gf.length;o++){var d=Gf[o],s=e[d];if(s){var v=l.ensureState(d),p=!!ni(s.getShallow("show"),c);if(p!==c&&(v.ignore=!p),v.style=is(s,r&&r[d],t,!0,!i),v.style.text=u[d],!i){var g=n.ensureState(d);g.textConfig=cG(s,t,!0)}}}l.silent=!!h.getShallow("silent"),l.style.x!=null&&(f.x=l.style.x),l.style.y!=null&&(f.y=l.style.y),l.ignore=!c,l.useStyle(f),l.dirty(),t.enableTextSetter&&(NI(l).setLabelText=function(m){var y=cJ(t,e,m);Oke(l,y)})}else l&&(l.ignore=!0);n.dirty()}function hh(n,e){e=e||"label";for(var t={normal:n.getModel(e)},r=0;r<Gf.length;r++){var i=Gf[r];t[i]=n.getModel([i,e])}return t}function is(n,e,t,r,i){var a={};return nft(a,n,t,r,i),e&&Mt(a,e),a}function cG(n,e,t){e=e||{};var r={},i,a=n.getShallow("rotate"),o=ni(n.getShallow("distance"),t?null:5),s=n.getShallow("offset");return i=n.getShallow("position")||(t?null:"inside"),i==="outside"&&(i=e.defaultOutsidePosition||"top"),i!=null&&(r.position=i),s!=null&&(r.offset=s),a!=null&&(a*=Math.PI/180,r.rotation=a),o!=null&&(r.distance=o),r.outsideFill=n.get("color")==="inherit"?e.inheritColor||null:"auto",r}function nft(n,e,t,r,i){t=t||tU;var a=e.ecModel,o=a&&a.option.textStyle,s=ift(e),l;if(s){l={};for(var u in s)if(s.hasOwnProperty(u)){var h=e.getModel(["rich",u]);ype(l[u]={},h,o,t,r,i,!1,!0)}}l&&(n.rich=l);var c=e.get("overflow");c&&(n.overflow=c);var f=e.get("minMargin");f!=null&&(n.margin=f),ype(n,e,o,t,r,i,!0,!1)}function ift(n){for(var e;n&&n!==n.ecModel;){var t=(n.option||tU).rich;if(t){e=e||{};for(var r=Li(t),i=0;i<r.length;i++){var a=r[i];e[a]=1}}n=n.parentModel}return e}var vpe=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],ppe=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],gpe=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function ype(n,e,t,r,i,a,o,s){t=!i&&t||tU;var l=r&&r.inheritColor,u=e.getShallow("color"),h=e.getShallow("textBorderColor"),c=ni(e.getShallow("opacity"),t.opacity);(u==="inherit"||u==="auto")&&(l?u=l:u=null),(h==="inherit"||h==="auto")&&(l?h=l:h=null),a||(u=u||t.color,h=h||t.textBorderColor),u!=null&&(n.fill=u),h!=null&&(n.stroke=h);var f=ni(e.getShallow("textBorderWidth"),t.textBorderWidth);f!=null&&(n.lineWidth=f);var d=ni(e.getShallow("textBorderType"),t.textBorderType);d!=null&&(n.lineDash=d);var v=ni(e.getShallow("textBorderDashOffset"),t.textBorderDashOffset);v!=null&&(n.lineDashOffset=v),!i&&c==null&&!s&&(c=r&&r.defaultOpacity),c!=null&&(n.opacity=c),!i&&!a&&n.fill==null&&r.inheritColor&&(n.fill=r.inheritColor);for(var p=0;p<vpe.length;p++){var g=vpe[p],m=ni(e.getShallow(g),t[g]);m!=null&&(n[g]=m)}for(var p=0;p<ppe.length;p++){var g=ppe[p],m=e.getShallow(g);m!=null&&(n[g]=m)}if(n.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(n.verticalAlign=y)}if(!o||!r.disableBox){for(var p=0;p<gpe.length;p++){var g=gpe[p],m=e.getShallow(g);m!=null&&(n[g]=m)}var _=e.getShallow("borderType");_!=null&&(n.borderDash=_),(n.backgroundColor==="auto"||n.backgroundColor==="inherit")&&l&&(n.backgroundColor=l),(n.borderColor==="auto"||n.borderColor==="inherit")&&l&&(n.borderColor=l)}}function Rke(n,e){var t=e&&e.getModel("textStyle");return Qg([n.fontStyle||t&&t.getShallow("fontStyle")||"",n.fontWeight||t&&t.getShallow("fontWeight")||"",(n.fontSize||t&&t.getShallow("fontSize")||12)+"px",n.fontFamily||t&&t.getShallow("fontFamily")||"sans-serif"].join(" "))}var NI=na();function Dke(n,e,t,r){if(!!n){var i=NI(n);i.prevValue=i.value,i.value=t;var a=e.normal;i.valueAnimation=a.get("valueAnimation"),i.valueAnimation&&(i.precision=a.get("precision"),i.defaultInterpolatedText=r,i.statesModels=e)}}function Nke(n,e,t,r,i){var a=NI(n);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=ni(a.interpolatedValue,a.prevValue),l=a.value;function u(h){var c=k3e(t,a.precision,s,l,h);a.interpolatedValue=h===1?null:c;var f=cJ({labelDataIndex:e,labelFetcher:i,defaultText:o?o(c):c+""},a.statesModels,c);Oke(n,f)}n.percent=0,(a.prevValue==null?Is:ma)(n,{percent:1},r,e,null,u)}var aft=["textStyle","color"],IH=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],LH=new la,oft=function(){function n(){}return n.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(aft):null)},n.prototype.getFont=function(){return Rke({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},n.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},r=0;r<IH.length;r++)t[IH[r]]=this.getShallow(IH[r]);return LH.useStyle(t),LH.update(),LH.getBoundingRect()},n}();const sft=oft;var kke=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],lft=qE(kke),uft=function(){function n(){}return n.prototype.getLineStyle=function(e){return lft(this,e)},n}(),Fke=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],hft=qE(Fke),cft=function(){function n(){}return n.prototype.getItemStyle=function(e,t){return hft(this,e,t)},n}(),X2=function(){function n(e,t,r){this.parentModel=t,this.ecModel=r,this.option=e}return n.prototype.init=function(e,t,r){},n.prototype.mergeOption=function(e,t){ii(this.option,e,!0)},n.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},n.prototype.getShallow=function(e,t){var r=this.option,i=r==null?r:r[e];if(i==null&&!t){var a=this.parentModel;a&&(i=a.getShallow(e))}return i},n.prototype.getModel=function(e,t){var r=e!=null,i=r?this.parsePath(e):null,a=r?this._doGet(i):this.option;return t=t||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),new n(a,t,this.ecModel)},n.prototype.isEmpty=function(){return this.option==null},n.prototype.restoreData=function(){},n.prototype.clone=function(){var e=this.constructor;return new e(Sn(this.option))},n.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},n.prototype.resolveParentPath=function(e){return e},n.prototype.isAnimationEnabled=function(){if(!sa.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},n.prototype._doGet=function(e,t){var r=this.option;if(!e)return r;for(var i=0;i<e.length&&!(!!e[i]&&(r=r&&typeof r=="object"?r[e[i]]:null,r==null));i++);return r==null&&t&&(r=t._doGet(this.resolveParentPath(e),t.parentModel)),r},n}();gie(X2);hht(X2);gu(X2,uft);gu(X2,cft);gu(X2,pht);gu(X2,sft);const as=X2;var fft=Math.round(Math.random()*10);function kI(n){return[n||"",fft++].join("_")}function dft(n){var e={};n.registerSubTypeDefaulter=function(t,r){var i=ky(t);e[i.main]=r},n.determineSubType=function(t,r){var i=r.type;if(!i){var a=ky(t).main;n.hasSubTypes(t)&&e[a]&&(i=e[a](r))}return i}}function vft(n,e){n.topologicalTravel=function(a,o,s,l){if(!a.length)return;var u=t(o),h=u.graph,c=u.noEntryList,f={};for(te(a,function(y){f[y]=!0});c.length;){var d=c.pop(),v=h[d],p=!!f[d];p&&(s.call(l,d,v.originalDeps.slice()),delete f[d]),te(v.successor,p?m:g)}te(f,function(){var y="";throw new Error(y)});function g(y){h[y].entryCount--,h[y].entryCount===0&&c.push(y)}function m(y){f[y]=!0,g(y)}};function t(a){var o={},s=[];return te(a,function(l){var u=r(o,l),h=u.originalDeps=e(l),c=i(h,a);u.entryCount=c.length,u.entryCount===0&&s.push(l),te(c,function(f){gi(u.predecessor,f)<0&&u.predecessor.push(f);var d=r(o,f);gi(d.successor,f)<0&&d.successor.push(l)})}),{graph:o,noEntryList:s}}function r(a,o){return a[o]||(a[o]={predecessor:[],successor:[]}),a[o]}function i(a,o){var s=[];return te(a,function(l){gi(o,l)>=0&&s.push(l)}),s}}function xw(n,e){return ii(ii({},n,!0),e,!0)}const pft={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},gft={time:{month:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],monthAbbr:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],dayOfWeek:["\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],dayOfWeekAbbr:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};var fG="ZH",Iie="EN",uD=Iie,IB={},Lie={},Bke=sa.domSupported?function(){var n=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return n.indexOf(fG)>-1?fG:uD}():uD;function Gke(n,e){n=n.toUpperCase(),Lie[n]=new as(e),IB[n]=e}function yft(n){if(Or(n)){var e=IB[n.toUpperCase()]||{};return n===fG||n===Iie?Sn(e):ii(Sn(e),Sn(IB[uD]),!1)}else return ii(Sn(n),Sn(IB[uD]),!1)}function fJ(n){return Lie[n]}function mft(){return Lie[uD]}Gke(Iie,pft);Gke(fG,gft);var Pie=1e3,Oie=Pie*60,KO=Oie*60,Ap=KO*24,mpe=Ap*365,nO={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},o4="{yyyy}-{MM}-{dd}",_pe={year:"{yyyy}",month:"{yyyy}-{MM}",day:o4,hour:o4+" "+nO.hour,minute:o4+" "+nO.minute,second:o4+" "+nO.second,millisecond:nO.none},PH=["year","month","day","hour","minute","second","millisecond"],zke=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function ix(n,e){return n+="","0000".substr(0,e-n.length)+n}function BA(n){switch(n){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return n}}function _ft(n){return n===BA(n)}function xft(n){switch(n){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function rU(n,e,t,r){var i=um(n),a=i[Rie(t)](),o=i[GA(t)]()+1,s=Math.floor((o-1)/3)+1,l=i[nU(t)](),u=i["get"+(t?"UTC":"")+"Day"](),h=i[hD(t)](),c=(h-1)%12+1,f=i[iU(t)](),d=i[aU(t)](),v=i[oU(t)](),p=r instanceof as?r:fJ(r||Bke)||mft(),g=p.getModel("time"),m=g.get("month"),y=g.get("monthAbbr"),_=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,ix(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,ix(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,ix(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,ix(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,ix(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,ix(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,ix(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,ix(v,3)).replace(/{S}/g,v+"")}function Sft(n,e,t,r,i){var a=null;if(Or(t))a=t;else if(rn(t))a=t(n.value,e,{level:n.level});else{var o=Mt({},nO);if(n.level>0)for(var s=0;s<PH.length;++s)o[PH[s]]="{primary|"+o[PH[s]]+"}";var l=t?t.inherit===!1?t:sn(t,o):o,u=Uke(n.value,i);if(l[u])a=l[u];else if(l.inherit){for(var h=zke.indexOf(u),s=h-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(Gt(a)){var c=n.level==null?0:n.level>=0?n.level:a.length+n.level;c=Math.min(c,a.length-1),a=a[c]}}return rU(new Date(n.value),a,i,r)}function Uke(n,e){var t=um(n),r=t[GA(e)]()+1,i=t[nU(e)](),a=t[hD(e)](),o=t[iU(e)](),s=t[aU(e)](),l=t[oU(e)](),u=l===0,h=u&&s===0,c=h&&o===0,f=c&&a===0,d=f&&i===1,v=d&&r===1;return v?"year":d?"month":f?"day":c?"hour":h?"minute":u?"second":"millisecond"}function xpe(n,e,t){var r=ha(n)?um(n):n;switch(e=e||Uke(n,t),e){case"year":return r[Rie(t)]();case"half-year":return r[GA(t)]()>=6?1:0;case"quarter":return Math.floor((r[GA(t)]()+1)/4);case"month":return r[GA(t)]();case"day":return r[nU(t)]();case"half-day":return r[hD(t)]()/24;case"hour":return r[hD(t)]();case"minute":return r[iU(t)]();case"second":return r[aU(t)]();case"millisecond":return r[oU(t)]()}}function Rie(n){return n?"getUTCFullYear":"getFullYear"}function GA(n){return n?"getUTCMonth":"getMonth"}function nU(n){return n?"getUTCDate":"getDate"}function hD(n){return n?"getUTCHours":"getHours"}function iU(n){return n?"getUTCMinutes":"getMinutes"}function aU(n){return n?"getUTCSeconds":"getSeconds"}function oU(n){return n?"getUTCMilliseconds":"getMilliseconds"}function wft(n){return n?"setUTCFullYear":"setFullYear"}function Vke(n){return n?"setUTCMonth":"setMonth"}function $ke(n){return n?"setUTCDate":"setDate"}function Wke(n){return n?"setUTCHours":"setHours"}function Hke(n){return n?"setUTCMinutes":"setMinutes"}function jke(n){return n?"setUTCSeconds":"setSeconds"}function Xke(n){return n?"setUTCMilliseconds":"setMilliseconds"}function Yke(n){if(!M3e(n))return Or(n)?n:"-";var e=(n+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function qke(n,e){return n=(n||"").toLowerCase().replace(/-(.)/g,function(t,r){return r.toUpperCase()}),e&&n&&(n=n.charAt(0).toUpperCase()+n.slice(1)),n}var FI=aie;function dJ(n,e,t){var r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(h){return h&&Qg(h)?h:"-"}function a(h){return!!(h!=null&&!isNaN(h)&&isFinite(h))}var o=e==="time",s=n instanceof Date;if(o||s){var l=o?um(n):n;if(isNaN(+l)){if(s)return"-"}else return rU(l,r,t)}if(e==="ordinal")return OK(n)?i(n):ha(n)&&a(n)?n+"":"-";var u=u_(n);return a(u)?Yke(u):OK(n)?i(n):typeof n=="boolean"?n+"":"-"}var Spe=["a","b","c","d","e","f","g"],OH=function(n,e){return"{"+n+(e==null?"":e)+"}"};function Zke(n,e,t){Gt(e)||(e=[e]);var r=e.length;if(!r)return"";for(var i=e[0].$vars||[],a=0;a<i.length;a++){var o=Spe[a];n=n.replace(OH(o),OH(o,0))}for(var s=0;s<r;s++)for(var l=0;l<i.length;l++){var u=e[s][i[l]];n=n.replace(OH(Spe[l],s),t?od(u):u)}return n}function bft(n,e,t){return te(e,function(r,i){n=n.replace("{"+i+"}",t?od(r):r)}),n}function Eft(n,e){var t=Or(n)?{color:n,extraCssText:e}:n||{},r=t.color,i=t.type;e=t.extraCssText;var a=t.renderMode||"html";if(!r)return"";if(a==="html")return i==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+od(r)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+od(r)+";"+(e||"")+'"></span>';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}}function KE(n,e){return e=e||"transparent",Or(n)?n:dn(n)&&n.colorStops&&(n.colorStops[0]||{}).color||e}function dG(n,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=n}else window.open(n,e)}var LB=te,Kke=["left","right","top","bottom","width","height"],iE=[["width","left","right"],["height","top","bottom"]];function Die(n,e,t,r,i){var a=0,o=0;r==null&&(r=1/0),i==null&&(i=1/0);var s=0;e.eachChild(function(l,u){var h=l.getBoundingRect(),c=e.childAt(u+1),f=c&&c.getBoundingRect(),d,v;if(n==="horizontal"){var p=h.width+(f?-f.x+h.x:0);d=a+p,d>r||l.newline?(a=0,d=p,o+=s+t,s=h.height):s=Math.max(s,h.height)}else{var g=h.height+(f?-f.y+h.y:0);v=o+g,v>i||l.newline?(a+=s+t,o=0,v=g,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),n==="horizontal"?a=d+t:o=v+t)})}var ME=Die;Un(Die,"vertical");Un(Die,"horizontal");function Tft(n,e,t){var r=e.width,i=e.height,a=xr(n.left,r),o=xr(n.top,i),s=xr(n.right,r),l=xr(n.bottom,i);return(isNaN(a)||isNaN(parseFloat(n.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(n.right)))&&(s=r),(isNaN(o)||isNaN(parseFloat(n.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(n.bottom)))&&(l=i),t=FI(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function Uu(n,e,t){t=FI(t||0);var r=e.width,i=e.height,a=xr(n.left,r),o=xr(n.top,i),s=xr(n.right,r),l=xr(n.bottom,i),u=xr(n.width,r),h=xr(n.height,i),c=t[2]+t[0],f=t[1]+t[3],d=n.aspect;switch(isNaN(u)&&(u=r-s-f-a),isNaN(h)&&(h=i-l-c-o),d!=null&&(isNaN(u)&&isNaN(h)&&(d>r/i?u=r*.8:h=i*.8),isNaN(u)&&(u=d*h),isNaN(h)&&(h=u/d)),isNaN(a)&&(a=r-s-u-f),isNaN(o)&&(o=i-l-h-c),n.left||n.right){case"center":a=r/2-u/2-t[3];break;case"right":a=r-u-f;break}switch(n.top||n.bottom){case"middle":case"center":o=i/2-h/2-t[0];break;case"bottom":o=i-h-c;break}a=a||0,o=o||0,isNaN(u)&&(u=r-f-a-(s||0)),isNaN(h)&&(h=i-c-o-(l||0));var v=new ai(a+t[3],o+t[0],u,h);return v.margin=t,v}function sU(n,e,t,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||n,a.x=n.x,a.y=n.y,!o&&!s)return!1;var u;if(l==="raw")u=n.type==="group"?new ai(0,0,+e.width||0,+e.height||0):n.getBoundingRect();else if(u=n.getBoundingRect(),n.needLocalTransform()){var h=n.getLocalTransform();u=u.clone(),u.applyTransform(h)}var c=Uu(sn({width:u.width,height:u.height},e),t,r),f=o?c.x-u.x:0,d=s?c.y-u.y:0;return l==="raw"?(a.x=f,a.y=d):(a.x+=f,a.y+=d),a===n&&n.markRedraw(),!0}function Cft(n,e){return n[iE[e][0]]!=null||n[iE[e][1]]!=null&&n[iE[e][2]]!=null}function cD(n){var e=n.layoutMode||n.constructor.layoutMode;return dn(e)?e:e?{type:e}:null}function kS(n,e,t){var r=t&&t.ignoreSize;!Gt(r)&&(r=[r,r]);var i=o(iE[0],0),a=o(iE[1],1);u(iE[0],n,i),u(iE[1],n,a);function o(h,c){var f={},d=0,v={},p=0,g=2;if(LB(h,function(_){v[_]=n[_]}),LB(h,function(_){s(e,_)&&(f[_]=v[_]=e[_]),l(f,_)&&d++,l(v,_)&&p++}),r[c])return l(e,h[1])?v[h[2]]=null:l(e,h[2])&&(v[h[1]]=null),v;if(p===g||!d)return v;if(d>=g)return f;for(var m=0;m<h.length;m++){var y=h[m];if(!s(f,y)&&s(n,y)){f[y]=n[y];break}}return f}function s(h,c){return h.hasOwnProperty(c)}function l(h,c){return h[c]!=null&&h[c]!=="auto"}function u(h,c,f){LB(h,function(d){c[d]=f[d]})}}function BI(n){return Jke({},n)}function Jke(n,e){return e&&n&&LB(Kke,function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n}var Aft=na(),GI=function(n){$e(e,n);function e(t,r,i){var a=n.call(this,t,r,i)||this;return a.uid=kI("ec_cpt_model"),a}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i)},e.prototype.mergeDefaultAndTheme=function(t,r){var i=cD(this),a=i?BI(t):{},o=r.getTheme();ii(t,o.get(this.mainType)),ii(t,this.getDefaultOption()),i&&kS(t,a,i)},e.prototype.mergeOption=function(t,r){ii(this.option,t,!0);var i=cD(this);i&&kS(this.option,t,i)},e.prototype.optionUpdated=function(t,r){},e.prototype.getDefaultOption=function(){var t=this.constructor;if(!sht(t))return t.defaultOption;var r=Aft(this);if(!r.defaultOption){for(var i=[],a=t;a;){var o=a.prototype.defaultOption;o&&i.push(o),a=a.superClass}for(var s={},l=i.length-1;l>=0;l--)s=ii(s,i[l],!0);r.defaultOption=s}return r.defaultOption},e.prototype.getReferringComponents=function(t,r){var i=t+"Index",a=t+"Id";return p3(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},r)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(as);B3e(GI,as);Hz(GI);dft(GI);vft(GI,Mft);function Mft(n){var e=[];return te(GI.getClassesByMainType(n),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=Vt(e,function(t){return ky(t).main}),n!=="dataset"&&gi(e,"dataset")<=0&&e.unshift("dataset"),e}const oa=GI;var Qke="";typeof navigator<"u"&&(Qke=navigator.platform||"");var XT="rgba(0, 0, 0, 0.2)";const Ift={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:XT,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:XT,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:XT,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:XT,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:XT,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:XT,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Qke.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var eFe=$r(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),ig="original",qc="arrayRows",ag="objectRows",Im="keyedColumns",mS="typedArray",tFe="unknown",Zy="column",zI="row",nc={Must:1,Might:2,Not:3},rFe=na();function Lft(n){rFe(n).datasetMap=$r()}function nFe(n,e,t){var r={},i=kie(e);if(!i||!n)return r;var a=[],o=[],s=e.ecModel,l=rFe(s).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,h,c;n=n.slice(),te(n,function(p,g){var m=dn(p)?p:n[g]={name:p};m.type==="ordinal"&&h==null&&(h=g,c=v(m)),r[m.name]=[]});var f=l.get(u)||l.set(u,{categoryWayDim:c,valueWayDim:0});te(n,function(p,g){var m=p.name,y=v(p);if(h==null){var _=f.valueWayDim;d(r[m],_,y),d(o,_,y),f.valueWayDim+=y}else if(h===g)d(r[m],0,y),d(a,0,y);else{var _=f.categoryWayDim;d(r[m],_,y),d(o,_,y),f.categoryWayDim+=y}});function d(p,g,m){for(var y=0;y<m;y++)p.push(g+y)}function v(p){var g=p.dimsDef;return g?g.length:1}return a.length&&(r.itemName=a),o.length&&(r.seriesName=o),r}function Nie(n,e,t){var r={},i=kie(n);if(!i)return r;var a=e.sourceFormat,o=e.dimensionsDefine,s;(a===ag||a===Im)&&te(o,function(h,c){(dn(h)?h.name:h)==="name"&&(s=c)});var l=function(){for(var h={},c={},f=[],d=0,v=Math.min(5,t);d<v;d++){var p=aFe(e.data,a,e.seriesLayoutBy,o,e.startIndex,d);f.push(p);var g=p===nc.Not;if(g&&h.v==null&&d!==s&&(h.v=d),(h.n==null||h.n===h.v||!g&&f[h.n]===nc.Not)&&(h.n=d),m(h)&&f[h.n]!==nc.Not)return h;g||(p===nc.Might&&c.v==null&&d!==s&&(c.v=d),(c.n==null||c.n===c.v)&&(c.n=d))}function m(y){return y.v!=null&&y.n!=null}return m(h)?h:m(c)?c:null}();if(l){r.value=[l.v];var u=s!=null?s:l.n;r.itemName=[u],r.seriesName=[u]}return r}function kie(n){var e=n.get("data",!0);if(!e)return p3(n.ecModel,"dataset",{index:n.get("datasetIndex",!0),id:n.get("datasetId",!0)},uu).models[0]}function Pft(n){return!n.get("transform",!0)&&!n.get("fromTransformResult",!0)?[]:p3(n.ecModel,"dataset",{index:n.get("fromDatasetIndex",!0),id:n.get("fromDatasetId",!0)},uu).models}function iFe(n,e){return aFe(n.data,n.sourceFormat,n.seriesLayoutBy,n.dimensionsDefine,n.startIndex,e)}function aFe(n,e,t,r,i,a){var o,s=5;if(Ev(n))return nc.Not;var l,u;if(r){var h=r[a];dn(h)?(l=h.name,u=h.type):Or(h)&&(l=h)}if(u!=null)return u==="ordinal"?nc.Must:nc.Not;if(e===qc){var c=n;if(t===zI){for(var f=c[a],d=0;d<(f||[]).length&&d<s;d++)if((o=x(f[i+d]))!=null)return o}else for(var d=0;d<c.length&&d<s;d++){var v=c[i+d];if(v&&(o=x(v[a]))!=null)return o}}else if(e===ag){var p=n;if(!l)return nc.Not;for(var d=0;d<p.length&&d<s;d++){var g=p[d];if(g&&(o=x(g[l]))!=null)return o}}else if(e===Im){var m=n;if(!l)return nc.Not;var f=m[l];if(!f||Ev(f))return nc.Not;for(var d=0;d<f.length&&d<s;d++)if((o=x(f[d]))!=null)return o}else if(e===ig)for(var y=n,d=0;d<y.length&&d<s;d++){var g=y[d],_=PI(g);if(!Gt(_))return nc.Not;if((o=x(_[a]))!=null)return o}function x(S){var w=Or(S);if(S!=null&&isFinite(S)&&S!=="")return w?nc.Might:nc.Not;if(w&&S!=="-")return nc.Must}return nc.Not}var vJ=$r();function Oft(n,e){Bf(vJ.get(n)==null&&e),vJ.set(n,e)}function Rft(n,e,t){var r=vJ.get(e);if(!r)return t;var i=r(n);return i?t.concat(i):t}var wpe=na(),Dft=na(),Fie=function(){function n(){}return n.prototype.getColorFromPalette=function(e,t,r){var i=Do(this.get("color",!0)),a=this.get("colorLayer",!0);return oFe(this,wpe,i,a,e,t,r)},n.prototype.clearColorPalette=function(){kft(this,wpe)},n}();function pJ(n,e,t,r){var i=Do(n.get(["aria","decal","decals"]));return oFe(n,Dft,i,null,e,t,r)}function Nft(n,e){for(var t=n.length,r=0;r<t;r++)if(n[r].length>e)return n[r];return n[t-1]}function oFe(n,e,t,r,i,a,o){a=a||n;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=o==null||!r?t:Nft(r,o);if(h=h||t,!(!h||!h.length)){var c=h[l];return i&&(u[i]=c),s.paletteIdx=(l+1)%h.length,c}}function kft(n,e){e(n).paletteIdx=0,e(n).paletteNameMap={}}var s4,ZL,bpe,Epe="\0_ec_inner",Fft=1,sFe=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t,r,i,a,o,s){a=a||{},this.option=null,this._theme=new as(a),this._locale=new as(o),this._optionManager=s},e.prototype.setOption=function(t,r,i){var a=Ape(r);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,r){return this._resetOption(t,Ape(r))},e.prototype._resetOption=function(t,r){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?bpe(this,o):(this.restoreData(),this._mergeOption(o,r)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,r))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&te(l,function(u){i=!0,this._mergeOption(u,r)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,r){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=$r(),u=r&&r.replaceMergeMainTypeMap;Lft(this),te(t,function(c,f){c!=null&&(oa.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?Sn(c):ii(i[f],c,!0))}),u&&u.each(function(c,f){oa.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),oa.topologicalTravel(s,oa.getAllClassMainTypes(),h,this);function h(c){var f=Rft(this,c,Do(t[c])),d=a.get(c),v=d?u&&u.get(c)?"replaceMerge":"normalMerge":"replaceAll",p=R3e(d,f,v);Jut(p,c,oa),i[c]=null,a.set(c,null),o.set(c,0);var g=[],m=[],y=0,_;te(p,function(x,S){var w=x.existing,b=x.newOption;if(!b)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var E=c==="series",T=oa.getClass(c,x.keyInfo.subType,!E);if(!T)return;if(c==="tooltip"){if(_)return;_=!0}if(w&&w.constructor===T)w.name=x.keyInfo.name,w.mergeOption(b,this),w.optionUpdated(b,!1);else{var C=Mt({componentIndex:S},x.keyInfo);w=new T(b,this,this,C),Mt(w,C),x.brandNew&&(w.__requireNewView=!0),w.init(b,this,this),w.optionUpdated(null,!0)}}w?(g.push(w.option),m.push(w),y++):(g.push(void 0),m.push(void 0))},this),i[c]=g,a.set(c,m),o.set(c,y),c==="series"&&s4(this)}this._seriesIndices||s4(this)},e.prototype.getOption=function(){var t=Sn(this.option);return te(t,function(r,i){if(oa.hasClass(i)){for(var a=Do(r),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!iD(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[i]=a}}),delete t[Epe],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,r){var i=this._componentsMap.get(t);if(i){var a=i[r||0];if(a)return a;if(r==null){for(var o=0;o<i.length;o++)if(i[o])return i[o]}}},e.prototype.queryComponents=function(t){var r=t.mainType;if(!r)return[];var i=t.index,a=t.id,o=t.name,s=this._componentsMap.get(r);if(!s||!s.length)return[];var l;return i!=null?(l=[],te(Do(i),function(u){s[u]&&l.push(s[u])})):a!=null?l=Tpe("id",a,s):o!=null?l=Tpe("name",o,s):l=To(s,function(u){return!!u}),Cpe(l,t)},e.prototype.findComponents=function(t){var r=t.query,i=t.mainType,a=s(r),o=a?this.queryComponents(a):To(this._componentsMap.get(i),function(u){return!!u});return l(Cpe(o,t));function s(u){var h=i+"Index",c=i+"Id",f=i+"Name";return u&&(u[h]!=null||u[c]!=null||u[f]!=null)?{mainType:i,index:u[h],id:u[c],name:u[f]}:null}function l(u){return t.filter?To(u,t.filter):u}},e.prototype.eachComponent=function(t,r,i){var a=this._componentsMap;if(rn(t)){var o=r,s=t;a.each(function(c,f){for(var d=0;c&&d<c.length;d++){var v=c[d];v&&s.call(o,f,v,v.componentIndex)}})}else for(var l=Or(t)?a.get(t):dn(t)?this.findComponents(t):null,u=0;l&&u<l.length;u++){var h=l[u];h&&r.call(i,h,h.componentIndex)}},e.prototype.getSeriesByName=function(t){var r=Ru(t,null);return To(this._componentsMap.get("series"),function(i){return!!i&&r!=null&&i.name===r})},e.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},e.prototype.getSeriesByType=function(t){return To(this._componentsMap.get("series"),function(r){return!!r&&r.subType===t})},e.prototype.getSeries=function(){return To(this._componentsMap.get("series"),function(t){return!!t})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(t,r){ZL(this),te(this._seriesIndices,function(i){var a=this._componentsMap.get("series")[i];t.call(r,a,i)},this)},e.prototype.eachRawSeries=function(t,r){te(this._componentsMap.get("series"),function(i){i&&t.call(r,i,i.componentIndex)})},e.prototype.eachSeriesByType=function(t,r,i){ZL(this),te(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];o.subType===t&&r.call(i,o,a)},this)},e.prototype.eachRawSeriesByType=function(t,r,i){return te(this.getSeriesByType(t),r,i)},e.prototype.isSeriesFiltered=function(t){return ZL(this),this._seriesIndicesMap.get(t.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(t,r){ZL(this);var i=[];te(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];t.call(r,o,a)&&i.push(a)},this),this._seriesIndices=i,this._seriesIndicesMap=$r(i)},e.prototype.restoreData=function(t){s4(this);var r=this._componentsMap,i=[];r.each(function(a,o){oa.hasClass(o)&&i.push(o)}),oa.topologicalTravel(i,oa.getAllClassMainTypes(),function(a){te(r.get(a),function(o){o&&(a!=="series"||!Bft(o,t))&&o.restoreData()})})},e.internalField=function(){s4=function(t){var r=t._seriesIndices=[];te(t._componentsMap.get("series"),function(i){i&&r.push(i.componentIndex)}),t._seriesIndicesMap=$r(r)},ZL=function(t){},bpe=function(t,r){t.option={},t.option[Epe]=Fft,t._componentsMap=$r({series:[]}),t._componentsCount=$r();var i=r.aria;dn(i)&&i.enabled==null&&(i.enabled=!0),Gft(r,t._theme.option),ii(r,Ift,!1),t._mergeOption(r,null)}}(),e}(as);function Bft(n,e){if(e){var t=e.seriesIndex,r=e.seriesId,i=e.seriesName;return t!=null&&n.componentIndex!==t||r!=null&&n.id!==r||i!=null&&n.name!==i}}function Gft(n,e){var t=n.color&&!n.colorLayer;te(e,function(r,i){i==="colorLayer"&&t||oa.hasClass(i)||(typeof r=="object"?n[i]=n[i]?ii(n[i],r,!1):Sn(r):n[i]==null&&(n[i]=r))})}function Tpe(n,e,t){if(Gt(e)){var r=$r();return te(e,function(a){if(a!=null){var o=Ru(a,null);o!=null&&r.set(a,!0)}}),To(t,function(a){return a&&r.get(a[n])})}else{var i=Ru(e,null);return To(t,function(a){return a&&i!=null&&a[n]===i})}}function Cpe(n,e){return e.hasOwnProperty("subType")?To(n,function(t){return t&&t.subType===e.subType}):n}function Ape(n){var e=$r();return n&&te(Do(n.replaceMerge),function(t){e.set(t,!0)}),{replaceMergeMainTypeMap:e}}gu(sFe,Fie);const lFe=sFe;var zft=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],Uft=function(){function n(e){te(zft,function(t){this[t]=kr(e[t],e)},this)}return n}();const uFe=Uft;var RH={},Vft=function(){function n(){this._coordinateSystems=[]}return n.prototype.create=function(e,t){var r=[];te(RH,function(i,a){var o=i.create(e,t);r=r.concat(o||[])}),this._coordinateSystems=r},n.prototype.update=function(e,t){te(this._coordinateSystems,function(r){r.update&&r.update(e,t)})},n.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},n.register=function(e,t){RH[e]=t},n.get=function(e){return RH[e]},n}();const S3=Vft;var $ft=/^(min|max)?(.+)$/,Wft=function(){function n(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return n.prototype.setOption=function(e,t,r){e&&(te(Do(e.series),function(o){o&&o.data&&Ev(o.data)&&Z8(o.data)}),te(Do(e.dataset),function(o){o&&o.source&&Ev(o.source)&&Z8(o.source)})),e=Sn(e);var i=this._optionBackup,a=Hft(e,t,!i);this._newBaseOption=a.baseOption,i?(a.timelineOptions.length&&(i.timelineOptions=a.timelineOptions),a.mediaList.length&&(i.mediaList=a.mediaList),a.mediaDefault&&(i.mediaDefault=a.mediaDefault)):this._optionBackup=a},n.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],Sn(e?t.baseOption:this._newBaseOption)},n.prototype.getTimelineOption=function(e){var t,r=this._timelineOptions;if(r.length){var i=e.getComponent("timeline");i&&(t=Sn(r[i.getCurrentIndex()]))}return t},n.prototype.getMediaOption=function(e){var t=this._api.getWidth(),r=this._api.getHeight(),i=this._mediaList,a=this._mediaDefault,o=[],s=[];if(!i.length&&!a)return s;for(var l=0,u=i.length;l<u;l++)jft(i[l].query,t,r)&&o.push(l);return!o.length&&a&&(o=[-1]),o.length&&!Yft(o,this._currentMediaIndices)&&(s=Vt(o,function(h){return Sn(h===-1?a.option:i[h].option)})),this._currentMediaIndices=o,s},n}();function Hft(n,e,t){var r=[],i,a,o=n.baseOption,s=n.timeline,l=n.options,u=n.media,h=!!n.media,c=!!(l||s||o&&o.timeline);o?(a=o,a.timeline||(a.timeline=s)):((c||h)&&(n.options=n.media=null),a=n),h&&Gt(u)&&te(u,function(d){d&&d.option&&(d.query?r.push(d):i||(i=d))}),f(a),te(l,function(d){return f(d)}),te(r,function(d){return f(d.option)});function f(d){te(e,function(v){v(d,t)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:i,mediaList:r}}function jft(n,e,t){var r={width:e,height:t,aspectratio:e/t},i=!0;return te(n,function(a,o){var s=o.match($ft);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();Xft(r[u],a,l)||(i=!1)}}),i}function Xft(n,e,t){return t==="min"?n>=e:t==="max"?n<=e:n===e}function Yft(n,e){return n.join(",")===e.join(",")}const qft=Wft;var Eg=te,fD=dn,Mpe=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function DH(n){var e=n&&n.itemStyle;if(!!e)for(var t=0,r=Mpe.length;t<r;t++){var i=Mpe[t],a=e.normal,o=e.emphasis;a&&a[i]&&(n[i]=n[i]||{},n[i].normal?ii(n[i].normal,a[i]):n[i].normal=a[i],a[i]=null),o&&o[i]&&(n[i]=n[i]||{},n[i].emphasis?ii(n[i].emphasis,o[i]):n[i].emphasis=o[i],o[i]=null)}}function Oc(n,e,t){if(n&&n[e]&&(n[e].normal||n[e].emphasis)){var r=n[e].normal,i=n[e].emphasis;r&&(t?(n[e].normal=n[e].emphasis=null,sn(n[e],r)):n[e]=r),i&&(n.emphasis=n.emphasis||{},n.emphasis[e]=i,i.focus&&(n.emphasis.focus=i.focus),i.blurScope&&(n.emphasis.blurScope=i.blurScope))}}function iO(n){Oc(n,"itemStyle"),Oc(n,"lineStyle"),Oc(n,"areaStyle"),Oc(n,"label"),Oc(n,"labelLine"),Oc(n,"upperLabel"),Oc(n,"edgeLabel")}function iu(n,e){var t=fD(n)&&n[e],r=fD(t)&&t.textStyle;if(r)for(var i=0,a=Ove.length;i<a;i++){var o=Ove[i];r.hasOwnProperty(o)&&(t[o]=r[o])}}function up(n){n&&(iO(n),iu(n,"label"),n.emphasis&&iu(n.emphasis,"label"))}function Zft(n){if(!!fD(n)){DH(n),iO(n),iu(n,"label"),iu(n,"upperLabel"),iu(n,"edgeLabel"),n.emphasis&&(iu(n.emphasis,"label"),iu(n.emphasis,"upperLabel"),iu(n.emphasis,"edgeLabel"));var e=n.markPoint;e&&(DH(e),up(e));var t=n.markLine;t&&(DH(t),up(t));var r=n.markArea;r&&up(r);var i=n.data;if(n.type==="graph"){i=i||n.nodes;var a=n.links||n.edges;if(a&&!Ev(a))for(var o=0;o<a.length;o++)up(a[o]);te(n.categories,function(u){iO(u)})}if(i&&!Ev(i))for(var o=0;o<i.length;o++)up(i[o]);if(e=n.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)up(s[o]);if(t=n.markLine,t&&t.data)for(var l=t.data,o=0;o<l.length;o++)Gt(l[o])?(up(l[o][0]),up(l[o][1])):up(l[o]);n.type==="gauge"?(iu(n,"axisLabel"),iu(n,"title"),iu(n,"detail")):n.type==="treemap"?(Oc(n.breadcrumb,"itemStyle"),te(n.levels,function(u){iO(u)})):n.type==="tree"&&iO(n.leaves)}}function Zm(n){return Gt(n)?n:n?[n]:[]}function Ipe(n){return(Gt(n)?n[0]:n)||{}}function Kft(n,e){Eg(Zm(n.series),function(r){fD(r)&&Zft(r)});var t=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&t.push("valueAxis","categoryAxis","logAxis","timeAxis"),Eg(t,function(r){Eg(Zm(n[r]),function(i){i&&(iu(i,"axisLabel"),iu(i.axisPointer,"label"))})}),Eg(Zm(n.parallel),function(r){var i=r&&r.parallelAxisDefault;iu(i,"axisLabel"),iu(i&&i.axisPointer,"label")}),Eg(Zm(n.calendar),function(r){Oc(r,"itemStyle"),iu(r,"dayLabel"),iu(r,"monthLabel"),iu(r,"yearLabel")}),Eg(Zm(n.radar),function(r){iu(r,"name"),r.name&&r.axisName==null&&(r.axisName=r.name,delete r.name),r.nameGap!=null&&r.axisNameGap==null&&(r.axisNameGap=r.nameGap,delete r.nameGap)}),Eg(Zm(n.geo),function(r){fD(r)&&(up(r),Eg(Zm(r.regions),function(i){up(i)}))}),Eg(Zm(n.timeline),function(r){up(r),Oc(r,"label"),Oc(r,"itemStyle"),Oc(r,"controlStyle",!0);var i=r.data;Gt(i)&&te(i,function(a){dn(a)&&(Oc(a,"label"),Oc(a,"itemStyle"))})}),Eg(Zm(n.toolbox),function(r){Oc(r,"iconStyle"),Eg(r.feature,function(i){Oc(i,"iconStyle")})}),iu(Ipe(n.axisPointer),"label"),iu(Ipe(n.tooltip).axisPointer,"label")}function Jft(n,e){for(var t=e.split(","),r=n,i=0;i<t.length&&(r=r&&r[t[i]],r!=null);i++);return r}function Qft(n,e,t,r){for(var i=e.split(","),a=n,o,s=0;s<i.length-1;s++)o=i[s],a[o]==null&&(a[o]={}),a=a[o];(r||a[i[s]]==null)&&(a[i[s]]=t)}function Lpe(n){n&&te(edt,function(e){e[0]in n&&!(e[1]in n)&&(n[e[1]]=n[e[0]])})}var edt=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],tdt=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],NH=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function KL(n){var e=n&&n.itemStyle;if(e)for(var t=0;t<NH.length;t++){var r=NH[t][1],i=NH[t][0];e[r]!=null&&(e[i]=e[r])}}function Ppe(n){!n||n.alignTo==="edge"&&n.margin!=null&&n.edgeDistance==null&&(n.edgeDistance=n.margin)}function Ope(n){!n||n.downplay&&!n.blur&&(n.blur=n.downplay)}function rdt(n){!n||n.focusNodeAdjacency!=null&&(n.emphasis=n.emphasis||{},n.emphasis.focus==null&&(n.emphasis.focus="adjacency"))}function hFe(n,e){if(n)for(var t=0;t<n.length;t++)e(n[t]),n[t]&&hFe(n[t].children,e)}function cFe(n,e){Kft(n,e),n.series=Do(n.series),te(n.series,function(t){if(!!dn(t)){var r=t.type;if(r==="line")t.clipOverflow!=null&&(t.clip=t.clipOverflow);else if(r==="pie"||r==="gauge"){t.clockWise!=null&&(t.clockwise=t.clockWise),Ppe(t.label);var i=t.data;if(i&&!Ev(i))for(var a=0;a<i.length;a++)Ppe(i[a]);t.hoverOffset!=null&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(t.emphasis.scaleSize=t.hoverOffset))}else if(r==="gauge"){var o=Jft(t,"pointer.color");o!=null&&Qft(t,"itemStyle.color",o)}else if(r==="bar"){KL(t),KL(t.backgroundStyle),KL(t.emphasis);var i=t.data;if(i&&!Ev(i))for(var a=0;a<i.length;a++)typeof i[a]=="object"&&(KL(i[a]),KL(i[a]&&i[a].emphasis))}else if(r==="sunburst"){var s=t.highlightPolicy;s&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=s)),Ope(t),hFe(t.data,Ope)}else r==="graph"||r==="sankey"?rdt(t):r==="map"&&(t.mapType&&!t.map&&(t.map=t.mapType),t.mapLocation&&sn(t,t.mapLocation));t.hoverAnimation!=null&&(t.emphasis=t.emphasis||{},t.emphasis&&t.emphasis.scale==null&&(t.emphasis.scale=t.hoverAnimation)),Lpe(t)}}),n.dataRange&&(n.visualMap=n.dataRange),te(tdt,function(t){var r=n[t];r&&(Gt(r)||(r=[r]),te(r,function(i){Lpe(i)}))})}function ndt(n){var e=$r();n.eachSeries(function(t){var r=t.get("stack");if(r){var i=e.get(r)||e.set(r,[]),a=t.getData(),o={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:t};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;i.length&&a.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}}),e.each(idt)}function idt(n){te(n,function(e,t){var r=[],i=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,h,c){var f=o.get(e.stackedDimension,c);if(isNaN(f))return i;var d,v;s?v=o.getRawIndex(c):d=o.get(e.stackedByDimension,c);for(var p=NaN,g=t-1;g>=0;g--){var m=n[g];if(s||(v=m.data.rawIndexOf(m.stackedByDimension,d)),v>=0){var y=m.data.getByRawIndex(m.stackResultDimension,v);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&f>=0&&y>0||l==="samesign"&&f<=0&&y<0){f=Uut(f,y),p=y;break}}}return r[0]=f,r[1]=p,r})})}var lU=function(){function n(e){this.data=e.data||(e.sourceFormat===Im?{}:[]),this.sourceFormat=e.sourceFormat||tFe,this.seriesLayoutBy=e.seriesLayoutBy||Zy,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var r=0;r<t.length;r++){var i=t[r];i.type==null&&iFe(this,r)===nc.Must&&(i.type="ordinal")}}return n}();function Bie(n){return n instanceof lU}function gJ(n,e,t){t=t||fFe(n);var r=e.seriesLayoutBy,i=odt(n,t,r,e.sourceHeader,e.dimensions),a=new lU({data:n,sourceFormat:t,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:Sn(e)});return a}function Gie(n){return new lU({data:n,sourceFormat:Ev(n)?mS:ig})}function adt(n){return new lU({data:n.data,sourceFormat:n.sourceFormat,seriesLayoutBy:n.seriesLayoutBy,dimensionsDefine:Sn(n.dimensionsDefine),startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount})}function fFe(n){var e=tFe;if(Ev(n))e=mS;else if(Gt(n)){n.length===0&&(e=qc);for(var t=0,r=n.length;t<r;t++){var i=n[t];if(i!=null){if(Gt(i)){e=qc;break}else if(dn(i)){e=ag;break}}}}else if(dn(n)){for(var a in n)if(Fr(n,a)&&Yc(n[a])){e=Im;break}}return e}function odt(n,e,t,r,i){var a,o;if(!n)return{dimensionsDefine:Rpe(i),startIndex:o,dimensionsDetectedCount:a};if(e===qc){var s=n;r==="auto"||r==null?Dpe(function(u){u!=null&&u!=="-"&&(Or(u)?o==null&&(o=1):o=0)},t,s,10):o=ha(r)?r:r?1:0,!i&&o===1&&(i=[],Dpe(function(u,h){i[h]=u!=null?u+"":""},t,s,1/0)),a=i?i.length:t===zI?s.length:s[0]?s[0].length:null}else if(e===ag)i||(i=sdt(n));else if(e===Im)i||(i=[],te(n,function(u,h){i.push(h)}));else if(e===ig){var l=PI(n[0]);a=Gt(l)&&l.length||1}return{startIndex:o,dimensionsDefine:Rpe(i),dimensionsDetectedCount:a}}function sdt(n){for(var e=0,t;e<n.length&&!(t=n[e++]););if(t)return Li(t)}function Rpe(n){if(!!n){var e=$r();return Vt(n,function(t,r){t=dn(t)?t:{name:t};var i={name:t.name,displayName:t.displayName,type:t.type};if(i.name==null)return i;i.name+="",i.displayName==null&&(i.displayName=i.name);var a=e.get(i.name);return a?i.name+="-"+a.count++:e.set(i.name,{count:1}),i})}}function Dpe(n,e,t,r){if(e===zI)for(var i=0;i<t.length&&i<r;i++)n(t[i]?t[i][0]:null,i);else for(var a=t[0]||[],i=0;i<a.length&&i<r;i++)n(a[i],i)}function dFe(n){var e=n.sourceFormat;return e===ag||e===Im}var ob,sb,lb,Npe,kpe,vFe=function(){function n(e,t){var r=Bie(e)?e:Gie(e);this._source=r;var i=this._data=r.data;r.sourceFormat===mS&&(this._offset=0,this._dimSize=t,this._data=i),kpe(this,i,r)}return n.prototype.getSource=function(){return this._source},n.prototype.count=function(){return 0},n.prototype.getItem=function(e,t){},n.prototype.appendData=function(e){},n.prototype.clean=function(){},n.protoInitialize=function(){var e=n.prototype;e.pure=!1,e.persistent=!0}(),n.internalField=function(){var e;kpe=function(o,s,l){var u=l.sourceFormat,h=l.seriesLayoutBy,c=l.startIndex,f=l.dimensionsDefine,d=Npe[zie(u,h)];if(Mt(o,d),u===mS)o.getItem=t,o.count=i,o.fillStorage=r;else{var v=pFe(u,h);o.getItem=kr(v,null,s,c,f);var p=gFe(u,h);o.count=kr(p,null,s,c,f)}};var t=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,u=this._dimSize,h=u*o,c=0;c<u;c++)s[c]=l[h+c];return s},r=function(o,s,l,u){for(var h=this._data,c=this._dimSize,f=0;f<c;f++){for(var d=u[f],v=d[0]==null?1/0:d[0],p=d[1]==null?-1/0:d[1],g=s-o,m=l[f],y=0;y<g;y++){var _=h[y*c+f];m[o+y]=_,_<v&&(v=_),_>p&&(p=_)}d[0]=v,d[1]=p}},i=function(){return this._data?this._data.length/this._dimSize:0};Npe=(e={},e[qc+"_"+Zy]={pure:!0,appendData:a},e[qc+"_"+zI]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[ag]={pure:!0,appendData:a},e[Im]={pure:!0,appendData:function(o){var s=this._data;te(o,function(l,u){for(var h=s[u]||(s[u]=[]),c=0;c<(l||[]).length;c++)h.push(l[c])})}},e[ig]={appendData:a},e[mS]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}}(),n}(),Fpe=function(n,e,t,r){return n[r]},ldt=(ob={},ob[qc+"_"+Zy]=function(n,e,t,r){return n[r+e]},ob[qc+"_"+zI]=function(n,e,t,r,i){r+=e;for(var a=i||[],o=n,s=0;s<o.length;s++){var l=o[s];a[s]=l?l[r]:null}return a},ob[ag]=Fpe,ob[Im]=function(n,e,t,r,i){for(var a=i||[],o=0;o<t.length;o++){var s=t[o].name,l=n[s];a[o]=l?l[r]:null}return a},ob[ig]=Fpe,ob);function pFe(n,e){var t=ldt[zie(n,e)];return t}var Bpe=function(n,e,t){return n.length},udt=(sb={},sb[qc+"_"+Zy]=function(n,e,t){return Math.max(0,n.length-e)},sb[qc+"_"+zI]=function(n,e,t){var r=n[0];return r?Math.max(0,r.length-e):0},sb[ag]=Bpe,sb[Im]=function(n,e,t){var r=t[0].name,i=n[r];return i?i.length:0},sb[ig]=Bpe,sb);function gFe(n,e){var t=udt[zie(n,e)];return t}var kH=function(n,e,t){return n[e]},hdt=(lb={},lb[qc]=kH,lb[ag]=function(n,e,t){return n[t]},lb[Im]=kH,lb[ig]=function(n,e,t){var r=PI(n);return r instanceof Array?r[e]:r},lb[mS]=kH,lb);function yFe(n){var e=hdt[n];return e}function zie(n,e){return n===qc?n+"_"+e:n}function dM(n,e,t){if(!!n){var r=n.getRawDataItem(e);if(r!=null){var i=n.getStore(),a=i.getSource().sourceFormat;if(t!=null){var o=n.getDimensionIndex(t),s=i.getDimensionProperty(o);return yFe(a)(r,o,s)}else{var l=r;return a===ig&&(l=PI(r)),l}}}}var cdt=/\{@(.+?)\}/g,Uie=function(){function n(){}return n.prototype.getDataParams=function(e,t){var r=this.getData(t),i=this.getRawValue(e,t),a=r.getRawIndex(e),o=r.getName(e),s=r.getRawDataItem(e),l=r.getItemVisual(e,"style"),u=l&&l[r.getItemVisual(e,"drawType")||"fill"],h=l&&l.stroke,c=this.mainType,f=c==="series",d=r.userOutput&&r.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:f?this.subType:null,seriesIndex:this.seriesIndex,seriesId:f?this.id:null,seriesName:f?this.name:null,name:o,dataIndex:a,data:s,dataType:t,value:i,color:u,borderColor:h,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},n.prototype.getFormattedLabel=function(e,t,r,i,a,o){t=t||"normal";var s=this.getData(r),l=this.getDataParams(e,r);if(o&&(l.value=o.interpolatedValue),i!=null&&Gt(l.value)&&(l.value=l.value[i]),!a){var u=s.getItemModel(e);a=u.get(t==="normal"?["label","formatter"]:[t,"label","formatter"])}if(rn(a))return l.status=t,l.dimensionIndex=i,a(l);if(Or(a)){var h=Zke(a,l);return h.replace(cdt,function(c,f){var d=f.length,v=f;v.charAt(0)==="["&&v.charAt(d-1)==="]"&&(v=+v.slice(1,d-1));var p=dM(s,e,v);if(o&&Gt(o.interpolatedValue)){var g=s.getDimensionIndex(v);g>=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},n.prototype.getRawValue=function(e,t){return dM(this.getData(t),e)},n.prototype.formatTooltip=function(e,t,r){},n}();function Gpe(n){var e,t;return dn(n)?n.type&&(t=n):e=n,{text:e,frag:t}}function JO(n){return new fdt(n)}var fdt=function(){function n(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return n.prototype.perform=function(e){var t=this._upstream,r=e&&e.skip;if(this._dirty&&t){var i=this.context;i.data=i.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!r&&(a=this._plan(this.context));var o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function h(y){return!(y>=1)&&(y=1),y}var c;(this._dirty||a==="reset")&&(this._dirty=!1,c=this._doReset(r)),this._modBy=l,this._modDataCount=u;var f=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,v=Math.min(f!=null?this._dueIndex+f:1/0,this._dueEnd);if(!r&&(c||d<v)){var p=this._progress;if(Gt(p))for(var g=0;g<p.length;g++)this._doProgress(p[g],d,v,l,u);else this._doProgress(p,d,v,l,u)}this._dueIndex=v;var m=this._settedOutputEnd!=null?this._settedOutputEnd:v;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},n.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},n.prototype._doProgress=function(e,t,r,i,a){zpe.reset(t,r,i,a),this._callingProgress=e,this._callingProgress({start:t,end:r,count:r-t,next:zpe.next},this.context)},n.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,r;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(r=t.forceFirstProgress,t=t.progress),Gt(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var i=this._downstream;return i&&i.dirty(),r},n.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},n.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},n.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},n.prototype.getUpstream=function(){return this._upstream},n.prototype.getDownstream=function(){return this._downstream},n.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},n}(),zpe=function(){var n,e,t,r,i,a={reset:function(l,u,h,c){e=l,n=u,t=h,r=c,i=Math.ceil(r/t),a.next=t>1&&r>0?s:o}};return a;function o(){return e<n?e++:null}function s(){var l=e%i*t+Math.ceil(e/i),u=e>=n?null:l<r?l:e;return e++,u}}();function _S(n,e){var t=e&&e.type;return t==="ordinal"?n:(t==="time"&&!ha(n)&&n!=null&&n!=="-"&&(n=+um(n)),n==null||n===""?NaN:+n)}var ddt=$r({number:function(n){return parseFloat(n)},time:function(n){return+um(n)},trim:function(n){return Or(n)?Qg(n):n}});function mFe(n){return ddt.get(n)}var _Fe={lt:function(n,e){return n<e},lte:function(n,e){return n<=e},gt:function(n,e){return n>e},gte:function(n,e){return n>=e}},vdt=function(){function n(e,t){if(!ha(t)){var r="";ao(r)}this._opFn=_Fe[e],this._rvalFloat=u_(t)}return n.prototype.evaluate=function(e){return ha(e)?this._opFn(e,this._rvalFloat):this._opFn(u_(e),this._rvalFloat)},n}(),xFe=function(){function n(e,t){var r=e==="desc";this._resultLT=r?1:-1,t==null&&(t=r?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return n.prototype.evaluate=function(e,t){var r=ha(e)?e:u_(e),i=ha(t)?t:u_(t),a=isNaN(r),o=isNaN(i);if(a&&(r=this._incomparable),o&&(i=this._incomparable),a&&o){var s=Or(e),l=Or(t);s&&(r=l?e:0),l&&(i=s?t:0)}return r<i?this._resultLT:r>i?-this._resultLT:0},n}(),pdt=function(){function n(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=u_(t)}return n.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var r=typeof e;r!==this._rvalTypeof&&(r==="number"||this._rvalTypeof==="number")&&(t=u_(e)===this._rvalFloat)}return this._isEQ?t:!t},n}();function gdt(n,e){return n==="eq"||n==="ne"?new pdt(n==="eq",e):Fr(_Fe,n)?new vdt(n,e):null}var ydt=function(){function n(){}return n.prototype.getRawData=function(){throw new Error("not supported")},n.prototype.getRawDataItem=function(e){throw new Error("not supported")},n.prototype.cloneRawData=function(){},n.prototype.getDimensionInfo=function(e){},n.prototype.cloneAllDimensionInfo=function(){},n.prototype.count=function(){},n.prototype.retrieveValue=function(e,t){},n.prototype.retrieveValueFromItem=function(e,t){},n.prototype.convertValue=function(e,t){return _S(e,t)},n}();function mdt(n,e){var t=new ydt,r=n.data,i=t.sourceFormat=n.sourceFormat,a=n.startIndex,o="";n.seriesLayoutBy!==Zy&&ao(o);var s=[],l={},u=n.dimensionsDefine;if(u)te(u,function(p,g){var m=p.name,y={index:g,name:m,displayName:p.displayName};if(s.push(y),m!=null){var _="";Fr(l,m)&&ao(_),l[m]=y}});else for(var h=0;h<n.dimensionsDetectedCount;h++)s.push({index:h});var c=pFe(i,Zy);e.__isBuiltIn&&(t.getRawDataItem=function(p){return c(r,a,s,p)},t.getRawData=kr(_dt,null,n)),t.cloneRawData=kr(xdt,null,n);var f=gFe(i,Zy);t.count=kr(f,null,r,a,s);var d=yFe(i);t.retrieveValue=function(p,g){var m=c(r,a,s,p);return v(m,g)};var v=t.retrieveValueFromItem=function(p,g){if(p!=null){var m=s[g];if(m)return d(p,g,m.name)}};return t.getDimensionInfo=kr(Sdt,null,s,l),t.cloneAllDimensionInfo=kr(wdt,null,s),t}function _dt(n){var e=n.sourceFormat;if(!Vie(e)){var t="";ao(t)}return n.data}function xdt(n){var e=n.sourceFormat,t=n.data;if(!Vie(e)){var r="";ao(r)}if(e===qc){for(var i=[],a=0,o=t.length;a<o;a++)i.push(t[a].slice());return i}else if(e===ag){for(var i=[],a=0,o=t.length;a<o;a++)i.push(Mt({},t[a]));return i}}function Sdt(n,e,t){if(t!=null){if(ha(t)||!isNaN(t)&&!Fr(e,t))return n[t];if(Fr(e,t))return e[t]}}function wdt(n){return Sn(n)}var SFe=$r();function bdt(n){n=Sn(n);var e=n.type,t="";e||ao(t);var r=e.split(":");r.length!==2&&ao(t);var i=!1;r[0]==="echarts"&&(e=r[1],i=!0),n.__isBuiltIn=i,SFe.set(e,n)}function Edt(n,e,t){var r=Do(n),i=r.length,a="";i||ao(a);for(var o=0,s=i;o<s;o++){var l=r[o];e=Tdt(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function Tdt(n,e,t,r){var i="";e.length||ao(i),dn(n)||ao(i);var a=n.type,o=SFe.get(a);o||ao(i);var s=Vt(e,function(u){return mdt(u,o)}),l=Do(o.transform({upstream:s[0],upstreamList:s,config:Sn(n.config)}));return Vt(l,function(u,h){var c="";dn(u)||ao(c),u.data||ao(c);var f=fFe(u.data);Vie(f)||ao(c);var d,v=e[0];if(v&&h===0&&!u.dimensions){var p=v.startIndex;p&&(u.data=v.data.slice(0,p).concat(u.data)),d={seriesLayoutBy:Zy,sourceHeader:p,dimensions:v.metaRawOption.dimensions}}else d={seriesLayoutBy:Zy,sourceHeader:0,dimensions:u.dimensions};return gJ(u.data,d,null)})}function Vie(n){return n===qc||n===ag}var uU="undefined",Cdt=typeof Uint32Array===uU?Array:Uint32Array,Adt=typeof Uint16Array===uU?Array:Uint16Array,wFe=typeof Int32Array===uU?Array:Int32Array,Upe=typeof Float64Array===uU?Array:Float64Array,bFe={float:Upe,int:wFe,ordinal:Array,number:Array,time:Upe},FH;function JL(n){return n>65535?Cdt:Adt}function YT(){return[1/0,-1/0]}function Mdt(n){var e=n.constructor;return e===Array?n.slice():new e(n)}function Vpe(n,e,t,r,i){var a=bFe[t||"float"];if(i){var o=n[e],s=o&&o.length;if(s!==r){for(var l=new a(r),u=0;u<s;u++)l[u]=o[u];n[e]=l}}else n[e]=new a(r)}var yJ=function(){function n(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=$r()}return n.prototype.initData=function(e,t,r){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=e.getSource(),a=this.defaultDimValueGetter=FH[i.sourceFormat];this._dimValueGetter=r||a,this._rawExtent=[],dFe(i),this._dimensions=Vt(t,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},n.prototype.getProvider=function(){return this._provider},n.prototype.getSource=function(){return this._provider.getSource()},n.prototype.ensureCalculationDimension=function(e,t){var r=this._calcDimNameToIdx,i=this._dimensions,a=r.get(e);if(a!=null){if(i[a].type===t)return a}else a=i.length;return i[a]={type:t},r.set(e,a),this._chunks[a]=new bFe[t||"float"](this._rawCount),this._rawExtent[a]=YT(),a},n.prototype.collectOrdinalMeta=function(e,t){var r=this._chunks[e],i=this._dimensions[e],a=this._rawExtent,o=i.ordinalOffset||0,s=r.length;o===0&&(a[e]=YT());for(var l=a[e],u=o;u<s;u++){var h=r[u]=t.parseAndCollect(r[u]);isNaN(h)||(l[0]=Math.min(h,l[0]),l[1]=Math.max(h,l[1]))}i.ordinalMeta=t,i.ordinalOffset=s,i.type="ordinal"},n.prototype.getOrdinalMeta=function(e){var t=this._dimensions[e],r=t.ordinalMeta;return r},n.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},n.prototype.appendData=function(e){var t=this._provider,r=this.count();t.appendData(e);var i=t.count();return t.persistent||(i+=r),r<i&&this._initDataFromProvider(r,i,!0),[r,i]},n.prototype.appendValues=function(e,t){for(var r=this._chunks,i=this._dimensions,a=i.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t||0),u=0;u<a;u++){var h=i[u];Vpe(r,u,h.type,l,!0)}for(var c=[],f=s;f<l;f++)for(var d=f-s,v=0;v<a;v++){var h=i[v],p=FH.arrayRows.call(this,e[d]||c,h.property,d,v);r[v][f]=p;var g=o[v];p<g[0]&&(g[0]=p),p>g[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},n.prototype._initDataFromProvider=function(e,t,r){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=Vt(o,function(y){return y.property}),h=0;h<s;h++){var c=o[h];l[h]||(l[h]=YT()),Vpe(a,h,c.type,t,r)}if(i.fillStorage)i.fillStorage(e,t,a,l);else for(var f=[],d=e;d<t;d++){f=i.getItem(d,f);for(var v=0;v<s;v++){var p=a[v],g=this._dimValueGetter(f,u[v],d,v);p[d]=g;var m=l[v];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},n.prototype.count=function(){return this._count},n.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var r=this._chunks[e];return r?r[this.getRawIndex(t)]:NaN},n.prototype.getValues=function(e,t){var r=[],i=[];if(t==null){t=e,e=[];for(var a=0;a<this._dimensions.length;a++)i.push(a)}else i=e;for(var a=0,o=i.length;a<o;a++)r.push(this.get(i[a],t));return r},n.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var r=this._chunks[e];return r?r[t]:NaN},n.prototype.getSum=function(e){var t=this._chunks[e],r=0;if(t)for(var i=0,a=this.count();i<a;i++){var o=this.get(e,i);isNaN(o)||(r+=o)}return r},n.prototype.getMedian=function(e){var t=[];this.each([e],function(a){isNaN(a)||t.push(a)});var r=t.sort(function(a,o){return a-o}),i=this.count();return i===0?0:i%2===1?r[(i-1)/2]:(r[i/2]+r[i/2-1])/2},n.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,r=t[e];if(r!=null&&r<this._count&&r===e)return e;for(var i=0,a=this._count-1;i<=a;){var o=(i+a)/2|0;if(t[o]<e)i=o+1;else if(t[o]>e)a=o-1;else return o}return-1},n.prototype.indicesOfNearest=function(e,t,r){var i=this._chunks,a=i[e],o=[];if(!a)return o;r==null&&(r=1/0);for(var s=1/0,l=-1,u=0,h=0,c=this.count();h<c;h++){var f=this.getRawIndex(h),d=t-a[f],v=Math.abs(d);v<=r&&((v<s||v===s&&d>=0&&l<0)&&(s=v,l=d,u=0),d===l&&(o[u++]=h))}return o.length=u,o},n.prototype.getIndices=function(){var e,t=this._indices;if(t){var r=t.constructor,i=this._count;if(r===Array){e=new r(i);for(var a=0;a<i;a++)e[a]=t[a]}else e=new r(t.buffer,0,i)}else{var r=JL(this._rawCount);e=new r(this.count());for(var a=0;a<e.length;a++)e[a]=a}return e},n.prototype.filter=function(e,t){if(!this._count)return this;for(var r=this.clone(),i=r.count(),a=JL(r._rawCount),o=new a(i),s=[],l=e.length,u=0,h=e[0],c=r._chunks,f=0;f<i;f++){var d=void 0,v=r.getRawIndex(f);if(l===0)d=t(f);else if(l===1){var p=c[h][v];d=t(p,f)}else{for(var g=0;g<l;g++)s[g]=c[e[g]][v];s[g]=f,d=t.apply(null,s)}d&&(o[u++]=v)}return u<i&&(r._indices=o),r._count=u,r._extent=[],r._updateGetRawIdx(),r},n.prototype.selectRange=function(e){var t=this.clone(),r=t._count;if(!r)return this;var i=Li(e),a=i.length;if(!a)return this;var o=t.count(),s=JL(t._rawCount),l=new s(o),u=0,h=i[0],c=e[h][0],f=e[h][1],d=t._chunks,v=!1;if(!t._indices){var p=0;if(a===1){for(var g=d[i[0]],m=0;m<r;m++){var y=g[m];(y>=c&&y<=f||isNaN(y))&&(l[u++]=p),p++}v=!0}else if(a===2){for(var g=d[i[0]],_=d[i[1]],x=e[i[1]][0],S=e[i[1]][1],m=0;m<r;m++){var y=g[m],w=_[m];(y>=c&&y<=f||isNaN(y))&&(w>=x&&w<=S||isNaN(w))&&(l[u++]=p),p++}v=!0}}if(!v)if(a===1)for(var m=0;m<o;m++){var b=t.getRawIndex(m),y=d[i[0]][b];(y>=c&&y<=f||isNaN(y))&&(l[u++]=b)}else for(var m=0;m<o;m++){for(var E=!0,b=t.getRawIndex(m),T=0;T<a;T++){var C=i[T],y=d[C][b];(y<e[C][0]||y>e[C][1])&&(E=!1)}E&&(l[u++]=t.getRawIndex(m))}return u<o&&(t._indices=l),t._count=u,t._extent=[],t._updateGetRawIdx(),t},n.prototype.map=function(e,t){var r=this.clone(e);return this._updateDims(r,e,t),r},n.prototype.modify=function(e,t){this._updateDims(this,e,t)},n.prototype._updateDims=function(e,t,r){for(var i=e._chunks,a=[],o=t.length,s=e.count(),l=[],u=e._rawExtent,h=0;h<t.length;h++)u[t[h]]=YT();for(var c=0;c<s;c++){for(var f=e.getRawIndex(c),d=0;d<o;d++)l[d]=i[t[d]][f];l[o]=c;var v=r&&r.apply(null,l);if(v!=null){typeof v!="object"&&(a[0]=v,v=a);for(var h=0;h<v.length;h++){var p=t[h],g=v[h],m=u[p],y=i[p];y&&(y[f]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},n.prototype.lttbDownSample=function(e,t){var r=this.clone([e],!0),i=r._chunks,a=i[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),h,c,f,d=new(JL(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;v<o-1;v+=l){for(var p=Math.min(v+l,o-1),g=Math.min(v+l*2,o),m=(g+p)/2,y=0,_=p;_<g;_++){var x=this.getRawIndex(_),S=a[x];isNaN(S)||(y+=S)}y/=g-p;var w=v,b=Math.min(v+l,o),E=v-1,T=a[u];h=-1,f=w;for(var C=-1,A=0,_=w;_<b;_++){var x=this.getRawIndex(_),S=a[x];if(isNaN(S)){A++,C<0&&(C=x);continue}c=Math.abs((E-m)*(S-T)-(E-_)*(y-T)),c>h&&(h=c,f=x)}A>0&&A<b-w&&(d[s++]=Math.min(C,f),f=Math.max(C,f)),d[s++]=f,u=f}return d[s++]=this.getRawIndex(o-1),r._count=s,r._indices=d,r.getRawIndex=this._getRawIdx,r},n.prototype.downSample=function(e,t,r,i){for(var a=this.clone([e],!0),o=a._chunks,s=[],l=Math.floor(1/t),u=o[e],h=this.count(),c=a._rawExtent[e]=YT(),f=new(JL(this._rawCount))(Math.ceil(h/l)),d=0,v=0;v<h;v+=l){l>h-v&&(l=h-v,s.length=l);for(var p=0;p<l;p++){var g=this.getRawIndex(v+p);s[p]=u[g]}var m=r(s),y=this.getRawIndex(Math.min(v+i(s,m)||0,h-1));u[y]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),f[d++]=y}return a._count=d,a._indices=f,a._updateGetRawIdx(),a},n.prototype.each=function(e,t){if(!!this._count)for(var r=e.length,i=this._chunks,a=0,o=this.count();a<o;a++){var s=this.getRawIndex(a);switch(r){case 0:t(a);break;case 1:t(i[e[0]][s],a);break;case 2:t(i[e[0]][s],i[e[1]][s],a);break;default:for(var l=0,u=[];l<r;l++)u[l]=i[e[l]][s];u[l]=a,t.apply(null,u)}}},n.prototype.getDataExtent=function(e){var t=this._chunks[e],r=YT();if(!t)return r;var i=this.count(),a=!this._indices,o;if(a)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=r;for(var s=o[0],l=o[1],u=0;u<i;u++){var h=this.getRawIndex(u),c=t[h];c<s&&(s=c),c>l&&(l=c)}return o=[s,l],this._extent[e]=o,o},n.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var r=[],i=this._chunks,a=0;a<i.length;a++)r.push(i[a][t]);return r},n.prototype.clone=function(e,t){var r=new n,i=this._chunks,a=e&&om(e,function(s,l){return s[l]=!0,s},{});if(a)for(var o=0;o<i.length;o++)r._chunks[o]=a[o]?Mdt(i[o]):i[o];else r._chunks=i;return this._copyCommonProps(r),t||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},n.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=Sn(this._extent),e._rawExtent=Sn(this._rawExtent)},n.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var r=this._indices.length;t=new e(r);for(var i=0;i<r;i++)t[i]=this._indices[i]}else t=new e(this._indices);return t}return null},n.prototype._getRawIdxIdentity=function(e){return e},n.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},n.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},n.internalField=function(){function e(t,r,i,a){return _S(t[a],this._dimensions[a])}FH={arrayRows:e,objectRows:function(t,r,i,a){return _S(t[r],this._dimensions[a])},keyedColumns:e,original:function(t,r,i,a){var o=t&&(t.value==null?t:t.value);return _S(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,r,i,a){return t[a]}}}(),n}(),EFe=function(){function n(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return n.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},n.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},n.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},n.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},n.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),r=!!t.length,i,a;if(l4(e)){var o=e,s=void 0,l=void 0,u=void 0;if(r){var h=t[0];h.prepareSource(),u=h.getSource(),s=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else s=o.get("data",!0),l=Ev(s)?mS:ig,a=[];var c=this._getSourceMetaRawOption()||{},f=u&&u.metaRawOption||{},d=ni(c.seriesLayoutBy,f.seriesLayoutBy)||null,v=ni(c.sourceHeader,f.sourceHeader),p=ni(c.dimensions,f.dimensions),g=d!==f.seriesLayoutBy||!!v!=!!f.sourceHeader||p;i=g?[gJ(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:p},l)]:[]}else{var m=e;if(r){var y=this._applyTransform(t);i=y.sourceList,a=y.upstreamSignList}else{var _=m.get("source",!0);i=[gJ(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},n.prototype._applyTransform=function(e){var t=this._sourceHost,r=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&Wpe(a)}var o,s=[],l=[];return te(e,function(u){u.prepareSource();var h=u.getSource(i||0),c="";i!=null&&!h&&Wpe(c),s.push(h),l.push(u._getVersionSign())}),r?o=Edt(r,s,{datasetIndex:t.componentIndex}):i!=null&&(o=[adt(s[0])]),{sourceList:o,upstreamSignList:l}},n.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var r=e[t];if(r._isDirty()||this._upstreamSignList[t]!==r._getVersionSign())return!0}},n.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var r=this._getUpstreamSourceManagers();return r[0]&&r[0].getSource(e)}return t},n.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},n.prototype._innerGetDataStore=function(e,t,r){var i=0,a=this._storeList,o=a[i];o||(o=a[i]={});var s=o[r];if(!s){var l=this._getUpstreamSourceManagers()[0];l4(this._sourceHost)&&l?s=l._innerGetDataStore(e,t,r):(s=new yJ,s.initData(new vFe(t,e.length),e)),o[r]=s}return s},n.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(l4(e)){var t=kie(e);return t?[t.getSourceManager()]:[]}else return Vt(Pft(e),function(r){return r.getSourceManager()})},n.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,r,i;if(l4(e))t=e.get("seriesLayoutBy",!0),r=e.get("sourceHeader",!0),i=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var a=e;t=a.get("seriesLayoutBy",!0),r=a.get("sourceHeader",!0),i=a.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:r,dimensions:i}},n}();function $pe(n){var e=n.option.transform;e&&Z8(n.option.transform)}function l4(n){return n.mainType==="series"}function Wpe(n){throw new Error(n)}var TFe="line-height:1";function CFe(n,e){var t=n.color||"#6e7079",r=n.fontSize||12,i=n.fontWeight||"400",a=n.color||"#464646",o=n.fontSize||14,s=n.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+od(r+"")+"px;color:"+od(t)+";font-weight:"+od(i+""),valueStyle:"font-size:"+od(o+"")+"px;color:"+od(a)+";font-weight:"+od(s+"")}:{nameStyle:{fontSize:r,fill:t,fontWeight:i},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var Idt=[0,10,20,30],Ldt=["",`
`,`
`,`
`];function ch(n,e){return e.type=n,e}function mJ(n){return n.type==="section"}function AFe(n){return mJ(n)?Pdt:Odt}function MFe(n){if(mJ(n)){var e=0,t=n.blocks.length,r=t>1||t>0&&!n.noHeader;return te(n.blocks,function(i){var a=MFe(i);a>=e&&(e=a+ +(r&&(!a||mJ(i)&&!i.noHeader)))}),e}return 0}function Pdt(n,e,t,r){var i=e.noHeader,a=Rdt(MFe(e)),o=[],s=e.blocks||[];Bf(!s||Gt(s)),s=s||[];var l=n.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Fr(u,l)){var h=new xFe(u[l],null);s.sort(function(v,p){return h.evaluate(v.sortParam,p.sortParam)})}else l==="seriesDesc"&&s.reverse()}te(s,function(v,p){var g=e.valueFormatter,m=AFe(v)(g?Mt(Mt({},n),{valueFormatter:g}):n,v,p>0?a.html:0,r);m!=null&&o.push(m)});var c=n.renderMode==="richText"?o.join(a.richText):_J(o.join(""),i?t:a.html);if(i)return c;var f=dJ(e.header,"ordinal",n.useUTC),d=CFe(r,n.renderMode).nameStyle;return n.renderMode==="richText"?IFe(n,f,d)+a.richText+c:_J('<div style="'+d+";"+TFe+';">'+od(f)+"</div>"+c,t)}function Odt(n,e,t,r){var i=n.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=n.useUTC,h=e.valueFormatter||n.valueFormatter||function(x){return x=Gt(x)?x:[x],Vt(x,function(S,w){return dJ(S,Gt(d)?d[w]:d,u)})};if(!(a&&o)){var c=s?"":n.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),f=a?"":dJ(l,"ordinal",u),d=e.valueType,v=o?[]:h(e.value),p=!s||!a,g=!s&&a,m=CFe(r,i),y=m.nameStyle,_=m.valueStyle;return i==="richText"?(s?"":c)+(a?"":IFe(n,f,y))+(o?"":kdt(n,v,p,g,_)):_J((s?"":c)+(a?"":Ddt(f,!s,y))+(o?"":Ndt(v,p,g,_)),t)}}function Hpe(n,e,t,r,i,a){if(!!n){var o=AFe(n),s={useUTC:i,renderMode:t,orderMode:r,markupStyleCreator:e,valueFormatter:n.valueFormatter};return o(s,n,0,a)}}function Rdt(n){return{html:Idt[n],richText:Ldt[n]}}function _J(n,e){var t='<div style="clear:both"></div>',r="margin: "+e+"px 0 0";return'<div style="'+r+";"+TFe+';">'+n+t+"</div>"}function Ddt(n,e,t){var r=e?"margin-left:2px":"";return'<span style="'+t+";"+r+'">'+od(n)+"</span>"}function Ndt(n,e,t,r){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return n=Gt(n)?n:[n],'<span style="'+a+";"+r+'">'+Vt(n,function(o){return od(o)}).join("&nbsp;&nbsp;")+"</span>"}function IFe(n,e,t){return n.markupStyleCreator.wrapRichTextStyle(e,t)}function kdt(n,e,t,r,i){var a=[i],o=r?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),n.markupStyleCreator.wrapRichTextStyle(Gt(e)?e.join(" "):e,a)}function LFe(n,e){var t=n.getData().getItemVisual(e,"style"),r=t[n.visualDrawType];return KE(r)}function PFe(n,e){var t=n.get("padding");return t!=null?t:e==="richText"?[8,10]:10}var BH=function(){function n(){this.richTextStyles={},this._nextStyleNameId=I3e()}return n.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},n.prototype.makeTooltipMarker=function(e,t,r){var i=r==="richText"?this._generateStyleName():null,a=Eft({color:t,type:e,renderMode:r,markerId:i});return Or(a)?a:(this.richTextStyles[i]=a.style,a.content)},n.prototype.wrapRichTextStyle=function(e,t){var r={};Gt(t)?te(t,function(a){return Mt(r,a)}):Mt(r,t);var i=this._generateStyleName();return this.richTextStyles[i]=r,"{"+i+"|"+e+"}"},n}();function OFe(n){var e=n.series,t=n.dataIndex,r=n.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=Gt(s),u=LFe(e,t),h,c,f,d;if(o>1||l&&!o){var v=Fdt(s,e,t,a,u);h=v.inlineValues,c=v.inlineValueTypes,f=v.blocks,d=v.inlineValues[0]}else if(o){var p=i.getDimensionInfo(a[0]);d=h=dM(i,t,a[0]),c=p.type}else d=h=l?s[0]:s;var g=vie(e),m=g&&e.name||"",y=i.getName(t),_=r?m:y;return ch("section",{header:m,noHeader:r||!g,sortParam:d,blocks:[ch("nameValue",{markerType:"item",markerColor:u,name:_,noName:!Qg(_),value:h,valueType:c})].concat(f||[])})}function Fdt(n,e,t,r,i){var a=e.getData(),o=om(n,function(c,f,d){var v=a.getDimensionInfo(d);return c=c||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];r.length?te(r,function(c){h(dM(a,t,c),c)}):te(n,h);function h(c,f){var d=a.getDimensionInfo(f);!d||d.otherDims.tooltip===!1||(o?u.push(ch("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:c,valueType:d.type})):(s.push(c),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var ax=na();function u4(n,e){return n.getName(e)||n.getId(e)}var PB="__universalTransitionEnabled",hU=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,r,i){this.seriesIndex=this.componentIndex,this.dataTask=JO({count:Gdt,reset:zdt}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=ax(this).sourceManager=new EFe(this);a.prepareSource();var o=this.getInitialData(t,i);Xpe(o,this),this.dataTask.context.data=o,ax(this).dataBeforeProcessed=o,jpe(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,r){var i=cD(this),a=i?BI(t):{},o=this.subType;oa.hasClass(o)&&(o+="Series"),ii(t,r.getTheme().get(this.subType)),ii(t,this.getDefaultOption()),XE(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&kS(t,a,i)},e.prototype.mergeOption=function(t,r){t=ii(this.option,t,!0),this.fillDataTextStyle(t.data);var i=cD(this);i&&kS(this.option,t,i);var a=ax(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,r);Xpe(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,ax(this).dataBeforeProcessed=o,jpe(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!Ev(t))for(var r=["show"],i=0;i<t.length;i++)t[i]&&t[i].label&&XE(t[i],"label",r)},e.prototype.getInitialData=function(t,r){},e.prototype.appendData=function(t){var r=this.getRawData();r.appendData(t.data)},e.prototype.getData=function(t){var r=xJ(this);if(r){var i=r.context.data;return t==null?i:i.getLinkedData(t)}else return ax(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var r=xJ(this);if(r){var i=r.context;i.outputData=t,r!==this.dataTask&&(i.data=t)}ax(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return $r(t)},e.prototype.getSourceManager=function(){return ax(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return ax(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var t=this.get("colorBy");return t||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},e.prototype.formatTooltip=function(t,r,i){return OFe({series:this,dataIndex:t,multipleSeries:r})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(sa.node&&!(t&&t.ssr))return!1;var r=this.getShallow("animation");return r&&this.getData().count()>this.getShallow("animationThreshold")&&(r=!1),!!r},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,r,i){var a=this.ecModel,o=Fie.prototype.getColorFromPalette.call(this,t,r,i);return o||(o=a.getColorFromPalette(t,r,i)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,r){this._innerSelect(this.getData(r),t)},e.prototype.unselect=function(t,r){var i=this.option.selectedMap;if(!!i){var a=this.option.selectedMode,o=this.getData(r);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<t.length;s++){var l=t[s],u=u4(o,l);i[u]=!1,this._selectedDataIndicesMap[u]=-1}}},e.prototype.toggleSelect=function(t,r){for(var i=[],a=0;a<t.length;a++)i[0]=t[a],this.isSelected(t[a],r)?this.unselect(i,r):this.select(i,r)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,r=Li(t),i=[],a=0;a<r.length;a++){var o=t[r[a]];o>=0&&i.push(o)}return i},e.prototype.isSelected=function(t,r){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(r);return(i==="all"||i[u4(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[PB])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,r){var i,a,o=this.option,s=o.selectedMode,l=r.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){dn(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,h=0;h<l;h++){var c=r[h],f=u4(t,c);u[f]=!0,this._selectedDataIndicesMap[f]=t.getRawIndex(c)}}else if(s==="single"||s===!0){var d=r[l-1],f=u4(t,d);o.selectedMap=(i={},i[f]=!0,i),this._selectedDataIndicesMap=(a={},a[f]=t.getRawIndex(d),a)}}},e.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var r=[];t.hasItemOption&&t.each(function(i){var a=t.getRawDataItem(i);a&&a.selected&&r.push(i)}),r.length>0&&this._innerSelect(t,r)}},e.registerClass=function(t){return oa.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(oa);gu(hU,Uie);gu(hU,Fie);B3e(hU,oa);function jpe(n){var e=n.name;vie(n)||(n.name=Bdt(n)||e)}function Bdt(n){var e=n.getRawData(),t=e.mapDimensionsAll("seriesName"),r=[];return te(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&r.push(a.displayName)}),r.join(" ")}function Gdt(n){return n.model.getRawData().count()}function zdt(n){var e=n.model;return e.setData(e.getRawData().cloneShallow()),Udt}function Udt(n,e){e.outputData&&n.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Xpe(n,e){te(K8(n.CHANGABLE_METHODS,n.DOWNSAMPLE_METHODS),function(t){n.wrapMethod(t,Un(Vdt,e))})}function Vdt(n,e){var t=xJ(n);return t&&t.setOutputEnd((e||this).count()),e}function xJ(n){var e=(n.ecModel||{}).scheduler,t=e&&e.getPipeline(n.uid);if(t){var r=t.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(n.uid))}return r}}const Ws=hU;var $ie=function(){function n(){this.group=new Cn,this.uid=kI("viewComponent")}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){},n.prototype.updateLayout=function(e,t,r,i){},n.prototype.updateVisual=function(e,t,r,i){},n.prototype.toggleBlurSeries=function(e,t,r){},n.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},n}();gie($ie);Hz($ie);const pl=$ie;function UI(){var n=na();return function(e){var t=n(e),r=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,o=t.large=!!(r&&r.large),s=t.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&"reset"}}var RFe=na(),$dt=UI(),Wie=function(){function n(){this.group=new Cn,this.uid=kI("viewChart"),this.renderTask=JO({plan:Wdt,reset:Hdt}),this.renderTask.context={view:this}}return n.prototype.init=function(e,t){},n.prototype.render=function(e,t,r,i){},n.prototype.highlight=function(e,t,r,i){var a=e.getData(i&&i.dataType);!a||qpe(a,i,"emphasis")},n.prototype.downplay=function(e,t,r,i){var a=e.getData(i&&i.dataType);!a||qpe(a,i,"normal")},n.prototype.remove=function(e,t){this.group.removeAll()},n.prototype.dispose=function(e,t){},n.prototype.updateView=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateLayout=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.updateVisual=function(e,t,r,i){this.render(e,t,r,i)},n.prototype.eachRendered=function(e){_w(this.group,e)},n.markUpdateMethod=function(e,t){RFe(e).updateMethod=t},n.protoInitialize=function(){var e=n.prototype;e.type="chart"}(),n}();function Ype(n,e,t){n&&sD(n)&&(e==="emphasis"?h_:c_)(n,t)}function qpe(n,e,t){var r=YE(n,e),i=e&&e.highlightKey!=null?yct(e.highlightKey):null;r!=null?te(Do(r),function(a){Ype(n.getItemGraphicEl(a),t,i)}):n.eachItemGraphicEl(function(a){Ype(a,t,i)})}gie(Wie);Hz(Wie);function Wdt(n){return $dt(n.model)}function Hdt(n){var e=n.model,t=n.ecModel,r=n.api,i=n.payload,a=e.pipelineContext.progressiveRender,o=n.view,s=i&&RFe(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,r,i),jdt[l]}var jdt={incrementalPrepareRender:{progress:function(n,e){e.view.incrementalRender(n,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(n,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const os=Wie;var vG="\0__throttleOriginMethod",Zpe="\0__throttleRate",Kpe="\0__throttleType";function Hie(n,e,t){var r,i=0,a=0,o=null,s,l,u,h;e=e||0;function c(){a=new Date().getTime(),o=null,n.apply(l,u||[])}var f=function(){for(var d=[],v=0;v<arguments.length;v++)d[v]=arguments[v];r=new Date().getTime(),l=this,u=d;var p=h||e,g=h||t;h=null,s=r-(g?i:a)-p,clearTimeout(o),g?o=setTimeout(c,p):s>=0?c():o=setTimeout(c,-s),i=r};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(d){h=d},f}function VI(n,e,t,r){var i=n[e];if(!!i){var a=i[vG]||i,o=i[Kpe],s=i[Zpe];if(s!==t||o!==r){if(t==null||!r)return n[e]=a;i=n[e]=Hie(a,t,r==="debounce"),i[vG]=a,i[Kpe]=r,i[Zpe]=t}return i}}function dD(n,e){var t=n[e];t&&t[vG]&&(t.clear&&t.clear(),n[e]=t[vG])}var Jpe=na(),Qpe={itemStyle:qE(Fke,!0),lineStyle:qE(kke,!0)},Xdt={lineStyle:"stroke",itemStyle:"fill"};function DFe(n,e){var t=n.visualStyleMapper||Qpe[e];return t||(console.warn("Unknown style type '"+e+"'."),Qpe.itemStyle)}function NFe(n,e){var t=n.visualDrawType||Xdt[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var Ydt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=n.getModel(r),a=DFe(n,r),o=a(i),s=i.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=NFe(n,r),u=o[l],h=rn(u)?u:null,c=o.fill==="auto"||o.stroke==="auto";if(!o[l]||h||c){var f=n.getColorFromPalette(n.name,null,e.getSeriesCount());o[l]||(o[l]=f,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||rn(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||rn(o.stroke)?f:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(n)&&h)return t.setVisual("colorFromPalette",!1),{dataEach:function(d,v){var p=n.getDataParams(v),g=Mt({},o);g[l]=h(p),d.setItemVisual(v,"style",g)}}}},QL=new as,qdt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!(n.ignoreStyleOnData||e.isSeriesFiltered(n))){var t=n.getData(),r=n.visualStyleAccessPath||"itemStyle",i=DFe(n,r),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[r]){QL.option=l[r];var u=i(QL),h=o.ensureUniqueItemVisual(s,"style");Mt(h,u),QL.option.decal&&(o.setItemVisual(s,"decal",QL.option.decal),QL.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},Zdt={performRawSeries:!0,overallReset:function(n){var e=$r();n.eachSeries(function(t){var r=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+r,a=e.get(i);a||(a={},e.set(i,a)),Jpe(t).scope=a}}),n.eachSeries(function(t){if(!(t.isColorBySeries()||n.isSeriesFiltered(t))){var r=t.getRawData(),i={},a=t.getData(),o=Jpe(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=NFe(t,s);a.each(function(u){var h=a.getRawIndex(u);i[h]=u}),r.each(function(u){var h=i[u],c=a.getItemVisual(h,"colorFromPalette");if(c){var f=a.ensureUniqueItemVisual(h,"style"),d=r.getName(u)||u+"",v=r.count();f[l]=t.getColorFromPalette(d,o,v)}})}})}},h4=Math.PI;function Kdt(n,e){e=e||{},sn(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Cn,r=new ta({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(r);var i=new la({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new ta({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new Tie({shape:{startAngle:-h4/2,endAngle:-h4/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:h4*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:h4*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(n.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),h=n.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:h}),a.setShape({x:u-l,y:h-l,width:l*2,height:l*2}),r.setShape({x:0,y:0,width:n.getWidth(),height:n.getHeight()})},t.resize(),t}var Jdt=function(){function n(e,t,r,i){this._stageTaskMap=$r(),this.ecInstance=e,this.api=t,r=this._dataProcessorHandlers=r.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=r.concat(i)}return n.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(r){var i=r.overallTask;i&&i.dirty()})},n.prototype.getPerformArgs=function(e,t){if(!!e.__pipeline){var r=this._pipelineMap.get(e.__pipeline.id),i=r.context,a=!t&&r.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>r.blockIndex,o=a?r.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},n.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},n.prototype.updateStreamModes=function(e,t){var r=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),o=r.progressiveEnabled&&t.incrementalPrepareRender&&a>=r.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=r.context={progressiveRender:o,modDataCount:l,large:s}},n.prototype.restorePipelines=function(e){var t=this,r=t._pipelineMap=$r();e.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;r.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(i,i.dataTask)})},n.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),r=this.api;te(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";Bf(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,t,r),i.overallReset&&this._createOverallStageTask(i,a,t,r)},this)},n.prototype.prepareView=function(e,t,r,i){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=r,o.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},n.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},n.prototype.performVisualTasks=function(e,t,r){this._performStageTasks(this._visualHandlers,e,t,r)},n.prototype._performStageTasks=function(e,t,r,i){i=i||{};var a=!1,o=this;te(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var h=o._stageTaskMap.get(l.uid),c=h.seriesTaskMap,f=h.overallTask;if(f){var d,v=f.agentStubMap;v.each(function(g){s(i,g)&&(g.dirty(),d=!0)}),d&&f.dirty(),o.updatePayload(f,r);var p=o.getPerformArgs(f,i.block);v.each(function(g){g.perform(p)}),f.perform(p)&&(a=!0)}else c&&c.each(function(g,m){s(i,g)&&g.dirty();var y=o.getPerformArgs(g,i.block);y.skip=!l.performRawSeries&&t.isSeriesFiltered(g.context.model),o.updatePayload(g,r),g.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},n.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(r){t=r.dataTask.perform()||t}),this.unfinished=t||this.unfinished},n.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},n.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},n.prototype._createSeriesStageTask=function(e,t,r,i){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=$r(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?r.eachRawSeries(h):l?r.eachRawSeriesByType(l,h):u&&u(r,i).each(h);function h(c){var f=c.uid,d=s.set(f,o&&o.get(f)||JO({plan:nvt,reset:ivt,count:ovt}));d.context={model:c,ecModel:r,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(c,d)}},n.prototype._createOverallStageTask=function(e,t,r,i){var a=this,o=t.overallTask=t.overallTask||JO({reset:Qdt});o.context={ecModel:r,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=$r(),u=e.seriesType,h=e.getTargetSeries,c=!0,f=!1,d="";Bf(!e.createOnAllSeries,d),u?r.eachRawSeriesByType(u,v):h?h(r,i).each(v):(c=!1,te(r.getSeries(),v));function v(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(f=!0,JO({reset:evt,onDirty:rvt})));m.context={model:p,overallProgress:c},m.agent=o,m.__block=c,a._pipe(p,m)}f&&o.dirty()},n.prototype._pipe=function(e,t){var r=e.uid,i=this._pipelineMap.get(r);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},n.wrapStageHandler=function(e,t){return rn(e)&&(e={overallReset:e,seriesType:svt(e)}),e.uid=kI("stageHandler"),t&&(e.visualType=t),e},n}();function Qdt(n){n.overallReset(n.ecModel,n.api,n.payload)}function evt(n){return n.overallProgress&&tvt}function tvt(){this.agent.dirty(),this.getDownstream().dirty()}function rvt(){this.agent&&this.agent.dirty()}function nvt(n){return n.plan?n.plan(n.model,n.ecModel,n.api,n.payload):null}function ivt(n){n.useClearVisual&&n.data.clearAllVisual();var e=n.resetDefines=Do(n.reset(n.model,n.ecModel,n.api,n.payload));return e.length>1?Vt(e,function(t,r){return kFe(r)}):avt}var avt=kFe(0);function kFe(n){return function(e,t){var r=t.data,i=t.resetDefines[n];if(i&&i.dataEach)for(var a=e.start;a<e.end;a++)i.dataEach(r,a);else i&&i.progress&&i.progress(e,r)}}function ovt(n){return n.data.count()}function svt(n){pG=null;try{n(vD,FFe)}catch{}return pG}var vD={},FFe={},pG;BFe(vD,lFe);BFe(FFe,uFe);vD.eachSeriesByType=vD.eachRawSeriesByType=function(n){pG=n};vD.eachComponent=function(n){n.mainType==="series"&&n.subType&&(pG=n.subType)};function BFe(n,e){for(var t in e.prototype)n[t]=Hl}const GFe=Jdt;var ege=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const lvt={color:ege,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],ege]};var pf="#B9B8CE",tge="#100C2A",c4=function(){return{axisLine:{lineStyle:{color:pf}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},rge=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],zFe={darkMode:!0,color:rge,backgroundColor:tge,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:pf}},textStyle:{color:pf},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:pf}},dataZoom:{borderColor:"#71708A",textStyle:{color:pf},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:pf}},timeline:{lineStyle:{color:pf},label:{color:pf},controlStyle:{color:pf,borderColor:pf}},calendar:{itemStyle:{color:tge},dayLabel:{color:pf},monthLabel:{color:pf},yearLabel:{color:pf}},timeAxis:c4(),logAxis:c4(),valueAxis:c4(),categoryAxis:c4(),line:{symbol:"circle"},graph:{color:rge},gauge:{title:{color:pf},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:pf},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};zFe.categoryAxis.splitLine.show=!1;const uvt=zFe;var hvt=function(){function n(){}return n.prototype.normalizeQuery=function(e){var t={},r={},i={};if(Or(e)){var a=ky(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};te(e,function(l,u){for(var h=!1,c=0;c<o.length;c++){var f=o[c],d=u.lastIndexOf(f);if(d>0&&d===u.length-f.length){var v=u.slice(0,d);v!=="data"&&(t.mainType=v,t[f.toLowerCase()]=l,h=!0)}}s.hasOwnProperty(u)&&(r[u]=l,h=!0),h||(i[u]=l)})}return{cptQuery:t,dataQuery:r,otherQuery:i}},n.prototype.filter=function(e,t){var r=this.eventInfo;if(!r)return!0;var i=r.targetEl,a=r.packedEvent,o=r.model,s=r.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,i,a));function h(c,f,d,v){return c[d]==null||f[v||d]===c[d]}},n.prototype.afterTrigger=function(){this.eventInfo=null},n}(),SJ=["symbol","symbolSize","symbolRotate","symbolOffset"],nge=SJ.concat(["symbolKeepAspect"]),cvt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){var t=n.getData();if(n.legendIcon&&t.setVisual("legendIcon",n.legendIcon),!n.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o<SJ.length;o++){var s=SJ[o],l=n.get(s);rn(l)?(a=!0,i[s]=l):r[s]=l}if(r.symbol=r.symbol||n.defaultSymbol,t.setVisual(Mt({legendIcon:n.legendIcon||r.symbol,symbolKeepAspect:n.get("symbolKeepAspect")},r)),e.isSeriesFiltered(n))return;var u=Li(i);function h(c,f){for(var d=n.getRawValue(f),v=n.getDataParams(f),p=0;p<u.length;p++){var g=u[p];c.setItemVisual(f,g,i[g](d,v))}}return{dataEach:a?h:null}}},fvt={createOnAllSeries:!0,performRawSeries:!0,reset:function(n,e){if(!n.hasSymbolVisual||e.isSeriesFiltered(n))return;var t=n.getData();function r(i,a){for(var o=i.getItemModel(a),s=0;s<nge.length;s++){var l=nge[s],u=o.getShallow(l,!0);u!=null&&i.setItemVisual(a,l,u)}}return{dataEach:t.hasItemOption?r:null}}};function jie(n,e,t){switch(t){case"color":var r=n.getItemVisual(e,"style");return r[n.getVisual("drawType")];case"opacity":return n.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return n.getItemVisual(e,t)}}function w3(n,e){switch(e){case"color":var t=n.getVisual("style");return t[n.getVisual("drawType")];case"opacity":return n.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return n.getVisual(e)}}function UFe(n,e,t,r){switch(t){case"color":var i=n.ensureUniqueItemVisual(e,"style");i[n.getVisual("drawType")]=r,n.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":n.ensureUniqueItemVisual(e,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":n.setItemVisual(e,t,r);break}}function VFe(n,e){function t(r,i){var a=[];return r.eachComponent({mainType:"series",subType:n,query:i},function(o){a.push(o.seriesIndex)}),a}te([[n+"ToggleSelect","toggleSelect"],[n+"Select","select"],[n+"UnSelect","unselect"]],function(r){e(r[0],function(i,a,o){i=Mt({},i),o.dispatchAction(Mt(i,{type:r[1],seriesIndex:t(a,i)}))})})}function qT(n,e,t,r,i){var a=n+e;t.isSilent(a)||r.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,u=i.selected,h=0;h<u.length;h++)if(u[h].seriesIndex===s){var c=o.getData(),f=YE(c,i.fromActionPayload);t.trigger(a,{type:a,seriesId:o.id,name:Gt(f)?c.getName(f[0]):c.getName(f),selected:Or(l)?l:Mt({},l)})}})}function dvt(n,e,t){n.on("selectchanged",function(r){var i=t.getModel();r.isFromClick?(qT("map","selectchanged",e,i,r),qT("pie","selectchanged",e,i,r)):r.fromAction==="select"?(qT("map","selected",e,i,r),qT("pie","selected",e,i,r)):r.fromAction==="unselect"&&(qT("map","unselected",e,i,r),qT("pie","unselected",e,i,r))})}function aE(n,e,t){for(var r;n&&!(e(n)&&(r=n,t));)n=n.__hostTarget||n.parent;return r}var vvt=Math.round(Math.random()*9),pvt=typeof Object.defineProperty=="function",gvt=function(){function n(){this._id="__ec_inner_"+vvt++}return n.prototype.get=function(e){return this._guard(e)[this._id]},n.prototype.set=function(e,t){var r=this._guard(e);return pvt?Object.defineProperty(r,this._id,{value:t,enumerable:!1,configurable:!0}):r[this._id]=t,this},n.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},n.prototype.has=function(e){return!!this._guard(e)[this._id]},n.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},n}();const yvt=gvt;var mvt=Si.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(n,e){var t=e.cx,r=e.cy,i=e.width/2,a=e.height/2;n.moveTo(t,r-a),n.lineTo(t+i,r+a),n.lineTo(t-i,r+a),n.closePath()}}),_vt=Si.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(n,e){var t=e.cx,r=e.cy,i=e.width/2,a=e.height/2;n.moveTo(t,r-a),n.lineTo(t+i,r),n.lineTo(t,r+a),n.lineTo(t-i,r),n.closePath()}}),xvt=Si.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(n,e){var t=e.x,r=e.y,i=e.width/5*3,a=Math.max(i,e.height),o=i/2,s=o*o/(a-o),l=r-a+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),f=Math.cos(u),d=o*.6,v=o*.7;n.moveTo(t-h,l+s),n.arc(t,l,o,Math.PI-u,Math.PI*2+u),n.bezierCurveTo(t+h-c*d,l+s+f*d,t,r-v,t,r),n.bezierCurveTo(t,r-v,t-h+c*d,l+s+f*d,t-h,l+s),n.closePath()}}),Svt=Si.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(n,e){var t=e.height,r=e.width,i=e.x,a=e.y,o=r/3*2;n.moveTo(i,a),n.lineTo(i+o,a+t),n.lineTo(i,a+t/4*3),n.lineTo(i-o,a+t),n.lineTo(i,a),n.closePath()}}),wvt={line:zh,rect:ta,roundRect:ta,square:ta,circle:cm,diamond:_vt,pin:xvt,arrow:Svt,triangle:mvt},bvt={line:function(n,e,t,r,i){i.x1=n,i.y1=e+r/2,i.x2=n+t,i.y2=e+r/2},rect:function(n,e,t,r,i){i.x=n,i.y=e,i.width=t,i.height=r},roundRect:function(n,e,t,r,i){i.x=n,i.y=e,i.width=t,i.height=r,i.r=Math.min(t,r)/4},square:function(n,e,t,r,i){var a=Math.min(t,r);i.x=n,i.y=e,i.width=a,i.height=a},circle:function(n,e,t,r,i){i.cx=n+t/2,i.cy=e+r/2,i.r=Math.min(t,r)/2},diamond:function(n,e,t,r,i){i.cx=n+t/2,i.cy=e+r/2,i.width=t,i.height=r},pin:function(n,e,t,r,i){i.x=n+t/2,i.y=e+r/2,i.width=t,i.height=r},arrow:function(n,e,t,r,i){i.x=n+t/2,i.y=e+r/2,i.width=t,i.height=r},triangle:function(n,e,t,r,i){i.cx=n+t/2,i.cy=e+r/2,i.width=t,i.height=r}},gG={};te(wvt,function(n,e){gG[e]=new n});var Evt=Si.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(n,e,t){var r=iG(n,e,t),i=this.shape;return i&&i.symbolType==="pin"&&e.position==="inside"&&(r.y=t.y+t.height*.4),r},buildPath:function(n,e,t){var r=e.symbolType;if(r!=="none"){var i=gG[r];i||(r="rect",i=gG[r]),bvt[r](e.x,e.y,e.width,e.height,i.shape),i.buildPath(n,i.shape,t)}}});function Tvt(n,e){if(this.type!=="image"){var t=this.style;this.__isEmptyBrush?(t.stroke=n,t.fill=e||"#fff",t.lineWidth=2):this.shape.symbolType==="line"?t.stroke=n:t.fill=n,this.markRedraw()}}function hu(n,e,t,r,i,a,o){var s=n.indexOf("empty")===0;s&&(n=n.substr(5,1).toLowerCase()+n.substr(6));var l;return n.indexOf("image://")===0?l=Ake(n.slice(8),new ai(e,t,r,i),o?"center":"cover"):n.indexOf("path://")===0?l=Qz(n.slice(7),{},new ai(e,t,r,i),o?"center":"cover"):l=new Evt({shape:{symbolType:n,x:e,y:t,width:r,height:i}}),l.__isEmptyBrush=s,l.setColor=Tvt,a&&l.setColor(a),l}function $I(n){return Gt(n)||(n=[+n,+n]),[n[0]||0,n[1]||0]}function Y2(n,e){if(n!=null)return Gt(n)||(n=[n,n]),[xr(n[0],e[0])||0,xr(ni(n[1],n[0]),e[1])||0]}function oE(n){return isFinite(n)}function Cvt(n,e,t){var r=e.x==null?0:e.x,i=e.x2==null?1:e.x2,a=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(r=r*t.width+t.x,i=i*t.width+t.x,a=a*t.height+t.y,o=o*t.height+t.y),r=oE(r)?r:0,i=oE(i)?i:1,a=oE(a)?a:0,o=oE(o)?o:0;var s=n.createLinearGradient(r,a,i,o);return s}function Avt(n,e,t){var r=t.width,i=t.height,a=Math.min(r,i),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*r+t.x,s=s*i+t.y,l=l*a),o=oE(o)?o:.5,s=oE(s)?s:.5,l=l>=0&&oE(l)?l:.5;var u=n.createRadialGradient(o,s,0,o,s,l);return u}function wJ(n,e,t){for(var r=e.type==="radial"?Avt(n,e,t):Cvt(n,e,t),i=e.colorStops,a=0;a<i.length;a++)r.addColorStop(i[a].offset,i[a].color);return r}function Mvt(n,e){if(n===e||!n&&!e)return!1;if(!n||!e||n.length!==e.length)return!0;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!0;return!1}function f4(n){return parseInt(n,10)}function fA(n,e,t){var r=["width","height"][e],i=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(t[r]!=null&&t[r]!=="auto")return parseFloat(t[r]);var s=document.defaultView.getComputedStyle(n);return(n[i]||f4(s[r])||f4(n.style[r]))-(f4(s[a])||0)-(f4(s[o])||0)|0}function Ivt(n,e){return!n||n==="solid"||!(e>0)?null:n==="dashed"?[4*e,2*e]:n==="dotted"?[e]:ha(n)?[n]:Gt(n)?n:null}function Xie(n){var e=n.style,t=e.lineDash&&e.lineWidth>0&&Ivt(e.lineDash,e.lineWidth),r=e.lineDashOffset;if(t){var i=e.strokeNoScale&&n.getLineScale?n.getLineScale():1;i&&i!==1&&(t=Vt(t,function(a){return a/i}),r/=i)}return[t,r]}var Lvt=new hm(!0);function yG(n){var e=n.stroke;return!(e==null||e==="none"||!(n.lineWidth>0))}function ige(n){return typeof n=="string"&&n!=="none"}function mG(n){var e=n.fill;return e!=null&&e!=="none"}function age(n,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.fillOpacity*e.opacity,n.fill(),n.globalAlpha=t}else n.fill()}function oge(n,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=n.globalAlpha;n.globalAlpha=e.strokeOpacity*e.opacity,n.stroke(),n.globalAlpha=t}else n.stroke()}function bJ(n,e,t){var r=yie(e.image,e.__image,t);if(jz(r)){var i=n.createPattern(r,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*yB),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function Pvt(n,e,t,r){var i,a=yG(t),o=mG(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var h=e.path||Lvt,c=e.__dirty;if(!r){var f=t.fill,d=t.stroke,v=o&&!!f.colorStops,p=a&&!!d.colorStops,g=o&&!!f.image,m=a&&!!d.image,y=void 0,_=void 0,x=void 0,S=void 0,w=void 0;(v||p)&&(w=e.getBoundingRect()),v&&(y=c?wJ(n,f,w):e.__canvasFillGradient,e.__canvasFillGradient=y),p&&(_=c?wJ(n,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),g&&(x=c||!e.__canvasFillPattern?bJ(n,f,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(S=c||!e.__canvasStrokePattern?bJ(n,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),v?n.fillStyle=y:g&&(x?n.fillStyle=x:o=!1),p?n.strokeStyle=_:m&&(S?n.strokeStyle=S:a=!1)}var b=e.getGlobalScale();h.setScale(b[0],b[1],e.segmentIgnoreThreshold);var E,T;n.setLineDash&&t.lineDash&&(i=Xie(e),E=i[0],T=i[1]);var C=!0;(u||c&BC)&&(h.setDPR(n.dpr),l?h.setContext(null):(h.setContext(n),C=!1),h.reset(),e.buildPath(h,e.shape,r),h.toStatic(),e.pathUpdated()),C&&h.rebuildPath(n,l?s:1),E&&(n.setLineDash(E),n.lineDashOffset=T),r||(t.strokeFirst?(a&&oge(n,t),o&&age(n,t)):(o&&age(n,t),a&&oge(n,t))),E&&n.setLineDash([])}function Ovt(n,e,t){var r=e.__image=yie(t.image,e.__image,e,e.onload);if(!(!r||!jz(r))){var i=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=r.width/r.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=r.width,s=r.height),t.sWidth&&t.sHeight){var u=t.sx||0,h=t.sy||0;n.drawImage(r,u,h,t.sWidth,t.sHeight,i,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,h=t.sy,c=o-u,f=s-h;n.drawImage(r,u,h,c,f,i,a,o,s)}else n.drawImage(r,i,a,o,s)}}function Rvt(n,e,t){var r,i=t.text;if(i!=null&&(i+=""),i){n.font=t.font||RS,n.textAlign=t.textAlign,n.textBaseline=t.textBaseline;var a=void 0,o=void 0;n.setLineDash&&t.lineDash&&(r=Xie(e),a=r[0],o=r[1]),a&&(n.setLineDash(a),n.lineDashOffset=o),t.strokeFirst?(yG(t)&&n.strokeText(i,t.x,t.y),mG(t)&&n.fillText(i,t.x,t.y)):(mG(t)&&n.fillText(i,t.x,t.y),yG(t)&&n.strokeText(i,t.x,t.y)),a&&n.setLineDash([])}}var sge=["shadowBlur","shadowOffsetX","shadowOffsetY"],lge=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function $Fe(n,e,t,r,i){var a=!1;if(!r&&(t=t||{},e===t))return!1;if(r||e.opacity!==t.opacity){hd(n,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);n.globalAlpha=isNaN(o)?EE.opacity:o}(r||e.blend!==t.blend)&&(a||(hd(n,i),a=!0),n.globalCompositeOperation=e.blend||EE.blend);for(var s=0;s<sge.length;s++){var l=sge[s];(r||e[l]!==t[l])&&(a||(hd(n,i),a=!0),n[l]=n.dpr*(e[l]||0))}return(r||e.shadowColor!==t.shadowColor)&&(a||(hd(n,i),a=!0),n.shadowColor=e.shadowColor||EE.shadowColor),a}function uge(n,e,t,r,i){var a=pD(e,i.inHover),o=r?null:t&&pD(t,i.inHover)||{};if(a===o)return!1;var s=$Fe(n,a,o,r,i);if((r||a.fill!==o.fill)&&(s||(hd(n,i),s=!0),ige(a.fill)&&(n.fillStyle=a.fill)),(r||a.stroke!==o.stroke)&&(s||(hd(n,i),s=!0),ige(a.stroke)&&(n.strokeStyle=a.stroke)),(r||a.opacity!==o.opacity)&&(s||(hd(n,i),s=!0),n.globalAlpha=a.opacity==null?1:a.opacity),e.hasStroke()){var l=a.lineWidth,u=l/(a.strokeNoScale&&e.getLineScale?e.getLineScale():1);n.lineWidth!==u&&(s||(hd(n,i),s=!0),n.lineWidth=u)}for(var h=0;h<lge.length;h++){var c=lge[h],f=c[0];(r||a[f]!==o[f])&&(s||(hd(n,i),s=!0),n[f]=a[f]||c[1])}return s}function Dvt(n,e,t,r,i){return $Fe(n,pD(e,i.inHover),t&&pD(t,i.inHover),r,i)}function WFe(n,e){var t=e.transform,r=n.dpr||1;t?n.setTransform(r*t[0],r*t[1],r*t[2],r*t[3],r*t[4],r*t[5]):n.setTransform(r,0,0,r,0,0)}function Nvt(n,e,t){for(var r=!1,i=0;i<n.length;i++){var a=n[i];r=r||a.isZeroArea(),WFe(e,a),e.beginPath(),a.buildPath(e,a.shape),e.clip()}t.allClipped=r}function kvt(n,e){return n&&e?n[0]!==e[0]||n[1]!==e[1]||n[2]!==e[2]||n[3]!==e[3]||n[4]!==e[4]||n[5]!==e[5]:!(!n&&!e)}var hge=1,cge=2,fge=3,dge=4;function Fvt(n){var e=mG(n),t=yG(n);return!(n.lineDash||!(+e^+t)||e&&typeof n.fill!="string"||t&&typeof n.stroke!="string"||n.strokePercent<1||n.strokeOpacity<1||n.fillOpacity<1)}function hd(n,e){e.batchFill&&n.fill(),e.batchStroke&&n.stroke(),e.batchFill="",e.batchStroke=""}function pD(n,e){return e&&n.__hoverStyle||n.style}function HFe(n,e){sE(n,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function sE(n,e,t,r){var i=e.transform;if(!e.shouldBePainted(t.viewWidth,t.viewHeight,!1,!1)){e.__dirty&=~ov,e.__isRendered=!1;return}var a=e.__clipPaths,o=t.prevElClipPaths,s=!1,l=!1;if((!o||Mvt(a,o))&&(o&&o.length&&(hd(n,t),n.restore(),l=s=!0,t.prevElClipPaths=null,t.allClipped=!1,t.prevEl=null),a&&a.length&&(hd(n,t),n.save(),Nvt(a,n,t),s=!0),t.prevElClipPaths=a),t.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var u=t.prevEl;u||(l=s=!0);var h=e instanceof Si&&e.autoBatch&&Fvt(e.style);s||kvt(i,u.transform)?(hd(n,t),WFe(n,e)):h||hd(n,t);var c=pD(e,t.inHover);e instanceof Si?(t.lastDrawType!==hge&&(l=!0,t.lastDrawType=hge),uge(n,e,u,l,t),(!h||!t.batchFill&&!t.batchStroke)&&n.beginPath(),Pvt(n,e,c,h),h&&(t.batchFill=c.fill||"",t.batchStroke=c.stroke||"")):e instanceof aD?(t.lastDrawType!==fge&&(l=!0,t.lastDrawType=fge),uge(n,e,u,l,t),Rvt(n,e,c)):e instanceof xc?(t.lastDrawType!==cge&&(l=!0,t.lastDrawType=cge),Dvt(n,e,u,l,t),Ovt(n,e,c)):e.getTemporalDisplayables&&(t.lastDrawType!==dge&&(l=!0,t.lastDrawType=dge),Bvt(n,e,t)),h&&r&&hd(n,t),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),t.prevEl=e,e.__dirty=0,e.__isRendered=!0}function Bvt(n,e,t){var r=e.getDisplayables(),i=e.getTemporalDisplayables();n.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:t.viewWidth,viewHeight:t.viewHeight,inHover:t.inHover},o,s;for(o=e.getCursor(),s=r.length;o<s;o++){var l=r[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),sE(n,l,a,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}for(var u=0,h=i.length;u<h;u++){var l=i[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),sE(n,l,a,u===h-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,n.restore()}var GH=new yvt,vge=new d3(100),pge=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function vM(n,e){if(n==="none")return null;var t=e.getDevicePixelRatio(),r=e.getZr(),i=r.painter.type==="svg";n.dirty&&GH.delete(n);var a=GH.get(n);if(a)return a;var o=sn(n,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=i?1:1/t,GH.set(n,s),n.dirty=!1,s;function l(u){for(var h=[t],c=!0,f=0;f<pge.length;++f){var d=o[pge[f]];if(d!=null&&!Gt(d)&&!Or(d)&&!ha(d)&&typeof d!="boolean"){c=!1;break}h.push(d)}var v;if(c){v=h.join(",")+(i?"-svg":"");var p=vge.get(v);p&&(i?u.svgElement=p:u.image=p)}var g=XFe(o.dashArrayX),m=Gvt(o.dashArrayY),y=jFe(o.symbol),_=zvt(g),x=YFe(m),S=!i&&s_.createCanvas(),w=i&&{tag:"g",attrs:{},key:"dcl",children:[]},b=T(),E;S&&(S.width=b.width*t,S.height=b.height*t,E=S.getContext("2d")),C(),c&&vge.put(v,S||w),u.image=S,u.svgElement=w,u.svgWidth=b.width,u.svgHeight=b.height;function T(){for(var A=1,M=0,I=_.length;M<I;++M)A=Lve(A,_[M]);for(var R=1,M=0,I=y.length;M<I;++M)R=Lve(R,y[M].length);A*=R;var k=x*_.length*y.length;return{width:Math.max(1,Math.min(A,o.maxTileWidth)),height:Math.max(1,Math.min(k,o.maxTileHeight))}}function C(){E&&(E.clearRect(0,0,S.width,S.height),o.backgroundColor&&(E.fillStyle=o.backgroundColor,E.fillRect(0,0,S.width,S.height)));for(var A=0,M=0;M<m.length;++M)A+=m[M];if(A<=0)return;for(var I=-x,R=0,k=0,D=0;I<b.height;){if(R%2===0){for(var G=k/2%y.length,W=0,z=0,V=0;W<b.width*2;){for(var q=0,M=0;M<g[D].length;++M)q+=g[D][M];if(q<=0)break;if(z%2===0){var Y=(1-o.symbolSize)*.5,le=W+g[D][z]*Y,j=I+m[R]*Y,Q=g[D][z]*o.symbolSize,ie=m[R]*o.symbolSize,oe=V/2%y[G].length;se(le,j,Q,ie,y[G][oe])}W+=g[D][z],++V,++z,z===g[D].length&&(z=0)}++D,D===g.length&&(D=0)}I+=m[R],++k,++R,R===m.length&&(R=0)}function se(me,Ce,Le,re,yt){var je=i?1:t,st=hu(yt,me*je,Ce*je,Le*je,re*je,o.color,o.symbolKeepAspect);if(i){var Nt=r.painter.renderOneToVNode(st);Nt&&w.children.push(Nt)}else HFe(E,st)}}}}function jFe(n){if(!n||n.length===0)return[["rect"]];if(Or(n))return[[n]];for(var e=!0,t=0;t<n.length;++t)if(!Or(n[t])){e=!1;break}if(e)return jFe([n]);for(var r=[],t=0;t<n.length;++t)Or(n[t])?r.push([n[t]]):r.push(n[t]);return r}function XFe(n){if(!n||n.length===0)return[[0,0]];if(ha(n)){var e=Math.ceil(n);return[[e,e]]}for(var t=!0,r=0;r<n.length;++r)if(!ha(n[r])){t=!1;break}if(t)return XFe([n]);for(var i=[],r=0;r<n.length;++r)if(ha(n[r])){var e=Math.ceil(n[r]);i.push([e,e])}else{var e=Vt(n[r],function(s){return Math.ceil(s)});e.length%2===1?i.push(e.concat(e)):i.push(e)}return i}function Gvt(n){if(!n||typeof n=="object"&&n.length===0)return[0,0];if(ha(n)){var e=Math.ceil(n);return[e,e]}var t=Vt(n,function(r){return Math.ceil(r)});return n.length%2?t.concat(t):t}function zvt(n){return Vt(n,function(e){return YFe(e)})}function YFe(n){for(var e=0,t=0;t<n.length;++t)e+=n[t];return n.length%2===1?e*2:e}function Uvt(n,e){n.eachRawSeries(function(t){if(!n.isSeriesFiltered(t)){var r=t.getData();r.hasItemVisual()&&r.each(function(o){var s=r.getItemVisual(o,"decal");if(s){var l=r.ensureUniqueItemVisual(o,"style");l.decal=vM(s,e)}});var i=r.getVisual("decal");if(i){var a=r.getVisual("style");a.decal=vM(i,e)}}})}var Vvt=new ng;const Ng=Vvt;var qFe={};function $vt(n,e){qFe[n]=e}function Wvt(n){return qFe[n]}var Hvt=1,jvt=800,Xvt=900,Yvt=1e3,qvt=2e3,Zvt=5e3,ZFe=1e3,Kvt=1100,Yie=2e3,KFe=3e3,Jvt=4e3,cU=4500,Qvt=4600,ept=5e3,tpt=6e3,JFe=7e3,rpt={PROCESSOR:{FILTER:Yvt,SERIES_FILTER:jvt,STATISTIC:Zvt},VISUAL:{LAYOUT:ZFe,PROGRESSIVE_LAYOUT:Kvt,GLOBAL:Yie,CHART:KFe,POST_CHART_LAYOUT:Qvt,COMPONENT:Jvt,BRUSH:ept,CHART_ITEM:cU,ARIA:tpt,DECAL:JFe}},Cc="__flagInMainProcess",td="__pendingUpdate",zH="__needsUpdateStatus",gge=/^[a-zA-Z0-9_]+$/,UH="__connectUpdateStatus",yge=0,npt=1,ipt=2;function QFe(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.isDisposed()){this.id;return}return t4e(this,n,e)}}function e4e(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return t4e(this,n,e)}}function t4e(n,e,t){return t[0]=t[0]&&t[0].toLowerCase(),ng.prototype[e].apply(n,t)}var r4e=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(ng),n4e=r4e.prototype;n4e.on=e4e("on");n4e.off=e4e("off");var ZT,VH,d4,ox,$H,WH,HH,eP,tP,mge,_ge,jH,xge,v4,Sge,i4e,jv,wge,a4e=function(n){$e(e,n);function e(t,r,i){var a=n.call(this,new hvt)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],i=i||{},Or(r)&&(r=o4e[r]),a._dom=t;var o="canvas",s="auto",l=!1,u=a._zr=Cve(t,{renderer:i.renderer||o,devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,ssr:i.ssr,useDirtyRect:ni(i.useDirtyRect,l),useCoarsePointer:ni(i.useCoarsePointer,s),pointerSize:i.pointerSize});a._ssr=i.ssr,a._throttledZrFlush=Hie(kr(u.flush,u),17),r=Sn(r),r&&cFe(r,!0),a._theme=r,a._locale=yft(i.locale||Bke),a._coordSysMgr=new S3;var h=a._api=Sge(a);function c(f,d){return f.__prio-d.__prio}return xB(xG,c),xB(EJ,c),a._scheduler=new GFe(a,h,EJ,xG),a._messageCenter=new r4e,a._initEvents(),a.resize=kr(a.resize,a),u.animation.on("frame",a._onframe,a),mge(u,a),_ge(u,a),Z8(a),a}return e.prototype._onframe=function(){if(!this._disposed){wge(this);var t=this._scheduler;if(this[td]){var r=this[td].silent;this[Cc]=!0;try{ZT(this),ox.update.call(this,null,this[td].updateParams)}catch(l){throw this[Cc]=!1,this[td]=null,l}this._zr.flush(),this[Cc]=!1,this[td]=null,eP.call(this,r),tP.call(this,r)}else if(t.unfinished){var i=Hvt,a=this._model,o=this._api;t.unfinished=!1;do{var s=+new Date;t.performSeriesTasks(a),t.performDataProcessorTasks(a),WH(this,a),t.performVisualTasks(a),v4(this,this._model,o,"remain",{}),i-=+new Date-s}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,r,i){if(!this[Cc]){if(this._disposed){this.id;return}var a,o,s;if(dn(r)&&(i=r.lazyUpdate,a=r.silent,o=r.replaceMerge,s=r.transition,r=r.notMerge),this[Cc]=!0,!this._model||r){var l=new qft(this._api),u=this._theme,h=this._model=new lFe;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},TJ);var c={seriesTransition:s,optionChanged:!0};if(i)this[td]={silent:a,updateParams:c},this[Cc]=!1,this.getZr().wakeUp();else{try{ZT(this),ox.update.call(this,null,c)}catch(f){throw this[td]=null,this[Cc]=!1,f}this._ssr||this._zr.flush(),this[td]=null,this[Cc]=!1,eP.call(this,a),tP.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||sa.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var r=this._zr.painter;return r.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var r=this._zr.painter;return r.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(!!sa.svgSupported){var t=this._zr,r=t.storage.getDisplayList();return te(r,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var r=t.excludeComponents,i=this._model,a=[],o=this;te(r,function(l){i.eachComponent({mainType:l},function(u){var h=o._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return te(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var r=t.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(bge[i]){var l=s,u=s,h=-s,c=-s,f=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();te(eR,function(_,x){if(_.group===i){var S=r?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(Sn(t)),w=_.getDom().getBoundingClientRect();l=a(w.left,l),u=a(w.top,u),h=o(w.right,h),c=o(w.bottom,c),f.push({dom:S,left:w.left,top:w.top})}}),l*=d,u*=d,h*=d,c*=d;var v=h-l,p=c-u,g=s_.createCanvas(),m=Cve(g,{renderer:r?"svg":"canvas"});if(m.resize({width:v,height:p}),r){var y="";return te(f,function(_){var x=_.left-l,S=_.top-u;y+='<g transform="translate('+x+","+S+')">'+_.dom+"</g>"}),m.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return t.connectedBackgroundColor&&m.add(new ta({shape:{x:0,y:0,width:v,height:p},style:{fill:t.connectedBackgroundColor}})),te(f,function(_){var x=new xc({style:{x:_.left*d-l,y:_.top*d-u,image:_.dom}});m.add(x)}),m.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,r){return $H(this,"convertToPixel",t,r)},e.prototype.convertFromPixel=function(t,r){return $H(this,"convertFromPixel",t,r)},e.prototype.containPixel=function(t,r){if(this._disposed){this.id;return}var i=this._model,a,o=XO(i,t);return te(o,function(s,l){l.indexOf("Models")>=0&&te(s,function(u){var h=u.coordinateSystem;if(h&&h.containPoint)a=a||!!h.containPoint(r);else if(l==="seriesModels"){var c=this._chartsMap[u.__viewId];c&&c.containPoint&&(a=a||c.containPoint(r,u))}},this)},this),!!a},e.prototype.getVisual=function(t,r){var i=this._model,a=XO(i,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?jie(s,l,r):w3(s,r)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;te(apt,function(r){var i=function(a){var o=t.getModel(),s=a.target,l,u=r==="globalout";if(u?l={}:s&&aE(s,function(v){var p=Bn(v);if(p&&p.dataIndex!=null){var g=p.dataModel||o.getSeriesByIndex(p.seriesIndex);return l=g&&g.getDataParams(p.dataIndex,p.dataType,s)||{},!0}else if(p.eventData)return l=Mt({},p.eventData),!0},!0),l){var h=l.componentType,c=l.componentIndex;(h==="markLine"||h==="markPoint"||h==="markArea")&&(h="series",c=l.seriesIndex);var f=h&&c!=null&&o.getComponent(h,c),d=f&&t[f.mainType==="series"?"_chartsMap":"_componentsMap"][f.__viewId];l.event=a,l.type=r,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:f,view:d},t.trigger(r,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(r,i,t)}),te(QO,function(r,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),te(["selectchanged"],function(r){t._messageCenter.on(r,function(i){this.trigger(r,i)},t)}),dvt(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&N3e(this.getDom(),Zie,"");var r=this,i=r._api,a=r._model;te(r._componentsViews,function(o){o.dispose(a,i)}),te(r._chartsViews,function(o){o.dispose(a,i)}),r._zr.dispose(),r._dom=r._model=r._chartsMap=r._componentsMap=r._chartsViews=r._componentsViews=r._scheduler=r._api=r._zr=r._throttledZrFlush=r._theme=r._coordSysMgr=r._messageCenter=null,delete eR[r.id]},e.prototype.resize=function(t){if(!this[Cc]){if(this._disposed){this.id;return}this._zr.resize(t);var r=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!r){var i=r.resetOption("media"),a=t&&t.silent;this[td]&&(a==null&&(a=this[td].silent),i=!0,this[td]=null),this[Cc]=!0;try{i&&ZT(this),ox.update.call(this,{type:"resize",animation:Mt({duration:0},t&&t.animation)})}catch(o){throw this[Cc]=!1,o}this[Cc]=!1,eP.call(this,a),tP.call(this,a)}}},e.prototype.showLoading=function(t,r){if(this._disposed){this.id;return}if(dn(t)&&(r=t,t=""),t=t||"default",this.hideLoading(),!!CJ[t]){var i=CJ[t](this._api,r),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var r=Mt({},t);return r.type=QO[t.type],r},e.prototype.dispatchAction=function(t,r){if(this._disposed){this.id;return}if(dn(r)||(r={silent:!!r}),!!_G[t.type]&&!!this._model){if(this[Cc]){this._pendingActions.push(t);return}var i=r.silent;HH.call(this,t,i);var a=r.flush;a?this._zr.flush():a!==!1&&sa.browser.weChat&&this._throttledZrFlush(),eP.call(this,i),tP.call(this,i)}},e.prototype.updateLabelLayout=function(){Ng.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var r=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(r);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){ZT=function(c){var f=c._scheduler;f.restorePipelines(c._model),f.prepareStageTasks(),VH(c,!0),VH(c,!1),f.plan()},VH=function(c,f){for(var d=c._model,v=c._scheduler,p=f?c._componentsViews:c._chartsViews,g=f?c._componentsMap:c._chartsMap,m=c._zr,y=c._api,_=0;_<p.length;_++)p[_].__alive=!1;f?d.eachComponent(function(w,b){w!=="series"&&x(b)}):d.eachSeries(x);function x(w){var b=w.__requireNewView;w.__requireNewView=!1;var E="_ec_"+w.id+"_"+w.type,T=!b&&g[E];if(!T){var C=ky(w.type),A=f?pl.getClass(C.main,C.sub):os.getClass(C.sub);T=new A,T.init(d,y),g[E]=T,p.push(T),m.add(T.group)}w.__viewId=T.__id=E,T.__alive=!0,T.__model=w,T.group.__ecComponentInfo={mainType:w.mainType,index:w.componentIndex},!f&&v.prepareView(T,w,d,y)}for(var _=0;_<p.length;){var S=p[_];S.__alive?_++:(!f&&S.renderTask.dispose(),m.remove(S.group),S.dispose(d,y),p.splice(_,1),g[S.__id]===S&&delete g[S.__id],S.__id=S.group.__ecComponentInfo=null)}},d4=function(c,f,d,v,p){var g=c._model;if(g.setUpdatePayload(d),!v){te([].concat(c._componentsViews).concat(c._chartsViews),S);return}var m={};m[v+"Id"]=d[v+"Id"],m[v+"Index"]=d[v+"Index"],m[v+"Name"]=d[v+"Name"];var y={mainType:v,query:m};p&&(y.subType=p);var _=d.excludeSeriesId,x;_!=null&&(x=$r(),te(Do(_),function(w){var b=Ru(w,null);b!=null&&x.set(b,!0)})),g&&g.eachComponent(y,function(w){var b=x&&x.get(w.id)!=null;if(!b)if(ipe(d))if(w instanceof Ws)d.type===TE&&!d.notBlur&&!w.get(["emphasis","disabled"])&&uct(w,d,c._api);else{var E=wie(w.mainType,w.componentIndex,d.name,c._api),T=E.focusSelf,C=E.dispatchers;d.type===TE&&T&&!d.notBlur&&oJ(w.mainType,w.componentIndex,c._api),C&&te(C,function(A){d.type===TE?h_(A):c_(A)})}else lJ(d)&&w instanceof Ws&&(fct(w,d,c._api),rpe(w),jv(c))},c),g&&g.eachComponent(y,function(w){var b=x&&x.get(w.id)!=null;b||S(c[v==="series"?"_chartsMap":"_componentsMap"][w.__viewId])},c);function S(w){w&&w.__alive&&w[f]&&w[f](w.__model,g,c._api,d)}},ox={prepareAndUpdate:function(c){ZT(this),ox.update.call(this,c,{optionChanged:c.newOption!=null})},update:function(c,f){var d=this._model,v=this._api,p=this._zr,g=this._coordSysMgr,m=this._scheduler;if(!!d){d.setUpdatePayload(c),m.restoreData(d,c),m.performSeriesTasks(d),g.create(d,v),m.performDataProcessorTasks(d,c),WH(this,d),g.update(d,v),t(d),m.performVisualTasks(d,c),jH(this,d,v,c,f);var y=d.get("backgroundColor")||"transparent",_=d.get("darkMode");p.setBackgroundColor(y),_!=null&&_!=="auto"&&p.setDarkMode(_),Ng.trigger("afterupdate",d,v)}},updateTransform:function(c){var f=this,d=this._model,v=this._api;if(!!d){d.setUpdatePayload(c);var p=[];d.eachComponent(function(m,y){if(m!=="series"){var _=f.getViewOfComponentModel(y);if(_&&_.__alive)if(_.updateTransform){var x=_.updateTransform(y,d,v,c);x&&x.update&&p.push(_)}else p.push(_)}});var g=$r();d.eachSeries(function(m){var y=f._chartsMap[m.__viewId];if(y.updateTransform){var _=y.updateTransform(m,d,v,c);_&&_.update&&g.set(m.uid,1)}else g.set(m.uid,1)}),t(d),this._scheduler.performVisualTasks(d,c,{setDirty:!0,dirtyMap:g}),v4(this,d,v,c,{},g),Ng.trigger("afterupdate",d,v)}},updateView:function(c){var f=this._model;!f||(f.setUpdatePayload(c),os.markUpdateMethod(c,"updateView"),t(f),this._scheduler.performVisualTasks(f,c,{setDirty:!0}),jH(this,f,this._api,c,{}),Ng.trigger("afterupdate",f,this._api))},updateVisual:function(c){var f=this,d=this._model;!d||(d.setUpdatePayload(c),d.eachSeries(function(v){v.getData().clearAllVisual()}),os.markUpdateMethod(c,"updateVisual"),t(d),this._scheduler.performVisualTasks(d,c,{visualType:"visual",setDirty:!0}),d.eachComponent(function(v,p){if(v!=="series"){var g=f.getViewOfComponentModel(p);g&&g.__alive&&g.updateVisual(p,d,f._api,c)}}),d.eachSeries(function(v){var p=f._chartsMap[v.__viewId];p.updateVisual(v,d,f._api,c)}),Ng.trigger("afterupdate",d,this._api))},updateLayout:function(c){ox.update.call(this,c)}},$H=function(c,f,d,v){if(c._disposed){c.id;return}for(var p=c._model,g=c._coordSysMgr.getCoordinateSystems(),m,y=XO(p,d),_=0;_<g.length;_++){var x=g[_];if(x[f]&&(m=x[f](p,y,v))!=null)return m}},WH=function(c,f){var d=c._chartsMap,v=c._scheduler;f.eachSeries(function(p){v.updateStreamModes(p,d[p.__viewId])})},HH=function(c,f){var d=this,v=this.getModel(),p=c.type,g=c.escapeConnect,m=_G[p],y=m.actionInfo,_=(y.update||"update").split(":"),x=_.pop(),S=_[0]!=null&&ky(_[0]);this[Cc]=!0;var w=[c],b=!1;c.batch&&(b=!0,w=Vt(c.batch,function(R){return R=sn(Mt({},R),c),R.batch=null,R}));var E=[],T,C=lJ(c),A=ipe(c);if(A&&ske(this._api),te(w,function(R){if(T=m.action(R,d._model,d._api),T=T||Mt({},R),T.type=y.event||T.type,E.push(T),A){var k=pie(c),D=k.queryOptionMap,G=k.mainTypeSpecified,W=G?D.keys()[0]:"series";d4(d,x,R,W),jv(d)}else C?(d4(d,x,R,"series"),jv(d)):S&&d4(d,x,R,S.main,S.sub)}),x!=="none"&&!A&&!C&&!S)try{this[td]?(ZT(this),ox.update.call(this,c),this[td]=null):ox[x].call(this,c)}catch(R){throw this[Cc]=!1,R}if(b?T={type:y.event||p,escapeConnect:g,batch:E}:T=E[0],this[Cc]=!1,!f){var M=this._messageCenter;if(M.trigger(T.type,T),C){var I={type:"selectchanged",escapeConnect:g,selected:dct(v),isFromClick:c.isFromClick||!1,fromAction:c.type,fromActionPayload:c};M.trigger(I.type,I)}}},eP=function(c){for(var f=this._pendingActions;f.length;){var d=f.shift();HH.call(this,d,c)}},tP=function(c){!c&&this.trigger("updated")},mge=function(c,f){c.on("rendered",function(d){f.trigger("rendered",d),c.animation.isFinished()&&!f[td]&&!f._scheduler.unfinished&&!f._pendingActions.length&&f.trigger("finished")})},_ge=function(c,f){c.on("mouseover",function(d){var v=d.target,p=aE(v,sD);p&&(hct(p,d,f._api),jv(f))}).on("mouseout",function(d){var v=d.target,p=aE(v,sD);p&&(cct(p,d,f._api),jv(f))}).on("click",function(d){var v=d.target,p=aE(v,function(y){return Bn(y).dataIndex!=null},!0);if(p){var g=p.selected?"unselect":"select",m=Bn(p);f._api.dispatchAction({type:g,dataType:m.dataType,dataIndexInside:m.dataIndex,seriesIndex:m.seriesIndex,isFromClick:!0})}})};function t(c){c.clearColorPalette(),c.eachSeries(function(f){f.clearColorPalette()})}function r(c){var f=[],d=[],v=!1;if(c.eachComponent(function(y,_){var x=_.get("zlevel")||0,S=_.get("z")||0,w=_.getZLevelKey();v=v||!!w,(y==="series"?d:f).push({zlevel:x,z:S,idx:_.componentIndex,type:y,key:w})}),v){var p=f.concat(d),g,m;xB(p,function(y,_){return y.zlevel===_.zlevel?y.z-_.z:y.zlevel-_.zlevel}),te(p,function(y){var _=c.getComponent(y.type,y.idx),x=y.zlevel,S=y.key;g!=null&&(x=Math.max(g,x)),S?(x===g&&S!==m&&x++,m=S):m&&(x===g&&x++,m=""),g=x,_.setZLevel(x)})}}jH=function(c,f,d,v,p){r(f),xge(c,f,d,v,p),te(c._chartsViews,function(g){g.__alive=!1}),v4(c,f,d,v,p),te(c._chartsViews,function(g){g.__alive||g.remove(f,d)})},xge=function(c,f,d,v,p,g){te(g||c._componentsViews,function(m){var y=m.__model;u(y,m),m.render(y,f,d,v),s(y,m),h(y,m)})},v4=function(c,f,d,v,p,g){var m=c._scheduler;p=Mt(p||{},{updatedSeries:f.getSeries()}),Ng.trigger("series:beforeupdate",f,d,p);var y=!1;f.eachSeries(function(_){var x=c._chartsMap[_.__viewId];x.__alive=!0;var S=x.renderTask;m.updatePayload(S,v),u(_,x),g&&g.get(_.uid)&&S.dirty(),S.perform(m.getPerformArgs(S))&&(y=!0),x.group.silent=!!_.get("silent"),o(_,x),rpe(_)}),m.unfinished=y||m.unfinished,Ng.trigger("series:layoutlabels",f,d,p),Ng.trigger("series:transition",f,d,p),f.eachSeries(function(_){var x=c._chartsMap[_.__viewId];s(_,x),h(_,x)}),a(c,f),Ng.trigger("series:afterupdate",f,d,p)},jv=function(c){c[zH]=!0,c.getZr().wakeUp()},wge=function(c){!c[zH]||(c.getZr().storage.traverse(function(f){FA(f)||i(f)}),c[zH]=!1)};function i(c){for(var f=[],d=c.currentStates,v=0;v<d.length;v++){var p=d[v];p==="emphasis"||p==="blur"||p==="select"||f.push(p)}c.selected&&c.states.select&&f.push("select"),c.hoverState===qz&&c.states.emphasis?f.push("emphasis"):c.hoverState===g3&&c.states.blur&&f.push("blur"),c.useStates(f)}function a(c,f){var d=c._zr,v=d.storage,p=0;v.traverse(function(g){g.isGroup||p++}),p>f.get("hoverLayerThreshold")&&!sa.node&&!sa.worker&&f.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=c._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(c,f){var d=c.get("blendMode")||null;f.eachRendered(function(v){v.isGroup||(v.style.blend=d)})}function s(c,f){if(!c.preventAutoZ){var d=c.get("z")||0,v=c.get("zlevel")||0;f.eachRendered(function(p){return l(p,d,v,-1/0),!0})}}function l(c,f,d,v){var p=c.getTextContent(),g=c.getTextGuideLine(),m=c.isGroup;if(m)for(var y=c.childrenRef(),_=0;_<y.length;_++)v=Math.max(l(y[_],f,d,v),v);else c.z=f,c.zlevel=d,v=Math.max(c.z2,v);if(p&&(p.z=f,p.zlevel=d,isFinite(v)&&(p.z2=v+2)),g){var x=c.textGuideLineConfig;g.z=f,g.zlevel=d,isFinite(v)&&(g.z2=v+(x&&x.showAbove?1:-1))}return v}function u(c,f){f.eachRendered(function(d){if(!FA(d)){var v=d.getTextContent(),p=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function h(c,f){var d=c.getModel("stateAnimation"),v=c.isAnimationEnabled(),p=d.get("duration"),g=p>0?{duration:p,delay:d.get("delay"),easing:d.get("easing")}:null;f.eachRendered(function(m){if(m.states&&m.states.emphasis){if(FA(m))return;if(m instanceof Si&&mct(m),m.__dirty){var y=m.prevStates;y&&m.useStates(y)}if(v){m.stateTransition=g;var _=m.getTextContent(),x=m.getTextGuideLine();_&&(_.stateTransition=g),x&&(x.stateTransition=g)}m.__dirty&&i(m)}})}Sge=function(c){return new(function(f){$e(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return c._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(v){for(;v;){var p=v.__ecComponentInfo;if(p!=null)return c._model.getComponent(p.mainType,p.index);v=v.parent}},d.prototype.enterEmphasis=function(v,p){h_(v,p),jv(c)},d.prototype.leaveEmphasis=function(v,p){c_(v,p),jv(c)},d.prototype.enterBlur=function(v){nke(v),jv(c)},d.prototype.leaveBlur=function(v){Sie(v),jv(c)},d.prototype.enterSelect=function(v){ike(v),jv(c)},d.prototype.leaveSelect=function(v){ake(v),jv(c)},d.prototype.getModel=function(){return c.getModel()},d.prototype.getViewOfComponentModel=function(v){return c.getViewOfComponentModel(v)},d.prototype.getViewOfSeriesModel=function(v){return c.getViewOfSeriesModel(v)},d}(uFe))(c)},i4e=function(c){function f(d,v){for(var p=0;p<d.length;p++){var g=d[p];g[UH]=v}}te(QO,function(d,v){c._messageCenter.on(v,function(p){if(bge[c.group]&&c[UH]!==yge){if(p&&p.escapeConnect)return;var g=c.makeActionFromEvent(p),m=[];te(eR,function(y){y!==c&&y.group===c.group&&m.push(y)}),f(m,yge),te(m,function(y){y[UH]!==npt&&y.dispatchAction(g)}),f(m,ipt)}})})}}(),e}(ng),qie=a4e.prototype;qie.on=QFe("on");qie.off=QFe("off");qie.one=function(n,e,t){var r=this;function i(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];e&&e.apply&&e.apply(this,a),r.off(n,i)}this.on.call(this,n,i,t)};var apt=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var _G={},QO={},EJ=[],TJ=[],xG=[],o4e={},CJ={},eR={},bge={},opt=+new Date-0,Zie="_echarts_instance_";function spt(n,e,t){var r=!(t&&t.ssr);if(r){var i=lpt(n);if(i)return i}var a=new a4e(n,e,t);return a.id="ec_"+opt++,eR[a.id]=a,r&&N3e(n,Zie,a.id),i4e(a),Ng.trigger("afterinit",a),a}function lpt(n){return eR[nht(n,Zie)]}function s4e(n,e){o4e[n]=e}function l4e(n){gi(TJ,n)<0&&TJ.push(n)}function u4e(n,e){Jie(EJ,n,e,qvt)}function upt(n){Kie("afterinit",n)}function hpt(n){Kie("afterupdate",n)}function Kie(n,e){Ng.on(n,e)}function Lm(n,e,t){rn(e)&&(t=e,e="");var r=dn(n)?n.type:[n,n={event:e}][0];n.event=(n.event||r).toLowerCase(),e=n.event,!QO[e]&&(Bf(gge.test(r)&&gge.test(e)),_G[r]||(_G[r]={action:t,actionInfo:n}),QO[e]=r)}function cpt(n,e){S3.register(n,e)}function fpt(n,e){Jie(xG,n,e,ZFe,"layout")}function q2(n,e){Jie(xG,n,e,KFe,"visual")}var Ege=[];function Jie(n,e,t,r,i){if((rn(e)||dn(e))&&(t=e,e=r),!(gi(Ege,t)>=0)){Ege.push(t);var a=GFe.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,n.push(a)}}function h4e(n,e){CJ[n]=e}function dpt(n,e,t){var r=Wvt("registerMap");r&&r(n,e,t)}var vpt=bdt;q2(Yie,Ydt);q2(cU,qdt);q2(cU,Zdt);q2(Yie,cvt);q2(cU,fvt);q2(JFe,Uvt);l4e(cFe);u4e(Xvt,ndt);h4e("default",Kdt);Lm({type:TE,event:TE,update:TE},Hl);Lm({type:CB,event:CB,update:CB},Hl);Lm({type:YO,event:YO,update:YO},Hl);Lm({type:AB,event:AB,update:AB},Hl);Lm({type:qO,event:qO,update:qO},Hl);s4e("light",lvt);s4e("dark",uvt);var Tge=[],ppt={registerPreprocessor:l4e,registerProcessor:u4e,registerPostInit:upt,registerPostUpdate:hpt,registerUpdateLifecycle:Kie,registerAction:Lm,registerCoordinateSystem:cpt,registerLayout:fpt,registerVisual:q2,registerTransform:vpt,registerLoading:h4e,registerMap:dpt,registerImpl:$vt,PRIORITY:rpt,ComponentModel:oa,ComponentView:pl,SeriesModel:Ws,ChartView:os,registerComponentModel:function(n){oa.registerClass(n)},registerComponentView:function(n){pl.registerClass(n)},registerSeriesModel:function(n){Ws.registerClass(n)},registerChartView:function(n){os.registerClass(n)},registerSubTypeDefaulter:function(n,e){oa.registerSubTypeDefaulter(n,e)},registerPainter:function(n,e){Fut(n,e)}};function _i(n){if(Gt(n)){te(n,function(e){_i(e)});return}gi(Tge,n)>=0||(Tge.push(n),rn(n)&&(n={install:n}),n.install(ppt))}function rP(n){return n==null?0:n.length||1}function Cge(n){return n}var gpt=function(){function n(e,t,r,i,a,o){this._old=e,this._new=t,this._oldKeyGetter=r||Cge,this._newKeyGetter=i||Cge,this.context=a,this._diffModeMultiple=o==="multiple"}return n.prototype.add=function(e){return this._add=e,this},n.prototype.update=function(e){return this._update=e,this},n.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},n.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},n.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},n.prototype.remove=function(e){return this._remove=e,this},n.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},n.prototype._executeOneToOne=function(){var e=this._old,t=this._new,r={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,r,a,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=i[o],l=r[s],u=rP(l);if(u>1){var h=l.shift();l.length===1&&(r[s]=l[0]),this._update&&this._update(h,o)}else u===1?(r[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,r)},n.prototype._executeMultiple=function(){var e=this._old,t=this._new,r={},i={},a=[],o=[];this._initIndexMap(e,r,a,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var s=0;s<a.length;s++){var l=a[s],u=r[l],h=i[l],c=rP(u),f=rP(h);if(c>1&&f===1)this._updateManyToOne&&this._updateManyToOne(h,u),i[l]=null;else if(c===1&&f>1)this._updateOneToMany&&this._updateOneToMany(h,u),i[l]=null;else if(c===1&&f===1)this._update&&this._update(h,u),i[l]=null;else if(c>1&&f>1)this._updateManyToMany&&this._updateManyToMany(h,u),i[l]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(u[d]);else this._remove&&this._remove(u)}this._performRestAdd(o,i)},n.prototype._performRestAdd=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=t[i],o=rP(a);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(a[s]);else o===1&&this._add&&this._add(a);t[i]=null}},n.prototype._initIndexMap=function(e,t,r,i){for(var a=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[i](e[o],o);if(a||(r[o]=s),!!t){var l=t[s],u=rP(l);u===0?(t[s]=o,a&&r.push(s)):u===1?t[s]=[l,o]:l.push(o)}}},n}();const f_=gpt;var ypt=function(){function n(e,t){this._encode=e,this._schema=t}return n.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},n.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},n}();function mpt(n,e){var t={},r=t.encode={},i=$r(),a=[],o=[],s={};te(n.dimensions,function(f){var d=n.getDimensionInfo(f),v=d.coordDim;if(v){var p=d.coordDimIndex;XH(r,v)[p]=f,d.isExtraCoord||(i.set(v,1),_pt(d.type)&&(a[0]=f),XH(s,v)[p]=n.getDimensionIndex(d.name)),d.defaultTooltip&&o.push(f)}eFe.each(function(g,m){var y=XH(r,m),_=d.otherDims[m];_!=null&&_!==!1&&(y[_]=d.name)})});var l=[],u={};i.each(function(f,d){var v=r[d];u[d]=v[0],l=l.concat(v)}),t.dataDimsOnCoord=l,t.dataDimIndicesOnCoord=Vt(l,function(f){return n.getDimensionInfo(f).storeDimIndex}),t.encodeFirstDimNotExtra=u;var h=r.label;h&&h.length&&(a=h.slice());var c=r.tooltip;return c&&c.length?o=c.slice():o.length||(o=a.slice()),r.defaultedLabel=a,r.defaultedTooltip=o,t.userOutput=new ypt(s,e),t}function XH(n,e){return n.hasOwnProperty(e)||(n[e]=[]),n[e]}function SG(n){return n==="category"?"ordinal":n==="time"?"time":"float"}function _pt(n){return!(n==="ordinal"||n==="time")}var xpt=function(){function n(e){this.otherDims={},e!=null&&Mt(this,e)}return n}();const OB=xpt;var Spt=na(),wpt={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},c4e=function(){function n(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return n.prototype.isDimensionOmitted=function(){return this._dimOmitted},n.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=v4e(this.source)))},n.prototype.getSourceDimensionIndex=function(e){return ni(this._dimNameMap.get(e),-1)},n.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},n.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=dFe(this.source),r=!p4e(e),i="",a=[],o=0,s=0;o<e;o++){var l=void 0,u=void 0,h=void 0,c=this.dimensions[s];if(c&&c.storeDimIndex===o)l=t?c.name:null,u=c.type,h=c.ordinalMeta,s++;else{var f=this.getSourceDimension(o);f&&(l=t?f.name:null,u=f.type)}a.push({property:l,type:u,ordinalMeta:h}),t&&l!=null&&(!c||!c.isCalculationCoord)&&(i+=r?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),i+="$",i+=wpt[u]||"f",h&&(i+=h.uid),i+="$"}var d=this.source,v=[d.seriesLayoutBy,d.startIndex,i].join("$$");return{dimensions:a,hash:v}},n.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,r=0;t<this._fullDimCount;t++){var i=void 0,a=this.dimensions[r];if(a&&a.storeDimIndex===t)a.isCalculationCoord||(i=a.name),r++;else{var o=this.getSourceDimension(t);o&&(i=o.name)}e.push(i)}return e},n.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},n}();function f4e(n){return n instanceof c4e}function d4e(n){for(var e=$r(),t=0;t<(n||[]).length;t++){var r=n[t],i=dn(r)?r.name:r;i!=null&&e.get(i)==null&&e.set(i,t)}return e}function v4e(n){var e=Spt(n);return e.dimNameMap||(e.dimNameMap=d4e(n.dimensionsDefine))}function p4e(n){return n>30}var nP=dn,sx=Vt,bpt=typeof Int32Array>"u"?Array:Int32Array,Ept="e\0\0",Age=-1,Tpt=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Cpt=["_approximateExtent"],Mge,p4,iP,aP,YH,g4,qH,Apt=function(){function n(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var r,i=!1;f4e(e)?(r=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,r=e),r=r||["x","y"];for(var a={},o=[],s={},l=!1,u={},h=0;h<r.length;h++){var c=r[h],f=Or(c)?new OB({name:c}):c instanceof OB?c:new OB(c),d=f.name;f.type=f.type||"float",f.coordDim||(f.coordDim=d,f.coordDimIndex=0);var v=f.otherDims=f.otherDims||{};o.push(d),a[d]=f,u[d]!=null&&(l=!0),f.createInvertedIndices&&(s[d]=[]),v.itemName===0&&(this._nameDimIdx=h),v.itemId===0&&(this._idDimIdx=h),i&&(f.storeDimIndex=h)}if(this.dimensions=o,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=t,this._invertedIndicesMap=s,this._dimOmitted){var p=this._dimIdxToName=$r();te(o,function(g){p.set(a[g].storeDimIndex,g)})}}return n.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var r=this._dimIdxToName.get(t);if(r!=null)return r;var i=this._schema.getSourceDimension(t);if(i)return i.name},n.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var r=this._getDimInfo(e);return r?r.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},n.prototype._recognizeDimIndex=function(e){if(ha(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},n.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);return t},n.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},n.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(r){return t.hasOwnProperty(r)?t[r]:void 0}:function(r){return t[r]}},n.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},n.prototype.mapDimension=function(e,t){var r=this._dimSummary;if(t==null)return r.encodeFirstDimNotExtra[e];var i=r.encode[e];return i?i[t]:null},n.prototype.mapDimensionsAll=function(e){var t=this._dimSummary,r=t.encode[e];return(r||[]).slice()},n.prototype.getStore=function(){return this._store},n.prototype.initData=function(e,t,r){var i=this,a;if(e instanceof yJ&&(a=e),!a){var o=this.dimensions,s=Bie(e)||Yc(e)?new vFe(e,o.length):e;a=new yJ;var l=sx(o,function(u){return{type:i._dimInfos[u].type,property:u}});a.initData(s,l,r)}this._store=a,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=mpt(this,this._schema),this.userOutput=this._dimSummary.userOutput},n.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},n.prototype.appendValues=function(e,t){var r=this._store.appendValues(e,t.length),i=r.start,a=r.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var s=i;s<a;s++){var l=s-i;this._nameList[s]=t[l],o&&qH(this,s)}},n.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,r=0;r<t.length;r++){var i=this._dimInfos[t[r]];i.ordinalMeta&&e.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},n.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==mS&&!e.fillStorage},n.prototype._doInit=function(e,t){if(!(e>=t)){var r=this._store,i=r.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===ig;if(l&&!i.pure)for(var u=[],h=e;h<t;h++){var c=i.getItem(h,u);if(!this.hasItemOption&&Wut(c)&&(this.hasItemOption=!0),c){var f=c.name;a[h]==null&&f!=null&&(a[h]=Ru(f,null));var d=c.id;o[h]==null&&d!=null&&(o[h]=Ru(d,null))}}if(this._shouldMakeIdFromName())for(var h=e;h<t;h++)qH(this,h);Mge(this)}},n.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},n.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},n.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},n.prototype.setCalculationInfo=function(e,t){nP(e)?Mt(this._calculationInfo,e):this._calculationInfo[e]=t},n.prototype.getName=function(e){var t=this.getRawIndex(e),r=this._nameList[t];return r==null&&this._nameDimIdx!=null&&(r=iP(this,this._nameDimIdx,t)),r==null&&(r=""),r},n.prototype._getCategory=function(e,t){var r=this._store.get(e,t),i=this._store.getOrdinalMeta(e);return i?i.categories[r]:r},n.prototype.getId=function(e){return p4(this,this.getRawIndex(e))},n.prototype.count=function(){return this._store.count()},n.prototype.get=function(e,t){var r=this._store,i=this._dimInfos[e];if(i)return r.get(i.storeDimIndex,t)},n.prototype.getByRawIndex=function(e,t){var r=this._store,i=this._dimInfos[e];if(i)return r.getByRawIndex(i.storeDimIndex,t)},n.prototype.getIndices=function(){return this._store.getIndices()},n.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},n.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},n.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},n.prototype.getValues=function(e,t){var r=this,i=this._store;return Gt(e)?i.getValues(sx(e,function(a){return r._getStoreDimIndex(a)}),t):i.getValues(e)},n.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,r=0,i=t.length;r<i;r++)if(isNaN(this._store.get(t[r],e)))return!1;return!0},n.prototype.indexOfName=function(e){for(var t=0,r=this._store.count();t<r;t++)if(this.getName(t)===e)return t;return-1},n.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},n.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},n.prototype.rawIndexOf=function(e,t){var r=e&&this._invertedIndicesMap[e],i=r[t];return i==null||isNaN(i)?Age:i},n.prototype.indicesOfNearest=function(e,t,r){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,r)},n.prototype.each=function(e,t,r){rn(e)&&(r=t,t=e,e=[]);var i=r||this,a=sx(aP(e),this._getStoreDimIndex,this);this._store.each(a,i?kr(t,i):t)},n.prototype.filterSelf=function(e,t,r){rn(e)&&(r=t,t=e,e=[]);var i=r||this,a=sx(aP(e),this._getStoreDimIndex,this);return this._store=this._store.filter(a,i?kr(t,i):t),this},n.prototype.selectRange=function(e){var t=this,r={},i=Li(e);return te(i,function(a){var o=t._getStoreDimIndex(a);r[o]=e[a]}),this._store=this._store.selectRange(r),this},n.prototype.mapArray=function(e,t,r){rn(e)&&(r=t,t=e,e=[]),r=r||this;var i=[];return this.each(e,function(){i.push(t&&t.apply(this,arguments))},r),i},n.prototype.map=function(e,t,r,i){var a=r||i||this,o=sx(aP(e),this._getStoreDimIndex,this),s=g4(this);return s._store=this._store.map(o,a?kr(t,a):t),s},n.prototype.modify=function(e,t,r,i){var a=r||i||this,o=sx(aP(e),this._getStoreDimIndex,this);this._store.modify(o,a?kr(t,a):t)},n.prototype.downSample=function(e,t,r,i){var a=g4(this);return a._store=this._store.downSample(this._getStoreDimIndex(e),t,r,i),a},n.prototype.lttbDownSample=function(e,t){var r=g4(this);return r._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),r},n.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},n.prototype.getItemModel=function(e){var t=this.hostModel,r=this.getRawDataItem(e);return new as(r,t,t&&t.ecModel)},n.prototype.diff=function(e){var t=this;return new f_(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(r){return p4(e,r)},function(r){return p4(t,r)})},n.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},n.prototype.setVisual=function(e,t){this._visual=this._visual||{},nP(e)?Mt(this._visual,e):this._visual[e]=t},n.prototype.getItemVisual=function(e,t){var r=this._itemVisuals[e],i=r&&r[t];return i==null?this.getVisual(t):i},n.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},n.prototype.ensureUniqueItemVisual=function(e,t){var r=this._itemVisuals,i=r[e];i||(i=r[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),Gt(a)?a=a.slice():nP(a)&&(a=Mt({},a)),i[t]=a),a},n.prototype.setItemVisual=function(e,t,r){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,nP(t)?Mt(i,t):i[t]=r},n.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},n.prototype.setLayout=function(e,t){nP(e)?Mt(this._layout,e):this._layout[e]=t},n.prototype.getLayout=function(e){return this._layout[e]},n.prototype.getItemLayout=function(e){return this._itemLayouts[e]},n.prototype.setItemLayout=function(e,t,r){this._itemLayouts[e]=r?Mt(this._itemLayouts[e]||{},t):t},n.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},n.prototype.setItemGraphicEl=function(e,t){var r=this.hostModel&&this.hostModel.seriesIndex;iJ(r,this.dataType,e,t),this._graphicEls[e]=t},n.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},n.prototype.eachItemGraphicEl=function(e,t){te(this._graphicEls,function(r,i){r&&e&&e.call(t,r,i)})},n.prototype.cloneShallow=function(e){return e||(e=new n(this._schema?this._schema:sx(this.dimensions,this._getDimInfo,this),this.hostModel)),YH(e,this),e._store=this._store,e},n.prototype.wrapMethod=function(e,t){var r=this[e];!rn(r)||(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=r.apply(this,arguments);return t.apply(this,[i].concat(iie(arguments)))})},n.internalField=function(){Mge=function(e){var t=e._invertedIndicesMap;te(t,function(r,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){r=t[i]=new bpt(o.categories.length);for(var l=0;l<r.length;l++)r[l]=Age;for(var l=0;l<s.count();l++)r[s.get(a.storeDimIndex,l)]=l}})},iP=function(e,t,r){return Ru(e._getCategory(t,r),null)},p4=function(e,t){var r=e._idList[t];return r==null&&e._idDimIdx!=null&&(r=iP(e,e._idDimIdx,t)),r==null&&(r=Ept+t),r},aP=function(e){return Gt(e)||(e=e!=null?[e]:[]),e},g4=function(e){var t=new n(e._schema?e._schema:sx(e.dimensions,e._getDimInfo,e),e.hostModel);return YH(t,e),t},YH=function(e,t){te(Tpt.concat(t.__wrappedMethods||[]),function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e.__wrappedMethods=t.__wrappedMethods,te(Cpt,function(r){e[r]=Sn(t[r])}),e._calculationInfo=Mt({},t._calculationInfo)},qH=function(e,t){var r=e._nameList,i=e._idList,a=e._nameDimIdx,o=e._idDimIdx,s=r[t],l=i[t];if(s==null&&a!=null&&(r[t]=s=iP(e,a,t)),l==null&&o!=null&&(i[t]=l=iP(e,o,t)),l==null&&s!=null){var u=e._nameRepeatCount,h=u[s]=(u[s]||0)+1;l=s,h>1&&(l+="__ec__"+h),i[t]=l}}}(),n}();const Df=Apt;function b3(n,e){Bie(n)||(n=Gie(n)),e=e||{};var t=e.coordDimensions||[],r=e.dimensionsDefine||n.dimensionsDefine||[],i=$r(),a=[],o=Ipt(n,t,r,e.dimensionsCount),s=e.canOmitUnusedDimensions&&p4e(o),l=r===n.dimensionsDefine,u=l?v4e(n):d4e(r),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(n,o));for(var c=$r(h),f=new wFe(o),d=0;d<f.length;d++)f[d]=-1;function v(T){var C=f[T];if(C<0){var A=r[T],M=dn(A)?A:{name:A},I=new OB,R=M.name;R!=null&&u.get(R)!=null&&(I.name=I.displayName=R),M.type!=null&&(I.type=M.type),M.displayName!=null&&(I.displayName=M.displayName);var k=a.length;return f[T]=k,I.storeDimIndex=T,a.push(I),I}return a[C]}if(!s)for(var d=0;d<o;d++)v(d);c.each(function(T,C){var A=Do(T).slice();if(A.length===1&&!Or(A[0])&&A[0]<0){c.set(C,!1);return}var M=c.set(C,[]);te(A,function(I,R){var k=Or(I)?u.get(I):I;k!=null&&k<o&&(M[R]=k,g(v(k),C,R))})});var p=0;te(t,function(T){var C,A,M,I;if(Or(T))C=T,I={};else{I=T,C=I.name;var R=I.ordinalMeta;I.ordinalMeta=null,I=Mt({},I),I.ordinalMeta=R,A=I.dimsDef,M=I.otherDims,I.name=I.coordDim=I.coordDimIndex=I.dimsDef=I.otherDims=null}var k=c.get(C);if(k!==!1){if(k=Do(k),!k.length)for(var D=0;D<(A&&A.length||1);D++){for(;p<o&&v(p).coordDim!=null;)p++;p<o&&k.push(p++)}te(k,function(G,W){var z=v(G);if(l&&I.type!=null&&(z.type=I.type),g(sn(z,I),C,W),z.name==null&&A){var V=A[W];!dn(V)&&(V={name:V}),z.name=z.displayName=V.name,z.defaultTooltip=V.defaultTooltip}M&&sn(z.otherDims,M)})}});function g(T,C,A){eFe.get(C)!=null?T.otherDims[C]=A:(T.coordDim=C,T.coordDimIndex=A,i.set(C,!0))}var m=e.generateCoord,y=e.generateCoordCount,_=y!=null;y=m?y||1:0;var x=m||"value";function S(T){T.name==null&&(T.name=T.coordDim)}if(s)te(a,function(T){S(T)}),a.sort(function(T,C){return T.storeDimIndex-C.storeDimIndex});else for(var w=0;w<o;w++){var b=v(w),E=b.coordDim;E==null&&(b.coordDim=Lpt(x,i,_),b.coordDimIndex=0,(!m||y<=0)&&(b.isExtraCoord=!0),y--),S(b),b.type==null&&(iFe(n,w)===nc.Must||b.isExtraCoord&&(b.otherDims.itemName!=null||b.otherDims.seriesName!=null))&&(b.type="ordinal")}return Mpt(a),new c4e({source:n,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function Mpt(n){for(var e=$r(),t=0;t<n.length;t++){var r=n[t],i=r.name,a=e.get(i)||0;a>0&&(r.name=i+(a-1)),a++,e.set(i,a)}}function Ipt(n,e,t,r){var i=Math.max(n.dimensionsDetectedCount||1,e.length,t.length,r||0);return te(e,function(a){var o;dn(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function Lpt(n,e,t){if(t||e.hasKey(n)){for(var r=0;e.hasKey(n+r);)r++;n+=r}return e.set(n,!0),n}var Ppt=function(){function n(e){this.coordSysDims=[],this.axisMap=$r(),this.categoryAxisMap=$r(),this.coordSysName=e}return n}();function Opt(n){var e=n.get("coordinateSystem"),t=new Ppt(e),r=Rpt[e];if(r)return r(n,t,t.axisMap,t.categoryAxisMap),t}var Rpt={cartesian2d:function(n,e,t,r){var i=n.getReferringComponents("xAxis",uu).models[0],a=n.getReferringComponents("yAxis",uu).models[0];e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),KT(i)&&(r.set("x",i),e.firstCategoryDimIndex=0),KT(a)&&(r.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(n,e,t,r){var i=n.getReferringComponents("singleAxis",uu).models[0];e.coordSysDims=["single"],t.set("single",i),KT(i)&&(r.set("single",i),e.firstCategoryDimIndex=0)},polar:function(n,e,t,r){var i=n.getReferringComponents("polar",uu).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),KT(a)&&(r.set("radius",a),e.firstCategoryDimIndex=0),KT(o)&&(r.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(n,e,t,r){e.coordSysDims=["lng","lat"]},parallel:function(n,e,t,r){var i=n.ecModel,a=i.getComponent("parallel",n.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();te(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),h=o[l];t.set(h,u),KT(u)&&(r.set(h,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function KT(n){return n.get("type")==="category"}function Dpt(n,e,t){t=t||{};var r=t.byIndex,i=t.stackedCoordDimension,a,o,s;Npt(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(n&&n.get("stack")),u,h,c,f;if(te(a,function(y,_){Or(y)&&(a[_]=y={name:y}),l&&!y.isExtraCoord&&(!r&&!u&&y.ordinalMeta&&(u=y),!h&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(h=y))}),h&&!r&&!u&&(r=!0),h){c="__\0ecstackresult_"+n.id,f="__\0ecstackedover_"+n.id,u&&(u.createInvertedIndices=!0);var d=h.coordDim,v=h.type,p=0;te(a,function(y){y.coordDim===d&&p++});var g={name:c,coordDim:d,coordDimIndex:p,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:f,coordDim:f,coordDimIndex:p+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(f,v),m.storeDimIndex=s.ensureCalculationDimension(c,v)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:c}}function Npt(n){return!f4e(n.schema)}function FS(n,e){return!!e&&e===n.getCalculationInfo("stackedDimension")}function g4e(n,e){return FS(n,e)?n.getCalculationInfo("stackResultDimension"):e}function kpt(n,e){var t=n.get("coordinateSystem"),r=S3.get(t),i;return e&&e.coordSysDims&&(i=Vt(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=SG(l)}return o})),i||(i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}function Fpt(n,e,t){var r,i;return t&&te(n,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(r==null&&(r=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(n[r].otherDims.itemName=0),r}function k_(n,e,t){t=t||{};var r=e.getSourceManager(),i,a=!1;n?(a=!0,i=Gie(n)):(i=r.getSource(),a=i.sourceFormat===ig);var o=Opt(e),s=kpt(e,o),l=t.useEncodeDefaulter,u=rn(l)?l:l?Un(nFe,s,e):null,h={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},c=b3(i,h),f=Fpt(c.dimensions,t.createInvertedIndices,o),d=a?null:r.getSharedDataStore(c),v=Dpt(e,{schema:c,store:d}),p=new Df(c,e);p.setCalculationInfo(v);var g=f!=null&&Bpt(i)?function(m,y,_,x){return x===f?_:this.defaultDimValueGetter(m,y,_,x)}:null;return p.hasItemOption=!1,p.initData(a?i:d,null,g),p}function Bpt(n){if(n.sourceFormat===ig){var e=Gpt(n.data||[]);return!Gt(PI(e))}}function Gpt(n){for(var e=0;e<n.length&&n[e]==null;)e++;return n[e]}var y4e=function(){function n(e){this._setting=e||{},this._extent=[1/0,-1/0]}return n.prototype.getSetting=function(e){return this._setting[e]},n.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},n.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.setExtent=function(e,t){var r=this._extent;isNaN(e)||(r[0]=e),isNaN(t)||(r[1]=t)},n.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},n.prototype.isBlank=function(){return this._isBlank},n.prototype.setBlank=function(e){this._isBlank=e},n}();Hz(y4e);const F_=y4e;var zpt=0,Upt=function(){function n(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++zpt}return n.createByAxisModel=function(e){var t=e.option,r=t.data,i=r&&Vt(r,Vpt);return new n({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},n.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},n.prototype.parseAndCollect=function(e){var t,r=this._needCollect;if(!Or(e)&&!r)return e;if(r&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(r?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},n.prototype._getOrCreateMap=function(){return this._map||(this._map=$r(this.categories))},n}();function Vpt(n){return dn(n)&&n.value!=null?n.value:n+""}const AJ=Upt;function MJ(n){return n.type==="interval"||n.type==="log"}function $pt(n,e,t,r){var i={},a=n[1]-n[0],o=i.interval=A3e(a/e,!0);t!=null&&o<t&&(o=i.interval=t),r!=null&&o>r&&(o=i.interval=r);var s=i.intervalPrecision=m4e(o),l=i.niceTickExtent=[Pl(Math.ceil(n[0]/o)*o,s),Pl(Math.floor(n[1]/o)*o,s)];return Wpt(l,n),i}function ZH(n){var e=Math.pow(10,die(n)),t=n/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Pl(t*e)}function m4e(n){return Ny(n)+2}function Ige(n,e,t){n[e]=Math.max(Math.min(n[e],t[1]),t[0])}function Wpt(n,e){!isFinite(n[0])&&(n[0]=e[0]),!isFinite(n[1])&&(n[1]=e[1]),Ige(n,0,e),Ige(n,1,e),n[0]>n[1]&&(n[0]=n[1])}function fU(n,e){return n>=e[0]&&n<=e[1]}function dU(n,e){return e[1]===e[0]?.5:(n-e[0])/(e[1]-e[0])}function vU(n,e){return n*(e[1]-e[0])+e[0]}var _4e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;r.type="ordinal";var i=r.getSetting("ordinalMeta");return i||(i=new AJ({})),Gt(i)&&(i=new AJ({categories:Vt(i,function(a){return dn(a)?a.value:a})})),r._ordinalMeta=i,r._extent=r.getSetting("extent")||[0,i.categories.length-1],r}return e.prototype.parse=function(t){return t==null?NaN:Or(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),fU(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),dU(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(vU(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],r=this._extent,i=r[0];i<=r[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var r=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,r.length);o<l;++o){var u=r[o];i[o]=u,a[u]=o}for(var h=0;o<s;++o){for(;a[h]!=null;)h++;i.push(h),a[h]=o}},e.prototype._getTickNumber=function(t){var r=this._ticksByOrdinalNumber;return r&&t>=0&&t<r.length?r[t]:t},e.prototype.getRawOrdinalNumber=function(t){var r=this._ordinalNumbersByTick;return r&&t>=0&&t<r.length?r[t]:t},e.prototype.getLabel=function(t){if(!this.isBlank()){var r=this.getRawOrdinalNumber(t.value),i=this._ordinalMeta.categories[r];return i==null?"":i+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(t,r){this.unionExtent(t.getApproximateExtent(r))},e.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(F_);F_.registerClass(_4e);const Qie=_4e;var ub=Pl,x4e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return fU(t,this._extent)},e.prototype.normalize=function(t){return dU(t,this._extent)},e.prototype.scale=function(t){return vU(t,this._extent)},e.prototype.setExtent=function(t,r){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(r)||(i[1]=parseFloat(r))},e.prototype.unionExtent=function(t){var r=this._extent;t[0]<r[0]&&(r[0]=t[0]),t[1]>r[1]&&(r[1]=t[1]),this.setExtent(r[0],r[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=m4e(t)},e.prototype.getTicks=function(t){var r=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!r)return s;var l=1e4;i[0]<a[0]&&(t?s.push({value:ub(a[0]-r,o)}):s.push({value:i[0]}));for(var u=a[0];u<=a[1]&&(s.push({value:u}),u=ub(u+r,o),u!==s[s.length-1].value);)if(s.length>l)return[];var h=s.length?s[s.length-1].value:a[1];return i[1]>h&&(t?s.push({value:ub(h+r,o)}):s.push({value:i[1]})),s},e.prototype.getMinorTicks=function(t){for(var r=this.getTicks(!0),i=[],a=this.getExtent(),o=1;o<r.length;o++){for(var s=r[o],l=r[o-1],u=0,h=[],c=s.value-l.value,f=c/t;u<t-1;){var d=ub(l.value+(u+1)*f);d>a[0]&&d<a[1]&&h.push(d),u++}i.push(h)}return i},e.prototype.getLabel=function(t,r){if(t==null)return"";var i=r&&r.precision;i==null?i=Ny(t.value)||0:i==="auto"&&(i=this._intervalPrecision);var a=ub(t.value,i,!0);return Yke(a)},e.prototype.calcNiceTicks=function(t,r,i){t=t||5;var a=this._extent,o=a[1]-a[0];if(!!isFinite(o)){o<0&&(o=-o,a.reverse());var s=$pt(a,t,r,i);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var r=this._extent;if(r[0]===r[1])if(r[0]!==0){var i=Math.abs(r[0]);t.fixMax||(r[1]+=i/2),r[0]-=i/2}else r[1]=1;var a=r[1]-r[0];isFinite(a)||(r[0]=0,r[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var o=this._interval;t.fixMin||(r[0]=ub(Math.floor(r[0]/o)*o)),t.fixMax||(r[1]=ub(Math.ceil(r[1]/o)*o))},e.prototype.setNiceExtent=function(t,r){this._niceExtent=[t,r]},e.type="interval",e}(F_);F_.registerClass(x4e);const BS=x4e;var S4e=typeof Float32Array<"u",Hpt=S4e?Float32Array:Array;function Fy(n){return Gt(n)?S4e?new Float32Array(n):n:new Hpt(n)}var IJ="__ec_stack_";function eae(n){return n.get("stack")||IJ+n.seriesIndex}function tae(n){return n.dim+n.index}function jpt(n){var e=[],t=n.axis,r="axis0";if(t.type==="category"){for(var i=t.getBandWidth(),a=0;a<n.count;a++)e.push(sn({bandWidth:i,axisKey:r,stackId:IJ+a},n));for(var o=E4e(e),s=[],a=0;a<n.count;a++){var l=o[r][IJ+a];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}function w4e(n,e){var t=[];return e.eachSeriesByType(n,function(r){A4e(r)&&t.push(r)}),t}function Xpt(n){var e={};te(n,function(l){var u=l.coordinateSystem,h=u.getBaseAxis();if(!(h.type!=="time"&&h.type!=="value"))for(var c=l.getData(),f=h.dim+"_"+h.index,d=c.getDimensionIndex(c.mapDimension(h.dim)),v=c.getStore(),p=0,g=v.count();p<g;++p){var m=v.get(d,p);e[f]?e[f].push(m):e[f]=[m]}});var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(i){i.sort(function(l,u){return l-u});for(var a=null,o=1;o<i.length;++o){var s=i[o]-i[o-1];s>0&&(a=a===null?s:Math.min(a,s))}t[r]=a}}return t}function b4e(n){var e=Xpt(n),t=[];return te(n,function(r){var i=r.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],h=Math.abs(o[1]-o[0]),c=a.scale.getExtent(),f=Math.abs(c[1]-c[0]);s=u?h/f*u:h}else{var d=r.getData();s=Math.abs(o[1]-o[0])/d.count()}var v=xr(r.get("barWidth"),s),p=xr(r.get("barMaxWidth"),s),g=xr(r.get("barMinWidth")||(M4e(r)?.5:1),s),m=r.get("barGap"),y=r.get("barCategoryGap");t.push({bandWidth:s,barWidth:v,barMaxWidth:p,barMinWidth:g,barGap:m,barCategoryGap:y,axisKey:tae(a),stackId:eae(r)})}),E4e(t)}function E4e(n){var e={};te(n,function(r,i){var a=r.axisKey,o=r.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=r.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=r.barWidth;h&&!l[u].width&&(l[u].width=h,h=Math.min(s.remainedWidth,h),s.remainedWidth-=h);var c=r.barMaxWidth;c&&(l[u].maxWidth=c);var f=r.barMinWidth;f&&(l[u].minWidth=f);var d=r.barGap;d!=null&&(s.gap=d);var v=r.barCategoryGap;v!=null&&(s.categoryGap=v)});var t={};return te(e,function(r,i){t[i]={};var a=r.stacks,o=r.bandWidth,s=r.categoryGap;if(s==null){var l=Li(a).length;s=Math.max(35-l*4,15)+"%"}var u=xr(s,o),h=xr(r.gap,1),c=r.remainedWidth,f=r.autoWidthCount,d=(c-u)/(f+(f-1)*h);d=Math.max(d,0),te(a,function(m){var y=m.maxWidth,_=m.minWidth;if(m.width){var x=m.width;y&&(x=Math.min(x,y)),_&&(x=Math.max(x,_)),m.width=x,c-=x+h*x,f--}else{var x=d;y&&y<x&&(x=Math.min(y,c)),_&&_>x&&(x=_),x!==d&&(m.width=x,c-=x+h*x,f--)}}),d=(c-u)/(f+(f-1)*h),d=Math.max(d,0);var v=0,p;te(a,function(m,y){m.width||(m.width=d),p=m,v+=m.width*(1+h)}),p&&(v-=p.width*h);var g=-v/2;te(a,function(m,y){t[i][y]=t[i][y]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+h)})}),t}function Ypt(n,e,t){if(n&&e){var r=n[tae(e)];return r!=null&&t!=null?r[eae(t)]:r}}function T4e(n,e){var t=w4e(n,e),r=b4e(t);te(t,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=eae(i),u=r[tae(s)][l],h=u.offset,c=u.width;a.setLayout({bandWidth:u.bandWidth,offset:h,size:c})})}function C4e(n){return{seriesType:n,plan:UI(),reset:function(e){if(!!A4e(e)){var t=e.getData(),r=e.coordinateSystem,i=r.getBaseAxis(),a=r.getOtherAxis(i),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),h=t.getCalculationInfo("stackResultDimension"),c=FS(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),d=qpt(i,a),v=M4e(e),p=e.get("barMinHeight")||0,g=h&&t.getDimensionIndex(h),m=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(_,x){for(var S=_.count,w=v&&Fy(S*3),b=v&&l&&Fy(S*3),E=v&&Fy(S),T=r.master.getRect(),C=f?T.width:T.height,A,M=x.getStore(),I=0;(A=_.next())!=null;){var R=M.get(c?g:o,A),k=M.get(s,A),D=d,G=void 0;c&&(G=+R-M.get(o,A));var W=void 0,z=void 0,V=void 0,q=void 0;if(f){var Y=r.dataToPoint([R,k]);if(c){var le=r.dataToPoint([G,k]);D=le[0]}W=D,z=Y[1]+y,V=Y[0]-D,q=m,Math.abs(V)<p&&(V=(V<0?-1:1)*p)}else{var Y=r.dataToPoint([k,R]);if(c){var le=r.dataToPoint([k,G]);D=le[1]}W=Y[0]+y,z=D,V=m,q=Y[1]-D,Math.abs(q)<p&&(q=(q<=0?-1:1)*p)}v?(w[I]=W,w[I+1]=z,w[I+2]=f?V:q,b&&(b[I]=f?T.x:W,b[I+1]=f?z:T.y,b[I+2]=C),E[A]=A):x.setItemLayout(A,{x:W,y:z,width:V,height:q}),I+=3}v&&x.setLayout({largePoints:w,largeDataIndices:E,largeBackgroundPoints:b,valueAxisHorizontal:f})}}}}}}function A4e(n){return n.coordinateSystem&&n.coordinateSystem.type==="cartesian2d"}function M4e(n){return n.pipelineContext&&n.pipelineContext.large}function qpt(n,e){return e.toGlobalCoord(e.dataToCoord(e.type==="log"?1:0))}var Zpt=function(n,e,t,r){for(;t<r;){var i=t+r>>>1;n[i][1]<e?t=i+1:r=i}return t},I4e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="time",r}return e.prototype.getLabel=function(t){var r=this.getSetting("useUTC");return rU(t.value,_pe[xft(BA(this._minLevelUnit))]||_pe.second,r,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,r,i){var a=this.getSetting("useUTC"),o=this.getSetting("locale");return Sft(t,r,i,o,a)},e.prototype.getTicks=function(){var t=this._interval,r=this._extent,i=[];if(!t)return i;i.push({value:r[0],level:0});var a=this.getSetting("useUTC"),o=ngt(this._minLevelUnit,this._approxInterval,a,r);return i=i.concat(o),i.push({value:r[1],level:0}),i},e.prototype.calcNiceExtent=function(t){var r=this._extent;if(r[0]===r[1]&&(r[0]-=Ap,r[1]+=Ap),r[1]===-1/0&&r[0]===1/0){var i=new Date;r[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),r[0]=r[1]-Ap}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},e.prototype.calcNiceTicks=function(t,r,i){t=t||10;var a=this._extent,o=a[1]-a[0];this._approxInterval=o/t,r!=null&&this._approxInterval<r&&(this._approxInterval=r),i!=null&&this._approxInterval>i&&(this._approxInterval=i);var s=y4.length,l=Math.min(Zpt(y4,this._approxInterval,0,s),s-1);this._interval=y4[l][1],this._minLevelUnit=y4[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return ha(t)?t:+um(t)},e.prototype.contain=function(t){return fU(this.parse(t),this._extent)},e.prototype.normalize=function(t){return dU(this.parse(t),this._extent)},e.prototype.scale=function(t){return vU(t,this._extent)},e.type="time",e}(BS),y4=[["second",Pie],["minute",Oie],["hour",KO],["quarter-day",KO*6],["half-day",KO*12],["day",Ap*1.2],["half-week",Ap*3.5],["week",Ap*7],["month",Ap*31],["quarter",Ap*95],["half-year",mpe/2],["year",mpe]];function Kpt(n,e,t,r){var i=um(e),a=um(t),o=function(v){return xpe(i,v,r)===xpe(a,v,r)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},h=function(){return u()&&o("hour")},c=function(){return h()&&o("minute")},f=function(){return c()&&o("second")},d=function(){return f()&&o("millisecond")};switch(n){case"year":return s();case"month":return l();case"day":return u();case"hour":return h();case"minute":return c();case"second":return f();case"millisecond":return d()}}function Jpt(n,e){return n/=Ap,n>16?16:n>7.5?7:n>3.5?4:n>1.5?2:1}function Qpt(n){var e=30*Ap;return n/=e,n>6?6:n>3?3:n>2?2:1}function egt(n){return n/=KO,n>12?12:n>6?6:n>3.5?4:n>2?2:1}function Lge(n,e){return n/=e?Oie:Pie,n>30?30:n>20?20:n>15?15:n>10?10:n>5?5:n>2?2:1}function tgt(n){return A3e(n,!0)}function rgt(n,e,t){var r=new Date(n);switch(BA(e)){case"year":case"month":r[Vke(t)](0);case"day":r[$ke(t)](1);case"hour":r[Wke(t)](0);case"minute":r[Hke(t)](0);case"second":r[jke(t)](0),r[Xke(t)](0)}return r.getTime()}function ngt(n,e,t,r){var i=1e4,a=zke,o=0;function s(C,A,M,I,R,k,D){for(var G=new Date(A),W=A,z=G[I]();W<M&&W<=r[1];)D.push({value:W}),z+=C,G[R](z),W=G.getTime();D.push({value:W,notAdd:!0})}function l(C,A,M){var I=[],R=!A.length;if(!Kpt(BA(C),r[0],r[1],t)){R&&(A=[{value:rgt(new Date(r[0]),C,t)},{value:r[1]}]);for(var k=0;k<A.length-1;k++){var D=A[k].value,G=A[k+1].value;if(D!==G){var W=void 0,z=void 0,V=void 0,q=!1;switch(C){case"year":W=Math.max(1,Math.round(e/Ap/365)),z=Rie(t),V=wft(t);break;case"half-year":case"quarter":case"month":W=Qpt(e),z=GA(t),V=Vke(t);break;case"week":case"half-week":case"day":W=Jpt(e),z=nU(t),V=$ke(t),q=!0;break;case"half-day":case"quarter-day":case"hour":W=egt(e),z=hD(t),V=Wke(t);break;case"minute":W=Lge(e,!0),z=iU(t),V=Hke(t);break;case"second":W=Lge(e,!1),z=aU(t),V=jke(t);break;case"millisecond":W=tgt(e),z=oU(t),V=Xke(t);break}s(W,D,G,z,V,q,I),C==="year"&&M.length>1&&k===0&&M.unshift({value:M[0].value-W})}}for(var k=0;k<I.length;k++)M.push(I[k]);return I}}for(var u=[],h=[],c=0,f=0,d=0;d<a.length&&o++<i;++d){var v=BA(a[d]);if(!!_ft(a[d])){l(a[d],u[u.length-1]||[],h);var p=a[d+1]?BA(a[d+1]):null;if(v!==p){if(h.length){f=c,h.sort(function(C,A){return C.value-A.value});for(var g=[],m=0;m<h.length;++m){var y=h[m].value;(m===0||h[m-1].value!==y)&&(g.push(h[m]),y>=r[0]&&y<=r[1]&&c++)}var _=(r[1]-r[0])/e;if(c>_*1.5&&f>_/1.5||(u.push(g),c>_||n===a[d]))break}h=[]}}}for(var x=To(Vt(u,function(C){return To(C,function(A){return A.value>=r[0]&&A.value<=r[1]&&!A.notAdd})}),function(C){return C.length>0}),S=[],w=x.length-1,d=0;d<x.length;++d)for(var b=x[d],E=0;E<b.length;++E)S.push({value:b[E].value,level:w-d});S.sort(function(C,A){return C.value-A.value});for(var T=[],d=0;d<S.length;++d)(d===0||S[d].value!==S[d-1].value)&&T.push(S[d]);return T}F_.registerClass(I4e);const L4e=I4e;var Pge=F_.prototype,tR=BS.prototype,igt=Pl,agt=Math.floor,ogt=Math.ceil,m4=Math.pow,Tg=Math.log,rae=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new BS,t._interval=0,t}return e.prototype.getTicks=function(t){var r=this._originalScale,i=this._extent,a=r.getExtent(),o=tR.getTicks.call(this,t);return Vt(o,function(s){var l=s.value,u=Pl(m4(this.base,l));return u=l===i[0]&&this._fixMin?_4(u,a[0]):u,u=l===i[1]&&this._fixMax?_4(u,a[1]):u,{value:u}},this)},e.prototype.setExtent=function(t,r){var i=Tg(this.base);t=Tg(Math.max(0,t))/i,r=Tg(Math.max(0,r))/i,tR.setExtent.call(this,t,r)},e.prototype.getExtent=function(){var t=this.base,r=Pge.getExtent.call(this);r[0]=m4(t,r[0]),r[1]=m4(t,r[1]);var i=this._originalScale,a=i.getExtent();return this._fixMin&&(r[0]=_4(r[0],a[0])),this._fixMax&&(r[1]=_4(r[1],a[1])),r},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var r=this.base;t[0]=Tg(t[0])/Tg(r),t[1]=Tg(t[1])/Tg(r),Pge.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,r){this.unionExtent(t.getApproximateExtent(r))},e.prototype.calcNiceTicks=function(t){t=t||10;var r=this._extent,i=r[1]-r[0];if(!(i===1/0||i<=0)){var a=$ut(i),o=t/i*a;for(o<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var s=[Pl(ogt(r[0]/a)*a),Pl(agt(r[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){tR.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=Tg(t)/Tg(this.base),fU(t,this._extent)},e.prototype.normalize=function(t){return t=Tg(t)/Tg(this.base),dU(t,this._extent)},e.prototype.scale=function(t){return t=vU(t,this._extent),m4(this.base,t)},e.type="log",e}(F_),P4e=rae.prototype;P4e.getMinorTicks=tR.getMinorTicks;P4e.getLabel=tR.getLabel;function _4(n,e){return igt(n,Ny(e))}F_.registerClass(rae);const sgt=rae;var lgt=function(){function n(e,t,r){this._prepareParams(e,t,r)}return n.prototype._prepareParams=function(e,t,r){r[1]<r[0]&&(r=[NaN,NaN]),this._dataMin=r[0],this._dataMax=r[1];var i=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&t.getNeedCrossZero&&t.getNeedCrossZero();var a=this._modelMinRaw=t.get("min",!0);rn(a)?this._modelMinNum=x4(e,a({min:r[0],max:r[1]})):a!=="dataMin"&&(this._modelMinNum=x4(e,a));var o=this._modelMaxRaw=t.get("max",!0);if(rn(o)?this._modelMaxNum=x4(e,o({min:r[0],max:r[1]})):o!=="dataMax"&&(this._modelMaxNum=x4(e,o)),i)this._axisDataLen=t.getCategories().length;else{var s=t.get("boundaryGap"),l=Gt(s)?s:[s||0,s||0];typeof l[0]=="boolean"||typeof l[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[_0(l[0],1),_0(l[1],1)]}},n.prototype.calculate=function(){var e=this._isOrdinal,t=this._dataMin,r=this._dataMax,i=this._axisDataLen,a=this._boundaryGapInner,o=e?null:r-t||Math.abs(t),s=this._modelMinRaw==="dataMin"?t:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?r:this._modelMaxNum,u=s!=null,h=l!=null;s==null&&(s=e?i?0:NaN:t-a[0]*o),l==null&&(l=e?i?i-1:NaN:r+a[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var c=eD(s)||eD(l)||e&&!i;this._needCrossZero&&(s>0&&l>0&&!u&&(s=0),s<0&&l<0&&!h&&(l=0));var f=this._determinedMin,d=this._determinedMax;return f!=null&&(s=f,u=!0),d!=null&&(l=d,h=!0),{min:s,max:l,minFixed:u,maxFixed:h,isBlank:c}},n.prototype.modifyDataMinMax=function(e,t){this[hgt[e]]=t},n.prototype.setDeterminedMinMax=function(e,t){var r=ugt[e];this[r]=t},n.prototype.freeze=function(){this.frozen=!0},n}(),ugt={min:"_determinedMin",max:"_determinedMax"},hgt={min:"_dataMin",max:"_dataMax"};function O4e(n,e,t){var r=n.rawExtentInfo;return r||(r=new lgt(n,e,t),n.rawExtentInfo=r,r)}function x4(n,e){return e==null?null:eD(e)?NaN:n.parse(e)}function R4e(n,e){var t=n.type,r=O4e(n,e,n.getExtent()).calculate();n.setBlank(r.isBlank);var i=r.min,a=r.max,o=e.ecModel;if(o&&t==="time"){var s=w4e("bar",o),l=!1;if(te(s,function(c){l=l||c.getBaseAxis()===e.axis}),l){var u=b4e(s),h=cgt(i,a,e,u);i=h.min,a=h.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function cgt(n,e,t,r){var i=t.axis.getExtent(),a=i[1]-i[0],o=Ypt(r,t.axis);if(o===void 0)return{min:n,max:e};var s=1/0;te(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;te(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-n,c=1-(s+l)/a,f=h/c-h;return e+=f*(l/u),n-=f*(s/u),{min:n,max:e}}function pM(n,e){var t=e,r=R4e(n,t),i=r.extent,a=t.get("splitNumber");n instanceof sgt&&(n.base=t.get("logBase"));var o=n.type,s=t.get("interval"),l=o==="interval"||o==="time";n.setExtent(i[0],i[1]),n.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&n.setInterval&&n.setInterval(s)}function pU(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new Qie({ordinalMeta:n.getOrdinalMeta?n.getOrdinalMeta():n.getCategories(),extent:[1/0,-1/0]});case"time":return new L4e({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new(F_.getClass(e)||BS)}}function fgt(n){var e=n.scale.getExtent(),t=e[0],r=e[1];return!(t>0&&r>0||t<0&&r<0)}function E3(n){var e=n.getLabelModel().get("formatter"),t=n.type==="category"?n.scale.getExtent()[0]:null;return n.scale.type==="time"?function(r){return function(i,a){return n.scale.getFormattedLabel(i,a,r)}}(e):Or(e)?function(r){return function(i){var a=n.scale.getLabel(i),o=r.replace("{value}",a!=null?a:"");return o}}(e):rn(e)?function(r){return function(i,a){return t!=null&&(a=i.value-t),r(nae(n,i),a,i.level!=null?{level:i.level}:null)}}(e):function(r){return n.scale.getLabel(r)}}function nae(n,e){return n.type==="category"?n.scale.getLabel(e):e.value}function dgt(n){var e=n.model,t=n.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var r,i,a=t.getExtent();t instanceof Qie?i=t.count():(r=t.getTicks(),i=r.length);var o=n.getLabelModel(),s=E3(n),l,u=1;i>40&&(u=Math.ceil(i/40));for(var h=0;h<i;h+=u){var c=r?r[h]:{value:a[0]+h},f=s(c,h),d=o.getTextRect(f),v=vgt(d,o.get("rotate")||0);l?l.union(v):l=v}return l}}function vgt(n,e){var t=e*Math.PI/180,r=n.width,i=n.height,a=r*Math.abs(Math.cos(t))+Math.abs(i*Math.sin(t)),o=r*Math.abs(Math.sin(t))+Math.abs(i*Math.cos(t)),s=new ai(n.x,n.y,a,o);return s}function iae(n){var e=n.get("interval");return e==null?"auto":e}function D4e(n){return n.type==="category"&&iae(n.getLabelModel())===0}function wG(n,e){var t={};return te(n.mapDimensionsAll(e),function(r){t[g4e(n,r)]=!0}),Li(t)}function pgt(n,e,t){e&&te(wG(e,t),function(r){var i=e.getApproximateExtent(r);i[0]<n[0]&&(n[0]=i[0]),i[1]>n[1]&&(n[1]=i[1])})}var T3=function(){function n(){}return n.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},n.prototype.getCoordSysModel=function(){},n}(),ggt=1e-8;function Oge(n,e){return Math.abs(n-e)<ggt}function Wb(n,e,t){var r=0,i=n[0];if(!i)return!1;for(var a=1;a<n.length;a++){var o=n[a];r+=g1(i[0],i[1],o[0],o[1],e,t),i=o}var s=n[0];return(!Oge(i[0],s[0])||!Oge(i[1],s[1]))&&(r+=g1(i[0],i[1],s[0],s[1],e,t)),r!==0}var ygt=[];function KH(n,e){for(var t=0;t<n.length;t++)cc(n[t],n[t],e)}function Rge(n,e,t,r){for(var i=0;i<n.length;i++){var a=n[i];r&&(a=r.project(a)),a&&isFinite(a[0])&&isFinite(a[1])&&(Kx(e,e,a),Jx(t,t,a))}}function mgt(n){for(var e=0,t=0,r=0,i=n.length,a=n[i-1][0],o=n[i-1][1],s=0;s<i;s++){var l=n[s][0],u=n[s][1],h=a*u-l*o;e+=h,t+=(a+l)*h,r+=(o+u)*h,a=l,o=u}return e?[t/e/3,r/e/3,e]:[n[0][0]||0,n[0][1]||0]}var N4e=function(){function n(e){this.name=e}return n.prototype.setCenter=function(e){this._center=e},n.prototype.getCenter=function(){var e=this._center;return e||(e=this._center=this.calcCenter()),e},n}(),Dge=function(){function n(e,t){this.type="polygon",this.exterior=e,this.interiors=t}return n}(),Nge=function(){function n(e){this.type="linestring",this.points=e}return n}(),k4e=function(n){$e(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.type="geoJSON",a.geometries=r,a._center=i&&[i[0],i[1]],a}return e.prototype.calcCenter=function(){for(var t=this.geometries,r,i=0,a=0;a<t.length;a++){var o=t[a],s=o.exterior,l=s&&s.length;l>i&&(r=o,i=l)}if(r)return mgt(r.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var r=this._rect;if(r&&!t)return r;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return te(o,function(s){s.type==="polygon"?Rge(s.exterior,i,a,t):te(s.points,function(l){Rge(l,i,a,t)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),r=new ai(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=r),r},e.prototype.contain=function(t){var r=this.getBoundingRect(),i=this.geometries;if(!r.contain(t[0],t[1]))return!1;e:for(var a=0,o=i.length;a<o;a++){var s=i[a];if(s.type==="polygon"){var l=s.exterior,u=s.interiors;if(Wb(l,t[0],t[1])){for(var h=0;h<(u?u.length:0);h++)if(Wb(u[h],t[0],t[1]))continue e;return!0}}}return!1},e.prototype.transformTo=function(t,r,i,a){var o=this.getBoundingRect(),s=o.width/o.height;i?a||(a=i/s):i=s*a;for(var l=new ai(t,r,i,a),u=o.calculateTransform(l),h=this.geometries,c=0;c<h.length;c++){var f=h[c];f.type==="polygon"?(KH(f.exterior,u),te(f.interiors,function(d){KH(d,u)})):te(f.points,function(d){KH(d,u)})}o=this._rect,o.copy(l),this._center=[o.x+o.width/2,o.y+o.height/2]},e.prototype.cloneShallow=function(t){t==null&&(t=this.name);var r=new e(t,this.geometries,this._center);return r._rect=this._rect,r.transformTo=null,r},e}(N4e),_gt=function(n){$e(e,n);function e(t,r){var i=n.call(this,t)||this;return i.type="geoSVG",i._elOnlyForCalculate=r,i}return e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,r=t.getBoundingRect(),i=[r.x+r.width/2,r.y+r.height/2],a=Vz(ygt),o=t;o&&!o.isGeoSVGGraphicRoot;)$1(a,o.getLocalTransform(),a),o=o.parent;return LI(a,a),cc(i,i,a),i},e}(N4e);function xgt(n){if(!n.UTF8Encoding)return n;var e=n,t=e.UTF8Scale;t==null&&(t=1024);var r=e.features;return te(r,function(i){var a=i.geometry,o=a.encodeOffsets,s=a.coordinates;if(!!o)switch(a.type){case"LineString":a.coordinates=F4e(s,o,t);break;case"Polygon":JH(s,o,t);break;case"MultiLineString":JH(s,o,t);break;case"MultiPolygon":te(s,function(l,u){return JH(l,o[u],t)})}}),e.UTF8Encoding=!1,e}function JH(n,e,t){for(var r=0;r<n.length;r++)n[r]=F4e(n[r],e[r],t)}function F4e(n,e,t){for(var r=[],i=e[0],a=e[1],o=0;o<n.length;o+=2){var s=n.charCodeAt(o)-64,l=n.charCodeAt(o+1)-64;s=s>>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,r.push([s/t,l/t])}return r}function Sgt(n,e){return n=xgt(n),Vt(To(n.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var r=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new Dge(o[0],o.slice(1)));break;case"MultiPolygon":te(i.coordinates,function(l){l[0]&&a.push(new Dge(l[0],l.slice(1)))});break;case"LineString":a.push(new Nge([i.coordinates]));break;case"MultiLineString":a.push(new Nge(i.coordinates))}var s=new k4e(r[e||"name"],a,r.cp);return s.properties=r,s})}var gD=na();function wgt(n){return n.type==="category"?Egt(n):Cgt(n)}function bgt(n,e){return n.type==="category"?Tgt(n,e):{ticks:Vt(n.scale.getTicks(),function(t){return t.value})}}function Egt(n){var e=n.getLabelModel(),t=B4e(n,e);return!e.get("show")||n.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function B4e(n,e){var t=G4e(n,"labels"),r=iae(e),i=z4e(t,r);if(i)return i;var a,o;return rn(r)?a=$4e(n,r):(o=r==="auto"?Agt(n):r,a=V4e(n,o)),U4e(t,r,{labels:a,labelCategoryInterval:o})}function Tgt(n,e){var t=G4e(n,"ticks"),r=iae(e),i=z4e(t,r);if(i)return i;var a,o;if((!e.get("show")||n.scale.isBlank())&&(a=[]),rn(r))a=$4e(n,r,!0);else if(r==="auto"){var s=B4e(n,n.getLabelModel());o=s.labelCategoryInterval,a=Vt(s.labels,function(l){return l.tickValue})}else o=r,a=V4e(n,o,!0);return U4e(t,r,{ticks:a,tickCategoryInterval:o})}function Cgt(n){var e=n.scale.getTicks(),t=E3(n);return{labels:Vt(e,function(r,i){return{level:r.level,formattedLabel:t(r,i),rawLabel:n.scale.getLabel(r),tickValue:r.value}})}}function G4e(n,e){return gD(n)[e]||(gD(n)[e]=[])}function z4e(n,e){for(var t=0;t<n.length;t++)if(n[t].key===e)return n[t].value}function U4e(n,e,t){return n.push({key:e,value:t}),t}function Agt(n){var e=gD(n).autoInterval;return e!=null?e:gD(n).autoInterval=n.calculateCategoryInterval()}function Mgt(n){var e=Igt(n),t=E3(n),r=(e.axisRotate-e.labelRotate)/180*Math.PI,i=n.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=n.dataToCoord(l+1)-n.dataToCoord(l),h=Math.abs(u*Math.cos(r)),c=Math.abs(u*Math.sin(r)),f=0,d=0;l<=a[1];l+=s){var v=0,p=0,g=v3(t({value:l}),e.font,"center","top");v=g.width*1.3,p=g.height*1.3,f=Math.max(f,v,7),d=Math.max(d,p,7)}var m=f/h,y=d/c;isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0);var _=Math.max(0,Math.floor(Math.min(m,y))),x=gD(n.model),S=n.getExtent(),w=x.lastAutoInterval,b=x.lastTickCount;return w!=null&&b!=null&&Math.abs(w-_)<=1&&Math.abs(b-o)<=1&&w>_&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?_=w:(x.lastTickCount=o,x.lastAutoInterval=_,x.axisExtent0=S[0],x.axisExtent1=S[1]),_}function Igt(n){var e=n.getLabelModel();return{axisRotate:n.getRotate?n.getRotate():n.isHorizontal&&!n.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function V4e(n,e,t){var r=E3(n),i=n.scale,a=i.getExtent(),o=n.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],h=i.count();u!==0&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=D4e(n),f=o.get("showMinLabel")||c,d=o.get("showMaxLabel")||c;f&&u!==a[0]&&p(a[0]);for(var v=u;v<=a[1];v+=l)p(v);d&&v-l!==a[1]&&p(a[1]);function p(g){var m={value:g};s.push(t?g:{formattedLabel:r(m),rawLabel:i.getLabel(m),tickValue:g})}return s}function $4e(n,e,t){var r=n.scale,i=E3(n),a=[];return te(r.getTicks(),function(o){var s=r.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:i(o),rawLabel:s,tickValue:l})}),a}var kge=[0,1],Lgt=function(){function n(e,t,r){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=r||[0,0]}return n.prototype.contain=function(e){var t=this._extent,r=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=r&&e<=i},n.prototype.containData=function(e){return this.scale.contain(e)},n.prototype.getExtent=function(){return this._extent.slice()},n.prototype.getPixelPrecision=function(e){return T3e(e||this.scale.getExtent(),this._extent)},n.prototype.setExtent=function(e,t){var r=this._extent;r[0]=e,r[1]=t},n.prototype.dataToCoord=function(e,t){var r=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(r=r.slice(),Fge(r,i.count())),go(e,kge,r,t)},n.prototype.coordToData=function(e,t){var r=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(r=r.slice(),Fge(r,i.count()));var a=go(e,r,kge,t);return this.scale.scale(a)},n.prototype.pointToData=function(e,t){},n.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),r=bgt(this,t),i=r.ticks,a=Vt(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return Pgt(this,a,o,e.clamp),a},n.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var r=this.scale.getMinorTicks(t),i=Vt(r,function(a){return Vt(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},n.prototype.getViewLabels=function(){return wgt(this).labels},n.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},n.prototype.getTickModel=function(){return this.model.getModel("axisTick")},n.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),r=t[1]-t[0]+(this.onBand?1:0);r===0&&(r=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/r},n.prototype.calculateCategoryInterval=function(){return Mgt(this)},n}();function Fge(n,e){var t=n[1]-n[0],r=e,i=t/r/2;n[0]+=i,n[1]-=i}function Pgt(n,e,t,r){var i=e.length;if(!n.onBand||t||!i)return;var a=n.getExtent(),o,s;if(i===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[i-1].tickValue-e[0].tickValue,u=(e[i-1].coord-e[0].coord)/l;te(e,function(d){d.coord-=u/2});var h=n.scale.getExtent();s=1+h[1]-e[i-1].tickValue,o={coord:e[i-1].coord+u*s},e.push(o)}var c=a[0]>a[1];f(e[0].coord,a[0])&&(r?e[0].coord=a[0]:e.shift()),r&&f(a[0],e[0].coord)&&e.unshift({coord:a[0]}),f(a[1],o.coord)&&(r?o.coord=a[1]:e.pop()),r&&f(o.coord,a[1])&&e.push({coord:a[1]});function f(d,v){return d=Pl(d),v=Pl(v),c?d>v:d<v}}const D0=Lgt;var oP=Math.PI*2,hb=hm.CMD,Ogt=["top","right","bottom","left"];function Rgt(n,e,t,r,i){var a=t.width,o=t.height;switch(n){case"top":r.set(t.x+a/2,t.y-e),i.set(0,-1);break;case"bottom":r.set(t.x+a/2,t.y+o+e),i.set(0,1);break;case"left":r.set(t.x-e,t.y+o/2),i.set(-1,0);break;case"right":r.set(t.x+a+e,t.y+o/2),i.set(1,0);break}}function Dgt(n,e,t,r,i,a,o,s,l){o-=n,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var h=o*t+n,c=s*t+e;if(Math.abs(r-i)%oP<1e-4)return l[0]=h,l[1]=c,u-t;if(a){var f=r;r=e0(i),i=e0(f)}else r=e0(r),i=e0(i);r>i&&(i+=oP);var d=Math.atan2(s,o);if(d<0&&(d+=oP),d>=r&&d<=i||d+oP>=r&&d+oP<=i)return l[0]=h,l[1]=c,u-t;var v=t*Math.cos(r)+n,p=t*Math.sin(r)+e,g=t*Math.cos(i)+n,m=t*Math.sin(i)+e,y=(v-o)*(v-o)+(p-s)*(p-s),_=(g-o)*(g-o)+(m-s)*(m-s);return y<_?(l[0]=v,l[1]=p,Math.sqrt(y)):(l[0]=g,l[1]=m,Math.sqrt(_))}function bG(n,e,t,r,i,a,o,s){var l=i-n,u=a-e,h=t-n,c=r-e,f=Math.sqrt(h*h+c*c);h/=f,c/=f;var d=l*h+u*c,v=d/f;s&&(v=Math.min(Math.max(v,0),1)),v*=f;var p=o[0]=n+v*h,g=o[1]=e+v*c;return Math.sqrt((p-i)*(p-i)+(g-a)*(g-a))}function W4e(n,e,t,r,i,a,o){t<0&&(n=n+t,t=-t),r<0&&(e=e+r,r=-r);var s=n+t,l=e+r,u=o[0]=Math.min(Math.max(i,n),s),h=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-i)*(u-i)+(h-a)*(h-a))}var zg=[];function Ngt(n,e,t){var r=W4e(e.x,e.y,e.width,e.height,n.x,n.y,zg);return t.set(zg[0],zg[1]),r}function kgt(n,e,t){for(var r=0,i=0,a=0,o=0,s,l,u=1/0,h=e.data,c=n.x,f=n.y,d=0;d<h.length;){var v=h[d++];d===1&&(r=h[d],i=h[d+1],a=r,o=i);var p=u;switch(v){case hb.M:a=h[d++],o=h[d++],r=a,i=o;break;case hb.L:p=bG(r,i,h[d],h[d+1],c,f,zg,!0),r=h[d++],i=h[d++];break;case hb.C:p=a3e(r,i,h[d++],h[d++],h[d++],h[d++],h[d],h[d+1],c,f,zg),r=h[d++],i=h[d++];break;case hb.Q:p=s3e(r,i,h[d++],h[d++],h[d],h[d+1],c,f,zg),r=h[d++],i=h[d++];break;case hb.A:var g=h[d++],m=h[d++],y=h[d++],_=h[d++],x=h[d++],S=h[d++];d+=1;var w=!!(1-h[d++]);s=Math.cos(x)*y+g,l=Math.sin(x)*_+m,d<=1&&(a=s,o=l);var b=(c-g)*_/y+g;p=Dgt(g,m,_,x,x+S,w,b,f,zg),r=Math.cos(x+S)*y+g,i=Math.sin(x+S)*_+m;break;case hb.R:a=r=h[d++],o=i=h[d++];var E=h[d++],T=h[d++];p=W4e(a,o,E,T,c,f,zg);break;case hb.Z:p=bG(r,i,a,o,c,f,zg,!0),r=a,i=o;break}p<u&&(u=p,t.set(zg[0],zg[1]))}return u}var t0=new qn,rs=new qn,$l=new qn,By=new qn,Ly=new qn;function Bge(n,e){if(!!n){var t=n.getTextGuideLine(),r=n.getTextContent();if(!!(r&&t)){var i=n.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=i.candidates||Ogt,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var l=1/0,u=i.anchor,h=n.getComputedTransform(),c=h&&LI([],h),f=e.get("length2")||0;u&&$l.copy(u);for(var d=0;d<o.length;d++){var v=o[d];Rgt(v,0,s,t0,By),qn.scaleAndAdd(rs,t0,By,f),rs.transform(c);var p=n.getBoundingRect(),g=u?u.distance(rs):n instanceof Si?kgt(rs,n.path,$l):Ngt(rs,p,$l);g<l&&(l=g,rs.transform(h),$l.transform(h),$l.toArray(a[0]),rs.toArray(a[1]),t0.toArray(a[2]))}H4e(a,e.get("minTurnAngle")),t.setShape({points:a})}}}var EG=[],wf=new qn;function H4e(n,e){if(e<=180&&e>0){e=e/180*Math.PI,t0.fromArray(n[0]),rs.fromArray(n[1]),$l.fromArray(n[2]),qn.sub(By,t0,rs),qn.sub(Ly,$l,rs);var t=By.len(),r=Ly.len();if(!(t<.001||r<.001)){By.scale(1/t),Ly.scale(1/r);var i=By.dot(Ly),a=Math.cos(e);if(a<i){var o=bG(rs.x,rs.y,$l.x,$l.y,t0.x,t0.y,EG,!1);wf.fromArray(EG),wf.scaleAndAdd(Ly,o/Math.tan(Math.PI-e));var s=$l.x!==rs.x?(wf.x-rs.x)/($l.x-rs.x):(wf.y-rs.y)/($l.y-rs.y);if(isNaN(s))return;s<0?qn.copy(wf,rs):s>1&&qn.copy(wf,$l),wf.toArray(n[1])}}}}function Fgt(n,e,t){if(t<=180&&t>0){t=t/180*Math.PI,t0.fromArray(n[0]),rs.fromArray(n[1]),$l.fromArray(n[2]),qn.sub(By,rs,t0),qn.sub(Ly,$l,rs);var r=By.len(),i=Ly.len();if(!(r<.001||i<.001)){By.scale(1/r),Ly.scale(1/i);var a=By.dot(e),o=Math.cos(t);if(a<o){var s=bG(rs.x,rs.y,$l.x,$l.y,t0.x,t0.y,EG,!1);wf.fromArray(EG);var l=Math.PI/2,u=Math.acos(Ly.dot(e)),h=l+u-t;if(h>=l)qn.copy(wf,$l);else{wf.scaleAndAdd(Ly,s/Math.tan(Math.PI/2-h));var c=$l.x!==rs.x?(wf.x-rs.x)/($l.x-rs.x):(wf.y-rs.y)/($l.y-rs.y);if(isNaN(c))return;c<0?qn.copy(wf,rs):c>1&&qn.copy(wf,$l)}wf.toArray(n[1])}}}}function Gge(n,e,t,r){var i=t==="normal",a=i?n:n.ensureState(t);a.ignore=e;var o=r.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=r.getModel("lineStyle").getLineStyle();i?n.useStyle(s):a.style=s}function Bgt(n,e){var t=e.smooth,r=e.points;if(!!r)if(n.moveTo(r[0][0],r[0][1]),t>0&&r.length>=3){var i=Zx(r[0],r[1]),a=Zx(r[1],r[2]);if(!i||!a){n.lineTo(r[1][0],r[1][1]),n.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*t,s=_B([],r[1],r[0],o/i),l=_B([],r[1],r[2],o/a),u=_B([],s,l,.5);n.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),n.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var h=1;h<r.length;h++)n.lineTo(r[h][0],r[h][1])}function aae(n,e,t){var r=n.getTextGuideLine(),i=n.getTextContent();if(!i){r&&n.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),s=i.ignore,l=0;l<oD.length;l++){var u=oD[l],h=e[u],c=u==="normal";if(h){var f=h.get("show"),d=c?s:ni(i.states[u]&&i.states[u].ignore,s);if(d||!ni(f,o)){var v=c?r:r&&r.states[u];v&&(v.ignore=!0);continue}r||(r=new Gd,n.setTextGuideLine(r),!c&&(s||!o)&&Gge(r,!0,"normal",e.normal),n.stateProxy&&(r.stateProxy=n.stateProxy)),Gge(r,!1,u,h)}}if(r){sn(r.style,t),r.style.fill=null;var p=a.get("showAbove"),g=n.textGuideLineConfig=n.textGuideLineConfig||{};g.showAbove=p||!1,r.buildPath=Bgt}}function oae(n,e){e=e||"labelLine";for(var t={normal:n.getModel(e)},r=0;r<Gf.length;r++){var i=Gf[r];t[i]=n.getModel([i,e])}return t}function j4e(n){for(var e=[],t=0;t<n.length;t++){var r=n[t];if(!r.defaultAttr.ignore){var i=r.label,a=i.getComputedTransform(),o=i.getBoundingRect(),s=!a||a[1]<1e-5&&a[2]<1e-5,l=i.style.margin||0,u=o.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var h=s?new lG(o,a):null;e.push({label:i,labelLine:r.labelLine,rect:u,localRect:o,obb:h,priority:r.priority,defaultAttr:r.defaultAttr,layoutOption:r.computedLayoutOption,axisAligned:s,transform:a})}}return e}function X4e(n,e,t,r,i,a){var o=n.length;if(o<2)return;n.sort(function(E,T){return E.rect[e]-T.rect[e]});for(var s=0,l,u=!1,h=0,c=0;c<o;c++){var f=n[c],d=f.rect;l=d[e]-s,l<0&&(d[e]-=l,f.label[e]-=l,u=!0);var v=Math.max(-l,0);h+=v,s=d[e]+d[t]}h>0&&a&&S(-h/o,0,o);var p=n[0],g=n[o-1],m,y;_(),m<0&&w(-m,.8),y<0&&w(y,.8),_(),x(m,y,1),x(y,m,-1),_(),m<0&&b(-m),y<0&&b(y);function _(){m=p.rect[e]-r,y=i-g.rect[e]-g.rect[t]}function x(E,T,C){if(E<0){var A=Math.min(T,-E);if(A>0){S(A*C,0,o);var M=A+E;M<0&&w(-M*C,1)}else w(-E*C,1)}}function S(E,T,C){E!==0&&(u=!0);for(var A=T;A<C;A++){var M=n[A],I=M.rect;I[e]+=E,M.label[e]+=E}}function w(E,T){for(var C=[],A=0,M=1;M<o;M++){var I=n[M-1].rect,R=Math.max(n[M].rect[e]-I[e]-I[t],0);C.push(R),A+=R}if(!!A){var k=Math.min(Math.abs(E)/A,T);if(E>0)for(var M=0;M<o-1;M++){var D=C[M]*k;S(D,0,M+1)}else for(var M=o-1;M>0;M--){var D=C[M-1]*k;S(-D,M,o)}}}function b(E){var T=E<0?-1:1;E=Math.abs(E);for(var C=Math.ceil(E/(o-1)),A=0;A<o-1;A++)if(T>0?S(C,0,A+1):S(-C,o-A-1,o),E-=C,E<=0)return}return u}function Ggt(n,e,t,r){return X4e(n,"x","width",e,t,r)}function Y4e(n,e,t,r){return X4e(n,"y","height",e,t,r)}function q4e(n){var e=[];n.sort(function(p,g){return g.priority-p.priority});var t=new ai(0,0,0,0);function r(p){if(!p.ignore){var g=p.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}p.ignore=!0}for(var i=0;i<n.length;i++){var a=n[i],o=a.axisAligned,s=a.localRect,l=a.transform,u=a.label,h=a.labelLine;t.copy(a.rect),t.width-=.1,t.height-=.1,t.x+=.05,t.y+=.05;for(var c=a.obb,f=!1,d=0;d<e.length;d++){var v=e[d];if(!!t.intersect(v.rect)){if(o&&v.axisAligned){f=!0;break}if(v.obb||(v.obb=new lG(v.localRect,v.transform)),c||(c=new lG(s,l)),c.intersect(v.obb)){f=!0;break}}}f?(r(u),h&&r(h)):(u.attr("ignore",a.defaultAttr.ignore),h&&h.attr("ignore",a.defaultAttr.labelGuideIgnore),e.push(a))}}function zgt(n){if(n){for(var e=[],t=0;t<n.length;t++)e.push(n[t].slice());return e}}function Ugt(n,e){var t=n.label,r=e&&e.getTextGuideLine();return{dataIndex:n.dataIndex,dataType:n.dataType,seriesIndex:n.seriesModel.seriesIndex,text:n.label.style.text,rect:n.hostRect,labelRect:n.rect,align:t.style.align,verticalAlign:t.style.verticalAlign,labelLinePoints:zgt(r&&r.shape.points)}}var zge=["align","verticalAlign","width","height","fontSize"],df=new L1,QH=na(),Vgt=na();function S4(n,e,t){for(var r=0;r<t.length;r++){var i=t[r];e[i]!=null&&(n[i]=e[i])}}var w4=["x","y","rotation"],$gt=function(){function n(){this._labelList=[],this._chartViewList=[]}return n.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},n.prototype._addLabel=function(e,t,r,i,a){var o=i.style,s=i.__hostTarget,l=s.textConfig||{},u=i.getComputedTransform(),h=i.getBoundingRect().plain();ai.applyTransform(h,h,u),u?df.setLocalTransform(u):(df.x=df.y=df.rotation=df.originX=df.originY=0,df.scaleX=df.scaleY=1),df.rotation=e0(df.rotation);var c=i.__hostTarget,f;if(c){f=c.getBoundingRect().plain();var d=c.getComputedTransform();ai.applyTransform(f,f,d)}var v=f&&c.getTextGuideLine();this._labelList.push({label:i,labelLine:v,seriesModel:r,dataIndex:e,dataType:t,layoutOption:a,computedLayoutOption:null,rect:h,hostRect:f,priority:f?f.width*f.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:v&&v.ignore,x:df.x,y:df.y,scaleX:df.scaleX,scaleY:df.scaleY,rotation:df.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:i.cursor,attachedPos:l.position,attachedRot:l.rotation}})},n.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var r=e.__model,i=r.get("labelLayout");!(rn(i)||Li(i).length)||e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=Bn(a);o&&!o.disableLabelLayout&&t._addLabel(s.dataIndex,s.dataType,r,o,i)})},n.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),r=e.getHeight();function i(_,x){return function(){Bge(_,x)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,h=void 0;rn(o.layoutOption)?h=o.layoutOption(Ugt(o,l)):h=o.layoutOption,h=h||{},o.computedLayoutOption=h;var c=Math.PI/180;l&&l.setTextConfig({local:!1,position:h.x!=null||h.y!=null?null:u.attachedPos,rotation:h.rotate!=null?h.rotate*c:u.attachedRot,offset:[h.dx||0,h.dy||0]});var f=!1;if(h.x!=null?(s.x=xr(h.x,t),s.setStyle("x",0),f=!0):(s.x=u.x,s.setStyle("x",u.style.x)),h.y!=null?(s.y=xr(h.y,r),s.setStyle("y",0),f=!0):(s.y=u.y,s.setStyle("y",u.style.y)),h.labelLinePoints){var d=l.getTextGuideLine();d&&(d.setShape({points:h.labelLinePoints}),f=!1)}var v=QH(s);v.needsUpdateLabelLine=f,s.rotation=h.rotate!=null?h.rotate*c:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var p=0;p<zge.length;p++){var g=zge[p];s.setStyle(g,h[g]!=null?h[g]:u.style[g])}if(h.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var y=o.seriesModel.getData(o.dataType);m=y.getItemModel(o.dataIndex)}s.on("drag",i(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},n.prototype.layout=function(e){var t=e.getWidth(),r=e.getHeight(),i=j4e(this._labelList),a=To(i,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=To(i,function(l){return l.layoutOption.moveOverlap==="shiftY"});Ggt(a,0,t),Y4e(o,0,r);var s=To(i,function(l){return l.layoutOption.hideOverlap});q4e(s)},n.prototype.processLabelsOverall=function(){var e=this;te(this._chartViewList,function(t){var r=t.__model,i=t.ignoreLabelLineUpdate,a=r.isAnimationEnabled();t.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!i,l=o.getTextContent();!s&&l&&(s=QH(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,r),a&&e._animateLabels(o,r)})})},n.prototype._updateLabelLine=function(e,t){var r=e.getTextContent(),i=Bn(e),a=i.dataIndex;if(r&&a!=null){var o=t.getData(i.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var h=o.getVisual("drawType");l.stroke=u[h]}var c=s.getModel("labelLine");aae(e,oae(s),l),Bge(e,c)}},n.prototype._animateLabels=function(e,t){var r=e.getTextContent(),i=e.getTextGuideLine();if(r&&(e.forceLabelAnimation||!r.ignore&&!r.invisible&&!e.disableLabelAnimation&&!FA(e))){var a=QH(r),o=a.oldLayout,s=Bn(e),l=s.dataIndex,u={x:r.x,y:r.y,rotation:r.rotation},h=t.getData(s.dataType);if(o){r.attr(o);var f=e.prevStates;f&&(gi(f,"select")>=0&&r.attr(a.oldLayoutSelect),gi(f,"emphasis")>=0&&r.attr(a.oldLayoutEmphasis)),ma(r,u,t,l)}else if(r.attr(u),!NI(r).valueAnimation){var c=ni(r.style.opacity,1);r.style.opacity=0,Is(r,{style:{opacity:c}},t,l)}if(a.oldLayout=u,r.states.select){var d=a.oldLayoutSelect={};S4(d,u,w4),S4(d,r.states.select,w4)}if(r.states.emphasis){var v=a.oldLayoutEmphasis={};S4(v,u,w4),S4(v,r.states.emphasis,w4)}Nke(r,l,h,t,t)}if(i&&!i.ignore&&!i.invisible){var a=Vgt(i),o=a.oldLayout,p={points:i.shape.points};o?(i.attr({shape:o}),ma(i,{shape:p},t)):(i.setShape(p),i.style.strokePercent=0,Is(i,{style:{strokePercent:1}},t)),a.oldLayout=p}},n}();const Wgt=$gt;var ej=na();function Hgt(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){var i=ej(t).labelManager;i||(i=ej(t).labelManager=new Wgt),i.clearLabels()}),n.registerUpdateLifecycle("series:layoutlabels",function(e,t,r){var i=ej(t).labelManager;r.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var tj=Math.sin,rj=Math.cos,Z4e=Math.PI,cb=Math.PI*2,jgt=180/Z4e,Xgt=function(){function n(){}return n.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},n.prototype.moveTo=function(e,t){this._add("M",e,t)},n.prototype.lineTo=function(e,t){this._add("L",e,t)},n.prototype.bezierCurveTo=function(e,t,r,i,a,o){this._add("C",e,t,r,i,a,o)},n.prototype.quadraticCurveTo=function(e,t,r,i){this._add("Q",e,t,r,i)},n.prototype.arc=function(e,t,r,i,a,o){this.ellipse(e,t,r,r,0,i,a,o)},n.prototype.ellipse=function(e,t,r,i,a,o,s,l){var u=s-o,h=!l,c=Math.abs(u),f=tS(c-cb)||(h?u>=cb:-u>=cb),d=u>0?u%cb:u%cb+cb,v=!1;f?v=!0:tS(c)?v=!1:v=d>=Z4e==!!h;var p=e+r*rj(o),g=t+i*tj(o);this._start&&this._add("M",p,g);var m=Math.round(a*jgt);if(f){var y=1/this._p,_=(h?1:-1)*(cb-y);this._add("A",r,i,m,1,+h,e+r*rj(o+_),t+i*tj(o+_)),y>.01&&this._add("A",r,i,m,0,+h,p,g)}else{var x=e+r*rj(s),S=t+i*tj(s);this._add("A",r,i,m,+v,+h,x,S)}},n.prototype.rect=function(e,t,r,i){this._add("M",e,t),this._add("l",r,0),this._add("l",0,i),this._add("l",-r,0),this._add("Z")},n.prototype.closePath=function(){this._d.length>0&&this._add("Z")},n.prototype._add=function(e,t,r,i,a,o,s,l,u){for(var h=[],c=this._p,f=1;f<arguments.length;f++){var d=arguments[f];if(isNaN(d)){this._invalid=!0;return}h.push(Math.round(d*c)/c)}this._d.push(e+h.join(" ")),this._start=e==="Z"},n.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},n.prototype.getStr=function(){return this._str},n}();const K4e=Xgt;var rR="none",Ygt=Math.round;function qgt(n){var e=n.fill;return e!=null&&e!==rR}function Zgt(n){var e=n.stroke;return e!=null&&e!==rR}var LJ=["lineCap","miterLimit","lineJoin"],Kgt=Vt(LJ,function(n){return"stroke-"+n.toLowerCase()});function Jgt(n,e,t,r){var i=e.opacity==null?1:e.opacity;if(t instanceof xc){n("opacity",i);return}if(qgt(e)){var a=nD(e.fill);n("fill",a.color);var o=e.fillOpacity!=null?e.fillOpacity*a.opacity*i:a.opacity*i;(r||o<1)&&n("fill-opacity",o)}else n("fill",rR);if(Zgt(e)){var s=nD(e.stroke);n("stroke",s.color);var l=e.strokeNoScale?t.getLineScale():1,u=l?(e.lineWidth||0)/l:0,h=e.strokeOpacity!=null?e.strokeOpacity*s.opacity*i:s.opacity*i,c=e.strokeFirst;if((r||u!==1)&&n("stroke-width",u),(r||c)&&n("paint-order",c?"stroke":"fill"),(r||h<1)&&n("stroke-opacity",h),e.lineDash){var f=Xie(t),d=f[0],v=f[1];d&&(v=Ygt(v||0),n("stroke-dasharray",d.join(",")),(v||r)&&n("stroke-dashoffset",v))}else r&&n("stroke-dasharray",rR);for(var p=0;p<LJ.length;p++){var g=LJ[p];if(r||e[g]!==oG[g]){var m=e[g]||oG[g];m&&n(Kgt[p],m)}}}else r&&n("stroke",rR)}var J4e="http://www.w3.org/2000/svg",Q4e="http://www.w3.org/1999/xlink",Qgt="http://www.w3.org/2000/xmlns/",e0t="http://www.w3.org/XML/1998/namespace";function e5e(n){return document.createElementNS(J4e,n)}function ih(n,e,t,r,i){return{tag:n,attrs:t||{},children:r,text:i,key:e}}function t0t(n,e){var t=[];if(e)for(var r in e){var i=e[r],a=r;i!==!1&&(i!==!0&&i!=null&&(a+='="'+i+'"'),t.push(a))}return"<"+n+" "+t.join(" ")+">"}function r0t(n){return"</"+n+">"}function sae(n,e){e=e||{};var t=e.newline?`
`:"";function r(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return t0t(o,s)+(o!=="style"?od(l):l||"")+(a?""+t+Vt(a,function(u){return r(u)}).join(t)+t:"")+r0t(o)}return r(n)}function n0t(n,e,t){t=t||{};var r=t.newline?`
`:"",i=" {"+r,a=r+"}",o=Vt(Li(n),function(l){return l+i+Vt(Li(n[l]),function(u){return u+":"+n[l][u]+";"}).join(r)+a}).join(r),s=Vt(Li(e),function(l){return"@keyframes "+l+i+Vt(Li(e[l]),function(u){return u+i+Vt(Li(e[l][u]),function(h){var c=e[l][u][h];return h==="d"&&(c='path("'+c+'")'),h+":"+c+";"}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(r)}function PJ(n){return{zrId:n,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Uge(n,e,t,r){return ih("svg","root",{width:n,height:e,xmlns:J4e,"xmlns:xlink":Q4e,version:"1.1",baseProfile:"full",viewBox:r?"0 0 "+n+" "+e:!1},t)}var Vge={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Pb="transform-origin";function i0t(n,e,t){var r=Mt({},n.shape);Mt(r,e),n.buildPath(t,r);var i=new K4e;return i.reset(v3e(n)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function a0t(n,e){var t=e.originX,r=e.originY;(t||r)&&(n[Pb]=t+"px "+r+"px")}var o0t={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function t5e(n,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=n,t}function s0t(n,e,t){var r=n.shape.paths,i={},a,o;if(te(r,function(l){var u=PJ(t.zrId);u.animation=!0,gU(l,{},u,!0);var h=u.cssAnims,c=u.cssNodes,f=Li(h),d=f.length;if(!!d){o=f[d-1];var v=h[o];for(var p in v){var g=v[p];i[p]=i[p]||{d:""},i[p].d+=g.d||""}for(var m in c){var y=c[m].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){e.d=!1;var s=t5e(i,t);return a.replace(o,s)}}function $ge(n){return Or(n)?Vge[n]?"cubic-bezier("+Vge[n]+")":uie(n)?n:"":""}function gU(n,e,t,r){var i=n.animators,a=i.length,o=[];if(n instanceof Cie){var s=s0t(n,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var h=i[u],c=[h.getMaxTime()/1e3+"s"],f=$ge(h.getClip().easing),d=h.getDelay();f?c.push(f):c.push("linear"),d&&c.push(d/1e3+"s"),h.getLoop()&&c.push("infinite");var v=c.join(" ");l[v]=l[v]||[v,[]],l[v][1].push(h)}function p(y){var _=y[1],x=_.length,S={},w={},b={},E="animation-timing-function";function T(se,me,Ce){for(var Le=se.getTracks(),re=se.getMaxTime(),yt=0;yt<Le.length;yt++){var je=Le[yt];if(je.needsAnimate()){var st=je.keyframes,Nt=je.propName;if(Ce&&(Nt=Ce(Nt)),Nt)for(var Zt=0;Zt<st.length;Zt++){var qe=st[Zt],ur=Math.round(qe.time/re*100)+"%",Dt=$ge(qe.easing),ft=qe.rawValue;(Or(ft)||ha(ft))&&(me[ur]=me[ur]||{},me[ur][Nt]=qe.rawValue,Dt&&(me[ur][E]=Dt))}}}}for(var C=0;C<x;C++){var A=_[C],M=A.targetName;M?M==="shape"&&T(A,w):!r&&T(A,S)}for(var I in S){var R={};_3e(R,n),Mt(R,S[I]);var k=p3e(R),D=S[I][E];b[I]=k?{transform:k}:{},a0t(b[I],R),D&&(b[I][E]=D)}var G,W=!0;for(var I in w){b[I]=b[I]||{};var z=!G,D=w[I][E];z&&(G=new hm);var V=G.len();G.reset(),b[I].d=i0t(n,w[I],G);var q=G.len();if(!z&&V!==q){W=!1;break}D&&(b[I][E]=D)}if(!W)for(var I in b)delete b[I].d;if(!r)for(var C=0;C<x;C++){var A=_[C],M=A.targetName;M==="style"&&T(A,b,function(Le){return o0t[Le]})}for(var Y=Li(b),le=!0,j,C=1;C<Y.length;C++){var Q=Y[C-1],ie=Y[C];if(b[Q][Pb]!==b[ie][Pb]){le=!1;break}j=b[Q][Pb]}if(le&&j){for(var I in b)b[I][Pb]&&delete b[I][Pb];e[Pb]=j}if(To(Y,function(se){return Li(b[se]).length>0}).length){var oe=t5e(b,t);return oe+" "+y[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=t.zrId+"-cls-"+t.cssClassIdx++;t.cssNodes["."+m]={animation:o.join(",")},e.class=m}}var yD=Math.round;function r5e(n){return n&&Or(n.src)}function n5e(n){return n&&rn(n.toDataURL)}function lae(n,e,t,r){Jgt(function(i,a){var o=i==="fill"||i==="stroke";o&&d3e(a)?a5e(e,n,i,r):o&&hie(a)?o5e(t,n,i,r):n[i]=a},e,t,!1),v0t(t,n,r)}function Wge(n){return tS(n[0]-1)&&tS(n[1])&&tS(n[2])&&tS(n[3]-1)}function l0t(n){return tS(n[4])&&tS(n[5])}function uae(n,e,t){if(e&&!(l0t(e)&&Wge(e))){var r=t?10:1e4;n.transform=Wge(e)?"translate("+yD(e[4]*r)/r+" "+yD(e[5]*r)/r+")":iut(e)}}function Hge(n,e,t){for(var r=n.points,i=[],a=0;a<r.length;a++)i.push(yD(r[a][0]*t)/t),i.push(yD(r[a][1]*t)/t);e.points=i.join(" ")}function jge(n){return!n.smooth}function u0t(n){var e=Vt(n,function(t){return typeof t=="string"?[t,t]:t});return function(t,r,i){for(var a=0;a<e.length;a++){var o=e[a],s=t[o[0]];s!=null&&(r[o[1]]=yD(s*i)/i)}}}var h0t={circle:[u0t(["cx","cy","r"])],polyline:[Hge,jge],polygon:[Hge,jge]};function c0t(n){for(var e=n.animators,t=0;t<e.length;t++)if(e[t].targetName==="shape")return!0;return!1}function i5e(n,e){var t=n.style,r=n.shape,i=h0t[n.type],a={},o=e.animation,s="path",l=n.style.strokePercent,u=e.compress&&v3e(n)||4;if(i&&!e.willUpdate&&!(i[1]&&!i[1](r))&&!(o&&c0t(n))&&!(l<1)){s=n.type;var h=Math.pow(10,u);i[0](r,a,h)}else{var c=!n.path||n.shapeChanged();n.path||n.createPathProxy();var f=n.path;c&&(f.beginPath(),n.buildPath(f,n.shape),n.pathUpdated());var d=f.getVersion(),v=n,p=v.__svgPathBuilder;(v.__svgPathVersion!==d||!p||l!==v.__svgPathStrokePercent)&&(p||(p=v.__svgPathBuilder=new K4e),p.reset(u),f.rebuildPath(p,l),p.generateStr(),v.__svgPathVersion=d,v.__svgPathStrokePercent=l),a.d=p.getStr()}return uae(a,n.transform),lae(a,t,n,e),e.animation&&gU(n,a,e),ih(s,n.id+"",a)}function f0t(n,e){var t=n.style,r=t.image;if(r&&!Or(r)&&(r5e(r)?r=r.src:n5e(r)&&(r=r.toDataURL())),!!r){var i=t.x||0,a=t.y||0,o=t.width,s=t.height,l={href:r,width:o,height:s};return i&&(l.x=i),a&&(l.y=a),uae(l,n.transform),lae(l,t,n,e),e.animation&&gU(n,l,e),ih("image",n.id+"",l)}}function d0t(n,e){var t=n.style,r=t.text;if(r!=null&&(r+=""),!(!r||isNaN(t.x)||isNaN(t.y))){var i=t.font||RS,a=t.x||0,o=out(t.y||0,Wz(i),t.textBaseline),s=aut[t.textAlign]||t.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(J3e(t)){var u="",h=t.fontStyle,c=K3e(t.fontSize);if(!parseFloat(c))return;var f=t.fontFamily||VNe,d=t.fontWeight;u+="font-size:"+c+";font-family:"+f+";",h&&h!=="normal"&&(u+="font-style:"+h+";"),d&&d!=="normal"&&(u+="font-weight:"+d+";"),l.style=u}else l.style="font: "+i;return r.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),o&&(l.y=o),uae(l,n.transform),lae(l,t,n,e),e.animation&&gU(n,l,e),ih("text",n.id+"",l,void 0,r)}}function Xge(n,e){if(n instanceof Si)return i5e(n,e);if(n instanceof xc)return f0t(n,e);if(n instanceof aD)return d0t(n,e)}function v0t(n,e,t){var r=n.style;if(sut(r)){var i=lut(n),a=t.shadowCache,o=a[i];if(!o){var s=n.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var h=r.shadowOffsetX||0,c=r.shadowOffsetY||0,f=r.shadowBlur,d=nD(r.shadowColor),v=d.opacity,p=d.color,g=f/2/l,m=f/2/u,y=g+" "+m;o=t.zrId+"-s"+t.shadowIdx++,t.defs[o]=ih("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[ih("feDropShadow","",{dx:h/l,dy:c/u,stdDeviation:y,"flood-color":p,"flood-opacity":v})]),a[i]=o}e.filter=$z(o)}}function a5e(n,e,t,r){var i=n[t],a,o={gradientUnits:i.global?"userSpaceOnUse":"objectBoundingBox"};if(c3e(i))a="linearGradient",o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if(f3e(i))a="radialGradient",o.cx=ni(i.x,.5),o.cy=ni(i.y,.5),o.r=ni(i.r,.5);else return;for(var s=i.colorStops,l=[],u=0,h=s.length;u<h;++u){var c=HK(s[u].offset)*100+"%",f=s[u].color,d=nD(f),v=d.color,p=d.opacity,g={offset:c};g["stop-color"]=v,p<1&&(g["stop-opacity"]=p),l.push(ih("stop",u+"",g))}var m=ih(a,"",o,l),y=sae(m),_=r.gradientCache,x=_[y];x||(x=r.zrId+"-g"+r.gradientIdx++,_[y]=x,o.id=x,r.defs[x]=ih(a,x,o,l)),e[t]=$z(x)}function o5e(n,e,t,r){var i=n.style[t],a=n.getBoundingRect(),o={},s=i.repeat,l=s==="no-repeat",u=s==="repeat-x",h=s==="repeat-y",c;if(h3e(i)){var f=i.imageWidth,d=i.imageHeight,v=void 0,p=i.image;if(Or(p)?v=p:r5e(p)?v=p.src:n5e(p)&&(v=p.toDataURL()),typeof Image>"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Bf(f,g),Bf(d,g)}else if(f==null||d==null){var m=function(C,A){if(C){var M=C.elm,I=f||A.width,R=d||A.height;C.tag==="pattern"&&(u?(R=1,I/=a.width):h&&(I=1,R/=a.height)),C.attrs.width=I,C.attrs.height=R,M&&(M.setAttribute("width",I),M.setAttribute("height",R))}},y=yie(v,null,n,function(C){l||m(w,C),m(c,C)});y&&y.width&&y.height&&(f=f||y.width,d=d||y.height)}c=ih("image","img",{href:v,width:f,height:d}),o.width=f,o.height=d}else i.svgElement&&(c=Sn(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(!!c){var _,x;l?_=x=1:u?(x=1,_=o.width/a.width):h?(_=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),x!=null&&!isNaN(x)&&(o.height=x);var S=p3e(i);S&&(o.patternTransform=S);var w=ih("pattern","",o,[c]),b=sae(w),E=r.patternCache,T=E[b];T||(T=r.zrId+"-p"+r.patternIdx++,E[b]=T,o.id=T,w=r.defs[T]=ih("pattern",T,o,[c])),e[t]=$z(T)}}function p0t(n,e,t){var r=t.clipPathCache,i=t.defs,a=r[n.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};r[n.id]=a,i[a]=ih("clipPath",a,o,[i5e(n,t)])}e["clip-path"]=$z(a)}function Yge(n){return document.createTextNode(n)}function Hb(n,e,t){n.insertBefore(e,t)}function qge(n,e){n.removeChild(e)}function Zge(n,e){n.appendChild(e)}function s5e(n){return n.parentNode}function l5e(n){return n.nextSibling}function nj(n,e){n.textContent=e}var Kge=58,g0t=120,y0t=ih("","");function OJ(n){return n===void 0}function Ey(n){return n!==void 0}function m0t(n,e,t){for(var r={},i=e;i<=t;++i){var a=n[i].key;a!==void 0&&(r[a]=i)}return r}function aO(n,e){var t=n.key===e.key,r=n.tag===e.tag;return r&&t}function mD(n){var e,t=n.children,r=n.tag;if(Ey(r)){var i=n.elm=e5e(r);if(hae(y0t,n),Gt(t))for(e=0;e<t.length;++e){var a=t[e];a!=null&&Zge(i,mD(a))}else Ey(n.text)&&!dn(n.text)&&Zge(i,Yge(n.text))}else n.elm=Yge(n.text);return n.elm}function u5e(n,e,t,r,i){for(;r<=i;++r){var a=t[r];a!=null&&Hb(n,mD(a),e)}}function TG(n,e,t,r){for(;t<=r;++t){var i=e[t];if(i!=null)if(Ey(i.tag)){var a=s5e(i.elm);qge(a,i.elm)}else qge(n,i.elm)}}function hae(n,e){var t,r=e.elm,i=n&&n.attrs||{},a=e.attrs||{};if(i!==a){for(t in a){var o=a[t],s=i[t];s!==o&&(o===!0?r.setAttribute(t,""):o===!1?r.removeAttribute(t):t.charCodeAt(0)!==g0t?r.setAttribute(t,o):t==="xmlns:xlink"||t==="xmlns"?r.setAttributeNS(Qgt,t,o):t.charCodeAt(3)===Kge?r.setAttributeNS(e0t,t,o):t.charCodeAt(5)===Kge?r.setAttributeNS(Q4e,t,o):r.setAttribute(t,o))}for(t in i)t in a||r.removeAttribute(t)}}function _0t(n,e,t){for(var r=0,i=0,a=e.length-1,o=e[0],s=e[a],l=t.length-1,u=t[0],h=t[l],c,f,d,v;r<=a&&i<=l;)o==null?o=e[++r]:s==null?s=e[--a]:u==null?u=t[++i]:h==null?h=t[--l]:aO(o,u)?(zC(o,u),o=e[++r],u=t[++i]):aO(s,h)?(zC(s,h),s=e[--a],h=t[--l]):aO(o,h)?(zC(o,h),Hb(n,o.elm,l5e(s.elm)),o=e[++r],h=t[--l]):aO(s,u)?(zC(s,u),Hb(n,s.elm,o.elm),s=e[--a],u=t[++i]):(OJ(c)&&(c=m0t(e,r,a)),f=c[u.key],OJ(f)?Hb(n,mD(u),o.elm):(d=e[f],d.tag!==u.tag?Hb(n,mD(u),o.elm):(zC(d,u),e[f]=void 0,Hb(n,d.elm,o.elm))),u=t[++i]);(r<=a||i<=l)&&(r>a?(v=t[l+1]==null?null:t[l+1].elm,u5e(n,v,t,i,l)):TG(n,e,r,a))}function zC(n,e){var t=e.elm=n.elm,r=n.children,i=e.children;n!==e&&(hae(n,e),OJ(e.text)?Ey(r)&&Ey(i)?r!==i&&_0t(t,r,i):Ey(i)?(Ey(n.text)&&nj(t,""),u5e(t,null,i,0,i.length-1)):Ey(r)?TG(t,r,0,r.length-1):Ey(n.text)&&nj(t,""):n.text!==e.text&&(Ey(r)&&TG(t,r,0,r.length-1),nj(t,e.text)))}function x0t(n,e){if(aO(n,e))zC(n,e);else{var t=n.elm,r=s5e(t);mD(e),r!==null&&(Hb(r,e.elm,l5e(t)),TG(r,[n],0,0))}return e}var S0t=0,w0t=function(){function n(e,t,r){if(this.type="svg",this.refreshHover=Jge(),this.configLayer=Jge(),this.storage=t,this._opts=r=Mt({},r),this.root=e,this._id="zr"+S0t++,this._oldVNode=Uge(r.width,r.height),e&&!r.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=e5e("svg");hae(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(r.width,r.height)}return n.prototype.getType=function(){return this.type},n.prototype.getViewportRoot=function(){return this._viewport},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.getSvgDom=function(){return this._svgDom},n.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",x0t(this._oldVNode,e),this._oldVNode=e}},n.prototype.renderOneToVNode=function(e){return Xge(e,PJ(this._id))},n.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),r=this._width,i=this._height,a=PJ(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress;var o=[],s=this._bgVNode=b0t(r,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=ih("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=Vt(Li(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(ih("defs","defs",{},u)),e.animation){var h=n0t(a.cssNodes,a.cssAnims,{newline:!0});if(h){var c=ih("style","stl",{},[],h);o.push(c)}}return Uge(r,i,o,e.useViewBox)},n.prototype.renderToString=function(e){return e=e||{},sae(this.renderToVNode({animation:ni(e.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:ni(e.useViewBox,!0)}),{newline:!0})},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e},n.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},n.prototype._paintList=function(e,t,r){for(var i=e.length,a=[],o=0,s,l,u=0,h=0;h<i;h++){var c=e[h];if(!c.invisible){var f=c.__clipPaths,d=f&&f.length||0,v=l&&l.length||0,p=void 0;for(p=Math.max(d-1,v-1);p>=0&&!(f&&l&&f[p]===l[p]);p--);for(var g=v-1;g>p;g--)o--,s=a[o-1];for(var m=p+1;m<d;m++){var y={};p0t(f[m],y,t);var _=ih("g","clip-g-"+u++,y,[]);(s?s.children:r).push(_),a[o++]=_,s=_}l=f;var x=Xge(c,t);x&&(s?s.children:r).push(x)}}},n.prototype.resize=function(e,t){var r=this._opts,i=this.root,a=this._viewport;if(e!=null&&(r.width=e),t!=null&&(r.height=t),i&&a&&(a.style.display="none",e=fA(i,0,r),t=fA(i,1,r),a.style.display=""),this._width!==e||this._height!==t){if(this._width=e,this._height=t,a){var o=a.style;o.width=e+"px",o.height=t+"px"}if(hie(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",e),s.setAttribute("height",t));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",e),l.setAttribute("height",t))}}},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},n.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},n.prototype.toDataURL=function(e){var t=this.renderToString(),r="data:image/svg+xml;";return e?(t=hut(t),t&&r+"base64,"+t):r+"charset=UTF-8,"+encodeURIComponent(t)},n}();function Jge(n){return function(){}}function b0t(n,e,t,r){var i;if(t&&t!=="none")if(i=ih("rect","bg",{width:n,height:e,x:"0",y:"0",id:"0"}),d3e(t))a5e({fill:t},i.attrs,"fill",r);else if(hie(t))o5e({style:{fill:t},dirty:Hl,getBoundingRect:function(){return{width:n,height:e}}},i.attrs,"fill",r);else{var a=nD(t),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs["fill-opacity"]=s)}return i}const E0t=w0t;function T0t(n){n.registerPainter("svg",E0t)}function Qge(n,e,t){var r=s_.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=r.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",r.setAttribute("data-zr-dom-id",n)),r.width=i*t,r.height=a*t,r}var C0t=function(n){$e(e,n);function e(t,r,i){var a=n.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||nG,typeof t=="string"?o=Qge(t,r,i):dn(t)&&(o=t,t=o.id),a.id=t,a.dom=o;var s=o.style;return s&&(YNe(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=r,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=Qge("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),t!==1&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,r,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new ai(0,0,0,0);function h(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var _=new ai(0,0,0,0);_.copy(y),o.push(_)}else{for(var x=!1,S=1/0,w=0,b=0;b<o.length;++b){var E=o[b];if(E.intersect(y)){var T=new ai(0,0,0,0);T.copy(E),T.union(y),o[b]=T,x=!0;break}else if(l){u.copy(y),u.union(E);var C=y.width*y.height,A=E.width*E.height,M=u.width*u.height,I=M-C-A;I<S&&(S=I,w=b)}}if(l&&(o[w].union(y),x=!0),!x){var _=new ai(0,0,0,0);_.copy(y),o.push(_)}l||(l=o.length>=s)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var f=t[c];if(f){var d=f.shouldBePainted(i,a,!0,!0),v=f.__isRendered&&(f.__dirty&ov||!d)?f.getPrevPaintRect():null;v&&h(v);var p=d&&(f.__dirty&ov||!f.__isRendered)?f.getPaintRect():null;p&&h(p)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var f=r[c],d=f.shouldBePainted(i,a,!0,!0);if(f&&(!d||!f.__zr)&&f.__isRendered){var v=f.getPrevPaintRect();v&&h(v)}}var g;do{g=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var m=c+1;m<o.length;)o[c].intersect(o[m])?(g=!0,o[c].union(o[m]),o.splice(m,1)):m++;c++}}while(g);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(t,r){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=t+"px",o.height=r+"px"),a.width=t*i,a.height=r*i,s&&(s.width=t*i,s.height=r*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(t,r,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;r=r||this.clearColor;var u=this.motionBlur&&!t,h=this.lastFrameAlpha,c=this.dpr,f=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/c,l/c));var d=this.domBack;function v(p,g,m,y){if(o.clearRect(p,g,m,y),r&&r!=="transparent"){var _=void 0;if(zz(r)){var x=r.global||r.__width===m&&r.__height===y;_=x&&r.__canvasGradient||wJ(o,r,{x:0,y:0,width:m,height:y}),r.__canvasGradient=_,r.__width=m,r.__height=y}else hlt(r)&&(r.scaleX=r.scaleX||c,r.scaleY=r.scaleY||c,_=bJ(o,r,{dirty:function(){f.setUnpainted(),f.__painter.refresh()}}));o.save(),o.fillStyle=_||r,o.fillRect(p,g,m,y),o.restore()}u&&(o.save(),o.globalAlpha=h,o.drawImage(d,p,g,m,y),o.restore())}!i||u?v(0,0,s,l):i.length&&te(i,function(p){v(p.x*c,p.y*c,p.width*c,p.height*c)})},e}(ng);const ij=C0t;var e0e=1e5,fb=314159,b4=.01,A0t=.001;function M0t(n){return n?n.__builtin__?!0:!(typeof n.resize!="function"||typeof n.refresh!="function"):!1}function I0t(n,e){var t=document.createElement("div");return t.style.cssText=["position:relative","width:"+n+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",t}var L0t=function(){function n(e,t,r,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=r=Mt({},r||{}),this.dpr=r.devicePixelRatio||nG,this._singleCanvas=a,this.root=e;var o=e.style;o&&(YNe(e),e.innerHTML=""),this.storage=t;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var h=e,c=h.width,f=h.height;r.width!=null&&(c=r.width),r.height!=null&&(f=r.height),this.dpr=r.devicePixelRatio||1,h.width=c*this.dpr,h.height=f*this.dpr,this._width=c,this._height=f;var d=new ij(h,this,this.dpr);d.__builtin__=!0,d.initContext(),l[fb]=d,d.zlevel=fb,s.push(fb),this._domRoot=e}else{this._width=fA(e,0,r),this._height=fA(e,1,r);var u=this._domRoot=I0t(this._width,this._height);e.appendChild(u)}}return n.prototype.getType=function(){return"canvas"},n.prototype.isSingleCanvas=function(){return this._singleCanvas},n.prototype.getViewportRoot=function(){return this._domRoot},n.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},n.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),r=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,r,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},n.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},n.prototype._paintHoverList=function(e){var t=e.length,r=this._hoverlayer;if(r&&r.clear(),!!t){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<t;o++){var s=e[o];s.__inHover&&(r||(r=this._hoverlayer=this.getLayer(e0e)),a||(a=r.ctx,a.save()),sE(a,s,i,o===t-1))}a&&a.restore()}},n.prototype.getHoverLayer=function(){return this.getLayer(e0e)},n.prototype.paintOne=function(e,t){HFe(e,t)},n.prototype._paintList=function(e,t,r,i){if(this._redrawId===i){r=r||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,t,r),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;zK(function(){l._paintList(e,t,r,i)})}}},n.prototype._compositeManually=function(){var e=this.getLayer(fb).ctx,t=this._domRoot.width,r=this._domRoot.height;e.clearRect(0,0,t,r),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,t,r)})},n.prototype._doPaintList=function(e,t,r){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||r)&&a.push(u)}for(var h=!0,c=!1,f=function(p){var g=a[p],m=g.ctx,y=o&&g.createRepaintRects(e,t,d._width,d._height),_=r?g.__startIndex:g.__drawIndex,x=!r&&g.incremental&&Date.now,S=x&&Date.now(),w=g.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(g.__startIndex===g.__endIndex)g.clear(!1,w,y);else if(_===g.__startIndex){var b=e[_];(!b.incremental||!b.notClear||r)&&g.clear(!1,w,y)}_===-1&&(console.error("For some unknown reason. drawIndex is -1"),_=g.__startIndex);var E,T=function(I){var R={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(E=_;E<g.__endIndex;E++){var k=e[E];if(k.__inHover&&(c=!0),i._doPaintEl(k,g,o,I,R,E===g.__endIndex-1),x){var D=Date.now()-S;if(D>15)break}}R.prevElClipPaths&&m.restore()};if(y)if(y.length===0)E=g.__endIndex;else for(var C=d.dpr,A=0;A<y.length;++A){var M=y[A];m.save(),m.beginPath(),m.rect(M.x*C,M.y*C,M.width*C,M.height*C),m.clip(),T(M),m.restore()}else m.save(),T(),m.restore();g.__drawIndex=E,g.__drawIndex<g.__endIndex&&(h=!1)},d=this,v=0;v<a.length;v++)f(v);return sa.wxa&&te(this._layers,function(p){p&&p.ctx&&p.ctx.draw&&p.ctx.draw()}),{finished:h,needsRefreshHover:c}},n.prototype._doPaintEl=function(e,t,r,i,a,o){var s=t.ctx;if(r){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(sE(s,e,a,o),e.setPrevPaintRect(l))}else sE(s,e,a,o)},n.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=fb);var r=this._layers[e];return r||(r=new ij("zr_"+e,this,this.dpr),r.zlevel=e,r.__builtin__=!0,this._layerConfig[e]?ii(r,this._layerConfig[e],!0):this._layerConfig[e-b4]&&ii(r,this._layerConfig[e-b4],!0),t&&(r.virtual=t),this.insertLayer(e,r),r.initContext()),r},n.prototype.insertLayer=function(e,t){var r=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(!r[e]&&!!M0t(t)){if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=r[i[l]]}if(i.splice(l+1,0,e),r[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.__painter=this}},n.prototype.eachLayer=function(e,t){for(var r=this._zlevelList,i=0;i<r.length;i++){var a=r[i];e.call(t,this._layers[a],a)}},n.prototype.eachBuiltinLayer=function(e,t){for(var r=this._zlevelList,i=0;i<r.length;i++){var a=r[i],o=this._layers[a];o.__builtin__&&e.call(t,o,a)}},n.prototype.eachOtherLayer=function(e,t){for(var r=this._zlevelList,i=0;i<r.length;i++){var a=r[i],o=this._layers[a];o.__builtin__||e.call(t,o,a)}},n.prototype.getLayers=function(){return this._layers},n.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(c,f){c.__dirty=c.__used=!1});function t(c){a&&(a.__endIndex!==c&&(a.__dirty=!0),a.__endIndex=c)}if(this._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,h=void 0;s!==u&&(s=u,o=0),i.incremental?(h=this.getLayer(u+A0t,this._needsManuallyCompositing),h.incremental=!0,o=1):h=this.getLayer(u+(o>0?b4:0),this._needsManuallyCompositing),h.__builtin__||rie("ZLevel "+u+" has been used by unkown layer "+h.id),h!==a&&(h.__used=!0,h.__startIndex!==l&&(h.__dirty=!0),h.__startIndex=l,h.incremental?h.__drawIndex=-1:h.__drawIndex=l,t(l),a=h),i.__dirty&ov&&!i.__inHover&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(c,f){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},n.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},n.prototype._clearLayer=function(e){e.clear()},n.prototype.setBackgroundColor=function(e){this._backgroundColor=e,te(this._layers,function(t){t.setUnpainted()})},n.prototype.configLayer=function(e,t){if(t){var r=this._layerConfig;r[e]?ii(r[e],t,!0):r[e]=t;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+b4){var o=this._layers[a];ii(o,r[e],!0)}}}},n.prototype.delLayer=function(e){var t=this._layers,r=this._zlevelList,i=t[e];!i||(i.dom.parentNode.removeChild(i.dom),delete t[e],r.splice(gi(r,e),1))},n.prototype.resize=function(e,t){if(this._domRoot.style){var r=this._domRoot;r.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),t!=null&&(i.height=t),e=fA(a,0,i),t=fA(a,1,i),r.style.display="",this._width!==e||t!==this._height){r.style.width=e+"px",r.style.height=t+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(fb).resize(e,t)}return this},n.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},n.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},n.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[fb].dom;var t=new ij("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var r=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,a=t.dom.height;this.eachLayer(function(c){c.__builtin__?r.drawImage(c.dom,0,0,i,a):c.renderToCanvas&&(r.save(),c.renderToCanvas(r),r.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var h=s[l];sE(r,h,o,l===u-1)}return t.dom},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n}();const P0t=L0t;function O0t(n){n.registerPainter("canvas",P0t)}var R0t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t){return k_(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var r=new Cn,i=hu("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);r.add(i),i.setStyle(t.lineStyle);var a=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=a==="none"?"circle":a,l=t.itemHeight*.8,u=hu(s,(t.itemWidth-l)/2,(t.itemHeight-l)/2,l,l,t.itemStyle.fill);r.add(u),u.setStyle(t.itemStyle);var h=t.iconRotate==="inherit"?o:t.iconRotate||0;return u.rotation=h*Math.PI/180,u.setOrigin([t.itemWidth/2,t.itemHeight/2]),s.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),r},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Ws);const D0t=R0t;function gM(n,e){var t=n.mapDimensionsAll("defaultedLabel"),r=t.length;if(r===1){var i=dM(n,e,t[0]);return i!=null?i+"":null}else if(r){for(var a=[],o=0;o<t.length;o++)a.push(dM(n,e,t[o]));return a.join(" ")}}function h5e(n,e){var t=n.mapDimensionsAll("defaultedLabel");if(!Gt(e))return e+"";for(var r=[],i=0;i<t.length;i++){var a=n.getDimensionIndex(t[i]);a>=0&&r.push(e[a])}return r.join(" ")}var N0t=function(n){$e(e,n);function e(t,r,i,a){var o=n.call(this)||this;return o.updateData(t,r,i,a),o}return e.prototype._createSymbol=function(t,r,i,a,o){this.removeAll();var s=hu(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=k0t,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){h_(this.childAt(0))},e.prototype.downplay=function(){c_(this.childAt(0))},e.prototype.setZ=function(t,r){var i=this.childAt(0);i.zlevel=t,i.z=r},e.prototype.setDraggable=function(t,r){var i=this.childAt(0);i.draggable=t,i.cursor=!r&&t?"move":i.cursor},e.prototype.updateData=function(t,r,i,a){this.silent=!1;var o=t.getItemVisual(r,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,r),u=o!==this._symbolType,h=a&&a.disableAnimation;if(u){var c=t.getItemVisual(r,"symbolKeepAspect");this._createSymbol(o,t,r,l,c)}else{var f=this.childAt(0);f.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};h?f.attr(d):ma(f,d,s,r),x0(f)}if(this._updateCommon(t,r,l,i,a),u){var f=this.childAt(0);if(!h){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,Is(f,d,s,r)}}h&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,r,i,a,o){var s=this.childAt(0),l=t.hostModel,u,h,c,f,d,v,p,g,m;if(a&&(u=a.emphasisItemStyle,h=a.blurItemStyle,c=a.selectItemStyle,f=a.focus,d=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,v=a.emphasisDisabled),!a||t.hasItemOption){var y=a&&a.itemModel?a.itemModel:t.getItemModel(r),_=y.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),c=y.getModel(["select","itemStyle"]).getItemStyle(),h=y.getModel(["blur","itemStyle"]).getItemStyle(),f=_.get("focus"),d=_.get("blurScope"),v=_.get("disabled"),p=hh(y),g=_.getShallow("scale"),m=y.getShallow("cursor")}var x=t.getItemVisual(r,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=Y2(t.getItemVisual(r,"symbolOffset"),i);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var w=t.getItemVisual(r,"style"),b=w.fill;if(s instanceof xc){var E=s.style;s.useStyle(Mt({image:E.image,x:E.x,y:E.y,width:E.width,height:E.height},w))}else s.__isEmptyBrush?s.useStyle(Mt({},w)):s.useStyle(w),s.style.decal=null,s.setColor(b,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var T=t.getItemVisual(r,"liftZ"),C=this._z2;T!=null?C==null&&(this._z2=s.z2,s.z2+=T):C!=null&&(s.z2=C,this._z2=null);var A=o&&o.useNameLabel;vc(s,p,{labelFetcher:l,labelDataIndex:r,defaultText:M,inheritColor:b,defaultOpacity:w.opacity});function M(k){return A?t.getName(k):gM(t,k)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var I=s.ensureState("emphasis");I.style=u,s.ensureState("select").style=c,s.ensureState("blur").style=h;var R=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;I.scaleX=this._sizeX*R,I.scaleY=this._sizeY*R,this.setSymbolScale(1),vl(this,f,d,v)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,r,i){var a=this.childAt(0),o=Bn(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&NS(l,{style:{opacity:0}},r,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();NS(a,{style:{opacity:0},scaleX:0,scaleY:0},r,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,r){return $I(t.getItemVisual(r,"symbolSize"))},e}(Cn);function k0t(n,e){this.parent.drift(n,e)}const C3=N0t;function aj(n,e,t,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r.isIgnore&&r.isIgnore(t))&&!(r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&n.getItemVisual(t,"symbol")!=="none"}function t0e(n){return n!=null&&!dn(n)&&(n={isIgnore:n}),n||{}}function r0e(n){var e=n.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:hh(e),cursorStyle:e.get("cursor")}}var F0t=function(){function n(e){this.group=new Cn,this._SymbolCtor=e||C3}return n.prototype.updateData=function(e,t){this._progressiveEls=null,t=t0e(t);var r=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=r0e(e),u={disableAnimation:s},h=t.getSymbolPoint||function(c){return e.getItemLayout(c)};a||r.removeAll(),e.diff(a).add(function(c){var f=h(c);if(aj(e,f,c,t)){var d=new o(e,c,l,u);d.setPosition(f),e.setItemGraphicEl(c,d),r.add(d)}}).update(function(c,f){var d=a.getItemGraphicEl(f),v=h(c);if(!aj(e,v,c,t)){r.remove(d);return}var p=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==p)r.remove(d),d=new o(e,c,l,u),d.setPosition(v);else{d.updateData(e,c,l,u);var m={x:v[0],y:v[1]};s?d.attr(m):ma(d,m,i)}r.add(d),e.setItemGraphicEl(c,d)}).remove(function(c){var f=a.getItemGraphicEl(c);f&&f.fadeOut(function(){r.remove(f)},i)}).execute(),this._getSymbolPoint=h,this._data=e},n.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(r,i){var a=e._getSymbolPoint(i);r.setPosition(a),r.markRedraw()})},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=r0e(e),this._data=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t,r){this._progressiveEls=[],r=t0e(r);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a<e.end;a++){var o=t.getItemLayout(a);if(aj(t,o,a,r)){var s=new this._SymbolCtor(t,a,this._seriesScope);s.traverse(i),s.setPosition(o),this.group.add(s),t.setItemGraphicEl(a,s),this._progressiveEls.push(s)}}},n.prototype.eachRendered=function(e){_w(this._progressiveEls||this.group,e)},n.prototype.remove=function(e){var t=this.group,r=this._data;r&&e?r.eachItemGraphicEl(function(i){i.fadeOut(function(){t.remove(i)},r.hostModel)}):t.removeAll()},n}();const A3=F0t;function c5e(n,e,t){var r=n.getBaseAxis(),i=n.getOtherAxis(r),a=B0t(i,t),o=r.dim,s=i.dim,l=e.mapDimension(s),u=e.mapDimension(o),h=s==="x"||s==="radius"?1:0,c=Vt(n.dimensions,function(v){return e.mapDimension(v)}),f=!1,d=e.getCalculationInfo("stackResultDimension");return FS(e,c[0])&&(f=!0,c[0]=d),FS(e,c[1])&&(f=!0,c[1]=d),{dataDimsForPoint:c,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:l,baseDim:u,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function B0t(n,e){var t=0,r=n.scale.getExtent();return e==="start"?t=r[0]:e==="end"?t=r[1]:ha(e)&&!isNaN(e)?t=e:r[0]>0?t=r[0]:r[1]<0&&(t=r[1]),t}function f5e(n,e,t,r){var i=NaN;n.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=n.valueStart);var a=n.baseDataOffset,o=[];return o[a]=t.get(n.baseDim,r),o[1-a]=i,e.dataToPoint(o)}function G0t(n,e){var t=[];return e.diff(n).add(function(r){t.push({cmd:"+",idx:r})}).update(function(r,i){t.push({cmd:"=",idx:i,idx1:r})}).remove(function(r){t.push({cmd:"-",idx:r})}).execute(),t}function z0t(n,e,t,r,i,a,o,s){for(var l=G0t(n,e),u=[],h=[],c=[],f=[],d=[],v=[],p=[],g=c5e(i,e,o),m=n.getLayout("points")||[],y=e.getLayout("points")||[],_=0;_<l.length;_++){var x=l[_],S=!0,w=void 0,b=void 0;switch(x.cmd){case"=":w=x.idx*2,b=x.idx1*2;var E=m[w],T=m[w+1],C=y[b],A=y[b+1];(isNaN(E)||isNaN(T))&&(E=C,T=A),u.push(E,T),h.push(C,A),c.push(t[w],t[w+1]),f.push(r[b],r[b+1]),p.push(e.getRawIndex(x.idx1));break;case"+":var M=x.idx,I=g.dataDimsForPoint,R=i.dataToPoint([e.get(I[0],M),e.get(I[1],M)]);b=M*2,u.push(R[0],R[1]),h.push(y[b],y[b+1]);var k=f5e(g,i,e,M);c.push(k[0],k[1]),f.push(r[b],r[b+1]),p.push(e.getRawIndex(M));break;case"-":S=!1}S&&(d.push(x),v.push(v.length))}v.sort(function(Q,ie){return p[Q]-p[ie]});for(var D=u.length,G=Fy(D),W=Fy(D),z=Fy(D),V=Fy(D),q=[],_=0;_<v.length;_++){var Y=v[_],le=_*2,j=Y*2;G[le]=u[j],G[le+1]=u[j+1],W[le]=h[j],W[le+1]=h[j+1],z[le]=c[j],z[le+1]=c[j+1],V[le]=f[j],V[le+1]=f[j+1],q[_]=d[Y]}return{current:G,next:W,stackedOnCurrent:z,stackedOnNext:V,status:q}}var lx=Math.min,ux=Math.max;function IE(n,e){return isNaN(n)||isNaN(e)}function RJ(n,e,t,r,i,a,o,s,l){for(var u,h,c,f,d,v,p=t,g=0;g<r;g++){var m=e[p*2],y=e[p*2+1];if(p>=i||p<0)break;if(IE(m,y)){if(l){p+=a;continue}break}if(p===t)n[a>0?"moveTo":"lineTo"](m,y),c=m,f=y;else{var _=m-u,x=y-h;if(_*_+x*x<.5){p+=a;continue}if(o>0){for(var S=p+a,w=e[S*2],b=e[S*2+1];w===m&&b===y&&g<r;)g++,S+=a,p+=a,w=e[S*2],b=e[S*2+1],m=e[p*2],y=e[p*2+1],_=m-u,x=y-h;var E=g+1;if(l)for(;IE(w,b)&&E<r;)E++,S+=a,w=e[S*2],b=e[S*2+1];var T=.5,C=0,A=0,M=void 0,I=void 0;if(E>=r||IE(w,b))d=m,v=y;else{C=w-u,A=b-h;var R=m-u,k=w-m,D=y-h,G=b-y,W=void 0,z=void 0;if(s==="x"){W=Math.abs(R),z=Math.abs(k);var V=C>0?1:-1;d=m-V*W*o,v=y,M=m+V*z*o,I=y}else if(s==="y"){W=Math.abs(D),z=Math.abs(G);var q=A>0?1:-1;d=m,v=y-q*W*o,M=m,I=y+q*z*o}else W=Math.sqrt(R*R+D*D),z=Math.sqrt(k*k+G*G),T=z/(z+W),d=m-C*o*(1-T),v=y-A*o*(1-T),M=m+C*o*T,I=y+A*o*T,M=lx(M,ux(w,m)),I=lx(I,ux(b,y)),M=ux(M,lx(w,m)),I=ux(I,lx(b,y)),C=M-m,A=I-y,d=m-C*W/z,v=y-A*W/z,d=lx(d,ux(u,m)),v=lx(v,ux(h,y)),d=ux(d,lx(u,m)),v=ux(v,lx(h,y)),C=m-d,A=y-v,M=m+C*z/W,I=y+A*z/W}n.bezierCurveTo(c,f,d,v,m,y),c=M,f=I}else n.lineTo(m,y)}u=m,h=y,p+=a}return g}var d5e=function(){function n(){this.smooth=0,this.smoothConstraint=!0}return n}(),U0t=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polyline",r}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new d5e},e.prototype.buildPath=function(t,r){var i=r.points,a=0,o=i.length/2;if(r.connectNulls){for(;o>0&&IE(i[o*2-2],i[o*2-1]);o--);for(;a<o&&IE(i[a*2],i[a*2+1]);a++);}for(;a<o;)a+=RJ(t,i,a,o,o,1,r.smooth,r.smoothMonotone,r.connectNulls)+1},e.prototype.getPointOn=function(t,r){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var i=this.path,a=i.data,o=hm.CMD,s,l,u=r==="x",h=[],c=0;c<a.length;){var f=a[c++],d=void 0,v=void 0,p=void 0,g=void 0,m=void 0,y=void 0,_=void 0;switch(f){case o.M:s=a[c++],l=a[c++];break;case o.L:if(d=a[c++],v=a[c++],_=u?(t-s)/(d-s):(t-l)/(v-l),_<=1&&_>=0){var x=u?(v-l)*_+l:(d-s)*_+s;return u?[t,x]:[x,t]}s=d,l=v;break;case o.C:d=a[c++],v=a[c++],p=a[c++],g=a[c++],m=a[c++],y=a[c++];var S=u?Q8(s,d,p,m,t,h):Q8(l,v,g,y,t,h);if(S>0)for(var w=0;w<S;w++){var b=h[w];if(b<=1&&b>=0){var x=u?Qu(l,v,g,y,b):Qu(s,d,p,m,b);return u?[t,x]:[x,t]}}s=m,l=y;break}}},e}(Si),V0t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(d5e),v5e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-polygon",r}return e.prototype.getDefaultShape=function(){return new V0t},e.prototype.buildPath=function(t,r){var i=r.points,a=r.stackedOnPoints,o=0,s=i.length/2,l=r.smoothMonotone;if(r.connectNulls){for(;s>0&&IE(i[s*2-2],i[s*2-1]);s--);for(;o<s&&IE(i[o*2],i[o*2+1]);o++);}for(;o<s;){var u=RJ(t,i,o,s,s,1,r.smooth,l,r.connectNulls);RJ(t,a,o+u-1,u,s,-1,r.stackedOnSmooth,l,r.connectNulls),o+=u+1,t.closePath()}},e}(Si);function p5e(n,e,t,r,i){var a=n.getArea(),o=a.x,s=a.y,l=a.width,u=a.height,h=t.get(["lineStyle","width"])||2;o-=h/2,s-=h/2,l+=h,u+=h,o=Math.floor(o),l=Math.round(l);var c=new ta({shape:{x:o,y:s,width:l,height:u}});if(e){var f=n.getBaseAxis(),d=f.isHorizontal(),v=f.inverse;d?(v&&(c.shape.x+=l),c.shape.width=0):(v||(c.shape.y+=u),c.shape.height=0);var p=rn(i)?function(g){i(g,c)}:null;Is(c,{shape:{width:l,height:u,x:o,y:s}},t,null,r,p)}return c}function g5e(n,e,t){var r=n.getArea(),i=Pl(r.r0,1),a=Pl(r.r,1),o=new wd({shape:{cx:Pl(n.cx,1),cy:Pl(n.cy,1),r0:i,r:a,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});if(e){var s=n.getBaseAxis().dim==="angle";s?o.shape.endAngle=r.startAngle:o.shape.r=i,Is(o,{shape:{endAngle:r.endAngle,r:a}},t)}return o}function yU(n,e,t,r,i){if(n){if(n.type==="polar")return g5e(n,e,t);if(n.type==="cartesian2d")return p5e(n,e,t,r,i)}else return null;return null}function Z2(n,e){return n.type===e}function n0e(n,e){if(n.length===e.length){for(var t=0;t<n.length;t++)if(n[t]!==e[t])return;return!0}}function i0e(n){for(var e=1/0,t=1/0,r=-1/0,i=-1/0,a=0;a<n.length;){var o=n[a++],s=n[a++];isNaN(o)||(e=Math.min(o,e),r=Math.max(o,r)),isNaN(s)||(t=Math.min(s,t),i=Math.max(s,i))}return[[e,t],[r,i]]}function a0e(n,e){var t=i0e(n),r=t[0],i=t[1],a=i0e(e),o=a[0],s=a[1];return Math.max(Math.abs(r[0]-o[0]),Math.abs(r[1]-o[1]),Math.abs(i[0]-s[0]),Math.abs(i[1]-s[1]))}function o0e(n){return ha(n)?n:n?.5:0}function $0t(n,e,t){if(!t.valueDim)return[];for(var r=e.count(),i=Fy(r*2),a=0;a<r;a++){var o=f5e(t,n,e,a);i[a*2]=o[0],i[a*2+1]=o[1]}return i}function hx(n,e,t,r){var i=e.getBaseAxis(),a=i.dim==="x"||i.dim==="radius"?0:1,o=[],s=0,l=[],u=[],h=[],c=[];if(r){for(s=0;s<n.length;s+=2)!isNaN(n[s])&&!isNaN(n[s+1])&&c.push(n[s],n[s+1]);n=c}for(s=0;s<n.length-2;s+=2)switch(h[0]=n[s+2],h[1]=n[s+3],u[0]=n[s],u[1]=n[s+1],o.push(u[0],u[1]),t){case"end":l[a]=h[a],l[1-a]=u[1-a],o.push(l[0],l[1]);break;case"middle":var f=(u[a]+h[a])/2,d=[];l[a]=d[a]=f,l[1-a]=u[1-a],d[1-a]=h[1-a],o.push(l[0],l[1]),o.push(d[0],d[1]);break;default:l[a]=u[a],l[1-a]=h[1-a],o.push(l[0],l[1])}return o.push(n[s++],n[s++]),o}function W0t(n,e){var t=[],r=n.length,i,a;function o(h,c,f){var d=h.coord,v=(f-d)/(c.coord-d),p=nut(v,[h.color,c.color]);return{coord:f,color:p}}for(var s=0;s<r;s++){var l=n[s],u=l.coord;if(u<0)i=l;else if(u>e){a?t.push(o(a,l,e)):i&&t.push(o(i,l,0),o(i,l,e));break}else i&&(t.push(o(i,l,0)),i=null),t.push(l),a=l}return t}function H0t(n,e,t){var r=n.getVisual("visualMeta");if(!(!r||!r.length||!n.count())&&e.type==="cartesian2d"){for(var i,a,o=r.length-1;o>=0;o--){var s=n.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=r[o];break}}if(!!a){var l=e.getAxis(i),u=Vt(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),h=u.length,c=a.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var f=W0t(u,i==="x"?t.getWidth():t.getHeight()),d=f.length;if(!d&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var v=10,p=f[0].coord-v,g=f[d-1].coord+v,m=g-p;if(m<.001)return"transparent";te(f,function(_){_.offset=(_.coord-p)/m}),f.push({offset:d?f[d-1].offset:.5,color:c[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:c[0]||"transparent"});var y=new y3(0,0,0,0,f,!0);return y[i]=p,y[i+"2"]=g,y}}}function j0t(n,e,t){var r=n.get("showAllSymbol"),i=r==="auto";if(!(r&&!i)){var a=t.getAxesByScale("ordinal")[0];if(!!a&&!(i&&X0t(a,e))){var o=e.mapDimension(a.dim),s={};return te(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function X0t(n,e){var t=n.getExtent(),r=Math.abs(t[1]-t[0])/n.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),o=0;o<i;o+=a)if(C3.getSymbolSize(e,o)[n.isHorizontal()?1:0]*1.5>r)return!1;return!0}function Y0t(n,e){return isNaN(n)||isNaN(e)}function q0t(n){for(var e=n.length/2;e>0&&Y0t(n[e*2-2],n[e*2-1]);e--);return e-1}function s0e(n,e){return[n[e*2],n[e*2+1]]}function Z0t(n,e,t){for(var r=n.length/2,i=t==="x"?0:1,a,o,s=0,l=-1,u=0;u<r;u++)if(o=n[u*2+i],!(isNaN(o)||isNaN(n[u*2+1-i]))){if(u===0){a=o;continue}if(a<=e&&o>=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function y5e(n){if(n.get(["endLabel","show"]))return!0;for(var e=0;e<Gf.length;e++)if(n.get([Gf[e],"endLabel","show"]))return!0;return!1}function oj(n,e,t,r){if(Z2(e,"cartesian2d")){var i=r.getModel("endLabel"),a=i.get("valueAnimation"),o=r.getData(),s={lastFrameIndex:0},l=y5e(r)?function(d,v){n._endLabelOnDuring(d,v,o,s,a,i,e)}:null,u=e.getBaseAxis().isHorizontal(),h=p5e(e,t,r,function(){var d=n._endLabel;d&&t&&s.originalX!=null&&d.attr({x:s.originalX,y:s.originalY})},l);if(!r.get("clip",!0)){var c=h.shape,f=Math.max(c.width,c.height);u?(c.y-=f,c.height+=f*2):(c.x-=f,c.width+=f*2)}return l&&l(1,h),h}else return g5e(e,t,r)}function K0t(n,e){var t=e.getBaseAxis(),r=t.isHorizontal(),i=t.inverse,a=r?i?"right":"left":"center",o=r?"middle":i?"top":"bottom";return{normal:{align:n.get("align")||a,verticalAlign:n.get("verticalAlign")||o}}}var J0t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(){var t=new Cn,r=new A3;this.group.add(r.group),this._symbolDraw=r,this._lineGroup=t},e.prototype.render=function(t,r,i){var a=this,o=t.coordinateSystem,s=this.group,l=t.getData(),u=t.getModel("lineStyle"),h=t.getModel("areaStyle"),c=l.getLayout("points")||[],f=o.type==="polar",d=this._coordSys,v=this._symbolDraw,p=this._polyline,g=this._polygon,m=this._lineGroup,y=!r.ssr&&t.isAnimationEnabled(),_=!h.isEmpty(),x=h.get("origin"),S=c5e(o,l,x),w=_&&$0t(o,l,S),b=t.get("showSymbol"),E=t.get("connectNulls"),T=b&&!f&&j0t(t,l,o),C=this._data;C&&C.eachItemGraphicEl(function(ie,oe){ie.__temp&&(s.remove(ie),C.setItemGraphicEl(oe,null))}),b||v.remove(),s.add(m);var A=f?!1:t.get("step"),M;o&&o.getArea&&t.get("clip",!0)&&(M=o.getArea(),M.width!=null?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var I=H0t(l,o,i)||l.getVisual("style")[l.getVisual("drawType")];if(!(p&&d.type===o.type&&A===this._step))b&&v.updateData(l,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(ie){return[c[ie*2],c[ie*2+1]]}}),y&&this._initSymbolLabelAnimation(l,o,M),A&&(c=hx(c,o,A,E),w&&(w=hx(w,o,A,E))),p=this._newPolyline(c),_?g=this._newPolygon(c,w):g&&(m.remove(g),g=this._polygon=null),f||this._initOrUpdateEndLabel(t,o,KE(I)),m.setClipPath(oj(this,o,!0,t));else{_&&!g?g=this._newPolygon(c,w):g&&!_&&(m.remove(g),g=this._polygon=null),f||this._initOrUpdateEndLabel(t,o,KE(I));var R=m.getClipPath();if(R){var k=oj(this,o,!1,t);Is(R,{shape:k.shape},t)}else m.setClipPath(oj(this,o,!0,t));b&&v.updateData(l,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(ie){return[c[ie*2],c[ie*2+1]]}}),(!n0e(this._stackedOnPoints,w)||!n0e(this._points,c))&&(y?this._doUpdateAnimation(l,w,o,i,A,x,E):(A&&(c=hx(c,o,A,E),w&&(w=hx(w,o,A,E))),p.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:w})))}var D=t.getModel("emphasis"),G=D.get("focus"),W=D.get("blurScope"),z=D.get("disabled");if(p.useStyle(sn(u.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),dc(p,t,"lineStyle"),p.style.lineWidth>0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var V=p.getState("emphasis").style;V.lineWidth=+p.style.lineWidth+1}Bn(p).seriesIndex=t.seriesIndex,vl(p,G,W,z);var q=o0e(t.get("smooth")),Y=t.get("smoothMonotone");if(p.setShape({smooth:q,smoothMonotone:Y,connectNulls:E}),g){var le=l.getCalculationInfo("stackedOnSeries"),j=0;g.useStyle(sn(h.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),le&&(j=o0e(le.get("smooth"))),g.setShape({smooth:q,stackedOnSmooth:j,smoothMonotone:Y,connectNulls:E}),dc(g,t,"areaStyle"),Bn(g).seriesIndex=t.seriesIndex,vl(g,G,W,z)}var Q=function(ie){a._changePolyState(ie)};l.eachItemGraphicEl(function(ie){ie&&(ie.onHoverStateChange=Q)}),this._polyline.onHoverStateChange=Q,this._data=l,this._coordSys=o,this._stackedOnPoints=w,this._points=c,this._step=A,this._valueOrigin=x,t.get("triggerLineEvent")&&(this.packEventData(t,p),g&&this.packEventData(t,g))},e.prototype.packEventData=function(t,r){Bn(r).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,r,i,a){var o=t.getData(),s=YE(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var h=l[s*2],c=l[s*2+1];if(isNaN(h)||isNaN(c)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,c))return;var f=t.get("zlevel")||0,d=t.get("z")||0;u=new C3(o,s),u.x=h,u.y=c,u.setZ(f,d);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=f,v.z=d,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else os.prototype.highlight.call(this,t,r,i,a)},e.prototype.downplay=function(t,r,i,a){var o=t.getData(),s=YE(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else os.prototype.downplay.call(this,t,r,i,a)},e.prototype._changePolyState=function(t){var r=this._polygon;sG(this._polyline,t),r&&sG(r,t)},e.prototype._newPolyline=function(t){var r=this._polyline;return r&&this._lineGroup.remove(r),r=new U0t({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(r),this._polyline=r,r},e.prototype._newPolygon=function(t,r){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new v5e({shape:{points:t,stackedOnPoints:r},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,r,i){var a,o,s=r.getBaseAxis(),l=s.inverse;r.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):r.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,h=u.get("animationDuration");rn(h)&&(h=h(null));var c=u.get("animationDelay")||0,f=rn(c)?c(null):c;t.eachItemGraphicEl(function(d,v){var p=d;if(p){var g=[d.x,d.y],m=void 0,y=void 0,_=void 0;if(i)if(o){var x=i,S=r.pointToCoord(g);a?(m=x.startAngle,y=x.endAngle,_=-S[1]/180*Math.PI):(m=x.r0,y=x.r,_=S[0])}else{var w=i;a?(m=w.x,y=w.x+w.width,_=d.x):(m=w.y+w.height,y=w.y,_=d.y)}var b=y===m?0:(_-m)/(y-m);l&&(b=1-b);var E=rn(c)?c(v):h*b+f,T=p.getSymbolPath(),C=T.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:E}),C&&C.animateFrom({style:{opacity:0}},{duration:300,delay:E}),T.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,r,i){var a=t.getModel("endLabel");if(y5e(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new la({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var h=q0t(l);h>=0&&(vc(s,hh(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:h,defaultText:function(c,f,d){return d!=null?h5e(o,d):gM(o,c)},enableTextSetter:!0},K0t(a,r)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,r,i,a,o,s,l){var u=this._endLabel,h=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var c=i.getLayout("points"),f=i.hostModel,d=f.get("connectNulls"),v=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),y=g.inverse,_=r.shape,x=y?m?_.x:_.y+_.height:m?_.x+_.width:_.y,S=(m?p:0)*(y?-1:1),w=(m?0:-p)*(y?-1:1),b=m?"x":"y",E=Z0t(c,x,b),T=E.range,C=T[1]-T[0],A=void 0;if(C>=1){if(C>1&&!d){var M=s0e(c,T[0]);u.attr({x:M[0]+S,y:M[1]+w}),o&&(A=f.getRawValue(T[0]))}else{var M=h.getPointOn(x,b);M&&u.attr({x:M[0]+S,y:M[1]+w});var I=f.getRawValue(T[0]),R=f.getRawValue(T[1]);o&&(A=k3e(i,v,I,R,E.t))}a.lastFrameIndex=T[0]}else{var k=t===1||a.lastFrameIndex>0?T[0]:0,M=s0e(c,k);o&&(A=f.getRawValue(k)),u.attr({x:M[0]+S,y:M[1]+w})}if(o){var D=NI(u);typeof D.setLabelText=="function"&&D.setLabelText(A)}}},e.prototype._doUpdateAnimation=function(t,r,i,a,o,s,l){var u=this._polyline,h=this._polygon,c=t.hostModel,f=z0t(this._data,t,this._stackedOnPoints,r,this._coordSys,i,this._valueOrigin),d=f.current,v=f.stackedOnCurrent,p=f.next,g=f.stackedOnNext;if(o&&(d=hx(f.current,i,o,l),v=hx(f.stackedOnCurrent,i,o,l),p=hx(f.next,i,o,l),g=hx(f.stackedOnNext,i,o,l)),a0e(d,p)>3e3||h&&a0e(v,g)>3e3){u.stopAnimation(),u.setShape({points:p}),h&&(h.stopAnimation(),h.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=f.current,u.shape.points=d;var m={shape:{points:p}};f.current!==d&&(m.shape.__points=f.next),u.stopAnimation(),ma(u,m,c),h&&(h.setShape({points:d,stackedOnPoints:v}),h.stopAnimation(),ma(h,{shape:{stackedOnPoints:g}},c),u.shape.points!==h.shape.points&&(h.shape.points=u.shape.points));for(var y=[],_=f.status,x=0;x<_.length;x++){var S=_[x].cmd;if(S==="="){var w=t.getItemGraphicEl(_[x].idx1);w&&y.push({el:w,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){h&&h.dirtyShape();for(var b=u.shape.__points,E=0;E<y.length;E++){var T=y[E].el,C=y[E].ptIdx*2;T.x=b[C],T.y=b[C+1],T.markRedraw()}})},e.prototype.remove=function(t){var r=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl(function(a,o){a.__temp&&(r.remove(a),i.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(os);const Q0t=J0t;function M3(n,e){return{seriesType:n,plan:UI(),reset:function(t){var r=t.getData(),i=t.coordinateSystem,a=t.pipelineContext,o=e||a.large;if(!!i){var s=Vt(i.dimensions,function(d){return r.mapDimension(d)}).slice(0,2),l=s.length,u=r.getCalculationInfo("stackResultDimension");FS(r,s[0])&&(s[0]=u),FS(r,s[1])&&(s[1]=u);var h=r.getStore(),c=r.getDimensionIndex(s[0]),f=r.getDimensionIndex(s[1]);return l&&{progress:function(d,v){for(var p=d.end-d.start,g=o&&Fy(p*l),m=[],y=[],_=d.start,x=0;_<d.end;_++){var S=void 0;if(l===1){var w=h.get(c,_);S=i.dataToPoint(w,null,y)}else m[0]=h.get(c,_),m[1]=h.get(f,_),S=i.dataToPoint(m,null,y);o?(g[x++]=S[0],g[x++]=S[1]):v.setItemLayout(_,S.slice())}o&&v.setLayout("points",g)}}}}}}var eyt={average:function(n){for(var e=0,t=0,r=0;r<n.length;r++)isNaN(n[r])||(e+=n[r],t++);return t===0?NaN:e/t},sum:function(n){for(var e=0,t=0;t<n.length;t++)e+=n[t]||0;return e},max:function(n){for(var e=-1/0,t=0;t<n.length;t++)n[t]>e&&(e=n[t]);return isFinite(e)?e:NaN},min:function(n){for(var e=1/0,t=0;t<n.length;t++)n[t]<e&&(e=n[t]);return isFinite(e)?e:NaN},nearest:function(n){return n[0]}},tyt=function(n){return Math.round(n.length/2)};function m5e(n){return{seriesType:n,reset:function(e,t,r){var i=e.getData(),a=e.get("sampling"),o=e.coordinateSystem,s=i.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),h=l.getExtent(),c=r.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(c||1),d=Math.round(s/f);if(isFinite(d)&&d>1){a==="lttb"&&e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d));var v=void 0;Or(a)?v=eyt[a]:rn(a)&&(v=a),v&&e.setData(i.downSample(i.mapDimension(u.dim),1/d,v,tyt))}}}}}function ryt(n){n.registerChartView(Q0t),n.registerSeriesModel(D0t),n.registerLayout(M3("line",!0)),n.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),r=e.getModel("lineStyle").getLineStyle();r&&!r.stroke&&(r.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",r)}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,m5e("line"))}var _5e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,r,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(i)te(a.getAxes(),function(f,d){if(f.type==="category"&&r!=null){var v=f.getTicksCoords(),p=o[d],g=r[d]==="x1"||r[d]==="y1";if(g&&(p+=1),v.length<2)return;if(v.length===2){s[d]=f.toGlobalCoord(f.getExtent()[g?1:0]);return}for(var m=void 0,y=void 0,_=1,x=0;x<v.length;x++){var S=v[x].coord,w=x===v.length-1?v[x-1].tickValue+_:v[x].tickValue;if(w===p){y=S;break}else if(w<p)m=S;else if(m!=null&&w>p){y=(S+m)/2;break}x===1&&(_=w-v[0].tickValue)}y==null&&(m?m&&(y=v[v.length-1].coord):y=v[0].coord),s[d]=f.toGlobalCoord(y)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),c=a.getBaseAxis().isHorizontal()?0:1;s[c]+=u+h/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Ws);Ws.registerClass(_5e);const CG=_5e;var nyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return k_(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),r=this.get("largeThreshold");return r>t&&(t=r),t},e.prototype.brushSelector=function(t,r,i){return i.rect(r.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=xw(CG.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(CG);const iyt=nyt;var ayt=function(){function n(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return n}(),oyt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="sausage",r}return e.prototype.getDefaultShape=function(){return new ayt},e.prototype.buildPath=function(t,r){var i=r.cx,a=r.cy,o=Math.max(r.r0||0,0),s=Math.max(r.r,0),l=(s-o)*.5,u=o+l,h=r.startAngle,c=r.endAngle,f=r.clockwise,d=Math.PI*2,v=f?c-h<d:h-c<d;v||(h=c-(f?d:-d));var p=Math.cos(h),g=Math.sin(h),m=Math.cos(c),y=Math.sin(c);v?(t.moveTo(p*o+i,g*o+a),t.arc(p*u+i,g*u+a,l,-Math.PI+h,h,!f)):t.moveTo(p*s+i,g*s+a),t.arc(i,a,s,h,c,!f),t.arc(m*u+i,y*u+a,l,c-Math.PI*2,c-Math.PI,!f),o!==0&&t.arc(i,a,o,c,h,f)},e}(Si);const AG=oyt;function syt(n,e){e=e||{};var t=e.isRoundCap;return function(r,i,a){var o=i.position;if(!o||o instanceof Array)return iG(r,i,a);var s=n(o),l=i.distance!=null?i.distance:5,u=this.shape,h=u.cx,c=u.cy,f=u.r,d=u.r0,v=(f+d)/2,p=u.startAngle,g=u.endAngle,m=(p+g)/2,y=t?Math.abs(f-d)/2:0,_=Math.cos,x=Math.sin,S=h+f*_(p),w=c+f*x(p),b="left",E="top";switch(s){case"startArc":S=h+(d-l)*_(m),w=c+(d-l)*x(m),b="center",E="top";break;case"insideStartArc":S=h+(d+l)*_(m),w=c+(d+l)*x(m),b="center",E="bottom";break;case"startAngle":S=h+v*_(p)+E4(p,l+y,!1),w=c+v*x(p)+T4(p,l+y,!1),b="right",E="middle";break;case"insideStartAngle":S=h+v*_(p)+E4(p,-l+y,!1),w=c+v*x(p)+T4(p,-l+y,!1),b="left",E="middle";break;case"middle":S=h+v*_(m),w=c+v*x(m),b="center",E="middle";break;case"endArc":S=h+(f+l)*_(m),w=c+(f+l)*x(m),b="center",E="bottom";break;case"insideEndArc":S=h+(f-l)*_(m),w=c+(f-l)*x(m),b="center",E="top";break;case"endAngle":S=h+v*_(g)+E4(g,l+y,!0),w=c+v*x(g)+T4(g,l+y,!0),b="left",E="middle";break;case"insideEndAngle":S=h+v*_(g)+E4(g,-l+y,!0),w=c+v*x(g)+T4(g,-l+y,!0),b="right",E="middle";break;default:return iG(r,i,a)}return r=r||{},r.x=S,r.y=w,r.align=b,r.verticalAlign=E,r}}function lyt(n,e,t,r){if(ha(r)){n.setTextConfig({rotation:r});return}else if(Gt(e)){n.setTextConfig({rotation:0});return}var i=n.shape,a=i.clockwise?i.startAngle:i.endAngle,o=i.clockwise?i.endAngle:i.startAngle,s=(a+o)/2,l,u=t(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=a;break;case"endAngle":case"insideEndAngle":l=o;break;default:n.setTextConfig({rotation:0});return}var h=Math.PI*1.5-l;u==="middle"&&h>Math.PI/2&&h<Math.PI*1.5&&(h-=Math.PI),n.setTextConfig({rotation:h})}function E4(n,e,t){return e*Math.sin(n)*(t?-1:1)}function T4(n,e,t){return e*Math.cos(n)*(t?1:-1)}function lE(n,e,t){var r=n.get("borderRadius");if(r==null)return t?{cornerRadius:0}:null;Gt(r)||(r=[r,r,r,r]);var i=Math.abs(e.r||0-e.r0||0);return{cornerRadius:Vt(r,function(a){return _0(a,i)})}}var sj=Math.max,lj=Math.min;function uyt(n,e){var t=n.getArea&&n.getArea();if(Z2(n,"cartesian2d")){var r=n.getBaseAxis();if(r.type!=="category"||!r.onBand){var i=e.getLayout("bandWidth");r.isHorizontal()?(t.x-=i,t.width+=i*2):(t.y-=i,t.height+=i*2)}}return t}var hyt=function(n){$e(e,n);function e(){var t=n.call(this)||this;return t.type=e.type,t._isFirstFrame=!0,t}return e.prototype.render=function(t,r,i,a){this._model=t,this._removeOnRenderedListener(i),this._updateDrawMode(t);var o=t.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,r,i):this._renderNormal(t,r,i,a))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,r){this._progressiveEls=[],this._incrementalRenderLarge(t,r)},e.prototype.eachRendered=function(t){_w(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;(this._isLargeDraw==null||r!==this._isLargeDraw)&&(this._isLargeDraw=r,this._clear())},e.prototype._renderNormal=function(t,r,i,a){var o=this.group,s=t.getData(),l=this._data,u=t.coordinateSystem,h=u.getBaseAxis(),c;u.type==="cartesian2d"?c=h.isHorizontal():u.type==="polar"&&(c=h.dim==="angle");var f=t.isAnimationEnabled()?t:null,d=cyt(t,u);d&&this._enableRealtimeSort(d,s,i);var v=t.get("clip",!0)||d,p=uyt(u,s);o.removeClipPath();var g=t.get("roundCap",!0),m=t.get("showBackground",!0),y=t.getModel("backgroundStyle"),_=y.get("borderRadius")||0,x=[],S=this._backgroundEls,w=a&&a.isInitSort,b=a&&a.type==="changeAxisOrder";function E(A){var M=C4[u.type](s,A),I=myt(u,c,M);return I.useStyle(y.getItemStyle()),u.type==="cartesian2d"?I.setShape("r",_):I.setShape("cornerRadius",_),x[A]=I,I}s.diff(l).add(function(A){var M=s.getItemModel(A),I=C4[u.type](s,A,M);if(m&&E(A),!(!s.hasValue(A)||!f0e[u.type](I))){var R=!1;v&&(R=l0e[u.type](p,I));var k=u0e[u.type](t,s,A,I,c,f,h.model,!1,g);d&&(k.forceLabelAnimation=!0),d0e(k,s,A,M,I,t,c,u.type==="polar"),w?k.attr({shape:I}):d?h0e(d,f,k,I,A,c,!1,!1):Is(k,{shape:I},t,A),s.setItemGraphicEl(A,k),o.add(k),k.ignore=R}}).update(function(A,M){var I=s.getItemModel(A),R=C4[u.type](s,A,I);if(m){var k=void 0;S.length===0?k=E(M):(k=S[M],k.useStyle(y.getItemStyle()),u.type==="cartesian2d"?k.setShape("r",_):k.setShape("cornerRadius",_),x[A]=k);var D=C4[u.type](s,A),G=S5e(c,D,u);ma(k,{shape:G},f,A)}var W=l.getItemGraphicEl(M);if(!s.hasValue(A)||!f0e[u.type](R)){o.remove(W);return}var z=!1;if(v&&(z=l0e[u.type](p,R),z&&o.remove(W)),W?x0(W):W=u0e[u.type](t,s,A,R,c,f,h.model,!!W,g),d&&(W.forceLabelAnimation=!0),b){var V=W.getTextContent();if(V){var q=NI(V);q.prevValue!=null&&(q.prevValue=q.value)}}else d0e(W,s,A,I,R,t,c,u.type==="polar");w?W.attr({shape:R}):d?h0e(d,f,W,R,A,c,!0,b):ma(W,{shape:R},t,A,null),s.setItemGraphicEl(A,W),W.ignore=z,o.add(W)}).remove(function(A){var M=l.getItemGraphicEl(A);M&&lD(M,t,A)}).execute();var T=this._backgroundGroup||(this._backgroundGroup=new Cn);T.removeAll();for(var C=0;C<x.length;++C)T.add(x[C]);o.add(T),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(t,r,i){this._clear(),p0e(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,r){this._removeBackground(),p0e(r,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){var r=t.get("clip",!0)&&yU(t.coordinateSystem,!1,t),i=this.group;r?i.setClipPath(r):i.removeClipPath()},e.prototype._enableRealtimeSort=function(t,r,i){var a=this;if(!!r.count()){var o=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(r,t,i),this._isFirstFrame=!1;else{var s=function(l){var u=r.getItemGraphicEl(l),h=u&&u.shape;return h&&Math.abs(o.isHorizontal()?h.height:h.width)||0};this._onRendered=function(){a._updateSortWithinSameData(r,s,o,i)},i.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,r,i){var a=[];return t.each(t.mapDimension(r.dim),function(o,s){var l=i(s);l=l==null?NaN:l,a.push({dataIndex:s,mappedValue:l,ordinalNumber:o})}),a.sort(function(o,s){return s.mappedValue-o.mappedValue}),{ordinalNumbers:Vt(a,function(o){return o.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(t,r,i){for(var a=i.scale,o=t.mapDimension(i.dim),s=Number.MAX_VALUE,l=0,u=a.getOrdinalMeta().categories.length;l<u;++l){var h=t.rawIndexOf(o,a.getRawOrdinalNumber(l)),c=h<0?Number.MIN_VALUE:r(t.indexOfRawIndex(h));if(c>s)return!0;s=c}return!1},e.prototype._isOrderDifferentInView=function(t,r){for(var i=r.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,r,i,a){if(!!this._isOrderChangedWithinSameData(t,r,i)){var o=this._dataSort(t,i,r);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,r,i){var a=r.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(r.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,r){this._clear(this._model),this._removeOnRenderedListener(r)},e.prototype.dispose=function(t,r){this._removeOnRenderedListener(r)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var r=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){lD(a,t,Bn(a).dataIndex)})):r.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(os),l0e={cartesian2d:function(n,e){var t=e.width<0?-1:1,r=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=n.x+n.width,a=n.y+n.height,o=sj(e.x,n.x),s=lj(e.x+e.width,i),l=sj(e.y,n.y),u=lj(e.y+e.height,a),h=s<o,c=u<l;return e.x=h&&o>i?s:o,e.y=c&&l>a?u:l,e.width=h?0:s-o,e.height=c?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(n,e){var t=e.r0<=e.r?1:-1;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}var i=lj(e.r,n.r),a=sj(e.r0,n.r0);e.r=i,e.r0=a;var o=i-a<0;if(t<0){var r=e.r;e.r=e.r0,e.r0=r}return o}},u0e={cartesian2d:function(n,e,t,r,i,a,o,s,l){var u=new ta({shape:Mt({},r),z2:1});if(u.__dataIndex=t,u.name="item",a){var h=u.shape,c=i?"height":"width";h[c]=0}return u},polar:function(n,e,t,r,i,a,o,s,l){var u=!i&&l?AG:wd,h=new u({shape:r,z2:1});h.name="item";var c=x5e(i);if(h.calculateTextPosition=syt(c,{isRoundCap:u===AG}),a){var f=h.shape,d=i?"r":"endAngle",v={};f[d]=i?r.r0:r.startAngle,v[d]=r[d],(s?ma:Is)(h,{shape:v},a)}return h}};function cyt(n,e){var t=n.get("realtimeSort",!0),r=e.getBaseAxis();if(t&&r.type==="category"&&e.type==="cartesian2d")return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}function h0e(n,e,t,r,i,a,o,s){var l,u;a?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(o?ma:Is)(t,{shape:l},e,i,null);var h=e?n.baseAxis.model:null;(o?ma:Is)(t,{shape:u},h,i)}function c0e(n,e){for(var t=0;t<e.length;t++)if(!isFinite(n[e[t]]))return!0;return!1}var fyt=["x","y","width","height"],dyt=["cx","cy","r","startAngle","endAngle"],f0e={cartesian2d:function(n){return!c0e(n,fyt)},polar:function(n){return!c0e(n,dyt)}},C4={cartesian2d:function(n,e,t){var r=n.getItemLayout(e),i=t?pyt(t,r):0,a=r.width>0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(n,e,t){var r=n.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function vyt(n){return n.startAngle!=null&&n.endAngle!=null&&n.startAngle===n.endAngle}function x5e(n){return function(e){var t=e?"Arc":"Angle";return function(r){switch(r){case"start":case"insideStart":case"end":case"insideEnd":return r+t;default:return r}}}(n)}function d0e(n,e,t,r,i,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var h=n.shape,c=lE(r.getModel("itemStyle"),h,!0);Mt(h,c),n.setShape(h)}}else{var u=r.get(["itemStyle","borderRadius"])||0;n.setShape("r",u)}n.useStyle(l);var f=r.getShallow("cursor");f&&n.attr("cursor",f);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",v=hh(r);vc(n,v,{labelFetcher:a,labelDataIndex:t,defaultText:gM(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var p=n.getTextContent();if(s&&p){var g=r.get(["label","position"]);n.textConfig.inside=g==="middle"?!0:null,lyt(n,g==="outside"?d:g,x5e(o),r.get(["label","rotate"]))}Dke(p,v,a.getRawValue(t),function(y){return h5e(e,y)});var m=r.getModel(["emphasis"]);vl(n,m.get("focus"),m.get("blurScope"),m.get("disabled")),dc(n,r),vyt(i)&&(n.style.fill="none",n.style.stroke="none",te(n.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function pyt(n,e){var t=n.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var r=n.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(r,i,a)}var gyt=function(){function n(){}return n}(),v0e=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="largeBar",r}return e.prototype.getDefaultShape=function(){return new gyt},e.prototype.buildPath=function(t,r){for(var i=r.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,h=0;h<i.length;h+=3)l[a]=u,l[o]=i[h+2],s[a]=i[h+a],s[o]=i[h+o],t.rect(s[0],s[1],l[0],l[1])},e}(Si);function p0e(n,e,t,r){var i=n.getData(),a=i.getLayout("valueAxisHorizontal")?1:0,o=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=n.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var h=new v0e({shape:{points:u},incremental:!!r,silent:!0,z2:0});h.baseDimIdx=a,h.largeDataIndices=o,h.barWidth=s,h.useStyle(l.getItemStyle()),e.add(h),t&&t.push(h)}var c=new v0e({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});c.baseDimIdx=a,c.largeDataIndices=o,c.barWidth=s,e.add(c),c.useStyle(i.getVisual("style")),Bn(c).seriesIndex=n.seriesIndex,n.get("silent")||(c.on("mousedown",g0e),c.on("mousemove",g0e)),t&&t.push(c)}var g0e=Hie(function(n){var e=this,t=yyt(e,n.offsetX,n.offsetY);Bn(e).dataIndex=t>=0?t:null},30,!1);function yyt(n,e,t){for(var r=n.baseDimIdx,i=1-r,a=n.shape.points,o=n.largeDataIndices,s=[],l=[],u=n.barWidth,h=0,c=a.length/3;h<c;h++){var f=h*3;if(l[r]=u,l[i]=a[f+2],s[r]=a[f+r],s[i]=a[f+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),e>=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[h]}return-1}function S5e(n,e,t){if(Z2(t,"cartesian2d")){var r=e,i=t.getArea();return{x:n?r.x:i.x,y:n?i.y:r.y,width:n?r.width:i.width,height:n?i.height:r.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:n?i.r0:a.r0,r:n?i.r:a.r,startAngle:n?a.startAngle:0,endAngle:n?a.endAngle:Math.PI*2}}}function myt(n,e,t){var r=n.type==="polar"?wd:ta;return new r({shape:S5e(e,t,n),silent:!0,z2:0})}const _yt=hyt;function xyt(n){n.registerChartView(_yt),n.registerSeriesModel(iyt),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,Un(T4e,"bar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,C4e("bar")),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,m5e("bar")),n.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var r=e.componentType||"series";t.eachComponent({mainType:r,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var A4=Math.PI*2,y0e=Math.PI/180;function w5e(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function b5e(n,e){var t=w5e(n,e),r=n.get("center"),i=n.get("radius");Gt(i)||(i=[0,i]);var a=xr(t.width,e.getWidth()),o=xr(t.height,e.getHeight()),s=Math.min(a,o),l=xr(i[0],s/2),u=xr(i[1],s/2),h,c,f=n.coordinateSystem;if(f){var d=f.dataToPoint(r);h=d[0]||0,c=d[1]||0}else Gt(r)||(r=[r,r]),h=xr(r[0],a)+t.x,c=xr(r[1],o)+t.y;return{cx:h,cy:c,r0:l,r:u}}function Syt(n,e,t){e.eachSeriesByType(n,function(r){var i=r.getData(),a=i.mapDimension("value"),o=w5e(r,t),s=b5e(r,t),l=s.cx,u=s.cy,h=s.r,c=s.r0,f=-r.get("startAngle")*y0e,d=r.get("minAngle")*y0e,v=0;i.each(a,function(C){!isNaN(C)&&v++});var p=i.getSum(a),g=Math.PI/(p||v)*2,m=r.get("clockwise"),y=r.get("roseType"),_=r.get("stillShowZeroSum"),x=i.getDataExtent(a);x[0]=0;var S=A4,w=0,b=f,E=m?1:-1;if(i.setLayout({viewRect:o,r:h}),i.each(a,function(C,A){var M;if(isNaN(C)){i.setItemLayout(A,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:m,cx:l,cy:u,r0:c,r:y?NaN:h});return}y!=="area"?M=p===0&&_?g:C*g:M=A4/v,M<d?(M=d,S-=d):w+=C;var I=b+E*M;i.setItemLayout(A,{angle:M,startAngle:b,endAngle:I,clockwise:m,cx:l,cy:u,r0:c,r:y?go(C,x,[c,h]):h}),b=I}),S<A4&&v)if(S<=.001){var T=A4/v;i.each(a,function(C,A){if(!isNaN(C)){var M=i.getItemLayout(A);M.angle=T,M.startAngle=f+E*A*T,M.endAngle=f+E*(A+1)*T}})}else g=S/w,b=f,i.each(a,function(C,A){if(!isNaN(C)){var M=i.getItemLayout(A),I=M.angle===d?d:C*g;M.startAngle=b,M.endAngle=b+E*I,b+=E*I}})})}function I3(n){return{seriesType:n,reset:function(e,t){var r=t.findComponents({mainType:"legend"});if(!(!r||!r.length)){var i=e.getData();i.filterSelf(function(a){for(var o=i.getName(a),s=0;s<r.length;s++)if(!r[s].isSelected(o))return!1;return!0})}}}}var wyt=Math.PI/180;function m0e(n,e,t,r,i,a,o,s,l,u){if(n.length<2)return;function h(p){for(var g=p.rB,m=g*g,y=0;y<p.list.length;y++){var _=p.list[y],x=Math.abs(_.label.y-t),S=r+_.len,w=S*S,b=Math.sqrt((1-Math.abs(x*x/m))*w),E=e+(b+_.len2)*i,T=E-_.label.x,C=_.targetTextWidth-T*i;E5e(_,C,!0),_.label.x=E}}function c(p){for(var g={list:[],maxY:0},m={list:[],maxY:0},y=0;y<p.length;y++)if(p[y].labelAlignTo==="none"){var _=p[y],x=_.label.y>t?m:g,S=Math.abs(_.label.y-t);if(S>=x.maxY){var w=_.label.x-e-_.len2*i,b=r+_.len,E=Math.abs(w)<b?Math.sqrt(S*S/(1-w*w/b/b)):b;x.rB=E,x.maxY=S}x.list.push(_)}h(g),h(m)}for(var f=n.length,d=0;d<f;d++)if(n[d].position==="outer"&&n[d].labelAlignTo==="labelLine"){var v=n[d].label.x-u;n[d].linePoints[1][0]+=v,n[d].label.x=u}Y4e(n,l,l+o)&&c(n)}function byt(n,e,t,r,i,a,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0;f<n.length;f++){var d=n[f].label;uj(n[f])||(d.x<e?(h=Math.min(h,d.x),l.push(n[f])):(c=Math.max(c,d.x),u.push(n[f])))}for(var f=0;f<n.length;f++){var v=n[f];if(!uj(v)&&v.linePoints){if(v.labelStyleWidth!=null)continue;var d=v.label,p=v.linePoints,g=void 0;v.labelAlignTo==="edge"?d.x<e?g=p[2][0]-v.labelDistance-o-v.edgeDistance:g=o+i-v.edgeDistance-p[2][0]-v.labelDistance:v.labelAlignTo==="labelLine"?d.x<e?g=h-o-v.bleedMargin:g=o+i-c-v.bleedMargin:d.x<e?g=d.x-o-v.bleedMargin:g=o+i-d.x-v.bleedMargin,v.targetTextWidth=g,E5e(v,g)}}m0e(u,e,t,r,1,i,a,o,s,c),m0e(l,e,t,r,-1,i,a,o,s,h);for(var f=0;f<n.length;f++){var v=n[f];if(!uj(v)&&v.linePoints){var d=v.label,p=v.linePoints,m=v.labelAlignTo==="edge",y=d.style.padding,_=y?y[1]+y[3]:0,x=d.style.backgroundColor?0:_,S=v.rect.width+x,w=p[1][0]-p[2][0];m?d.x<e?p[2][0]=o+v.edgeDistance+S+v.labelDistance:p[2][0]=o+i-v.edgeDistance-S-v.labelDistance:(d.x<e?p[2][0]=d.x+v.labelDistance:p[2][0]=d.x-v.labelDistance,p[1][0]=p[2][0]+w),p[1][1]=p[2][1]=d.y}}}function E5e(n,e,t){if(t===void 0&&(t=!1),n.labelStyleWidth==null){var r=n.label,i=r.style,a=n.rect,o=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,h=a.width+(o?0:l);if(e<h||t){var c=a.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",e-l);var f=r.getBoundingRect();r.setStyle("width",Math.ceil(f.width)),r.setStyle("backgroundColor",o)}else{var d=e-l,v=e<h?d:t?d>n.unconstrainedWidth?null:d:null;r.setStyle("width",v)}var p=r.getBoundingRect();a.width=p.width;var g=(r.style.margin||0)+2.1;a.height=p.height+g,a.y-=(a.height-c)/2}}}function uj(n){return n.position==="center"}function Eyt(n){var e=n.getData(),t=[],r,i,a=!1,o=(n.get("minShowLabelAngle")||0)*wyt,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,h=s.x,c=s.y,f=s.height;function d(w){w.ignore=!0}function v(w){if(!w.ignore)return!0;for(var b in w.states)if(w.states[b].ignore===!1)return!0;return!1}e.each(function(w){var b=e.getItemGraphicEl(w),E=b.shape,T=b.getTextContent(),C=b.getTextGuideLine(),A=e.getItemModel(w),M=A.getModel("label"),I=M.get("position")||A.get(["emphasis","label","position"]),R=M.get("distanceToLabelLine"),k=M.get("alignTo"),D=xr(M.get("edgeDistance"),u),G=M.get("bleedMargin"),W=A.getModel("labelLine"),z=W.get("length");z=xr(z,u);var V=W.get("length2");if(V=xr(V,u),Math.abs(E.endAngle-E.startAngle)<o){te(T.states,d),T.ignore=!0,C&&(te(C.states,d),C.ignore=!0);return}if(!!v(T)){var q=(E.startAngle+E.endAngle)/2,Y=Math.cos(q),le=Math.sin(q),j,Q,ie,oe;r=E.cx,i=E.cy;var se=I==="inside"||I==="inner";if(I==="center")j=E.cx,Q=E.cy,oe="center";else{var me=(se?(E.r+E.r0)/2*Y:E.r*Y)+r,Ce=(se?(E.r+E.r0)/2*le:E.r*le)+i;if(j=me+Y*3,Q=Ce+le*3,!se){var Le=me+Y*(z+l-E.r),re=Ce+le*(z+l-E.r),yt=Le+(Y<0?-1:1)*V,je=re;k==="edge"?j=Y<0?h+D:h+u-D:j=yt+(Y<0?-R:R),Q=je,ie=[[me,Ce],[Le,re],[yt,je]]}oe=se?"center":k==="edge"?Y>0?"right":"left":Y>0?"left":"right"}var st=Math.PI,Nt=0,Zt=M.get("rotate");if(ha(Zt))Nt=Zt*(st/180);else if(I==="center")Nt=0;else if(Zt==="radial"||Zt===!0){var qe=Y<0?-q+st:-q;Nt=qe}else if(Zt==="tangential"&&I!=="outside"&&I!=="outer"){var ur=Math.atan2(Y,le);ur<0&&(ur=st*2+ur);var Dt=le>0;Dt&&(ur=st+ur),Nt=ur-st}if(a=!!Nt,T.x=j,T.y=Q,T.rotation=Nt,T.setStyle({verticalAlign:"middle"}),se){T.setStyle({align:oe});var J=T.states.select;J&&(J.x+=T.x,J.y+=T.y)}else{var ft=T.getBoundingRect().clone();ft.applyTransform(T.getComputedTransform());var Oe=(T.style.margin||0)+2.1;ft.y-=Oe/2,ft.height+=Oe,t.push({label:T,labelLine:C,position:I,len:z,len2:V,minTurnAngle:W.get("minTurnAngle"),maxSurfaceAngle:W.get("maxSurfaceAngle"),surfaceNormal:new qn(Y,le),linePoints:ie,textAlign:oe,labelDistance:R,labelAlignTo:k,edgeDistance:D,bleedMargin:G,rect:ft,unconstrainedWidth:ft.width,labelStyleWidth:T.style.width})}b.setTextConfig({inside:se})}}),!a&&n.get("avoidLabelOverlap")&&byt(t,r,i,l,u,f,h,c);for(var p=0;p<t.length;p++){var g=t[p],m=g.label,y=g.labelLine,_=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),_&&(te(m.states,d),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(y){var S=g.linePoints;_||!S?(te(y.states,d),y.ignore=!0):(H4e(S,g.minTurnAngle),Fgt(S,g.surfaceNormal,g.maxSurfaceAngle),y.setShape({points:S}),m.__hostTarget.textGuideLineConfig={anchor:new qn(S[0][0],S[0][1])})}}}var Tyt=function(n){$e(e,n);function e(t,r,i){var a=n.call(this)||this;a.z2=2;var o=new la;return a.setTextContent(o),a.updateData(t,r,i,!0),a}return e.prototype.updateData=function(t,r,i,a){var o=this,s=t.hostModel,l=t.getItemModel(r),u=l.getModel("emphasis"),h=t.getItemLayout(r),c=Mt(lE(l.getModel("itemStyle"),h,!0),h);if(isNaN(c.startAngle)){o.setShape(c);return}if(a){o.setShape(c);var f=s.getShallow("animationType");s.ecModel.ssr?(Is(o,{scaleX:0,scaleY:0},s,{dataIndex:r,isFrom:!0}),o.originX=c.cx,o.originY=c.cy):f==="scale"?(o.shape.r=h.r0,Is(o,{shape:{r:h.r}},s,r)):i!=null?(o.setShape({startAngle:i,endAngle:i}),Is(o,{shape:{startAngle:h.startAngle,endAngle:h.endAngle}},s,r)):(o.shape.endAngle=h.startAngle,ma(o,{shape:{endAngle:h.endAngle}},s,r))}else x0(o),ma(o,{shape:c},s,r);o.useStyle(t.getItemVisual(r,"style")),dc(o,l);var d=(h.startAngle+h.endAngle)/2,v=s.get("selectedOffset"),p=Math.cos(d)*v,g=Math.sin(d)*v,m=l.getShallow("cursor");m&&o.attr("cursor",m),this._updateLabel(s,t,r),o.ensureState("emphasis").shape=Mt({r:h.r+(u.get("scale")&&u.get("scaleSize")||0)},lE(u.getModel("itemStyle"),h)),Mt(o.ensureState("select"),{x:p,y:g,shape:lE(l.getModel(["select","itemStyle"]),h)}),Mt(o.ensureState("blur"),{shape:lE(l.getModel(["blur","itemStyle"]),h)});var y=o.getTextGuideLine(),_=o.getTextContent();y&&Mt(y.ensureState("select"),{x:p,y:g}),Mt(_.ensureState("select"),{x:p,y:g}),vl(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,r,i){var a=this,o=r.getItemModel(i),s=o.getModel("labelLine"),l=r.getItemVisual(i,"style"),u=l&&l.fill,h=l&&l.opacity;vc(a,hh(o),{labelFetcher:r.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:h,defaultText:t.getFormattedLabel(i,"normal")||r.getName(i)});var c=a.getTextContent();a.setTextConfig({position:null,rotation:null}),c.attr({z2:10});var f=t.get(["label","position"]);if(f!=="outside"&&f!=="outer")a.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new Gd,this.setTextGuideLine(d)),aae(this,oae(o),{stroke:u,opacity:qy(s.get(["lineStyle","opacity"]),h,1)})}},e}(wd),Cyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,r,i,a){var o=t.getData(),s=this._data,l=this.group,u;if(!s&&o.count()>0){for(var h=o.getItemLayout(0),c=1;isNaN(h&&h.startAngle)&&c<o.count();++c)h=o.getItemLayout(c);h&&(u=h.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&t.get("showEmptyCircle")){var f=new wd({shape:b5e(t,i)});f.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,l.add(f)}o.diff(s).add(function(d){var v=new Tyt(o,d,u);o.setItemGraphicEl(d,v),l.add(v)}).update(function(d,v){var p=s.getItemGraphicEl(v);p.updateData(o,d,u),p.off("click"),l.add(p),o.setItemGraphicEl(d,p)}).remove(function(d){var v=s.getItemGraphicEl(d);lD(v,t,d)}).execute(),Eyt(t),t.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,r){var i=r.getData(),a=i.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="pie",e}(os);const Ayt=Cyt;function WI(n,e,t){e=Gt(e)&&{coordDimensions:e}||Mt({encodeDefine:n.getEncode()},e);var r=n.getSource(),i=b3(r,e).dimensions,a=new Df(i,n);return a.initData(r,t),a}var Myt=function(){function n(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return n.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},n.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},n.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},n.prototype.getItemVisual=function(e,t){var r=this._getDataWithEncodedVisual();return r.getItemVisual(e,t)},n}();const L3=Myt;var Iyt=na(),Lyt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new L3(kr(this.getData,this),kr(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){n.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return WI(this,{coordDimensions:["value"],encodeDefaulter:Un(Nie,this)})},e.prototype.getDataParams=function(t){var r=this.getData(),i=Iyt(r),a=i.seats;if(!a){var o=[];r.each(r.mapDimension("value"),function(l){o.push(l)}),a=i.seats=zut(o,r.hostModel.get("percentPrecision"))}var s=n.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){XE(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Ws);const Pyt=Lyt;function Oyt(n){return{seriesType:n,reset:function(e,t){var r=e.getData();r.filterSelf(function(i){var a=r.mapDimension("value"),o=r.get(a,i);return!(ha(o)&&!isNaN(o)&&o<0)})}}}function Ryt(n){n.registerChartView(Ayt),n.registerSeriesModel(Pyt),VFe("pie",n.registerAction),n.registerLayout(Un(Syt,"pie")),n.registerProcessor(I3("pie")),n.registerProcessor(Oyt("pie"))}var Dyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,r,i){return i.point(r.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Ws);const Nyt=Dyt;var T5e=4,kyt=function(){function n(){}return n}(),Fyt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}return e.prototype.getDefaultShape=function(){return new kyt},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,r){var i=r.points,a=r.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]<T5e,h=this.softClipShape,c;if(u){this._ctx=l;return}for(this._ctx=null,c=this._off;c<i.length;){var f=i[c++],d=i[c++];isNaN(f)||isNaN(d)||h&&!h.contain(f,d)||(s.x=f-a[0]/2,s.y=d-a[1]/2,s.width=a[0],s.height=a[1],o.buildPath(t,s,!0))}this.incremental&&(this._off=c,this.notClear=!0)},e.prototype.afterBrush=function(){var t=this.shape,r=t.points,i=t.size,a=this._ctx,o=this.softClipShape,s;if(!!a){for(s=this._off;s<r.length;){var l=r[s++],u=r[s++];isNaN(l)||isNaN(u)||o&&!o.contain(l,u)||a.fillRect(l-i[0]/2,u-i[1]/2,i[0],i[1])}this.incremental&&(this._off=s,this.notClear=!0)}},e.prototype.findDataIndex=function(t,r){for(var i=this.shape,a=i.points,o=i.size,s=Math.max(o[0],4),l=Math.max(o[1],4),u=a.length/2-1;u>=0;u--){var h=u*2,c=a[h]-s/2,f=a[h+1]-l/2;if(t>=c&&r>=f&&t<=c+s&&r<=f+l)return u}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var o=this.hoverDataIdx=this.findDataIndex(t,r);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.points,a=r.size,o=a[0],s=a[1],l=1/0,u=1/0,h=-1/0,c=-1/0,f=0;f<i.length;){var d=i[f++],v=i[f++];l=Math.min(d,l),h=Math.max(d,h),u=Math.min(v,u),c=Math.max(v,c)}t=this._rect=new ai(l-o/2,u-s/2,h-l+o,c-u+s)}return t},e}(Si),Byt=function(){function n(){this.group=new Cn}return n.prototype.updateData=function(e,t){this._clear();var r=this._create();r.setShape({points:e.getLayout("points")}),this._setCommon(r,e,t)},n.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild(function(r){if(r.startIndex!=null){var i=(r.endIndex-r.startIndex)*2,a=r.startIndex*4*2;t=new Float32Array(t.buffer,a,i)}r.setShape("points",t),r.reset()})},n.prototype.incrementalPrepareUpdate=function(e){this._clear()},n.prototype.incrementalUpdate=function(e,t,r){var i=this._newAdded[0],a=t.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var s=o.length,l=new Float32Array(s+a.length);l.set(o),l.set(a,s),i.endIndex=e.end,i.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=e.start,u.endIndex=e.end,u.incremental=!0,u.setShape({points:a}),this._setCommon(u,t,r)}},n.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},n.prototype._create=function(){var e=new Fyt({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},n.prototype._setCommon=function(e,t,r){var i=t.hostModel;r=r||{};var a=t.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=r.clipShape||null,e.symbolProxy=hu(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<T5e;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("style"),l=s&&s.fill;l&&e.setColor(l);var u=Bn(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(h){u.dataIndex=null;var c=e.hoverDataIdx;c>=0&&(u.dataIndex=c+(e.startIndex||0))})},n.prototype.remove=function(){this._clear()},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const Gyt=Byt;var zyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._symbolDraw.incrementalUpdate(t,r.getData(),{clipShape:this._getClipShape(r)}),this._finished=t.end===r.getData().count()},e.prototype.updateTransform=function(t,r,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=M3("").reset(t,r,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var r=t.coordinateSystem,i=r&&r.getArea&&r.getArea();return t.get("clip",!0)?i:null},e.prototype._updateSymbolDraw=function(t,r){var i=this._symbolDraw,a=r.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new Gyt:new A3,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(os);const Uyt=zyt;var Vyt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(oa);const $yt=Vyt;var DJ=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",uu).models[0]},e.type="cartesian2dAxis",e}(oa);gu(DJ,T3);var C5e={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},Wyt=ii({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},C5e),cae=ii({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},C5e),Hyt=ii({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},cae),jyt=sn({logBase:10},cae);const A5e={category:Wyt,value:cae,time:Hyt,log:jyt};var Xyt={value:1,category:1,time:1,log:1};function yM(n,e,t,r){te(Xyt,function(i,a){var o=ii(ii({},A5e[a],!0),r,!0),s=function(l){$e(u,l);function u(){var h=l!==null&&l.apply(this,arguments)||this;return h.type=e+"Axis."+a,h}return u.prototype.mergeDefaultAndTheme=function(h,c){var f=cD(this),d=f?BI(h):{},v=c.getTheme();ii(h,v.get(a+"Axis")),ii(h,this.getDefaultOption()),h.type=_0e(h),f&&kS(h,d,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=AJ.createByAxisModel(this))},u.prototype.getCategories=function(h){var c=this.option;if(c.type==="category")return h?c.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);n.registerComponentModel(s)}),n.registerSubTypeDefaulter(e+"Axis",_0e)}function _0e(n){return n.type||(n.data?"category":"value")}var Yyt=function(){function n(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return n.prototype.getAxis=function(e){return this._axes[e]},n.prototype.getAxes=function(){return Vt(this._dimList,function(e){return this._axes[e]},this)},n.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),To(this.getAxes(),function(t){return t.scale.type===e})},n.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},n}();const qyt=Yyt;var NJ=["x","y"];function x0e(n){return n.type==="interval"||n.type==="time"}var Zyt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=NJ,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,r=this.getAxis("y").scale;if(!(!x0e(t)||!x0e(r))){var i=t.getExtent(),a=r.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var h=(s[0]-o[0])/l,c=(s[1]-o[1])/u,f=o[0]-i[0]*h,d=o[1]-a[0]*c,v=this._transform=[h,0,0,c,f,d];this._invTransform=LI([],v)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var r=this.getAxis("x"),i=this.getAxis("y");return r.contain(r.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,r){var i=this.dataToPoint(t),a=this.dataToPoint(r),o=this.getArea(),s=new ai(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,r,i){i=i||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return cc(i,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,r)),i[1]=l.toGlobalCoord(l.dataToCoord(o,r)),i},e.prototype.clampData=function(t,r){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return r=r||[],r[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),r[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),r},e.prototype.pointToData=function(t,r){var i=[];if(this._invTransform)return cc(i,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),r),i[1]=o.coordToData(o.toLocalCoord(t[1]),r),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),r=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1]),a=Math.min(r[0],r[1]),o=Math.max(t[0],t[1])-i,s=Math.max(r[0],r[1])-a;return new ai(i,a,o,s)},e}(qyt),Kyt=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this,t,r,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var r=this.getExtent();return r[0]=this.toGlobalCoord(r[0]),r[1]=this.toGlobalCoord(r[1]),t&&r[0]>r[1]&&r.reverse(),r},e.prototype.pointToData=function(t,r){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),r)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(D0);const Jyt=Kyt;function kJ(n,e,t){t=t||{};var r=n.coordinateSystem,i=e.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,l=o?"onZero":s,u=i.dim,h=r.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],f={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,v=u==="x"?[c[2]-d,c[3]+d]:[c[0]-d,c[1]+d];if(o){var p=o.toGlobalCoord(o.dataToCoord(0));v[f.onZero]=Math.max(Math.min(p,v[1]),v[0])}a.position=[u==="y"?v[f[l]]:c[0],u==="x"?v[f[l]]:c[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=g[s],a.labelOffset=o?v[f[s]]-v[f.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Gh(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function S0e(n){return n.get("coordinateSystem")==="cartesian2d"}function w0e(n){var e={xAxisModel:null,yAxisModel:null};return te(e,function(t,r){var i=r.replace(/Model$/,""),a=n.getReferringComponents(i,uu).models[0];e[r]=a}),e}var hj=Math.log;function M5e(n,e,t){var r=BS.prototype,i=r.getTicks.call(t),a=r.getTicks.call(t,!0),o=i.length-1,s=r.getInterval.call(t),l=R4e(n,e),u=l.extent,h=l.fixMin,c=l.fixMax;if(n.type==="log"){var f=hj(n.base);u=[hj(u[0])/f,hj(u[1])/f]}n.setExtent(u[0],u[1]),n.calcNiceExtent({splitNumber:o,fixMin:h,fixMax:c});var d=r.getExtent.call(n);h&&(u[0]=d[0]),c&&(u[1]=d[1]);var v=r.getInterval.call(n),p=u[0],g=u[1];if(h&&c)v=(g-p)/o;else if(h)for(g=u[0]+v*o;g<u[1]&&isFinite(g)&&isFinite(u[1]);)v=ZH(v),g=u[0]+v*o;else if(c)for(p=u[1]-v*o;p>u[0]&&isFinite(p)&&isFinite(u[0]);)v=ZH(v),p=u[1]-v*o;else{var m=n.getTicks().length-1;m>o&&(v=ZH(v));var y=v*o;g=Math.ceil(u[1]/v)*v,p=Pl(g-y),p<0&&u[0]>=0?(p=0,g=Pl(y)):g>0&&u[1]<=0&&(g=0,p=-Pl(y))}var _=(i[0].value-a[0].value)/s,x=(i[o].value-a[o].value)/s;r.setExtent.call(n,p+v*_,g+v*x),r.setInterval.call(n,v),(_||x)&&r.setNiceExtent.call(n,p+v,g-v)}var Qyt=function(){function n(e,t,r){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=NJ,this._initCartesian(e,t,r),this.model=e}return n.prototype.getRect=function(){return this._rect},n.prototype.update=function(e,t){var r=this._axesMap;this._updateScale(e,this.model);function i(o){var s,l=Li(o),u=l.length;if(!!u){for(var h=[],c=u-1;c>=0;c--){var f=+l[c],d=o[f],v=d.model,p=d.scale;MJ(p)&&v.get("alignTicks")&&v.get("interval")==null?h.push(d):(pM(p,v),MJ(p)&&(s=d))}h.length&&(s||(s=h.pop(),pM(s.scale,s.model)),te(h,function(g){M5e(g.scale,g.model,s.scale)}))}}i(r.x),i(r.y);var a={};te(r.x,function(o){b0e(r,"y",o,a)}),te(r.y,function(o){b0e(r,"x",o,a)}),this.resize(this.model,t)},n.prototype.resize=function(e,t,r){var i=e.getBoxLayoutParams(),a=!r&&e.get("containLabel"),o=Uu(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(te(s,function(u){if(!u.model.get(["axisLabel","inside"])){var h=dgt(u);if(h){var c=u.isHorizontal()?"height":"width",f=u.model.get(["axisLabel","margin"]);o[c]-=h[c]+f,u.position==="top"?o.y+=h.height+f:u.position==="left"&&(o.x+=h.width+f)}}}),l()),te(this._coordsList,function(u){u.calcAffineTransform()});function l(){te(s,function(u){var h=u.isHorizontal(),c=h?[0,o.width]:[0,o.height],f=u.inverse?1:0;u.setExtent(c[f],c[1-f]),emt(u,h?o.x:o.y)})}},n.prototype.getAxis=function(e,t){var r=this._axesMap[e];if(r!=null)return r[t||0]},n.prototype.getAxes=function(){return this._axesList.slice()},n.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var r="x"+e+"y"+t;return this._coordsMap[r]}dn(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i<a.length;i++)if(a[i].getAxis("x").index===e||a[i].getAxis("y").index===t)return a[i]},n.prototype.getCartesians=function(){return this._coordsList.slice()},n.prototype.convertToPixel=function(e,t,r){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.dataToPoint(r):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(r)):null},n.prototype.convertFromPixel=function(e,t,r){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.pointToData(r):i.axis?i.axis.coordToData(i.axis.toLocalCoord(r)):null},n.prototype._findConvertTarget=function(e){var t=e.seriesModel,r=e.xAxisModel||t&&t.getReferringComponents("xAxis",uu).models[0],i=e.yAxisModel||t&&t.getReferringComponents("yAxis",uu).models[0],a=e.gridModel,o=this._coordsList,s,l;if(t)s=t.coordinateSystem,gi(o,s)<0&&(s=null);else if(r&&i)s=this.getCartesian(r.componentIndex,i.componentIndex);else if(r)l=this.getAxis("x",r.componentIndex);else if(i)l=this.getAxis("y",i.componentIndex);else if(a){var u=a.coordinateSystem;u===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},n.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},n.prototype._initCartesian=function(e,t,r){var i=this,a=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(t.eachComponent("xAxis",u("x"),this),t.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,te(s.x,function(h,c){te(s.y,function(f,d){var v="x"+c+"y"+d,p=new Zyt(v);p.master=i,p.model=e,i._coordsMap[v]=p,i._coordsList.push(p),p.addAxis(h),p.addAxis(f)})});function u(h){return function(c,f){if(!!cj(c,e)){var d=c.get("position");h==="x"?d!=="top"&&d!=="bottom"&&(d=o.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=o.left?"right":"left"),o[d]=!0;var v=new Jyt(h,pU(c),[0,0],c.get("type"),d),p=v.type==="category";v.onBand=p&&c.get("boundaryGap"),v.inverse=c.get("inverse"),c.axis=v,v.model=c,v.grid=a,v.index=f,a._axesList.push(v),s[h][f]=v,l[h]++}}}},n.prototype._updateScale=function(e,t){te(this._axesList,function(i){if(i.scale.setExtent(1/0,-1/0),i.type==="category"){var a=i.model.get("categorySortInfo");i.scale.setSortInfo(a)}}),e.eachSeries(function(i){if(S0e(i)){var a=w0e(i),o=a.xAxisModel,s=a.yAxisModel;if(!cj(o,t)||!cj(s,t))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),u=i.getData(),h=l.getAxis("x"),c=l.getAxis("y");r(u,h),r(u,c)}},this);function r(i,a){te(wG(i,a.dim),function(o){a.scale.unionExtentFromData(i,o)})}},n.prototype.getTooltipAxes=function(e){var t=[],r=[];return te(this.getCartesians(),function(i){var a=e!=null&&e!=="auto"?i.getAxis(e):i.getBaseAxis(),o=i.getOtherAxis(a);gi(t,a)<0&&t.push(a),gi(r,o)<0&&r.push(o)}),{baseAxes:t,otherAxes:r}},n.create=function(e,t){var r=[];return e.eachComponent("grid",function(i,a){var o=new n(i,e,t);o.name="grid_"+a,o.resize(i,t,!0),i.coordinateSystem=o,r.push(o)}),e.eachSeries(function(i){if(!!S0e(i)){var a=w0e(i),o=a.xAxisModel,s=a.yAxisModel,l=o.getCoordSysModel(),u=l.coordinateSystem;i.coordinateSystem=u.getCartesian(o.componentIndex,s.componentIndex)}}),r},n.dimensions=NJ,n}();function cj(n,e){return n.getCoordSysModel()===e}function b0e(n,e,t,r){t.getAxesOnZeroOf=function(){return a?[a]:[]};var i=n[e],a,o=t.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)E0e(i[l])&&(a=i[l]);else for(var u in i)if(i.hasOwnProperty(u)&&E0e(i[u])&&!r[h(i[u])]){a=i[u];break}a&&(r[h(a)]=!0);function h(c){return c.dim+"_"+c.index}}function E0e(n){return n&&n.type!=="category"&&n.type!=="time"&&fgt(n)}function emt(n,e){var t=n.getExtent(),r=t[0]+t[1];n.toGlobalCoord=n.dim==="x"?function(i){return i+e}:function(i){return r-i+e},n.toLocalCoord=n.dim==="x"?function(i){return i-e}:function(i){return r-i+e}}const tmt=Qyt;var rS=Math.PI,LE=function(){function n(e,t){this.group=new Cn,this.opt=t,this.axisModel=e,sn(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var r=new Cn({x:t.position[0],y:t.position[1],rotation:t.rotation});r.updateTransform(),this._transformGroup=r}return n.prototype.hasBuilder=function(e){return!!T0e[e]},n.prototype.add=function(e){T0e[e](this.opt,this.axisModel,this.group,this._transformGroup)},n.prototype.getGroup=function(){return this.group},n.innerTextLayout=function(e,t,r){var i=C3e(t-e),a,o;return aG(i)?(o=r>0?"top":"bottom",a="center"):aG(i-rS)?(o=r>0?"bottom":"top",a="center"):(o="middle",i>0&&i<rS?a=r>0?"right":"left":a=r>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},n.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},n.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},n}(),T0e={axisLine:function(n,e,t,r){var i=e.get(["axisLine","show"]);if(i==="auto"&&n.handleAutoShown&&(i=n.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),o=r.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(cc(s,s,o),cc(l,l,o));var h=Mt({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new zh({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:n.strokeContainThreshold||5,silent:!0,z2:1});fM(c.shape,c.style.lineWidth),c.anid="line",t.add(c);var f=e.get(["axisLine","symbol"]);if(f!=null){var d=e.get(["axisLine","symbolSize"]);Or(f)&&(f=[f,f]),(Or(d)||ha(d))&&(d=[d,d]);var v=Y2(e.get(["axisLine","symbolOffset"])||0,d),p=d[0],g=d[1];te([{rotate:n.rotation+Math.PI/2,offset:v[0],r:0},{rotate:n.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(m,y){if(f[y]!=="none"&&f[y]!=null){var _=hu(f[y],-p/2,-g/2,p,g,h.stroke,!0),x=m.r+m.offset,S=u?l:s;_.attr({rotation:m.rotate,x:S[0]+x*Math.cos(n.rotation),y:S[1]-x*Math.sin(n.rotation),silent:!0,z2:11}),t.add(_)}})}}},axisTickLabel:function(n,e,t,r){var i=imt(t,r,e,n),a=omt(t,r,e,n);if(nmt(e,a,i),amt(t,r,e,n.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=j4e(Vt(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));q4e(o)}},axisName:function(n,e,t,r){var i=Gh(n.axisName,e.get("name"));if(!!i){var a=e.get("nameLocation"),o=n.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),h=u[0]>u[1]?-1:1,c=[a==="start"?u[0]-h*l:a==="end"?u[1]+h*l:(u[0]+u[1])/2,A0e(a)?n.labelOffset+o*l:0],f,d=e.get("nameRotate");d!=null&&(d=d*rS/180);var v;A0e(a)?f=LE.innerTextLayout(n.rotation,d!=null?d:n.rotation,o):(f=rmt(n.rotation,a,d||0,u),v=n.axisNameAvailableWidth,v!=null&&(v=Math.abs(v/Math.sin(f.rotation)),!isFinite(v)&&(v=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,y=Gh(n.nameTruncateMaxWidth,g.maxWidth,v),_=new la({x:c[0],y:c[1],rotation:f.rotation,silent:LE.isLabelSilent(e),style:is(s,{text:i,font:p,overflow:"truncate",width:y,ellipsis:m,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||f.textAlign,verticalAlign:s.get("verticalAlign")||f.textVerticalAlign}),z2:1});if(DI({el:_,componentModel:e,itemName:i}),_.__fullText=i,_.anid="name",e.get("triggerEvent")){var x=LE.makeAxisEventDataBase(e);x.targetType="axisName",x.name=i,Bn(_).eventData=x}r.add(_),_.updateTransform(),t.add(_),_.decomposeTransform()}}};function rmt(n,e,t,r){var i=C3e(t-n),a,o,s=r[0]>r[1],l=e==="start"&&!s||e!=="start"&&s;return aG(i-rS/2)?(o=l?"bottom":"top",a="center"):aG(i-rS*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",i<rS*1.5&&i>rS/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function nmt(n,e,t){if(!D4e(n.axis)){var r=n.get(["axisLabel","showMinLabel"]),i=n.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],h=t[1],c=t[t.length-1],f=t[t.length-2];r===!1?(Xv(a),Xv(u)):C0e(a,o)&&(r?(Xv(o),Xv(h)):(Xv(a),Xv(u))),i===!1?(Xv(s),Xv(c)):C0e(l,s)&&(i?(Xv(l),Xv(f)):(Xv(s),Xv(c)))}}function Xv(n){n&&(n.ignore=!0)}function C0e(n,e){var t=n&&n.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(!(!t||!r)){var i=Vz([]);return j2(i,i,-n.rotation),t.applyTransform($1([],i,n.getLocalTransform())),r.applyTransform($1([],i,e.getLocalTransform())),t.intersect(r)}}function A0e(n){return n==="middle"||n==="center"}function I5e(n,e,t,r,i){for(var a=[],o=[],s=[],l=0;l<n.length;l++){var u=n[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=t,e&&(cc(o,o,e),cc(s,s,e));var h=new zh({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});fM(h.shape,h.style.lineWidth),h.anid=i+"_"+n[l].tickValue,a.push(h)}return a}function imt(n,e,t,r){var i=t.axis,a=t.getModel("axisTick"),o=a.get("show");if(o==="auto"&&r.handleAutoShown&&(o=r.handleAutoShown("axisTick")),!(!o||i.scale.isBlank())){for(var s=a.getModel("lineStyle"),l=r.tickDirection*a.get("length"),u=i.getTicksCoords(),h=I5e(u,e.transform,l,sn(s.getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<h.length;c++)n.add(h[c]);return h}}function amt(n,e,t,r){var i=t.axis,a=t.getModel("minorTick");if(!(!a.get("show")||i.scale.isBlank())){var o=i.getMinorTicksCoords();if(!!o.length)for(var s=a.getModel("lineStyle"),l=r*a.get("length"),u=sn(s.getLineStyle(),sn(t.getModel("axisTick").getLineStyle(),{stroke:t.get(["axisLine","lineStyle","color"])})),h=0;h<o.length;h++)for(var c=I5e(o[h],e.transform,l,u,"minorticks_"+h),f=0;f<c.length;f++)n.add(c[f])}}function omt(n,e,t,r){var i=t.axis,a=Gh(r.axisLabelShow,t.get(["axisLabel","show"]));if(!(!a||i.scale.isBlank())){var o=t.getModel("axisLabel"),s=o.get("margin"),l=i.getViewLabels(),u=(Gh(r.labelRotate,o.get("rotate"))||0)*rS/180,h=LE.innerTextLayout(r.rotation,u,r.labelDirection),c=t.getCategories&&t.getCategories(!0),f=[],d=LE.isLabelSilent(t),v=t.get("triggerEvent");return te(l,function(p,g){var m=i.scale.type==="ordinal"?i.scale.getRawOrdinalNumber(p.tickValue):p.tickValue,y=p.formattedLabel,_=p.rawLabel,x=o;if(c&&c[m]){var S=c[m];dn(S)&&S.textStyle&&(x=new as(S.textStyle,o,t.ecModel))}var w=x.getTextColor()||t.get(["axisLine","lineStyle","color"]),b=i.dataToCoord(m),E=new la({x:b,y:r.labelOffset+r.labelDirection*s,rotation:h.rotation,silent:d,z2:10+(p.level||0),style:is(x,{text:y,align:x.getShallow("align",!0)||h.textAlign,verticalAlign:x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||h.textVerticalAlign,fill:rn(w)?w(i.type==="category"?_:i.type==="value"?m+"":m,g):w})});if(E.anid="label_"+m,v){var T=LE.makeAxisEventDataBase(t);T.targetType="axisLabel",T.value=_,T.tickIndex=g,i.type==="category"&&(T.dataIndex=m),Bn(E).eventData=T}e.add(E),E.updateTransform(),f.push(E),n.add(E),E.decomposeTransform()}),f}}const d_=LE;function smt(n,e){var t={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return lmt(t,n,e),t.seriesInvolved&&hmt(t,n),t}function lmt(n,e,t){var r=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];te(t.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=_D(s.model),u=n.coordSysAxesInfo[l]={};n.coordSysMap[l]=s;var h=s.model,c=h.getModel("tooltip",r);if(te(s.getAxes(),Un(p,!1,null)),s.getTooltipAxes&&r&&c.get("show")){var f=c.get("trigger")==="axis",d=c.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(c.get(["axisPointer","axis"]));(f||d)&&te(v.baseAxes,Un(p,d?"cross":!0,f)),d&&te(v.otherAxes,Un(p,"cross",!1))}function p(g,m,y){var _=y.model.getModel("axisPointer",i),x=_.get("show");if(!(!x||x==="auto"&&!g&&!FJ(_))){m==null&&(m=_.get("triggerTooltip")),_=g?umt(y,c,i,e,g,m):_;var S=_.get("snap"),w=_.get("triggerEmphasis"),b=_D(y.model),E=m||S||y.type==="category",T=n.axesInfo[b]={key:b,axis:y,coordSys:s,axisPointerModel:_,triggerTooltip:m,triggerEmphasis:w,involveSeries:E,snap:S,useHandle:FJ(_),seriesModels:[],linkGroup:null};u[b]=T,n.seriesInvolved=n.seriesInvolved||E;var C=cmt(a,y);if(C!=null){var A=o[C]||(o[C]={axesInfo:{}});A.axesInfo[b]=T,A.mapper=a[C].mapper,T.linkGroup=A}}}})}function umt(n,e,t,r,i,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};te(s,function(f){l[f]=Sn(o.get(f))}),l.snap=n.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var h=o.get(["label","show"]);if(u.show=h!=null?h:!0,!a){var c=l.lineStyle=o.get("crossStyle");c&&sn(u,c.textStyle)}}return n.model.getModel("axisPointer",new as(l,t,r))}function hmt(n,e){e.eachSeries(function(t){var r=t.coordinateSystem,i=t.get(["tooltip","trigger"],!0),a=t.get(["tooltip","show"],!0);!r||i==="none"||i===!1||i==="item"||a===!1||t.get(["axisPointer","show"],!0)===!1||te(n.coordSysAxesInfo[_D(r.model)],function(o){var s=o.axis;r.getAxis(s.dim)===s&&(o.seriesModels.push(t),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=t.getData().count())})})}function cmt(n,e){for(var t=e.model,r=e.dim,i=0;i<n.length;i++){var a=n[i]||{};if(fj(a[r+"AxisId"],t.id)||fj(a[r+"AxisIndex"],t.componentIndex)||fj(a[r+"AxisName"],t.name))return i}}function fj(n,e){return n==="all"||Gt(n)&&gi(n,e)>=0||n===e}function fmt(n){var e=fae(n);if(!!e){var t=e.axisPointerModel,r=e.axis.scale,i=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=r.parse(o));var s=FJ(t);a==null&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),i.value=o,s&&(i.status=e.axis.scale.isBlank()?"hide":"show")}}function fae(n){var e=(n.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[_D(n)]}function dmt(n){var e=fae(n);return e&&e.axisPointerModel}function FJ(n){return!!n.get(["handle","show"])}function _D(n){return n.type+"||"+n.id}var M0e={},vmt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){this.axisPointerClass&&fmt(t),n.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,i,!0)},e.prototype.updateAxisPointer=function(t,r,i,a){this._doUpdateAxisPointerClass(t,i,!1)},e.prototype.remove=function(t,r){var i=this._axisPointer;i&&i.remove(r)},e.prototype.dispose=function(t,r){this._disposeAxisPointer(r),n.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,r,i){var a=e.getAxisPointerClass(this.axisPointerClass);if(!!a){var o=dmt(t);o?(this._axisPointer||(this._axisPointer=new a)).render(t,o,r,i):this._disposeAxisPointer(r)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,r){M0e[t]=r},e.getAxisPointerClass=function(t){return t&&M0e[t]},e.type="axis",e}(pl);const K2=vmt;var BJ=na();function L5e(n,e,t,r){var i=t.axis;if(!i.scale.isBlank()){var a=t.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:a,clamp:!0});if(!!u.length){var h=s.length,c=BJ(n).splitAreaColors,f=$r(),d=0;if(c)for(var v=0;v<u.length;v++){var p=c.get(u[v].tickValue);if(p!=null){d=(p+(h-1)*v)%h;break}}var g=i.toGlobalCoord(u[0].coord),m=o.getAreaStyle();s=Gt(s)?s:[s];for(var v=1;v<u.length;v++){var y=i.toGlobalCoord(u[v].coord),_=void 0,x=void 0,S=void 0,w=void 0;i.isHorizontal()?(_=g,x=l.y,S=y-_,w=l.height,g=_+S):(_=l.x,x=g,S=l.width,w=y-x,g=x+w);var b=u[v-1].tickValue;b!=null&&f.set(b,d),e.add(new ta({anid:b!=null?"area_"+b:null,shape:{x:_,y:x,width:S,height:w},style:sn({fill:s[d]},m),autoBatch:!0,silent:!0})),d=(d+1)%h}BJ(n).splitAreaColors=f}}}function P5e(n){BJ(n).splitAreaColors=null}var pmt=["axisLine","axisTickLabel","axisName"],gmt=["splitArea","splitLine","minorSplitLine"],O5e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="CartesianAxisPointer",t}return e.prototype.render=function(t,r,i,a){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Cn,this.group.add(this._axisGroup),!!t.get("show")){var s=t.getCoordSysModel(),l=kJ(s,t),u=new d_(t,Mt({handleAutoShown:function(c){for(var f=s.coordinateSystem.getCartesians(),d=0;d<f.length;d++)if(MJ(f[d].getOtherAxis(t.axis).scale))return!0;return!1}},l));te(pmt,u.add,u),this._axisGroup.add(u.getGroup()),te(gmt,function(c){t.get([c,"show"])&&ymt[c](this,this._axisGroup,t,s)},this);var h=a&&a.type==="changeAxisOrder"&&a.isInitSort;h||m3(o,this._axisGroup,t),n.prototype.render.call(this,t,r,i,a)}},e.prototype.remove=function(){P5e(this)},e.type="cartesianAxis",e}(K2),ymt={splitLine:function(n,e,t,r){var i=t.axis;if(!i.scale.isBlank()){var a=t.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=Gt(s)?s:[s];for(var l=r.coordinateSystem.getRect(),u=i.isHorizontal(),h=0,c=i.getTicksCoords({tickModel:a}),f=[],d=[],v=o.getLineStyle(),p=0;p<c.length;p++){var g=i.toGlobalCoord(c[p].coord);u?(f[0]=g,f[1]=l.y,d[0]=g,d[1]=l.y+l.height):(f[0]=l.x,f[1]=g,d[0]=l.x+l.width,d[1]=g);var m=h++%s.length,y=c[p].tickValue,_=new zh({anid:y!=null?"line_"+c[p].tickValue:null,autoBatch:!0,shape:{x1:f[0],y1:f[1],x2:d[0],y2:d[1]},style:sn({stroke:s[m]},v),silent:!0});fM(_.shape,v.lineWidth),e.add(_)}}},minorSplitLine:function(n,e,t,r){var i=t.axis,a=t.getModel("minorSplitLine"),o=a.getModel("lineStyle"),s=r.coordinateSystem.getRect(),l=i.isHorizontal(),u=i.getMinorTicksCoords();if(!!u.length)for(var h=[],c=[],f=o.getLineStyle(),d=0;d<u.length;d++)for(var v=0;v<u[d].length;v++){var p=i.toGlobalCoord(u[d][v].coord);l?(h[0]=p,h[1]=s.y,c[0]=p,c[1]=s.y+s.height):(h[0]=s.x,h[1]=p,c[0]=s.x+s.width,c[1]=p);var g=new zh({anid:"minor_line_"+u[d][v].tickValue,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:f,silent:!0});fM(g.shape,f.lineWidth),e.add(g)}},splitArea:function(n,e,t,r){L5e(n,e,t,r)}},R5e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="xAxis",e}(O5e),mmt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=R5e.type,t}return e.type="yAxis",e}(O5e),_mt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="grid",t}return e.prototype.render=function(t,r){this.group.removeAll(),t.get("show")&&this.group.add(new ta({shape:t.coordinateSystem.getRect(),style:sn({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(pl),I0e={offset:0};function D5e(n){n.registerComponentView(_mt),n.registerComponentModel($yt),n.registerCoordinateSystem("cartesian2d",tmt),yM(n,"x",DJ,I0e),yM(n,"y",DJ,I0e),n.registerComponentView(R5e),n.registerComponentView(mmt),n.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}function xmt(n){_i(D5e),n.registerSeriesModel(Nyt),n.registerChartView(Uyt),n.registerLayout(M3("scatter"))}function Smt(n){n.eachSeriesByType("radar",function(e){var t=e.getData(),r=[],i=e.coordinateSystem;if(!!i){var a=i.getIndicatorAxes();te(a,function(o,s){t.each(t.mapDimension(a[s].dim),function(l,u){r[u]=r[u]||[];var h=i.dataToPoint(l,s);r[u][s]=L0e(h)?h:P0e(i)})}),t.each(function(o){var s=llt(r[o],function(l){return L0e(l)})||P0e(i);r[o].push(s.slice()),t.setItemLayout(o,r[o])})}})}function L0e(n){return!isNaN(n[0])&&!isNaN(n[1])}function P0e(n){return[n.cx,n.cy]}function wmt(n){var e=n.polar;if(e){Gt(e)||(e=[e]);var t=[];te(e,function(r,i){r.indicator?(r.type&&!r.shape&&(r.shape=r.type),n.radar=n.radar||[],Gt(n.radar)||(n.radar=[n.radar]),n.radar.push(r)):t.push(r)}),n.polar=t}te(n.series,function(r){r&&r.type==="radar"&&r.polarIndex&&(r.radarIndex=r.polarIndex)})}var bmt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.coordinateSystem,o=this.group,s=t.getData(),l=this._data;function u(f,d){var v=f.getItemVisual(d,"symbol")||"circle";if(v!=="none"){var p=$I(f.getItemVisual(d,"symbolSize")),g=hu(v,-1,-1,2,2),m=f.getItemVisual(d,"symbolRotate")||0;return g.attr({style:{strokeNoScale:!0},z2:100,scaleX:p[0]/2,scaleY:p[1]/2,rotation:m*Math.PI/180||0}),g}}function h(f,d,v,p,g,m){v.removeAll();for(var y=0;y<d.length-1;y++){var _=u(p,g);_&&(_.__dimIdx=y,f[y]?(_.setPosition(f[y]),x3[m?"initProps":"updateProps"](_,{x:d[y][0],y:d[y][1]},t,g)):_.setPosition(d[y]),v.add(_))}}function c(f){return Vt(f,function(d){return[a.cx,a.cy]})}s.diff(l).add(function(f){var d=s.getItemLayout(f);if(!!d){var v=new bd,p=new Gd,g={shape:{points:d}};v.shape.points=c(d),p.shape.points=c(d),Is(v,g,t,f),Is(p,g,t,f);var m=new Cn,y=new Cn;m.add(p),m.add(v),m.add(y),h(p.shape.points,d,y,s,f,!0),s.setItemGraphicEl(f,m)}}).update(function(f,d){var v=l.getItemGraphicEl(d),p=v.childAt(0),g=v.childAt(1),m=v.childAt(2),y={shape:{points:s.getItemLayout(f)}};!y.shape.points||(h(p.shape.points,y.shape.points,m,s,f,!1),x0(g),x0(p),ma(p,y,t),ma(g,y,t),s.setItemGraphicEl(f,v))}).remove(function(f){o.remove(l.getItemGraphicEl(f))}).execute(),s.eachItemGraphicEl(function(f,d){var v=s.getItemModel(d),p=f.childAt(0),g=f.childAt(1),m=f.childAt(2),y=s.getItemVisual(d,"style"),_=y.fill;o.add(f),p.useStyle(sn(v.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:_})),dc(p,v,"lineStyle"),dc(g,v,"areaStyle");var x=v.getModel("areaStyle"),S=x.isEmpty()&&x.parentModel.isEmpty();g.ignore=S,te(["emphasis","select","blur"],function(E){var T=v.getModel([E,"areaStyle"]),C=T.isEmpty()&&T.parentModel.isEmpty();g.ensureState(E).ignore=C&&S}),g.useStyle(sn(x.getAreaStyle(),{fill:_,opacity:.7,decal:y.decal}));var w=v.getModel("emphasis"),b=w.getModel("itemStyle").getItemStyle();m.eachChild(function(E){if(E instanceof xc){var T=E.style;E.useStyle(Mt({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},y))}else E.useStyle(y),E.setColor(_),E.style.strokeNoScale=!0;var C=E.ensureState("emphasis");C.style=Sn(b);var A=s.getStore().get(s.getDimensionIndex(E.__dimIdx),d);(A==null||isNaN(A))&&(A=""),vc(E,hh(v),{labelFetcher:s.hostModel,labelDataIndex:d,labelDimIndex:E.__dimIdx,defaultText:A,inheritColor:_,defaultOpacity:y.opacity})}),vl(f,w.get("focus"),w.get("blurScope"),w.get("disabled"))}),this._data=s},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}(os);const Emt=bmt;var Tmt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new L3(kr(this.getData,this),kr(this.getRawData,this))},e.prototype.getInitialData=function(t,r){return WI(this,{generateCoord:"indicator_",generateCoordCount:1/0})},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),o=this.coordinateSystem,s=o.getIndicatorAxes(),l=this.getData().getName(t),u=l===""?this.name:l,h=LFe(this,t);return ch("section",{header:u,sortBlocks:!0,blocks:Vt(s,function(c){var f=a.get(a.mapDimension(c.dim),t);return ch("nameValue",{markerType:"subItem",markerColor:h,name:c.name,value:f,sortParam:f})})})},e.prototype.getTooltipPosition=function(t){if(t!=null){for(var r=this.getData(),i=this.coordinateSystem,a=r.getValues(Vt(i.dimensions,function(u){return r.mapDimension(u)}),t),o=0,s=a.length;o<s;o++)if(!isNaN(a[o])){var l=i.getIndicatorAxes();return i.coordToPoint(l[o].dataToCoord(a[o]),o)}}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},e}(Ws);const Cmt=Tmt;var sP=A5e.value;function M4(n,e){return sn({show:e},n)}var Amt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){var t=this.get("boundaryGap"),r=this.get("splitNumber"),i=this.get("scale"),a=this.get("axisLine"),o=this.get("axisTick"),s=this.get("axisLabel"),l=this.get("axisName"),u=this.get(["axisName","show"]),h=this.get(["axisName","formatter"]),c=this.get("axisNameGap"),f=this.get("triggerEvent"),d=Vt(this.get("indicator")||[],function(v){v.max!=null&&v.max>0&&!v.min?v.min=0:v.min!=null&&v.min<0&&!v.max&&(v.max=0);var p=l;v.color!=null&&(p=sn({color:v.color},l));var g=ii(Sn(v),{boundaryGap:t,splitNumber:r,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:v.text,showName:u,nameLocation:"end",nameGap:c,nameTextStyle:p,triggerEvent:f},!1);if(Or(h)){var m=g.name;g.name=h.replace("{value}",m!=null?m:"")}else rn(h)&&(g.name=h(g.name,g));var y=new as(g,null,this.ecModel);return gu(y,T3.prototype),y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this._indicatorModels=d},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:ii({lineStyle:{color:"#bbb"}},sP.axisLine),axisLabel:M4(sP.axisLabel,!1),axisTick:M4(sP.axisTick,!1),splitLine:M4(sP.splitLine,!0),splitArea:M4(sP.splitArea,!0),indicator:[]},e}(oa);const Mmt=Amt;var Imt=["axisLine","axisTickLabel","axisName"],Lmt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes(),a=Vt(i,function(o){var s=o.model.get("showName")?o.name:"",l=new d_(o.model,{axisName:s,position:[r.cx,r.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});te(a,function(o){te(Imt,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var r=t.coordinateSystem,i=r.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),h=o.get("show"),c=s.get("show"),f=l.get("color"),d=u.get("color"),v=Gt(f)?f:[f],p=Gt(d)?d:[d],g=[],m=[];function y(k,D,G){var W=G%D.length;return k[W]=k[W]||[],W}if(a==="circle")for(var _=i[0].getTicksCoords(),x=r.cx,S=r.cy,w=0;w<_.length;w++){if(h){var b=y(g,v,w);g[b].push(new cm({shape:{cx:x,cy:S,r:_[w].coord}}))}if(c&&w<_.length-1){var b=y(m,p,w);m[b].push(new Kz({shape:{cx:x,cy:S,r0:_[w].coord,r:_[w+1].coord}}))}}else for(var E,T=Vt(i,function(k,D){var G=k.getTicksCoords();return E=E==null?G.length-1:Math.min(G.length-1,E),Vt(G,function(W){return r.coordToPoint(W.coord,D)})}),C=[],w=0;w<=E;w++){for(var A=[],M=0;M<i.length;M++)A.push(T[M][w]);if(A[0]&&A.push(A[0].slice()),h){var b=y(g,v,w);g[b].push(new Gd({shape:{points:A}}))}if(c&&C){var b=y(m,p,w-1);m[b].push(new bd({shape:{points:A.concat(C)}}))}C=A.slice().reverse()}var I=l.getLineStyle(),R=u.getAreaStyle();te(m,function(k,D){this.group.add(Cp(k,{style:sn({stroke:"none",fill:p[D%p.length]},R),silent:!0}))},this),te(g,function(k,D){this.group.add(Cp(k,{style:sn({fill:"none",stroke:v[D%v.length]},I),silent:!0}))},this)},e.type="radar",e}(pl);const Pmt=Lmt;var Omt=function(n){$e(e,n);function e(t,r,i){var a=n.call(this,t,r,i)||this;return a.type="value",a.angle=0,a.name="",a}return e}(D0);const Rmt=Omt;var Dmt=function(){function n(e,t,r){this.dimensions=[],this._model=e,this._indicatorAxes=Vt(e.getIndicatorModels(),function(i,a){var o="indicator_"+a,s=new Rmt(o,new BS);return s.name=i.get("name"),s.model=i,i.axis=s,this.dimensions.push(o),s},this),this.resize(e,r)}return n.prototype.getIndicatorAxes=function(){return this._indicatorAxes},n.prototype.dataToPoint=function(e,t){var r=this._indicatorAxes[t];return this.coordToPoint(r.dataToCoord(e),t)},n.prototype.coordToPoint=function(e,t){var r=this._indicatorAxes[t],i=r.angle,a=this.cx+e*Math.cos(i),o=this.cy-e*Math.sin(i);return[a,o]},n.prototype.pointToData=function(e){var t=e[0]-this.cx,r=e[1]-this.cy,i=Math.sqrt(t*t+r*r);t/=i,r/=i;for(var a=Math.atan2(-r,t),o=1/0,s,l=-1,u=0;u<this._indicatorAxes.length;u++){var h=this._indicatorAxes[u],c=Math.abs(a-h.angle);c<o&&(s=h,l=u,o=c)}return[l,+(s&&s.coordToData(i))]},n.prototype.resize=function(e,t){var r=e.get("center"),i=t.getWidth(),a=t.getHeight(),o=Math.min(i,a)/2;this.cx=xr(r[0],i),this.cy=xr(r[1],a),this.startAngle=e.get("startAngle")*Math.PI/180;var s=e.get("radius");(Or(s)||ha(s))&&(s=[0,s]),this.r0=xr(s[0],o),this.r=xr(s[1],o),te(this._indicatorAxes,function(l,u){l.setExtent(this.r0,this.r);var h=this.startAngle+u*Math.PI*2/this._indicatorAxes.length;h=Math.atan2(Math.sin(h),Math.cos(h)),l.angle=h},this)},n.prototype.update=function(e,t){var r=this._indicatorAxes,i=this._model;te(r,function(s){s.scale.setExtent(1/0,-1/0)}),e.eachSeriesByType("radar",function(s,l){if(!(s.get("coordinateSystem")!=="radar"||e.getComponent("radar",s.get("radarIndex"))!==i)){var u=s.getData();te(r,function(h){h.scale.unionExtentFromData(u,u.mapDimension(h.dim))})}},this);var a=i.get("splitNumber"),o=new BS;o.setExtent(0,a),o.setInterval(1),te(r,function(s,l){M5e(s.scale,s.model,o)})},n.prototype.convertToPixel=function(e,t,r){return console.warn("Not implemented."),null},n.prototype.convertFromPixel=function(e,t,r){return console.warn("Not implemented."),null},n.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},n.create=function(e,t){var r=[];return e.eachComponent("radar",function(i){var a=new n(i,e,t);r.push(a),i.coordinateSystem=a}),e.eachSeriesByType("radar",function(i){i.get("coordinateSystem")==="radar"&&(i.coordinateSystem=r[i.get("radarIndex")||0])}),r},n.dimensions=[],n}();const Nmt=Dmt;function kmt(n){n.registerCoordinateSystem("radar",Nmt),n.registerComponentModel(Mmt),n.registerComponentView(Pmt),n.registerVisual({seriesType:"radar",reset:function(e){var t=e.getData();t.each(function(r){t.setItemVisual(r,"legendIcon","roundRect")}),t.setVisual("legendIcon","roundRect")}})}function Fmt(n){_i(kmt),n.registerChartView(Emt),n.registerSeriesModel(Cmt),n.registerLayout(Smt),n.registerProcessor(I3("radar")),n.registerPreprocessor(wmt)}var O0e="\0_ec_interaction_mutex";function Bmt(n,e,t){var r=dae(n);r[e]=t}function Gmt(n,e,t){var r=dae(n),i=r[e];i===t&&(r[e]=null)}function R0e(n,e){return!!dae(n)[e]}function dae(n){return n[O0e]||(n[O0e]={})}Lm({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Hl);var zmt=function(n){$e(e,n);function e(t){var r=n.call(this)||this;r._zr=t;var i=kr(r._mousedownHandler,r),a=kr(r._mousemoveHandler,r),o=kr(r._mouseupHandler,r),s=kr(r._mousewheelHandler,r),l=kr(r._pinchHandler,r);return r.enable=function(u,h){this.disable(),this._opt=sn(Sn(h)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),u==null&&(u=!0),(u===!0||u==="move"||u==="pan")&&(t.on("mousedown",i),t.on("mousemove",a),t.on("mouseup",o)),(u===!0||u==="scale"||u==="zoom")&&(t.on("mousewheel",s),t.on("pinch",l))},r.disable=function(){t.off("mousedown",i),t.off("mousemove",a),t.off("mouseup",o),t.off("mousewheel",s),t.off("pinch",l)},r}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!ave(t)){for(var r=t.target;r;){if(r.draggable)return;r=r.__hostTarget||r.parent}var i=t.offsetX,a=t.offsetY;this.pointerChecker&&this.pointerChecker(t,i,a)&&(this._x=i,this._y=a,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(!(!this._dragging||!RB("moveOnMouseMove",t,this._opt)||t.gestureEvent==="pinch"||R0e(this._zr,"globalPan"))){var r=t.offsetX,i=t.offsetY,a=this._x,o=this._y,s=r-a,l=i-o;this._x=r,this._y=i,this._opt.preventDefaultMouseMove&&l_(t.event),N5e(this,"pan","moveOnMouseMove",t,{dx:s,dy:l,oldX:a,oldY:o,newX:r,newY:i,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){ave(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var r=RB("zoomOnMouseWheel",t,this._opt),i=RB("moveOnMouseWheel",t,this._opt),a=t.wheelDelta,o=Math.abs(a),s=t.offsetX,l=t.offsetY;if(!(a===0||!r&&!i)){if(r){var u=o>3?1.4:o>1?1.2:1.1,h=a>0?u:1/u;dj(this,"zoom","zoomOnMouseWheel",t,{scale:h,originX:s,originY:l,isAvailableBehavior:null})}if(i){var c=Math.abs(a),f=(a>0?1:-1)*(c>3?.4:c>1?.15:.05);dj(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:f,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!R0e(this._zr,"globalPan")){var r=t.pinchScale>1?1.1:1/1.1;dj(this,"zoom",null,t,{scale:r,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(ng);function dj(n,e,t,r,i){n.pointerChecker&&n.pointerChecker(r,i.originX,i.originY)&&(l_(r.event),N5e(n,e,t,r,i))}function N5e(n,e,t,r,i){i.isAvailableBehavior=kr(RB,null,t,r),n.trigger(e,i)}function RB(n,e,t){var r=t[n];return!n||r&&(!Or(r)||e.event[r+"Key"])}const P3=zmt;function vae(n,e,t){var r=n.target;r.x+=e,r.y+=t,r.dirty()}function pae(n,e,t,r){var i=n.target,a=n.zoomLimit,o=n.zoom=n.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/n.zoom;n.zoom=o,i.x-=(t-i.x)*(u-1),i.y-=(r-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var Umt={axisPointer:1,tooltip:1,brush:1};function mU(n,e,t){var r=e.getComponentByElement(n.topTarget),i=r&&r.coordinateSystem;return r&&r!==t&&!Umt.hasOwnProperty(r.mainType)&&i&&i.model!==t}function k5e(n){if(Or(n)){var e=new DOMParser;n=e.parseFromString(n,"text/xml")}var t=n;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var vj,MG={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},D0e=Li(MG),IG={"alignment-baseline":"textBaseline","stop-color":"stopColor"},N0e=Li(IG),Vmt=function(){function n(){this._defs={},this._root=null}return n.prototype.parse=function(e,t){t=t||{};var r=k5e(e);this._defsUsePending=[];var i=new Cn;this._root=i;var a=[],o=r.getAttribute("viewBox")||"",s=parseFloat(r.getAttribute("width")||t.width),l=parseFloat(r.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),qd(r,i,null,!0,!1);for(var u=r.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;Hmt(this._defs,this._defsUsePending),this._defsUsePending=[];var h,c;if(o){var f=_U(o);f.length>=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&s!=null&&l!=null&&(c=B5e(h,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var d=i;i=new Cn,i.add(d),d.scaleX=d.scaleY=c.scale,d.x=c.x,d.y=c.y}return!t.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new ta({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:h,viewBoxTransform:c,named:a}},n.prototype._parseNode=function(e,t,r,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var h=vj[s];if(h&&Fr(vj,s)){l=h.call(this,e,t);var c=e.getAttribute("name");if(c){var f={name:c,namedFrom:null,svgNodeTagLower:s,el:l};r.push(f),s==="g"&&(u=f)}else i&&r.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});t.add(l)}}var d=k0e[s];if(d&&Fr(k0e,s)){var v=d.call(this,e),p=e.getAttribute("id");p&&(this._defs[p]=v)}}if(l&&l.isGroup)for(var g=e.firstChild;g;)g.nodeType===1?this._parseNode(g,l,r,u,a,o):g.nodeType===3&&o&&this._parseText(g,l),g=g.nextSibling},n.prototype._parseText=function(e,t){var r=new aD({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),$mt(r,t);var i=r.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,r.scaleX*=a/9,r.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=r.getBoundingRect();return this._textX+=s.width,t.add(r),r},n.internalField=function(){vj={g:function(e,t){var r=new Cn;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r},rect:function(e,t){var r=new ta;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),r.silent=!0,r},circle:function(e,t){var r=new cm;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),r.silent=!0,r},line:function(e,t){var r=new zh;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),r.silent=!0,r},ellipse:function(e,t){var r=new Eie;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),r.silent=!0,r},polygon:function(e,t){var r=e.getAttribute("points"),i;r&&(i=G0e(r));var a=new bd({shape:{points:i||[]},silent:!0});return Yv(t,a),qd(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var r=e.getAttribute("points"),i;r&&(i=G0e(r));var a=new Gd({shape:{points:i||[]},silent:!0});return Yv(t,a),qd(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var r=new xc;return Yv(t,r),qd(e,r,this._defsUsePending,!1,!1),r.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),r.silent=!0,r},text:function(e,t){var r=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(r)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Cn;return Yv(t,s),qd(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var r=e.getAttribute("x"),i=e.getAttribute("y");r!=null&&(this._textX=parseFloat(r)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new Cn;return Yv(t,s),qd(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var r=e.getAttribute("d")||"",i=fke(r);return Yv(t,i),qd(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),n}(),k0e={lineargradient:function(n){var e=parseInt(n.getAttribute("x1")||"0",10),t=parseInt(n.getAttribute("y1")||"0",10),r=parseInt(n.getAttribute("x2")||"10",10),i=parseInt(n.getAttribute("y2")||"0",10),a=new y3(e,t,r,i);return F0e(n,a),B0e(n,a),a},radialgradient:function(n){var e=parseInt(n.getAttribute("cx")||"0",10),t=parseInt(n.getAttribute("cy")||"0",10),r=parseInt(n.getAttribute("r")||"0",10),i=new Tke(e,t,r);return F0e(n,i),B0e(n,i),i}};function F0e(n,e){var t=n.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function B0e(n,e){for(var t=n.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var r=t.getAttribute("offset"),i=void 0;r&&r.indexOf("%")>0?i=parseInt(r,10)/100:r?i=parseFloat(r):i=0;var a={};F5e(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:o})}t=t.nextSibling}}function Yv(n,e){n&&n.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),sn(e.__inheritedStyle,n.__inheritedStyle))}function G0e(n){for(var e=_U(n),t=[],r=0;r<e.length;r+=2){var i=parseFloat(e[r]),a=parseFloat(e[r+1]);t.push([i,a])}return t}function qd(n,e,t,r,i){var a=e,o=a.__inheritedStyle=a.__inheritedStyle||{},s={};n.nodeType===1&&(Ymt(n,e),F5e(n,o,s),r||qmt(n,o,s)),a.style=a.style||{},o.fill!=null&&(a.style.fill=z0e(a,"fill",o.fill,t)),o.stroke!=null&&(a.style.stroke=z0e(a,"stroke",o.stroke,t)),te(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(l){o[l]!=null&&(a.style[l]=parseFloat(o[l]))}),te(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],function(l){o[l]!=null&&(a.style[l]=o[l])}),i&&(a.__selfStyle=s),o.lineDash&&(a.style.lineDash=Vt(_U(o.lineDash),function(l){return parseFloat(l)})),(o.visibility==="hidden"||o.visibility==="collapse")&&(a.invisible=!0),o.display==="none"&&(a.ignore=!0)}function $mt(n,e){var t=e.__selfStyle;if(t){var r=t.textBaseline,i=r;!r||r==="auto"||r==="baseline"?i="alphabetic":r==="before-edge"||r==="text-before-edge"?i="top":r==="after-edge"||r==="text-after-edge"?i="bottom":(r==="central"||r==="mathematical")&&(i="middle"),n.style.textBaseline=i}var a=e.__inheritedStyle;if(a){var o=a.textAlign,s=o;o&&(o==="middle"&&(s="center"),n.style.textAlign=s)}}var Wmt=/^url\(\s*#(.*?)\)/;function z0e(n,e,t,r){var i=t&&t.match(Wmt);if(i){var a=Qg(i[1]);r.push([n,e,a]);return}return t==="none"&&(t=null),t}function Hmt(n,e){for(var t=0;t<e.length;t++){var r=e[t];r[0].style[r[1]]=n[r[2]]}}var jmt=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function _U(n){return n.match(jmt)||[]}var Xmt=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,pj=Math.PI/180;function Ymt(n,e){var t=n.getAttribute("transform");if(t){t=t.replace(/,/g," ");var r=[],i=null;t.replace(Xmt,function(c,f,d){return r.push(f,d),""});for(var a=r.length-1;a>0;a-=2){var o=r[a],s=r[a-1],l=_U(o);switch(i=i||Up(),s){case"translate":sm(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":lie(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":j2(i,i,-parseFloat(l[0])*pj);break;case"skewX":var u=Math.tan(parseFloat(l[0])*pj);$1(i,[1,0,u,1,0,0],i);break;case"skewY":var h=Math.tan(parseFloat(l[0])*pj);$1(i,[1,h,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var U0e=/([^\s:;]+)\s*:\s*([^:;]+)/g;function F5e(n,e,t){var r=n.getAttribute("style");if(!!r){U0e.lastIndex=0;for(var i;(i=U0e.exec(r))!=null;){var a=i[1],o=Fr(MG,a)?MG[a]:null;o&&(e[o]=i[2]);var s=Fr(IG,a)?IG[a]:null;s&&(t[s]=i[2])}}}function qmt(n,e,t){for(var r=0;r<D0e.length;r++){var i=D0e[r],a=n.getAttribute(i);a!=null&&(e[MG[i]]=a)}for(var r=0;r<N0e.length;r++){var i=N0e[r],a=n.getAttribute(i);a!=null&&(t[IG[i]]=a)}}function B5e(n,e){var t=e.width/n.width,r=e.height/n.height,i=Math.min(t,r);return{scale:i,x:-(n.x+n.width/2)*i+(e.x+e.width/2),y:-(n.y+n.height/2)*i+(e.y+e.height/2)}}function Zmt(n,e){var t=new Vmt;return t.parse(n,e)}var Kmt=$r(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),Jmt=function(){function n(e,t){this.type="geoSVG",this._usedGraphicMap=$r(),this._freedGraphics=[],this._mapName=e,this._parsedXML=k5e(t)}return n.prototype.load=function(){var e=this._firstGraphic;if(!e){e=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(e),this._boundingRect=this._firstGraphic.boundingRect.clone();var t=e1t(e.named),r=t.regions,i=t.regionsMap;this._regions=r,this._regionsMap=i}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},n.prototype._buildGraphic=function(e){var t,r;try{t=e&&Zmt(e,{ignoreViewBox:!0,ignoreRootClip:!0})||{},r=t.root,Bf(r!=null)}catch(g){throw new Error(`Invalid svg format
`+g.message)}var i=new Cn;i.add(r),i.isGeoSVGGraphicRoot=!0;var a=t.width,o=t.height,s=t.viewBoxRect,l=this._boundingRect;if(!l){var u=void 0,h=void 0,c=void 0,f=void 0;if(a!=null?(u=0,c=a):s&&(u=s.x,c=s.width),o!=null?(h=0,f=o):s&&(h=s.y,f=s.height),u==null||h==null){var d=r.getBoundingRect();u==null&&(u=d.x,c=d.width),h==null&&(h=d.y,f=d.height)}l=this._boundingRect=new ai(u,h,c,f)}if(s){var v=B5e(s,l);r.scaleX=r.scaleY=v.scale,r.x=v.x,r.y=v.y}i.setClipPath(new ta({shape:l.plain()}));var p=[];return te(t.named,function(g){Kmt.get(g.svgNodeTagLower)!=null&&(p.push(g),Qmt(g.el))}),{root:i,boundingRect:l,named:p}},n.prototype.useGraphic=function(e){var t=this._usedGraphicMap,r=t.get(e);return r||(r=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,r),r)},n.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,r=t.get(e);r&&(t.removeKey(e),this._freedGraphics.push(r))},n}();function Qmt(n){n.silent=!1,n.isGroup&&n.traverse(function(e){e.silent=!1})}function e1t(n){var e=[],t=$r();return te(n,function(r){if(r.namedFrom==null){var i=new _gt(r.name,r.el);e.push(i),t.set(r.name,i)}}),{regions:e,regionsMap:t}}var GJ=[126,25],V0e="\u5357\u6D77\u8BF8\u5C9B",Ob=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for(var db=0;db<Ob.length;db++)for(var JT=0;JT<Ob[db].length;JT++)Ob[db][JT][0]/=10.5,Ob[db][JT][1]/=-10.5/.75,Ob[db][JT][0]+=GJ[0],Ob[db][JT][1]+=GJ[1];function t1t(n,e){if(n==="china"){for(var t=0;t<e.length;t++)if(e[t].name===V0e)return;e.push(new k4e(V0e,Vt(Ob,function(r){return{type:"polygon",exterior:r}}),GJ))}}var r1t={\u5357\u6D77\u8BF8\u5C9B:[32,80],\u5E7F\u4E1C:[0,-10],\u9999\u6E2F:[10,5],\u6FB3\u95E8:[-10,10],\u5929\u6D25:[5,5]};function n1t(n,e){if(n==="china"){var t=r1t[e.name];if(t){var r=e.getCenter();r[0]+=t[0]/10.5,r[1]+=-t[1]/(10.5/.75),e.setCenter(r)}}}var i1t=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function a1t(n,e){n==="china"&&e.name==="\u53F0\u6E7E"&&e.geometries.push({type:"polygon",exterior:i1t[0]})}var o1t="name",s1t=function(){function n(e,t,r){this.type="geoJSON",this._parsedMap=$r(),this._mapName=e,this._specialAreas=r,this._geoJSON=u1t(t)}return n.prototype.load=function(e,t){t=t||o1t;var r=this._parsedMap.get(t);if(!r){var i=this._parseToRegions(t);r=this._parsedMap.set(t,{regions:i,boundingRect:l1t(i)})}var a=$r(),o=[];return te(r.regions,function(s){var l=s.name;e&&Fr(e,l)&&(s=s.cloneShallow(l=e[l])),o.push(s),a.set(l,s)}),{regions:o,boundingRect:r.boundingRect||new ai(0,0,0,0),regionsMap:a}},n.prototype._parseToRegions=function(e){var t=this._mapName,r=this._geoJSON,i;try{i=r?Sgt(r,e):[]}catch(a){throw new Error(`Invalid geoJson format
`+a.message)}return t1t(t,i),te(i,function(a){var o=a.name;n1t(t,a),a1t(t,a);var s=this._specialAreas&&this._specialAreas[o];s&&a.transformTo(s.left,s.top,s.width,s.height)},this),i},n.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},n}();function l1t(n){for(var e,t=0;t<n.length;t++){var r=n[t].getBoundingRect();e=e||r.clone(),e.union(r)}return e}function u1t(n){return Or(n)?typeof JSON<"u"&&JSON.parse?JSON.parse(n):new Function("return ("+n+");")():n}var lP=$r();const v_={registerMap:function(n,e,t){if(e.svg){var r=new Jmt(n,e.svg);lP.set(n,r)}else{var i=e.geoJson||e.geoJSON;i&&!e.features?t=e.specialAreas:i=e;var r=new s1t(n,i,t);lP.set(n,r)}},getGeoResource:function(n){return lP.get(n)},getMapForUser:function(n){var e=lP.get(n);return e&&e.type==="geoJSON"&&e.getMapForUser()},load:function(n,e,t){var r=lP.get(n);if(!!r)return r.load(e,t)}};var gae=["rect","circle","line","ellipse","polygon","polyline","path"],h1t=$r(gae),c1t=$r(gae.concat(["g"])),f1t=$r(gae.concat(["g"])),G5e=na();function I4(n){var e=n.getItemStyle(),t=n.get("areaColor");return t!=null&&(e.fill=t),e}function $0e(n){var e=n.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var d1t=function(){function n(e){var t=new Cn;this.uid=kI("ec_map_draw"),this._controller=new P3(e.getZr()),this._controllerHost={target:t},this.group=t,t.add(this._regionsGroup=new Cn),t.add(this._svgGroup=new Cn)}return n.prototype.draw=function(e,t,r,i,a){var o=e.mainType==="geo",s=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},function(m){!s&&m.getHostGeoModel()===e&&(s=m.getData())});var l=e.coordinateSystem,u=this._regionsGroup,h=this.group,c=l.getTransformInfo(),f=c.raw,d=c.roam,v=!u.childAt(0)||a;v?(h.x=d.x,h.y=d.y,h.scaleX=d.scaleX,h.scaleY=d.scaleY,h.dirty()):ma(h,d,e);var p=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0,g={api:r,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:f};l.resourceType==="geoJSON"?this._buildGeoJSON(g):l.resourceType==="geoSVG"&&this._buildSVG(g),this._updateController(e,t,r),this._updateMapSelectHandler(e,u,r,i)},n.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=$r(),r=$r(),i=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function h(d,v){return v&&(d=v(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function c(d){for(var v=[],p=!u&&l&&l.project,g=0;g<d.length;++g){var m=h(d[g],p);m&&v.push(m)}return v}function f(d){return{shape:{points:c(d)}}}i.removeAll(),te(e.geo.regions,function(d){var v=d.name,p=t.get(v),g=r.get(v)||{},m=g.dataIdx,y=g.regionModel;p||(p=t.set(v,new Cn),i.add(p),m=s?s.indexOfName(v):null,y=e.isGeo?o.getRegionModel(v):s?s.getItemModel(m):null,r.set(v,{dataIdx:m,regionModel:y}));var _=[],x=[];te(d.geometries,function(b){if(b.type==="polygon"){var E=[b.exterior].concat(b.interiors||[]);u&&(E=q0e(E,u)),te(E,function(C){_.push(new bd(f(C)))})}else{var T=b.points;u&&(T=q0e(T,u,!0)),te(T,function(C){x.push(new Gd(f(C)))})}});var S=h(d.getCenter(),l&&l.project);function w(b,E){if(!!b.length){var T=new Cie({culling:!0,segmentIgnoreThreshold:1,shape:{paths:b}});p.add(T),W0e(e,T,m,y),H0e(e,T,v,y,o,m,S),E&&($0e(T),te(T.states,$0e))}}w(_),w(x,!0)}),t.each(function(d,v){var p=r.get(v),g=p.dataIdx,m=p.regionModel;j0e(e,d,v,m,o,g),X0e(e,d,v,m,o),Y0e(e,d,v,m,o)},this)},n.prototype._buildSVG=function(e){var t=e.geo.map,r=e.transformInfoRaw;this._svgGroup.x=r.x,this._svgGroup.y=r.y,this._svgGroup.scaleX=r.scaleX,this._svgGroup.scaleY=r.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var i=this._svgDispatcherMap=$r(),a=!1;te(this._svgGraphicRecord.named,function(o){var s=o.name,l=e.mapOrGeoModel,u=e.data,h=o.svgNodeTagLower,c=o.el,f=u?u.indexOfName(s):null,d=l.getRegionModel(s);if(h1t.get(h)!=null&&c instanceof Vp&&W0e(e,c,f,d),c instanceof Vp&&(c.culling=!0),c.z2EmphasisLift=0,!o.namedFrom&&(f1t.get(h)!=null&&H0e(e,c,s,d,l,f,null),j0e(e,c,s,d,l,f),X0e(e,c,s,d,l),c1t.get(h)!=null)){var v=Y0e(e,c,s,d,l);v==="self"&&(a=!0);var p=i.get(s)||i.set(s,[]);p.push(c)}},this),this._enableBlurEntireSVG(a,e)},n.prototype._enableBlurEntireSVG=function(e,t){if(e&&t.isGeo){var r=t.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle(),i=r.opacity;this._svgGraphicRecord.root.traverse(function(a){if(!a.isGroup){ZE(a);var o=a.ensureState("blur").style||{};o.opacity==null&&i!=null&&(o.opacity=i),a.ensureState("emphasis")}})}},n.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},n.prototype.findHighDownDispatchers=function(e,t){if(e==null)return[];var r=t.coordinateSystem;if(r.resourceType==="geoJSON"){var i=this._regionsGroupByName;if(i){var a=i.get(e);return a?[a]:[]}}else if(r.resourceType==="geoSVG")return this._svgDispatcherMap&&this._svgDispatcherMap.get(e)||[]},n.prototype._svgResourceChanged=function(e){return this._svgMapName!==e},n.prototype._useSVG=function(e){var t=v_.getGeoResource(e);if(t&&t.type==="geoSVG"){var r=t.useGraphic(this.uid);this._svgGroup.add(r.root),this._svgGraphicRecord=r,this._svgMapName=e}},n.prototype._freeSVG=function(){var e=this._svgMapName;if(e!=null){var t=v_.getGeoResource(e);t&&t.type==="geoSVG"&&t.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},n.prototype._updateController=function(e,t,r){var i=e.coordinateSystem,a=this._controller,o=this._controllerHost;o.zoomLimit=e.get("scaleLimit"),o.zoom=i.getZoom(),a.enable(e.get("roam")||!1);var s=e.mainType;function l(){var u={type:"geoRoam",componentType:s};return u[s+"Id"]=e.id,u}a.off("pan").on("pan",function(u){this._mouseDownFlag=!1,vae(o,u.dx,u.dy),r.dispatchAction(Mt(l(),{dx:u.dx,dy:u.dy,animation:{duration:0}}))},this),a.off("zoom").on("zoom",function(u){this._mouseDownFlag=!1,pae(o,u.scale,u.originX,u.originY),r.dispatchAction(Mt(l(),{zoom:u.scale,originX:u.originX,originY:u.originY,animation:{duration:0}}))},this),a.setPointerChecker(function(u,h,c){return i.containPoint([h,c])&&!mU(u,r,e)})},n.prototype.resetForLabelLayout=function(){this.group.traverse(function(e){var t=e.getTextContent();t&&(t.ignore=G5e(t).ignore)})},n.prototype._updateMapSelectHandler=function(e,t,r,i){var a=this;t.off("mousedown"),t.off("click"),e.get("selectedMode")&&(t.on("mousedown",function(){a._mouseDownFlag=!0}),t.on("click",function(o){!a._mouseDownFlag||(a._mouseDownFlag=!1)}))},n}();function W0e(n,e,t,r){var i=r.getModel("itemStyle"),a=r.getModel(["emphasis","itemStyle"]),o=r.getModel(["blur","itemStyle"]),s=r.getModel(["select","itemStyle"]),l=I4(i),u=I4(a),h=I4(s),c=I4(o),f=n.data;if(f){var d=f.getItemVisual(t,"style"),v=f.getItemVisual(t,"decal");n.isVisualEncodedByVisualMap&&d.fill&&(l.fill=d.fill),v&&(l.decal=vM(v,n.api))}e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=u,e.ensureState("select").style=h,e.ensureState("blur").style=c,ZE(e)}function H0e(n,e,t,r,i,a,o){var s=n.data,l=n.isGeo,u=s&&isNaN(s.get(s.mapDimension("value"),a)),h=s&&s.getItemLayout(a);if(l||u||h&&h.showLabel){var c=l?t:a,f=void 0;(!s||a>=0)&&(f=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;vc(e,hh(r),{labelFetcher:f,labelDataIndex:c,defaultText:t},d);var v=e.getTextContent();if(v&&(G5e(v).ignore=v.ignore,e.textConfig&&o)){var p=e.getBoundingRect().clone();e.textConfig.layoutRect=p,e.textConfig.position=[(o[0]-p.x)/p.width*100+"%",(o[1]-p.y)/p.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function j0e(n,e,t,r,i,a){n.data?n.data.setItemGraphicEl(a,e):Bn(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:r&&r.option||{}}}function X0e(n,e,t,r,i){n.data||DI({el:e,componentModel:i,itemName:t,itemTooltipOption:r.get("tooltip")})}function Y0e(n,e,t,r,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=r.getModel("emphasis"),o=a.get("focus");return vl(e,o,a.get("blurScope"),a.get("disabled")),n.isGeo&&gct(e,i,t),o}function q0e(n,e,t){var r=[],i;function a(){i=[]}function o(){i.length&&(r.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),te(n,function(l){s.lineStart();for(var u=0;u<l.length;u++)s.point(l[u][0],l[u][1]);s.lineEnd()}),!t&&s.polygonEnd(),r}const z5e=d1t;var v1t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&a&&a.type==="geoRoam"&&this._mapDraw.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===t.id){var s=this._mapDraw;s&&o.add(s.group)}else if(t.needsDrawMap){var s=this._mapDraw||new z5e(i);o.add(s.group),s.draw(t,r,i,this,a),this._mapDraw=s}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&r.getComponent("legend")&&this._renderSymbols(t,r,i)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,r,i){var a=t.originalData,o=this.group;a.each(a.mapDimension("value"),function(s,l){if(!isNaN(s)){var u=a.getItemLayout(l);if(!(!u||!u.point)){var h=u.point,c=u.offset,f=new cm({style:{fill:t.getData().getVisual("style").fill},shape:{cx:h[0]+c*9,cy:h[1],r:3},silent:!0,z2:8+(c?0:OI+1)});if(!c){var d=t.mainSeries.getData(),v=a.getName(l),p=d.indexOfName(v),g=a.getItemModel(l),m=g.getModel("label"),y=d.getItemGraphicEl(p);vc(f,hh(g),{labelFetcher:{getFormattedLabel:function(_,x){return t.getFormattedLabel(p,x)}},defaultText:v}),f.disableLabelAnimation=!0,m.get("position")||f.setTextConfig({position:"bottom"}),y.onHoverStateChange=function(_){sG(f,_)}}o.add(f)}}})},e.type="map",e}(os);const p1t=v1t;var g1t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.needsDrawMap=!1,t.seriesGroup=[],t.getTooltipPosition=function(r){if(r!=null){var i=this.getData().getName(r),a=this.coordinateSystem,o=a.getRegion(i);return o&&a.dataToPoint(o.getCenter())}},t}return e.prototype.getInitialData=function(t){for(var r=WI(this,{coordDimensions:["value"],encodeDefaulter:Un(Nie,this)}),i=$r(),a=[],o=0,s=r.count();o<s;o++){var l=r.getName(o);i.set(l,!0)}var u=v_.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return te(u.regions,function(h){var c=h.name;i.get(c)||a.push(c)}),r.appendValues([],a),r},e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return t!=null?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},e.prototype.getRawValue=function(t){var r=this.getData();return r.get(r.mapDimension("value"),t)},e.prototype.getRegionModel=function(t){var r=this.getData();return r.getItemModel(r.indexOfName(t))},e.prototype.formatTooltip=function(t,r,i){for(var a=this.getData(),o=this.getRawValue(t),s=a.getName(t),l=this.seriesGroup,u=[],h=0;h<l.length;h++){var c=l[h].originalData.indexOfName(s),f=a.mapDimension("value");isNaN(l[h].originalData.get(f,c))||u.push(l[h].name)}return ch("section",{header:u.join(", "),noHeader:!u.length,blocks:[ch("nameValue",{name:s,value:o})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var r=t.icon||"roundRect",i=hu(r,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return i.setStyle(t.itemStyle),i.style.stroke="none",r.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Ws);const y1t=g1t;function m1t(n,e){var t={};return te(n,function(r){r.each(r.mapDimension("value"),function(i,a){var o="ec-"+r.getName(a);t[o]=t[o]||[],isNaN(i)||t[o].push(i)})}),n[0].map(n[0].mapDimension("value"),function(r,i){for(var a="ec-"+n[0].getName(i),o=0,s=1/0,l=-1/0,u=t[a].length,h=0;h<u;h++)s=Math.min(s,t[a][h]),l=Math.max(l,t[a][h]),o+=t[a][h];var c;return e==="min"?c=s:e==="max"?c=l:e==="average"?c=o/u:c=o,u===0?NaN:c})}function _1t(n){var e={};n.eachSeriesByType("map",function(t){var r=t.getHostGeoModel(),i=r?"o"+r.id:"i"+t.getMapType();(e[i]=e[i]||[]).push(t)}),te(e,function(t,r){for(var i=m1t(Vt(t,function(o){return o.getData()}),t[0].get("mapValueCalculation")),a=0;a<t.length;a++)t[a].originalData=t[a].getData();for(var a=0;a<t.length;a++)t[a].seriesGroup=t,t[a].needsDrawMap=a===0&&!t[a].getHostGeoModel(),t[a].setData(i.cloneShallow()),t[a].mainSeries=t[0]})}function x1t(n){var e={};n.eachSeriesByType("map",function(t){var r=t.getMapType();if(!(t.getHostGeoModel()||e[r])){var i={};te(t.seriesGroup,function(o){var s=o.coordinateSystem,l=o.originalData;o.get("showLegendSymbol")&&n.getComponent("legend")&&l.each(l.mapDimension("value"),function(u,h){var c=l.getName(h),f=s.getRegion(c);if(!(!f||isNaN(u))){var d=i[c]||0,v=s.dataToPoint(f.getCenter());i[c]=d+1,l.setItemLayout(h,{point:v,offset:d})}})});var a=t.getData();a.each(function(o){var s=a.getName(o),l=a.getItemLayout(o)||{};l.showLabel=!i[s],a.setItemLayout(o,l)}),e[r]=!0}})}var Z0e=cc,S1t=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r.type="view",r.dimensions=["x","y"],r._roamTransformable=new L1,r._rawTransformable=new L1,r.name=t,r}return e.prototype.setBoundingRect=function(t,r,i,a){return this._rect=new ai(t,r,i,a),this._rect},e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,r,i,a){this._transformTo(t,r,i,a),this._viewRect=new ai(t,r,i,a)},e.prototype._transformTo=function(t,r,i,a){var o=this.getBoundingRect(),s=this._rawTransformable;s.transform=o.calculateTransform(new ai(t,r,i,a));var l=s.parent;s.parent=null,s.decomposeTransform(),s.parent=l,this._updateTransform()},e.prototype.setCenter=function(t,r){!t||(this._center=[xr(t[0],r.getWidth()),xr(t[1],r.getHeight())],this._updateCenterAndZoom())},e.prototype.setZoom=function(t){t=t||1;var r=this.zoomLimit;r&&(r.max!=null&&(t=Math.min(r.max,t)),r.min!=null&&(t=Math.max(r.min,t))),this._zoom=t,this._updateCenterAndZoom()},e.prototype.getDefaultCenter=function(){var t=this.getBoundingRect(),r=t.x+t.width/2,i=t.y+t.height/2;return[r,i]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},e.prototype._updateCenterAndZoom=function(){var t=this._rawTransformable.getLocalTransform(),r=this._roamTransformable,i=this.getDefaultCenter(),a=this.getCenter(),o=this.getZoom();a=cc([],a,t),i=cc([],i,t),r.originX=a[0],r.originY=a[1],r.x=i[0]-a[0],r.y=i[1]-a[1],r.scaleX=r.scaleY=o,this._updateTransform()},e.prototype._updateTransform=function(){var t=this._roamTransformable,r=this._rawTransformable;r.parent=t,t.updateTransform(),r.updateTransform(),sie(this.transform||(this.transform=[]),r.transform||Up()),this._rawTransform=r.getLocalTransform(),this.invTransform=this.invTransform||[],LI(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,r=this._roamTransformable,i=new L1;return i.transform=r.transform,i.decomposeTransform(),{roam:{x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},e.prototype.dataToPoint=function(t,r,i){var a=r?this._rawTransform:this.transform;return i=i||[],a?Z0e(i,t,a):mf(i,t)},e.prototype.pointToData=function(t){var r=this.invTransform;return r?Z0e([],t,r):[t[0],t[1]]},e.prototype.convertToPixel=function(t,r,i){var a=K0e(r);return a===this?a.dataToPoint(i):null},e.prototype.convertFromPixel=function(t,r,i){var a=K0e(r);return a===this?a.pointToData(i):null},e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(L1);function K0e(n){var e=n.seriesModel;return e?e.coordinateSystem:null}const O3=S1t;var w1t={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},U5e=["lng","lat"],V5e=function(n){$e(e,n);function e(t,r,i){var a=n.call(this,t)||this;a.dimensions=U5e,a.type="geo",a._nameCoordMap=$r(),a.map=r;var o=i.projection,s=v_.load(r,i.nameMap,i.nameProperty),l=v_.getGeoResource(r);a.resourceType=l?l.type:null;var u=a.regions=s.regions,h=w1t[l.type];a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o;var c;if(o)for(var f=0;f<u.length;f++){var d=u[f].getBoundingRect(o);c=c||d.clone(),c.union(d)}else c=s.boundingRect;return a.setBoundingRect(c.x,c.y,c.width,c.height),a.aspectScale=o?1:ni(i.aspectScale,h.aspectScale),a._invertLongitute=o?!1:h.invertLongitute,a}return e.prototype._transformTo=function(t,r,i,a){var o=this.getBoundingRect(),s=this._invertLongitute;o=o.clone(),s&&(o.y=-o.y-o.height);var l=this._rawTransformable;l.transform=o.calculateTransform(new ai(t,r,i,a));var u=l.parent;l.parent=null,l.decomposeTransform(),l.parent=u,s&&(l.scaleY=-l.scaleY),this._updateTransform()},e.prototype.getRegion=function(t){return this._regionsMap.get(t)},e.prototype.getRegionByCoord=function(t){for(var r=this.regions,i=0;i<r.length;i++){var a=r[i];if(a.type==="geoJSON"&&a.contain(t))return r[i]}},e.prototype.addGeoCoord=function(t,r){this._nameCoordMap.set(t,r)},e.prototype.getGeoCoord=function(t){var r=this._regionsMap.get(t);return this._nameCoordMap.get(t)||r&&r.getCenter()},e.prototype.dataToPoint=function(t,r,i){if(Or(t)&&(t=this.getGeoCoord(t)),t){var a=this.projection;return a&&(t=a.project(t)),t&&this.projectedToPoint(t,r,i)}},e.prototype.pointToData=function(t){var r=this.projection;return r&&(t=r.unproject(t)),t&&this.pointToProjected(t)},e.prototype.pointToProjected=function(t){return n.prototype.pointToData.call(this,t)},e.prototype.projectedToPoint=function(t,r,i){return n.prototype.dataToPoint.call(this,t,r,i)},e.prototype.convertToPixel=function(t,r,i){var a=J0e(r);return a===this?a.dataToPoint(i):null},e.prototype.convertFromPixel=function(t,r,i){var a=J0e(r);return a===this?a.pointToData(i):null},e}(O3);gu(V5e,O3);function J0e(n){var e=n.geoModel,t=n.seriesModel;return e?e.coordinateSystem:t?t.coordinateSystem||(t.getReferringComponents("geo",uu).models[0]||{}).coordinateSystem:null}const Q0e=V5e;function eye(n,e){var t=n.get("boundingCoords");if(t!=null){var r=t[0],i=t[1];if(isFinite(r[0])&&isFinite(r[1])&&isFinite(i[0])&&isFinite(i[1])){var a=this.projection;if(a){var o=r[0],s=r[1],l=i[0],u=i[1];r=[1/0,1/0],i=[-1/0,-1/0];var h=function(w,b,E,T){for(var C=E-w,A=T-b,M=0;M<=100;M++){var I=M/100,R=a.project([w+C*I,b+A*I]);Kx(r,r,R),Jx(i,i,R)}};h(o,s,l,s),h(l,s,l,u),h(l,u,o,u),h(o,u,l,s)}this.setBoundingRect(r[0],r[1],i[0]-r[0],i[1]-r[1])}}var c=this.getBoundingRect(),f=n.get("layoutCenter"),d=n.get("layoutSize"),v=e.getWidth(),p=e.getHeight(),g=c.width/c.height*this.aspectScale,m=!1,y,_;f&&d&&(y=[xr(f[0],v),xr(f[1],p)],_=xr(d,Math.min(v,p)),!isNaN(y[0])&&!isNaN(y[1])&&!isNaN(_)&&(m=!0));var x;if(m)x={},g>1?(x.width=_,x.height=_/g):(x.height=_,x.width=_*g),x.y=y[1]-x.height/2,x.x=y[0]-x.width/2;else{var S=n.getBoxLayoutParams();S.aspect=g,x=Uu(S,{width:v,height:p})}this.setViewRect(x.x,x.y,x.width,x.height),this.setCenter(n.get("center"),e),this.setZoom(n.get("zoom"))}function b1t(n,e){te(e.get("geoCoord"),function(t,r){n.addGeoCoord(r,t)})}var E1t=function(){function n(){this.dimensions=U5e}return n.prototype.create=function(e,t){var r=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new Q0e(l+s,l,Mt({nameMap:o.get("nameMap")},i(o)));u.zoomLimit=o.get("scaleLimit"),r.push(u),o.coordinateSystem=u,u.model=o,u.resize=eye,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=r[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),te(a,function(o,s){var l=Vt(o,function(h){return h.get("nameMap")}),u=new Q0e(s,s,Mt({nameMap:nie(l)},i(o[0])));u.zoomLimit=Gh.apply(null,Vt(o,function(h){return h.get("scaleLimit")})),r.push(u),u.resize=eye,u.resize(o[0],t),te(o,function(h){h.coordinateSystem=u,b1t(u,h)})}),r},n.prototype.getFilledRegions=function(e,t,r,i){for(var a=(e||[]).slice(),o=$r(),s=0;s<a.length;s++)o.set(a[s].name,a[s]);var l=v_.load(t,r,i);return te(l.regions,function(u){var h=u.name;!o.get(h)&&a.push({name:h})}),a},n}(),T1t=new E1t;const $5e=T1t;var C1t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r,i){var a=v_.getGeoResource(t.map);if(a&&a.type==="geoJSON"){var o=t.itemStyle=t.itemStyle||{};"color"in o||(o.color="#eee")}this.mergeDefaultAndTheme(t,i),XE(t,"label",["show"])},e.prototype.optionUpdated=function(){var t=this,r=this.option;r.regions=$5e.getFilledRegions(r.regions,r.map,r.nameMap,r.nameProperty);var i={};this._optionModelMap=om(r.regions||[],function(a,o){var s=o.name;return s&&(a.set(s,new as(o,t,t.ecModel)),o.selected&&(i[s]=!0)),a},$r()),r.selectedMap||(r.selectedMap=i)},e.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new as(null,this,this.ecModel)},e.prototype.getFormattedLabel=function(t,r){var i=this.getRegionModel(t),a=r==="normal"?i.get(["label","formatter"]):i.get(["emphasis","label","formatter"]),o={name:t};if(rn(a))return o.status=r,a(o);if(Or(a))return a.replace("{a}",t!=null?t:"")},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.select=function(t){var r=this.option,i=r.selectedMode;if(!!i){i!=="multiple"&&(r.selectedMap=null);var a=r.selectedMap||(r.selectedMap={});a[t]=!0}},e.prototype.unSelect=function(t){var r=this.option.selectedMap;r&&(r[t]=!1)},e.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},e.prototype.isSelected=function(t){var r=this.option.selectedMap;return!!(r&&r[t])},e.type="geo",e.layoutMode="box",e.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},e}(oa);const A1t=C1t;function tye(n,e){return n.pointToProjected?n.pointToProjected(e):n.pointToData(e)}function yae(n,e,t,r){var i=n.getZoom(),a=n.getCenter(),o=e.zoom,s=n.projectedToPoint?n.projectedToPoint(a):n.dataToPoint(a);if(e.dx!=null&&e.dy!=null&&(s[0]-=e.dx,s[1]-=e.dy,n.setCenter(tye(n,s),r)),o!=null){if(t){var l=t.min||0,u=t.max||1/0;o=Math.max(Math.min(i*o,u),l)/i}n.scaleX*=o,n.scaleY*=o;var h=(e.originX-n.x)*(o-1),c=(e.originY-n.y)*(o-1);n.x-=h,n.y-=c,n.updateTransform(),n.setCenter(tye(n,s),r),n.setZoom(o*i)}return{center:n.getCenter(),zoom:n.getZoom()}}var M1t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.focusBlurEnabled=!0,t}return e.prototype.init=function(t,r){this._api=r},e.prototype.render=function(t,r,i,a){if(this._model=t,!t.get("show")){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;return}this._mapDraw||(this._mapDraw=new z5e(i));var o=this._mapDraw;o.draw(t,r,i,this,a),o.group.on("click",this._handleRegionClick,this),o.group.silent=t.get("silent"),this.group.add(o.group),this.updateSelectStatus(t,r,i)},e.prototype._handleRegionClick=function(t){var r;aE(t.target,function(i){return(r=Bn(i).eventData)!=null},!0),r&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:r.name})},e.prototype.updateSelectStatus=function(t,r,i){var a=this;this._mapDraw.group.traverse(function(o){var s=Bn(o).eventData;if(s)return a._model.isSelected(s.name)?i.enterSelect(o):i.leaveSelect(o),!0})},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(pl);const I1t=M1t;function L1t(n,e,t){v_.registerMap(n,e,t)}function W5e(n){n.registerCoordinateSystem("geo",$5e),n.registerComponentModel(A1t),n.registerComponentView(I1t),n.registerImpl("registerMap",L1t),n.registerImpl("getMap",function(t){return v_.getMapForUser(t)});function e(t,r){r.update="geo:updateSelectStatus",n.registerAction(r,function(i,a){var o={},s=[];return a.eachComponent({mainType:"geo",query:i},function(l){l[t](i.name);var u=l.coordinateSystem;te(u.regions,function(c){o[c.name]=l.isSelected(c.name)||!1});var h=[];te(o,function(c,f){o[f]&&h.push(f)}),s.push({geoIndex:l.componentIndex,name:h})}),{selected:o,allSelected:s,name:i.name}})}e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),n.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,r,i){var a=t.componentType||"series";r.eachComponent({mainType:a,query:t},function(o){var s=o.coordinateSystem;if(s.type==="geo"){var l=yae(s,t,o.get("scaleLimit"),i);o.setCenter&&o.setCenter(l.center),o.setZoom&&o.setZoom(l.zoom),a==="series"&&te(o.seriesGroup,function(u){u.setCenter(l.center),u.setZoom(l.zoom)})}})})}function P1t(n){_i(W5e),n.registerChartView(p1t),n.registerSeriesModel(y1t),n.registerLayout(x1t),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,_1t),VFe("map",n.registerAction)}function O1t(n){var e=n;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t=[e],r,i;r=t.pop();)if(i=r.children,r.isExpand&&i.length)for(var a=i.length,o=a-1;o>=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function R1t(n,e){var t=n.isExpand?n.children:[],r=n.parentNode.children,i=n.hierNode.i?r[n.hierNode.i-1]:null;if(t.length){k1t(n);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(n.hierNode.prelim=i.hierNode.prelim+e(n,i),n.hierNode.modifier=n.hierNode.prelim-a):n.hierNode.prelim=a}else i&&(n.hierNode.prelim=i.hierNode.prelim+e(n,i));n.parentNode.hierNode.defaultAncestor=F1t(n,i,n.parentNode.hierNode.defaultAncestor||r[0],e)}function D1t(n){var e=n.hierNode.prelim+n.parentNode.hierNode.modifier;n.setLayout({x:e},!0),n.hierNode.modifier+=n.parentNode.hierNode.modifier}function rye(n){return arguments.length?n:z1t}function oO(n,e){return n-=Math.PI/2,{x:e*Math.cos(n),y:e*Math.sin(n)}}function N1t(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function k1t(n){for(var e=n.children,t=e.length,r=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=r,a.hierNode.modifier+=r,i+=a.hierNode.change,r+=a.hierNode.shift+i}}function F1t(n,e,t,r){if(e){for(var i=n,a=n,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=gj(s),a=yj(a),s&&a;){i=gj(i),o=yj(o),i.hierNode.ancestor=n;var f=s.hierNode.prelim+c-a.hierNode.prelim-u+r(s,a);f>0&&(G1t(B1t(s,n,t),n,f),u+=f,l+=f),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,h+=o.hierNode.modifier}s&&!gj(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=c-l),a&&!yj(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,t=n)}return t}function gj(n){var e=n.children;return e.length&&n.isExpand?e[e.length-1]:n.hierNode.thread}function yj(n){var e=n.children;return e.length&&n.isExpand?e[0]:n.hierNode.thread}function B1t(n,e,t){return n.hierNode.ancestor.parentNode===e.parentNode?n.hierNode.ancestor:t}function G1t(n,e,t){var r=t/(e.hierNode.i-n.hierNode.i);e.hierNode.change-=r,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,n.hierNode.change+=r}function z1t(n,e){return n.parentNode===e.parentNode?1:2}var U1t=function(){function n(){this.parentPoint=[],this.childPoints=[]}return n}(),V1t=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new U1t},e.prototype.buildPath=function(t,r){var i=r.childPoints,a=i.length,o=r.parentPoint,s=i[0],l=i[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=r.orient,h=u==="TB"||u==="BT"?0:1,c=1-h,f=xr(r.forkPosition,1),d=[];d[h]=o[h],d[c]=o[c]+(l[c]-o[c])*f,t.moveTo(o[0],o[1]),t.lineTo(d[0],d[1]),t.moveTo(s[0],s[1]),d[h]=s[h],t.lineTo(d[0],d[1]),d[h]=l[h],t.lineTo(d[0],d[1]),t.lineTo(l[0],l[1]);for(var v=1;v<a-1;v++){var p=i[v];t.moveTo(p[0],p[1]),d[h]=p[h],t.lineTo(d[0],d[1])}},e}(Si),$1t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._mainGroup=new Cn,t}return e.prototype.init=function(t,r){this._controller=new P3(r.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,r,i){var a=t.getData(),o=t.layoutInfo,s=this._mainGroup,l=t.get("layout");l==="radial"?(s.x=o.x+o.width/2,s.y=o.y+o.height/2):(s.x=o.x,s.y=o.y),this._updateViewCoordSys(t,i),this._updateController(t,r,i);var u=this._data;a.diff(u).add(function(h){nye(a,h)&&iye(a,h,null,s,t)}).update(function(h,c){var f=u.getItemGraphicEl(c);if(!nye(a,h)){f&&oye(u,c,f,s,t);return}iye(a,h,f,s,t)}).remove(function(h){var c=u.getItemGraphicEl(h);c&&oye(u,h,c,s,t)}).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),t.get("expandAndCollapse")===!0&&a.eachItemGraphicEl(function(h,c){h.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:c})})}),this._data=a},e.prototype._updateViewCoordSys=function(t,r){var i=t.getData(),a=[];i.each(function(c){var f=i.getItemLayout(c);f&&!isNaN(f.x)&&!isNaN(f.y)&&a.push([+f.x,+f.y])});var o=[],s=[];Yz(a,o,s);var l=this._min,u=this._max;s[0]-o[0]===0&&(o[0]=l?l[0]:o[0]-1,s[0]=u?u[0]:s[0]+1),s[1]-o[1]===0&&(o[1]=l?l[1]:o[1]-1,s[1]=u?u[1]:s[1]+1);var h=t.coordinateSystem=new O3;h.zoomLimit=t.get("scaleLimit"),h.setBoundingRect(o[0],o[1],s[0]-o[0],s[1]-o[1]),h.setCenter(t.get("center"),r),h.setZoom(t.get("zoom")),this.group.attr({x:h.x,y:h.y,scaleX:h.scaleX,scaleY:h.scaleY}),this._min=o,this._max=s},e.prototype._updateController=function(t,r,i){var a=this,o=this._controller,s=this._controllerHost,l=this.group;o.setPointerChecker(function(u,h,c){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(h,c)&&!mU(u,i,t)}),o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){vae(s,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"treeRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){pae(s,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(t),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(t){var r=t.getData(),i=this._getNodeGlobalScale(t);r.eachItemGraphicEl(function(a,o){a.setSymbolScale(i)})},e.prototype._getNodeGlobalScale=function(t){var r=t.coordinateSystem;if(r.type!=="view")return 1;var i=this._nodeScaleRatio,a=r.scaleX||1,o=r.getZoom(),s=(o-1)*i+1;return s/a},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}(os);function nye(n,e){var t=n.getItemLayout(e);return t&&!isNaN(t.x)&&!isNaN(t.y)}function iye(n,e,t,r,i){var a=!t,o=n.tree.getNodeByDataIndex(e),s=o.getModel(),l=o.getVisual("style").fill,u=o.isExpand===!1&&o.children.length!==0?l:"#fff",h=n.tree.root,c=o.parentNode===h?o:o.parentNode||o,f=n.getItemGraphicEl(c.dataIndex),d=c.getLayout(),v=f?{x:f.__oldX,y:f.__oldY,rawX:f.__radialOldRawX,rawY:f.__radialOldRawY}:d,p=o.getLayout();a?(t=new C3(n,e,null,{symbolInnerColor:u,useNameLabel:!0}),t.x=v.x,t.y=v.y):t.updateData(n,e,null,{symbolInnerColor:u,useNameLabel:!0}),t.__radialOldRawX=t.__radialRawX,t.__radialOldRawY=t.__radialRawY,t.__radialRawX=p.rawX,t.__radialRawY=p.rawY,r.add(t),n.setItemGraphicEl(e,t),t.__oldX=t.x,t.__oldY=t.y,ma(t,{x:p.x,y:p.y},i);var g=t.getSymbolPath();if(i.get("layout")==="radial"){var m=h.children[0],y=m.getLayout(),_=m.children.length,x=void 0,S=void 0;if(p.x===y.x&&o.isExpand===!0&&m.children.length){var w={x:(m.children[0].getLayout().x+m.children[_-1].getLayout().x)/2,y:(m.children[0].getLayout().y+m.children[_-1].getLayout().y)/2};x=Math.atan2(w.y-y.y,w.x-y.x),x<0&&(x=Math.PI*2+x),S=w.x<y.x,S&&(x=x-Math.PI)}else x=Math.atan2(p.y-y.y,p.x-y.x),x<0&&(x=Math.PI*2+x),o.children.length===0||o.children.length!==0&&o.isExpand===!1?(S=p.x<y.x,S&&(x=x-Math.PI)):(S=p.x>y.x,S||(x=x-Math.PI));var b=S?"left":"right",E=s.getModel("label"),T=E.get("rotate"),C=T*(Math.PI/180),A=g.getTextContent();A&&(g.setTextConfig({position:E.get("position")||b,rotation:T==null?-x:C,origin:"center"}),A.setStyle("verticalAlign","middle"))}var M=s.get(["emphasis","focus"]),I=M==="relative"?K8(o.getAncestorsIndices(),o.getDescendantIndices()):M==="ancestor"?o.getAncestorsIndices():M==="descendant"?o.getDescendantIndices():null;I&&(Bn(t).focus=I),W1t(i,o,h,t,v,d,p,r),t.__edge&&(t.onHoverStateChange=function(R){if(R!=="blur"){var k=o.parentNode&&n.getItemGraphicEl(o.parentNode.dataIndex);k&&k.hoverState===g3||sG(t.__edge,R)}})}function W1t(n,e,t,r,i,a,o,s){var l=e.getModel(),u=n.get("edgeShape"),h=n.get("layout"),c=n.getOrient(),f=n.get(["lineStyle","curveness"]),d=n.get("edgeForkPosition"),v=l.getModel("lineStyle").getLineStyle(),p=r.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(p||(p=r.__edge=new Jz({shape:zJ(h,c,f,i,i)})),ma(p,{shape:zJ(h,c,f,a,o)},n));else if(u==="polyline"&&h==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var g=e.children,m=[],y=0;y<g.length;y++){var _=g[y].getLayout();m.push([_.x,_.y])}p||(p=r.__edge=new V1t({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:c,forkPosition:d}})),ma(p,{shape:{parentPoint:[o.x,o.y],childPoints:m}},n)}p&&!(u==="polyline"&&!e.isExpand)&&(p.useStyle(sn({strokeNoScale:!0,fill:null},v)),dc(p,l,"lineStyle"),ZE(p),s.add(p))}function aye(n,e,t,r,i){var a=e.tree.root,o=H5e(a,n),s=o.source,l=o.sourceLayout,u=e.getItemGraphicEl(n.dataIndex);if(!!u){var h=e.getItemGraphicEl(s.dataIndex),c=h.__edge,f=u.__edge||(s.isExpand===!1||s.children.length===1?c:void 0),d=r.get("edgeShape"),v=r.get("layout"),p=r.get("orient"),g=r.get(["lineStyle","curveness"]);f&&(d==="curve"?NS(f,{shape:zJ(v,p,g,l,l),style:{opacity:0}},r,{cb:function(){t.remove(f)},removeOpt:i}):d==="polyline"&&r.get("layout")==="orthogonal"&&NS(f,{shape:{parentPoint:[l.x,l.y],childPoints:[[l.x,l.y]]},style:{opacity:0}},r,{cb:function(){t.remove(f)},removeOpt:i}))}}function H5e(n,e){for(var t=e.parentNode===n?e:e.parentNode||e,r;r=t.getLayout(),r==null;)t=t.parentNode===n?t:t.parentNode||t;return{source:t,sourceLayout:r}}function oye(n,e,t,r,i){var a=n.tree.getNodeByDataIndex(e),o=n.tree.root,s=H5e(o,a).sourceLayout,l={duration:i.get("animationDurationUpdate"),easing:i.get("animationEasingUpdate")};NS(t,{x:s.x+1,y:s.y+1},i,{cb:function(){r.remove(t),n.setItemGraphicEl(e,null)},removeOpt:l}),t.fadeOut(null,n.hostModel,{fadeLabel:!0,animation:l}),a.children.forEach(function(u){aye(u,n,r,i,l)}),aye(a,n,r,i,l)}function zJ(n,e,t,r,i){var a,o,s,l,u,h,c,f;if(n==="radial"){u=r.rawX,c=r.rawY,h=i.rawX,f=i.rawY;var d=oO(u,c),v=oO(u,c+(f-c)*t),p=oO(h,f+(c-f)*t),g=oO(h,f);return{x1:d.x||0,y1:d.y||0,x2:g.x||0,y2:g.y||0,cpx1:v.x||0,cpy1:v.y||0,cpx2:p.x||0,cpy2:p.y||0}}else u=r.x,c=r.y,h=i.x,f=i.y,(e==="LR"||e==="RL")&&(a=u+(h-u)*t,o=c,s=h+(u-h)*t,l=f),(e==="TB"||e==="BT")&&(a=u,o=c+(f-c)*t,s=h,l=f+(c-f)*t);return{x1:u,y1:c,x2:h,y2:f,cpx1:a,cpy1:o,cpx2:s,cpy2:l}}const H1t=$1t;var kp=na();function j5e(n){var e=n.mainData,t=n.datas;t||(t={main:e},n.datasAttr={main:"data"}),n.datas=n.mainData=null,X5e(e,t,n),te(t,function(r){te(e.TRANSFERABLE_METHODS,function(i){r.wrapMethod(i,Un(j1t,n))})}),e.wrapMethod("cloneShallow",Un(Y1t,n)),te(e.CHANGABLE_METHODS,function(r){e.wrapMethod(r,Un(X1t,n))}),Bf(t[e.dataType]===e)}function j1t(n,e){if(K1t(this)){var t=Mt({},kp(this).datas);t[this.dataType]=e,X5e(e,t,n)}else mae(e,this.dataType,kp(this).mainData,n);return e}function X1t(n,e){return n.struct&&n.struct.update(),e}function Y1t(n,e){return te(kp(e).datas,function(t,r){t!==e&&mae(t.cloneShallow(),r,e,n)}),e}function q1t(n){var e=kp(this).mainData;return n==null||e==null?e:kp(e).datas[n]}function Z1t(){var n=kp(this).mainData;return n==null?[{data:n}]:Vt(Li(kp(n).datas),function(e){return{type:e,data:kp(n).datas[e]}})}function K1t(n){return kp(n).mainData===n}function X5e(n,e,t){kp(n).datas={},te(e,function(r,i){mae(r,i,n,t)})}function mae(n,e,t,r){kp(t).datas[e]=n,kp(n).mainData=t,n.dataType=e,r.struct&&(n[r.structAttr]=r.struct,r.struct[r.datasAttr[e]]=n),n.getLinkedData=q1t,n.getLinkedDataAll=Z1t}var J1t=function(){function n(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||"",this.hostTree=t}return n.prototype.isRemoved=function(){return this.dataIndex<0},n.prototype.eachNode=function(e,t,r){rn(e)&&(r=t,t=e,e=null),e=e||{},Or(e)&&(e={order:e});var i=e.order||"preorder",a=this[e.attr||"children"],o;i==="preorder"&&(o=t.call(r,this));for(var s=0;!o&&s<a.length;s++)a[s].eachNode(e,t,r);i==="postorder"&&t.call(r,this)},n.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var r=0;r<this.children.length;r++){var i=this.children[r];i.updateDepthAndHeight(e+1),i.height>t&&(t=i.height)}this.height=t+1},n.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,r=this.children,i=r.length;t<i;t++){var a=r[t].getNodeById(e);if(a)return a}},n.prototype.contains=function(e){if(e===this)return!0;for(var t=0,r=this.children,i=r.length;t<i;t++){var a=r[t].contains(e);if(a)return a}},n.prototype.getAncestors=function(e){for(var t=[],r=e?this:this.parentNode;r;)t.push(r),r=r.parentNode;return t.reverse(),t},n.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},n.prototype.getDescendantIndices=function(){var e=[];return this.eachNode(function(t){e.push(t.dataIndex)}),e},n.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||"value"),this.dataIndex)},n.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},n.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,r=t.data.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},n.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},n.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},n.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},n.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},n.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},n.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},n.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},n}(),Q1t=function(){function n(e){this.type="tree",this._nodes=[],this.hostModel=e}return n.prototype.eachNode=function(e,t,r){this.root.eachNode(e,t,r)},n.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},n.prototype.getNodeById=function(e){return this.root.getNodeById(e)},n.prototype.update=function(){for(var e=this.data,t=this._nodes,r=0,i=t.length;r<i;r++)t[r].dataIndex=-1;for(var r=0,i=e.count();r<i;r++)t[e.getRawIndex(r)].dataIndex=r},n.prototype.clearLayouts=function(){this.data.clearItemLayouts()},n.createTree=function(e,t,r){var i=new n(t),a=[],o=1;s(e);function s(h,c){var f=h.value;o=Math.max(o,Gt(f)?f.length:1),a.push(h);var d=new J1t(Ru(h.name,""),i);c?e_t(d,c):i.root=d,i._nodes.push(d);var v=h.children;if(v)for(var p=0;p<v.length;p++)s(v[p],d)}i.root.updateDepthAndHeight(0);var l=b3(a,{coordDimensions:["value"],dimensionsCount:o}).dimensions,u=new Df(l,t);return u.initData(a),r&&r(u),j5e({mainData:u,struct:i,structAttr:"tree"}),i.update(),i},n}();function e_t(n,e){var t=e.children;n.parentNode!==e&&(t.push(n),n.parentNode=e)}const _ae=Q1t;function xD(n,e,t){if(n&&gi(e,n.type)>=0){var r=t.getData().tree.root,i=n.targetNode;if(Or(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=n.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function Y5e(n){for(var e=[];n;)n=n.parentNode,n&&e.push(n);return e.reverse()}function xae(n,e){var t=Y5e(n);return gi(t,e)>=0}function xU(n,e){for(var t=[];n;){var r=n.dataIndex;t.push({name:n.name,dataIndex:r,value:e.getRawValue(r)}),n=n.parentNode}return t.reverse(),t}var t_t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var r={name:t.name,children:t.data},i=t.leaves||{},a=new as(i,this,this.ecModel),o=_ae.createTree(r,this,s);function s(c){c.wrapMethod("getItemModel",function(f,d){var v=o.getNodeByDataIndex(d);return v&&v.children.length&&v.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(c){c.depth>l&&(l=c.depth)});var u=t.expandAndCollapse,h=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(c){var f=c.hostTree.data.getRawDataItem(c.dataIndex);c.isExpand=f&&f.collapsed!=null?!f.collapsed:c.depth<=h}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,r,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return ch("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=xU(i,this),r.collapsed=!i.isExpand,r},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Ws);const r_t=t_t;function n_t(n,e,t){for(var r=[n],i=[],a;a=r.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s<o.length;s++)r.push(o[s])}for(;a=i.pop();)e(a,t)}function uP(n,e){for(var t=[n],r;r=t.pop();)if(e(r),r.isExpand){var i=r.children;if(i.length)for(var a=i.length-1;a>=0;a--)t.push(i[a])}}function i_t(n,e){n.eachSeriesByType("tree",function(t){a_t(t,e)})}function a_t(n,e){var t=N1t(n,e);n.layoutInfo=t;var r=n.get("layout"),i=0,a=0,o=null;r==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,o=rye(function(_,x){return(_.parentNode===x.parentNode?1:2)/_.depth})):(i=t.width,a=t.height,o=rye());var s=n.getData().tree.root,l=s.children[0];if(l){O1t(s),n_t(l,R1t,o),s.hierNode.modifier=-l.hierNode.prelim,uP(l,D1t);var u=l,h=l,c=l;uP(l,function(_){var x=_.getLayout().x;x<u.getLayout().x&&(u=_),x>h.getLayout().x&&(h=_),_.depth>c.depth&&(c=_)});var f=u===h?1:o(u,h)/2,d=f-u.getLayout().x,v=0,p=0,g=0,m=0;if(r==="radial")v=i/(h.getLayout().x+f+d),p=a/(c.depth-1||1),uP(l,function(_){g=(_.getLayout().x+d)*v,m=(_.depth-1)*p;var x=oO(g,m);_.setLayout({x:x.x,y:x.y,rawX:g,rawY:m},!0)});else{var y=n.getOrient();y==="RL"||y==="LR"?(p=a/(h.getLayout().x+f+d),v=i/(c.depth-1||1),uP(l,function(_){m=(_.getLayout().x+d)*p,g=y==="LR"?(_.depth-1)*v:i-(_.depth-1)*v,_.setLayout({x:g,y:m},!0)})):(y==="TB"||y==="BT")&&(v=i/(h.getLayout().x+f+d),p=a/(c.depth-1||1),uP(l,function(_){g=(_.getLayout().x+d)*v,m=y==="TB"?(_.depth-1)*p:a-(_.depth-1)*p,_.setLayout({x:g,y:m},!0)}))}}}function o_t(n){n.eachSeriesByType("tree",function(e){var t=e.getData(),r=t.tree;r.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(i.dataIndex,"style");Mt(s,o)})})}function s_t(n){n.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(r){var i=e.dataIndex,a=r.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),n.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,r){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,o=yae(a,e,void 0,r);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}function l_t(n){n.registerChartView(H1t),n.registerSeriesModel(r_t),n.registerLayout(i_t),n.registerVisual(o_t),s_t(n)}var sye=["treemapZoomToNode","treemapRender","treemapMove"];function u_t(n){for(var e=0;e<sye.length;e++)n.registerAction({type:sye[e],update:"updateView"},Hl);n.registerAction({type:"treemapRootToNode",update:"updateView"},function(t,r){r.eachComponent({mainType:"series",subType:"treemap",query:t},i);function i(a,o){var s=["treemapZoomToNode","treemapRootToNode"],l=xD(t,s,a);if(l){var u=a.getViewRoot();u&&(t.direction=xae(u,l.node)?"rollUp":"drillDown"),a.resetViewRoot(l.node)}}})}function q5e(n){var e=n.getData(),t=e.tree,r={};t.eachNode(function(i){for(var a=i;a&&a.depth>1;)a=a.parentNode;var o=pJ(n.ecModel,a.name||a.dataIndex+"",r);i.setVisual("decal",o)})}var h_t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};Z5e(i);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new as({itemStyle:o},this,r);a=t.levels=c_t(a,r);var l=Vt(a||[],function(c){return new as(c,s,r)},this),u=_ae.createTree(i,this,h);function h(c){c.wrapMethod("getItemModel",function(f,d){var v=u.getNodeByDataIndex(d),p=v?l[v.depth]:null;return f.parentModel=p||s,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return ch("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treeAncestors=xU(i,this),r.treePathInfo=r.treeAncestors,r},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Mt(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var r=this._idIndexMap;r||(r=this._idIndexMap=$r(),this._idIndexMapCount=0);var i=r.get(t);return i==null&&r.set(t,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){q5e(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25B6",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Ws);function Z5e(n){var e=0;te(n.children,function(r){Z5e(r);var i=r.value;Gt(i)&&(i=i[0]),e+=i});var t=n.value;Gt(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Gt(n.value)?n.value[0]=t:n.value=t}function c_t(n,e){var t=Do(e.get("color")),r=Do(e.get(["aria","decal","decals"]));if(!!t){n=n||[];var i,a;te(n,function(s){var l=new as(s),u=l.get("color"),h=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||h&&h!=="none")&&(a=!0)});var o=n[0]||(n[0]={});return i||(o.color=t.slice()),!a&&r&&(o.decal=r.slice()),n}}const f_t=h_t;var d_t=8,lye=8,mj=5,v_t=function(){function n(e){this.group=new Cn,e.add(this.group)}return n.prototype.render=function(e,t,r,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!r)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),c={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(r,c,u),this._renderContent(e,c,s,l,u,h,i),sU(o,c.pos,c.box)}},n.prototype._prepare=function(e,t,r){for(var i=e;i;i=i.parentNode){var a=Ru(i.getModel().get("name"),""),o=r.getTextRect(a),s=Math.max(o.width+d_t*2,t.emptyItemWidth);t.totalWidth+=s+lye,t.renderList.push({node:i,text:a,width:s})}},n.prototype._renderContent=function(e,t,r,i,a,o,s){for(var l=0,u=t.emptyItemWidth,h=e.get(["breadcrumb","height"]),c=Tft(t.pos,t.box),f=t.totalWidth,d=t.renderList,v=i.getModel("itemStyle").getItemStyle(),p=d.length-1;p>=0;p--){var g=d[p],m=g.node,y=g.width,_=g.text;f>c.width&&(f-=y-u,y=u,_=null);var x=new bd({shape:{points:p_t(l,0,y,h,p===d.length-1,p===0)},style:sn(r.getItemStyle(),{lineJoin:"bevel"}),textContent:new la({style:is(a,{text:_})}),textConfig:{position:"inside"},z2:OI*1e4,onclick:Un(s,m)});x.disableLabelAnimation=!0,x.getTextContent().ensureState("emphasis").style=is(o,{text:_}),x.ensureState("emphasis").style=v,vl(x,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(x),g_t(x,e,m),l+=y+lye}},n.prototype.remove=function(){this.group.removeAll()},n}();function p_t(n,e,t,r,i,a){var o=[[i?n:n-mj,e],[n+t,e],[n+t,e+r],[i?n:n-mj,e+r]];return!a&&o.splice(2,0,[n+t+mj,e+r/2]),!i&&o.push([n,e+r/2]),o}function g_t(n,e,t){Bn(n).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&xU(t,e)}}const y_t=v_t;var m_t=function(){function n(){this._storage=[],this._elExistsMap={}}return n.prototype.add=function(e,t,r,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:r,delay:i,easing:a}),!0)},n.prototype.finished=function(e){return this._finishedCallback=e,this},n.prototype.start=function(){for(var e=this,t=this._storage.length,r=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;i<a;i++){var o=this._storage[i];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:r,aborted:r})}return this},n}();function __t(){return new m_t}var UJ=Cn,uye=ta,hye=3,cye="label",fye="upperLabel",x_t=OI*10,S_t=OI*2,w_t=OI*3,Rb=qE([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),dye=function(n){var e=Rb(n);return e.stroke=e.fill=e.lineWidth=null,e},LG=na(),b_t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._state="ready",t._storage=hP(),t}return e.prototype.render=function(t,r,i,a){var o=r.findComponents({mainType:"series",subType:"treemap",query:a});if(!(gi(o,t)<0)){this.seriesModel=t,this.api=i,this.ecModel=r;var s=["treemapZoomToNode","treemapRootToNode"],l=xD(a,s,t),u=a&&a.type,h=t.layoutInfo,c=!this._oldTree,f=this._storage,d=u==="treemapRootToNode"&&l&&f?{rootNodeGroup:f.nodeGroup[l.node.getRawIndex()],direction:a.direction}:null,v=this._giveContainerGroup(h),p=t.get("animation"),g=this._doRender(v,t,d);p&&!c&&(!u||u==="treemapZoomToNode"||u==="treemapRootToNode")?this._doAnimation(v,g,t,d):g.renderFinally(),this._resetController(i),this._renderBreadcrumb(t,i,l)}},e.prototype._giveContainerGroup=function(t){var r=this._containerGroup;return r||(r=this._containerGroup=new UJ,this._initEvents(r),this.group.add(r)),r.x=t.x,r.y=t.y,r},e.prototype._doRender=function(t,r,i){var a=r.getData().tree,o=this._oldTree,s=hP(),l=hP(),u=this._storage,h=[];function c(g,m,y,_){return E_t(r,l,u,i,s,h,g,m,y,_)}d(a.root?[a.root]:[],o&&o.root?[o.root]:[],t,a===o||!o,0);var f=v(u);return this._oldTree=a,this._storage=l,{lastsForAnimation:s,willDeleteEls:f,renderFinally:p};function d(g,m,y,_,x){_?(m=g,te(g,function(b,E){!b.isRemoved()&&w(E,E)})):new f_(m,g,S,S).add(w).update(w).remove(Un(w,null)).execute();function S(b){return b.getId()}function w(b,E){var T=b!=null?g[b]:null,C=E!=null?m[E]:null,A=c(T,C,y,x);A&&d(T&&T.viewChildren||[],C&&C.viewChildren||[],A,_,x+1)}}function v(g){var m=hP();return g&&te(g,function(y,_){var x=m[_];te(y,function(S){S&&(x.push(S),LG(S).willDelete=!0)})}),m}function p(){te(f,function(g){te(g,function(m){m.parent&&m.parent.remove(m)})}),te(h,function(g){g.invisible=!0,g.dirty()})}},e.prototype._doAnimation=function(t,r,i,a){var o=i.get("animationDurationUpdate"),s=i.get("animationEasing"),l=(rn(o)?0:o)||0,u=(rn(s)?null:s)||"cubicOut",h=__t();te(r.willDeleteEls,function(c,f){te(c,function(d,v){if(!d.invisible){var p=d.parent,g,m=LG(p);if(a&&a.direction==="drillDown")g=p===a.rootNodeGroup?{shape:{x:0,y:0,width:m.nodeWidth,height:m.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var y=0,_=0;m.willDelete||(y=m.nodeWidth/2,_=m.nodeHeight/2),g=f==="nodeGroup"?{x:y,y:_,style:{opacity:0}}:{shape:{x:y,y:_,width:0,height:0},style:{opacity:0}}}g&&h.add(d,g,l,0,u)}})}),te(this._storage,function(c,f){te(c,function(d,v){var p=r.lastsForAnimation[f][v],g={};!p||(d instanceof Cn?p.oldX!=null&&(g.x=d.x,g.y=d.y,d.x=p.oldX,d.y=p.oldY):(p.oldShape&&(g.shape=Mt({},d.shape),d.setShape(p.oldShape)),p.fadein?(d.setStyle("opacity",0),g.style={opacity:1}):d.style.opacity!==1&&(g.style={opacity:1})),h.add(d,g,l,0,u))})},this),this._state="animating",h.finished(kr(function(){this._state="ready",r.renderFinally()},this)).start()},e.prototype._resetController=function(t){var r=this._controller;r||(r=this._controller=new P3(t.getZr()),r.enable(this.seriesModel.get("roam")),r.on("pan",kr(this._onPan,this)),r.on("zoom",kr(this._onZoom,this)));var i=new ai(0,0,t.getWidth(),t.getHeight());r.setPointerChecker(function(a,o,s){return i.contain(o,s)})},e.prototype._clearController=function(){var t=this._controller;t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if(this._state!=="animating"&&(Math.abs(t.dx)>hye||Math.abs(t.dy)>hye)){var r=this.seriesModel.getData().tree.root;if(!r)return;var i=r.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(t){var r=t.originX,i=t.originY;if(this._state!=="animating"){var a=this.seriesModel.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new ai(o.x,o.y,o.width,o.height),l=this.seriesModel.layoutInfo;r-=l.x,i-=l.y;var u=Up();sm(u,u,[-r,-i]),lie(u,u,[t.scale,t.scale]),sm(u,u,[r,i]),s.applyTransform(u),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var r=this;t.on("click",function(i){if(r._state==="ready"){var a=r.seriesModel.get("nodeClick",!0);if(!!a){var o=r.findTarget(i.offsetX,i.offsetY);if(!!o){var s=o.node;if(s.getLayout().isLeafRoot)r._rootToNode(o);else if(a==="zoomToNode")r._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&dG(u,h)}}}}},this)},e.prototype._renderBreadcrumb=function(t,r,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(r.getWidth()/2,r.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new y_t(this.group))).render(t,r,i.node,function(o){a._state!=="animating"&&(xae(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=hP(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,r){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,r),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(os);function hP(){return{nodeGroup:[],background:[],content:[]}}function E_t(n,e,t,r,i,a,o,s,l,u){if(!o)return;var h=o.getLayout(),c=n.getData(),f=o.getModel();if(c.setItemGraphicEl(o.dataIndex,null),!h||!h.isInView)return;var d=h.width,v=h.height,p=h.borderWidth,g=h.invisible,m=o.getRawIndex(),y=s&&s.getRawIndex(),_=o.viewChildren,x=h.upperHeight,S=_&&_.length,w=f.getModel("itemStyle"),b=f.getModel(["emphasis","itemStyle"]),E=f.getModel(["blur","itemStyle"]),T=f.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,A=j("nodeGroup",UJ);if(!A)return;if(l.add(A),A.x=h.x||0,A.y=h.y||0,A.markRedraw(),LG(A).nodeWidth=d,LG(A).nodeHeight=v,h.isAboveViewRoot)return A;var M=j("background",uye,u,S_t);M&&z(A,M,S&&h.upperLabelHeight);var I=f.getModel("emphasis"),R=I.get("focus"),k=I.get("blurScope"),D=I.get("disabled"),G=R==="ancestor"?o.getAncestorsIndices():R==="descendant"?o.getDescendantIndices():R;if(S)sD(A)&&nE(A,!1),M&&(nE(M,!D),c.setItemGraphicEl(o.dataIndex,M),sJ(M,G,k));else{var W=j("content",uye,u,w_t);W&&V(A,W),M.disableMorphing=!0,M&&sD(M)&&nE(M,!1),nE(A,!D),c.setItemGraphicEl(o.dataIndex,A),sJ(A,G,k)}return A;function z(oe,se,me){var Ce=Bn(se);if(Ce.dataIndex=o.dataIndex,Ce.seriesIndex=n.seriesIndex,se.setShape({x:0,y:0,width:d,height:v,r:C}),g)q(se);else{se.invisible=!1;var Le=o.getVisual("style"),re=Le.stroke,yt=dye(w);yt.fill=re;var je=Rb(b);je.fill=b.get("borderColor");var st=Rb(E);st.fill=E.get("borderColor");var Nt=Rb(T);if(Nt.fill=T.get("borderColor"),me){var Zt=d-2*p;Y(se,re,Le.opacity,{x:p,y:0,width:Zt,height:x})}else se.removeTextContent();se.setStyle(yt),se.ensureState("emphasis").style=je,se.ensureState("blur").style=st,se.ensureState("select").style=Nt,ZE(se)}oe.add(se)}function V(oe,se){var me=Bn(se);me.dataIndex=o.dataIndex,me.seriesIndex=n.seriesIndex;var Ce=Math.max(d-2*p,0),Le=Math.max(v-2*p,0);if(se.culling=!0,se.setShape({x:p,y:p,width:Ce,height:Le,r:C}),g)q(se);else{se.invisible=!1;var re=o.getVisual("style"),yt=re.fill,je=dye(w);je.fill=yt,je.decal=re.decal;var st=Rb(b),Nt=Rb(E),Zt=Rb(T);Y(se,yt,re.opacity,null),se.setStyle(je),se.ensureState("emphasis").style=st,se.ensureState("blur").style=Nt,se.ensureState("select").style=Zt,ZE(se)}oe.add(se)}function q(oe){!oe.invisible&&a.push(oe)}function Y(oe,se,me,Ce){var Le=f.getModel(Ce?fye:cye),re=Ru(f.get("name"),null),yt=Le.getShallow("show");vc(oe,hh(f,Ce?fye:cye),{defaultText:yt?re:null,inheritColor:se,defaultOpacity:me,labelFetcher:n,labelDataIndex:o.dataIndex});var je=oe.getTextContent();if(!!je){var st=je.style,Nt=aie(st.padding||0);Ce&&(oe.setTextConfig({layoutRect:Ce}),je.disableLabelLayout=!0),je.beforeUpdate=function(){var qe=Math.max((Ce?Ce.width:oe.shape.width)-Nt[1]-Nt[3],0),ur=Math.max((Ce?Ce.height:oe.shape.height)-Nt[0]-Nt[2],0);(st.width!==qe||st.height!==ur)&&je.setStyle({width:qe,height:ur})},st.truncateMinChar=2,st.lineOverflow="truncate",le(st,Ce,h);var Zt=je.getState("emphasis");le(Zt?Zt.style:null,Ce,h)}}function le(oe,se,me){var Ce=oe?oe.text:null;if(!se&&me.isLeafRoot&&Ce!=null){var Le=n.get("drillDownIcon",!0);oe.text=Le?Le+" "+Ce:Ce}}function j(oe,se,me,Ce){var Le=y!=null&&t[oe][y],re=i[oe];return Le?(t[oe][y]=null,Q(re,Le)):g||(Le=new se,Le instanceof Vp&&(Le.z2=T_t(me,Ce)),ie(re,Le)),e[oe][m]=Le}function Q(oe,se){var me=oe[m]={};se instanceof UJ?(me.oldX=se.x,me.oldY=se.y):me.oldShape=Mt({},se.shape)}function ie(oe,se){var me=oe[m]={},Ce=o.parentNode,Le=se instanceof Cn;if(Ce&&(!r||r.direction==="drillDown")){var re=0,yt=0,je=i.background[Ce.getRawIndex()];!r&&je&&je.oldShape&&(re=je.oldShape.width,yt=je.oldShape.height),Le?(me.oldX=0,me.oldY=yt):me.oldShape={x:re,y:yt,width:0,height:0}}me.fadein=!Le}}function T_t(n,e){return n*x_t+e}const C_t=b_t;var SD=te,A_t=dn,PG=-1,Sae=function(){function n(e){var t=e.mappingMethod,r=e.type,i=this.option=Sn(e);this.type=r,this.mappingMethod=t,this._normalizeData=L_t[t];var a=n.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(_j(i),M_t(i)):t==="category"?i.categories?I_t(i):_j(i,!0):(Bf(t!=="linear"||i.dataExtent),_j(i))}return n.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},n.prototype.getNormalizer=function(){return kr(this._normalizeData,this)},n.listVisualTypes=function(){return Li(n.visualHandlers)},n.isValidType=function(e){return n.visualHandlers.hasOwnProperty(e)},n.eachVisual=function(e,t,r){dn(e)?te(e,t,r):t.call(r,e)},n.mapVisual=function(e,t,r){var i,a=Gt(e)?[]:dn(e)?{}:(i=!0,null);return n.eachVisual(e,function(o,s){var l=t.call(r,o,s);i?a=l:a[s]=l}),a},n.retrieveVisuals=function(e){var t={},r;return e&&SD(n.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],r=!0)}),r?t:null},n.prepareVisualTypes=function(e){if(Gt(e))e=e.slice();else if(A_t(e)){var t=[];SD(e,function(r,i){t.push(i)}),e=t}else return[];return e.sort(function(r,i){return i==="color"&&r!=="color"&&r.indexOf("color")===0?1:-1}),e},n.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},n.findPieceIndex=function(e,t,r){for(var i,a=1/0,o=0,s=t.length;o<s;o++){var l=t[o].value;if(l!=null){if(l===e||Or(l)&&l===e+"")return o;r&&f(l,o)}}for(var o=0,s=t.length;o<s;o++){var u=t[o],h=u.interval,c=u.close;if(h){if(h[0]===-1/0){if(P4(c[1],e,h[1]))return o}else if(h[1]===1/0){if(P4(c[0],h[0],e))return o}else if(P4(c[0],h[0],e)&&P4(c[1],e,h[1]))return o;r&&f(h[0],o),r&&f(h[1],o)}}if(r)return e===1/0?t.length-1:e===-1/0?0:i;function f(d,v){var p=Math.abs(d-e);p<a&&(a=p,i=v)}},n.visualHandlers={color:{applyVisual:cP("color"),getColorMapper:function(){var e=this.option;return kr(e.mappingMethod==="category"?function(t,r){return!r&&(t=this._normalizeData(t)),sO.call(this,t)}:function(t,r,i){var a=!!i;return!r&&(t=this._normalizeData(t)),i=eH(t,e.parsedVisual,i),a?i:W1(i,"rgba")},this)},_normalizedToVisual:{linear:function(e){return W1(eH(e,this.option.parsedVisual),"rgba")},category:sO,piecewise:function(e,t){var r=$J.call(this,t);return r==null&&(r=W1(eH(e,this.option.parsedVisual),"rgba")),r},fixed:Db}},colorHue:L4(function(e,t){return WO(e,t)}),colorSaturation:L4(function(e,t){return WO(e,null,t)}),colorLightness:L4(function(e,t){return WO(e,null,null,t)}),colorAlpha:L4(function(e,t){return eG(e,t)}),decal:{applyVisual:cP("decal"),_normalizedToVisual:{linear:null,category:sO,piecewise:null,fixed:null}},opacity:{applyVisual:cP("opacity"),_normalizedToVisual:VJ([0,1])},liftZ:{applyVisual:cP("liftZ"),_normalizedToVisual:{linear:Db,category:Db,piecewise:Db,fixed:Db}},symbol:{applyVisual:function(e,t,r){var i=this.mapValueToVisual(e);r("symbol",i)},_normalizedToVisual:{linear:vye,category:sO,piecewise:function(e,t){var r=$J.call(this,t);return r==null&&(r=vye.call(this,e)),r},fixed:Db}},symbolSize:{applyVisual:cP("symbolSize"),_normalizedToVisual:VJ([0,1])}},n}();function M_t(n){var e=n.pieceList;n.hasSpecialVisual=!1,te(e,function(t,r){t.originIndex=r,t.visual!=null&&(n.hasSpecialVisual=!0)})}function I_t(n){var e=n.categories,t=n.categoryMap={},r=n.visual;if(SD(e,function(o,s){t[o]=s}),!Gt(r)){var i=[];dn(r)?SD(r,function(o,s){var l=t[s];i[l!=null?l:PG]=o}):i[PG]=r,r=K5e(n,i)}for(var a=e.length-1;a>=0;a--)r[a]==null&&(delete t[e[a]],e.pop())}function _j(n,e){var t=n.visual,r=[];dn(t)?SD(t,function(a){r.push(a)}):t!=null&&r.push(t);var i={color:1,symbol:1};!e&&r.length===1&&!i.hasOwnProperty(n.type)&&(r[1]=r[0]),K5e(n,r)}function L4(n){return{applyVisual:function(e,t,r){var i=this.mapValueToVisual(e);r("color",n(t("color"),i))},_normalizedToVisual:VJ([0,1])}}function vye(n){var e=this.option.visual;return e[Math.round(go(n,[0,1],[0,e.length-1],!0))]||{}}function cP(n){return function(e,t,r){r(n,this.mapValueToVisual(e))}}function sO(n){var e=this.option.visual;return e[this.option.loop&&n!==PG?n%e.length:n]}function Db(){return this.option.visual[0]}function VJ(n){return{linear:function(e){return go(e,n,this.option.visual,!0)},category:sO,piecewise:function(e,t){var r=$J.call(this,t);return r==null&&(r=go(e,n,this.option.visual,!0)),r},fixed:Db}}function $J(n){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var r=Sae.findPieceIndex(n,t),i=t[r];if(i&&i.visual)return i.visual[this.type]}}function K5e(n,e){return n.visual=e,n.type==="color"&&(n.parsedVisual=Vt(e,function(t){var r=gv(t);return r||[0,0,0,1]})),e}var L_t={linear:function(n){return go(n,this.option.dataExtent,[0,1],!0)},piecewise:function(n){var e=this.option.pieceList,t=Sae.findPieceIndex(n,e,!0);if(t!=null)return go(t,[0,e.length-1],[0,1],!0)},category:function(n){var e=this.option.categories?this.option.categoryMap[n]:n;return e==null?PG:e},fixed:Hl};function P4(n,e,t){return n?e<=t:e<t}const fc=Sae;var P_t="itemStyle",J5e=na();const O_t={seriesType:"treemap",reset:function(n){var e=n.getData().tree,t=e.root;t.isRemoved()||Q5e(t,{},n.getViewRoot().getAncestors(),n)}};function Q5e(n,e,t,r){var i=n.getModel(),a=n.getLayout(),o=n.hostTree.data;if(!(!a||a.invisible||!a.isInView)){var s=i.getModel(P_t),l=R_t(s,e,r),u=o.ensureUniqueItemVisual(n.dataIndex,"style"),h=s.get("borderColor"),c=s.get("borderColorSaturation"),f;c!=null&&(f=pye(l),h=D_t(c,f)),u.stroke=h;var d=n.viewChildren;if(!d||!d.length)f=pye(l),u.fill=f;else{var v=N_t(n,i,a,s,l,d);te(d,function(p,g){if(p.depth>=t.length||p===t[p.depth]){var m=k_t(i,l,p,g,v,r);Q5e(p,m,t,r)}})}}}function R_t(n,e,t){var r=Mt({},e),i=t.designatedVisualItemStyle;return te(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=n.get(a);i[a]=null,o!=null&&(r[a]=o)}),r}function pye(n){var e=xj(n,"color");if(e){var t=xj(n,"colorAlpha"),r=xj(n,"colorSaturation");return r&&(e=WO(e,null,null,r)),t&&(e=eG(e,t)),e}}function D_t(n,e){return e!=null?WO(e,null,null,n):null}function xj(n,e){var t=n[e];if(t!=null&&t!=="none")return t}function N_t(n,e,t,r,i,a){if(!(!a||!a.length)){var o=Sj(e,"color")||i.color!=null&&i.color!=="none"&&(Sj(e,"colorAlpha")||Sj(e,"colorSaturation"));if(!!o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&s<u[0]&&(u[0]=s),l!=null&&l>u[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};c.type==="color"&&(h==="index"||h==="id")?(c.mappingMethod="category",c.loop=!0):c.mappingMethod="linear";var f=new fc(c);return J5e(f).drColorMappingBy=h,f}}}function Sj(n,e){var t=n.get(e);return Gt(t)&&t.length?{name:e,range:t}:null}function k_t(n,e,t,r,i,a){var o=Mt({},e);if(i){var s=i.type,l=s==="color"&&J5e(i).drColorMappingBy,u=l==="index"?r:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(n.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var wD=Math.max,OG=Math.min,gye=Gh,wae=te,e6e=["itemStyle","borderWidth"],F_t=["itemStyle","gapWidth"],B_t=["upperLabel","show"],G_t=["upperLabel","height"];const z_t={seriesType:"treemap",reset:function(n,e,t,r){var i=t.getWidth(),a=t.getHeight(),o=n.option,s=Uu(n.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=xr(gye(s.width,l[0]),i),h=xr(gye(s.height,l[1]),a),c=r&&r.type,f=["treemapZoomToNode","treemapRootToNode"],d=xD(r,f,n),v=c==="treemapRender"||c==="treemapMove"?r.rootRect:null,p=n.getViewRoot(),g=Y5e(p);if(c!=="treemapMove"){var m=c==="treemapZoomToNode"?j_t(n,d,p,u,h):v?[v.width,v.height]:[u,h],y=o.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var _={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};p.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};p.setLayout(x),t6e(p,_,!1,0),x=p.getLayout(),wae(g,function(w,b){var E=(g[b+1]||p).getValue();w.setLayout(Mt({dataExtent:[E,E],borderWidth:0,upperHeight:0},x))})}var S=n.getData().tree.root;S.setLayout(X_t(s,v,d),!0),n.setLayoutInfo(s),r6e(S,new ai(-s.x,-s.y,i,a),g,p,0)}};function t6e(n,e,t,r){var i,a;if(!n.isRemoved()){var o=n.getLayout();i=o.width,a=o.height;var s=n.getModel(),l=s.get(e6e),u=s.get(F_t)/2,h=n6e(s),c=Math.max(l,h),f=l-u,d=c-u;n.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0),i=wD(i-2*f,0),a=wD(a-f-d,0);var v=i*a,p=U_t(n,s,v,e,t,r);if(!!p.length){var g={x:f,y:d,width:i,height:a},m=OG(i,a),y=1/0,_=[];_.area=0;for(var x=0,S=p.length;x<S;){var w=p[x];_.push(w),_.area+=w.getLayout().area;var b=H_t(_,m,e.squareRatio);b<=y?(x++,y=b):(_.area-=_.pop().getLayout().area,yye(_,m,g,u,!1),m=OG(g.width,g.height),_.length=_.area=0,y=1/0)}if(_.length&&yye(_,m,g,u,!0),!t){var E=s.get("childrenVisibleMin");E!=null&&v<E&&(t=!0)}for(var x=0,S=p.length;x<S;x++)t6e(p[x],e,t,r+1)}}}function U_t(n,e,t,r,i,a){var o=n.children||[],s=r.sort;s!=="asc"&&s!=="desc"&&(s=null);var l=r.leafDepth!=null&&r.leafDepth<=a;if(i&&!l)return n.viewChildren=[];o=To(o,function(d){return!d.isRemoved()}),$_t(o,s);var u=W_t(e,o,s);if(u.sum===0)return n.viewChildren=[];if(u.sum=V_t(e,t,u.sum,s,o),u.sum===0)return n.viewChildren=[];for(var h=0,c=o.length;h<c;h++){var f=o[h].getValue()/u.sum*t;o[h].setLayout({area:f})}return l&&(o.length&&n.setLayout({isLeafRoot:!0},!0),o.length=0),n.viewChildren=o,n.setLayout({dataExtent:u.dataExtent},!0),o}function V_t(n,e,t,r,i){if(!r)return t;for(var a=n.get("visibleMin"),o=i.length,s=o,l=o-1;l>=0;l--){var u=i[r==="asc"?o-l-1:l].getValue();u/t*e<a&&(s=l,t-=u)}return r==="asc"?i.splice(0,o-s):i.splice(s,o-s),t}function $_t(n,e){return e&&n.sort(function(t,r){var i=e==="asc"?t.getValue()-r.getValue():r.getValue()-t.getValue();return i===0?e==="asc"?t.dataIndex-r.dataIndex:r.dataIndex-t.dataIndex:i}),n}function W_t(n,e,t){for(var r=0,i=0,a=e.length;i<a;i++)r+=e[i].getValue();var o=n.get("visualDimension"),s;return!e||!e.length?s=[NaN,NaN]:o==="value"&&t?(s=[e[e.length-1].getValue(),e[0].getValue()],t==="asc"&&s.reverse()):(s=[1/0,-1/0],wae(e,function(l){var u=l.getValue(o);u<s[0]&&(s[0]=u),u>s[1]&&(s[1]=u)})),{sum:r,dataExtent:s}}function H_t(n,e,t){for(var r=0,i=1/0,a=0,o=void 0,s=n.length;a<s;a++)o=n[a].getLayout().area,o&&(o<i&&(i=o),o>r&&(r=o));var l=n.area*n.area,u=e*e*t;return l?wD(u*r/l,l/(u*i)):1/0}function yye(n,e,t,r,i){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],h=e?n.area/e:0;(i||h>t[l[o]])&&(h=t[l[o]]);for(var c=0,f=n.length;c<f;c++){var d=n[c],v={},p=h?d.getLayout().area/h:0,g=v[l[o]]=wD(h-2*r,0),m=t[s[a]]+t[l[a]]-u,y=c===f-1||m<p?m:p,_=v[l[a]]=wD(y-2*r,0);v[s[o]]=t[s[o]]+OG(r,g/2),v[s[a]]=u+OG(r,_/2),u+=y,d.setLayout(v,!0)}t[s[o]]+=h,t[l[o]]-=h}function j_t(n,e,t,r,i){var a=(e||{}).node,o=[r,i];if(!a||a===t)return o;for(var s,l=r*i,u=l*n.option.zoomToNodeRatio;s=a.parentNode;){for(var h=0,c=s.children,f=0,d=c.length;f<d;f++)h+=c[f].getValue();var v=a.getValue();if(v===0)return o;u*=h/v;var p=s.getModel(),g=p.get(e6e),m=Math.max(g,n6e(p));u+=4*g*g+(3*g+m)*Math.pow(u,.5),u>Mve&&(u=Mve),a=s}u<l&&(u=l);var y=Math.pow(u/l,.5);return[r*y,i*y]}function X_t(n,e,t){if(e)return{x:e.x,y:e.y};var r={x:0,y:0};if(!t)return r;var i=t.node,a=i.getLayout();if(!a)return r;for(var o=[a.width/2,a.height/2],s=i;s;){var l=s.getLayout();o[0]+=l.x,o[1]+=l.y,s=s.parentNode}return{x:n.width/2-o[0],y:n.height/2-o[1]}}function r6e(n,e,t,r,i){var a=n.getLayout(),o=t[i],s=o&&o===n;if(!(o&&!s||i===t.length&&n!==r)){n.setLayout({isInView:!0,invisible:!s&&!e.intersect(a),isAboveViewRoot:s},!0);var l=new ai(e.x-a.x,e.y-a.y,e.width,e.height);wae(n.viewChildren||[],function(u){r6e(u,l,t,r,i+1)})}}function n6e(n){return n.get(B_t)?n.get(G_t):0}function Y_t(n){n.registerSeriesModel(f_t),n.registerChartView(C_t),n.registerVisual(O_t),n.registerLayout(z_t),u_t(n)}function q_t(n){var e=n.findComponents({mainType:"legend"});!e||!e.length||n.eachSeriesByType("graph",function(t){var r=t.getCategoriesData(),i=t.getGraph(),a=i.data,o=r.mapArray(r.getName);a.filterSelf(function(s){var l=a.getItemModel(s),u=l.getShallow("category");if(u!=null){ha(u)&&(u=o[u]);for(var h=0;h<e.length;h++)if(!e[h].isSelected(u))return!1}return!0})})}function Z_t(n){var e={};n.eachSeriesByType("graph",function(t){var r=t.getCategoriesData(),i=t.getData(),a={};r.each(function(o){var s=r.getName(o);a["ec-"+s]=o;var l=r.getItemModel(o),u=l.getModel("itemStyle").getItemStyle();u.fill||(u.fill=t.getColorFromPalette(s,e)),r.setItemVisual(o,"style",u);for(var h=["symbol","symbolSize","symbolKeepAspect"],c=0;c<h.length;c++){var f=l.getShallow(h[c],!0);f!=null&&r.setItemVisual(o,h[c],f)}}),r.count()&&i.each(function(o){var s=i.getItemModel(o),l=s.getShallow("category");if(l!=null){Or(l)&&(l=a["ec-"+l]);var u=r.getItemVisual(l,"style"),h=i.ensureUniqueItemVisual(o,"style");Mt(h,u);for(var c=["symbol","symbolSize","symbolKeepAspect"],f=0;f<c.length;f++)i.setItemVisual(o,c[f],r.getItemVisual(l,c[f]))}})})}function O4(n){return n instanceof Array||(n=[n,n]),n}function K_t(n){n.eachSeriesByType("graph",function(e){var t=e.getGraph(),r=e.getEdgeData(),i=O4(e.get("edgeSymbol")),a=O4(e.get("edgeSymbolSize"));r.setVisual("fromSymbol",i&&i[0]),r.setVisual("toSymbol",i&&i[1]),r.setVisual("fromSymbolSize",a&&a[0]),r.setVisual("toSymbolSize",a&&a[1]),r.setVisual("style",e.getModel("lineStyle").getLineStyle()),r.each(function(o){var s=r.getItemModel(o),l=t.getEdgeByIndex(o),u=O4(s.getShallow("symbol",!0)),h=O4(s.getShallow("symbolSize",!0)),c=s.getModel("lineStyle").getLineStyle(),f=r.ensureUniqueItemVisual(o,"style");switch(Mt(f,c),f.stroke){case"source":{var d=l.node1.getVisual("style");f.stroke=d&&d.fill;break}case"target":{var d=l.node2.getVisual("style");f.stroke=d&&d.fill;break}}u[0]&&l.setVisual("fromSymbol",u[0]),u[1]&&l.setVisual("toSymbol",u[1]),h[0]&&l.setVisual("fromSymbolSize",h[0]),h[1]&&l.setVisual("toSymbolSize",h[1])})})}var WJ="-->",SU=function(n){return n.get("autoCurveness")||null},i6e=function(n,e){var t=SU(n),r=20,i=[];if(ha(t))r=t;else if(Gt(t)){n.__curvenessList=t;return}e>r&&(r=e);var a=r%2?r+2:r+3;i=[];for(var o=0;o<a;o++)i.push((o%2?o+1:o)/10*(o%2?-1:1));n.__curvenessList=i},bD=function(n,e,t){var r=[n.id,n.dataIndex].join("."),i=[e.id,e.dataIndex].join(".");return[t.uid,r,i].join(WJ)},a6e=function(n){var e=n.split(WJ);return[e[0],e[2],e[1]].join(WJ)},J_t=function(n,e){var t=bD(n.node1,n.node2,e);return e.__edgeMap[t]},Q_t=function(n,e){var t=HJ(bD(n.node1,n.node2,e),e),r=HJ(bD(n.node2,n.node1,e),e);return t+r},HJ=function(n,e){var t=e.__edgeMap;return t[n]?t[n].length:0};function ext(n){!SU(n)||(n.__curvenessList=[],n.__edgeMap={},i6e(n))}function txt(n,e,t,r){if(!!SU(t)){var i=bD(n,e,t),a=t.__edgeMap,o=a[a6e(i)];a[i]&&!o?a[i].isForward=!0:o&&a[i]&&(o.isForward=!0,a[i].isForward=!1),a[i]=a[i]||[],a[i].push(r)}}function bae(n,e,t,r){var i=SU(e),a=Gt(i);if(!i)return null;var o=J_t(n,e);if(!o)return null;for(var s=-1,l=0;l<o.length;l++)if(o[l]===t){s=l;break}var u=Q_t(n,e);i6e(e,u),n.lineStyle=n.lineStyle||{};var h=bD(n.node1,n.node2,e),c=e.__curvenessList,f=a||u%2?0:1;if(o.isForward)return c[f+s];var d=a6e(h),v=HJ(d,e),p=c[s+v+f];return r?a?i&&i[0]===0?(v+f)%2?p:-p:((v%2?0:1)+f)%2?p:-p:(v+f)%2?p:-p:c[s+v+f]}function o6e(n){var e=n.coordinateSystem;if(!(e&&e.type!=="view")){var t=n.getGraph();t.eachNode(function(r){var i=r.getModel();r.setLayout([+i.get("x"),+i.get("y")])}),Eae(t,n)}}function Eae(n,e){n.eachEdge(function(t,r){var i=qy(t.getModel().get(["lineStyle","curveness"]),-bae(t,e,r,!0),0),a=V1(t.node1.getLayout()),o=V1(t.node2.getLayout()),s=[a,o];+i&&s.push([(a[0]+o[0])/2-(a[1]-o[1])*i,(a[1]+o[1])/2-(o[0]-a[0])*i]),t.setLayout(s)})}function rxt(n,e){n.eachSeriesByType("graph",function(t){var r=t.get("layout"),i=t.coordinateSystem;if(i&&i.type!=="view"){var a=t.getData(),o=[];te(i.dimensions,function(f){o=o.concat(a.mapDimensionsAll(f))});for(var s=0;s<a.count();s++){for(var l=[],u=!1,h=0;h<o.length;h++){var c=a.get(o[h],s);isNaN(c)||(u=!0),l.push(c)}u?a.setItemLayout(s,i.dataToPoint(l)):a.setItemLayout(s,[NaN,NaN])}Eae(a.graph,t)}else(!r||r==="none")&&o6e(t)})}function lO(n){var e=n.coordinateSystem;if(e.type!=="view")return 1;var t=n.option.nodeScaleRatio,r=e.scaleX,i=e.getZoom(),a=(i-1)*t+1;return a/r}function uO(n){var e=n.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var mye=Math.PI,wj=[];function Tae(n,e,t,r){var i=n.coordinateSystem;if(!(i&&i.type!=="view")){var a=i.getBoundingRect(),o=n.getData(),s=o.graph,l=a.width/2+a.x,u=a.height/2+a.y,h=Math.min(a.width,a.height)/2,c=o.count();if(o.setLayout({cx:l,cy:u}),!!c){if(t){var f=i.pointToData(r),d=f[0],v=f[1],p=[d-l,v-u];II(p,p),mB(p,p,h),t.setLayout([l+p[0],u+p[1]],!0);var g=n.get(["circular","rotateLabel"]);s6e(t,g,l,u)}nxt[e](n,s,o,h,l,u,c),s.eachEdge(function(m,y){var _=qy(m.getModel().get(["lineStyle","curveness"]),bae(m,n,y),0),x=V1(m.node1.getLayout()),S=V1(m.node2.getLayout()),w,b=(x[0]+S[0])/2,E=(x[1]+S[1])/2;+_&&(_*=3,w=[l*_+b*(1-_),u*_+E*(1-_)]),m.setLayout([x,S,w])})}}}var nxt={value:function(n,e,t,r,i,a,o){var s=0,l=t.getSum("value"),u=Math.PI*2/(l||o);e.eachNode(function(h){var c=h.getValue("value"),f=u*(l?c:1)/2;s+=f,h.setLayout([r*Math.cos(s)+i,r*Math.sin(s)+a]),s+=f})},symbolSize:function(n,e,t,r,i,a,o){var s=0;wj.length=o;var l=lO(n);e.eachNode(function(c){var f=uO(c);isNaN(f)&&(f=2),f<0&&(f=0),f*=l;var d=Math.asin(f/2/r);isNaN(d)&&(d=mye/2),wj[c.dataIndex]=d,s+=d*2});var u=(2*mye-s)/o/2,h=0;e.eachNode(function(c){var f=u+wj[c.dataIndex];h+=f,(!c.getLayout()||!c.getLayout().fixed)&&c.setLayout([r*Math.cos(h)+i,r*Math.sin(h)+a]),h+=f})}};function s6e(n,e,t,r){var i=n.getGraphicEl();if(!!i){var a=n.getModel(),o=a.get(["label","rotate"])||0,s=i.getSymbolPath();if(e){var l=n.getLayout(),u=Math.atan2(l[1]-r,l[0]-t);u<0&&(u=Math.PI*2+u);var h=l[0]<t;h&&(u=u-Math.PI);var c=h?"left":"right";s.setTextConfig({rotation:-u,position:c,origin:"center"});var f=s.ensureState("emphasis");Mt(f.textConfig||(f.textConfig={}),{position:c})}else s.setTextConfig({rotation:o*=Math.PI/180})}}function ixt(n){n.eachSeriesByType("graph",function(e){e.get("layout")==="circular"&&Tae(e,"symbolSize")})}var QT=RK;function axt(n,e,t){for(var r=n,i=e,a=t.rect,o=a.width,s=a.height,l=[a.x+o/2,a.y+s/2],u=t.gravity==null?.1:t.gravity,h=0;h<r.length;h++){var c=r[h];c.p||(c.p=H2(o*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),c.pp=V1(c.p),c.edges=null}var f=t.friction==null?.6:t.friction,d=f,v,p;return{warmUp:function(){d=f*.8},setFixed:function(g){r[g].fixed=!0},setUnfixed:function(g){r[g].fixed=!1},beforeStep:function(g){v=g},afterStep:function(g){p=g},step:function(g){v&&v(r,i);for(var m=[],y=r.length,_=0;_<i.length;_++){var x=i[_];if(!x.ignoreForceLayout){var S=x.n1,w=x.n2;tE(m,w.p,S.p);var b=DK(m)-x.d,E=w.w/(S.w+w.w);isNaN(E)&&(E=0),II(m,m),!S.fixed&&QT(S.p,S.p,m,E*b*d),!w.fixed&&QT(w.p,w.p,m,-(1-E)*b*d)}}for(var _=0;_<y;_++){var T=r[_];T.fixed||(tE(m,l,T.p),QT(T.p,T.p,m,u*d))}for(var _=0;_<y;_++)for(var S=r[_],C=_+1;C<y;C++){var w=r[C];tE(m,w.p,S.p);var b=DK(m);b===0&&(plt(m,Math.random()-.5,Math.random()-.5),b=1);var A=(S.rep+w.rep)/b/b;!S.fixed&&QT(S.pp,S.pp,m,A),!w.fixed&&QT(w.pp,w.pp,m,-A)}for(var M=[],_=0;_<y;_++){var T=r[_];T.fixed||(tE(M,T.p,T.pp),QT(T.p,T.p,M,d),mf(T.pp,T.p))}d=d*.992;var I=d<.01;p&&p(r,i,I),g&&g(I)}}}function oxt(n){n.eachSeriesByType("graph",function(e){var t=e.coordinateSystem;if(!(t&&t.type!=="view"))if(e.get("layout")==="force"){var r=e.preservedPoints||{},i=e.getGraph(),a=i.data,o=i.edgeData,s=e.getModel("force"),l=s.get("initLayout");e.preservedPoints?a.each(function(_){var x=a.getId(_);a.setItemLayout(_,r[x]||[NaN,NaN])}):!l||l==="none"?o6e(e):l==="circular"&&Tae(e,"value");var u=a.getDataExtent("value"),h=o.getDataExtent("value"),c=s.get("repulsion"),f=s.get("edgeLength"),d=Gt(c)?c:[c,c],v=Gt(f)?f:[f,f];v=[v[1],v[0]];var p=a.mapArray("value",function(_,x){var S=a.getItemLayout(x),w=go(_,u,d);return isNaN(w)&&(w=(d[0]+d[1])/2),{w,rep:w,fixed:a.getItemModel(x).get("fixed"),p:!S||isNaN(S[0])||isNaN(S[1])?null:S}}),g=o.mapArray("value",function(_,x){var S=i.getEdgeByIndex(x),w=go(_,h,v);isNaN(w)&&(w=(v[0]+v[1])/2);var b=S.getModel(),E=qy(S.getModel().get(["lineStyle","curveness"]),-bae(S,e,x,!0),0);return{n1:p[S.node1.dataIndex],n2:p[S.node2.dataIndex],d:w,curveness:E,ignoreForceLayout:b.get("ignoreForceLayout")}}),m=t.getBoundingRect(),y=axt(p,g,{rect:m,gravity:s.get("gravity"),friction:s.get("friction")});y.beforeStep(function(_,x){for(var S=0,w=_.length;S<w;S++)_[S].fixed&&mf(_[S].p,i.getNodeByIndex(S).getLayout())}),y.afterStep(function(_,x,S){for(var w=0,b=_.length;w<b;w++)_[w].fixed||i.getNodeByIndex(w).setLayout(_[w].p),r[a.getId(w)]=_[w].p;for(var w=0,b=x.length;w<b;w++){var E=x[w],T=i.getEdgeByIndex(w),C=E.n1.p,A=E.n2.p,M=T.getLayout();M=M?M.slice():[],M[0]=M[0]||[],M[1]=M[1]||[],mf(M[0],C),mf(M[1],A),+E.curveness&&(M[2]=[(C[0]+A[0])/2-(C[1]-A[1])*E.curveness,(C[1]+A[1])/2-(A[0]-C[0])*E.curveness]),T.setLayout(M)}}),e.forceLayout=y,e.preservedPoints=r,y.step()}else e.forceLayout=null})}function sxt(n,e,t){var r=Mt(n.getBoxLayoutParams(),{aspect:t});return Uu(r,{width:e.getWidth(),height:e.getHeight()})}function lxt(n,e){var t=[];return n.eachSeriesByType("graph",function(r){var i=r.get("coordinateSystem");if(!i||i==="view"){var a=r.getData(),o=a.mapArray(function(g){var m=a.getItemModel(g);return[+m.get("x"),+m.get("y")]}),s=[],l=[];Yz(o,s,l),l[0]-s[0]===0&&(l[0]+=1,s[0]-=1),l[1]-s[1]===0&&(l[1]+=1,s[1]-=1);var u=(l[0]-s[0])/(l[1]-s[1]),h=sxt(r,e,u);isNaN(u)&&(s=[h.x,h.y],l=[h.x+h.width,h.y+h.height]);var c=l[0]-s[0],f=l[1]-s[1],d=h.width,v=h.height,p=r.coordinateSystem=new O3;p.zoomLimit=r.get("scaleLimit"),p.setBoundingRect(s[0],s[1],c,f),p.setViewRect(h.x,h.y,d,v),p.setCenter(r.get("center"),e),p.setZoom(r.get("zoom")),t.push(p)}}),t}var _ye=zh.prototype,bj=Jz.prototype,l6e=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return n}();(function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e})(l6e);function Ej(n){return isNaN(+n.cpx1)||isNaN(+n.cpy1)}var uxt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="ec-line",r}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new l6e},e.prototype.buildPath=function(t,r){Ej(r)?_ye.buildPath.call(this,t,r):bj.buildPath.call(this,t,r)},e.prototype.pointAt=function(t){return Ej(this.shape)?_ye.pointAt.call(this,t):bj.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var r=this.shape,i=Ej(r)?[r.x2-r.x1,r.y2-r.y1]:bj.tangentAt.call(this,t);return II(i,i)},e}(Si);const hxt=uxt;var Tj=["fromSymbol","toSymbol"];function xye(n){return"_"+n+"Type"}function Sye(n,e,t){var r=e.getItemVisual(t,n);if(!r||r==="none")return r;var i=e.getItemVisual(t,n+"Size"),a=e.getItemVisual(t,n+"Rotate"),o=e.getItemVisual(t,n+"Offset"),s=e.getItemVisual(t,n+"KeepAspect"),l=$I(i),u=Y2(o||0,l);return r+l+u+(a||"")+(s||"")}function wye(n,e,t){var r=e.getItemVisual(t,n);if(!(!r||r==="none")){var i=e.getItemVisual(t,n+"Size"),a=e.getItemVisual(t,n+"Rotate"),o=e.getItemVisual(t,n+"Offset"),s=e.getItemVisual(t,n+"KeepAspect"),l=$I(i),u=Y2(o||0,l),h=hu(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=a==null||isNaN(a)?void 0:+a*Math.PI/180||0,h.name=n,h}}function cxt(n){var e=new hxt({name:"line",subPixelOptimize:!0});return jJ(e.shape,n),e}function jJ(n,e){n.x1=e[0][0],n.y1=e[0][1],n.x2=e[1][0],n.y2=e[1][1],n.percent=1;var t=e[2];t?(n.cpx1=t[0],n.cpy1=t[1]):(n.cpx1=NaN,n.cpy1=NaN)}var fxt=function(n){$e(e,n);function e(t,r,i){var a=n.call(this)||this;return a._createLine(t,r,i),a}return e.prototype._createLine=function(t,r,i){var a=t.hostModel,o=t.getItemLayout(r),s=cxt(o);s.shape.percent=0,Is(s,{shape:{percent:1}},a,r),this.add(s),te(Tj,function(l){var u=wye(l,t,r);this.add(u),this[xye(l)]=Sye(l,t,r)},this),this._updateCommonStl(t,r,i)},e.prototype.updateData=function(t,r,i){var a=t.hostModel,o=this.childOfName("line"),s=t.getItemLayout(r),l={shape:{}};jJ(l.shape,s),ma(o,l,a,r),te(Tj,function(u){var h=Sye(u,t,r),c=xye(u);if(this[c]!==h){this.remove(this.childOfName(u));var f=wye(u,t,r);this.add(f)}this[c]=h},this),this._updateCommonStl(t,r,i)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,r,i){var a=t.hostModel,o=this.childOfName("line"),s=i&&i.emphasisLineStyle,l=i&&i.blurLineStyle,u=i&&i.selectLineStyle,h=i&&i.labelStatesModels,c=i&&i.emphasisDisabled,f=i&&i.focus,d=i&&i.blurScope;if(!i||t.hasItemOption){var v=t.getItemModel(r),p=v.getModel("emphasis");s=p.getModel("lineStyle").getLineStyle(),l=v.getModel(["blur","lineStyle"]).getLineStyle(),u=v.getModel(["select","lineStyle"]).getLineStyle(),c=p.get("disabled"),f=p.get("focus"),d=p.get("blurScope"),h=hh(v)}var g=t.getItemVisual(r,"style"),m=g.stroke;o.useStyle(g),o.style.fill=null,o.style.strokeNoScale=!0,o.ensureState("emphasis").style=s,o.ensureState("blur").style=l,o.ensureState("select").style=u,te(Tj,function(w){var b=this.childOfName(w);if(b){b.setColor(m),b.style.opacity=g.opacity;for(var E=0;E<Gf.length;E++){var T=Gf[E],C=o.getState(T);if(C){var A=C.style||{},M=b.ensureState(T),I=M.style||(M.style={});A.stroke!=null&&(I[b.__isEmptyBrush?"stroke":"fill"]=A.stroke),A.opacity!=null&&(I.opacity=A.opacity)}}b.markRedraw()}},this);var y=a.getRawValue(r);vc(this,h,{labelDataIndex:r,labelFetcher:{getFormattedLabel:function(w,b){return a.getFormattedLabel(w,b,t.dataType)}},inheritColor:m||"#000",defaultOpacity:g.opacity,defaultText:(y==null?t.getName(r):isFinite(y)?Pl(y):y)+""});var _=this.getTextContent();if(_){var x=h.normal;_.__align=_.style.align,_.__verticalAlign=_.style.verticalAlign,_.__position=x.get("position")||"middle";var S=x.get("distance");Gt(S)||(S=[S,S]),_.__labelDistance=S}this.setTextConfig({position:null,local:!0,inside:!1}),vl(this,f,d,c)},e.prototype.highlight=function(){h_(this)},e.prototype.downplay=function(){c_(this)},e.prototype.updateLayout=function(t,r){this.setLinePoints(t.getItemLayout(r))},e.prototype.setLinePoints=function(t){var r=this.childOfName("line");jJ(r.shape,t),r.dirty()},e.prototype.beforeUpdate=function(){var t=this,r=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),a=t.getTextContent();if(!r&&!i&&(!a||a.ignore))return;for(var o=1,s=this.parent;s;)s.scaleX&&(o/=s.scaleX),s=s.parent;var l=t.childOfName("line");if(!this.__dirty&&!l.__dirty)return;var u=l.shape.percent,h=l.pointAt(0),c=l.pointAt(u),f=tE([],c,h);II(f,f);function d(C,A){var M=C.__specifiedRotation;if(M==null){var I=l.tangentAt(A);C.attr("rotation",(A===1?-1:1)*Math.PI/2-Math.atan2(I[1],I[0]))}else C.attr("rotation",M)}if(r&&(r.setPosition(h),d(r,0),r.scaleX=r.scaleY=o*u,r.markRedraw()),i&&(i.setPosition(c),d(i,1),i.scaleX=i.scaleY=o*u,i.markRedraw()),a&&!a.ignore){a.x=a.y=0,a.originX=a.originY=0;var v=void 0,p=void 0,g=a.__labelDistance,m=g[0]*o,y=g[1]*o,_=u/2,x=l.tangentAt(_),S=[x[1],-x[0]],w=l.pointAt(_);S[1]>0&&(S[0]=-S[0],S[1]=-S[1]);var b=x[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var E=-Math.atan2(x[1],x[0]);c[0]<h[0]&&(E=Math.PI+E),a.rotation=E}var T=void 0;switch(a.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":T=-y,p="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":T=y,p="top";break;default:T=0,p="middle"}switch(a.__position){case"end":a.x=f[0]*m+c[0],a.y=f[1]*y+c[1],v=f[0]>.8?"left":f[0]<-.8?"right":"center",p=f[1]>.8?"top":f[1]<-.8?"bottom":"middle";break;case"start":a.x=-f[0]*m+h[0],a.y=-f[1]*y+h[1],v=f[0]>.8?"right":f[0]<-.8?"left":"center",p=f[1]>.8?"bottom":f[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=m*b+h[0],a.y=h[1]+T,v=x[0]<0?"right":"left",a.originX=-m*b,a.originY=-T;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=w[0],a.y=w[1]+T,v="center",a.originY=-T;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-m*b+c[0],a.y=c[1]+T,v=x[0]>=0?"right":"left",a.originX=m*b,a.originY=-T;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||p,align:a.__align||v})}},e}(Cn);const Cae=fxt;var dxt=function(){function n(e){this.group=new Cn,this._LineCtor=e||Cae}return n.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var r=this,i=r.group,a=r._lineData;r._lineData=e,a||i.removeAll();var o=bye(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},n.prototype.updateLayout=function(){var e=this._lineData;!e||e.eachItemGraphicEl(function(t,r){t.updateLayout(e,r)},this)},n.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=bye(e),this._lineData=null,this.group.removeAll()},n.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function r(s){!s.isGroup&&!vxt(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var a=t.getItemLayout(i);if(Cj(a)){var o=new this._LineCtor(t,i,this._seriesScope);o.traverse(r),this.group.add(o),t.setItemGraphicEl(i,o),this._progressiveEls.push(o)}}},n.prototype.remove=function(){this.group.removeAll()},n.prototype.eachRendered=function(e){_w(this._progressiveEls||this.group,e)},n.prototype._doAdd=function(e,t,r){var i=e.getItemLayout(t);if(!!Cj(i)){var a=new this._LineCtor(e,t,r);e.setItemGraphicEl(t,a),this.group.add(a)}},n.prototype._doUpdate=function(e,t,r,i,a){var o=e.getItemGraphicEl(r);if(!Cj(t.getItemLayout(i))){this.group.remove(o);return}o?o.updateData(t,i,a):o=new this._LineCtor(t,i,a),t.setItemGraphicEl(i,o),this.group.add(o)},n}();function vxt(n){return n.animators&&n.animators.length>0}function bye(n){var e=n.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:hh(e)}}function Eye(n){return isNaN(n[0])||isNaN(n[1])}function Cj(n){return n&&!Eye(n[0])&&!Eye(n[1])}const Aae=dxt;var Aj=[],Mj=[],Ij=[],eC=Ph,Lj=wE,Tye=Math.abs;function Cye(n,e,t){for(var r=n[0],i=n[1],a=n[2],o=1/0,s,l=t*t,u=.1,h=.1;h<=.9;h+=.1){Aj[0]=eC(r[0],i[0],a[0],h),Aj[1]=eC(r[1],i[1],a[1],h);var c=Tye(Lj(Aj,e)-l);c<o&&(o=c,s=h)}for(var f=0;f<32;f++){var d=s+u;Mj[0]=eC(r[0],i[0],a[0],s),Mj[1]=eC(r[1],i[1],a[1],s),Ij[0]=eC(r[0],i[0],a[0],d),Ij[1]=eC(r[1],i[1],a[1],d);var c=Lj(Mj,e)-l;if(Tye(c)<.01)break;var v=Lj(Ij,e)-l;u/=2,c<0?v>=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function Pj(n,e){var t=[],r=tD,i=[[],[],[]],a=[[],[]],o=[];e/=2,n.eachEdge(function(s,l){var u=s.getLayout(),h=s.getVisual("fromSymbol"),c=s.getVisual("toSymbol");u.__original||(u.__original=[V1(u[0]),V1(u[1])],u[2]&&u.__original.push(V1(u[2])));var f=u.__original;if(u[2]!=null){if(mf(i[0],f[0]),mf(i[1],f[2]),mf(i[2],f[1]),h&&h!=="none"){var d=uO(s.node1),v=Cye(i,f[0],d*e);r(i[0][0],i[1][0],i[2][0],v,t),i[0][0]=t[3],i[1][0]=t[4],r(i[0][1],i[1][1],i[2][1],v,t),i[0][1]=t[3],i[1][1]=t[4]}if(c&&c!=="none"){var d=uO(s.node2),v=Cye(i,f[1],d*e);r(i[0][0],i[1][0],i[2][0],v,t),i[1][0]=t[1],i[2][0]=t[2],r(i[0][1],i[1][1],i[2][1],v,t),i[1][1]=t[1],i[2][1]=t[2]}mf(u[0],i[0]),mf(u[1],i[2]),mf(u[2],i[1])}else{if(mf(a[0],f[0]),mf(a[1],f[1]),tE(o,a[1],a[0]),II(o,o),h&&h!=="none"){var d=uO(s.node1);RK(a[0],a[0],o,d*e)}if(c&&c!=="none"){var d=uO(s.node2);RK(a[1],a[1],o,-d*e)}mf(u[0],a[0]),mf(u[1],a[1])}})}function Aye(n){return n.type==="view"}var pxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){var i=new A3,a=new Aae,o=this.group;this._controller=new P3(r.getZr()),this._controllerHost={target:o},o.add(i.group),o.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,r,i){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(Aye(o)){var h={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(h):ma(u,h,t)}Pj(t.getGraph(),lO(t));var c=t.getData();s.updateData(c);var f=t.getEdgeData();l.updateData(f),this._updateNodeAndLinkScale(),this._updateController(t,r,i),clearTimeout(this._layoutTimeout);var d=t.forceLayout,v=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,v);var p=t.get("layout");c.graph.eachNode(function(_){var x=_.dataIndex,S=_.getGraphicEl(),w=_.getModel();if(!!S){S.off("drag").off("dragend");var b=w.get("draggable");b&&S.on("drag",function(T){switch(p){case"force":d.warmUp(),!a._layouting&&a._startForceLayoutIteration(d,v),d.setFixed(x),c.setItemLayout(x,[S.x,S.y]);break;case"circular":c.setItemLayout(x,[S.x,S.y]),_.setLayout({fixed:!0},!0),Tae(t,"symbolSize",_,[T.offsetX,T.offsetY]),a.updateLayout(t);break;case"none":default:c.setItemLayout(x,[S.x,S.y]),Eae(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){d&&d.setUnfixed(x)}),S.setDraggable(b,!!w.get("cursor"));var E=w.get(["emphasis","focus"]);E==="adjacency"&&(Bn(S).focus=_.getAdjacentDataIndices())}}),c.graph.eachEdge(function(_){var x=_.getGraphicEl(),S=_.getModel().get(["emphasis","focus"]);!x||S==="adjacency"&&(Bn(x).focus={edge:[_.dataIndex],node:[_.node1.dataIndex,_.node2.dataIndex]})});var g=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),m=c.getLayout("cx"),y=c.getLayout("cy");c.graph.eachNode(function(_){s6e(_,g,m,y)}),this._firstRender=!1},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,r){var i=this;(function a(){t.step(function(o){i.updateLayout(i._model),(i._layouting=!o)&&(r?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,r,i){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,h,c){var f=l.getBoundingRect();return f.applyTransform(l.transform),f.contain(h,c)&&!mU(u,i,t)}),!Aye(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){vae(s,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){pae(s,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),Pj(t.getGraph(),lO(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,r=t.getData(),i=lO(t);r.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){Pj(t.getGraph(),lO(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(os);const gxt=pxt;function tC(n){return"_EC_"+n}var yxt=function(){function n(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return n.prototype.isDirected=function(){return this._directed},n.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var r=this._nodesMap;if(!r[tC(e)]){var i=new Nb(e,t);return i.hostGraph=this,this.nodes.push(i),r[tC(e)]=i,i}},n.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},n.prototype.getNodeById=function(e){return this._nodesMap[tC(e)]},n.prototype.addEdge=function(e,t,r){var i=this._nodesMap,a=this._edgesMap;if(ha(e)&&(e=this.nodes[e]),ha(t)&&(t=this.nodes[t]),e instanceof Nb||(e=i[tC(e)]),t instanceof Nb||(t=i[tC(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new u6e(e,t,r);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},n.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},n.prototype.getEdge=function(e,t){e instanceof Nb&&(e=e.id),t instanceof Nb&&(t=t.id);var r=this._edgesMap;return this._directed?r[e+"-"+t]:r[e+"-"+t]||r[t+"-"+e]},n.prototype.eachNode=function(e,t){for(var r=this.nodes,i=r.length,a=0;a<i;a++)r[a].dataIndex>=0&&e.call(t,r[a],a)},n.prototype.eachEdge=function(e,t){for(var r=this.edges,i=r.length,a=0;a<i;a++)r[a].dataIndex>=0&&r[a].node1.dataIndex>=0&&r[a].node2.dataIndex>=0&&e.call(t,r[a],a)},n.prototype.breadthFirstTraverse=function(e,t,r,i){if(t instanceof Nb||(t=this._nodesMap[tC(t)]),!!t){for(var a=r==="out"?"outEdges":r==="in"?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(i,t,null))for(var s=[t];s.length;)for(var l=s.shift(),u=l[a],o=0;o<u.length;o++){var h=u[o],c=h.node1===l?h.node2:h.node1;if(!c.__visited){if(e.call(i,c,l))return;s.push(c),c.__visited=!0}}}},n.prototype.update=function(){for(var e=this.data,t=this.edgeData,r=this.nodes,i=this.edges,a=0,o=r.length;a<o;a++)r[a].dataIndex=-1;for(var a=0,o=e.count();a<o;a++)r[e.getRawIndex(a)].dataIndex=a;t.filterSelf(function(s){var l=i[t.getRawIndex(s)];return l.node1.dataIndex>=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a<o;a++)i[a].dataIndex=-1;for(var a=0,o=t.count();a<o;a++)i[t.getRawIndex(a)].dataIndex=a},n.prototype.clone=function(){for(var e=new n(this._directed),t=this.nodes,r=this.edges,i=0;i<t.length;i++)e.addNode(t[i].id,t[i].dataIndex);for(var i=0;i<r.length;i++){var a=r[i];e.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return e},n}(),Nb=function(){function n(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=e==null?"":e,this.dataIndex=t==null?-1:t}return n.prototype.degree=function(){return this.edges.length},n.prototype.inDegree=function(){return this.inEdges.length},n.prototype.outDegree=function(){return this.outEdges.length},n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostGraph,r=t.data.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var r=this.edges[t];r.dataIndex<0||(e.edge.push(r.dataIndex),e.node.push(r.node1.dataIndex,r.node2.dataIndex))}return e},n.prototype.getTrajectoryDataIndices=function(){for(var e=$r(),t=$r(),r=0;r<this.edges.length;r++){var i=this.edges[r];if(!(i.dataIndex<0)){e.set(i.dataIndex,!0);for(var a=[i.node1],o=[i.node2],s=0;s<a.length;){var l=a[s];s++,t.set(l.dataIndex,!0);for(var u=0;u<l.inEdges.length;u++)e.set(l.inEdges[u].dataIndex,!0),a.push(l.inEdges[u].node1)}for(s=0;s<o.length;){var h=o[s];s++,t.set(h.dataIndex,!0);for(var u=0;u<h.outEdges.length;u++)e.set(h.outEdges[u].dataIndex,!0),o.push(h.outEdges[u].node2)}}}return{edge:e.keys(),node:t.keys()}},n}(),u6e=function(){function n(e,t,r){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=r==null?-1:r}return n.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostGraph,r=t.edgeData.getItemModel(this.dataIndex);return r.getModel(e)}},n.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},n.prototype.getTrajectoryDataIndices=function(){var e=$r(),t=$r();e.set(this.dataIndex,!0);for(var r=[this.node1],i=[this.node2],a=0;a<r.length;){var o=r[a];a++,t.set(o.dataIndex,!0);for(var s=0;s<o.inEdges.length;s++)e.set(o.inEdges[s].dataIndex,!0),r.push(o.inEdges[s].node1)}for(a=0;a<i.length;){var l=i[a];a++,t.set(l.dataIndex,!0);for(var s=0;s<l.outEdges.length;s++)e.set(l.outEdges[s].dataIndex,!0),i.push(l.outEdges[s].node2)}return{edge:e.keys(),node:t.keys()}},n}();function h6e(n,e){return{getValue:function(t){var r=this[n][e];return r.getStore().get(r.getDimensionIndex(t||"value"),this.dataIndex)},setVisual:function(t,r){this.dataIndex>=0&&this[n][e].setItemVisual(this.dataIndex,t,r)},getVisual:function(t){return this[n][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,r){this.dataIndex>=0&&this[n][e].setItemLayout(this.dataIndex,t,r)},getLayout:function(){return this[n][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[n][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[n][e].getRawIndex(this.dataIndex)}}}gu(Nb,h6e("hostGraph","data"));gu(u6e,h6e("hostGraph","edgeData"));const mxt=yxt;function c6e(n,e,t,r,i){for(var a=new mxt(r),o=0;o<n.length;o++)a.addNode(Gh(n[o].id,n[o].name,o),o);for(var s=[],l=[],u=0,o=0;o<e.length;o++){var h=e[o],c=h.source,f=h.target;a.addEdge(c,f,u)&&(l.push(h),s.push(Gh(Ru(h.id,null),c+" > "+f)),u++)}var d=t.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar")v=k_(n,t);else{var p=S3.get(d),g=p?p.dimensions||[]:[];gi(g,"value")<0&&g.concat(["value"]);var m=b3(n,{coordDimensions:g,encodeDefine:t.getEncode()}).dimensions;v=new Df(m,t),v.initData(n)}var y=new Df(["value"],t);return y.initData(l,s),i&&i(v,y),j5e({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var _xt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments);var r=this;function i(){return r._categoriesData}this.legendVisualProvider=new L3(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){n.prototype.mergeDefaultAndTheme.apply(this,arguments),XE(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,r){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&i){ext(this);var s=c6e(a,i,this,!0,l);return te(s.edges,function(u){txt(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,h){u.wrapMethod("getItemModel",function(v){var p=o._categoriesModels,g=v.getShallow("category"),m=p[g];return m&&(m.parentModel=v.parentModel,v.parentModel=m),v});var c=as.prototype.getModel;function f(v,p){var g=c.call(this,v,p);return g.resolveParentPath=d,g}h.wrapMethod("getItemModel",function(v){return v.resolveParentPath=d,v.getModel=f,v});function d(v){if(v&&(v[0]==="label"||v[1]==="label")){var p=v.slice();return v[0]==="label"?p[0]="edgeLabel":v[1]==="label"&&(p[1]="edgeLabel"),p}return v}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,r,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(t,i),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),h=[];return l!=null&&h.push(l),u!=null&&h.push(u),ch("nameValue",{name:h.join(" > "),value:o.value,noValue:o.value==null})}var c=OFe({series:this,dataIndex:t,multipleSeries:r});return c},e.prototype._updateCategoriesData=function(){var t=Vt(this.option.categories||[],function(i){return i.value!=null?i:Mt({value:0},i)}),r=new Df(["value"],this);r.initData(t),this._categoriesData=r,this._categoriesModels=r.mapArray(function(i){return r.getItemModel(i)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return n.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Ws);const xxt=_xt;var Sxt={type:"graphRoam",event:"graphRoam",update:"none"};function wxt(n){n.registerChartView(gxt),n.registerSeriesModel(xxt),n.registerProcessor(q_t),n.registerVisual(Z_t),n.registerVisual(K_t),n.registerLayout(rxt),n.registerLayout(n.PRIORITY.VISUAL.POST_CHART_LAYOUT,ixt),n.registerLayout(oxt),n.registerCoordinateSystem("graphView",{dimensions:O3.dimensions,create:lxt}),n.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Hl),n.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Hl),n.registerAction(Sxt,function(e,t,r){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,o=yae(a,e,void 0,r);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}var bxt=function(){function n(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return n}(),Ext=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="pointer",r}return e.prototype.getDefaultShape=function(){return new bxt},e.prototype.buildPath=function(t,r){var i=Math.cos,a=Math.sin,o=r.r,s=r.width,l=r.angle,u=r.x-i(l)*s*(s>=o/3?1:2),h=r.y-a(l)*s*(s>=o/3?1:2);l=r.angle-Math.PI/2,t.moveTo(u,h),t.lineTo(r.x+i(l)*s,r.y+a(l)*s),t.lineTo(r.x+i(r.angle)*o,r.y+a(r.angle)*o),t.lineTo(r.x-i(l)*s,r.y-a(l)*s),t.lineTo(u,h)},e}(Si);const Txt=Ext;function Cxt(n,e){var t=n.get("center"),r=e.getWidth(),i=e.getHeight(),a=Math.min(r,i),o=xr(t[0],e.getWidth()),s=xr(t[1],e.getHeight()),l=xr(n.get("radius"),a/2);return{cx:o,cy:s,r:l}}function R4(n,e){var t=n==null?"":n+"";return e&&(Or(e)?t=e.replace("{value}",t):rn(e)&&(t=e(n))),t}var Axt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=Cxt(t,i);this._renderMain(t,r,i,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,r,i,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,h=-t.get("endAngle")/180*Math.PI,c=t.getModel("axisLine"),f=c.get("roundCap"),d=f?AG:wd,v=c.get("show"),p=c.getModel("lineStyle"),g=p.get("width"),m=[u,h];V3e(m,!l),u=m[0],h=m[1];for(var y=h-u,_=u,x=[],S=0;v&&S<a.length;S++){var w=Math.min(Math.max(a[S][0],0),1);h=u+y*w;var b=new d({shape:{startAngle:_,endAngle:h,cx:o.cx,cy:o.cy,clockwise:l,r0:o.r-g,r:o.r},silent:!0});b.setStyle({fill:a[S][1]}),b.setStyle(p.getLineStyle(["color","width"])),x.push(b),_=h}x.reverse(),te(x,function(T){return s.add(T)});var E=function(T){if(T<=0)return a[0][1];var C;for(C=0;C<a.length;C++)if(a[C][0]>=T&&(C===0?0:a[C-1][0])<T)return a[C][1];return a[C-1][1]};this._renderTicks(t,r,i,E,o,u,h,l,g),this._renderTitleAndDetail(t,r,i,E,o),this._renderAnchor(t,o),this._renderPointer(t,r,i,E,o,u,h,l,g)},e.prototype._renderTicks=function(t,r,i,a,o,s,l,u,h){for(var c=this.group,f=o.cx,d=o.cy,v=o.r,p=+t.get("min"),g=+t.get("max"),m=t.getModel("splitLine"),y=t.getModel("axisTick"),_=t.getModel("axisLabel"),x=t.get("splitNumber"),S=y.get("splitNumber"),w=xr(m.get("length"),v),b=xr(y.get("length"),v),E=s,T=(l-s)/x,C=T/S,A=m.getModel("lineStyle").getLineStyle(),M=y.getModel("lineStyle").getLineStyle(),I=m.get("distance"),R,k,D=0;D<=x;D++){if(R=Math.cos(E),k=Math.sin(E),m.get("show")){var G=I?I+h:h,W=new zh({shape:{x1:R*(v-G)+f,y1:k*(v-G)+d,x2:R*(v-w-G)+f,y2:k*(v-w-G)+d},style:A,silent:!0});A.stroke==="auto"&&W.setStyle({stroke:a(D/x)}),c.add(W)}if(_.get("show")){var G=_.get("distance")+I,z=R4(Pl(D/x*(g-p)+p),_.get("formatter")),V=a(D/x),q=R*(v-w-G)+f,Y=k*(v-w-G)+d,le=_.get("rotate"),j=0;le==="radial"?(j=-E+2*Math.PI,j>Math.PI/2&&(j+=Math.PI)):le==="tangential"?j=-E-Math.PI/2:ha(le)&&(j=le*Math.PI/180),j===0?c.add(new la({style:is(_,{text:z,x:q,y:Y,verticalAlign:k<-.8?"top":k>.8?"bottom":"middle",align:R<-.4?"left":R>.4?"right":"center"},{inheritColor:V}),silent:!0})):c.add(new la({style:is(_,{text:z,x:q,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:V}),silent:!0,originX:q,originY:Y,rotation:j}))}if(y.get("show")&&D!==x){var G=y.get("distance");G=G?G+h:h;for(var Q=0;Q<=S;Q++){R=Math.cos(E),k=Math.sin(E);var ie=new zh({shape:{x1:R*(v-G)+f,y1:k*(v-G)+d,x2:R*(v-b-G)+f,y2:k*(v-b-G)+d},silent:!0,style:M});M.stroke==="auto"&&ie.setStyle({stroke:a((D+Q/S)/x)}),c.add(ie),E+=C}E-=C}else E+=T}},e.prototype._renderPointer=function(t,r,i,a,o,s,l,u,h){var c=this.group,f=this._data,d=this._progressEls,v=[],p=t.get(["pointer","show"]),g=t.getModel("progress"),m=g.get("show"),y=t.getData(),_=y.mapDimension("value"),x=+t.get("min"),S=+t.get("max"),w=[x,S],b=[s,l];function E(C,A){var M=y.getItemModel(C),I=M.getModel("pointer"),R=xr(I.get("width"),o.r),k=xr(I.get("length"),o.r),D=t.get(["pointer","icon"]),G=I.get("offsetCenter"),W=xr(G[0],o.r),z=xr(G[1],o.r),V=I.get("keepAspect"),q;return D?q=hu(D,W-R/2,z-k,R,k,null,V):q=new Txt({shape:{angle:-Math.PI/2,width:R,r:k,x:W,y:z}}),q.rotation=-(A+Math.PI/2),q.x=o.cx,q.y=o.cy,q}function T(C,A){var M=g.get("roundCap"),I=M?AG:wd,R=g.get("overlap"),k=R?g.get("width"):h/y.count(),D=R?o.r-k:o.r-(C+1)*k,G=R?o.r:o.r-C*k,W=new I({shape:{startAngle:s,endAngle:A,cx:o.cx,cy:o.cy,clockwise:u,r0:D,r:G}});return R&&(W.z2=S-y.get(_,C)%S),W}(m||p)&&(y.diff(f).add(function(C){var A=y.get(_,C);if(p){var M=E(C,s);Is(M,{rotation:-((isNaN(+A)?b[0]:go(A,w,b,!0))+Math.PI/2)},t),c.add(M),y.setItemGraphicEl(C,M)}if(m){var I=T(C,s),R=g.get("clip");Is(I,{shape:{endAngle:go(A,w,b,R)}},t),c.add(I),iJ(t.seriesIndex,y.dataType,C,I),v[C]=I}}).update(function(C,A){var M=y.get(_,C);if(p){var I=f.getItemGraphicEl(A),R=I?I.rotation:s,k=E(C,R);k.rotation=R,ma(k,{rotation:-((isNaN(+M)?b[0]:go(M,w,b,!0))+Math.PI/2)},t),c.add(k),y.setItemGraphicEl(C,k)}if(m){var D=d[A],G=D?D.shape.endAngle:s,W=T(C,G),z=g.get("clip");ma(W,{shape:{endAngle:go(M,w,b,z)}},t),c.add(W),iJ(t.seriesIndex,y.dataType,C,W),v[C]=W}}).execute(),y.each(function(C){var A=y.getItemModel(C),M=A.getModel("emphasis"),I=M.get("focus"),R=M.get("blurScope"),k=M.get("disabled");if(p){var D=y.getItemGraphicEl(C),G=y.getItemVisual(C,"style"),W=G.fill;if(D instanceof xc){var z=D.style;D.useStyle(Mt({image:z.image,x:z.x,y:z.y,width:z.width,height:z.height},G))}else D.useStyle(G),D.type!=="pointer"&&D.setColor(W);D.setStyle(A.getModel(["pointer","itemStyle"]).getItemStyle()),D.style.fill==="auto"&&D.setStyle("fill",a(go(y.get(_,C),w,[0,1],!0))),D.z2EmphasisLift=0,dc(D,A),vl(D,I,R,k)}if(m){var V=v[C];V.useStyle(y.getItemVisual(C,"style")),V.setStyle(A.getModel(["progress","itemStyle"]).getItemStyle()),V.z2EmphasisLift=0,dc(V,A),vl(V,I,R,k)}}),this._progressEls=v)},e.prototype._renderAnchor=function(t,r){var i=t.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),h=hu(s,r.cx-o/2+xr(l[0],r.r),r.cy-o/2+xr(l[1],r.r),o,o,null,u);h.z2=i.get("showAbove")?1:0,h.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(h)}},e.prototype._renderTitleAndDetail=function(t,r,i,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),h=+t.get("min"),c=+t.get("max"),f=new Cn,d=[],v=[],p=t.isAnimationEnabled(),g=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(m){d[m]=new la({silent:!0}),v[m]=new la({silent:!0})}).update(function(m,y){d[m]=s._titleEls[y],v[m]=s._detailEls[y]}).execute(),l.each(function(m){var y=l.getItemModel(m),_=l.get(u,m),x=new Cn,S=a(go(_,[h,c],[0,1],!0)),w=y.getModel("title");if(w.get("show")){var b=w.get("offsetCenter"),E=o.cx+xr(b[0],o.r),T=o.cy+xr(b[1],o.r),C=d[m];C.attr({z2:g?0:2,style:is(w,{x:E,y:T,text:l.getName(m),align:"center",verticalAlign:"middle"},{inheritColor:S})}),x.add(C)}var A=y.getModel("detail");if(A.get("show")){var M=A.get("offsetCenter"),I=o.cx+xr(M[0],o.r),R=o.cy+xr(M[1],o.r),k=xr(A.get("width"),o.r),D=xr(A.get("height"),o.r),G=t.get(["progress","show"])?l.getItemVisual(m,"style").fill:S,C=v[m],W=A.get("formatter");C.attr({z2:g?0:2,style:is(A,{x:I,y:R,text:R4(_,W),width:isNaN(k)?null:k,height:isNaN(D)?null:D,align:"center",verticalAlign:"middle"},{inheritColor:G})}),Dke(C,{normal:A},_,function(V){return R4(V,W)}),p&&Nke(C,m,l,t,{getFormattedLabel:function(V,q,Y,le,j,Q){return R4(Q?Q.interpolatedValue:_,W)}}),x.add(C)}f.add(x)}),this.group.add(f),this._titleEls=d,this._detailEls=v},e.type="gauge",e}(os);const Mxt=Axt;var Ixt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,r){return WI(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Ws);const Lxt=Ixt;function Pxt(n){n.registerChartView(Mxt),n.registerSeriesModel(Lxt)}var Oxt=["itemStyle","opacity"],Rxt=function(n){$e(e,n);function e(t,r){var i=n.call(this)||this,a=i,o=new Gd,s=new la;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(t,r,!0),i}return e.prototype.updateData=function(t,r,i){var a=this,o=t.hostModel,s=t.getItemModel(r),l=t.getItemLayout(r),u=s.getModel("emphasis"),h=s.get(Oxt);h=h==null?1:h,i||x0(a),a.useStyle(t.getItemVisual(r,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Is(a,{style:{opacity:h}},o,r)):ma(a,{style:{opacity:h},shape:{points:l.points}},o,r),dc(a,s),this._updateLabel(t,r),vl(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,r){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=t.hostModel,l=t.getItemModel(r),u=t.getItemLayout(r),h=u.label,c=t.getItemVisual(r,"style"),f=c.fill;vc(o,hh(l),{labelFetcher:t.hostModel,labelDataIndex:r,defaultOpacity:c.opacity,defaultText:t.getName(r)},{normal:{align:h.textAlign,verticalAlign:h.verticalAlign}}),i.setTextConfig({local:!0,inside:!!h.inside,insideStroke:f,outsideFill:f});var d=h.linePoints;a.setShape({points:d}),i.textGuideLineConfig={anchor:d?new qn(d[0][0],d[0][1]):null},ma(o,{style:{x:h.x,y:h.y}},s,r),o.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),aae(i,oae(l),{stroke:f})},e}(bd),Dxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new Rxt(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(a,l),s.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=o.getItemGraphicEl(l);lD(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(os);const Nxt=Dxt;var kxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new L3(kr(this.getData,this),kr(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,r){return WI(this,{coordDimensions:["value"],encodeDefaulter:Un(Nie,this)})},e.prototype._defaultLabelLine=function(t){XE(t,"labelLine",["show"]);var r=t.labelLine,i=t.emphasis.labelLine;r.show=r.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var r=this.getData(),i=n.prototype.getDataParams.call(this,t),a=r.mapDimension("value"),o=r.getSum(a);return i.percent=o?+(r.get(a,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Ws);const Fxt=kxt;function Bxt(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Gxt(n,e){for(var t=n.mapDimension("value"),r=n.mapArray(t,function(l){return l}),i=[],a=e==="ascending",o=0,s=n.count();o<s;o++)i[o]=o;return rn(e)?i.sort(e):e!=="none"&&i.sort(function(l,u){return a?r[l]-r[u]:r[u]-r[l]}),i}function zxt(n){var e=n.hostModel,t=e.get("orient");n.each(function(r){var i=n.getItemModel(r),a=i.getModel("label"),o=a.get("position"),s=i.getModel("labelLine"),l=n.getItemLayout(r),u=l.points,h=o==="inner"||o==="inside"||o==="center"||o==="insideLeft"||o==="insideRight",c,f,d,v;if(h)o==="insideLeft"?(f=(u[0][0]+u[3][0])/2+5,d=(u[0][1]+u[3][1])/2,c="left"):o==="insideRight"?(f=(u[1][0]+u[2][0])/2-5,d=(u[1][1]+u[2][1])/2,c="right"):(f=(u[0][0]+u[1][0]+u[2][0]+u[3][0])/4,d=(u[0][1]+u[1][1]+u[2][1]+u[3][1])/4,c="center"),v=[[f,d],[f,d]];else{var p=void 0,g=void 0,m=void 0,y=void 0,_=s.get("length");o==="left"?(p=(u[3][0]+u[0][0])/2,g=(u[3][1]+u[0][1])/2,m=p-_,f=m-5,c="right"):o==="right"?(p=(u[1][0]+u[2][0])/2,g=(u[1][1]+u[2][1])/2,m=p+_,f=m+5,c="left"):o==="top"?(p=(u[3][0]+u[0][0])/2,g=(u[3][1]+u[0][1])/2,y=g-_,d=y-5,c="center"):o==="bottom"?(p=(u[1][0]+u[2][0])/2,g=(u[1][1]+u[2][1])/2,y=g+_,d=y+5,c="center"):o==="rightTop"?(p=t==="horizontal"?u[3][0]:u[1][0],g=t==="horizontal"?u[3][1]:u[1][1],t==="horizontal"?(y=g-_,d=y-5,c="center"):(m=p+_,f=m+5,c="top")):o==="rightBottom"?(p=u[2][0],g=u[2][1],t==="horizontal"?(y=g+_,d=y+5,c="center"):(m=p+_,f=m+5,c="bottom")):o==="leftTop"?(p=u[0][0],g=t==="horizontal"?u[0][1]:u[1][1],t==="horizontal"?(y=g-_,d=y-5,c="center"):(m=p-_,f=m-5,c="right")):o==="leftBottom"?(p=t==="horizontal"?u[1][0]:u[3][0],g=t==="horizontal"?u[1][1]:u[2][1],t==="horizontal"?(y=g+_,d=y+5,c="center"):(m=p-_,f=m-5,c="right")):(p=(u[1][0]+u[2][0])/2,g=(u[1][1]+u[2][1])/2,t==="horizontal"?(y=g+_,d=y+5,c="center"):(m=p+_,f=m+5,c="left")),t==="horizontal"?(m=p,f=m):(y=g,d=y),v=[[p,g],[m,y]]}l.label={linePoints:v,x:f,y:d,verticalAlign:"middle",textAlign:c,inside:h}})}function Uxt(n,e){n.eachSeriesByType("funnel",function(t){var r=t.getData(),i=r.mapDimension("value"),a=t.get("sort"),o=Bxt(t,e),s=t.get("orient"),l=o.width,u=o.height,h=Gxt(r,a),c=o.x,f=o.y,d=s==="horizontal"?[xr(t.get("minSize"),u),xr(t.get("maxSize"),u)]:[xr(t.get("minSize"),l),xr(t.get("maxSize"),l)],v=r.getDataExtent(i),p=t.get("min"),g=t.get("max");p==null&&(p=Math.min(v[0],0)),g==null&&(g=v[1]);var m=t.get("funnelAlign"),y=t.get("gap"),_=s==="horizontal"?l:u,x=(_-y*(r.count()-1))/r.count(),S=function(R,k){if(s==="horizontal"){var D=r.get(i,R)||0,G=go(D,[p,g],d,!0),W=void 0;switch(m){case"top":W=f;break;case"center":W=f+(u-G)/2;break;case"bottom":W=f+(u-G);break}return[[k,W],[k,W+G]]}var z=r.get(i,R)||0,V=go(z,[p,g],d,!0),q;switch(m){case"left":q=c;break;case"center":q=c+(l-V)/2;break;case"right":q=c+l-V;break}return[[q,k],[q+V,k]]};a==="ascending"&&(x=-x,y=-y,s==="horizontal"?c+=l:f+=u,h=h.reverse());for(var w=0;w<h.length;w++){var b=h[w],E=h[w+1],T=r.getItemModel(b);if(s==="horizontal"){var C=T.get(["itemStyle","width"]);C==null?C=x:(C=xr(C,l),a==="ascending"&&(C=-C));var A=S(b,c),M=S(E,c+C);c+=C+y,r.setItemLayout(b,{points:A.concat(M.slice().reverse())})}else{var I=T.get(["itemStyle","height"]);I==null?I=x:(I=xr(I,u),a==="ascending"&&(I=-I));var A=S(b,f),M=S(E,f+I);f+=I+y,r.setItemLayout(b,{points:A.concat(M.slice().reverse())})}}zxt(r)})}function Vxt(n){n.registerChartView(Nxt),n.registerSeriesModel(Fxt),n.registerLayout(Uxt),n.registerProcessor(I3("funnel"))}var $xt=.3,Wxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._dataGroup=new Cn,t._initialized=!1,t}return e.prototype.init=function(){this.group.add(this._dataGroup)},e.prototype.render=function(t,r,i,a){this._progressiveEls=null;var o=this._dataGroup,s=t.getData(),l=this._data,u=t.coordinateSystem,h=u.dimensions,c=Iye(t);s.diff(l).add(f).update(d).remove(v).execute();function f(g){var m=Mye(s,o,g,h,u);Oj(m,s,g,c)}function d(g,m){var y=l.getItemGraphicEl(m),_=f6e(s,g,h,u);s.setItemGraphicEl(g,y),ma(y,{shape:{points:_}},t,g),x0(y),Oj(y,s,g,c)}function v(g){var m=l.getItemGraphicEl(g);o.remove(m)}if(!this._initialized){this._initialized=!0;var p=Hxt(u,t,function(){setTimeout(function(){o.removeClipPath()})});o.setClipPath(p)}this._data=s},e.prototype.incrementalPrepareRender=function(t,r,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,r,i){for(var a=r.getData(),o=r.coordinateSystem,s=o.dimensions,l=Iye(r),u=this._progressiveEls=[],h=t.start;h<t.end;h++){var c=Mye(a,this._dataGroup,h,s,o);c.incremental=!0,Oj(c,a,h,l),u.push(c)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}(os);function Hxt(n,e,t){var r=n.model,i=n.getRect(),a=new ta({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),o=r.get("layout")==="horizontal"?"width":"height";return a.setShape(o,0),Is(a,{shape:{width:i.width,height:i.height}},e,t),a}function f6e(n,e,t,r){for(var i=[],a=0;a<t.length;a++){var o=t[a],s=n.get(n.mapDimension(o),e);jxt(s,r.getAxis(o).type)||i.push(r.dataToPoint(s,o))}return i}function Mye(n,e,t,r,i){var a=f6e(n,t,r,i),o=new Gd({shape:{points:a},z2:10});return e.add(o),n.setItemGraphicEl(t,o),o}function Iye(n){var e=n.get("smooth",!0);return e===!0&&(e=$xt),e=u_(e),eD(e)&&(e=0),{smooth:e}}function Oj(n,e,t,r){n.useStyle(e.getItemVisual(t,"style")),n.style.fill=null,n.setShape("smooth",r.smooth);var i=e.getItemModel(t),a=i.getModel("emphasis");dc(n,i,"lineStyle"),vl(n,a.get("focus"),a.get("blurScope"),a.get("disabled"))}function jxt(n,e){return e==="category"?n==null:n==null||isNaN(n)}const Xxt=Wxt;var Yxt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{useEncodeDefaulter:kr(qxt,null,this)})},e.prototype.getRawIndicesByActiveState=function(t){var r=this.coordinateSystem,i=this.getData(),a=[];return r.eachActiveState(i,function(o,s){t===o&&a.push(i.getRawIndex(s))}),a},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}(Ws);function qxt(n){var e=n.ecModel.getComponent("parallel",n.get("parallelIndex"));if(!!e){var t={};return te(e.dimensions,function(r){var i=Zxt(r);t[r]=i}),t}}function Zxt(n){return+n.replace("dim","")}const Kxt=Yxt;var Jxt=["lineStyle","opacity"],Qxt={seriesType:"parallel",reset:function(n,e){var t=n.coordinateSystem,r={normal:n.get(["lineStyle","opacity"]),active:n.get("activeOpacity"),inactive:n.get("inactiveOpacity")};return{progress:function(i,a){t.eachActiveState(a,function(o,s){var l=r[o];if(o==="normal"&&a.hasItemOption){var u=a.getItemModel(s).get(Jxt,!0);u!=null&&(l=u)}var h=a.ensureUniqueItemVisual(s,"style");h.opacity=l},i.start,i.end)}}}};const eSt=Qxt;function tSt(n){rSt(n),nSt(n)}function rSt(n){if(!n.parallel){var e=!1;te(n.series,function(t){t&&t.type==="parallel"&&(e=!0)}),e&&(n.parallel=[{}])}}function nSt(n){var e=Do(n.parallelAxis);te(e,function(t){if(!!dn(t)){var r=t.parallelIndex||0,i=Do(n.parallel)[r];i&&i.parallelAxisDefault&&ii(t,i.parallelAxisDefault,!1)}})}var iSt=5,aSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this._model=t,this._api=i,this._handlers||(this._handlers={},te(oSt,function(a,o){i.getZr().on(o,this._handlers[o]=kr(a,this))},this)),VI(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,r){dD(this,"_throttledDispatchExpand"),te(this._handlers,function(i,a){r.getZr().off(a,i)}),this._handlers=null},e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(Mt({type:"parallelAxisExpand"},t))},e.type="parallel",e}(pl),oSt={mousedown:function(n){Rj(this,"click")&&(this._mouseDownPoint=[n.offsetX,n.offsetY])},mouseup:function(n){var e=this._mouseDownPoint;if(Rj(this,"click")&&e){var t=[n.offsetX,n.offsetY],r=Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2);if(r>iSt)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(n){if(!(this._mouseDownPoint||!Rj(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([n.offsetX,n.offsetY]),r=t.behavior;r==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(r==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:r==="jump"?null:{duration:0}})}}};function Rj(n,e){var t=n._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}const sSt=aSt;var lSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){n.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var r=this.option;t&&ii(r,t,!0),this._initDimensions()},e.prototype.contains=function(t,r){var i=t.get("parallelIndex");return i!=null&&r.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){te(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(r){t.hasOwnProperty(r)&&(this.option[r]=t[r])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],r=this.parallelAxisIndex=[],i=To(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);te(i,function(a){t.push("dim"+a.get("dim")),r.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(oa);const uSt=lSt;var hSt=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this,t,r,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(D0);const cSt=hSt;function J2(n,e,t,r,i,a){n=n||0;var o=t[1]-t[0];if(i!=null&&(i=rC(i,[0,o])),a!=null&&(a=Math.max(a,i!=null?i:0)),r==="all"){var s=Math.abs(e[1]-e[0]);s=rC(s,[0,o]),i=a=rC(s,[i,a]),r=0}e[0]=rC(e[0],t),e[1]=rC(e[1],t);var l=Dj(e,r);e[r]+=n;var u=i||0,h=t.slice();l.sign<0?h[0]+=u:h[1]-=u,e[r]=rC(e[r],h);var c;return c=Dj(e,r),i!=null&&(c.sign!==l.sign||c.span<i)&&(e[1-r]=e[r]+l.sign*i),c=Dj(e,r),a!=null&&c.span>a&&(e[1-r]=e[r]+c.sign*a),e}function Dj(n,e){var t=n[e]-n[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function rC(n,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,n))}var Nj=te,d6e=Math.min,v6e=Math.max,Lye=Math.floor,fSt=Math.ceil,Pye=Pl,dSt=Math.PI,vSt=function(){function n(e,t,r){this.type="parallel",this._axesMap=$r(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,r)}return n.prototype._init=function(e,t,r){var i=e.dimensions,a=e.parallelAxisIndex;Nj(i,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),h=this._axesMap.set(o,new cSt(o,pU(u),[0,0],u.get("type"),l)),c=h.type==="category";h.onBand=c&&u.get("boundaryGap"),h.inverse=u.get("inverse"),u.axis=h,h.model=u,h.coordinateSystem=u.coordinateSystem=this},this)},n.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},n.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),r=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=r&&o<=r+t.axisLength&&s>=i&&s<=i+t.layoutLength},n.prototype.getModel=function(){return this._model},n.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(r){if(!!e.contains(r,t)){var i=r.getData();Nj(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),pM(o.scale,o.model)},this)}},this)},n.prototype.resize=function(e,t){this._rect=Uu(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},n.prototype.getRect=function(){return this._rect},n.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,r=["x","y"],i=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[i[o]],l=[0,s],u=this.dimensions.length,h=D4(e.get("axisExpandWidth"),l),c=D4(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,d=e.get("axisExpandWindow"),v;if(d)v=D4(d[1]-d[0],l),d[1]=d[0]+v;else{v=D4(h*(c-1),l);var p=e.get("axisExpandCenter")||Lye(u/2);d=[h*p-v/2],d[1]=d[0]+v}var g=(s-v)/(u-c);g<3&&(g=0);var m=[Lye(Pye(d[0]/h,1))+1,fSt(Pye(d[1]/h,1))-1],y=g/h*d[0];return{layout:a,pixelDimIndex:o,layoutBase:t[r[o]],layoutLength:s,axisBase:t[r[1-o]],axisLength:t[i[1-o]],axisExpandable:f,axisExpandWidth:h,axisCollapseWidth:g,axisExpandWindow:d,axisCount:u,winInnerIndices:m,axisExpandWindow0Pos:y}},n.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,r=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),Nj(r,function(o,s){var l=(i.axisExpandable?gSt:pSt)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},h={horizontal:dSt/2,vertical:0},c=[u[a].x+e.x,u[a].y+e.y],f=h[a],d=Up();j2(d,d,f),sm(d,d,c),this._axesLayout[o]={position:c,rotation:f,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},n.prototype.getAxis=function(e){return this._axesMap.get(e)},n.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},n.prototype.eachActiveState=function(e,t,r,i){r==null&&(r=0),i==null&&(i=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];te(o,function(g){s.push(e.mapDimension(g)),l.push(a.get(g).model)});for(var u=this.hasAxisBrushed(),h=r;h<i;h++){var c=void 0;if(!u)c="normal";else{c="active";for(var f=e.getValues(s,h),d=0,v=o.length;d<v;d++){var p=l[d].getActiveState(f[d]);if(p==="inactive"){c="inactive";break}}}t(c,h)}},n.prototype.hasAxisBrushed=function(){for(var e=this.dimensions,t=this._axesMap,r=!1,i=0,a=e.length;i<a;i++)t.get(e[i]).model.getActiveState()!=="normal"&&(r=!0);return r},n.prototype.axisCoordToPoint=function(e,t){var r=this._axesLayout[t];return u0([e,0],r.transform)},n.prototype.getAxisLayout=function(e){return Sn(this._axesLayout[e])},n.prototype.getSlidedAxisExpandWindow=function(e){var t=this._makeLayoutInfo(),r=t.pixelDimIndex,i=t.axisExpandWindow.slice(),a=i[1]-i[0],o=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:i};var s=e[r]-t.layoutBase-t.axisExpandWindow0Pos,l,u="slide",h=t.axisCollapseWidth,c=this._model.get("axisExpandSlideTriggerArea"),f=c[0]!=null;if(h)f&&h&&s<a*c[0]?(u="jump",l=s-a*c[2]):f&&h&&s>a*(1-c[0])?(u="jump",l=s-a*(1-c[2])):(l=s-a*c[1])>=0&&(l=s-a*(1-c[1]))<=0&&(l=0),l*=t.axisExpandWidth/h,l?J2(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[v6e(0,v-d/2)],i[1]=d6e(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},n}();function D4(n,e){return d6e(v6e(n,e[0]),e[1])}function pSt(n,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*n,axisNameAvailableWidth:t,axisLabelShow:!0}}function gSt(n,e){var t=e.layoutLength,r=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,h;return n<o[0]?(s=n*a,h=a):n<=o[1]?(s=e.axisExpandWindow0Pos+n*r-e.axisExpandWindow[0],l=r,u=!0):(s=t-(i-1-n)*a,h=a),{position:s,axisNameAvailableWidth:l,axisLabelShow:u,nameTruncateMaxWidth:h}}const ySt=vSt;function mSt(n,e){var t=[];return n.eachComponent("parallel",function(r,i){var a=new ySt(r,n,e);a.name="parallel_"+i,a.resize(r,e),r.coordinateSystem=a,a.model=r,t.push(a)}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="parallel"){var i=r.getReferringComponents("parallel",uu).models[0];r.coordinateSystem=i.coordinateSystem}}),t}var _St={create:mSt};const xSt=_St;var p6e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.activeIntervals=[],t}return e.prototype.getAreaSelectStyle=function(){return qE([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},e.prototype.setActiveIntervals=function(t){var r=this.activeIntervals=Sn(t);if(r)for(var i=r.length-1;i>=0;i--)Op(r[i])},e.prototype.getActiveState=function(t){var r=this.activeIntervals;if(!r.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(r.length===1){var i=r[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,o=r.length;a<o;a++)if(r[a][0]<=t&&t<=r[a][1])return"active";return"inactive"},e}(oa);gu(p6e,T3);const Oye=p6e;var JE=!0,ED=Math.min,mM=Math.max,SSt=Math.pow,wSt=1e4,bSt=6,ESt=6,Rye="globalPan",TSt={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},CSt={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},Dye={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},ASt=0,MSt=function(n){$e(e,n);function e(t){var r=n.call(this)||this;return r._track=[],r._covers=[],r._handlers={},r._zr=t,r.group=new Cn,r._uid="brushController_"+ASt++,te(NSt,function(i,a){this._handlers[a]=kr(i,this)},r),r}return e.prototype.enableBrush=function(t){return this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var r=this._zr;this._enableGlobalPan||Bmt(r,Rye,this._uid),te(this._handlers,function(i,a){r.on(a,i)}),this._brushType=t.brushType,this._brushOption=ii(Sn(Dye),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;Gmt(t,Rye,this._uid),te(this._handlers,function(r,i){t.off(i,r)}),this._brushType=this._brushOption=null},e.prototype.setPanels=function(t){if(t&&t.length){var r=this._panels={};te(t,function(i){r[i.panelId]=Sn(i)})}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var r=this.group;return this._zr.add(r),r.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=r.getLocalTransform(),this},e.prototype.updateCovers=function(t){t=Vt(t,function(f){return ii(Sn(Dye),f,!0)});var r="\0-brush-index-",i=this._covers,a=this._covers=[],o=this,s=this._creatingCover;return new f_(i,t,u,l).add(h).update(h).remove(c).execute(),this;function l(f,d){return(f.id!=null?f.id:r+d)+"-"+f.brushType}function u(f,d){return l(f.__brushOption,d)}function h(f,d){var v=t[f];if(d!=null&&i[d]===s)a[f]=i[d];else{var p=a[f]=d!=null?(i[d].__brushOption=v,i[d]):y6e(o,g6e(o,v));Mae(o,p)}}function c(f){i[f]!==s&&o.group.remove(i[f])}},e.prototype.unmount=function(){return this.enableBrush(!1),XJ(this),this._zr.remove(this.group),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(ng);function g6e(n,e){var t=wU[e.brushType].createCover(n,e);return t.__brushOption=e,_6e(t,e),n.group.add(t),t}function y6e(n,e){var t=Iae(e);return t.endCreating&&(t.endCreating(n,e),_6e(e,e.__brushOption)),e}function m6e(n,e){var t=e.__brushOption;Iae(e).updateCoverShape(n,e,t.range,t)}function _6e(n,e){var t=e.z;t==null&&(t=wSt),n.traverse(function(r){r.z=t,r.z2=t})}function Mae(n,e){Iae(e).updateCommon(n,e),m6e(n,e)}function Iae(n){return wU[n.__brushOption.brushType]}function Lae(n,e,t){var r=n._panels;if(!r)return JE;var i,a=n._transform;return te(r,function(o){o.isTargetByCursor(e,t,a)&&(i=o)}),i}function x6e(n,e){var t=n._panels;if(!t)return JE;var r=e.__brushOption.panelId;return r!=null?t[r]:JE}function XJ(n){var e=n._covers,t=e.length;return te(e,function(r){n.group.remove(r)},n),e.length=0,!!t}function QE(n,e){var t=Vt(n._covers,function(r){var i=r.__brushOption,a=Sn(i.range);return{brushType:i.brushType,panelId:i.panelId,range:a}});n.trigger("brush",{areas:t,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function ISt(n){var e=n._track;if(!e.length)return!1;var t=e[e.length-1],r=e[0],i=t[0]-r[0],a=t[1]-r[1],o=SSt(i*i+a*a,.5);return o>bSt}function S6e(n){var e=n.length-1;return e<0&&(e=0),[n[0],n[e]]}function w6e(n,e,t,r){var i=new Cn;return i.add(new ta({name:"main",style:Pae(t),silent:!0,draggable:!0,cursor:"move",drift:Un(Nye,n,e,i,["n","s","w","e"]),ondragend:Un(QE,e,{isEnd:!0})})),te(r,function(a){i.add(new ta({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Un(Nye,n,e,i,a),ondragend:Un(QE,e,{isEnd:!0})}))}),i}function b6e(n,e,t,r){var i=r.brushStyle.lineWidth||0,a=mM(i,ESt),o=t[0][0],s=t[1][0],l=o-i/2,u=s-i/2,h=t[0][1],c=t[1][1],f=h-a+i/2,d=c-a+i/2,v=h-o,p=c-s,g=v+i,m=p+i;Km(n,e,"main",o,s,v,p),r.transformable&&(Km(n,e,"w",l,u,a,m),Km(n,e,"e",f,u,a,m),Km(n,e,"n",l,u,g,a),Km(n,e,"s",l,d,g,a),Km(n,e,"nw",l,u,a,a),Km(n,e,"ne",f,u,a,a),Km(n,e,"sw",l,d,a,a),Km(n,e,"se",f,d,a,a))}function YJ(n,e){var t=e.__brushOption,r=t.transformable,i=e.childAt(0);i.useStyle(Pae(t)),i.attr({silent:!r,cursor:r?"move":"default"}),te([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?qJ(n,a[0]):PSt(n,a);o&&o.attr({silent:!r,invisible:!r,cursor:r?CSt[s]+"-resize":null})})}function Km(n,e,t,r,i,a,o){var s=e.childOfName(t);s&&s.setShape(RSt(Oae(n,e,[[r,i],[r+a,i+o]])))}function Pae(n){return sn({strokeNoScale:!0},n.brushStyle)}function E6e(n,e,t,r){var i=[ED(n,t),ED(e,r)],a=[mM(n,t),mM(e,r)];return[[i[0],a[0]],[i[1],a[1]]]}function LSt(n){return AE(n.group)}function qJ(n,e){var t={w:"left",e:"right",n:"top",s:"bottom"},r={left:"w",right:"e",top:"n",bottom:"s"},i=eU(t[e],LSt(n));return r[i]}function PSt(n,e){var t=[qJ(n,e[0]),qJ(n,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function Nye(n,e,t,r,i,a){var o=t.__brushOption,s=n.toRectRange(o.range),l=T6e(e,i,a);te(r,function(u){var h=TSt[u];s[h[0]][h[1]]+=l[h[0]]}),o.range=n.fromRectRange(E6e(s[0][0],s[1][0],s[0][1],s[1][1])),Mae(e,t),QE(e,{isEnd:!1})}function OSt(n,e,t,r){var i=e.__brushOption.range,a=T6e(n,t,r);te(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Mae(n,e),QE(n,{isEnd:!1})}function T6e(n,e,t){var r=n.group,i=r.transformCoordToLocal(e,t),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function Oae(n,e,t){var r=x6e(n,e);return r&&r!==JE?r.clipPath(t,n._transform):Sn(t)}function RSt(n){var e=ED(n[0][0],n[1][0]),t=ED(n[0][1],n[1][1]),r=mM(n[0][0],n[1][0]),i=mM(n[0][1],n[1][1]);return{x:e,y:t,width:r-e,height:i-t}}function DSt(n,e,t){if(!(!n._brushType||kSt(n,e.offsetX,e.offsetY))){var r=n._zr,i=n._covers,a=Lae(n,e,t);if(!n._dragging)for(var o=0;o<i.length;o++){var s=i[o].__brushOption;if(a&&(a===JE||s.panelId===a.panelId)&&wU[s.brushType].contain(i[o],t[0],t[1]))return}a&&r.setCursorStyle("crosshair")}}function ZJ(n){var e=n.event;e.preventDefault&&e.preventDefault()}function KJ(n,e,t){return n.childOfName("main").contain(e,t)}function C6e(n,e,t,r){var i=n._creatingCover,a=n._creatingPanel,o=n._brushOption,s;if(n._track.push(t.slice()),ISt(n)||i){if(a&&!i){o.brushMode==="single"&&XJ(n);var l=Sn(o);l.brushType=kye(l.brushType,a),l.panelId=a===JE?null:a.panelId,i=n._creatingCover=g6e(n,l),n._covers.push(i)}if(i){var u=wU[kye(n._brushType,a)],h=i.__brushOption;h.range=u.getCreatingRange(Oae(n,i,n._track)),r&&(y6e(n,i),u.updateCommon(n,i)),m6e(n,i),s={isEnd:r}}}else r&&o.brushMode==="single"&&o.removeOnClick&&Lae(n,e,t)&&XJ(n)&&(s={isEnd:r,removeOnClick:!0});return s}function kye(n,e){return n==="auto"?e.defaultBrushType:n}var NSt={mousedown:function(n){if(this._dragging)Fye(this,n);else if(!n.target||!n.target.draggable){ZJ(n);var e=this.group.transformCoordToLocal(n.offsetX,n.offsetY);this._creatingCover=null;var t=this._creatingPanel=Lae(this,n,e);t&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(n){var e=n.offsetX,t=n.offsetY,r=this.group.transformCoordToLocal(e,t);if(DSt(this,n,r),this._dragging){ZJ(n);var i=C6e(this,n,r,!1);i&&QE(this,i)}},mouseup:function(n){Fye(this,n)}};function Fye(n,e){if(n._dragging){ZJ(e);var t=e.offsetX,r=e.offsetY,i=n.group.transformCoordToLocal(t,r),a=C6e(n,e,i,!0);n._dragging=!1,n._track=[],n._creatingCover=null,a&&QE(n,a)}}function kSt(n,e,t){var r=n._zr;return e<0||e>r.getWidth()||t<0||t>r.getHeight()}var wU={lineX:Bye(0),lineY:Bye(1),rect:{createCover:function(n,e){function t(r){return r}return w6e({toRectRange:t,fromRectRange:t},n,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(n){var e=S6e(n);return E6e(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(n,e,t,r){b6e(n,e,t,r)},updateCommon:YJ,contain:KJ},polygon:{createCover:function(n,e){var t=new Cn;return t.add(new Gd({name:"main",style:Pae(e),silent:!0})),t},getCreatingRange:function(n){return n},endCreating:function(n,e){e.remove(e.childAt(0)),e.add(new bd({name:"main",draggable:!0,drift:Un(OSt,n,e),ondragend:Un(QE,n,{isEnd:!0})}))},updateCoverShape:function(n,e,t,r){e.childAt(0).setShape({points:Oae(n,e,t)})},updateCommon:YJ,contain:KJ}};function Bye(n){return{createCover:function(e,t){return w6e({toRectRange:function(r){var i=[r,[0,100]];return n&&i.reverse(),i},fromRectRange:function(r){return r[n]}},e,t,[[["w"],["e"]],[["n"],["s"]]][n])},getCreatingRange:function(e){var t=S6e(e),r=ED(t[0][n],t[1][n]),i=mM(t[0][n],t[1][n]);return[r,i]},updateCoverShape:function(e,t,r,i){var a,o=x6e(e,t);if(o!==JE&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(n);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-n]]}var l=[r,a];n&&l.reverse(),b6e(e,t,l,i)},updateCommon:YJ,contain:KJ}}const Rae=MSt;function A6e(n){return n=Dae(n),function(e){return Lke(e,n)}}function M6e(n,e){return n=Dae(n),function(t){var r=e!=null?e:t,i=r?n.width:n.height,a=r?n.x:n.y;return[a,a+(i||0)]}}function I6e(n,e,t){var r=Dae(n);return function(i,a){return r.contain(a[0],a[1])&&!mU(i,e,t)}}function Dae(n){return ai.create(n)}var FSt=["axisLine","axisTickLabel","axisName"],BSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){n.prototype.init.apply(this,arguments),(this._brushController=new Rae(r.getZr())).on("brush",kr(this._onBrush,this))},e.prototype.render=function(t,r,i,a){if(!GSt(t,r,a)){this.axisModel=t,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Cn,this.group.add(this._axisGroup),!!t.get("show")){var s=USt(t,r),l=s.coordinateSystem,u=t.getAreaSelectStyle(),h=u.width,c=t.axis.dim,f=l.getAxisLayout(c),d=Mt({strokeContainThreshold:h},f),v=new d_(t,d);te(FSt,v.add,v),this._axisGroup.add(v.getGroup()),this._refreshBrushController(d,u,t,s,h,i),m3(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,r,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),c=ai.create({x:l[0],y:-o/2,width:u,height:o});c.x-=h,c.width+=2*h,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:A6e(c),isTargetByCursor:I6e(c,s,a),getLinearBrushOtherExtent:M6e(c,0)}]).enableBrush({brushType:"lineX",brushStyle:r,removeOnClick:!0}).updateCovers(zSt(i))},e.prototype._onBrush=function(t){var r=t.areas,i=this.axisModel,a=i.axis,o=Vt(r,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(pl);function GSt(n,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===n}function zSt(n){var e=n.axis;return Vt(n.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function USt(n,e){return e.getComponent("parallel",n.get("parallelIndex"))}const VSt=BSt;var $St={type:"axisAreaSelect",event:"axisAreaSelected"};function WSt(n){n.registerAction($St,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(r){r.axis.model.setActiveIntervals(e.intervals)})}),n.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(r){r.setAxisExpand(e)})})}var HSt={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function L6e(n){n.registerComponentView(sSt),n.registerComponentModel(uSt),n.registerCoordinateSystem("parallel",xSt),n.registerPreprocessor(tSt),n.registerComponentModel(Oye),n.registerComponentView(VSt),yM(n,"parallel",Oye,HSt),WSt(n)}function jSt(n){_i(L6e),n.registerChartView(Xxt),n.registerSeriesModel(Kxt),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,eSt)}var XSt=function(){function n(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return n}(),YSt=function(n){$e(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new XSt},e.prototype.buildPath=function(t,r){var i=r.extent;t.moveTo(r.x1,r.y1),t.bezierCurveTo(r.cpx1,r.cpy1,r.cpx2,r.cpy2,r.x2,r.y2),r.orient==="vertical"?(t.lineTo(r.x2+i,r.y2),t.bezierCurveTo(r.cpx2+i,r.cpy2,r.cpx1+i,r.cpy1,r.x1+i,r.y1)):(t.lineTo(r.x2,r.y2+i),t.bezierCurveTo(r.cpx2,r.cpy2+i,r.cpx1,r.cpy1+i,r.x1,r.y1+i)),t.closePath()},e.prototype.highlight=function(){h_(this)},e.prototype.downplay=function(){c_(this)},e}(Si),qSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,r,i){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,h=l.height,c=t.getData(),f=t.getData("edge"),d=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(v){var p=new YSt,g=Bn(p);g.dataIndex=v.dataIndex,g.seriesIndex=t.seriesIndex,g.dataType="edge";var m=v.getModel(),y=m.getModel("lineStyle"),_=y.get("curveness"),x=v.node1.getLayout(),S=v.node1.getModel(),w=S.get("localX"),b=S.get("localY"),E=v.node2.getLayout(),T=v.node2.getModel(),C=T.get("localX"),A=T.get("localY"),M=v.getLayout(),I,R,k,D,G,W,z,V;p.shape.extent=Math.max(1,M.dy),p.shape.orient=d,d==="vertical"?(I=(w!=null?w*u:x.x)+M.sy,R=(b!=null?b*h:x.y)+x.dy,k=(C!=null?C*u:E.x)+M.ty,D=A!=null?A*h:E.y,G=I,W=R*(1-_)+D*_,z=k,V=R*_+D*(1-_)):(I=(w!=null?w*u:x.x)+x.dx,R=(b!=null?b*h:x.y)+M.sy,k=C!=null?C*u:E.x,D=(A!=null?A*h:E.y)+M.ty,G=I*(1-_)+k*_,W=R,z=I*_+k*(1-_),V=D),p.setShape({x1:I,y1:R,x2:k,y2:D,cpx1:G,cpy1:W,cpx2:z,cpy2:V}),p.useStyle(y.getItemStyle()),Gye(p.style,d,v);var q=""+m.get("value"),Y=hh(m,"edgeLabel");vc(p,Y,{labelFetcher:{getFormattedLabel:function(Q,ie,oe,se,me,Ce){return t.getFormattedLabel(Q,ie,"edge",se,qy(me,Y.normal&&Y.normal.get("formatter"),q),Ce)}},labelDataIndex:v.dataIndex,defaultText:q}),p.setTextConfig({position:"inside"});var le=m.getModel("emphasis");dc(p,m,"lineStyle",function(Q){var ie=Q.getItemStyle();return Gye(ie,d,v),ie}),s.add(p),f.setItemGraphicEl(v.dataIndex,p);var j=le.get("focus");vl(p,j==="adjacency"?v.getAdjacentDataIndices():j==="trajectory"?v.getTrajectoryDataIndices():j,le.get("blurScope"),le.get("disabled"))}),o.eachNode(function(v){var p=v.getLayout(),g=v.getModel(),m=g.get("localX"),y=g.get("localY"),_=g.getModel("emphasis"),x=new ta({shape:{x:m!=null?m*u:p.x,y:y!=null?y*h:p.y,width:p.dx,height:p.dy},style:g.getModel("itemStyle").getItemStyle(),z2:10});vc(x,hh(g),{labelFetcher:{getFormattedLabel:function(w,b){return t.getFormattedLabel(w,b,"node")}},labelDataIndex:v.dataIndex,defaultText:v.id}),x.disableLabelAnimation=!0,x.setStyle("fill",v.getVisual("color")),x.setStyle("decal",v.getVisual("style").decal),dc(x,g),s.add(x),c.setItemGraphicEl(v.dataIndex,x),Bn(x).dataType="node";var S=_.get("focus");vl(x,S==="adjacency"?v.getAdjacentDataIndices():S==="trajectory"?v.getTrajectoryDataIndices():S,_.get("blurScope"),_.get("disabled"))}),c.eachItemGraphicEl(function(v,p){var g=c.getItemModel(p);g.get("draggable")&&(v.drift=function(m,y){a._focusAdjacencyDisabled=!0,this.shape.x+=m,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:c.getRawIndex(p),localX:this.shape.x/u,localY:this.shape.y/h})},v.ondragend=function(){a._focusAdjacencyDisabled=!1},v.draggable=!0,v.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(ZSt(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(os);function Gye(n,e,t){switch(n.fill){case"source":n.fill=t.node1.getVisual("color"),n.decal=t.node1.getVisual("style").decal;break;case"target":n.fill=t.node2.getVisual("color"),n.decal=t.node2.getVisual("style").decal;break;case"gradient":var r=t.node1.getVisual("color"),i=t.node2.getVisual("color");Or(r)&&Or(i)&&(n.fill=new y3(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:r,offset:0},{color:i,offset:1}]))}}function ZSt(n,e,t){var r=new ta({shape:{x:n.x-10,y:n.y-10,width:0,height:n.height+20}});return Is(r,{shape:{width:n.width+20}},e,t),r}const KSt=qSt;var JSt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){var i=t.edges||t.links,a=t.data||t.nodes,o=t.levels;this.levelModels=[];for(var s=this.levelModels,l=0;l<o.length;l++)o[l].depth!=null&&o[l].depth>=0&&(s[o[l].depth]=new as(o[l],this,r));if(a&&i){var u=c6e(a,i,this,!0,h);return u.data}function h(c,f){c.wrapMethod("getItemModel",function(d,v){var p=d.parentModel,g=p.getData().getItemLayout(v);if(g){var m=g.depth,y=p.levelModels[m];y&&(d.parentModel=y)}return d}),f.wrapMethod("getItemModel",function(d,v){var p=d.parentModel,g=p.getGraph().getEdgeByIndex(v),m=g.node1.getLayout();if(m){var y=m.depth,_=p.levelModels[y];_&&(d.parentModel=_)}return d})}},e.prototype.setNodePosition=function(t,r){var i=this.option.data||this.option.nodes,a=i[t];a.localX=r[0],a.localY=r[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,r,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(t,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return ch("nameValue",{name:u,value:l,noValue:a(l)})}else{var h=this.getGraph().getNodeByIndex(t),c=h.getLayout().value,f=this.getDataParams(t,i).data.name;return ch("nameValue",{name:f!=null?f+"":null,value:c,noValue:a(c)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,r){var i=n.prototype.getDataParams.call(this,t,r);if(i.value==null&&r==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(Ws);const QSt=JSt;function ewt(n,e){n.eachSeriesByType("sankey",function(t){var r=t.get("nodeWidth"),i=t.get("nodeGap"),a=twt(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,h=l.edges;nwt(u);var c=To(u,function(p){return p.getLayout().value===0}),f=c.length!==0?0:t.get("layoutIterations"),d=t.get("orient"),v=t.get("nodeAlign");rwt(u,h,r,i,o,s,f,d,v)})}function twt(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function rwt(n,e,t,r,i,a,o,s,l){iwt(n,e,t,i,a,s,l),lwt(n,e,a,i,r,o,s),ywt(n,s)}function nwt(n){te(n,function(e){var t=xS(e.outEdges,RG),r=xS(e.inEdges,RG),i=e.getValue()||0,a=Math.max(t,r,i);e.setLayout({value:a},!0)})}function iwt(n,e,t,r,i,a,o){for(var s=[],l=[],u=[],h=[],c=0,f=0;f<e.length;f++)s[f]=1;for(var f=0;f<n.length;f++)l[f]=n[f].inEdges.length,l[f]===0&&u.push(n[f]);for(var d=-1;u.length;){for(var v=0;v<u.length;v++){var p=u[v],g=p.hostGraph.data.getRawDataItem(p.dataIndex),m=g.depth!=null&&g.depth>=0;m&&g.depth>d&&(d=g.depth),p.setLayout({depth:m?g.depth:c},!0),a==="vertical"?p.setLayout({dy:t},!0):p.setLayout({dx:t},!0);for(var y=0;y<p.outEdges.length;y++){var _=p.outEdges[y],x=e.indexOf(_);s[x]=0;var S=_.node2,w=n.indexOf(S);--l[w]===0&&h.indexOf(S)<0&&h.push(S)}}++c,u=h,h=[]}for(var f=0;f<s.length;f++)if(s[f]===1)throw new Error("Sankey is a DAG, the original data has cycle!");var b=d>c-1?d:c-1;o&&o!=="left"&&awt(n,o,a,b);var E=a==="vertical"?(i-t)/b:(r-t)/b;swt(n,E,a)}function P6e(n){var e=n.hostGraph.data.getRawDataItem(n.dataIndex);return e.depth!=null&&e.depth>=0}function awt(n,e,t,r){if(e==="right"){for(var i=[],a=n,o=0;a.length;){for(var s=0;s<a.length;s++){var l=a[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];i.indexOf(h.node1)<0&&i.push(h.node1)}}a=i,i=[],++o}te(n,function(c){P6e(c)||c.setLayout({depth:Math.max(0,r-c.getLayout().skNodeHeight)},!0)})}else e==="justify"&&owt(n,r)}function owt(n,e){te(n,function(t){!P6e(t)&&!t.outEdges.length&&t.setLayout({depth:e},!0)})}function swt(n,e,t){te(n,function(r){var i=r.getLayout().depth*e;t==="vertical"?r.setLayout({y:i},!0):r.setLayout({x:i},!0)})}function lwt(n,e,t,r,i,a,o){var s=uwt(n,o);hwt(s,e,t,r,i,o),kj(s,i,t,r,o);for(var l=1;a>0;a--)l*=.99,cwt(s,l,o),kj(s,i,t,r,o),gwt(s,l,o),kj(s,i,t,r,o)}function uwt(n,e){var t=[],r=e==="vertical"?"y":"x",i=eJ(n,function(a){return a.getLayout()[r]});return i.keys.sort(function(a,o){return a-o}),te(i.keys,function(a){t.push(i.buckets.get(a))}),t}function hwt(n,e,t,r,i,a){var o=1/0;te(n,function(s){var l=s.length,u=0;te(s,function(c){u+=c.getLayout().value});var h=a==="vertical"?(r-(l-1)*i)/u:(t-(l-1)*i)/u;h<o&&(o=h)}),te(n,function(s){te(s,function(l,u){var h=l.getLayout().value*o;a==="vertical"?(l.setLayout({x:u},!0),l.setLayout({dx:h},!0)):(l.setLayout({y:u},!0),l.setLayout({dy:h},!0))})}),te(e,function(s){var l=+s.getValue()*o;s.setLayout({dy:l},!0)})}function kj(n,e,t,r,i){var a=i==="vertical"?"x":"y";te(n,function(o){o.sort(function(p,g){return p.getLayout()[a]-g.getLayout()[a]});for(var s,l,u,h=0,c=o.length,f=i==="vertical"?"dx":"dy",d=0;d<c;d++)l=o[d],u=h-l.getLayout()[a],u>0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]+l.getLayout()[f]+e;var v=i==="vertical"?r:t;if(u=h-e-v,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),h=s;for(var d=c-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[f]+e-h,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]}})}function cwt(n,e,t){te(n.slice().reverse(),function(r){te(r,function(i){if(i.outEdges.length){var a=xS(i.outEdges,fwt,t)/xS(i.outEdges,RG);if(isNaN(a)){var o=i.outEdges.length;a=o?xS(i.outEdges,dwt,t)/o:0}if(t==="vertical"){var s=i.getLayout().x+(a-GS(i,t))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-GS(i,t))*e;i.setLayout({y:l},!0)}}})})}function fwt(n,e){return GS(n.node2,e)*n.getValue()}function dwt(n,e){return GS(n.node2,e)}function vwt(n,e){return GS(n.node1,e)*n.getValue()}function pwt(n,e){return GS(n.node1,e)}function GS(n,e){return e==="vertical"?n.getLayout().x+n.getLayout().dx/2:n.getLayout().y+n.getLayout().dy/2}function RG(n){return n.getValue()}function xS(n,e,t){for(var r=0,i=n.length,a=-1;++a<i;){var o=+e(n[a],t);isNaN(o)||(r+=o)}return r}function gwt(n,e,t){te(n,function(r){te(r,function(i){if(i.inEdges.length){var a=xS(i.inEdges,vwt,t)/xS(i.inEdges,RG);if(isNaN(a)){var o=i.inEdges.length;a=o?xS(i.inEdges,pwt,t)/o:0}if(t==="vertical"){var s=i.getLayout().x+(a-GS(i,t))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-GS(i,t))*e;i.setLayout({y:l},!0)}}})})}function ywt(n,e){var t=e==="vertical"?"x":"y";te(n,function(r){r.outEdges.sort(function(i,a){return i.node2.getLayout()[t]-a.node2.getLayout()[t]}),r.inEdges.sort(function(i,a){return i.node1.getLayout()[t]-a.node1.getLayout()[t]})}),te(n,function(r){var i=0,a=0;te(r.outEdges,function(o){o.setLayout({sy:i},!0),i+=o.getLayout().dy}),te(r.inEdges,function(o){o.setLayout({ty:a},!0),a+=o.getLayout().dy})})}function mwt(n){n.eachSeriesByType("sankey",function(e){var t=e.getGraph(),r=t.nodes,i=t.edges;if(r.length){var a=1/0,o=-1/0;te(r,function(s){var l=s.getLayout().value;l<a&&(a=l),l>o&&(o=l)}),te(r,function(s){var l=new fc({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),h=s.getModel().get(["itemStyle","color"]);h!=null?(s.setVisual("color",h),s.setVisual("style",{fill:h})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&te(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function _wt(n){n.registerChartView(KSt),n.registerSeriesModel(QSt),n.registerLayout(ewt),n.registerVisual(mwt),n.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(r){r.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var O6e=function(){function n(){}return n.prototype.getInitialData=function(e,t){var r,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",r=i.getOrdinalMeta(),l=!0):s==="category"?(e.layout="vertical",r=a.getOrdinalMeta(),l=!0):e.layout=e.layout||"horizontal";var u=["x","y"],h=e.layout==="horizontal"?0:1,c=this._baseAxisDim=u[h],f=u[1-h],d=[i,a],v=d[h].get("type"),p=d[1-h].get("type"),g=e.data;if(g&&l){var m=[];te(g,function(x,S){var w;Gt(x)?(w=x.slice(),x.unshift(S)):Gt(x.value)?(w=Mt({},x),w.value=w.value.slice(),x.value.unshift(S)):w=x,m.push(w)}),e.data=m}var y=this.defaultValueDimensions,_=[{name:c,type:SG(v),ordinalMeta:r,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:f,type:SG(p),dimsDef:y.slice()}];return WI(this,{coordDimensions:_,dimensionsCount:y.length+1,encodeDefaulter:Un(nFe,_,this)})},n.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},n}(),R6e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(Ws);gu(R6e,O6e,!0);const xwt=R6e;var Swt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var h=a.getItemLayout(u),c=zye(h,a,u,l,!0);a.setItemGraphicEl(u,c),o.add(c)}}).update(function(u,h){var c=s.getItemGraphicEl(h);if(!a.hasValue(u)){o.remove(c);return}var f=a.getItemLayout(u);c?(x0(c),D6e(f,c,a,u)):c=zye(f,a,u,l),o.add(c),a.setItemGraphicEl(u,c)}).remove(function(u){var h=s.getItemGraphicEl(u);h&&o.remove(h)}).execute(),this._data=a},e.prototype.remove=function(t){var r=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&r.remove(a)})},e.type="boxplot",e}(os),wwt=function(){function n(){}return n}(),bwt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="boxplotBoxPath",r}return e.prototype.getDefaultShape=function(){return new wwt},e.prototype.buildPath=function(t,r){var i=r.points,a=0;for(t.moveTo(i[a][0],i[a][1]),a++;a<4;a++)t.lineTo(i[a][0],i[a][1]);for(t.closePath();a<i.length;a++)t.moveTo(i[a][0],i[a][1]),a++,t.lineTo(i[a][0],i[a][1])},e}(Si);function zye(n,e,t,r,i){var a=n.ends,o=new bwt({shape:{points:i?Ewt(a,r,n):a}});return D6e(n,o,e,t,i),o}function D6e(n,e,t,r,i){var a=t.hostModel,o=x3[i?"initProps":"updateProps"];o(e,{shape:{points:n.ends}},a,r),e.useStyle(t.getItemVisual(r,"style")),e.style.strokeNoScale=!0,e.z2=100;var s=t.getItemModel(r),l=s.getModel("emphasis");dc(e,s),vl(e,l.get("focus"),l.get("blurScope"),l.get("disabled"))}function Ewt(n,e,t){return Vt(n,function(r){return r=r.slice(),r[e]=t.initBaseline,r})}const Twt=Swt;var nR=te;function Cwt(n){var e=Awt(n);nR(e,function(t){var r=t.seriesModels;!r.length||(Mwt(t),nR(r,function(i,a){Iwt(i,t.boxOffsetList[a],t.boxWidthList[a])}))})}function Awt(n){var e=[],t=[];return n.eachSeriesByType("boxplot",function(r){var i=r.getBaseAxis(),a=gi(t,i);a<0&&(a=t.length,t[a]=i,e[a]={axis:i,seriesModels:[]}),e[a].seriesModels.push(r)}),e}function Mwt(n){var e=n.axis,t=n.seriesModels,r=t.length,i=n.boxWidthList=[],a=n.boxOffsetList=[],o=[],s;if(e.type==="category")s=e.getBandWidth();else{var l=0;nR(t,function(v){l=Math.max(l,v.getData().count())});var u=e.getExtent();s=Math.abs(u[1]-u[0])/l}nR(t,function(v){var p=v.get("boxWidth");Gt(p)||(p=[p,p]),o.push([xr(p[0],s)||0,xr(p[1],s)||0])});var h=s*.8-2,c=h/r*.3,f=(h-c*(r-1))/r,d=f/2-h/2;nR(t,function(v,p){a.push(d),d+=c+f,i.push(Math.min(Math.max(f,o[p][0]),o[p][1]))})}function Iwt(n,e,t){var r=n.coordinateSystem,i=n.getData(),a=t/2,o=n.get("layout")==="horizontal"?0:1,s=1-o,l=["x","y"],u=i.mapDimension(l[o]),h=i.mapDimensionsAll(l[s]);if(u==null||h.length<5)return;for(var c=0;c<i.count();c++){var f=i.get(u,c),d=_(f,h[2],c),v=_(f,h[0],c),p=_(f,h[1],c),g=_(f,h[3],c),m=_(f,h[4],c),y=[];x(y,p,!1),x(y,g,!0),y.push(v,p,m,g),S(y,v),S(y,m),S(y,d),i.setItemLayout(c,{initBaseline:d[s],ends:y})}function _(w,b,E){var T=i.get(b,E),C=[];C[o]=w,C[s]=T;var A;return isNaN(w)||isNaN(T)?A=[NaN,NaN]:(A=r.dataToPoint(C),A[o]+=e),A}function x(w,b,E){var T=b.slice(),C=b.slice();T[o]+=a,C[o]-=a,E?w.push(T,C):w.push(C,T)}function S(w,b){var E=b.slice(),T=b.slice();E[o]-=a,T[o]+=a,w.push(E,T)}}function Lwt(n,e){e=e||{};for(var t=[],r=[],i=e.boundIQR,a=i==="none"||i===0,o=0;o<n.length;o++){var s=Op(n[o].slice()),l=fH(s,.25),u=fH(s,.5),h=fH(s,.75),c=s[0],f=s[s.length-1],d=(i==null?1.5:i)*(h-l),v=a?c:Math.max(c,l-d),p=a?f:Math.min(f,h+d),g=e.itemNameFormatter,m=rn(g)?g({value:o}):Or(g)?g.replace("{value}",o+""):o+"";t.push([m,v,l,u,h,p]);for(var y=0;y<s.length;y++){var _=s[y];if(_<v||_>p){var x=[m,_];r.push(x)}}}return{boxData:t,outliers:r}}var Pwt={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==qc){var r="";ao(r)}var i=Lwt(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Owt(n){n.registerSeriesModel(xwt),n.registerChartView(Twt),n.registerLayout(Cwt),n.registerTransform(Pwt)}var Rwt=["color","borderColor"],Dwt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,r,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,r,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,r):this._incrementalRenderNormal(t,r)},e.prototype.eachRendered=function(t){_w(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;(this._isLargeDraw==null||r!==this._isLargeDraw)&&(this._isLargeDraw=r,this._clear())},e.prototype._renderNormal=function(t){var r=t.getData(),i=this._data,a=this.group,o=r.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),r.diff(i).add(function(h){if(r.hasValue(h)){var c=r.getItemLayout(h);if(s&&Uye(u,c))return;var f=Fj(c,h,!0);Is(f,{shape:{points:c.ends}},t,h),Bj(f,r,h,o),a.add(f),r.setItemGraphicEl(h,f)}}).update(function(h,c){var f=i.getItemGraphicEl(c);if(!r.hasValue(h)){a.remove(f);return}var d=r.getItemLayout(h);if(s&&Uye(u,d)){a.remove(f);return}f?(ma(f,{shape:{points:d.ends}},t,h),x0(f)):f=Fj(d),Bj(f,r,h,o),a.add(f),r.setItemGraphicEl(h,f)}).remove(function(h){var c=i.getItemGraphicEl(h);c&&a.remove(c)}).execute(),this._data=r},e.prototype._renderLarge=function(t){this._clear(),Vye(t,this.group);var r=t.get("clip",!0)?yU(t.coordinateSystem,!1,t):null;r?this.group.setClipPath(r):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,r){for(var i=r.getData(),a=i.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=i.getItemLayout(o),l=Fj(s);Bj(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,r){Vye(r,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(os),Nwt=function(){function n(){}return n}(),kwt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="normalCandlestickBox",r}return e.prototype.getDefaultShape=function(){return new Nwt},e.prototype.buildPath=function(t,r){var i=r.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))},e}(Si);function Fj(n,e,t){var r=n.ends;return new kwt({shape:{points:t?Fwt(r,n):r},z2:100})}function Uye(n,e){for(var t=!0,r=0;r<e.ends.length;r++)if(n.contain(e.ends[r][0],e.ends[r][1])){t=!1;break}return t}function Bj(n,e,t,r){var i=e.getItemModel(t);n.useStyle(e.getItemVisual(t,"style")),n.style.strokeNoScale=!0,n.__simpleBox=r,dc(n,i)}function Fwt(n,e){return Vt(n,function(t){return t=t.slice(),t[1]=e.initBaseline,t})}var Bwt=function(){function n(){}return n}(),Gj=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r.type="largeCandlestickBox",r}return e.prototype.getDefaultShape=function(){return new Bwt},e.prototype.buildPath=function(t,r){for(var i=r.points,a=0;a<i.length;)if(this.__sign===i[a++]){var o=i[a++];t.moveTo(o,i[a++]),t.lineTo(o,i[a++])}else a+=3},e}(Si);function Vye(n,e,t,r){var i=n.getData(),a=i.getLayout("largePoints"),o=new Gj({shape:{points:a},__sign:1,ignoreCoarsePointer:!0});e.add(o);var s=new Gj({shape:{points:a},__sign:-1,ignoreCoarsePointer:!0});e.add(s);var l=new Gj({shape:{points:a},__sign:0,ignoreCoarsePointer:!0});e.add(l),zj(1,o,n),zj(-1,s,n),zj(0,l,n),r&&(o.incremental=!0,s.incremental=!0),t&&t.push(o,s)}function zj(n,e,t,r){var i=t.get(["itemStyle",n>0?"borderColor":"borderColor0"])||t.get(["itemStyle",n>0?"color":"color0"]);n===0&&(i=t.get(["itemStyle","borderColorDoji"]));var a=t.getModel("itemStyle").getItemStyle(Rwt);e.useStyle(a),e.style.fill=null,e.style.stroke=i}const Gwt=Dwt;var N6e=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],t}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,r,i){var a=r.getItemLayout(t);return a&&i.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Ws);gu(N6e,O6e,!0);const zwt=N6e;function Uwt(n){!n||!Gt(n.series)||te(n.series,function(e){dn(e)&&e.type==="k"&&(e.type="candlestick")})}var Vwt=["itemStyle","borderColor"],$wt=["itemStyle","borderColor0"],Wwt=["itemStyle","borderColorDoji"],Hwt=["itemStyle","color"],jwt=["itemStyle","color0"],Xwt={seriesType:"candlestick",plan:UI(),performRawSeries:!0,reset:function(n,e){function t(a,o){return o.get(a>0?Hwt:jwt)}function r(a,o){return o.get(a===0?Wwt:a>0?Vwt:$wt)}if(!e.isSeriesFiltered(n)){var i=n.pipelineContext.large;return!i&&{progress:function(a,o){for(var s;(s=a.next())!=null;){var l=o.getItemModel(s),u=o.getItemLayout(s).sign,h=l.getItemStyle();h.fill=t(u,l),h.stroke=r(u,l)||h.fill;var c=o.ensureUniqueItemVisual(s,"style");Mt(c,h)}}}}}};const Ywt=Xwt;var qwt={seriesType:"candlestick",plan:UI(),reset:function(n){var e=n.coordinateSystem,t=n.getData(),r=Zwt(n,t),i=0,a=1,o=["x","y"],s=t.getDimensionIndex(t.mapDimension(o[i])),l=Vt(t.mapDimensionsAll(o[a]),t.getDimensionIndex,t),u=l[0],h=l[1],c=l[2],f=l[3];if(t.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),s<0||l.length<4)return;return{progress:n.pipelineContext.large?v:d};function d(p,g){for(var m,y=g.getStore();(m=p.next())!=null;){var _=y.get(s,m),x=y.get(u,m),S=y.get(h,m),w=y.get(c,m),b=y.get(f,m),E=Math.min(x,S),T=Math.max(x,S),C=G(E,_),A=G(T,_),M=G(w,_),I=G(b,_),R=[];W(R,A,0),W(R,C,1),R.push(V(I),V(A),V(M),V(C));var k=g.getItemModel(m),D=!!k.get(["itemStyle","borderColorDoji"]);g.setItemLayout(m,{sign:$ye(y,m,x,S,h,D),initBaseline:x>S?A[a]:C[a],ends:R,brushRect:z(w,b,_)})}function G(q,Y){var le=[];return le[i]=Y,le[a]=q,isNaN(Y)||isNaN(q)?[NaN,NaN]:e.dataToPoint(le)}function W(q,Y,le){var j=Y.slice(),Q=Y.slice();j[i]=MB(j[i]+r/2,1,!1),Q[i]=MB(Q[i]-r/2,1,!0),le?q.push(j,Q):q.push(Q,j)}function z(q,Y,le){var j=G(q,le),Q=G(Y,le);return j[i]-=r/2,Q[i]-=r/2,{x:j[0],y:j[1],width:r,height:Q[1]-j[1]}}function V(q){return q[i]=MB(q[i],1),q}}function v(p,g){for(var m=Fy(p.count*4),y=0,_,x=[],S=[],w,b=g.getStore(),E=!!n.get(["itemStyle","borderColorDoji"]);(w=p.next())!=null;){var T=b.get(s,w),C=b.get(u,w),A=b.get(h,w),M=b.get(c,w),I=b.get(f,w);if(isNaN(T)||isNaN(M)||isNaN(I)){m[y++]=NaN,y+=3;continue}m[y++]=$ye(b,w,C,A,h,E),x[i]=T,x[a]=M,_=e.dataToPoint(x,null,S),m[y++]=_?_[0]:NaN,m[y++]=_?_[1]:NaN,x[a]=I,_=e.dataToPoint(x,null,S),m[y++]=_?_[1]:NaN}g.setLayout("largePoints",m)}}};function $ye(n,e,t,r,i,a){var o;return t>r?o=-1:t<r?o=1:o=a?0:e>0?n.get(i,e-1)<=r?1:-1:1,o}function Zwt(n,e){var t=n.getBaseAxis(),r,i=t.type==="category"?t.getBandWidth():(r=t.getExtent(),Math.abs(r[1]-r[0])/e.count()),a=xr(ni(n.get("barMaxWidth"),i),i),o=xr(ni(n.get("barMinWidth"),1),i),s=n.get("barWidth");return s!=null?xr(s,i):Math.max(Math.min(i/2,a),o)}const Kwt=qwt;function Jwt(n){n.registerChartView(Gwt),n.registerSeriesModel(zwt),n.registerPreprocessor(Uwt),n.registerVisual(Ywt),n.registerLayout(Kwt)}function Wye(n,e){var t=e.rippleEffectColor||e.color;n.eachChild(function(r){r.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var Qwt=function(n){$e(e,n);function e(t,r){var i=n.call(this)||this,a=new C3(t,r),o=new Cn;return i.add(a),i.add(o),i.updateData(t,r),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var r=t.symbolType,i=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s<a;s++){var l=hu(r,-1,-1,2,2,i);l.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var u=-s/a*t.period+t.effectOffset;l.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(u).start(),l.animateStyle(!0).when(t.period,{opacity:0}).delay(u).start(),o.add(l)}Wye(o,t)},e.prototype.updateEffectAnimation=function(t){for(var r=this._effectCfg,i=this.childAt(1),a=["symbolType","period","rippleScale","rippleNumber"],o=0;o<a.length;o++){var s=a[o];if(r[s]!==t[s]){this.stopEffectAnimation(),this.startEffectAnimation(t);return}}Wye(i,t)},e.prototype.highlight=function(){h_(this)},e.prototype.downplay=function(){c_(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},e.prototype.updateData=function(t,r){var i=this,a=t.hostModel;this.childAt(0).updateData(t,r);var o=this.childAt(1),s=t.getItemModel(r),l=t.getItemVisual(r,"symbol"),u=$I(t.getItemVisual(r,"symbolSize")),h=t.getItemVisual(r,"style"),c=h&&h.fill,f=s.getModel("emphasis");o.setScale(u),o.traverse(function(g){g.setStyle("fill",c)});var d=Y2(t.getItemVisual(r,"symbolOffset"),u);d&&(o.x=d[0],o.y=d[1]);var v=t.getItemVisual(r,"symbolRotate");o.rotation=(v||0)*Math.PI/180||0;var p={};p.showEffectOn=a.get("showEffectOn"),p.rippleScale=s.get(["rippleEffect","scale"]),p.brushType=s.get(["rippleEffect","brushType"]),p.period=s.get(["rippleEffect","period"])*1e3,p.effectOffset=r/t.count(),p.z=a.getShallow("z")||0,p.zlevel=a.getShallow("zlevel")||0,p.symbolType=l,p.color=c,p.rippleEffectColor=s.get(["rippleEffect","color"]),p.rippleNumber=s.get(["rippleEffect","number"]),p.showEffectOn==="render"?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(g){g==="emphasis"?p.showEffectOn!=="render"&&i.startEffectAnimation(p):g==="normal"&&p.showEffectOn!=="render"&&i.stopEffectAnimation()}),this._effectCfg=p,vl(this,f.get("focus"),f.get("blurScope"),f.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(Cn);const ebt=Qwt;var tbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this._symbolDraw=new A3(ebt)},e.prototype.render=function(t,r,i){var a=t.getData(),o=this._symbolDraw;o.updateData(a,{clipShape:this._getClipShape(t)}),this.group.add(o.group)},e.prototype._getClipShape=function(t){var r=t.coordinateSystem,i=r&&r.getArea&&r.getArea();return t.get("clip",!0)?i:null},e.prototype.updateTransform=function(t,r,i){var a=t.getData();this.group.dirty();var o=M3("").reset(t,r,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var r=t.coordinateSystem;r&&r.getRoamTransform&&(this.group.transform=Rlt(r.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,r){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}(os);const rbt=tbt;var nbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,r,i){return i.point(r.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},e}(Ws);const ibt=nbt;function abt(n){n.registerChartView(rbt),n.registerSeriesModel(ibt),n.registerLayout(M3("effectScatter"))}var obt=function(n){$e(e,n);function e(t,r,i){var a=n.call(this)||this;return a.add(a.createLine(t,r,i)),a._updateEffectSymbol(t,r),a}return e.prototype.createLine=function(t,r,i){return new Cae(t,r,i)},e.prototype._updateEffectSymbol=function(t,r){var i=t.getItemModel(r),a=i.getModel("effect"),o=a.get("symbolSize"),s=a.get("symbol");Gt(o)||(o=[o,o]);var l=t.getItemVisual(r,"style"),u=a.get("color")||l&&l.stroke,h=this.childAt(1);this._symbolType!==s&&(this.remove(h),h=hu(s,-.5,-.5,1,1,u),h.z2=100,h.culling=!0,this.add(h)),h&&(h.setStyle("shadowColor",u),h.setStyle(a.getItemStyle(["color"])),h.scaleX=o[0],h.scaleY=o[1],h.setColor(u),this._symbolType=s,this._symbolScale=o,this._updateEffectAnimation(t,a,r))},e.prototype._updateEffectAnimation=function(t,r,i){var a=this.childAt(1);if(!!a){var o=t.getItemLayout(i),s=r.get("period")*1e3,l=r.get("loop"),u=r.get("roundTrip"),h=r.get("constantSpeed"),c=Gh(r.get("delay"),function(d){return d/t.count()*s/3});if(a.ignore=!0,this._updateAnimationPoints(a,o),h>0&&(s=this._getLineLength(a)/h*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var f=void 0;rn(c)?f=c(i):f=c,a.__t>0&&(f=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,r,i,a,o){if(r>0){t.__t=0;var s=this,l=t.animate("",a).when(o?r*2:r,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return Zx(t.__p1,t.__cp1)+Zx(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,r){t.__p1=r[0],t.__p2=r[1],t.__cp1=r[2]||[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]},e.prototype.updateData=function(t,r,i){this.childAt(0).updateData(t,r,i),this._updateEffectSymbol(t,r)},e.prototype._updateSymbolPosition=function(t){var r=t.__p1,i=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=Ph,h=UK;s[0]=u(r[0],a[0],i[0],o),s[1]=u(r[1],a[1],i[1],o);var c=t.__t<1?h(r[0],a[0],i[0],o):h(i[0],a[0],r[0],1-o),f=t.__t<1?h(r[1],a[1],i[1],o):h(i[1],a[1],r[1],1-o);t.rotation=-Math.atan2(f,c)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT<t.__t?(t.scaleY=Zx(l,s)*1.05,o===1&&(s[0]=l[0]+(s[0]-l[0])/2,s[1]=l[1]+(s[1]-l[1])/2)):t.__lastT===1?t.scaleY=2*Zx(r,s):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=s[0],t.y=s[1]},e.prototype.updateLayout=function(t,r){this.childAt(0).updateLayout(t,r);var i=t.getItemModel(r).getModel("effect");this._updateEffectAnimation(t,i,r)},e}(Cn);const k6e=obt;var sbt=function(n){$e(e,n);function e(t,r,i){var a=n.call(this)||this;return a._createPolyline(t,r,i),a}return e.prototype._createPolyline=function(t,r,i){var a=t.getItemLayout(r),o=new Gd({shape:{points:a}});this.add(o),this._updateCommonStl(t,r,i)},e.prototype.updateData=function(t,r,i){var a=t.hostModel,o=this.childAt(0),s={shape:{points:t.getItemLayout(r)}};ma(o,s,a,r),this._updateCommonStl(t,r,i)},e.prototype._updateCommonStl=function(t,r,i){var a=this.childAt(0),o=t.getItemModel(r),s=i&&i.emphasisLineStyle,l=i&&i.focus,u=i&&i.blurScope,h=i&&i.emphasisDisabled;if(!i||t.hasItemOption){var c=o.getModel("emphasis");s=c.getModel("lineStyle").getLineStyle(),h=c.get("disabled"),l=c.get("focus"),u=c.get("blurScope")}a.useStyle(t.getItemVisual(r,"style")),a.style.fill=null,a.style.strokeNoScale=!0;var f=a.ensureState("emphasis");f.style=s,vl(this,l,u,h)},e.prototype.updateLayout=function(t,r){var i=this.childAt(0);i.setShape("points",t.getItemLayout(r))},e}(Cn);const F6e=sbt;var lbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._lastFrame=0,t._lastFramePercent=0,t}return e.prototype.createLine=function(t,r,i){return new F6e(t,r,i)},e.prototype._updateAnimationPoints=function(t,r){this._points=r;for(var i=[0],a=0,o=1;o<r.length;o++){var s=r[o-1],l=r[o];a+=Zx(s,l),i.push(a)}if(a===0){this._length=0;return}for(var o=0;o<i.length;o++)i[o]/=a;this._offsets=i,this._length=a},e.prototype._getLineLength=function(){return this._length},e.prototype._updateSymbolPosition=function(t){var r=t.__t<1?t.__t:2-t.__t,i=this._points,a=this._offsets,o=i.length;if(!!a){var s=this._lastFrame,l;if(r<this._lastFramePercent){var u=Math.min(s+1,o-1);for(l=u;l>=0&&!(a[l]<=r);l--);l=Math.min(l,o-2)}else{for(l=s;l<o&&!(a[l]>r);l++);l=Math.min(l-1,o-2)}var h=(r-a[l])/(a[l+1]-a[l]),c=i[l],f=i[l+1];t.x=c[0]*(1-h)+h*f[0],t.y=c[1]*(1-h)+h*f[1];var d=t.__t<1?f[0]-c[0]:c[0]-f[0],v=t.__t<1?f[1]-c[1]:c[1]-f[1];t.rotation=-Math.atan2(v,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=r,t.ignore=!1}},e}(k6e);const ubt=lbt;var hbt=function(){function n(){this.polyline=!1,this.curveness=0,this.segs=[]}return n}(),cbt=function(n){$e(e,n);function e(t){var r=n.call(this,t)||this;return r._off=0,r.hoverDataIdx=-1,r}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new hbt},e.prototype.buildPath=function(t,r){var i=r.segs,a=r.curveness,o;if(r.polyline)for(o=this._off;o<i.length;){var s=i[o++];if(s>0){t.moveTo(i[o++],i[o++]);for(var l=1;l<s;l++)t.lineTo(i[o++],i[o++])}}else for(o=this._off;o<i.length;){var u=i[o++],h=i[o++],c=i[o++],f=i[o++];if(t.moveTo(u,h),a>0){var d=(u+c)/2-(h-f)*a,v=(h+f)/2-(c-u)*a;t.quadraticCurveTo(d,v,c,f)}else t.lineTo(c,f)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,r){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u<a.length;){var h=a[u++];if(h>0)for(var c=a[u++],f=a[u++],d=1;d<h;d++){var v=a[u++],p=a[u++];if(Nx(c,f,v,p,s,t,r))return l}l++}else for(var l=0,u=0;u<a.length;){var c=a[u++],f=a[u++],v=a[u++],p=a[u++];if(o>0){var g=(c+v)/2-(f-p)*o,m=(f+p)/2-(v-c)*o;if($3e(c,f,g,m,v,p,s,t,r))return l}else if(Nx(c,f,v,p,s,t,r))return l;l++}return-1},e.prototype.contain=function(t,r){var i=this.transformCoordToLocal(t,r),a=this.getBoundingRect();if(t=i[0],r=i[1],a.contain(t,r)){var o=this.hoverDataIdx=this.findDataIndex(t,r);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var r=this.shape,i=r.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<i.length;){var h=i[u++],c=i[u++];a=Math.min(h,a),s=Math.max(h,s),o=Math.min(c,o),l=Math.max(c,l)}t=this._rect=new ai(a,o,s,l)}return t},e}(Si),fbt=function(){function n(){this.group=new Cn}return n.prototype.updateData=function(e){this._clear();var t=this._create();t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e)},n.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clear()},n.prototype.incrementalUpdate=function(e,t){var r=this._newAdded[0],i=t.getLayout("linesPoints"),a=r&&r.shape.segs;if(a&&a.length<2e4){var o=a.length,s=new Float32Array(o+i.length);s.set(a),s.set(i,o),r.setShape({segs:s})}else{this._newAdded=[];var l=this._create();l.incremental=!0,l.setShape({segs:i}),this._setCommon(l,t),l.__startIndex=e.start}},n.prototype.remove=function(){this._clear()},n.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},n.prototype._create=function(){var e=new cbt({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(e),this.group.add(e),e},n.prototype._setCommon=function(e,t,r){var i=t.hostModel;e.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),e.useStyle(i.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var a=t.getVisual("style");a&&a.stroke&&e.setStyle("stroke",a.stroke),e.setStyle("fill",null);var o=Bn(e);o.seriesIndex=i.seriesIndex,e.on("mousemove",function(s){o.dataIndex=null;var l=e.hoverDataIdx;l>0&&(o.dataIndex=l+e.__startIndex)})},n.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},n}();const dbt=fbt;var vbt={seriesType:"lines",plan:UI(),reset:function(n){var e=n.coordinateSystem;if(!!e){var t=n.get("polyline"),r=n.pipelineContext.large;return{progress:function(i,a){var o=[];if(r){var s=void 0,l=i.end-i.start;if(t){for(var u=0,h=i.start;h<i.end;h++)u+=n.getLineCoordsCount(h);s=new Float32Array(l+u*2)}else s=new Float32Array(l*4);for(var c=0,f=[],h=i.start;h<i.end;h++){var d=n.getLineCoords(h,o);t&&(s[c++]=d);for(var v=0;v<d;v++)f=e.dataToPoint(o[v],!1,f),s[c++]=f[0],s[c++]=f[1]}a.setLayout("linesPoints",s)}else for(var h=i.start;h<i.end;h++){var p=a.getItemModel(h),d=n.getLineCoords(h,o),g=[];if(t)for(var m=0;m<d;m++)g.push(e.dataToPoint(o[m]));else{g[0]=e.dataToPoint(o[0]),g[1]=e.dataToPoint(o[1]);var y=p.get(["lineStyle","curveness"]);+y&&(g[2]=[(g[0][0]+g[1][0])/2-(g[0][1]-g[1][1])*y,(g[0][1]+g[1][1])/2-(g[1][0]-g[0][0])*y])}a.setItemLayout(h,g)}}}}}};const B6e=vbt;var pbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this._updateLineDraw(a,t),s=t.get("zlevel"),l=t.get(["effect","trailLength"]),u=i.getZr(),h=u.painter.getType()==="svg";h||u.painter.getLayer(s).clear(!0),this._lastZlevel!=null&&!h&&u.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&l>0&&(h||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var c=t.get("clip",!0)&&yU(t.coordinateSystem,!1,t);c?this.group.setClipPath(c):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,r,i){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,r,i){this._lineDraw.incrementalUpdate(t,r.getData()),this._finished=t.end===r.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,r,i){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=B6e.reset(t,r,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,r){var i=this._lineDraw,a=this._showEffect(r),o=!!r.get("polyline"),s=r.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new dbt:new Aae(o?a?ubt:F6e:a?k6e:Cae),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var r=t.getZr(),i=r.painter.getType()==="svg";!i&&this._lastZlevel!=null&&r.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,r){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(r)},e.prototype.dispose=function(t,r){this.remove(t,r)},e.type="lines",e}(os);const gbt=pbt;var ybt=typeof Uint32Array>"u"?Array:Uint32Array,mbt=typeof Float64Array>"u"?Array:Float64Array;function Hye(n){var e=n.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(n.data=Vt(e,function(t){var r=[t[0].coord,t[1].coord],i={coords:r};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),nie([i,t[0],t[1]])}))}var _bt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],Hye(t);var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count)),n.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(Hye(t),t.data){var r=this._processFlatCoordsArray(t.data);this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset,r.flatCoords&&(t.data=new Float32Array(r.count))}n.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var r=this._processFlatCoordsArray(t.data);r.flatCoords&&(this._flatCoords?(this._flatCoords=K8(this._flatCoords,r.flatCoords),this._flatCoordsOffset=K8(this._flatCoordsOffset,r.flatCoordsOffset)):(this._flatCoords=r.flatCoords,this._flatCoordsOffset=r.flatCoordsOffset),t.data=new Float32Array(r.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var r=this.getData().getItemModel(t),i=r.option instanceof Array?r.option:r.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,r){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;o<a;o++)r[o]=r[o]||[],r[o][0]=this._flatCoords[i+o*2],r[o][1]=this._flatCoords[i+o*2+1];return a}else{for(var s=this._getCoordsFromItemModel(t),o=0;o<s.length;o++)r[o]=r[o]||[],r[o][0]=s[o][0],r[o][1]=s[o][1];return s.length}},e.prototype._processFlatCoordsArray=function(t){var r=0;if(this._flatCoords&&(r=this._flatCoords.length),ha(t[0])){for(var i=t.length,a=new ybt(i),o=new mbt(i),s=0,l=0,u=0,h=0;h<i;){u++;var c=t[h++];a[l++]=s+r,a[l++]=c;for(var f=0;f<c;f++){var d=t[h++],v=t[h++];o[s++]=d,o[s++]=v}}return{flatCoordsOffset:new Uint32Array(a.buffer,0,l),flatCoords:o,count:u}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,r){var i=new Df(["value"],this);return i.hasItemOption=!1,i.initData(t.data,[],function(a,o,s,l){if(a instanceof Array)return NaN;i.hasItemOption=!0;var u=a.value;if(u!=null)return u instanceof Array?u[l]:u}),i},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),o=a.getItemModel(t),s=o.get("name");if(s)return s;var l=o.get("fromName"),u=o.get("toName"),h=[];return l!=null&&h.push(l),u!=null&&h.push(u),ch("nameValue",{name:h.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t==null?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t==null?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),r=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&r>0?r+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Ws);const xbt=_bt;function N4(n){return n instanceof Array||(n=[n,n]),n}var Sbt={seriesType:"lines",reset:function(n){var e=N4(n.get("symbol")),t=N4(n.get("symbolSize")),r=n.getData();r.setVisual("fromSymbol",e&&e[0]),r.setVisual("toSymbol",e&&e[1]),r.setVisual("fromSymbolSize",t&&t[0]),r.setVisual("toSymbolSize",t&&t[1]);function i(a,o){var s=a.getItemModel(o),l=N4(s.getShallow("symbol",!0)),u=N4(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:r.hasItemOption?i:null}}};const wbt=Sbt;function bbt(n){n.registerChartView(gbt),n.registerSeriesModel(xbt),n.registerLayout(B6e),n.registerVisual(wbt)}var Ebt=256,Tbt=function(){function n(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=s_.createCanvas();this.canvas=e}return n.prototype.update=function(e,t,r,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),h=this.pointSize+this.blurSize,c=this.canvas,f=c.getContext("2d"),d=e.length;c.width=t,c.height=r;for(var v=0;v<d;++v){var p=e[v],g=p[0],m=p[1],y=p[2],_=i(y);f.globalAlpha=_,f.drawImage(s,g-h,m-h)}if(!c.width||!c.height)return c;for(var x=f.getImageData(0,0,c.width,c.height),S=x.data,w=0,b=S.length,E=this.minOpacity,T=this.maxOpacity,C=T-E;w<b;){var _=S[w+3]/256,A=Math.floor(_*(Ebt-1))*4;if(_>0){var M=o(_)?l:u;_>0&&(_=_*C+E),S[w++]=M[A],S[w++]=M[A+1],S[w++]=M[A+2],S[w++]=M[A+3]*_*256}else w+=4}return f.putImageData(x,0,0),c},n.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=s_.createCanvas()),t=this.pointSize+this.blurSize,r=t*2;e.width=r,e.height=r;var i=e.getContext("2d");return i.clearRect(0,0,r,r),i.shadowOffsetX=r,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},n.prototype._getGradient=function(e,t){for(var r=this._gradientPixels,i=r[t]||(r[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},n}();const Cbt=Tbt;function Abt(n,e,t){var r=n[1]-n[0];e=Vt(e,function(o){return{interval:[(o.interval[0]-n[0])/r,(o.interval[1]-n[0])/r]}});var i=e.length,a=0;return function(o){var s;for(s=a;s<i;s++){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}if(s===i)for(s=a-1;s>=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s<i&&t[s]}}function Mbt(n,e){var t=n[1]-n[0];return e=[(e[0]-n[0])/t,(e[1]-n[0])/t],function(r){return r>=e[0]&&r<=e[1]}}function jye(n){var e=n.dimensions;return e[0]==="lng"&&e[1]==="lat"}var Ibt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a;r.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):jye(o)&&this._renderOnGeo(o,t,a,i)},e.prototype.incrementalPrepareRender=function(t,r,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,r,i,a){var o=r.coordinateSystem;o&&(jye(o)?this.render(r,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(r,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){_w(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,r,i,a,o){var s=t.coordinateSystem,l=Z2(s,"cartesian2d"),u,h,c,f;if(l){var d=s.getAxis("x"),v=s.getAxis("y");u=d.getBandWidth()+.5,h=v.getBandWidth()+.5,c=d.scale.getExtent(),f=v.scale.getExtent()}for(var p=this.group,g=t.getData(),m=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),_=t.getModel(["select","itemStyle"]).getItemStyle(),x=t.get(["itemStyle","borderRadius"]),S=hh(t),w=t.getModel("emphasis"),b=w.get("focus"),E=w.get("blurScope"),T=w.get("disabled"),C=l?[g.mapDimension("x"),g.mapDimension("y"),g.mapDimension("value")]:[g.mapDimension("time"),g.mapDimension("value")],A=i;A<a;A++){var M=void 0,I=g.getItemVisual(A,"style");if(l){var R=g.get(C[0],A),k=g.get(C[1],A);if(isNaN(g.get(C[2],A))||isNaN(R)||isNaN(k)||R<c[0]||R>c[1]||k<f[0]||k>f[1])continue;var D=s.dataToPoint([R,k]);M=new ta({shape:{x:D[0]-u/2,y:D[1]-h/2,width:u,height:h},style:I})}else{if(isNaN(g.get(C[1],A)))continue;M=new ta({z2:1,shape:s.dataToRect([g.get(C[0],A)]).contentShape,style:I})}if(g.hasItemOption){var G=g.getItemModel(A),W=G.getModel("emphasis");m=W.getModel("itemStyle").getItemStyle(),y=G.getModel(["blur","itemStyle"]).getItemStyle(),_=G.getModel(["select","itemStyle"]).getItemStyle(),x=G.get(["itemStyle","borderRadius"]),b=W.get("focus"),E=W.get("blurScope"),T=W.get("disabled"),S=hh(G)}M.shape.r=x;var z=t.getRawValue(A),V="-";z&&z[2]!=null&&(V=z[2]+""),vc(M,S,{labelFetcher:t,labelDataIndex:A,defaultOpacity:I.opacity,defaultText:V}),M.ensureState("emphasis").style=m,M.ensureState("blur").style=y,M.ensureState("select").style=_,vl(M,b,E,T),M.incremental=o,o&&(M.states.emphasis.hoverLayer=!0),p.add(M),g.setItemGraphicEl(A,M),this._progressiveEls&&this._progressiveEls.push(M)}},e.prototype._renderOnGeo=function(t,r,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=r.getData(),u=this._hmLayer||this._hmLayer||new Cbt;u.blurSize=r.get("blurSize"),u.pointSize=r.get("pointSize"),u.minOpacity=r.get("minOpacity"),u.maxOpacity=r.get("maxOpacity");var h=t.getViewRect().clone(),c=t.getRoamTransform();h.applyTransform(c);var f=Math.max(h.x,0),d=Math.max(h.y,0),v=Math.min(h.width+h.x,a.getWidth()),p=Math.min(h.height+h.y,a.getHeight()),g=v-f,m=p-d,y=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],_=l.mapArray(y,function(b,E,T){var C=t.dataToPoint([b,E]);return C[0]-=f,C[1]-=d,C.push(T),C}),x=i.getExtent(),S=i.type==="visualMap.continuous"?Mbt(x,i.option.range):Abt(x,i.getPieceList(),i.option.selected);u.update(_,g,m,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},S);var w=new xc({style:{width:g,height:m,x:f,y:d,image:u.canvas},silent:!0});this.group.add(w)},e.type="heatmap",e}(os);const Lbt=Ibt;var Pbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,r){return k_(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=S3.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(Ws);const Obt=Pbt;function Rbt(n){n.registerChartView(Lbt),n.registerSeriesModel(Obt)}var Dbt=["itemStyle","borderWidth"],Xye=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],Uj=new cm,Nbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),h=u.isHorizontal(),c=l.master.getRect(),f={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[c.x,c.x+c.width],[c.y,c.y+c.height]],isHorizontal:h,valueDim:Xye[+h],categoryDim:Xye[1-+h]};return o.diff(s).add(function(d){if(!!o.hasValue(d)){var v=qye(o,d),p=Yye(o,d,v,f),g=Zye(o,f,p);o.setItemGraphicEl(d,g),a.add(g),Jye(g,f,p)}}).update(function(d,v){var p=s.getItemGraphicEl(v);if(!o.hasValue(d)){a.remove(p);return}var g=qye(o,d),m=Yye(o,d,g,f),y=W6e(o,m);p&&y!==p.__pictorialShapeStr&&(a.remove(p),o.setItemGraphicEl(d,null),p=null),p?Vbt(p,f,m):p=Zye(o,f,m,!0),o.setItemGraphicEl(d,p),p.__pictorialSymbolMeta=m,a.add(p),Jye(p,f,m)}).remove(function(d){var v=s.getItemGraphicEl(d);v&&Kye(s,d,v.__pictorialSymbolMeta.animationModel,v)}).execute(),this._data=o,this.group},e.prototype.remove=function(t,r){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){Kye(a,Bn(o).dataIndex,t,o)}):i.removeAll()},e.type="pictorialBar",e}(os);function Yye(n,e,t,r){var i=n.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=t.get("symbolPatternSize")||2,c=t.isAnimationEnabled(),f={dataIndex:e,layout:i,itemModel:t,symbolType:n.getItemVisual(e,"symbol")||"circle",style:n.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:c?t:null,hoverScale:c&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};kbt(t,a,i,r,f),Fbt(n,e,i,a,o,f.boundingLength,f.pxSign,h,r,f),Bbt(t,f.symbolScale,u,r,f);var d=f.symbolSize,v=Y2(t.get("symbolOffset"),d);return Gbt(t,d,i,a,o,v,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,r,f),f}function kbt(n,e,t,r,i){var a=r.valueDim,o=n.get("symbolBoundingData"),s=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),h;if(Gt(o)){var c=[Vj(s,o[0])-l,Vj(s,o[1])-l];c[1]<c[0]&&c.reverse(),h=c[u]}else o!=null?h=Vj(s,o)-l:e?h=r.coordSysExtent[a.index][u]-l:h=t[a.wh];i.boundingLength=h,e&&(i.repeatCutLength=t[a.wh]),i.pxSign=h>0?1:-1}function Vj(n,e){return n.toGlobalCoord(n.dataToCoord(n.scale.parse(e)))}function Fbt(n,e,t,r,i,a,o,s,l,u){var h=l.valueDim,c=l.categoryDim,f=Math.abs(t[c.wh]),d=n.getItemVisual(e,"symbolSize"),v;Gt(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[c.index]=xr(v[c.index],f),v[h.index]=xr(v[h.index],r?f:Math.abs(a)),u.symbolSize=v;var p=u.symbolScale=[v[0]/s,v[1]/s];p[h.index]*=(l.isHorizontal?-1:1)*o}function Bbt(n,e,t,r,i){var a=n.get(Dbt)||0;a&&(Uj.attr({scaleX:e[0],scaleY:e[1],rotation:t}),Uj.updateTransform(),a/=Uj.getLineScale(),a*=e[r.valueDim.index]),i.valueLineWidth=a||0}function Gbt(n,e,t,r,i,a,o,s,l,u,h,c){var f=h.categoryDim,d=h.valueDim,v=c.pxSign,p=Math.max(e[d.index]+s,0),g=p;if(r){var m=Math.abs(l),y=Gh(n.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=xr(y,e[d.index]),S=Math.max(p+x*2,0),w=_?0:x*2,b=M3e(r),E=b?r:Qye((m+w)/S),T=m-E*p;x=T/2/(_?E:Math.max(E-1,1)),S=p+x*2,w=_?0:x*2,!b&&r!=="fixed"&&(E=u?Qye((Math.abs(u)+w)/S):0),g=E*S-w,c.repeatTimes=E,c.symbolMargin=x}var C=v*(g/2),A=c.pathPosition=[];A[f.index]=t[f.wh]/2,A[d.index]=o==="start"?C:o==="end"?l-C:l/2,a&&(A[0]+=a[0],A[1]+=a[1]);var M=c.bundlePosition=[];M[f.index]=t[f.xy],M[d.index]=t[d.xy];var I=c.barRectShape=Mt({},t);I[d.wh]=v*Math.max(Math.abs(t[d.wh]),Math.abs(A[d.index]+C)),I[f.wh]=t[f.wh];var R=c.clipShape={};R[f.xy]=-t[f.xy],R[f.wh]=h.ecSize[f.wh],R[d.xy]=0,R[d.wh]=t[d.wh]}function G6e(n){var e=n.symbolPatternSize,t=hu(n.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function z6e(n,e,t,r){var i=n.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,h=0,c=a[e.valueDim.index]+o+t.symbolMargin*2;for(Nae(n,function(p){p.__pictorialAnimationIndex=h,p.__pictorialRepeatTimes=u,h<u?zA(p,null,v(h),t,r):zA(p,null,{scaleX:0,scaleY:0},t,r,function(){i.remove(p)}),h++});h<u;h++){var f=G6e(t);f.__pictorialAnimationIndex=h,f.__pictorialRepeatTimes=u,i.add(f);var d=v(h);zA(f,{x:d.x,y:d.y,scaleX:0,scaleY:0},{scaleX:d.scaleX,scaleY:d.scaleY,rotation:d.rotation},t,r)}function v(p){var g=s.slice(),m=t.pxSign,y=p;return(t.symbolRepeatDirection==="start"?m>0:m<0)&&(y=u-1-p),g[l.index]=c*(y-u/2+.5)+s[l.index],{x:g[0],y:g[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function U6e(n,e,t,r){var i=n.__pictorialBundle,a=n.__pictorialMainPath;a?zA(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,r):(a=n.__pictorialMainPath=G6e(t),i.add(a),zA(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,r))}function V6e(n,e,t){var r=Mt({},e.barRectShape),i=n.__pictorialBarRect;i?zA(i,null,{shape:r},e,t):(i=n.__pictorialBarRect=new ta({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,n.add(i))}function $6e(n,e,t,r){if(t.symbolClip){var i=n.__pictorialClipPath,a=Mt({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(i)ma(i,{shape:a},s,l);else{a[o.wh]=0,i=new ta({shape:a}),n.__pictorialBundle.setClipPath(i),n.__pictorialClipPath=i;var u={};u[o.wh]=t.clipShape[o.wh],x3[r?"updateProps":"initProps"](i,{shape:u},s,l)}}}function qye(n,e){var t=n.getItemModel(e);return t.getAnimationDelayParams=zbt,t.isAnimationEnabled=Ubt,t}function zbt(n){return{index:n.__pictorialAnimationIndex,count:n.__pictorialRepeatTimes}}function Ubt(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function Zye(n,e,t,r){var i=new Cn,a=new Cn;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?z6e(i,e,t):U6e(i,e,t),V6e(i,t,r),$6e(i,e,t,r),i.__pictorialShapeStr=W6e(n,t),i.__pictorialSymbolMeta=t,i}function Vbt(n,e,t){var r=t.animationModel,i=t.dataIndex,a=n.__pictorialBundle;ma(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},r,i),t.symbolRepeat?z6e(n,e,t,!0):U6e(n,e,t,!0),V6e(n,t,!0),$6e(n,e,t,!0)}function Kye(n,e,t,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var a=[];Nae(r,function(o){a.push(o)}),r.__pictorialMainPath&&a.push(r.__pictorialMainPath),r.__pictorialClipPath&&(t=null),te(a,function(o){NS(o,{scaleX:0,scaleY:0},t,e,function(){r.parent&&r.parent.remove(r)})}),n.setItemGraphicEl(e,null)}function W6e(n,e){return[n.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function Nae(n,e,t){te(n.__pictorialBundle.children(),function(r){r!==n.__pictorialBarRect&&e.call(t,r)})}function zA(n,e,t,r,i,a){e&&n.attr(e),r.symbolClip&&!i?t&&n.attr(t):t&&x3[i?"updateProps":"initProps"](n,t,r.animationModel,r.dataIndex,a)}function Jye(n,e,t){var r=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),h=a.get("focus"),c=a.get("blurScope"),f=a.get("scale");Nae(n,function(p){if(p instanceof xc){var g=p.style;p.useStyle(Mt({image:g.image,x:g.x,y:g.y,width:g.width,height:g.height},t.style))}else p.useStyle(t.style);var m=p.ensureState("emphasis");m.style=o,f&&(m.scaleX=p.scaleX*1.1,m.scaleY=p.scaleY*1.1),p.ensureState("blur").style=s,p.ensureState("select").style=l,u&&(p.cursor=u),p.z2=t.z2});var d=e.valueDim.posDesc[+(t.boundingLength>0)],v=n.__pictorialBarRect;vc(v,hh(i),{labelFetcher:e.seriesModel,labelDataIndex:r,defaultText:gM(e.seriesModel.getData(),r),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:d}),vl(n,h,c,a.get("disabled"))}function Qye(n){var e=Math.round(n);return Math.abs(n-e)<1e-4?e:Math.ceil(n)}const $bt=Nbt;var Wbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,n.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=xw(CG.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(CG);const Hbt=Wbt;function jbt(n){n.registerChartView($bt),n.registerSeriesModel(Hbt),n.registerLayout(n.PRIORITY.VISUAL.LAYOUT,Un(T4e,"pictorialBar")),n.registerLayout(n.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,C4e("pictorialBar"))}var Xbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,r,i){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),h=u.rect,c=u.boundaryGap;s.x=0,s.y=h.y+c[0];function f(g){return g.name}var d=new f_(this._layersSeries||[],l,f,f),v=[];d.add(kr(p,this,"add")).update(kr(p,this,"update")).remove(kr(p,this,"remove")).execute();function p(g,m,y){var _=o._layers;if(g==="remove"){s.remove(_[m]);return}for(var x=[],S=[],w,b=l[m].indices,E=0;E<b.length;E++){var T=a.getItemLayout(b[E]),C=T.x,A=T.y0,M=T.y;x.push(C,A),S.push(C,A+M),w=a.getItemVisual(b[E],"style")}var I,R=a.getItemLayout(b[0]),k=t.getModel("label"),D=k.get("margin"),G=t.getModel("emphasis");if(g==="add"){var W=v[m]=new Cn;I=new v5e({shape:{points:x,stackedOnPoints:S,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),W.add(I),s.add(W),t.isAnimationEnabled()&&I.setClipPath(Ybt(I.getBoundingRect(),t,function(){I.removeClipPath()}))}else{var W=_[y];I=W.childAt(0),s.add(W),v[m]=W,ma(I,{shape:{points:x,stackedOnPoints:S}},t),x0(I)}vc(I,hh(t),{labelDataIndex:b[E-1],defaultText:a.getName(b[E-1]),inheritColor:w.fill},{normal:{verticalAlign:"middle"}}),I.setTextConfig({position:null,local:!0});var z=I.getTextContent();z&&(z.x=R.x-D,z.y=R.y0+R.y/2),I.useStyle(w),a.setItemGraphicEl(m,I),dc(I,t),vl(I,G.get("focus"),G.get("blurScope"),G.get("disabled"))}this._layersSeries=l,this._layers=v},e.type="themeRiver",e}(os);function Ybt(n,e,t){var r=new ta({shape:{x:n.x-10,y:n.y-10,width:0,height:n.height+20}});return Is(r,{shape:{x:n.x-50,width:n.width+100,height:n.height+20}},e,t),r}const qbt=Xbt;var $j=2,Zbt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){n.prototype.init.apply(this,arguments),this.legendVisualProvider=new L3(kr(this.getData,this),kr(this.getRawData,this))},e.prototype.fixData=function(t){var r=t.length,i={},a=eJ(t,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),o=[];a.buckets.each(function(f,d){o.push({name:d,dataList:f})});for(var s=o.length,l=0;l<s;++l){for(var u=o[l].name,h=0;h<o[l].dataList.length;++h){var c=o[l].dataList[h][0]+"";i[c]=l}for(var c in i)i.hasOwnProperty(c)&&i[c]!==l&&(i[c]=l,t[r]=[c,0,u],r++)}return t},e.prototype.getInitialData=function(t,r){for(var i=this.getReferringComponents("singleAxis",uu).models[0],a=i.get("type"),o=To(t.data,function(v){return v[2]!==void 0}),s=this.fixData(o||[]),l=[],u=this.nameMap=$r(),h=0,c=0;c<s.length;++c)l.push(s[c][$j]),u.get(s[c][$j])||(u.set(s[c][$j],h),h++);var f=b3(s,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:SG(a)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,d=new Df(f,this);return d.initData(s),d},e.prototype.getLayerSeries=function(){for(var t=this.getData(),r=t.count(),i=[],a=0;a<r;++a)i[a]=a;var o=t.mapDimension("single"),s=eJ(i,function(u){return t.get("name",u)}),l=[];return s.buckets.each(function(u,h){u.sort(function(c,f){return t.get(o,c)-t.get(o,f)}),l.push({name:h,indices:u})}),l},e.prototype.getAxisTooltipData=function(t,r,i){Gt(t)||(t=t?[t]:[]);for(var a=this.getData(),o=this.getLayerSeries(),s=[],l=o.length,u,h=0;h<l;++h){for(var c=Number.MAX_VALUE,f=-1,d=o[h].indices.length,v=0;v<d;++v){var p=a.get(t[0],o[h].indices[v]),g=Math.abs(p-r);g<=c&&(u=p,c=g,f=o[h].indices[v])}s.push(f)}return{dataIndices:s,nestestValue:u}},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),o=a.getName(t),s=a.get(a.mapDimension("value"),t);return ch("nameValue",{name:o,value:s})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}(Ws);const Kbt=Zbt;function Jbt(n,e){n.eachSeriesByType("themeRiver",function(t){var r=t.getData(),i=t.coordinateSystem,a={},o=i.getRect();a.rect=o;var s=t.get("boundaryGap"),l=i.getAxis();if(a.boundaryGap=s,l.orient==="horizontal"){s[0]=xr(s[0],o.height),s[1]=xr(s[1],o.height);var u=o.height-s[0]-s[1];eme(r,t,u)}else{s[0]=xr(s[0],o.width),s[1]=xr(s[1],o.width);var h=o.width-s[0]-s[1];eme(r,t,h)}r.setLayout("layoutInfo",a)})}function eme(n,e,t){if(!!n.count())for(var r=e.coordinateSystem,i=e.getLayerSeries(),a=n.mapDimension("single"),o=n.mapDimension("value"),s=Vt(i,function(g){return Vt(g.indices,function(m){var y=r.dataToPoint(n.get(a,m));return y[1]=n.get(o,m),y})}),l=Qbt(s),u=l.y0,h=t/l.max,c=i.length,f=i[0].indices.length,d,v=0;v<f;++v){d=u[v]*h,n.setItemLayout(i[0].indices[v],{layerIndex:0,x:s[0][v][0],y0:d,y:s[0][v][1]*h});for(var p=1;p<c;++p)d+=s[p-1][v][1]*h,n.setItemLayout(i[p].indices[v],{layerIndex:p,x:s[p][v][0],y0:d,y:s[p][v][1]*h})}}function Qbt(n){for(var e=n.length,t=n[0].length,r=[],i=[],a=0,o=0;o<t;++o){for(var s=0,l=0;l<e;++l)s+=n[l][o][1];s>a&&(a=s),r.push(s)}for(var u=0;u<t;++u)i[u]=(a-r[u])/2;a=0;for(var h=0;h<t;++h){var c=r[h]+i[h];c>a&&(a=c)}return{y0:i,max:a}}function eEt(n){n.registerChartView(qbt),n.registerSeriesModel(Kbt),n.registerLayout(Jbt),n.registerProcessor(I3("themeRiver"))}var tEt=2,rEt=4,nEt=function(n){$e(e,n);function e(t,r,i,a){var o=n.call(this)||this;o.z2=tEt,o.textConfig={inside:!0},Bn(o).seriesIndex=r.seriesIndex;var s=new la({z2:rEt,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,r,i,a),o}return e.prototype.updateData=function(t,r,i,a,o){this.node=r,r.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;Bn(s).dataIndex=r.dataIndex;var l=r.getModel(),u=l.getModel("emphasis"),h=r.getLayout(),c=Mt({},h);c.label=null;var f=r.getVisual("style");f.lineJoin="bevel";var d=r.getVisual("decal");d&&(f.decal=vM(d,o));var v=lE(l.getModel("itemStyle"),c,!0);Mt(c,v),te(Gf,function(y){var _=s.ensureState(y),x=l.getModel([y,"itemStyle"]);_.style=x.getItemStyle();var S=lE(x,c);S&&(_.shape=S)}),t?(s.setShape(c),s.shape.r=h.r0,Is(s,{shape:{r:h.r}},i,r.dataIndex)):(ma(s,{shape:c},i),x0(s)),s.useStyle(f),this._updateLabel(i);var p=l.getShallow("cursor");p&&s.attr("cursor",p),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var g=u.get("focus"),m=g==="ancestor"?r.getAncestorsIndices():g==="descendant"?r.getDescendantIndices():g;vl(this,m,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var r=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),h=Math.sin(l),c=this,f=c.getTextContent(),d=this.node.dataIndex,v=a.get("minAngle")/180*Math.PI,p=a.get("show")&&!(v!=null&&Math.abs(s)<v);f.ignore=!p,te(oD,function(m){var y=m==="normal"?i.getModel("label"):i.getModel([m,"label"]),_=m==="normal",x=_?f:f.ensureState(m),S=t.getFormattedLabel(d,m);_&&(S=S||r.node.name),x.style=is(y,{},null,m!=="normal",!0),S&&(x.style.text=S);var w=y.get("show");w!=null&&!_&&(x.ignore=!w);var b=g(y,"position"),E=_?c:c.states[m],T=E.style.fill;E.textConfig={outsideFill:y.get("color")==="inherit"?T:null,inside:b!=="outside"};var C,A=g(y,"distance")||0,M=g(y,"align");b==="outside"?(C=o.r+A,M=l>Math.PI/2?"right":"left"):!M||M==="center"?(s===2*Math.PI&&o.r0===0?C=0:C=(o.r+o.r0)/2,M="center"):M==="left"?(C=o.r0+A,l>Math.PI/2&&(M="right")):M==="right"&&(C=o.r-A,l>Math.PI/2&&(M="left")),x.style.align=M,x.style.verticalAlign=g(y,"verticalAlign")||"middle",x.x=C*u+o.cx,x.y=C*h+o.cy;var I=g(y,"rotate"),R=0;I==="radial"?(R=e0(-l),R>Math.PI/2&&R<Math.PI*1.5&&(R+=Math.PI)):I==="tangential"?(R=Math.PI/2-l,R>Math.PI/2?R-=Math.PI:R<-Math.PI/2&&(R+=Math.PI)):ha(I)&&(R=I*Math.PI/180),x.rotation=e0(R)});function g(m,y){var _=m.get(y);return _==null?a.get(y):_}f.dirtyStyle()},e}(wd);const tme=nEt;var JJ="sunburstRootToNode",rme="sunburstHighlight",iEt="sunburstUnhighlight";function aEt(n){n.registerAction({type:JJ,update:"updateView"},function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},r);function r(i,a){var o=xD(e,[JJ],i);if(o){var s=i.getViewRoot();s&&(e.direction=xae(s,o.node)?"rollUp":"drillDown"),i.resetViewRoot(o.node)}}}),n.registerAction({type:rme,update:"none"},function(e,t,r){e=Mt({},e),t.eachComponent({mainType:"series",subType:"sunburst",query:e},i);function i(a){var o=xD(e,[rme],a);o&&(e.dataIndex=o.node.dataIndex)}r.dispatchAction(Mt(e,{type:"highlight"}))}),n.registerAction({type:iEt,update:"updateView"},function(e,t,r){e=Mt({},e),r.dispatchAction(Mt(e,{type:"downplay"}))})}var oEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){var o=this;this.seriesModel=t,this.api=i,this.ecModel=r;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),h=this.group,c=t.get("renderLabelForZeroData"),f=[];u.eachNode(function(y){f.push(y)});var d=this._oldChildren||[];v(f,d),m(l,u),this._initEvents(),this._oldChildren=f;function v(y,_){if(y.length===0&&_.length===0)return;new f_(_,y,x,x).add(S).update(S).remove(Un(S,null)).execute();function x(w){return w.getId()}function S(w,b){var E=w==null?null:y[w],T=b==null?null:_[b];p(E,T)}}function p(y,_){if(!c&&y&&!y.getValue()&&(y=null),y!==l&&_!==l){if(_&&_.piece)y?(_.piece.updateData(!1,y,t,r,i),s.setItemGraphicEl(y.dataIndex,_.piece)):g(_);else if(y){var x=new tme(y,t,r,i);h.add(x),s.setItemGraphicEl(y.dataIndex,x)}}}function g(y){!y||y.piece&&(h.remove(y.piece),y.piece=null)}function m(y,_){_.depth>0?(o.virtualPiece?o.virtualPiece.updateData(!1,y,t,r,i):(o.virtualPiece=new tme(y,t,r,i),h.add(o.virtualPiece)),_.piece.off("click"),o.virtualPiece.on("click",function(x){o._rootToNode(_.parentNode)})):o.virtualPiece&&(h.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(r){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===r.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";dG(u,h)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:JJ,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,r){var i=r.getData(),a=i.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(os);const sEt=oEt;var lEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,r){var i={name:t.name,children:t.data};H6e(i);var a=this._levelModels=Vt(t.levels||[],function(l){return new as(l,this,r)},this),o=_ae.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,h){var c=o.getNodeByDataIndex(h),f=a[c.depth];return f&&(u.parentModel=f),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var r=n.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return r.treePathInfo=xU(i,this),r},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var r=this.getRawData().tree.root;(!t||t!==r&&!r.contains(t))&&(this._viewRoot=r)},e.prototype.enableAriaDecal=function(){q5e(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(Ws);function H6e(n){var e=0;te(n.children,function(r){H6e(r);var i=r.value;Gt(i)&&(i=i[0]),e+=i});var t=n.value;Gt(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Gt(n.value)?n.value[0]=t:n.value=t}const uEt=lEt;var nme=Math.PI/180;function hEt(n,e,t){e.eachSeriesByType(n,function(r){var i=r.get("center"),a=r.get("radius");Gt(a)||(a=[0,a]),Gt(i)||(i=[i,i]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=xr(i[0],o),h=xr(i[1],s),c=xr(a[0],l/2),f=xr(a[1],l/2),d=-r.get("startAngle")*nme,v=r.get("minAngle")*nme,p=r.getData().tree.root,g=r.getViewRoot(),m=g.depth,y=r.get("sort");y!=null&&j6e(g,y);var _=0;te(g.children,function(D){!isNaN(D.getValue())&&_++});var x=g.getValue(),S=Math.PI/(x||_)*2,w=g.depth>0,b=g.height-(w?-1:1),E=(f-c)/(b||1),T=r.get("clockwise"),C=r.get("stillShowZeroSum"),A=T?1:-1,M=function(D,G){if(!!D){var W=G;if(D!==p){var z=D.getValue(),V=x===0&&C?S:z*S;V<v&&(V=v),W=G+A*V;var q=D.depth-m-(w?-1:1),Y=c+E*q,le=c+E*(q+1),j=r.getLevelModel(D);if(j){var Q=j.get("r0",!0),ie=j.get("r",!0),oe=j.get("radius",!0);oe!=null&&(Q=oe[0],ie=oe[1]),Q!=null&&(Y=xr(Q,l/2)),ie!=null&&(le=xr(ie,l/2))}D.setLayout({angle:V,startAngle:G,endAngle:W,clockwise:T,cx:u,cy:h,r0:Y,r:le})}if(D.children&&D.children.length){var se=0;te(D.children,function(me){se+=M(me,G+se)})}return W-G}};if(w){var I=c,R=c+E,k=Math.PI*2;p.setLayout({angle:k,startAngle:d,endAngle:d+k,clockwise:T,cx:u,cy:h,r0:I,r:R})}M(g,d)})}function j6e(n,e){var t=n.children||[];n.children=cEt(t,e),t.length&&te(n.children,function(r){j6e(r,e)})}function cEt(n,e){if(rn(e)){var t=Vt(n,function(i,a){var o=i.getValue();return{params:{depth:i.depth,height:i.height,dataIndex:i.dataIndex,getValue:function(){return o}},index:a}});return t.sort(function(i,a){return e(i.params,a.params)}),Vt(t,function(i){return n[i.index]})}else{var r=e==="asc";return n.sort(function(i,a){var o=(i.getValue()-a.getValue())*(r?1:-1);return o===0?(i.dataIndex-a.dataIndex)*(r?-1:1):o})}}function fEt(n){var e={};function t(r,i,a){for(var o=r;o&&o.depth>1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return r.depth>1&&Or(s)&&(s=WK(s,(r.depth-1)/(a-1)*.5)),s}n.eachSeriesByType("sunburst",function(r){var i=r.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,r,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");Mt(u,l)})})}function dEt(n){n.registerChartView(sEt),n.registerSeriesModel(uEt),n.registerLayout(Un(hEt,"sunburst")),n.registerProcessor(Un(I3,"sunburst")),n.registerVisual(fEt),aEt(n)}var ime={color:"fill",borderColor:"stroke"},vEt={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},H1=na(),pEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,r){return k_(null,this)},e.prototype.getDataParams=function(t,r,i){var a=n.prototype.getDataParams.call(this,t,r);return i&&(a.info=H1(i).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(Ws);const gEt=pEt;function yEt(n,e){return e=e||[0,0],Vt(["x","y"],function(t,r){var i=this.getAxis(t),a=e[r],o=n[r]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function mEt(n){var e=n.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:kr(yEt,n)}}}function _Et(n,e){return e=e||[0,0],Vt([0,1],function(t){var r=e[t],i=n[t]/2,a=[],o=[];return a[t]=r-i,o[t]=r+i,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function xEt(n){var e=n.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:n.getZoom()},api:{coord:function(t){return n.dataToPoint(t)},size:kr(_Et,n)}}}function SEt(n,e){var t=this.getAxis(),r=e instanceof Array?e[0]:e,i=(n instanceof Array?n[0]:n)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(r-i)-t.dataToCoord(r+i))}function wEt(n){var e=n.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return n.dataToPoint(t)},size:kr(SEt,n)}}}function bEt(n,e){return e=e||[0,0],Vt(["Radius","Angle"],function(t,r){var i="get"+t+"Axis",a=this[i](),o=e[r],s=n[r]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function EEt(n){var e=n.getRadiusAxis(),t=n.getAngleAxis(),r=e.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:n.cx,cy:n.cy,r:r[1],r0:r[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),o=t.dataToAngle(i[1]),s=n.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:kr(bEt,n)}}}function TEt(n){var e=n.getRect(),t=n.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:n.getCellWidth(),cellHeight:n.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(r,i){return n.dataToPoint(r,i)}}}}function X6e(n,e,t,r){return n&&(n.legacy||n.legacy!==!1&&!t&&!r&&e!=="tspan"&&(e==="text"||Fr(n,"text")))}function Y6e(n,e,t){var r=n,i,a,o;if(e==="text")o=r;else{o={},Fr(r,"text")&&(o.text=r.text),Fr(r,"rich")&&(o.rich=r.rich),Fr(r,"textFill")&&(o.fill=r.textFill),Fr(r,"textStroke")&&(o.stroke=r.textStroke),Fr(r,"fontFamily")&&(o.fontFamily=r.fontFamily),Fr(r,"fontSize")&&(o.fontSize=r.fontSize),Fr(r,"fontStyle")&&(o.fontStyle=r.fontStyle),Fr(r,"fontWeight")&&(o.fontWeight=r.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=Fr(r,"textPosition");t?i.position=s?r.textPosition:"inside":s&&(i.position=r.textPosition),Fr(r,"textPosition")&&(i.position=r.textPosition),Fr(r,"textOffset")&&(i.offset=r.textOffset),Fr(r,"textRotation")&&(i.rotation=r.textRotation),Fr(r,"textDistance")&&(i.distance=r.textDistance)}return ame(o,n),te(o.rich,function(l){ame(l,l)}),{textConfig:i,textContent:a}}function ame(n,e){!e||(e.font=e.textFont||e.font,Fr(e,"textStrokeWidth")&&(n.lineWidth=e.textStrokeWidth),Fr(e,"textAlign")&&(n.align=e.textAlign),Fr(e,"textVerticalAlign")&&(n.verticalAlign=e.textVerticalAlign),Fr(e,"textLineHeight")&&(n.lineHeight=e.textLineHeight),Fr(e,"textWidth")&&(n.width=e.textWidth),Fr(e,"textHeight")&&(n.height=e.textHeight),Fr(e,"textBackgroundColor")&&(n.backgroundColor=e.textBackgroundColor),Fr(e,"textPadding")&&(n.padding=e.textPadding),Fr(e,"textBorderColor")&&(n.borderColor=e.textBorderColor),Fr(e,"textBorderWidth")&&(n.borderWidth=e.textBorderWidth),Fr(e,"textBorderRadius")&&(n.borderRadius=e.textBorderRadius),Fr(e,"textBoxShadowColor")&&(n.shadowColor=e.textBoxShadowColor),Fr(e,"textBoxShadowBlur")&&(n.shadowBlur=e.textBoxShadowBlur),Fr(e,"textBoxShadowOffsetX")&&(n.shadowOffsetX=e.textBoxShadowOffsetX),Fr(e,"textBoxShadowOffsetY")&&(n.shadowOffsetY=e.textBoxShadowOffsetY))}function ome(n,e,t){var r=n;r.textPosition=r.textPosition||t.position||"inside",t.offset!=null&&(r.textOffset=t.offset),t.rotation!=null&&(r.textRotation=t.rotation),t.distance!=null&&(r.textDistance=t.distance);var i=r.textPosition.indexOf("inside")>=0,a=n.fill||"#000";sme(r,e);var o=r.textFill==null;return i?o&&(r.textFill=t.insideFill||"#fff",!r.textStroke&&t.insideStroke&&(r.textStroke=t.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth==null&&(r.textStrokeWidth=2)):(o&&(r.textFill=n.fill||t.outsideFill||"#000"),!r.textStroke&&t.outsideStroke&&(r.textStroke=t.outsideStroke)),r.text=e.text,r.rich=e.rich,te(e.rich,function(s){sme(s,s)}),r}function sme(n,e){!e||(Fr(e,"fill")&&(n.textFill=e.fill),Fr(e,"stroke")&&(n.textStroke=e.fill),Fr(e,"lineWidth")&&(n.textStrokeWidth=e.lineWidth),Fr(e,"font")&&(n.font=e.font),Fr(e,"fontStyle")&&(n.fontStyle=e.fontStyle),Fr(e,"fontWeight")&&(n.fontWeight=e.fontWeight),Fr(e,"fontSize")&&(n.fontSize=e.fontSize),Fr(e,"fontFamily")&&(n.fontFamily=e.fontFamily),Fr(e,"align")&&(n.textAlign=e.align),Fr(e,"verticalAlign")&&(n.textVerticalAlign=e.verticalAlign),Fr(e,"lineHeight")&&(n.textLineHeight=e.lineHeight),Fr(e,"width")&&(n.textWidth=e.width),Fr(e,"height")&&(n.textHeight=e.height),Fr(e,"backgroundColor")&&(n.textBackgroundColor=e.backgroundColor),Fr(e,"padding")&&(n.textPadding=e.padding),Fr(e,"borderColor")&&(n.textBorderColor=e.borderColor),Fr(e,"borderWidth")&&(n.textBorderWidth=e.borderWidth),Fr(e,"borderRadius")&&(n.textBorderRadius=e.borderRadius),Fr(e,"shadowColor")&&(n.textBoxShadowColor=e.shadowColor),Fr(e,"shadowBlur")&&(n.textBoxShadowBlur=e.shadowBlur),Fr(e,"shadowOffsetX")&&(n.textBoxShadowOffsetX=e.shadowOffsetX),Fr(e,"shadowOffsetY")&&(n.textBoxShadowOffsetY=e.shadowOffsetY),Fr(e,"textShadowColor")&&(n.textShadowColor=e.textShadowColor),Fr(e,"textShadowBlur")&&(n.textShadowBlur=e.textShadowBlur),Fr(e,"textShadowOffsetX")&&(n.textShadowOffsetX=e.textShadowOffsetX),Fr(e,"textShadowOffsetY")&&(n.textShadowOffsetY=e.textShadowOffsetY))}var q6e={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},lme=Li(q6e);om(lm,function(n,e){return n[e]=1,n},{});lm.join(", ");var DG=["","style","shape","extra"],_M=na();function kae(n,e,t,r,i){var a=n+"Animation",o=RI(n,r,i)||{},s=_M(e).userDuring;return o.duration>0&&(o.during=s?kr(LEt,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=n),Mt(o,t[a]),o}function DB(n,e,t,r){r=r||{};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=t.isAnimationEnabled(),l=_M(n),u=e.style;l.userDuring=e.during;var h={},c={};if(OEt(n,e,c),hme("shape",e,c),hme("extra",e,c),!a&&s&&(PEt(n,e,h),ume("shape",n,e,h),ume("extra",n,e,h),REt(n,e,u,h)),c.style=u,CEt(n,c,o),MEt(n,e),s)if(a){var f={};te(DG,function(v){var p=v?e[v]:e;p&&p.enterFrom&&(v&&(f[v]=f[v]||{}),Mt(v?f[v]:f,p.enterFrom))});var d=kae("enter",n,e,t,i);d.duration>0&&n.animateFrom(f,d)}else AEt(n,e,i||0,t,h);Z6e(n,e),u?n.dirty():n.markRedraw()}function Z6e(n,e){for(var t=_M(n).leaveToProps,r=0;r<DG.length;r++){var i=DG[r],a=i?e[i]:e;a&&a.leaveTo&&(t||(t=_M(n).leaveToProps={}),i&&(t[i]=t[i]||{}),Mt(i?t[i]:t,a.leaveTo))}}function bU(n,e,t,r){if(n){var i=n.parent,a=_M(n).leaveToProps;if(a){var o=kae("update",n,e,t,0);o.done=function(){i.remove(n),r&&r()},n.animateTo(a,o)}else i.remove(n),r&&r()}}function PE(n){return n==="all"}function CEt(n,e,t){var r=e.style;if(!n.isGroup&&r){if(t){n.useStyle({});for(var i=n.animators,a=0;a<i.length;a++){var o=i[a];o.targetName==="style"&&o.changeTarget(n.style)}}n.setStyle(r)}e&&(e.style=null,e&&n.attr(e),e.style=r)}function AEt(n,e,t,r,i){if(i){var a=kae("update",n,e,r,t);a.duration>0&&n.animateFrom(i,a)}}function MEt(n,e){Fr(e,"silent")&&(n.silent=e.silent),Fr(e,"ignore")&&(n.ignore=e.ignore),n instanceof Vp&&Fr(e,"invisible")&&(n.invisible=e.invisible),n instanceof Si&&Fr(e,"autoBatch")&&(n.autoBatch=e.autoBatch)}var vy={},IEt={setTransform:function(n,e){return vy.el[n]=e,this},getTransform:function(n){return vy.el[n]},setShape:function(n,e){var t=vy.el,r=t.shape||(t.shape={});return r[n]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(n){var e=vy.el.shape;if(e)return e[n]},setStyle:function(n,e){var t=vy.el,r=t.style;return r&&(r[n]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(n){var e=vy.el.style;if(e)return e[n]},setExtra:function(n,e){var t=vy.el.extra||(vy.el.extra={});return t[n]=e,this},getExtra:function(n){var e=vy.el.extra;if(e)return e[n]}};function LEt(){var n=this,e=n.el;if(!!e){var t=_M(e).userDuring,r=n.userDuring;if(t!==r){n.el=n.userDuring=null;return}vy.el=e,r(IEt)}}function ume(n,e,t,r){var i=t[n];if(!!i){var a=e[n],o;if(a){var s=t.transition,l=i.transition;if(l)if(!o&&(o=r[n]={}),PE(l))Mt(o,a);else for(var u=Do(l),h=0;h<u.length;h++){var c=u[h],f=a[c];o[c]=f}else if(PE(s)||gi(s,n)>=0){!o&&(o=r[n]={});for(var d=Li(a),h=0;h<d.length;h++){var c=d[h],f=a[c];DEt(i[c],f)&&(o[c]=f)}}}}}function hme(n,e,t){var r=e[n];if(!!r)for(var i=t[n]={},a=Li(r),o=0;o<a.length;o++){var s=a[o];i[s]=HO(r[s])}}function PEt(n,e,t){for(var r=e.transition,i=PE(r)?lm:Do(r||[]),a=0;a<i.length;a++){var o=i[a];if(!(o==="style"||o==="shape"||o==="extra")){var s=n[o];t[o]=s}}}function OEt(n,e,t){for(var r=0;r<lme.length;r++){var i=lme[r],a=q6e[i],o=e[i];o&&(t[a[0]]=o[0],t[a[1]]=o[1])}for(var r=0;r<lm.length;r++){var s=lm[r];e[s]!=null&&(t[s]=e[s])}}function REt(n,e,t,r){if(!!t){var i=n.style,a;if(i){var o=t.transition,s=e.transition;if(o&&!PE(o)){var l=Do(o);!a&&(a=r.style={});for(var u=0;u<l.length;u++){var h=l[u],c=i[h];a[h]=c}}else if(n.getAnimationStyleProps&&(PE(s)||PE(o)||gi(s,"style")>=0)){var f=n.getAnimationStyleProps(),d=f?f.style:null;if(d){!a&&(a=r.style={});for(var v=Li(t),u=0;u<v.length;u++){var h=v[u];if(d[h]){var c=i[h];a[h]=c}}}}}}}function DEt(n,e){return Yc(n)?n!==e:n!=null&&isFinite(n)}var K6e=na(),NEt=["percent","easing","shape","style","extra"];function J6e(n){n.stopAnimation("keyframe"),n.attr(K6e(n))}function NG(n,e,t){if(!(!t.isAnimationEnabled()||!e)){if(Gt(e)){te(e,function(s){NG(n,s,t)});return}var r=e.keyframes,i=e.duration;if(t&&i==null){var a=RI("enter",t,0);i=a&&a.duration}if(!(!r||!i)){var o=K6e(n);te(DG,function(s){if(!(s&&!n[s])){var l;r.sort(function(u,h){return u.percent-h.percent}),te(r,function(u){var h=n.animators,c=s?u[s]:u;if(!!c){var f=Li(c);if(s||(f=To(f,function(p){return gi(NEt,p)<0})),!!f.length){l||(l=n.animate(s,e.loop,!0),l.scope="keyframe");for(var d=0;d<h.length;d++)h[d]!==l&&h[d].targetName===l.targetName&&h[d].stopTracks(f);s&&(o[s]=o[s]||{});var v=s?o[s]:o;te(f,function(p){v[p]=((s?n[s]:n)||{})[p]}),l.whenWithKeys(i*u.percent,c,f,u.easing)}}}),l&&l.delay(e.delay||0).duration(i).start(e.easing)}})}}}var j1="emphasis",nS="normal",Fae="blur",Bae="select",zS=[nS,j1,Fae,Bae],Wj={normal:["itemStyle"],emphasis:[j1,"itemStyle"],blur:[Fae,"itemStyle"],select:[Bae,"itemStyle"]},Hj={normal:["label"],emphasis:[j1,"label"],blur:[Fae,"label"],select:[Bae,"label"]},kEt=["x","y"],FEt="e\0\0",qv={normal:{},emphasis:{},blur:{},select:{}},BEt={cartesian2d:mEt,geo:xEt,single:wEt,polar:EEt,calendar:TEt};function QJ(n){return n instanceof Si}function eQ(n){return n instanceof Vp}function GEt(n,e){e.copyTransform(n),eQ(e)&&eQ(n)&&(e.setStyle(n.style),e.z=n.z,e.z2=n.z2,e.zlevel=n.zlevel,e.invisible=n.invisible,e.ignore=n.ignore,QJ(e)&&QJ(n)&&e.setShape(n.shape))}var zEt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){this._progressiveEls=null;var o=this._data,s=t.getData(),l=this.group,u=cme(t,s,r,i);o||l.removeAll(),s.diff(o).add(function(c){jj(i,null,c,u(c,a),t,l,s)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&bU(f,H1(f).option,t)}).update(function(c,f){var d=o.getItemGraphicEl(f);jj(i,d,c,u(c,a),t,l,s)}).execute();var h=t.get("clip",!0)?yU(t.coordinateSystem,!1,t):null;h?l.setClipPath(h):l.removeClipPath(),this._data=s},e.prototype.incrementalPrepareRender=function(t,r,i){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,r,i,a,o){var s=r.getData(),l=cme(r,s,i,a),u=this._progressiveEls=[];function h(d){d.isGroup||(d.incremental=!0,d.ensureState("emphasis").hoverLayer=!0)}for(var c=t.start;c<t.end;c++){var f=jj(null,null,c,l(c,o),r,this.group,s);f&&(f.traverse(h),u.push(f))}},e.prototype.eachRendered=function(t){_w(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,r,i,a){var o=r.element;if(o==null||i.name===o)return!0;for(;(i=i.__hostTarget||i.parent)&&i!==this.group;)if(i.name===o)return!0;return!1},e.type="custom",e}(os);const UEt=zEt;function Gae(n){var e=n.type,t;if(e==="path"){var r=n.shape,i=r.width!=null&&r.height!=null?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,a=tBe(r);t=Qz(a,null,i,r.layout||"center"),H1(t).customPathData=a}else if(e==="image")t=new xc({}),H1(t).customImagePath=n.style.image;else if(e==="text")t=new la({});else if(e==="group")t=new Cn;else{if(e==="compoundPath")throw new Error('"compoundPath" is not supported yet.');var o=Mie(e);if(!o){var s="";ao(s)}t=new o}return H1(t).customGraphicType=e,t.name=n.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function zae(n,e,t,r,i,a,o){J6e(e);var s=i&&i.normal.cfg;s&&e.setTextConfig(s),r&&r.transition==null&&(r.transition=kEt);var l=r&&r.style;if(l){if(e.type==="text"){var u=l;Fr(u,"textFill")&&(u.fill=u.textFill),Fr(u,"textStroke")&&(u.stroke=u.textStroke)}var h=void 0,c=QJ(e)?l.decal:null;n&&c&&(c.dirty=!0,h=vM(c,n)),l.__decalPattern=h}if(eQ(e)&&l){var h=l.__decalPattern;h&&(l.decal=h)}DB(e,r,a,{dataIndex:t,isInit:o,clearStyle:!0}),NG(e,r.keyframeAnimation,a)}function Q6e(n,e,t,r,i){var a=e.isGroup?null:e,o=i&&i[n].cfg;if(a){var s=a.ensureState(n);if(r===!1){var l=a.getState(n);l&&(l.style=null)}else s.style=r||null;o&&(s.textConfig=o),ZE(a)}}function VEt(n,e,t){if(!n.isGroup){var r=n,i=t.currentZ,a=t.currentZLevel;r.z=i,r.zlevel=a;var o=e.z2;o!=null&&(r.z2=o||0);for(var s=0;s<zS.length;s++)$Et(r,e,zS[s])}}function $Et(n,e,t){var r=t===nS,i=r?e:kG(e,t),a=i?i.z2:null,o;a!=null&&(o=r?n:n.ensureState(t),o.z2=a||0)}function cme(n,e,t,r){var i=n.get("renderItem"),a=n.coordinateSystem,o={};a&&(o=a.prepareCustoms?a.prepareCustoms(a):BEt[a.type](a));for(var s=sn({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:x,style:w,ordinalRawValue:S,styleEmphasis:b,visual:C,barLayout:A,currentSeriesIndices:M,font:I},o.api||{}),l={context:{},seriesId:n.id,seriesName:n.name,seriesIndex:n.seriesIndex,coordSys:o.coordSys,dataInsideLength:e.count(),encode:WEt(n.getData())},u,h,c={},f={},d={},v={},p=0;p<zS.length;p++){var g=zS[p];d[g]=n.getModel(Wj[g]),v[g]=n.getModel(Hj[g])}function m(R){return R===u?h||(h=e.getItemModel(R)):e.getItemModel(R)}function y(R,k){return e.hasItemOption?R===u?c[k]||(c[k]=m(R).getModel(Wj[k])):m(R).getModel(Wj[k]):d[k]}function _(R,k){return e.hasItemOption?R===u?f[k]||(f[k]=m(R).getModel(Hj[k])):m(R).getModel(Hj[k]):v[k]}return function(R,k){return u=R,h=null,c={},f={},i&&i(sn({dataIndexInside:R,dataIndex:e.getRawIndex(R),actionType:k?k.type:null},l),s)};function x(R,k){return k==null&&(k=u),e.getStore().get(e.getDimensionIndex(R||0),k)}function S(R,k){k==null&&(k=u),R=R||0;var D=e.getDimensionInfo(R);if(!D){var G=e.getDimensionIndex(R);return G>=0?e.getStore().get(G,k):void 0}var W=e.get(D.name,k),z=D&&D.ordinalMeta;return z?z.categories[W]:W}function w(R,k){k==null&&(k=u);var D=e.getItemVisual(k,"style"),G=D&&D.fill,W=D&&D.opacity,z=y(k,nS).getItemStyle();G!=null&&(z.fill=G),W!=null&&(z.opacity=W);var V={inheritColor:Or(G)?G:"#000"},q=_(k,nS),Y=is(q,null,V,!1,!0);Y.text=q.getShallow("show")?ni(n.getFormattedLabel(k,nS),gM(e,k)):null;var le=cG(q,V,!1);return T(R,z),z=ome(z,Y,le),R&&E(z,R),z.legacy=!0,z}function b(R,k){k==null&&(k=u);var D=y(k,j1).getItemStyle(),G=_(k,j1),W=is(G,null,null,!0,!0);W.text=G.getShallow("show")?qy(n.getFormattedLabel(k,j1),n.getFormattedLabel(k,nS),gM(e,k)):null;var z=cG(G,null,!0);return T(R,D),D=ome(D,W,z),R&&E(D,R),D.legacy=!0,D}function E(R,k){for(var D in k)Fr(k,D)&&(R[D]=k[D])}function T(R,k){R&&(R.textFill&&(k.textFill=R.textFill),R.textPosition&&(k.textPosition=R.textPosition))}function C(R,k){if(k==null&&(k=u),Fr(ime,R)){var D=e.getItemVisual(k,"style");return D?D[ime[R]]:null}if(Fr(vEt,R))return e.getItemVisual(k,R)}function A(R){if(a.type==="cartesian2d"){var k=a.getBaseAxis();return jpt(sn({axis:k},R))}}function M(){return t.getCurrentSeriesIndices()}function I(R){return Rke(R,t)}}function WEt(n){var e={};return te(n.dimensions,function(t){var r=n.getDimensionInfo(t);if(!r.isExtraCoord){var i=r.coordDim,a=e[i]=e[i]||[];a[r.coordDimIndex]=n.getDimensionIndex(t)}}),e}function jj(n,e,t,r,i,a,o){if(!r){a.remove(e);return}var s=Uae(n,e,t,r,i,a);return s&&o.setItemGraphicEl(t,s),s&&vl(s,r.focus,r.blurScope,r.emphasisDisabled),s}function Uae(n,e,t,r,i,a){var o=-1,s=e;e&&eBe(e,r,i)&&(o=gi(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=Gae(r),s&&GEt(s,u)),r.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),qv.normal.cfg=qv.normal.conOpt=qv.emphasis.cfg=qv.emphasis.conOpt=qv.blur.cfg=qv.blur.conOpt=qv.select.cfg=qv.select.conOpt=null,qv.isLegacy=!1,jEt(u,t,r,i,l,qv),HEt(u,t,r,i,l),zae(n,u,t,r,qv,i,l),Fr(r,"info")&&(H1(u).info=r.info);for(var h=0;h<zS.length;h++){var c=zS[h];if(c!==nS){var f=kG(r,c),d=Vae(r,f,c);Q6e(c,u,f,d,qv)}}return VEt(u,r,i),r.type==="group"&&XEt(n,u,t,r,i),o>=0?a.replaceAt(u,o):a.add(u),u}function eBe(n,e,t){var r=H1(n),i=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i==="path"&&KEt(a)&&tBe(a)!==r.customPathData||i==="image"&&Fr(o,"image")&&o.image!==r.customImagePath}function HEt(n,e,t,r,i){var a=t.clipPath;if(a===!1)n&&n.getClipPath()&&n.removeClipPath();else if(a){var o=n.getClipPath();o&&eBe(o,a,r)&&(o=null),o||(o=Gae(a),n.setClipPath(o)),zae(null,o,e,a,null,r,i)}}function jEt(n,e,t,r,i,a){if(!n.isGroup){fme(t,null,a),fme(t,j1,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var h=n.getTextContent();if(o===!1)h&&n.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},h?h.clearStates():(h=Gae(o),n.setTextContent(h)),zae(null,h,e,o,null,r,i);for(var c=o&&o.style,f=0;f<zS.length;f++){var d=zS[f];if(d!==nS){var v=a[d].conOpt;Q6e(d,h,v,Vae(o,v,d),null)}}c?h.dirty():h.markRedraw()}}}}function fme(n,e,t){var r=e?kG(n,e):n,i=e?Vae(n,r,j1):n.style,a=n.type,o=r?r.textConfig:null,s=n.textContent,l=s?e?kG(s,e):s:null;if(i&&(t.isLegacy||X6e(i,a,!!o,!!l))){t.isLegacy=!0;var u=Y6e(i,a,!e);!o&&u.textConfig&&(o=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var h=l;!h.type&&(h.type="text")}var c=e?t[e]:t.normal;c.cfg=o,c.conOpt=l}function kG(n,e){return e?n?n[e]:null:n}function Vae(n,e,t){var r=e&&e.style;return r==null&&t===j1&&n&&(r=n.styleEmphasis),r}function XEt(n,e,t,r,i){var a=r.children,o=a?a.length:0,s=r.$mergeChildren,l=s==="byName"||r.diffChildrenByName,u=s===!1;if(!(!o&&!l&&!u)){if(l){qEt({api:n,oldChildren:e.children()||[],newChildren:a||[],dataIndex:t,seriesModel:i,group:e});return}u&&e.removeAll();for(var h=0;h<o;h++){var c=a[h],f=e.childAt(h);c?(c.ignore==null&&(c.ignore=!1),Uae(n,f,t,c,i,e)):f.ignore=!0}for(var d=e.childCount()-1;d>=h;d--){var v=e.childAt(d);YEt(e,v,i)}}}function YEt(n,e,t){e&&bU(e,H1(n).option,t)}function qEt(n){new f_(n.oldChildren,n.newChildren,dme,dme,n).add(vme).update(vme).remove(ZEt).execute()}function dme(n,e){var t=n&&n.name;return t!=null?t:FEt+e}function vme(n,e){var t=this.context,r=n!=null?t.newChildren[n]:null,i=e!=null?t.oldChildren[e]:null;Uae(t.api,i,t.dataIndex,r,t.seriesModel,t.group)}function ZEt(n){var e=this.context,t=e.oldChildren[n];t&&bU(t,H1(t).option,e.seriesModel)}function tBe(n){return n&&(n.pathData||n.d)}function KEt(n){return n&&(Fr(n,"pathData")||Fr(n,"d"))}function JEt(n){n.registerChartView(UEt),n.registerSeriesModel(gEt)}var jb=na(),pme=Sn,Xj=kr,QEt=function(){function n(){this._dragging=!1,this.animationThreshold=15}return n.prototype.render=function(e,t,r,i){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=r,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,r);var h=u.graphicKey;h!==this._lastGraphicKey&&this.clear(r),this._lastGraphicKey=h;var c=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Cn,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),r.getZr().add(s);else{var f=Un(gme,t,c);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,t)}mme(s,t,!0),this._renderHandle(a)}},n.prototype.remove=function(e){this.clear(e)},n.prototype.dispose=function(e){this.clear(e)},n.prototype.determineAnimation=function(e,t){var r=t.get("animation"),i=e.axis,a=i.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(r==="auto"||r==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=fae(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return r===!0},n.prototype.makeElOption=function(e,t,r,i,a){},n.prototype.createPointerEl=function(e,t,r,i){var a=t.pointer;if(a){var o=jb(e).pointerEl=new x3[a.type](pme(t.pointer));e.add(o)}},n.prototype.createLabelEl=function(e,t,r,i){if(t.label){var a=jb(e).labelEl=new la(pme(t.label));e.add(a),yme(a,i)}},n.prototype.updatePointerEl=function(e,t,r){var i=jb(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),r(i,{shape:t.pointer.shape}))},n.prototype.updateLabelEl=function(e,t,r,i){var a=jb(e).labelEl;a&&(a.setStyle(t.label.style),r(a,{x:t.label.x,y:t.label.y}),yme(a,i))},n.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,r=this._api.getZr(),i=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){i&&r.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=_3(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){l_(u.event)},onmousedown:Xj(this._onHandleDragMove,this,0,0),drift:Xj(this._onHandleDragMove,this),ondragend:Xj(this._onHandleDragEnd,this)}),r.add(i)),mme(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");Gt(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,VI(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},n.prototype._moveHandleToValue=function(e,t){gme(this._axisPointerModel,!t&&this._moveAnimation,this._handle,Yj(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},n.prototype._onHandleDragMove=function(e,t){var r=this._handle;if(!!r){this._dragging=!0;var i=this.updateHandleTransform(Yj(r),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,r.stopAnimation(),r.attr(Yj(i)),jb(r).lastProp=null,this._doDispatchAxisPointer()}},n.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(!!e){var t=this._payloadInfo,r=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:r.axis.dim,axisIndex:r.componentIndex}]})}},n.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(!!e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},n.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),r=this._group,i=this._handle;t&&r&&(this._lastGraphicKey=null,r&&t.remove(r),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),dD(this,"_doDispatchAxisPointer")},n.prototype.doClear=function(){},n.prototype.buildLabel=function(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}},n}();function gme(n,e,t,r){rBe(jb(t).lastProp,r)||(jb(t).lastProp=r,e?ma(t,r,n):(t.stopAnimation(),t.attr(r)))}function rBe(n,e){if(dn(n)&&dn(e)){var t=!0;return te(e,function(r,i){t=t&&rBe(n[i],r)}),!!t}else return n===e}function yme(n,e){n[e.get(["label","show"])?"show":"hide"]()}function Yj(n){return{x:n.x||0,y:n.y||0,rotation:n.rotation||0}}function mme(n,e,t){var r=e.get("z"),i=e.get("zlevel");n&&n.traverse(function(a){a.type!=="group"&&(r!=null&&(a.z=r),i!=null&&(a.zlevel=i),a.silent=t)})}const $ae=QEt;function Wae(n){var e=n.get("type"),t=n.getModel(e+"Style"),r;return e==="line"?(r=t.getLineStyle(),r.fill=null):e==="shadow"&&(r=t.getAreaStyle(),r.stroke=null),r}function nBe(n,e,t,r,i){var a=t.get("value"),o=iBe(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=FI(s.get("padding")||0),u=s.getFont(),h=v3(o,u),c=i.position,f=h.width+l[1]+l[3],d=h.height+l[0]+l[2],v=i.align;v==="right"&&(c[0]-=f),v==="center"&&(c[0]-=f/2);var p=i.verticalAlign;p==="bottom"&&(c[1]-=d),p==="middle"&&(c[1]-=d/2),e2t(c,f,d,r);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),n.label={x:c[0],y:c[1],style:is(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function e2t(n,e,t,r){var i=r.getWidth(),a=r.getHeight();n[0]=Math.min(n[0]+e,i)-e,n[1]=Math.min(n[1]+t,a)-t,n[0]=Math.max(n[0],0),n[1]=Math.max(n[1],0)}function iBe(n,e,t,r,i){n=e.scale.parse(n);var a=e.scale.getLabel({value:n},{precision:i.precision}),o=i.formatter;if(o){var s={value:nae(e,{value:n}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};te(r,function(l){var u=t.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,c=u&&u.getDataParams(h);c&&s.seriesData.push(c)}),Or(o)?a=o.replace("{value}",a):rn(o)&&(a=o(s))}return a}function Hae(n,e,t){var r=Up();return j2(r,r,t.rotation),sm(r,r,t.position),u0([n.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],r)}function aBe(n,e,t,r,i,a){var o=d_.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),nBe(e,r,i,a,{position:Hae(r.axis,n,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function jae(n,e,t){return t=t||0,{x1:n[t],y1:n[1-t],x2:e[t],y2:e[1-t]}}function oBe(n,e,t){return t=t||0,{x:n[t],y:n[1-t],width:e[t],height:e[1-t]}}function _me(n,e,t,r,i,a){return{cx:n,cy:e,r0:t,r,startAngle:i,endAngle:a,clockwise:!0}}var t2t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),h=xme(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(r,!0));if(u&&u!=="none"){var f=Wae(a),d=r2t[u](s,c,h);d.style=f,t.graphicKey=d.type,t.pointer=d}var v=kJ(l.model,i);aBe(r,t,v,i,a,o)},e.prototype.getHandleTransform=function(t,r,i){var a=kJ(r.axis.grid.model,r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Hae(r.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=xme(s,o).getOtherAxis(o).getGlobalExtent(),h=o.dim==="x"?0:1,c=[t.x,t.y];c[h]+=r[h],c[h]=Math.min(l[1],c[h]),c[h]=Math.max(l[0],c[h]);var f=(u[1]+u[0])/2,d=[f,f];d[h]=c[h];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:d,tooltipOption:v[h]}},e}($ae);function xme(n,e){var t={};return t[e.dim+"AxisIndex"]=e.index,n.getCartesian(t)}var r2t={line:function(n,e,t){var r=jae([e,t[0]],[e,t[1]],Sme(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=Math.max(1,n.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:oBe([e-r/2,t[0]],[r,i],Sme(n))}}};function Sme(n){return n.dim==="x"?0:1}const n2t=t2t;var i2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(oa);const a2t=i2t;var P1=na(),o2t=te;function sBe(n,e,t){if(!sa.node){var r=e.getZr();P1(r).records||(P1(r).records={}),s2t(r,e);var i=P1(r).records[n]||(P1(r).records[n]={});i.handler=t}}function s2t(n,e){if(P1(n).initialized)return;P1(n).initialized=!0,t("click",Un(wme,"click")),t("mousemove",Un(wme,"mousemove")),t("globalout",u2t);function t(r,i){n.on(r,function(a){var o=h2t(e);o2t(P1(n).records,function(s){s&&i(s,a,o.dispatchAction)}),l2t(o.pendings,e)})}}function l2t(n,e){var t=n.showTip.length,r=n.hideTip.length,i;t?i=n.showTip[t-1]:r&&(i=n.hideTip[r-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function u2t(n,e,t){n.handler("leave",null,t)}function wme(n,e,t,r){e.handler(n,t,r)}function h2t(n){var e={showTip:[],hideTip:[]},t=function(r){var i=e[r.type];i?i.push(r):(r.dispatchAction=t,n.dispatchAction(r))};return{dispatchAction:t,pendings:e}}function tQ(n,e){if(!sa.node){var t=e.getZr(),r=(P1(t).records||{})[n];r&&(P1(t).records[n]=null)}}var c2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=r.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";sBe("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,r){tQ("axisPointer",r)},e.prototype.dispose=function(t,r){tQ("axisPointer",r)},e.type="axisPointer",e}(pl);const f2t=c2t;function lBe(n,e){var t=[],r=n.seriesIndex,i;if(r==null||!(i=e.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=YE(a,n);if(o==null||o<0||Gt(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(n.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),c=h.dim,f=u.dim,d=c==="x"||c==="radius"?1:0,v=a.mapDimension(f),p=[];p[d]=a.get(v,o),p[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(p)||[]}else t=l.dataToPoint(a.getValues(Vt(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),t=[g.x+g.width/2,g.y+g.height/2]}return{point:t,el:s}}var bme=na();function d2t(n,e,t){var r=n.currTrigger,i=[n.x,n.y],a=n,o=n.dispatchAction||kr(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(!!s){NB(i)&&(i=lBe({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=NB(i),u=a.axesInfo,h=s.axesInfo,c=r==="leave"||NB(i),f={},d={},v={list:[],map:{}},p={showPointer:Un(p2t,d),showTooltip:Un(g2t,v)};te(s.coordSysMap,function(m,y){var _=l||m.containPoint(i);te(s.coordSysAxesInfo[y],function(x,S){var w=x.axis,b=x2t(u,x);if(!c&&_&&(!u||b)){var E=b&&b.value;E==null&&!l&&(E=w.pointToData(i)),E!=null&&Eme(x,E,p,!1,f)}})});var g={};return te(h,function(m,y){var _=m.linkGroup;_&&!d[y]&&te(_.axesInfo,function(x,S){var w=d[S];if(x!==m&&w){var b=w.value;_.mapper&&(b=m.axis.scale.parse(_.mapper(b,Tme(x),Tme(m)))),g[m.key]=b}})}),te(g,function(m,y){Eme(h[y],m,p,!0,f)}),y2t(d,h,f),m2t(v,i,n,o),_2t(h,o,t),f}}function Eme(n,e,t,r,i){var a=n.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!n.involveSeries){t.showPointer(n,e);return}var o=v2t(e,n),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&Mt(i,s[0]),!r&&n.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(n,e,s),t.showTooltip(n,o,l)}}function v2t(n,e){var t=e.axis,r=t.dim,i=n,a=[],o=Number.MAX_VALUE,s=-1;return te(e.seriesModels,function(l,u){var h=l.getData().mapDimensionsAll(r),c,f;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(h,n,t);f=d.dataIndices,c=d.nestestValue}else{if(f=l.getData().indicesOfNearest(h[0],n,t.type==="category"?.5:null),!f.length)return;c=l.getData().get(h[0],f[0])}if(!(c==null||!isFinite(c))){var v=n-c,p=Math.abs(v);p<=o&&((p<o||v>=0&&s<0)&&(o=p,s=v,i=c,a.length=0),te(f,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:i}}function p2t(n,e,t,r){n[e.key]={value:t,payloadBatch:r}}function g2t(n,e,t,r){var i=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=_D(l),h=n.map[u];h||(h=n.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},n.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function y2t(n,e,t){var r=t.axesInfo=[];te(e,function(i,a){var o=i.axisPointerModel.option,s=n[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&r.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function m2t(n,e,t,r){if(NB(e)||!n.list.length){r({type:"hideTip"});return}var i=((n.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:n.list})}function _2t(n,e,t){var r=t.getZr(),i="axisPointerLastHighlights",a=bme(r)[i]||{},o=bme(r)[i]={};te(n,function(u,h){var c=u.axisPointerModel.option;c.status==="show"&&u.triggerEmphasis&&te(c.seriesDataIndices,function(f){var d=f.seriesIndex+" | "+f.dataIndex;o[d]=f})});var s=[],l=[];te(a,function(u,h){!o[h]&&l.push(u)}),te(o,function(u,h){!a[h]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function x2t(n,e){for(var t=0;t<(n||[]).length;t++){var r=n[t];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}function Tme(n){var e=n.axis.model,t={},r=t.axisDim=n.axis.dim;return t.axisIndex=t[r+"AxisIndex"]=e.componentIndex,t.axisName=t[r+"AxisName"]=e.name,t.axisId=t[r+"AxisId"]=e.id,t}function NB(n){return!n||n[0]==null||isNaN(n[0])||n[1]==null||isNaN(n[1])}function R3(n){K2.registerAxisPointerClass("CartesianAxisPointer",n2t),n.registerComponentModel(a2t),n.registerComponentView(f2t),n.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Gt(t)&&(e.axisPointer.link=[t])}}),n.registerProcessor(n.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=smt(e,t)}),n.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},d2t)}function S2t(n){_i(D5e),_i(R3)}var w2t=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),h=u.getExtent(),c=s.dataToCoord(r),f=a.get("type");if(f&&f!=="none"){var d=Wae(a),v=E2t[f](s,l,c,h);v.style=d,t.graphicKey=v.type,t.pointer=v}var p=a.get(["label","margin"]),g=b2t(r,i,a,l,p);nBe(t,i,a,o,g)},e}($ae);function b2t(n,e,t,r,i){var a=e.axis,o=a.dataToCoord(n),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=r.getRadiusAxis().getExtent(),u,h,c;if(a.dim==="radius"){var f=Up();j2(f,f,s),sm(f,f,[r.cx,r.cy]),u=u0([o,-i],f);var d=e.getModel("axisLabel").get("rotate")||0,v=d_.innerTextLayout(s,d*Math.PI/180,-1);h=v.textAlign,c=v.textVerticalAlign}else{var p=l[1];u=r.coordToPoint([p+i,o]);var g=r.cx,m=r.cy;h=Math.abs(u[0]-g)/p<.3?"center":u[0]>g?"left":"right",c=Math.abs(u[1]-m)/p<.3?"middle":u[1]>m?"top":"bottom"}return{position:u,align:h,verticalAlign:c}}var E2t={line:function(n,e,t,r){return n.dim==="angle"?{type:"Line",shape:jae(e.coordToPoint([r[0],t]),e.coordToPoint([r[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(n,e,t,r){var i=Math.max(1,n.getBandWidth()),a=Math.PI/180;return n.dim==="angle"?{type:"Sector",shape:_me(e.cx,e.cy,r[0],r[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:_me(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}};const T2t=w2t;var C2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var r,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(r=a)},this),r},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(oa);const A2t=C2t;var Xae=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",uu).models[0]},e.type="polarAxis",e}(oa);gu(Xae,T3);var M2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(Xae),I2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(Xae),Yae=function(n){$e(e,n);function e(t,r){return n.call(this,"radius",t,r)||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e}(D0);Yae.prototype.dataToRadius=D0.prototype.dataToCoord;Yae.prototype.radiusToData=D0.prototype.coordToData;const L2t=Yae;var P2t=na(),qae=function(n){$e(e,n);function e(t,r){return n.call(this,"angle",t,r||[0,360])||this}return e.prototype.pointToData=function(t,r){return this.polar.pointToData(t,r)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,r=t.getLabelModel(),i=t.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),h=v3(s==null?"":s+"",r.getFont(),"center","top"),c=Math.max(h.height,7),f=c/u;isNaN(f)&&(f=1/0);var d=Math.max(0,Math.floor(f)),v=P2t(t.model),p=v.lastAutoInterval,g=v.lastTickCount;return p!=null&&g!=null&&Math.abs(p-d)<=1&&Math.abs(g-o)<=1&&p>d?d=p:(v.lastTickCount=o,v.lastAutoInterval=d),d},e}(D0);qae.prototype.dataToAngle=D0.prototype.dataToCoord;qae.prototype.angleToData=D0.prototype.coordToData;const O2t=qae;var uBe=["radius","angle"],R2t=function(){function n(e){this.dimensions=uBe,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new L2t,this._angleAxis=new O2t,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return n.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},n.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},n.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},n.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},n.prototype.getAxesByScale=function(e){var t=[],r=this._angleAxis,i=this._radiusAxis;return r.scale.type===e&&t.push(r),i.scale.type===e&&t.push(i),t},n.prototype.getAngleAxis=function(){return this._angleAxis},n.prototype.getRadiusAxis=function(){return this._radiusAxis},n.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},n.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},n.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},n.prototype.pointToData=function(e,t){var r=this.pointToCoord(e);return[this._radiusAxis.radiusToData(r[0],t),this._angleAxis.angleToData(r[1],t)]},n.prototype.pointToCoord=function(e){var t=e[0]-this.cx,r=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+r*r);t/=l,r/=l;for(var u=Math.atan2(-r,t)/Math.PI*180,h=u<o?1:-1;u<o||u>s;)u+=h*360;return[l,u]},n.prototype.coordToPoint=function(e){var t=e[0],r=e[1]/180*Math.PI,i=Math.cos(r)*t+this.cx,a=-Math.sin(r)*t+this.cy;return[i,a]},n.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),r=t.getExtent().slice();r[0]>r[1]&&r.reverse();var i=e.getExtent(),a=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:r[0],r:r[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,s){var l=o-this.cx,u=s-this.cy,h=l*l+u*u-1e-4,c=this.r,f=this.r0;return h<=c*c&&h>=f*f}}},n.prototype.convertToPixel=function(e,t,r){var i=Cme(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Cme(t);return i===this?this.pointToData(r):null},n}();function Cme(n){var e=n.seriesModel,t=n.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}const D2t=R2t;function N2t(n,e,t){var r=e.get("center"),i=t.getWidth(),a=t.getHeight();n.cx=xr(r[0],i),n.cy=xr(r[1],a);var o=n.getRadiusAxis(),s=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:Gt(l)||(l=[0,l]);var u=[xr(l[0],s),xr(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function k2t(n,e){var t=this,r=t.getAngleAxis(),i=t.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),n.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();te(wG(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),te(wG(l,"angle"),function(u){r.scale.unionExtentFromData(l,u)})}}),pM(r.scale,r.model),pM(i.scale,i.model),r.type==="category"&&!r.onBand){var a=r.getExtent(),o=360/r.scale.count();r.inverse?a[1]+=o:a[1]-=o,r.setExtent(a[0],a[1])}}function F2t(n){return n.mainType==="angleAxis"}function Ame(n,e){if(n.type=e.get("type"),n.scale=pU(e),n.onBand=e.get("boundaryGap")&&n.type==="category",n.inverse=e.get("inverse"),F2t(e)){n.inverse=n.inverse!==e.get("clockwise");var t=e.get("startAngle");n.setExtent(t,t+(n.inverse?-360:360))}e.axis=n,n.model=e}var B2t={dimensions:uBe,create:function(n,e){var t=[];return n.eachComponent("polar",function(r,i){var a=new D2t(i+"");a.update=k2t;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=r.findAxisModel("radiusAxis"),u=r.findAxisModel("angleAxis");Ame(o,l),Ame(s,u),N2t(a,r,e),t.push(a),r.coordinateSystem=a,a.model=r}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="polar"){var i=r.getReferringComponents("polar",uu).models[0];r.coordinateSystem=i.coordinateSystem}}),t}};const G2t=B2t;var z2t=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function k4(n,e,t){e[1]>e[0]&&(e=e.slice().reverse());var r=n.coordToPoint([e[0],t]),i=n.coordToPoint([e[1],t]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function F4(n){var e=n.getRadiusAxis();return e.inverse?0:1}function Mme(n){var e=n[0],t=n[n.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&n.pop()}var U2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,r){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=Vt(i.getViewLabels(),function(h){h=Sn(h);var c=i.scale,f=c.type==="ordinal"?c.getRawOrdinalNumber(h.tickValue):h.tickValue;return h.coord=i.dataToCoord(f),h});Mme(u),Mme(s),te(z2t,function(h){t.get([h,"show"])&&(!i.scale.isBlank()||h==="axisLine")&&V2t[h](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(K2),V2t={axisLine:function(n,e,t,r,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=F4(t),l=s?0:1,u;a[l]===0?u=new cm({shape:{cx:t.cx,cy:t.cy,r:a[s]},style:o.getLineStyle(),z2:1,silent:!0}):u=new Kz({shape:{cx:t.cx,cy:t.cy,r:a[s],r0:a[l]},style:o.getLineStyle(),z2:1,silent:!0}),u.style.fill=null,n.add(u)},axisTick:function(n,e,t,r,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[F4(t)],u=Vt(r,function(h){return new zh({shape:k4(t,[l,l+s],h.coord)})});n.add(Cp(u,{style:sn(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(n,e,t,r,i,a){if(!!i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[F4(t)],h=[],c=0;c<i.length;c++)for(var f=0;f<i[c].length;f++)h.push(new zh({shape:k4(t,[u,u+l],i[c][f].coord)}));n.add(Cp(h,{style:sn(s.getModel("lineStyle").getLineStyle(),sn(o.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(n,e,t,r,i,a,o){var s=e.getCategories(!0),l=e.getModel("axisLabel"),u=l.get("margin"),h=e.get("triggerEvent");te(o,function(c,f){var d=l,v=c.tickValue,p=a[F4(t)],g=t.coordToPoint([p+u,c.coord]),m=t.cx,y=t.cy,_=Math.abs(g[0]-m)/p<.3?"center":g[0]>m?"left":"right",x=Math.abs(g[1]-y)/p<.3?"middle":g[1]>y?"top":"bottom";if(s&&s[v]){var S=s[v];dn(S)&&S.textStyle&&(d=new as(S.textStyle,l,l.ecModel))}var w=new la({silent:d_.isLabelSilent(e),style:is(d,{x:g[0],y:g[1],fill:d.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:c.formattedLabel,align:_,verticalAlign:x})});if(n.add(w),h){var b=d_.makeAxisEventDataBase(e);b.targetType="axisLabel",b.value=c.rawLabel,Bn(w).eventData=b}},this)},splitLine:function(n,e,t,r,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=0;c<r.length;c++){var f=u++%l.length;h[f]=h[f]||[],h[f].push(new zh({shape:k4(t,a,r[c].coord)}))}for(var c=0;c<h.length;c++)n.add(Cp(h[c],{style:sn({stroke:l[c%l.length]},s.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(n,e,t,r,i,a){if(!!i.length){for(var o=e.getModel("minorSplitLine"),s=o.getModel("lineStyle"),l=[],u=0;u<i.length;u++)for(var h=0;h<i[u].length;h++)l.push(new zh({shape:k4(t,a,i[u][h].coord)}));n.add(Cp(l,{style:s.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(n,e,t,r,i,a){if(!!r.length){var o=e.getModel("splitArea"),s=o.getModel("areaStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=Math.PI/180,f=-r[0].coord*c,d=Math.min(a[0],a[1]),v=Math.max(a[0],a[1]),p=e.get("clockwise"),g=1,m=r.length;g<=m;g++){var y=g===m?r[0].coord:r[g].coord,_=u++%l.length;h[_]=h[_]||[],h[_].push(new wd({shape:{cx:t.cx,cy:t.cy,r0:d,r:v,startAngle:f,endAngle:-y*c,clockwise:p},silent:!0})),f=-y*c}for(var g=0;g<h.length;g++)n.add(Cp(h[g],{style:sn({fill:l[g%l.length]},s.getAreaStyle()),silent:!0}))}}};const $2t=U2t;var W2t=["axisLine","axisTickLabel","axisName"],H2t=["splitLine","splitArea","minorSplitLine"],j2t=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,r){if(this.group.removeAll(),!!t.get("show")){var i=this._axisGroup,a=this._axisGroup=new Cn;this.group.add(a);var o=t.axis,s=o.polar,l=s.getAngleAxis(),u=o.getTicksCoords(),h=o.getMinorTicksCoords(),c=l.getExtent()[0],f=o.getExtent(),d=Y2t(s,t,c),v=new d_(t,d);te(W2t,v.add,v),a.add(v.getGroup()),m3(i,a,t),te(H2t,function(p){t.get([p,"show"])&&!o.scale.isBlank()&&X2t[p](this.group,t,s,c,f,u,h)},this)}},e.type="radiusAxis",e}(K2),X2t={splitLine:function(n,e,t,r,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=0;c<a.length;c++){var f=u++%l.length;h[f]=h[f]||[],h[f].push(new cm({shape:{cx:t.cx,cy:t.cy,r:Math.max(a[c].coord,0)}}))}for(var c=0;c<h.length;c++)n.add(Cp(h[c],{style:sn({stroke:l[c%l.length],fill:null},s.getLineStyle()),silent:!0}))},minorSplitLine:function(n,e,t,r,i,a,o){if(!!o.length){for(var s=e.getModel("minorSplitLine"),l=s.getModel("lineStyle"),u=[],h=0;h<o.length;h++)for(var c=0;c<o[h].length;c++)u.push(new cm({shape:{cx:t.cx,cy:t.cy,r:o[h][c].coord}}));n.add(Cp(u,{style:sn({fill:null},l.getLineStyle()),silent:!0}))}},splitArea:function(n,e,t,r,i,a){if(!!a.length){var o=e.getModel("splitArea"),s=o.getModel("areaStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=a[0].coord,f=1;f<a.length;f++){var d=u++%l.length;h[d]=h[d]||[],h[d].push(new wd({shape:{cx:t.cx,cy:t.cy,r0:c,r:a[f].coord,startAngle:0,endAngle:Math.PI*2},silent:!0})),c=a[f].coord}for(var f=0;f<h.length;f++)n.add(Cp(h[f],{style:sn({fill:l[f%l.length]},s.getAreaStyle()),silent:!0}))}}};function Y2t(n,e,t){return{position:[n.cx,n.cy],rotation:t/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}const q2t=j2t;function hBe(n){return n.get("stack")||"__ec_stack_"+n.seriesIndex}function cBe(n,e){return e.dim+n.model.componentIndex}function Z2t(n,e,t){var r={},i=K2t(To(e.getSeriesByType(n),function(a){return!e.isSeriesFiltered(a)&&a.coordinateSystem&&a.coordinateSystem.type==="polar"}));e.eachSeriesByType(n,function(a){if(a.coordinateSystem.type==="polar"){var o=a.getData(),s=a.coordinateSystem,l=s.getBaseAxis(),u=cBe(s,l),h=hBe(a),c=i[u][h],f=c.offset,d=c.width,v=s.getOtherAxis(l),p=a.coordinateSystem.cx,g=a.coordinateSystem.cy,m=a.get("barMinHeight")||0,y=a.get("barMinAngle")||0;r[h]=r[h]||[];for(var _=o.mapDimension(v.dim),x=o.mapDimension(l.dim),S=FS(o,_),w=l.dim!=="radius"||!a.get("roundCap",!0),b=v.dataToCoord(0),E=0,T=o.count();E<T;E++){var C=o.get(_,E),A=o.get(x,E),M=C>=0?"p":"n",I=b;S&&(r[h][A]||(r[h][A]={p:b,n:b}),I=r[h][A][M]);var R=void 0,k=void 0,D=void 0,G=void 0;if(v.dim==="radius"){var W=v.dataToCoord(C)-b,z=l.dataToCoord(A);Math.abs(W)<m&&(W=(W<0?-1:1)*m),R=I,k=I+W,D=z-f,G=D-d,S&&(r[h][A][M]=k)}else{var V=v.dataToCoord(C,w)-b,q=l.dataToCoord(A);Math.abs(V)<y&&(V=(V<0?-1:1)*y),R=q+f,k=R+d,D=I,G=I+V,S&&(r[h][A][M]=G)}o.setItemLayout(E,{cx:p,cy:g,r0:R,r:k,startAngle:-D*Math.PI/180,endAngle:-G*Math.PI/180,clockwise:D>=G})}}})}function K2t(n){var e={};te(n,function(r,i){var a=r.getData(),o=r.coordinateSystem,s=o.getBaseAxis(),l=cBe(o,s),u=s.getExtent(),h=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),c=e[l]||{bandWidth:h,remainedWidth:h,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},f=c.stacks;e[l]=c;var d=hBe(r);f[d]||c.autoWidthCount++,f[d]=f[d]||{width:0,maxWidth:0};var v=xr(r.get("barWidth"),h),p=xr(r.get("barMaxWidth"),h),g=r.get("barGap"),m=r.get("barCategoryGap");v&&!f[d].width&&(v=Math.min(c.remainedWidth,v),f[d].width=v,c.remainedWidth-=v),p&&(f[d].maxWidth=p),g!=null&&(c.gap=g),m!=null&&(c.categoryGap=m)});var t={};return te(e,function(r,i){t[i]={};var a=r.stacks,o=r.bandWidth,s=xr(r.categoryGap,o),l=xr(r.gap,1),u=r.remainedWidth,h=r.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),te(a,function(p,g){var m=p.maxWidth;m&&m<c&&(m=Math.min(m,u),p.width&&(m=Math.min(m,p.width)),u-=m,p.width=m,h--)}),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var f=0,d;te(a,function(p,g){p.width||(p.width=c),d=p,f+=p.width*(1+l)}),d&&(f-=d.width*l);var v=-f/2;te(a,function(p,g){t[i][g]=t[i][g]||{offset:v,width:p.width},v+=p.width*(1+l)})}),t}var J2t={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},Q2t={splitNumber:5},eTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="polar",e}(pl);function tTt(n){_i(R3),K2.registerAxisPointerClass("PolarAxisPointer",T2t),n.registerCoordinateSystem("polar",G2t),n.registerComponentModel(A2t),n.registerComponentView(eTt),yM(n,"angle",M2t,J2t),yM(n,"radius",I2t,Q2t),n.registerComponentView($2t),n.registerComponentView(q2t),n.registerLayout(Un(Z2t,"bar"))}function rQ(n,e){e=e||{};var t=n.coordinateSystem,r=n.axis,i={},a=r.position,o=r.orient,s=t.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};i.position=[o==="vertical"?u.vertical[a]:l[0],o==="horizontal"?u.horizontal[a]:l[3]];var h={horizontal:0,vertical:1};i.rotation=Math.PI/2*h[o];var c={top:-1,bottom:1,right:1,left:-1};i.labelDirection=i.tickDirection=i.nameDirection=c[a],n.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),Gh(e.labelInside,n.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var f=e.rotate;return f==null&&(f=n.get(["axisLabel","rotate"])),i.labelRotation=a==="top"?-f:f,i.z2=1,i}var rTt=["axisLine","axisTickLabel","axisName"],nTt=["splitArea","splitLine"],iTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="SingleAxisPointer",t}return e.prototype.render=function(t,r,i,a){var o=this.group;o.removeAll();var s=this._axisGroup;this._axisGroup=new Cn;var l=rQ(t),u=new d_(t,l);te(rTt,u.add,u),o.add(this._axisGroup),o.add(u.getGroup()),te(nTt,function(h){t.get([h,"show"])&&aTt[h](this,this.group,this._axisGroup,t)},this),m3(s,this._axisGroup,t),n.prototype.render.call(this,t,r,i,a)},e.prototype.remove=function(){P5e(this)},e.type="singleAxis",e}(K2),aTt={splitLine:function(n,e,t,r){var i=r.axis;if(!i.scale.isBlank()){var a=r.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=s instanceof Array?s:[s];for(var l=o.get("width"),u=r.coordinateSystem.getRect(),h=i.isHorizontal(),c=[],f=0,d=i.getTicksCoords({tickModel:a}),v=[],p=[],g=0;g<d.length;++g){var m=i.toGlobalCoord(d[g].coord);h?(v[0]=m,v[1]=u.y,p[0]=m,p[1]=u.y+u.height):(v[0]=u.x,v[1]=m,p[0]=u.x+u.width,p[1]=m);var y=new zh({shape:{x1:v[0],y1:v[1],x2:p[0],y2:p[1]},silent:!0});fM(y.shape,l);var _=f++%s.length;c[_]=c[_]||[],c[_].push(y)}for(var x=o.getLineStyle(["color"]),g=0;g<c.length;++g)e.add(Cp(c[g],{style:sn({stroke:s[g%s.length]},x),silent:!0}))}},splitArea:function(n,e,t,r){L5e(n,t,r,r)}};const oTt=iTt;var fBe=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(oa);gu(fBe,T3.prototype);const qj=fBe;var sTt=function(n){$e(e,n);function e(t,r,i,a,o){var s=n.call(this,t,r,i)||this;return s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.pointToData=function(t,r){return this.coordinateSystem.pointToData(t)[0]},e}(D0);const lTt=sTt;var dBe=["single"],uTt=function(){function n(e,t,r){this.type="single",this.dimension="single",this.dimensions=dBe,this.axisPointerEnabled=!0,this.model=e,this._init(e,t,r)}return n.prototype._init=function(e,t,r){var i=this.dimension,a=new lTt(i,pU(e),[0,0],e.get("type"),e.get("position")),o=a.type==="category";a.onBand=o&&e.get("boundaryGap"),a.inverse=e.get("inverse"),a.orient=e.get("orient"),e.axis=a,a.model=e,a.coordinateSystem=this,this._axis=a},n.prototype.update=function(e,t){e.eachSeries(function(r){if(r.coordinateSystem===this){var i=r.getData();te(i.mapDimensionsAll(this.dimension),function(a){this._axis.scale.unionExtentFromData(i,a)},this),pM(this._axis.scale,this._axis.model)}},this)},n.prototype.resize=function(e,t){this._rect=Uu({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},n.prototype.getRect=function(){return this._rect},n.prototype._adjustAxis=function(){var e=this._rect,t=this._axis,r=t.isHorizontal(),i=r?[0,e.width]:[0,e.height],a=t.inverse?1:0;t.setExtent(i[a],i[1-a]),this._updateAxisTransform(t,r?e.x:e.y)},n.prototype._updateAxisTransform=function(e,t){var r=e.getExtent(),i=r[0]+r[1],a=e.isHorizontal();e.toGlobalCoord=a?function(o){return o+t}:function(o){return i-o+t},e.toLocalCoord=a?function(o){return o-t}:function(o){return i-o+t}},n.prototype.getAxis=function(){return this._axis},n.prototype.getBaseAxis=function(){return this._axis},n.prototype.getAxes=function(){return[this._axis]},n.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},n.prototype.containPoint=function(e){var t=this.getRect(),r=this.getAxis(),i=r.orient;return i==="horizontal"?r.contain(r.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:r.contain(r.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},n.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},n.prototype.dataToPoint=function(e){var t=this.getAxis(),r=this.getRect(),i=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=a===0?r.y+r.height/2:r.x+r.width/2,i},n.prototype.convertToPixel=function(e,t,r){var i=Ime(t);return i===this?this.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Ime(t);return i===this?this.pointToData(r):null},n}();function Ime(n){var e=n.seriesModel,t=n.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function hTt(n,e){var t=[];return n.eachComponent("singleAxis",function(r,i){var a=new uTt(r,n,e);a.name="single_"+i,a.resize(r,e),r.coordinateSystem=a,t.push(a)}),n.eachSeries(function(r){if(r.get("coordinateSystem")==="singleAxis"){var i=r.getReferringComponents("singleAxis",uu).models[0];r.coordinateSystem=i&&i.coordinateSystem}}),t}var cTt={create:hTt,dimensions:dBe};const fTt=cTt;var Lme=["x","y"],dTt=["width","height"],vTt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,r,i,a,o){var s=i.axis,l=s.coordinateSystem,u=Zj(l,1-FG(s)),h=l.dataToPoint(r)[0],c=a.get("type");if(c&&c!=="none"){var f=Wae(a),d=pTt[c](s,h,u);d.style=f,t.graphicKey=d.type,t.pointer=d}var v=rQ(i);aBe(r,t,v,i,a,o)},e.prototype.getHandleTransform=function(t,r,i){var a=rQ(r,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=Hae(r.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,r,i,a){var o=i.axis,s=o.coordinateSystem,l=FG(o),u=Zj(s,l),h=[t.x,t.y];h[l]+=r[l],h[l]=Math.min(u[1],h[l]),h[l]=Math.max(u[0],h[l]);var c=Zj(s,1-l),f=(c[1]+c[0])/2,d=[f,f];return d[l]=h[l],{x:h[0],y:h[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}($ae),pTt={line:function(n,e,t){var r=jae([e,t[0]],[e,t[1]],FG(n));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(n,e,t){var r=n.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:oBe([e-r/2,t[0]],[r,i],FG(n))}}};function FG(n){return n.isHorizontal()?0:1}function Zj(n,e){var t=n.getRect();return[t[Lme[e]],t[Lme[e]]+t[dTt[e]]]}const gTt=vTt;var yTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(pl);function mTt(n){_i(R3),K2.registerAxisPointerClass("SingleAxisPointer",gTt),n.registerComponentView(yTt),n.registerComponentView(oTt),n.registerComponentModel(qj),yM(n,"single",qj,qj.defaultOption),n.registerCoordinateSystem("single",fTt)}var _Tt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r,i){var a=BI(t);n.prototype.init.apply(this,arguments),Pme(t,a)},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),Pme(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(oa);function Pme(n,e){var t=n.cellSize,r;Gt(t)?r=t:r=n.cellSize=[t,t],r.length===1&&(r[1]=r[0]);var i=Vt([0,1],function(a){return Cft(e,a)&&(r[a]="auto"),r[a]!=null&&r[a]!=="auto"});kS(n,e,{type:"box",ignoreSize:i})}const xTt=_Tt;var STt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=r.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,r,i){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=r.start.time;u<=r.end.time;u=a.getNextNDay(u,1).time){var h=a.dataToRect([u],!1).tl,c=new ta({shape:{x:h[0],y:h[1],width:s,height:l},cursor:"default",style:o});i.add(c)}},e.prototype._renderLines=function(t,r,i,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),h=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=r.start,f=0;c.time<=r.end.time;f++){v(c.formatedDate),f===0&&(c=s.getDateInfo(r.start.y+"-"+r.start.m));var d=c.date;d.setMonth(d.getMonth()+1),c=s.getDateInfo(d)}v(s.getNextNDay(r.end.time,1).formatedDate);function v(p){o._firstDayOfMonth.push(s.getDateInfo(p)),o._firstDayPoints.push(s.dataToRect([p],!1).tl);var g=o._getLinePointsOfOneWeek(t,p,i);o._tlpoints.push(g[0]),o._blpoints.push(g[g.length-1]),u&&o._drawSplitline(g,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,h,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,h,i),l,a)},e.prototype._getEdgesPoints=function(t,r,i){var a=[t[0].slice(),t[t.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-r/2,a[1][o]=a[1][o]+r/2,a},e.prototype._drawSplitline=function(t,r,i){var a=new Gd({z2:20,shape:{points:t},style:r});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,r,i){for(var a=t.coordinateSystem,o=a.getDateInfo(r),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),h=a.dataToRect([u.time],!1);s[2*u.day]=h.tl,s[2*u.day+1]=h[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,r){return Or(t)&&t?bft(t,r):rn(t)?t(r):r.nameMap},e.prototype._yearTextPositionControl=function(t,r,i,a,o){var s=r[0],l=r[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,r,i,a){var o=t.getModel("yearLabel");if(!!o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],h=(u[0][0]+u[1][0])/2,c=(u[0][1]+u[1][1])/2,f=i==="horizontal"?0:1,d={top:[h,u[f][1]],bottom:[h,u[1-f][1]],left:[u[1-f][0],c],right:[u[f][0],c]},v=r.start.y;+r.end.y>+r.start.y&&(v=v+"-"+r.end.y);var p=o.get("formatter"),g={start:r.start.y,end:r.end.y,nameMap:v},m=this._formatterLabel(p,g),y=new la({z2:30,style:is(o,{text:m})});y.attr(this._yearTextPositionControl(y,d[l],i,l,s)),a.add(y)}},e.prototype._monthTextPositionControl=function(t,r,i,a,o){var s="left",l="top",u=t[0],h=t[1];return i==="horizontal"?(h=h+o,r&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,r&&(l="middle"),a==="start"&&(s="right")),{x:u,y:h,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,r,i,a){var o=t.getModel("monthLabel");if(!!o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),h=o.get("align"),c=[this._tlpoints,this._blpoints];(!s||Or(s))&&(s&&(r=fJ(s)||r),s=r.get(["time","monthAbbr"])||[]);var f=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var v=h==="center",p=0;p<c[f].length-1;p++){var g=c[f][p].slice(),m=this._firstDayOfMonth[p];if(v){var y=this._firstDayPoints[p];g[d]=(y[d]+c[0][p+1][d])/2}var _=o.get("formatter"),x=s[+m.m-1],S={yyyy:m.y,yy:(m.y+"").slice(2),MM:m.m,M:+m.m,nameMap:x},w=this._formatterLabel(_,S),b=new la({z2:30,style:Mt(is(o,{text:w}),this._monthTextPositionControl(g,v,i,u,l))});a.add(b)}}},e.prototype._weekTextPositionControl=function(t,r,i,a,o){var s="center",l="middle",u=t[0],h=t[1],c=i==="start";return r==="horizontal"?(u=u+a+(c?1:-1)*o[0]/2,s=c?"right":"left"):(h=h+a+(c?1:-1)*o[1]/2,l=c?"bottom":"top"),{x:u,y:h,align:s,verticalAlign:l}},e.prototype._renderWeekText=function(t,r,i,a,o){var s=t.getModel("dayLabel");if(!!s.get("show")){var l=t.coordinateSystem,u=s.get("position"),h=s.get("nameMap"),c=s.get("margin"),f=l.getFirstDayOfWeek();if(!h||Or(h)){h&&(r=fJ(h)||r);var d=r.get(["time","dayOfWeekShort"]);h=d||Vt(r.get(["time","dayOfWeekAbbr"]),function(S){return S[0]})}var v=l.getNextNDay(i.end.time,7-i.lweek).time,p=[l.getCellWidth(),l.getCellHeight()];c=xr(c,Math.min(p[1],p[0])),u==="start"&&(v=l.getNextNDay(i.start.time,-(7+i.fweek)).time,c=-c);for(var g=0;g<7;g++){var m=l.getNextNDay(v,g),y=l.dataToRect([m.time],!1).center,_=g;_=Math.abs((g+f)%7);var x=new la({z2:30,style:Mt(is(s,{text:h[_]}),this._weekTextPositionControl(y,a,u,c,p))});o.add(x)}}},e.type="calendar",e}(pl);const wTt=STt;var Kj=864e5,bTt=function(){function n(e,t,r){this.type="calendar",this.dimensions=n.dimensions,this.getDimensionsInfo=n.getDimensionsInfo,this._model=e}return n.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},n.prototype.getRangeInfo=function(){return this._rangeInfo},n.prototype.getModel=function(){return this._model},n.prototype.getRect=function(){return this._rect},n.prototype.getCellWidth=function(){return this._sw},n.prototype.getCellHeight=function(){return this._sh},n.prototype.getOrient=function(){return this._orient},n.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},n.prototype.getDateInfo=function(e){e=um(e);var t=e.getFullYear(),r=e.getMonth()+1,i=r<10?"0"+r:""+r,a=e.getDate(),o=a<10?"0"+a:""+a,s=e.getDay();return s=Math.abs((s+7-this.getFirstDayOfWeek())%7),{y:t+"",m:i,d:o,day:s,time:e.getTime(),formatedDate:t+"-"+i+"-"+o,date:e}},n.prototype.getNextNDay=function(e,t){return t=t||0,t===0?this.getDateInfo(e):(e=new Date(this.getDateInfo(e).time),e.setDate(e.getDate()+t),this.getDateInfo(e))},n.prototype.update=function(e,t){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var r=this._rangeInfo.weeks||1,i=["width","height"],a=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),s=this._orient==="horizontal"?[r,7]:[7,r];te([0,1],function(c){h(a,c)&&(o[i[c]]=a[c]*s[c])});var l={width:t.getWidth(),height:t.getHeight()},u=this._rect=Uu(o,l);te([0,1],function(c){h(a,c)||(a[c]=u[i[c]]/s[c])});function h(c,f){return c[f]!=null&&c[f]!=="auto"}this._sw=a[0],this._sh=a[1]},n.prototype.dataToPoint=function(e,t){Gt(e)&&(e=e[0]),t==null&&(t=!0);var r=this.getDateInfo(e),i=this._rangeInfo,a=r.formatedDate;if(t&&!(r.time>=i.start.time&&r.time<i.end.time+Kj))return[NaN,NaN];var o=r.day,s=this._getRangeInfo([i.start.time,a]).nthWeek;return this._orient==="vertical"?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+s*this._sh+this._sh/2]:[this._rect.x+s*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},n.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},n.prototype.dataToRect=function(e,t){var r=this.dataToPoint(e,t);return{contentShape:{x:r[0]-(this._sw-this._lineWidth)/2,y:r[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:r,tl:[r[0]-this._sw/2,r[1]-this._sh/2],tr:[r[0]+this._sw/2,r[1]-this._sh/2],br:[r[0]+this._sw/2,r[1]+this._sh/2],bl:[r[0]-this._sw/2,r[1]+this._sh/2]}},n.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,r=Math.floor((e[1]-this._rect.y)/this._sh)+1,i=this._rangeInfo.range;return this._orient==="vertical"?this._getDateByWeeksAndDay(r,t-1,i):this._getDateByWeeksAndDay(t,r-1,i)},n.prototype.convertToPixel=function(e,t,r){var i=Ome(t);return i===this?i.dataToPoint(r):null},n.prototype.convertFromPixel=function(e,t,r){var i=Ome(t);return i===this?i.pointToData(r):null},n.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},n.prototype._initRangeOption=function(){var e=this._model.get("range"),t;if(Gt(e)&&e.length===1&&(e=e[0]),Gt(e))t=e;else{var r=e.toString();if(/^\d{4}$/.test(r)&&(t=[r+"-01-01",r+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(r)){var i=this.getDateInfo(r),a=i.date;a.setMonth(a.getMonth()+1);var o=this.getNextNDay(a,-1);t=[i.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(r)&&(t=[r,r])}if(!t)return e;var s=this._getRangeInfo(t);return s.start.time>s.end.time&&t.reverse(),t},n.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],r;t[0].time>t[1].time&&(r=!0,t.reverse());var i=Math.floor(t[1].time/Kj)-Math.floor(t[0].time/Kj)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var h=Math.floor((i+t[0].day+6)/7),c=r?-h+1:h-1;return r&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:h,nthWeek:c,fweek:t[0].day,lweek:t[1].day}},n.prototype._getDateByWeeksAndDay=function(e,t,r){var i=this._getRangeInfo(r);if(e>i.weeks||e===0&&t<i.fweek||e===i.weeks&&t>i.lweek)return null;var a=(e-1)*7-i.fweek+t,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},n.create=function(e,t){var r=[];return e.eachComponent("calendar",function(i){var a=new n(i);r.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=r[i.get("calendarIndex")||0])}),r},n.dimensions=["time","value"],n}();function Ome(n){var e=n.calendarModel,t=n.seriesModel,r=e?e.coordinateSystem:t?t.coordinateSystem:null;return r}const ETt=bTt;function TTt(n){n.registerComponentModel(xTt),n.registerComponentView(wTt),n.registerCoordinateSystem("calendar",ETt)}function CTt(n,e){var t=n.existing;if(e.id=n.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var r=e.parentOption;r?e.parentId=r.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function Rme(n,e){var t;return te(e,function(r){n[r]!=null&&n[r]!=="auto"&&(t=!0)}),t}function ATt(n,e,t){var r=Mt({},t),i=n[e],a=t.$action||"merge";a==="merge"?i?(ii(i,r,!0),kS(i,r,{ignoreSize:!0}),Jke(t,i),B4(t,i),B4(t,i,"shape"),B4(t,i,"style"),B4(t,i,"extra"),t.clipPath=i.clipPath):n[e]=r:a==="replace"?n[e]=r:a==="remove"&&i&&(n[e]=null)}var vBe=["transition","enterFrom","leaveTo"],MTt=vBe.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function B4(n,e,t){if(t&&(!n[t]&&e[t]&&(n[t]={}),n=n[t],e=e[t]),!(!n||!e))for(var r=t?vBe:MTt,i=0;i<r.length;i++){var a=r[i];n[a]==null&&e[a]!=null&&(n[a]=e[a])}}function ITt(n,e){if(!!n&&(n.hv=e.hv=[Rme(e,["left","right"]),Rme(e,["top","bottom"])],n.type==="group")){var t=n,r=e;t.width==null&&(t.width=r.width=0),t.height==null&&(t.height=r.height=0)}}var LTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.preventAutoZ=!0,t}return e.prototype.mergeOption=function(t,r){var i=this.option.elements;this.option.elements=null,n.prototype.mergeOption.call(this,t,r),this.option.elements=i},e.prototype.optionUpdated=function(t,r){var i=this.option,a=(r?i:t).elements,o=i.elements=r?[]:i.elements,s=[];this._flatten(a,s,null);var l=R3e(o,s,"normalMerge"),u=this._elOptionsToUpdate=[];te(l,function(h,c){var f=h.newOption;!f||(u.push(f),CTt(h,f),ATt(o,c,f),ITt(o[c],f))},this),i.elements=To(o,function(h){return h&&delete h.$action,h!=null})},e.prototype._flatten=function(t,r,i){te(t,function(a){if(!!a){i&&(a.parentOption=i),r.push(a);var o=a.children;o&&o.length&&this._flatten(o,r,a),delete a.children}},this)},e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(oa),Dme={path:null,compoundPath:null,group:Cn,image:xc,text:la},yp=na(),PTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this._elMap=$r()},e.prototype.render=function(t,r,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,i)},e.prototype._updateElements=function(t){var r=t.useElOptionsToUpdate();if(!!r){var i=this._elMap,a=this.group,o=t.get("z"),s=t.get("zlevel");te(r,function(l){var u=Ru(l.id,null),h=u!=null?i.get(u):null,c=Ru(l.parentId,null),f=c!=null?i.get(c):a,d=l.type,v=l.style;d==="text"&&v&&l.hv&&l.hv[1]&&(v.textVerticalAlign=v.textBaseline=v.verticalAlign=v.align=null);var p=l.textContent,g=l.textConfig;if(v&&X6e(v,d,!!g,!!p)){var m=Y6e(v,d,!0);!g&&m.textConfig&&(g=l.textConfig=m.textConfig),!p&&m.textContent&&(p=m.textContent)}var y=OTt(l),_=l.$action||"merge",x=_==="merge",S=_==="replace";if(x){var w=!h,b=h;w?b=Nme(u,f,l.type,i):(b&&(yp(b).isNew=!1),J6e(b)),b&&(DB(b,y,t,{isInit:w}),kme(b,l,o,s))}else if(S){kB(h,l,i,t);var E=Nme(u,f,l.type,i);E&&(DB(E,y,t,{isInit:!0}),kme(E,l,o,s))}else _==="remove"&&(Z6e(h,l),kB(h,l,i,t));var T=i.get(u);if(T&&p)if(x){var C=T.getTextContent();C?C.attr(p):T.setTextContent(new la(p))}else S&&T.setTextContent(new la(p));if(T){var A=l.clipPath;if(A){var M=A.type,I=void 0,w=!1;if(x){var R=T.getClipPath();w=!R||yp(R).type!==M,I=w?nQ(M):R}else S&&(w=!0,I=nQ(M));T.setClipPath(I),DB(I,A,t,{isInit:w}),NG(I,A.keyframeAnimation,t)}var k=yp(T);T.setTextConfig(g),k.option=l,RTt(T,t,l),DI({el:T,componentModel:t,itemName:T.name,itemTooltipOption:l.tooltip}),NG(T,l.keyframeAnimation,t)}})}},e.prototype._relocate=function(t,r){for(var i=t.option.elements,a=this.group,o=this._elMap,s=r.getWidth(),l=r.getHeight(),u=["x","y"],h=0;h<i.length;h++){var c=i[h],f=Ru(c.id,null),d=f!=null?o.get(f):null;if(!(!d||!d.isGroup)){var v=d.parent,p=v===a,g=yp(d),m=yp(v);g.width=xr(g.option.width,p?s:m.width)||0,g.height=xr(g.option.height,p?l:m.height)||0}}for(var h=i.length-1;h>=0;h--){var c=i[h],f=Ru(c.id,null),d=f!=null?o.get(f):null;if(!!d){var v=d.parent,m=yp(v),y=v===a?{width:s,height:l}:{width:m.width,height:m.height},_={},x=sU(d,c,y,null,{hv:c.hv,boundingMode:c.bounding},_);if(!yp(d).isNew&&x){for(var S=c.transition,w={},b=0;b<u.length;b++){var E=u[b],T=_[E];S&&(PE(S)||gi(S,E)>=0)?w[E]=T:d[E]=T}ma(d,w,t,0)}else d.attr(_)}}},e.prototype._clear=function(){var t=this,r=this._elMap;r.each(function(i){kB(i,yp(i).option,r,t._lastGraphicModel)}),this._elMap=$r()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(pl);function nQ(n){var e=Fr(Dme,n)?Dme[n]:Mie(n),t=new e({});return yp(t).type=n,t}function Nme(n,e,t,r){var i=nQ(t);return e.add(i),r.set(n,i),yp(i).id=n,yp(i).isNew=!0,i}function kB(n,e,t,r){var i=n&&n.parent;i&&(n.type==="group"&&n.traverse(function(a){kB(a,e,t,r)}),bU(n,e,r),t.removeKey(yp(n).id))}function kme(n,e,t,r){n.isGroup||te([["cursor",Vp.prototype.cursor],["zlevel",r||0],["z",t||0],["z2",0]],function(i){var a=i[0];Fr(e,a)?n[a]=ni(e[a],i[1]):n[a]==null&&(n[a]=i[1])}),te(Li(e),function(i){if(i.indexOf("on")===0){var a=e[i];n[i]=rn(a)?a:null}}),Fr(e,"draggable")&&(n.draggable=e.draggable),e.name!=null&&(n.name=e.name),e.id!=null&&(n.id=e.id)}function OTt(n){return n=Mt({},n),te(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Kke),function(e){delete n[e]}),n}function RTt(n,e,t){var r=Bn(n).eventData;!n.silent&&!n.ignore&&!r&&(r=Bn(n).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:n.name}),r&&(r.info=t.info)}function DTt(n){n.registerComponentModel(LTt),n.registerComponentView(PTt),n.registerPreprocessor(function(e){var t=e.graphic;Gt(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var Fme=["x","y","radius","angle","single"],NTt=["cartesian2d","polar","singleAxis"];function kTt(n){var e=n.get("coordinateSystem");return gi(NTt,e)>=0}function iS(n){return n+"Axis"}function FTt(n,e){var t=$r(),r=[],i=$r();n.eachComponent({mainType:"dataZoom",query:e},function(h){i.get(h.uid)||s(h)});var a;do a=!1,n.eachComponent("dataZoom",o);while(a);function o(h){!i.get(h.uid)&&l(h)&&(s(h),a=!0)}function s(h){i.set(h.uid,!0),r.push(h),u(h)}function l(h){var c=!1;return h.eachTargetAxis(function(f,d){var v=t.get(f);v&&v[d]&&(c=!0)}),c}function u(h){h.eachTargetAxis(function(c,f){(t.get(c)||t.set(c,[]))[f]=!0})}return r}function pBe(n){var e=n.ecModel,t={infoList:[],infoMap:$r()};return n.eachTargetAxis(function(r,i){var a=e.getComponent(iS(r),i);if(!!a){var o=a.getCoordSysModel();if(!!o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var Jj=function(){function n(){this.indexList=[],this.indexMap=[]}return n.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},n}(),BTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,r,i){var a=Bme(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var r=Bme(t);ii(this.option,t,!0),ii(this.settledOption,r,!0),this._doInit(r)},e.prototype._doInit=function(t){var r=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;te([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(r[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),r=this._targetAxisInfoMap=$r(),i=this._fillSpecifiedTargetAxis(r);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(r,this._orient)),this._noTarget=!0,r.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var r=!1;return te(Fme,function(i){var a=this.getReferringComponents(iS(i),rht);if(!!a.specified){r=!0;var o=new Jj;te(a.models,function(s){o.add(s.componentIndex)}),t.set(i,o)}},this),r},e.prototype._fillAutoTargetAxisByOrient=function(t,r){var i=this.ecModel,a=!0;if(a){var o=r==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===r}});l(s,"single")}function l(u,h){var c=u[0];if(!!c){var f=new Jj;if(f.add(c.componentIndex),t.set(h,f),a=!1,h==="x"||h==="y"){var d=c.getReferringComponents("grid",uu).models[0];d&&te(u,function(v){c.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",uu).models[0]&&f.add(v.componentIndex)})}}}a&&te(Fme,function(u){if(!!a){var h=i.findComponents({mainType:iS(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var c=new Jj;c.add(h[0].componentIndex),t.set(u,c),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(r){!t&&(t=r)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var r=this.ecModel.option;this.option.throttle=r.animation&&r.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var r=this._rangePropMode,i=this.get("rangeMode");te([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?r[o]="percent":!s&&l?r[o]="value":i?r[o]=i[o]:s&&(r[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(r,i){t==null&&(t=this.ecModel.getComponent(iS(r),i))},this),t},e.prototype.eachTargetAxis=function(t,r){this._targetAxisInfoMap.each(function(i,a){te(i.indexList,function(o){t.call(r,a,o)})})},e.prototype.getAxisProxy=function(t,r){var i=this.getAxisModel(t,r);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,r){var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[r])return this.ecModel.getComponent(iS(t),r)},e.prototype.setRawRange=function(t){var r=this.option,i=this.settledOption;te([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(r[a[0]]=i[a[0]]=t[a[0]],r[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var r=this.option;te(["start","startValue","end","endValue"],function(i){r[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,r){if(t==null&&r==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,r).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var r,i=this._targetAxisInfoMap.keys(),a=0;a<i.length;a++)for(var o=i[a],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var u=this.getAxisProxy(o,s.indexList[l]);if(u.hostedBy(this))return u;r||(r=u)}return r},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(oa);function Bme(n){var e={};return te(["start","end","startValue","endValue","throttle"],function(t){n.hasOwnProperty(t)&&(e[t]=n[t])}),e}const TD=BTt;var GTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(TD);const zTt=GTt;var UTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i,a){this.dataZoomModel=t,this.ecModel=r,this.api=i},e.type="dataZoom",e}(pl);const Zae=UTt;var VTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.select",e}(Zae);const $Tt=VTt;var UC=te,Gme=Op,WTt=function(){function n(e,t,r,i){this._dimName=e,this._axisIndex=t,this.ecModel=i,this._dataZoomModel=r}return n.prototype.hostedBy=function(e){return this._dataZoomModel===e},n.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},n.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},n.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(kTt(t)){var r=iS(this._dimName),i=t.getReferringComponents(r,uu).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}},this),e},n.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},n.prototype.getMinMaxSpan=function(){return Sn(this._minMaxSpan)},n.prototype.calculateDataWindow=function(e){var t=this._dataExtent,r=this.getAxisModel(),i=r.axis.scale,a=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],u;UC(["start","end"],function(f,d){var v=e[f],p=e[f+"Value"];a[d]==="percent"?(v==null&&(v=o[d]),p=i.parse(go(v,o,t))):(u=!0,p=p==null?t[d]:i.parse(p),v=go(p,t,o)),l[d]=p==null||isNaN(p)?t[d]:p,s[d]=v==null||isNaN(v)?o[d]:v}),Gme(l),Gme(s);var h=this._minMaxSpan;u?c(l,s,t,o,!1):c(s,l,o,t,!0);function c(f,d,v,p,g){var m=g?"Span":"ValueSpan";J2(0,f,v,"all",h["min"+m],h["max"+m]);for(var y=0;y<2;y++)d[y]=go(f[y],v,p,!0),g&&(d[y]=i.parse(d[y]))}return{valueWindow:l,percentWindow:s}},n.prototype.reset=function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=HTt(this,this._dimName,t),this._updateMinMaxSpan();var r=this.calculateDataWindow(e.settledOption);this._valueWindow=r.valueWindow,this._percentWindow=r.percentWindow,this._setAxisModel()}},n.prototype.filterData=function(e,t){if(e!==this._dataZoomModel)return;var r=this._dimName,i=this.getTargetSeriesModels(),a=e.get("filterMode"),o=this._valueWindow;if(a==="none")return;UC(i,function(l){var u=l.getData(),h=u.mapDimensionsAll(r);if(!!h.length){if(a==="weakFilter"){var c=u.getStore(),f=Vt(h,function(d){return u.getDimensionIndex(d)},u);u.filterSelf(function(d){for(var v,p,g,m=0;m<h.length;m++){var y=c.get(f[m],d),_=!isNaN(y),x=y<o[0],S=y>o[1];if(_&&!x&&!S)return!0;_&&(g=!0),x&&(v=!0),S&&(p=!0)}return g&&v&&p})}else UC(h,function(d){if(a==="empty")l.setData(u=u.map(d,function(p){return s(p)?p:NaN}));else{var v={};v[d]=o,u.selectRange(v)}});UC(h,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},n.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,r=this._dataExtent;UC(["min","max"],function(i){var a=t.get(i+"Span"),o=t.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=go(r[0]+o,r,[0,100],!0):a!=null&&(o=go(a,[0,100],r,!0)-r[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},n.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,r=this._valueWindow;if(!!t){var i=T3e(r,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+r[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+r[1].toFixed(i)),a.freeze()}},n}();function HTt(n,e,t){var r=[1/0,-1/0];UC(t,function(o){pgt(r,o.getData(),e)});var i=n.getAxisModel(),a=O4e(i.axis.scale,i,r).calculate();return[a.min,a.max]}const jTt=WTt;var XTt={getTargetSeries:function(n){function e(i){n.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=n.getComponent(iS(o),s);i(o,s,l,a)})})}e(function(i,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new jTt(i,a,s,n),t.push(o.__dzAxisProxy))});var r=$r();return te(t,function(i){te(i.getTargetSeriesModels(),function(a){r.set(a.uid,a)})}),r},overallReset:function(n,e){n.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).reset(t)}),t.eachTargetAxis(function(r,i){t.getAxisProxy(r,i).filterData(t,e)})}),n.eachComponent("dataZoom",function(t){var r=t.findRepresentativeAxisProxy();if(r){var i=r.getDataPercentWindow(),a=r.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};const YTt=XTt;function qTt(n){n.registerAction("dataZoom",function(e,t){var r=FTt(t,e);te(r,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var zme=!1;function Kae(n){zme||(zme=!0,n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,YTt),qTt(n),n.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function ZTt(n){n.registerComponentModel(zTt),n.registerComponentView($Tt),Kae(n)}var bp=function(){function n(){}return n}(),gBe={};function VC(n,e){gBe[n]=e}function yBe(n){return gBe[n]}var KTt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){n.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;te(this.option.feature,function(r,i){var a=yBe(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),ii(r,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(oa);const JTt=KTt;function QTt(n,e,t){var r=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=Uu(r,a,i);ME(e.get("orient"),n,e.get("itemGap"),o.width,o.height),sU(n,r,a,i)}function mBe(n,e){var t=FI(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),n=new ta({shape:{x:n.x-t[3],y:n.y-t[0],width:n.width+t[1]+t[3],height:n.height+t[0]+t[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1}),n}var eCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},h=this._features||(this._features={}),c=[];te(u,function(v,p){c.push(p)}),new f_(this._featureNames||[],c).add(f).update(f).remove(Un(f,null)).execute(),this._featureNames=c;function f(v,p){var g=c[v],m=c[p],y=u[g],_=new as(y,t,t.ecModel),x;if(a&&a.newTitle!=null&&a.featureName===g&&(y.title=a.newTitle),g&&!m){if(tCt(g))x={onclick:_.option.onclick,featureName:g};else{var S=yBe(g);if(!S)return;x=new S}h[g]=x}else if(x=h[m],!x)return;x.uid=kI("toolbox-feature"),x.model=_,x.ecModel=r,x.api=i;var w=x instanceof bp;if(!g&&m){w&&x.dispose&&x.dispose(r,i);return}if(!_.get("show")||w&&x.unusable){w&&x.remove&&x.remove(r,i);return}d(_,x,g),_.setIconStatus=function(b,E){var T=this.option,C=this.iconPaths;T.iconStatus=T.iconStatus||{},T.iconStatus[b]=E,C[b]&&(E==="emphasis"?h_:c_)(C[b])},x instanceof bp&&x.render&&x.render(_,r,i,a)}function d(v,p,g){var m=v.getModel("iconStyle"),y=v.getModel(["emphasis","iconStyle"]),_=p instanceof bp&&p.getIcons?p.getIcons():v.get("icon"),x=v.get("title")||{},S,w;Or(_)?(S={},S[g]=_):S=_,Or(x)?(w={},w[g]=x):w=x;var b=v.iconPaths={};te(S,function(E,T){var C=_3(E,{},{x:-s/2,y:-s/2,width:s,height:s});C.setStyle(m.getItemStyle());var A=C.ensureState("emphasis");A.style=y.getItemStyle();var M=new la({style:{text:w[T],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null},ignore:!0});C.setTextContent(M),DI({el:C,componentModel:t,itemName:T,formatterParamsExtra:{title:w[T]}}),C.__title=w[T],C.on("mouseover",function(){var I=y.getItemStyle(),R=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";M.setStyle({fill:y.get("textFill")||I.fill||I.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),C.setTextConfig({position:y.get("textPosition")||R}),M.ignore=!t.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){v.get(["iconStatus",T])!=="emphasis"&&i.leaveEmphasis(this),M.hide()}),(v.get(["iconStatus",T])==="emphasis"?h_:c_)(C),o.add(C),C.on("click",kr(p.onclick,p,r,i,T)),b[T]=C})}QTt(o,t,i),o.add(mBe(o.getBoundingRect(),t)),l||o.eachChild(function(v){var p=v.__title,g=v.ensureState("emphasis"),m=g.textConfig||(g.textConfig={}),y=v.getTextContent(),_=y&&y.ensureState("emphasis");if(_&&!rn(_)&&p){var x=_.style||(_.style={}),S=v3(p,la.makeFont(x)),w=v.x+o.x,b=v.y+o.y+s,E=!1;b+S.height>i.getHeight()&&(m.position="top",E=!0);var T=E?-5-S.height:s+10;w+S.width/2>i.getWidth()?(m.position=["100%",T],x.align="right"):w-S.width/2<0&&(m.position=[0,T],x.align="left")}})},e.prototype.updateView=function(t,r,i,a){te(this._features,function(o){o instanceof bp&&o.updateView&&o.updateView(o.model,r,i,a)})},e.prototype.remove=function(t,r){te(this._features,function(i){i instanceof bp&&i.remove&&i.remove(t,r)}),this.group.removeAll()},e.prototype.dispose=function(t,r){te(this._features,function(i){i instanceof bp&&i.dispose&&i.dispose(t,r)})},e.type="toolbox",e}(pl);function tCt(n){return n.indexOf("my")===0}const rCt=eCt;var nCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",o=r.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=r.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=sa.browser;if(rn(MouseEvent)&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+s,h.target="_blank",h.href=l;var c=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});h.dispatchEvent(c)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,v=o?decodeURIComponent(f[1]):f[1];d&&(v=window.atob(v));var p=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var g=v.length,m=new Uint8Array(g);g--;)m[g]=v.charCodeAt(g);var y=new Blob([m]);window.navigator.msSaveOrOpenBlob(y,p)}else{var _=document.createElement("iframe");document.body.appendChild(_);var x=_.contentWindow,S=x.document;S.open("image/svg+xml","replace"),S.write(v),S.close(),x.focus(),S.execCommand("SaveAs",!0,p),document.body.removeChild(_)}}else{var w=i.get("lang"),b='<body style="margin:0;"><img src="'+l+'" style="max-width:100%;" title="'+(w&&w[0]||"")+'" /></body>',E=window.open();E.document.write(b),E.document.title=a}},e.getDefaultOption=function(t){var r={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return r},e}(bp);const iCt=nCt;var Ume="__ec_magicType_stack__",aCt=[["line","bar"],["stack"]],oCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,r=t.get("icon"),i={};return te(t.get("type"),function(a){r[a]&&(i[a]=r[a])}),i},e.getDefaultOption=function(t){var r={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return r},e.prototype.onclick=function(t,r,i){var a=this.model,o=a.get(["seriesIndex",i]);if(!!Vme[i]){var s={series:[]},l=function(c){var f=c.subType,d=c.id,v=Vme[i](f,d,c,a);v&&(sn(v,c.option),s.series.push(v));var p=c.coordinateSystem;if(p&&p.type==="cartesian2d"&&(i==="line"||i==="bar")){var g=p.getAxesByScale("ordinal")[0];if(g){var m=g.dim,y=m+"Axis",_=c.getReferringComponents(y,uu).models[0],x=_.componentIndex;s[y]=s[y]||[];for(var S=0;S<=x;S++)s[y][x]=s[y][x]||{};s[y][x].boundaryGap=i==="bar"}}};te(aCt,function(c){gi(c,i)>=0&&te(c,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,h=i;i==="stack"&&(u=ii({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(h="tiled")),r.dispatchAction({type:"changeMagicType",currentType:h,newOption:s,newTitle:u,featureName:"magicType"})}},e}(bp),Vme={line:function(n,e,t,r){if(n==="bar")return ii({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(n,e,t,r){if(n==="line")return ii({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(n,e,t,r){var i=t.get("stack")===Ume;if(n==="line"||n==="bar")return r.setIconStatus("stack",i?"normal":"emphasis"),ii({id:e,stack:i?"":Ume},r.get(["option","stack"])||{},!0)}};Lm({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(n,e){e.mergeOption(n.newOption)});const sCt=oCt;var EU=new Array(60).join("-"),xM=" ";function lCt(n){var e={},t=[],r=[];return n.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:r}}function uCt(n){var e=[];return te(n,function(t,r){var i=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(Vt(t.series,function(d){return d.name})),l=[i.model.getCategories()];te(t.series,function(d){var v=d.getRawData();l.push(d.getRawData().mapArray(v.mapDimension(o),function(p){return p}))});for(var u=[s.join(xM)],h=0;h<l[0].length;h++){for(var c=[],f=0;f<l.length;f++)c.push(l[f][h]);u.push(c.join(xM))}e.push(u.join(`
`))}),e.join(`
`+EU+`
`)}function hCt(n){return Vt(n,function(e){var t=e.getRawData(),r=[e.name],i=[];return t.each(t.dimensions,function(){for(var a=arguments.length,o=arguments[a-1],s=t.getName(o),l=0;l<a-1;l++)i[l]=arguments[l];r.push((s?s+xM:"")+i.join(xM))}),r.join(`
`)}).join(`
`+EU+`
`)}function cCt(n){var e=lCt(n);return{value:To([uCt(e.seriesGroupByCategoryAxis),hCt(e.other)],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join(`
`+EU+`
`),meta:e.meta}}function BG(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function fCt(n){var e=n.slice(0,n.indexOf(`
`));if(e.indexOf(xM)>=0)return!0}var iQ=new RegExp("["+xM+"]+","g");function dCt(n){for(var e=n.split(/\n+/g),t=BG(e.shift()).split(iQ),r=[],i=Vt(t,function(l){return{name:l,data:[]}}),a=0;a<e.length;a++){var o=BG(e[a]).split(iQ);r.push(o.shift());for(var s=0;s<o.length;s++)i[s]&&(i[s].data[a]=o[s])}return{series:i,categories:r}}function vCt(n){for(var e=n.split(/\n+/g),t=BG(e.shift()),r=[],i=0;i<e.length;i++){var a=BG(e[i]);if(!!a){var o=a.split(iQ),s="",l=void 0,u=!1;isNaN(o[0])?(u=!0,s=o[0],o=o.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var h=0;h<o.length;h++)l.push(+o[h]);l.length===1&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:t,data:r}}function pCt(n,e){var t=n.split(new RegExp(`
*`+EU+`
*`,"g")),r={series:[]};return te(t,function(i,a){if(fCt(i)){var o=dCt(i),s=e[a],l=s.axisDim+"Axis";s&&(r[l]=r[l]||[],r[l][s.axisIndex]={data:o.categories},r.series=r.series.concat(o.series))}else{var o=vCt(i);r.series.push(o)}}),r}var gCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){setTimeout(function(){r.dispatchAction({type:"hideTip"})});var i=r.getDom(),a=this.model;this._dom&&i.removeChild(this._dom);var o=document.createElement("div");o.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",o.style.backgroundColor=a.get("backgroundColor")||"#fff";var s=document.createElement("h4"),l=a.get("lang")||[];s.innerHTML=l[0]||a.get("title"),s.style.cssText="margin:10px 20px",s.style.color=a.get("textColor");var u=document.createElement("div"),h=document.createElement("textarea");u.style.cssText="overflow:auto";var c=a.get("optionToContent"),f=a.get("contentToOption"),d=cCt(t);if(rn(c)){var v=c(r.getOption());Or(v)?u.innerHTML=v:QR(v)&&u.appendChild(v)}else{h.readOnly=a.get("readOnly");var p=h.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=a.get("textColor"),p.borderColor=a.get("textareaBorderColor"),p.backgroundColor=a.get("textareaColor"),h.value=d.value,u.appendChild(h)}var g=d.meta,m=document.createElement("div");m.style.cssText="position:absolute;bottom:5px;left:0;right:0";var y="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),x=document.createElement("div");y+=";background-color:"+a.get("buttonColor"),y+=";color:"+a.get("buttonTextColor");var S=this;function w(){i.removeChild(o),S._dom=null}GK(_,"click",w),GK(x,"click",function(){if(f==null&&c!=null||f!=null&&c==null){w();return}var b;try{rn(f)?b=f(u,r.getOption()):b=pCt(h.value,g)}catch(E){throw w(),new Error("Data view format error "+E)}b&&r.dispatchAction({type:"changeDataView",newOption:b}),w()}),_.innerHTML=l[1],x.innerHTML=l[2],x.style.cssText=_.style.cssText=y,!a.get("readOnly")&&m.appendChild(x),m.appendChild(_),o.appendChild(s),o.appendChild(u),o.appendChild(m),u.style.height=i.clientHeight-80+"px",i.appendChild(o),this._dom=o},e.prototype.remove=function(t,r){this._dom&&r.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,r){this.remove(t,r)},e.getDefaultOption=function(t){var r={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"};return r},e}(bp);function yCt(n,e){return Vt(n,function(t,r){var i=e&&e[r];if(dn(i)&&!Gt(i)){var a=dn(t)&&!Gt(t);a||(t={value:t});var o=i.name!=null&&t.name==null;return t=sn(t,i),o&&delete t.name,t}else return t})}Lm({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(n,e){var t=[];te(n.newOption.series,function(r){var i=e.getSeriesByName(r.name)[0];if(!i)t.push(Mt({type:"scatter"},r));else{var a=i.get("data");t.push({name:r.name,data:yCt(r.data,a)})}}),e.mergeOption(sn({series:t},n.newOption))});const mCt=gCt;var _Be=te,xBe=na();function _Ct(n,e){var t=Jae(n);_Be(e,function(r,i){for(var a=t.length-1;a>=0;a--){var o=t[a];if(o[i])break}if(a<0){var s=n.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function xCt(n){var e=Jae(n),t=e[e.length-1];e.length>1&&e.pop();var r={};return _Be(t,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){r[a]=i;break}}),r}function SCt(n){xBe(n).snapshots=null}function wCt(n){return Jae(n).length}function Jae(n){var e=xBe(n);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var bCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onclick=function(t,r){SCt(t),r.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var r={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return r},e}(bp);Lm({type:"restore",event:"restore",update:"prepareAndUpdate"},function(n,e){e.resetOption("recreate")});const ECt=bCt;var TCt=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],CCt=function(){function n(e,t,r){var i=this;this._targetInfoList=[];var a=$me(t,e);te(ACt,function(o,s){(!r||!r.include||gi(r.include,s)>=0)&&o(a,i._targetInfoList)})}return n.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(r,i,a){if((r.coordRanges||(r.coordRanges=[])).push(i),!r.coordRange){r.coordRange=i;var o=Qj[r.brushType](0,a,i);r.__rangeOffset={offset:Xme[r.brushType](o.values,r.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},n.prototype.matchOutputRanges=function(e,t,r){te(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&te(a.coordSyses,function(o){var s=Qj[i.brushType](1,o,i.range,!0);r(i,s.values,o,t)})},this)},n.prototype.setInputRanges=function(e,t){te(e,function(r){var i=this.findTargetInfo(r,t);if(r.range=r.range||[],i&&i!==!0){r.panelId=i.panelId;var a=Qj[r.brushType](0,i.coordSys,r.coordRange),o=r.__rangeOffset;r.range=o?Xme[r.brushType](a.values,o.offset,MCt(a.xyMinMax,o.xyMinMax)):a.values}},this)},n.prototype.makePanelOpts=function(e,t){return Vt(this._targetInfoList,function(r){var i=r.getPanelRect();return{panelId:r.panelId,defaultBrushType:t?t(r):null,clipPath:A6e(i),isTargetByCursor:I6e(i,e,r.coordSysModel),getLinearBrushOtherExtent:M6e(i)}})},n.prototype.controlSeries=function(e,t,r){var i=this.findTargetInfo(e,r);return i===!0||i&&gi(i.coordSyses,t.coordinateSystem)>=0},n.prototype.findTargetInfo=function(e,t){for(var r=this._targetInfoList,i=$me(t,e),a=0;a<r.length;a++){var o=r[a],s=e.panelId;if(s){if(o.panelId===s)return o}else for(var l=0;l<Wme.length;l++)if(Wme[l](i,o))return o}return!0},n}();function aQ(n){return n[0]>n[1]&&n.reverse(),n}function $me(n,e){return XO(n,e,{includeMainTypes:TCt})}var ACt={grid:function(n,e){var t=n.xAxisModels,r=n.yAxisModels,i=n.gridModels,a=$r(),o={},s={};!t&&!r&&!i||(te(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),te(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),te(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];te(u.getCartesians(),function(c,f){(gi(t,c.getAxis("x").model)>=0||gi(r,c.getAxis("y").model)>=0)&&h.push(c)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:h[0],coordSyses:h,getPanelRect:Hme.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(n,e){te(n.geoModels,function(t){var r=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:r,coordSyses:[r],getPanelRect:Hme.geo})})}},Wme=[function(n,e){var t=n.xAxisModel,r=n.yAxisModel,i=n.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===e.gridModel},function(n,e){var t=n.geoModel;return t&&t===e.geoModel}],Hme={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var n=this.coordSys,e=n.getBoundingRect().clone();return e.applyTransform(AE(n)),e}},Qj={lineX:Un(jme,0),lineY:Un(jme,1),rect:function(n,e,t,r){var i=n?e.pointToData([t[0][0],t[1][0]],r):e.dataToPoint([t[0][0],t[1][0]],r),a=n?e.pointToData([t[0][1],t[1][1]],r):e.dataToPoint([t[0][1],t[1][1]],r),o=[aQ([i[0],a[0]]),aQ([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(n,e,t,r){var i=[[1/0,-1/0],[1/0,-1/0]],a=Vt(t,function(o){var s=n?e.pointToData(o,r):e.dataToPoint(o,r);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function jme(n,e,t,r){var i=t.getAxis(["x","y"][n]),a=aQ(Vt([0,1],function(s){return e?i.coordToData(i.toLocalCoord(r[s]),!0):i.toGlobalCoord(i.dataToCoord(r[s]))})),o=[];return o[n]=a,o[1-n]=[NaN,NaN],{values:a,xyMinMax:o}}var Xme={lineX:Un(Yme,0),lineY:Un(Yme,1),rect:function(n,e,t){return[[n[0][0]-t[0]*e[0][0],n[0][1]-t[0]*e[0][1]],[n[1][0]-t[1]*e[1][0],n[1][1]-t[1]*e[1][1]]]},polygon:function(n,e,t){return Vt(n,function(r,i){return[r[0]-t[0]*e[i][0],r[1]-t[1]*e[i][1]]})}};function Yme(n,e,t,r){return[e[0]-r[n]*t[0],e[1]-r[n]*t[1]]}function MCt(n,e){var t=qme(n),r=qme(e),i=[t[0]/r[0],t[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function qme(n){return n?[n[0][1]-n[0][0],n[1][1]-n[1][0]]:[NaN,NaN]}const Qae=CCt;var oQ=te,ICt=Kut("toolbox-dataZoom_"),LCt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i,a){this._brushController||(this._brushController=new Rae(i.getZr()),this._brushController.on("brush",kr(this._onBrush,this)).mount()),RCt(t,r,this,a,i),OCt(t,r)},e.prototype.onclick=function(t,r,i){PCt[i].call(this)},e.prototype.remove=function(t,r){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,r){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var r=t.areas;if(!t.isEnd||!r.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new Qae(eoe(this.model),a,{include:["grid"]});o.matchOutputRanges(r,a,function(u,h,c){if(c.type==="cartesian2d"){var f=u.brushType;f==="rect"?(s("x",c,h[0]),s("y",c,h[1])):s({lineX:"x",lineY:"y"}[f],c,h)}}),_Ct(a,i),this._dispatchZoomAction(i);function s(u,h,c){var f=h.getAxis(u),d=f.model,v=l(u,d,a),p=v.findRepresentativeAxisProxy(d).getMinMaxSpan();(p.minValueSpan!=null||p.maxValueSpan!=null)&&(c=J2(0,c.slice(),f.scale.getExtent(),0,p.minValueSpan,p.maxValueSpan)),v&&(i[v.id]={dataZoomId:v.id,startValue:c[0],endValue:c[1]})}function l(u,h,c){var f;return c.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var v=d.getAxisModel(u,h.componentIndex);v&&(f=d)}),f}},e.prototype._dispatchZoomAction=function(t){var r=[];oQ(t,function(i,a){r.push(Sn(i))}),r.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:r})},e.getDefaultOption=function(t){var r={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return r},e}(bp),PCt={zoom:function(){var n=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:n})},back:function(){this._dispatchZoomAction(xCt(this.ecModel))}};function eoe(n){var e={xAxisIndex:n.get("xAxisIndex",!0),yAxisIndex:n.get("yAxisIndex",!0),xAxisId:n.get("xAxisId",!0),yAxisId:n.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function OCt(n,e){n.setIconStatus("back",wCt(e)>1?"emphasis":"normal")}function RCt(n,e,t,r,i){var a=t._isZoomActive;r&&r.type==="takeGlobalCursor"&&(a=r.key==="dataZoomSelect"?r.dataZoomSelectActive:!1),t._isZoomActive=a,n.setIconStatus("zoom",a?"emphasis":"normal");var o=new Qae(eoe(n),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:n.getModel("brushStyle").getItemStyle()}:!1)}Oft("dataZoom",function(n){var e=n.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var r=e.getModel(t),i=[],a=eoe(r),o=XO(n,a);oQ(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),oQ(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,h){var c=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:ICt+u+c};f[h]=c,i.push(f)}return i});const DCt=LCt;function NCt(n){n.registerComponentModel(JTt),n.registerComponentView(rCt),VC("saveAsImage",iCt),VC("magicType",sCt),VC("dataView",mCt),VC("dataZoom",DCt),VC("restore",ECt),_i(ZTt)}var kCt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(oa);const FCt=kCt;function SBe(n){var e=n.get("confine");return e!=null?!!e:n.get("renderMode")==="richText"}function wBe(n){if(!!sa.domSupported){for(var e=document.documentElement.style,t=0,r=n.length;t<r;t++)if(n[t]in e)return n[t]}}var bBe=wBe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),BCt=wBe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function EBe(n,e){if(!n)return e;e=qke(e,!0);var t=n.indexOf(e);return n=t===-1?e:"-"+n.slice(0,t)+"-"+e,n.toLowerCase()}function GCt(n,e){var t=n.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(n);return t?e?t[e]:t:null}var zCt=EBe(BCt,"transition"),toe=EBe(bBe,"transform"),UCt="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(sa.transform3dSupported?"will-change:transform;":"");function VCt(n){return n=n==="left"?"right":n==="right"?"left":n==="top"?"bottom":"top",n}function $Ct(n,e,t){if(!Or(t)||t==="inside")return"";var r=n.get("backgroundColor"),i=n.get("borderWidth");e=KE(e);var a=VCt(t),o=Math.max(Math.round(i)*1.5,6),s="",l=toe+":",u;gi(["left","right"],a)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,c=o+i,f=c*Math.abs(Math.cos(h))+c*Math.abs(Math.sin(h)),d=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-c)/2)*100)/100;s+=";"+a+":-"+d+"px";var v=e+" solid "+i+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+r+";"];return'<div style="'+p.join("")+'"></div>'}function WCt(n,e){var t="cubic-bezier(0.23,1,0.32,1)",r=" "+n/2+"s "+t,i="opacity"+r+",visibility"+r;return e||(r=" "+n+"s "+t,i+=sa.transformSupported?","+toe+r:",left"+r+",top"+r),zCt+":"+i}function Zme(n,e,t){var r=n.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!sa.transformSupported)return t?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var a=sa.transform3dSupported,o="translate"+(a?"3d":"")+"("+r+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+toe+":"+o+";":[["top",0],["left",0],[bBe,o]]}function HCt(n){var e=[],t=n.get("fontSize"),r=n.getTextColor();r&&e.push("color:"+r),e.push("font:"+n.getFont()),t&&e.push("line-height:"+Math.round(t*3/2)+"px");var i=n.get("textShadowColor"),a=n.get("textShadowBlur")||0,o=n.get("textShadowOffsetX")||0,s=n.get("textShadowOffsetY")||0;return i&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+i),te(["decoration","align"],function(l){var u=n.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function jCt(n,e,t){var r=[],i=n.get("transitionDuration"),a=n.get("backgroundColor"),o=n.get("shadowBlur"),s=n.get("shadowColor"),l=n.get("shadowOffsetX"),u=n.get("shadowOffsetY"),h=n.getModel("textStyle"),c=PFe(n,"html"),f=l+"px "+u+"px "+o+"px "+s;return r.push("box-shadow:"+f),e&&i&&r.push(WCt(i,t)),a&&r.push("background-color:"+a),te(["width","color","radius"],function(d){var v="border-"+d,p=qke(v),g=n.get(p);g!=null&&r.push(v+":"+g+(d==="color"?"":"px"))}),r.push(HCt(h)),c!=null&&r.push("padding:"+FI(c).join("px ")+"px"),r.join(";")+";"}function Kme(n,e,t,r,i){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&wlt(n,o,document.body,r,i)}else{n[0]=r,n[1]=i;var s=a&&a.getViewportRootOffset();s&&(n[0]+=s.offsetLeft,n[1]+=s.offsetTop)}n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}var XCt=function(){function n(e,t,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,sa.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var a=this._zr=t.getZr(),o=this._appendToBody=r&&r.appendToBody;Kme(this._styleCoord,a,o,t.getWidth()/2,t.getHeight()/2),o?document.body.appendChild(i):e.appendChild(i),this._container=e;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=a.handler,h=a.painter.getViewportRoot();lp(h,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return n.prototype.update=function(e){var t=this._container,r=GCt(t,"position"),i=t.style;i.position!=="absolute"&&r!=="absolute"&&(i.position="relative");var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},n.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var r=this.el,i=r.style,a=this._styleCoord;r.innerHTML?i.cssText=UCt+jCt(e,!this._firstShow,this._longHide)+Zme(a[0],a[1],!0)+("border-color:"+KE(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},n.prototype.setContent=function(e,t,r,i,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Or(a)&&r.get("trigger")==="item"&&!SBe(r)&&(s=$Ct(r,i,a)),Or(e))o.innerHTML=e+s;else if(e){o.innerHTML="",Gt(e)||(e=[e]);for(var l=0;l<e.length;l++)QR(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var u=document.createElement("div");u.innerHTML=s,o.appendChild(u)}}},n.prototype.setEnterable=function(e){this._enterable=e},n.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},n.prototype.moveTo=function(e,t){var r=this._styleCoord;if(Kme(r,this._zr,this._appendToBody,e,t),r[0]!=null&&r[1]!=null){var i=this.el.style,a=Zme(r[0],r[1]);te(a,function(o){i[o[0]]=o[1]})}},n.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},n.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",sa.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},n.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(kr(this.hide,this),e)):this.hide())},n.prototype.isShow=function(){return this._show},n.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},n}();const YCt=XCt;var qCt=function(){function n(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),Qme(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return n.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},n.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},n.prototype.setContent=function(e,t,r,i,a){var o=this;dn(e)&&ao(""),this.el&&this._zr.remove(this.el);var s=r.getModel("textStyle");this.el=new la({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:s.get("textShadowColor"),fill:r.get(["textStyle","color"]),padding:PFe(r,"richText"),verticalAlign:"top",align:"left"},z:r.get("z")}),te(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){o.el.style[u]=r.get(u)}),te(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){o.el.style[u]=s.get(u)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},n.prototype.setEnterable=function(e){this._enterable=e},n.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),r=Jme(e.style);return[t.width+r.left+r.right,t.height+r.top+r.bottom]},n.prototype.moveTo=function(e,t){var r=this.el;if(r){var i=this._styleCoord;Qme(i,this._zr,e,t),e=i[0],t=i[1];var a=r.style,o=Cx(a.borderWidth||0),s=Jme(a);r.x=e+o+s.left,r.y=t+o+s.top,r.markRedraw()}},n.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},n.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},n.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(kr(this.hide,this),e)):this.hide())},n.prototype.isShow=function(){return this._show},n.prototype.dispose=function(){this._zr.remove(this.el)},n}();function Cx(n){return Math.max(0,n)}function Jme(n){var e=Cx(n.shadowBlur||0),t=Cx(n.shadowOffsetX||0),r=Cx(n.shadowOffsetY||0);return{left:Cx(e-t),right:Cx(e+t),top:Cx(e-r),bottom:Cx(e+r)}}function Qme(n,e,t,r){n[0]=t,n[1]=r,n[2]=n[0]/e.getWidth(),n[3]=n[1]/e.getHeight()}const ZCt=qCt;var KCt=new ta({shape:{x:-1,y:-1,width:2,height:2}}),JCt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){if(!(sa.node||!r.getDom())){var i=t.getComponent("tooltip"),a=this._renderMode=iht(i.get("renderMode"));this._tooltipContent=a==="richText"?new ZCt(r):new YCt(r.getDom(),r,{appendToBody:i.get("appendToBody",!0)})}},e.prototype.render=function(t,r,i){if(!(sa.node||!i.getDom())){this.group.removeAll(),this._tooltipModel=t,this._ecModel=r,this._api=i;var a=this._tooltipContent;a.update(t),a.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&t.get("transitionDuration")?VI(this,"_updatePosition",50,"fixRate"):dD(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel,r=t.get("triggerOn");sBe("itemTooltip",this._api,kr(function(i,a,o){r!=="none"&&(r.indexOf(i)>=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,r=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(t,r,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,r,i,a){if(!(a.from===this.uid||sa.node||!i.getDom())){var o=e1e(a,i);this._ticket="";var s=a.dataByCoordSys,l=rAt(a,r,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=KCt;h.x=a.x,h.y=a.y,h.update(),Bn(h).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:h},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,r,i,a))return;var c=lBe(a,r),f=c.point[0],d=c.point[1];f!=null&&d!=null&&this._tryShow({offsetX:f,offsetY:d,target:c.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,r,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(e1e(a,i))},e.prototype._manuallyAxisShowTip=function(t,r,i,a){var o=a.seriesIndex,s=a.dataIndex,l=r.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=r.getSeriesByIndex(o);if(!!u){var h=u.getData(),c=fP([h.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(c.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,r){var i=t.target,a=this._tooltipModel;if(!!a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(i){this._lastDataByCoordSys=null;var s,l;aE(i,function(u){if(Bn(u).dataIndex!=null)return s=u,!0;if(Bn(u).tooltipConfig!=null)return l=u,!0},!0),s?this._showSeriesItemTooltip(t,s,r):l?this._showComponentItemTooltip(t,l,r):this._hide(r)}else this._lastDataByCoordSys=null,this._hide(r)}},e.prototype._showOrMove=function(t,r){var i=t.get("showDelay");r=kr(r,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(r,i):r()},e.prototype._showAxisTooltip=function(t,r){var i=this._ecModel,a=this._tooltipModel,o=[r.offsetX,r.offsetY],s=fP([r.tooltipOption],a),l=this._renderMode,u=[],h=ch("section",{blocks:[],noHeader:!0}),c=[],f=new BH;te(t,function(y){te(y.dataByAxis,function(_){var x=i.getComponent(_.axisDim+"Axis",_.axisIndex),S=_.value;if(!(!x||S==null)){var w=iBe(S,x.axis,i,_.seriesDataIndices,_.valueLabelOpt),b=ch("section",{header:w,noHeader:!Qg(w),sortBlocks:!0,blocks:[]});h.blocks.push(b),te(_.seriesDataIndices,function(E){var T=i.getSeriesByIndex(E.seriesIndex),C=E.dataIndexInside,A=T.getDataParams(C);if(!(A.dataIndex<0)){A.axisDim=_.axisDim,A.axisIndex=_.axisIndex,A.axisType=_.axisType,A.axisId=_.axisId,A.axisValue=nae(x.axis,{value:S}),A.axisValueLabel=w,A.marker=f.makeTooltipMarker("item",KE(A.color),l);var M=Gpe(T.formatTooltip(C,!0,null)),I=M.frag;if(I){var R=fP([T],a).get("valueFormatter");b.blocks.push(R?Mt({valueFormatter:R},I):I)}M.text&&c.push(M.text),u.push(A)}})}})}),h.blocks.reverse(),c.reverse();var d=r.position,v=s.get("order"),p=Hpe(h,f,l,v,i.get("useUTC"),s.get("textStyle"));p&&c.unshift(p);var g=l==="richText"?`
`:"<br/>",m=c.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],d,null,f)})},e.prototype._showSeriesItemTooltip=function(t,r,i){var a=this._ecModel,o=Bn(r),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,h=o.dataIndex,c=o.dataType,f=u.getData(c),d=this._renderMode,v=t.positionDefault,p=fP([f.getItemModel(h),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(h,c),y=new BH;m.marker=y.makeTooltipMarker("item",KE(m.color),d);var _=Gpe(u.formatTooltip(h,!1,c)),x=p.get("order"),S=p.get("valueFormatter"),w=_.frag,b=w?Hpe(S?Mt({valueFormatter:S},w):w,y,d,x,a.get("useUTC"),p.get("textStyle")):_.text,E="item_"+u.name+"_"+h;this._showOrMove(p,function(){this._showTooltipContent(p,b,m,E,t.offsetX,t.offsetY,t.position,t.target,y)}),i({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,r,i){var a=Bn(r),o=a.tooltipConfig,s=o.option||{};if(Or(s)){var l=s;s={content:l,formatter:l}}var u=[s],h=this._ecModel.getComponent(a.componentMainType,a.componentIndex);h&&u.push(h),u.push({formatter:s.content});var c=t.positionDefault,f=fP(u,this._tooltipModel,c?{position:c}:null),d=f.get("content"),v=Math.random()+"",p=new BH;this._showOrMove(f,function(){var g=Sn(f.get("formatterParams")||{});this._showTooltipContent(f,d,g,v,t.offsetX,t.offsetY,t.position,r,p)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,r,i,a,o,s,l,u,h){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var f=t.get("formatter");l=l||t.get("position");var d=r,v=this._getNearestPoint([o,s],i,t.get("trigger"),t.get("borderColor")),p=v.color;if(f)if(Or(f)){var g=t.ecModel.get("useUTC"),m=Gt(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;d=f,y&&(d=rU(m.axisValue,d,g)),d=Zke(d,i,!0)}else if(rn(f)){var _=kr(function(x,S){x===this._ticket&&(c.setContent(S,h,t,p,l),this._updatePosition(t,l,o,s,c,i,u))},this);this._ticket=a,d=f(i,a,_)}else d=f;c.setContent(d,h,t,p,l),c.show(t,p),this._updatePosition(t,l,o,s,c,i,u)}},e.prototype._getNearestPoint=function(t,r,i,a){if(i==="axis"||Gt(r))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!Gt(r))return{color:a||r.color||r.borderColor}},e.prototype._updatePosition=function(t,r,i,a,o,s,l){var u=this._api.getWidth(),h=this._api.getHeight();r=r||t.get("position");var c=o.getSize(),f=t.get("align"),d=t.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),rn(r)&&(r=r([i,a],s,o.el,v,{viewSize:[u,h],contentSize:c.slice()})),Gt(r))i=xr(r[0],u),a=xr(r[1],h);else if(dn(r)){var p=r;p.width=c[0],p.height=c[1];var g=Uu(p,{width:u,height:h});i=g.x,a=g.y,f=null,d=null}else if(Or(r)&&l){var m=tAt(r,v,c,t.get("borderWidth"));i=m[0],a=m[1]}else{var m=QCt(i,a,o,u,h,f?null:20,d?null:20);i=m[0],a=m[1]}if(f&&(i-=t1e(f)?c[0]/2:f==="right"?c[0]:0),d&&(a-=t1e(d)?c[1]/2:d==="bottom"?c[1]:0),SBe(t)){var m=eAt(i,a,o,u,h);i=m[0],a=m[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,r){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===t.length;return o&&te(i,function(s,l){var u=s.dataByAxis||[],h=t[l]||{},c=h.dataByAxis||[];o=o&&u.length===c.length,o&&te(u,function(f,d){var v=c[d]||{},p=f.seriesDataIndices||[],g=v.seriesDataIndices||[];o=o&&f.value===v.value&&f.axisType===v.axisType&&f.axisId===v.axisId&&p.length===g.length,o&&te(p,function(m,y){var _=g[y];o=o&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&te(f.seriesDataIndices,function(m){var y=m.seriesIndex,_=r[y],x=a[y];_&&x&&x.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=r,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,r){sa.node||!r.getDom()||(dD(this,"_updatePosition"),this._tooltipContent.dispose(),tQ("itemTooltip",r))},e.type="tooltip",e}(pl);function fP(n,e,t){var r=e.ecModel,i;t?(i=new as(t,r,r),i=new as(e.option,i,r)):i=e;for(var a=n.length-1;a>=0;a--){var o=n[a];o&&(o instanceof as&&(o=o.get("tooltip",!0)),Or(o)&&(o={formatter:o}),o&&(i=new as(o,i,r)))}return i}function e1e(n,e){return n.dispatchAction||kr(e.dispatchAction,e)}function QCt(n,e,t,r,i,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(n+l+a+2>r?n-=l+a:n+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[n,e]}function eAt(n,e,t,r,i){var a=t.getSize(),o=a[0],s=a[1];return n=Math.min(n+o,r)-o,e=Math.min(e+s,i)-s,n=Math.max(n,0),e=Math.max(e,0),[n,e]}function tAt(n,e,t,r){var i=t[0],a=t[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=e.width,h=e.height;switch(n){case"inside":s=e.x+u/2-i/2,l=e.y+h/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+h+o;break;case"left":s=e.x-i-o,l=e.y+h/2-a/2;break;case"right":s=e.x+u+o,l=e.y+h/2-a/2}return[s,l]}function t1e(n){return n==="center"||n==="middle"}function rAt(n,e,t){var r=pie(n).queryOptionMap,i=r.keys()[0];if(!(!i||i==="series")){var a=p3(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(!!o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var h=Bn(u).tooltipConfig;if(h&&h.name===n.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}const nAt=JCt;function iAt(n){_i(R3),n.registerComponentModel(FCt),n.registerComponentView(nAt),n.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Hl),n.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Hl)}var aAt=["rect","polygon","keep","clear"];function oAt(n,e){var t=Do(n?n.brush:[]);if(!!t.length){var r=[];te(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(r=r.concat(u))});var i=n&&n.toolbox;Gt(i)&&(i=i[0]),i||(i={feature:{}},n.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,r),sAt(s),e&&!s.length&&s.push.apply(s,aAt)}}function sAt(n){var e={};te(n,function(t){e[t]=1}),n.length=0,te(e,function(t,r){n.push(r)})}var r1e=te;function n1e(n){if(n){for(var e in n)if(n.hasOwnProperty(e))return!0}}function sQ(n,e,t){var r={};return r1e(e,function(a){var o=r[a]=i();r1e(n[a],function(s,l){if(!!fc.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new fc(u),l==="opacity"&&(u=Sn(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new fc(u))}})}),r;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function TBe(n,e,t){var r;te(t,function(i){e.hasOwnProperty(i)&&n1e(e[i])&&(r=!0)}),r&&te(t,function(i){e.hasOwnProperty(i)&&n1e(e[i])?n[i]=Sn(e[i]):delete n[i]})}function lAt(n,e,t,r,i,a){var o={};te(n,function(c){var f=fc.prepareVisualTypes(e[c]);o[c]=f});var s;function l(c){return jie(t,s,c)}function u(c,f){UFe(t,s,c,f)}a==null?t.each(h):t.each([a],h);function h(c,f){s=a==null?c:f;var d=t.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var v=r.call(i,c),p=e[v],g=o[v],m=0,y=g.length;m<y;m++){var _=g[m];p[_]&&p[_].applyVisual(c,l,u)}}}function uAt(n,e,t,r){var i={};return te(n,function(a){var o=fc.prepareVisualTypes(e[a]);i[a]=o}),{progress:function(o,s){var l;r!=null&&(l=s.getDimensionIndex(r));function u(S){return jie(s,c,S)}function h(S,w){UFe(s,c,S,w)}for(var c,f=s.getStore();(c=o.next())!=null;){var d=s.getRawDataItem(c);if(!(d&&d.visualMap===!1))for(var v=r!=null?f.get(l,c):c,p=t(v),g=e[p],m=i[p],y=0,_=m.length;y<_;y++){var x=m[y];g[x]&&g[x].applyVisual(v,u,h)}}}}}function hAt(n){var e=n.brushType,t={point:function(r){return i1e[e].point(r,t,n)},rect:function(r){return i1e[e].rect(r,t,n)}};return t}var i1e={lineX:a1e(0),lineY:a1e(1),rect:{point:function(n,e,t){return n&&t.boundingRect.contain(n[0],n[1])},rect:function(n,e,t){return n&&t.boundingRect.intersect(n)}},polygon:{point:function(n,e,t){return n&&t.boundingRect.contain(n[0],n[1])&&Wb(t.range,n[0],n[1])},rect:function(n,e,t){var r=t.range;if(!n||r.length<=1)return!1;var i=n.x,a=n.y,o=n.width,s=n.height,l=r[0];if(Wb(r,i,a)||Wb(r,i+o,a)||Wb(r,i,a+s)||Wb(r,i+o,a+s)||ai.create(n).contain(l[0],l[1])||rO(i,a,i+o,a,r)||rO(i,a,i,a+s,r)||rO(i+o,a,i+o,a+s,r)||rO(i,a+s,i+o,a+s,r))return!0}}};function a1e(n){var e=["x","y"],t=["width","height"];return{point:function(r,i,a){if(r){var o=a.range,s=r[n];return dP(s,o)}},rect:function(r,i,a){if(r){var o=a.range,s=[r[e[n]],r[e[n]]+r[t[n]]];return s[1]<s[0]&&s.reverse(),dP(s[0],o)||dP(s[1],o)||dP(o[0],s)||dP(o[1],s)}}}}function dP(n,e){return e[0]<=n&&n<=e[1]}var o1e=["inBrush","outOfBrush"],eX="__ecBrushSelect",lQ="__ecInBrushSelectEvent";function CBe(n){n.eachComponent({mainType:"brush"},function(e){var t=e.brushTargetManager=new Qae(e.option,n);t.setInputRanges(e.areas,n)})}function cAt(n,e,t){var r=[],i,a;n.eachComponent({mainType:"brush"},function(o){t&&t.type==="takeGlobalCursor"&&o.setBrushOption(t.key==="brush"?t.brushOption:{brushType:!1})}),CBe(n),n.eachComponent({mainType:"brush"},function(o,s){var l={brushId:o.id,brushIndex:s,brushName:o.name,areas:Sn(o.areas),selected:[]};r.push(l);var u=o.option,h=u.brushLink,c=[],f=[],d=[],v=!1;s||(i=u.throttleType,a=u.throttleDelay);var p=Vt(o.areas,function(S){var w=pAt[S.brushType],b=sn({boundingRect:w?w(S):void 0},S);return b.selectors=hAt(b),b}),g=sQ(o.option,o1e,function(S){S.mappingMethod="fixed"});Gt(h)&&te(h,function(S){c[S]=1});function m(S){return h==="all"||!!c[S]}function y(S){return!!S.length}n.eachSeries(function(S,w){var b=d[w]=[];S.subType==="parallel"?_(S,w):x(S,w,b)});function _(S,w){var b=S.coordinateSystem;v=v||b.hasAxisBrushed(),m(w)&&b.eachActiveState(S.getData(),function(E,T){E==="active"&&(f[T]=1)})}function x(S,w,b){if(!(!S.brushSelector||vAt(o,w))&&(te(p,function(T){o.brushTargetManager.controlSeries(T,S,n)&&b.push(T),v=v||y(b)}),m(w)&&y(b))){var E=S.getData();E.each(function(T){s1e(S,b,E,T)&&(f[T]=1)})}}n.eachSeries(function(S,w){var b={seriesId:S.id,seriesIndex:w,seriesName:S.name,dataIndex:[]};l.selected.push(b);var E=d[w],T=S.getData(),C=m(w)?function(A){return f[A]?(b.dataIndex.push(T.getRawIndex(A)),"inBrush"):"outOfBrush"}:function(A){return s1e(S,E,T,A)?(b.dataIndex.push(T.getRawIndex(A)),"inBrush"):"outOfBrush"};(m(w)?v:y(E))&&lAt(o1e,g,T,C)})}),fAt(e,i,a,r,t)}function fAt(n,e,t,r,i){if(!!i){var a=n.getZr();if(!a[lQ]){a[eX]||(a[eX]=dAt);var o=VI(a,eX,t,e);o(n,r)}}}function dAt(n,e){if(!n.isDisposed()){var t=n.getZr();t[lQ]=!0,n.dispatchAction({type:"brushSelect",batch:e}),t[lQ]=!1}}function s1e(n,e,t,r){for(var i=0,a=e.length;i<a;i++){var o=e[i];if(n.brushSelector(r,t,o.selectors,o))return!0}}function vAt(n,e){var t=n.option.seriesIndex;return t!=null&&t!=="all"&&(Gt(t)?gi(t,e)<0:e!==t)}var pAt={rect:function(n){return l1e(n.range)},polygon:function(n){for(var e,t=n.range,r=0,i=t.length;r<i;r++){e=e||[[1/0,-1/0],[1/0,-1/0]];var a=t[r];a[0]<e[0][0]&&(e[0][0]=a[0]),a[0]>e[0][1]&&(e[0][1]=a[0]),a[1]<e[1][0]&&(e[1][0]=a[1]),a[1]>e[1][1]&&(e[1][1]=a[1])}return e&&l1e(e)}};function l1e(n){return new ai(n[0][0],n[1][0],n[0][1]-n[0][0],n[1][1]-n[1][0])}var gAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.ecModel=t,this.api=r,this.model,(this._brushController=new Rae(r.getZr())).on("brush",kr(this._onBrush,this)).mount()},e.prototype.render=function(t,r,i,a){this.model=t,this._updateController(t,r,i,a)},e.prototype.updateTransform=function(t,r,i,a){CBe(r),this._updateController(t,r,i,a)},e.prototype.updateVisual=function(t,r,i,a){this.updateTransform(t,r,i,a)},e.prototype.updateView=function(t,r,i,a){this._updateController(t,r,i,a)},e.prototype._updateController=function(t,r,i,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var r=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:r,areas:Sn(i),$from:r}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:r,areas:Sn(i),$from:r})},e.type="brush",e}(pl);const yAt=gAt;var mAt="#ddd",_At=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&TBe(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:mAt},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){!t||(this.areas=Vt(t,function(r){return u1e(this.option,r)},this))},e.prototype.setBrushOption=function(t){this.brushOption=u1e(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(oa);function u1e(n,e){return ii({brushType:n.brushType,brushMode:n.brushMode,transformable:n.transformable,brushStyle:new as(n.brushStyle).getItemStyle(),removeOnClick:n.removeOnClick,z:n.z},e,!0)}const xAt=_At;var SAt=["rect","polygon","lineX","lineY","keep","clear"],wAt=function(n){$e(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(t,r,i){var a,o,s;r.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,te(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,r,i){this.render(t,r,i)},e.prototype.getIcons=function(){var t=this.model,r=t.get("icon",!0),i={};return te(t.get("type",!0),function(a){r[a]&&(i[a]=r[a])}),i},e.prototype.onclick=function(t,r,i){var a=this._brushType,o=this._brushMode;i==="clear"?(r.dispatchAction({type:"axisAreaSelect",intervals:[]}),r.dispatchAction({type:"brush",command:"clear",areas:[]})):r.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var r={show:!0,type:SAt.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return r},e}(bp);const bAt=wAt;function EAt(n){n.registerComponentView(yAt),n.registerComponentModel(xAt),n.registerPreprocessor(oAt),n.registerVisual(n.PRIORITY.VISUAL.BRUSH,cAt),n.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(r){r.setAreas(e.areas)})}),n.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Hl),n.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Hl),VC("brush",bAt)}var TAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(oa),CAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,r,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=ni(t.get("textBaseline"),t.get("textVerticalAlign")),h=new la({style:is(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),c=h.getBoundingRect(),f=t.get("subtext"),d=new la({style:is(s,{text:f,fill:s.getTextColor(),y:c.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=t.get("link"),p=t.get("sublink"),g=t.get("triggerEvent",!0);h.silent=!v&&!g,d.silent=!p&&!g,v&&h.on("click",function(){dG(v,"_"+t.get("target"))}),p&&d.on("click",function(){dG(p,"_"+t.get("subtarget"))}),Bn(h).eventData=Bn(d).eventData=g?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(h),f&&a.add(d);var m=a.getBoundingRect(),y=t.getBoxLayoutParams();y.width=m.width,y.height=m.height;var _=Uu(y,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?_.x+=_.width:l==="center"&&(_.x+=_.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?_.y+=_.height:u==="middle"&&(_.y+=_.height/2),u=u||"top"),a.x=_.x,a.y=_.y,a.markRedraw();var x={align:l,verticalAlign:u};h.setStyle(x),d.setStyle(x),m=a.getBoundingRect();var S=_.margin,w=t.getItemStyle(["color","opacity"]);w.fill=t.get("backgroundColor");var b=new ta({shape:{x:m.x-S[3],y:m.y-S[0],width:m.width+S[1]+S[3],height:m.height+S[0]+S[2],r:t.get("borderRadius")},style:w,subPixelOptimize:!0,silent:!0});a.add(b)}},e.type="title",e}(pl);function AAt(n){n.registerComponentModel(TAt),n.registerComponentView(CAt)}var MAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){n.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var r=this._data.count();this.option.loop?t=(t%r+r)%r:(t>=r&&(t=r-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,r=t.data||[],i=t.axisType,a=this._names=[],o;i==="category"?(o=[],te(r,function(u,h){var c=Ru(PI(u),""),f;dn(u)?(f=Sn(u),f.value=h):f=h,o.push(f),a.push(c)})):o=r;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new Df([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(oa);const h1e=MAt;var ABe=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=xw(h1e.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(h1e);gu(ABe,Uie.prototype);const IAt=ABe;var LAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(pl);const PAt=LAt;var OAt=function(n){$e(e,n);function e(t,r,i,a){var o=n.call(this,t,r,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(D0);const RAt=OAt;var tX=Math.PI,c1e=na(),DAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,r){this.api=r},e.prototype.render=function(t,r,i){if(this.model=t,this.api=i,this.ecModel=r,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return ch("nameValue",{noName:!0,value:h})},te(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,r){var i=t.get(["label","position"]),a=t.get("orient"),o=kAt(t,r),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2<r.getHeight()/2?"-":"+":o.x+o.width/2<r.getWidth()/2?"+":"-":Or(i)?s={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[a][i]:s=i;var l={horizontal:"center",vertical:s>=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:tX/2},c=a==="vertical"?o.height:o.width,f=t.getModel("controlStyle"),d=f.get("show",!0),v=d?f.get("itemSize"):0,p=d?f.get("itemGap"):0,g=v+p,m=t.get(["label","rotate"])||0;m=m*tX/180;var y,_,x,S=f.get("position",!0),w=d&&f.get("showPlayBtn",!0),b=d&&f.get("showPrevBtn",!0),E=d&&f.get("showNextBtn",!0),T=0,C=c;S==="left"||S==="bottom"?(w&&(y=[0,0],T+=g),b&&(_=[T,0],T+=g),E&&(x=[C-v,0],C-=g)):(w&&(y=[C-v,0],C-=g),b&&(_=[0,0],T+=g),E&&(x=[C-v,0],C-=g));var A=[T,C];return t.get("inverse")&&A.reverse(),{viewRect:o,mainLength:c,orient:a,rotation:h[a],labelRotation:m,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:y,prevBtnPosition:_,nextBtnPosition:x,axisExtent:A,controlSize:v,controlGap:p}},e.prototype._position=function(t,r){var i=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=Up(),l=o.x,u=o.y+o.height;sm(s,s,[-l,-u]),j2(s,s,-tX/2),sm(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var h=y(o),c=y(i.getBoundingRect()),f=y(a.getBoundingRect()),d=[i.x,i.y],v=[a.x,a.y];v[0]=d[0]=h[0][0];var p=t.labelPosOpt;if(p==null||Or(p)){var g=p==="+"?0:1;_(d,c,h,1,g),_(v,f,h,1,1-g)}else{var g=p>=0?0:1;_(d,c,h,1,g),v[1]=d[1]+p}i.setPosition(d),a.setPosition(v),i.rotation=a.rotation=t.rotation,m(i),m(a);function m(x){x.originX=h[0][0]-x.x,x.originY=h[1][0]-x.y}function y(x){return[[x.x,x.x+x.width],[x.y,x.y+x.height]]}function _(x,S,w,b,E){x[b]+=w[b][E]-S[b][E]}},e.prototype._createAxis=function(t,r){var i=r.getData(),a=r.get("axisType"),o=NAt(r,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new RAt("value",o,t.axisExtent,a);return l.model=r,l},e.prototype._createGroup=function(t){var r=this[t]=new Cn;return this.group.add(r),r},e.prototype._renderAxisLine=function(t,r,i,a){var o=i.getExtent();if(!!a.get(["lineStyle","show"])){var s=new zh({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:Mt({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});r.add(s);var l=this._progressLine=new zh({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:sn({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});r.add(l)}},e.prototype._renderAxisTick=function(t,r,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],te(l,function(u){var h=i.dataToCoord(u.value),c=s.getItemModel(u.value),f=c.getModel("itemStyle"),d=c.getModel(["emphasis","itemStyle"]),v=c.getModel(["progress","itemStyle"]),p={x:h,y:0,onclick:kr(o._changeTimeline,o,u.value)},g=f1e(c,f,r,p);g.ensureState("emphasis").style=d.getItemStyle(),g.ensureState("progress").style=v.getItemStyle(),CE(g);var m=Bn(g);c.get("tooltip")?(m.dataIndex=u.value,m.dataModel=a):m.dataIndex=m.dataModel=null,o._tickSymbols.push(g)})},e.prototype._renderAxisLabel=function(t,r,i,a){var o=this,s=i.getLabelModel();if(!!s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],te(u,function(h){var c=h.tickValue,f=l.getItemModel(c),d=f.getModel("label"),v=f.getModel(["emphasis","label"]),p=f.getModel(["progress","label"]),g=i.dataToCoord(h.tickValue),m=new la({x:g,y:0,rotation:t.labelRotation-t.rotation,onclick:kr(o._changeTimeline,o,c),silent:!1,style:is(d,{text:h.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});m.ensureState("emphasis").style=is(v),m.ensureState("progress").style=is(p),r.add(m),CE(m),c1e(m).dataIndex=c,o._tickLabels.push(m)})}},e.prototype._renderControl=function(t,r,i,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),h=a.getPlayState(),c=a.get("inverse",!0);f(t.nextBtnPosition,"next",kr(this._changeTimeline,this,c?"-":"+")),f(t.prevBtnPosition,"prev",kr(this._changeTimeline,this,c?"+":"-")),f(t.playPosition,h?"stop":"play",kr(this._handlePlayClick,this,!h),!0);function f(d,v,p,g){if(!!d){var m=_0(ni(a.get(["controlStyle",v+"BtnSize"]),o),o),y=[0,-m/2,m,m],_=FAt(a,v+"Icon",y,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:g?-s:0,rectHover:!0,style:l,onclick:p});_.ensureState("emphasis").style=u,r.add(_),CE(_)}}},e.prototype._renderCurrentPointer=function(t,r,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,h={onCreate:function(c){c.draggable=!0,c.drift=kr(u._handlePointerDrag,u),c.ondragend=kr(u._handlePointerDragend,u),d1e(c,u._progressLine,s,i,a,!0)},onUpdate:function(c){d1e(c,u._progressLine,s,i,a)}};this._currentPointer=f1e(l,l,this._mainGroup,{},this._currentPointer,h)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,r,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,r){var i=this._toAxisCoord(t)[0],a=this._axis,o=Op(a.getExtent().slice());i>o[1]&&(i=o[1]),i<o[0]&&(i=o[0]),this._currentPointer.x=i,this._currentPointer.markRedraw();var s=this._progressLine;s&&(s.shape.x2=i,s.dirty());var l=this._findNearestTick(i),u=this.model;(r||l!==u.getCurrentIndex()&&u.get("realtime"))&&this._changeTimeline(l)},e.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var r=t.model;t._changeTimeline(r.getCurrentIndex()+(r.get("rewind",!0)?-1:1))},this.model.get("playInterval")))},e.prototype._toAxisCoord=function(t){var r=this._mainGroup.getLocalTransform();return u0(t,r,!0)},e.prototype._findNearestTick=function(t){var r=this.model.getData(),i=1/0,a,o=this._axis;return r.each(["value"],function(s,l){var u=o.dataToCoord(s),h=Math.abs(u-t);h<i&&(i=h,a=l)}),a},e.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},e.prototype._changeTimeline=function(t){var r=this.model.getCurrentIndex();t==="+"?t=r+1:t==="-"&&(t=r-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},e.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),r=this._tickSymbols,i=this._tickLabels;if(r)for(var a=0;a<r.length;a++)r&&r[a]&&r[a].toggleState("progress",a<t);if(i)for(var a=0;a<i.length;a++)i&&i[a]&&i[a].toggleState("progress",c1e(i[a]).dataIndex<=t)},e.type="timeline.slider",e}(PAt);function NAt(n,e){if(e=e||n.get("type"),e)switch(e){case"category":return new Qie({ordinalMeta:n.getCategories(),extent:[1/0,-1/0]});case"time":return new L4e({locale:n.ecModel.getLocaleModel(),useUTC:n.ecModel.get("useUTC")});default:return new BS}}function kAt(n,e){return Uu(n.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},n.get("padding"))}function FAt(n,e,t,r){var i=r.style,a=_3(n.get(["controlStyle",e]),r||{},new ai(t[0],t[1],t[2],t[3]));return i&&a.setStyle(i),a}function f1e(n,e,t,r,i,a){var o=e.get("color");if(i)i.setColor(o),t.add(i),a&&a.onUpdate(i);else{var s=n.get("symbol");i=hu(s,-1,-1,2,2,o),i.setStyle("strokeNoScale",!0),t.add(i),a&&a.onCreate(i)}var l=e.getItemStyle(["color"]);i.setStyle(l),r=ii({rectHover:!0,z2:100},r,!0);var u=$I(n.get("symbolSize"));r.scaleX=u[0]/2,r.scaleY=u[1]/2;var h=Y2(n.get("symbolOffset"),u);h&&(r.x=(r.x||0)+h[0],r.y=(r.y||0)+h[1]);var c=n.get("symbolRotate");return r.rotation=(c||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function d1e(n,e,t,r,i,a){if(!n.dragging){var o=i.getModel("checkpointStyle"),s=r.dataToCoord(i.getData().get("value",t));if(a||!o.get("animation",!0))n.attr({x:s,y:0}),e&&e.attr({shape:{x2:s}});else{var l={duration:o.get("animationDuration",!0),easing:o.get("animationEasing",!0)};n.stopAnimation(null,!0),n.animateTo({x:s,y:0},l),e&&e.animateTo({shape:{x2:s}},l)}}}const BAt=DAt;function GAt(n){n.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(e,t,r){var i=t.getComponent("timeline");return i&&e.currentIndex!=null&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.getPlayState()&&(i.setPlayState(!1),r.dispatchAction({type:"timelinePlayChange",playState:!1,from:e.from}))),t.resetOption("timeline",{replaceMerge:i.get("replaceMerge",!0)}),sn({currentIndex:i.option.currentIndex},e)}),n.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(e,t){var r=t.getComponent("timeline");r&&e.playState!=null&&r.setPlayState(e.playState)})}function zAt(n){var e=n&&n.timeline;Gt(e)||(e=e?[e]:[]),te(e,function(t){!t||UAt(t)})}function UAt(n){var e=n.type,t={number:"value",time:"time"};if(t[e]&&(n.axisType=t[e],delete n.type),v1e(n),Xb(n,"controlPosition")){var r=n.controlStyle||(n.controlStyle={});Xb(r,"position")||(r.position=n.controlPosition),r.position==="none"&&!Xb(r,"show")&&(r.show=!1,delete r.position),delete n.controlPosition}te(n.data||[],function(i){dn(i)&&!Gt(i)&&(!Xb(i,"value")&&Xb(i,"name")&&(i.value=i.name),v1e(i))})}function v1e(n){var e=n.itemStyle||(n.itemStyle={}),t=e.emphasis||(e.emphasis={}),r=n.label||n.label||{},i=r.normal||(r.normal={}),a={normal:1,emphasis:1};te(r,function(o,s){!a[s]&&!Xb(i,s)&&(i[s]=o)}),t.label&&!Xb(r,"emphasis")&&(r.emphasis=t.label,delete t.label)}function Xb(n,e){return n.hasOwnProperty(e)}function VAt(n){n.registerComponentModel(IAt),n.registerComponentView(BAt),n.registerSubTypeDefaulter("timeline",function(){return"slider"}),GAt(n),n.registerPreprocessor(zAt)}function roe(n,e){if(!n)return!1;for(var t=Gt(n)?n:[n],r=0;r<t.length;r++)if(t[r]&&t[r][e])return!0;return!1}function G4(n){XE(n,"label",["show"])}var z4=na(),MBe=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.createdBySelf=!1,t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),this._mergeOption(t,i,!1,!0)},e.prototype.isAnimationEnabled=function(){if(sa.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},e.prototype.mergeOption=function(t,r){this._mergeOption(t,r,!1,!1)},e.prototype._mergeOption=function(t,r,i,a){var o=this.mainType;i||r.eachSeries(function(s){var l=s.get(this.mainType,!0),u=z4(s)[o];if(!l||!l.data){z4(s)[o]=null;return}u?u._mergeOption(l,r,!0):(a&&G4(l),te(l.data,function(h){h instanceof Array?(G4(h[0]),G4(h[1])):G4(h)}),u=this.createMarkerModelFromSeries(l,this,r),Mt(u,{mainType:this.mainType,seriesIndex:s.seriesIndex,name:s.name,createdBySelf:!0}),u.__hostSeries=s),z4(s)[o]=u},this)},e.prototype.formatTooltip=function(t,r,i){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return ch("section",{header:this.name,blocks:[ch("nameValue",{name:s,value:o,noName:!s,noValue:o==null})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.getMarkerModelFromSeries=function(t,r){return z4(t)[r]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(oa);gu(MBe,Uie.prototype);const US=MBe;var $At=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,i)},e.type="markPoint",e.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(US);const WAt=$At;function uQ(n){return!(isNaN(parseFloat(n.x))&&isNaN(parseFloat(n.y)))}function HAt(n){return!isNaN(parseFloat(n.x))&&!isNaN(parseFloat(n.y))}function U4(n,e,t,r,i,a){var o=[],s=FS(e,r),l=s?e.getCalculationInfo("stackResultDimension"):r,u=noe(e,l,n),h=e.indicesOfNearest(l,u)[0];o[i]=e.get(t,h),o[a]=e.get(l,h);var c=e.get(r,h),f=Ny(e.get(r,h));return f=Math.min(f,20),f>=0&&(o[a]=+o[a].toFixed(f)),[o,c]}var rX={min:Un(U4,"min"),max:Un(U4,"max"),average:Un(U4,"average"),median:Un(U4,"median")};function CD(n,e){if(!!e){var t=n.getData(),r=n.coordinateSystem,i=r&&r.dimensions;if(!HAt(e)&&!Gt(e.coord)&&Gt(i)){var a=IBe(e,t,r,n);if(e=Sn(e),e.type&&rX[e.type]&&a.baseAxis&&a.valueAxis){var o=gi(i,a.baseAxis.dim),s=gi(i,a.valueAxis.dim),l=rX[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!Gt(i))e.coord=[];else for(var u=e.coord,h=0;h<2;h++)rX[u[h]]&&(u[h]=noe(t,t.mapDimension(i[h]),u[h]));return e}}function IBe(n,e,t,r){var i={};return n.valueIndex!=null||n.valueDim!=null?(i.valueDataDim=n.valueIndex!=null?e.getDimension(n.valueIndex):n.valueDim,i.valueAxis=t.getAxis(jAt(r,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function jAt(n,e){var t=n.getData().getDimensionInfo(e);return t&&t.coordDim}function AD(n,e){return n&&n.containData&&e.coord&&!uQ(e)?n.containData(e.coord):!0}function XAt(n,e,t){return n&&n.containZone&&e.coord&&t.coord&&!uQ(e)&&!uQ(t)?n.containZone(e.coord,t.coord):!0}function LBe(n,e){return n?function(t,r,i,a){var o=a<2?t.coord&&t.coord[a]:t.value;return _S(o,e[a])}:function(t,r,i,a){return _S(t.value,e[a])}}function noe(n,e,t){if(t==="average"){var r=0,i=0;return n.each(e,function(a,o){isNaN(a)||(r+=a,i++)}),r/i}else return t==="median"?n.getMedian(e):n.getDataExtent(e)[t==="max"?1:0]}var nX=na(),YAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=$r()},e.prototype.render=function(t,r,i){var a=this,o=this.markerGroupMap;o.each(function(s){nX(s).keep=!1}),r.eachSeries(function(s){var l=US.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,r,i)}),o.each(function(s){!nX(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){nX(t).keep=!0},e.prototype.toggleBlurSeries=function(t,r){var i=this;te(t,function(a){var o=US.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(r?nke(l):Sie(l))})}})},e.type="marker",e}(pl);const ioe=YAt;function p1e(n,e,t){var r=e.coordinateSystem;n.each(function(i){var a=n.getItemModel(i),o,s=xr(a.get("x"),t.getWidth()),l=xr(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(n.getValues(n.dimensions,i));else if(r){var u=n.get(r.dimensions[0],i),h=n.get(r.dimensions[1],i);o=r.dataToPoint([u,h])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),n.setItemLayout(i,o)})}var qAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var o=US.getMarkerModelFromSeries(a,"markPoint");o&&(p1e(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,r,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new A3),c=ZAt(o,t,r);r.setData(c),p1e(r.getData(),t,a),c.each(function(f){var d=c.getItemModel(f),v=d.getShallow("symbol"),p=d.getShallow("symbolSize"),g=d.getShallow("symbolRotate"),m=d.getShallow("symbolOffset"),y=d.getShallow("symbolKeepAspect");if(rn(v)||rn(p)||rn(g)||rn(m)){var _=r.getRawValue(f),x=r.getDataParams(f);rn(v)&&(v=v(_,x)),rn(p)&&(p=p(_,x)),rn(g)&&(g=g(_,x)),rn(m)&&(m=m(_,x))}var S=d.getModel("itemStyle").getItemStyle(),w=w3(l,"color");S.fill||(S.fill=w),c.setItemVisual(f,{symbol:v,symbolSize:p,symbolRotate:g,symbolOffset:m,symbolKeepAspect:y,style:S})}),h.updateData(c),this.group.add(h.group),c.eachItemGraphicEl(function(f){f.traverse(function(d){Bn(d).dataModel=r})}),this.markKeep(h),h.group.silent=r.get("silent")||t.get("silent")},e.type="markPoint",e}(ioe);function ZAt(n,e,t){var r;n?r=Vt(n&&n.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return Mt(Mt({},l),{name:s,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new Df(r,t),a=Vt(t.get("data"),Un(CD,e));n&&(a=To(a,Un(AD,n)));var o=LBe(!!n,r);return i.initData(a,null,o),i}const KAt=qAt;function JAt(n){n.registerComponentModel(WAt),n.registerComponentView(KAt),n.registerPreprocessor(function(e){roe(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var QAt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(US);const eMt=QAt;var V4=na(),tMt=function(n,e,t,r){var i=n.getData(),a;if(Gt(r))a=r;else{var o=r.type;if(o==="min"||o==="max"||o==="average"||o==="median"||r.xAxis!=null||r.yAxis!=null){var s=void 0,l=void 0;if(r.yAxis!=null||r.xAxis!=null)s=e.getAxis(r.yAxis!=null?"y":"x"),l=Gh(r.yAxis,r.xAxis);else{var u=IBe(r,i,e,n);s=u.valueAxis;var h=g4e(i,u.valueDataDim);l=noe(i,h,o)}var c=s.dim==="x"?0:1,f=1-c,d=Sn(r),v={coord:[]};d.type=null,d.coord=[],d.coord[f]=-1/0,v.coord[f]=1/0;var p=t.get("precision");p>=0&&ha(l)&&(l=+l.toFixed(Math.min(p,20))),d.coord[c]=v.coord[c]=l,a=[d,v,{type:o,valueIndex:r.valueIndex,value:l}]}else a=[]}var g=[CD(n,a[0]),CD(n,a[1]),Mt({},a[2])];return g[2].type=g[2].type||null,ii(g[2],g[0]),ii(g[2],g[1]),g};function GG(n){return!isNaN(n)&&!isFinite(n)}function g1e(n,e,t,r){var i=1-n,a=r.dimensions[n];return GG(e[i])&&GG(t[i])&&e[n]===t[n]&&r.getAxis(a).containData(e[n])}function rMt(n,e){if(n.type==="cartesian2d"){var t=e[0].coord,r=e[1].coord;if(t&&r&&(g1e(1,t,r,n)||g1e(0,t,r,n)))return!0}return AD(n,e[0])&&AD(n,e[1])}function iX(n,e,t,r,i){var a=r.coordinateSystem,o=n.getItemModel(e),s,l=xr(o.get("x"),i.getWidth()),u=xr(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(r.getMarkerPosition)s=r.getMarkerPosition(n.getValues(n.dimensions,e));else{var h=a.dimensions,c=n.get(h[0],e),f=n.get(h[1],e);s=a.dataToPoint([c,f])}if(Z2(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),h=a.dimensions;GG(n.get(h[0],e))?s[0]=d.toGlobalCoord(d.getExtent()[t?0:1]):GG(n.get(h[1],e))&&(s[1]=v.toGlobalCoord(v.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}n.setItemLayout(e,s)}var nMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var o=US.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=V4(o).from,u=V4(o).to;l.each(function(h){iX(l,h,!0,a,i),iX(u,h,!1,a,i)}),s.each(function(h){s.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,r,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new Aae);this.group.add(h.group);var c=iMt(o,t,r),f=c.from,d=c.to,v=c.line;V4(r).from=f,V4(r).to=d,r.setData(v);var p=r.get("symbol"),g=r.get("symbolSize"),m=r.get("symbolRotate"),y=r.get("symbolOffset");Gt(p)||(p=[p,p]),Gt(g)||(g=[g,g]),Gt(m)||(m=[m,m]),Gt(y)||(y=[y,y]),c.from.each(function(x){_(f,x,!0),_(d,x,!1)}),v.each(function(x){var S=v.getItemModel(x).getModel("lineStyle").getLineStyle();v.setItemLayout(x,[f.getItemLayout(x),d.getItemLayout(x)]),S.stroke==null&&(S.stroke=f.getItemVisual(x,"style").fill),v.setItemVisual(x,{fromSymbolKeepAspect:f.getItemVisual(x,"symbolKeepAspect"),fromSymbolOffset:f.getItemVisual(x,"symbolOffset"),fromSymbolRotate:f.getItemVisual(x,"symbolRotate"),fromSymbolSize:f.getItemVisual(x,"symbolSize"),fromSymbol:f.getItemVisual(x,"symbol"),toSymbolKeepAspect:d.getItemVisual(x,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(x,"symbolOffset"),toSymbolRotate:d.getItemVisual(x,"symbolRotate"),toSymbolSize:d.getItemVisual(x,"symbolSize"),toSymbol:d.getItemVisual(x,"symbol"),style:S})}),h.updateData(v),c.line.eachItemGraphicEl(function(x){Bn(x).dataModel=r,x.traverse(function(S){Bn(S).dataModel=r})});function _(x,S,w){var b=x.getItemModel(S);iX(x,S,w,t,a);var E=b.getModel("itemStyle").getItemStyle();E.fill==null&&(E.fill=w3(l,"color")),x.setItemVisual(S,{symbolKeepAspect:b.get("symbolKeepAspect"),symbolOffset:ni(b.get("symbolOffset",!0),y[w?0:1]),symbolRotate:ni(b.get("symbolRotate",!0),m[w?0:1]),symbolSize:ni(b.get("symbolSize"),g[w?0:1]),symbol:ni(b.get("symbol",!0),p[w?0:1]),style:E})}this.markKeep(h),h.group.silent=r.get("silent")||t.get("silent")},e.type="markLine",e}(ioe);function iMt(n,e,t){var r;n?r=Vt(n&&n.dimensions,function(u){var h=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return Mt(Mt({},h),{name:u,ordinalMeta:null})}):r=[{name:"value",type:"float"}];var i=new Df(r,t),a=new Df(r,t),o=new Df([],t),s=Vt(t.get("data"),Un(tMt,e,n,t));n&&(s=To(s,Un(rMt,n)));var l=LBe(!!n,r);return i.initData(Vt(s,function(u){return u[0]}),null,l),a.initData(Vt(s,function(u){return u[1]}),null,l),o.initData(Vt(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}const aMt=nMt;function oMt(n){n.registerComponentModel(eMt),n.registerComponentView(aMt),n.registerPreprocessor(function(e){roe(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var sMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,r,i){return new e(t,r,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(US);const lMt=sMt;var $4=na(),uMt=function(n,e,t,r){var i=r[0],a=r[1];if(!(!i||!a)){var o=CD(n,i),s=CD(n,a),l=o.coord,u=s.coord;l[0]=Gh(l[0],-1/0),l[1]=Gh(l[1],-1/0),u[0]=Gh(u[0],1/0),u[1]=Gh(u[1],1/0);var h=nie([{},o,s]);return h.coord=[o.coord,s.coord],h.x0=o.x,h.y0=o.y,h.x1=s.x,h.y1=s.y,h}};function zG(n){return!isNaN(n)&&!isFinite(n)}function y1e(n,e,t,r){var i=1-n;return zG(e[i])&&zG(t[i])}function hMt(n,e){var t=e.coord[0],r=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:r,x:e.x1,y:e.y1};return Z2(n,"cartesian2d")?t&&r&&(y1e(1,t,r)||y1e(0,t,r))?!0:XAt(n,i,a):AD(n,i)||AD(n,a)}function m1e(n,e,t,r,i){var a=r.coordinateSystem,o=n.getItemModel(e),s,l=xr(o.get(t[0]),i.getWidth()),u=xr(o.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(r.getMarkerPosition){var h=n.getValues(["x0","y0"],e),c=n.getValues(["x1","y1"],e),f=a.clampData(h),d=a.clampData(c),v=[];t[0]==="x0"?v[0]=f[0]>d[0]?c[0]:h[0]:v[0]=f[0]>d[0]?h[0]:c[0],t[1]==="y0"?v[1]=f[1]>d[1]?c[1]:h[1]:v[1]=f[1]>d[1]?h[1]:c[1],s=r.getMarkerPosition(v,t,!0)}else{var p=n.get(t[0],e),g=n.get(t[1],e),m=[p,g];a.clampData&&a.clampData(m,m),s=a.dataToPoint(m,!0)}if(Z2(a,"cartesian2d")){var y=a.getAxis("x"),_=a.getAxis("y"),p=n.get(t[0],e),g=n.get(t[1],e);zG(p)?s[0]=y.toGlobalCoord(y.getExtent()[t[0]==="x0"?0:1]):zG(g)&&(s[1]=_.toGlobalCoord(_.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var _1e=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],cMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,r,i){r.eachSeries(function(a){var o=US.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=Vt(_1e,function(c){return m1e(s,l,c,a,i)});s.setItemLayout(l,u);var h=s.getItemGraphicEl(l);h.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,r,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,{group:new Cn});this.group.add(h.group),this.markKeep(h);var c=fMt(o,t,r);r.setData(c),c.each(function(f){var d=Vt(_1e,function(E){return m1e(c,f,E,t,a)}),v=o.getAxis("x").scale,p=o.getAxis("y").scale,g=v.getExtent(),m=p.getExtent(),y=[v.parse(c.get("x0",f)),v.parse(c.get("x1",f))],_=[p.parse(c.get("y0",f)),p.parse(c.get("y1",f))];Op(y),Op(_);var x=!(g[0]>y[1]||g[1]<y[0]||m[0]>_[1]||m[1]<_[0]),S=!x;c.setItemLayout(f,{points:d,allClipped:S});var w=c.getItemModel(f).getModel("itemStyle").getItemStyle(),b=w3(l,"color");w.fill||(w.fill=b,Or(w.fill)&&(w.fill=eG(w.fill,.4))),w.stroke||(w.stroke=b),c.setItemVisual(f,"style",w)}),c.diff($4(h).data).add(function(f){var d=c.getItemLayout(f);if(!d.allClipped){var v=new bd({shape:{points:d.points}});c.setItemGraphicEl(f,v),h.group.add(v)}}).update(function(f,d){var v=$4(h).data.getItemGraphicEl(d),p=c.getItemLayout(f);p.allClipped?v&&h.group.remove(v):(v?ma(v,{shape:{points:p.points}},r,f):v=new bd({shape:{points:p.points}}),c.setItemGraphicEl(f,v),h.group.add(v))}).remove(function(f){var d=$4(h).data.getItemGraphicEl(f);h.group.remove(d)}).execute(),c.eachItemGraphicEl(function(f,d){var v=c.getItemModel(d),p=c.getItemVisual(d,"style");f.useStyle(c.getItemVisual(d,"style")),vc(f,hh(v),{labelFetcher:r,labelDataIndex:d,defaultText:c.getName(d)||"",inheritColor:Or(p.fill)?eG(p.fill,1):"#000"}),dc(f,v),vl(f,null,null,v.get(["emphasis","disabled"])),Bn(f).dataModel=r}),$4(h).data=c,h.group.silent=r.get("silent")||t.get("silent")},e.type="markArea",e}(ioe);function fMt(n,e,t){var r,i,a=["x0","y0","x1","y1"];if(n){var o=Vt(n&&n.dimensions,function(u){var h=e.getData(),c=h.getDimensionInfo(h.mapDimension(u))||{};return Mt(Mt({},c),{name:u,ordinalMeta:null})});i=Vt(a,function(u,h){return{name:u,type:o[h%2].type}}),r=new Df(i,t)}else i=[{name:"value",type:"float"}],r=new Df(i,t);var s=Vt(t.get("data"),Un(uMt,e,n,t));n&&(s=To(s,Un(hMt,n)));var l=n?function(u,h,c,f){var d=u.coord[Math.floor(f/2)][f%2];return _S(d,i[f])}:function(u,h,c,f){return _S(u.value,i[f])};return r.initData(s,null,l),r.hasItemOption=!0,r}const dMt=cMt;function vMt(n){n.registerComponentModel(lMt),n.registerComponentView(dMt),n.registerPreprocessor(function(e){roe(e.series,"markArea")&&(e.markArea=e.markArea||{})})}var pMt=function(n,e){if(e==="all")return{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}},gMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),this._updateSelector(t)},e.prototype._updateSelector=function(t){var r=t.selector,i=this.ecModel;r===!0&&(r=t.selector=["all","inverse"]),Gt(r)&&te(r,function(a,o){Or(a)&&(a={type:a}),r[o]=ii(a,pMt(i,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&this.get("selectedMode")==="single"){for(var r=!1,i=0;i<t.length;i++){var a=t[i].get("name");if(this.isSelected(a)){this.select(a),r=!0;break}}!r&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var r=[],i=[];t.eachRawSeries(function(l){var u=l.name;i.push(u);var h;if(l.legendVisualProvider){var c=l.legendVisualProvider,f=c.getAllNames();t.isSeriesFiltered(l)||(i=i.concat(f)),f.length?r=r.concat(f):h=!0}else h=!0;h&&vie(l)&&r.push(l.name)}),this._availableNames=i;var a=this.get("data")||r,o=$r(),s=Vt(a,function(l){return(Or(l)||ha(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new as(l,this,this.ecModel))},this);this._data=To(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var r=this.option.selected,i=this.get("selectedMode");if(i==="single"){var a=this._data;te(a,function(o){r[o.get("name")]=!1})}r[t]=!0},e.prototype.unSelect=function(t){this.get("selectedMode")!=="single"&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var r=this.option.selected;r.hasOwnProperty(t)||(r[t]=!0),this[r[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this._data,r=this.option.selected;te(t,function(i){r[i.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var t=this._data,r=this.option.selected;te(t,function(i){var a=i.get("name",!0);r.hasOwnProperty(a)||(r[a]=!0),r[a]=!r[a]})},e.prototype.isSelected=function(t){var r=this.option.selected;return!(r.hasOwnProperty(t)&&!r[t])&&gi(this._availableNames,t)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(oa);const hQ=gMt;var nC=Un,cQ=te,W4=Cn,yMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new W4),this.group.add(this._selectorGroup=new W4),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,r,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,r,i,l,s,u);var h=t.getBoxLayoutParams(),c={width:i.getWidth(),height:i.getHeight()},f=t.get("padding"),d=Uu(h,c,f),v=this.layoutInner(t,o,d,a,l,u),p=Uu(sn({width:v.width,height:v.height},h),c,f);this.group.x=p.x-v.x,this.group.y=p.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=mBe(v,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,r,i,a,o,s,l){var u=this.getContentGroup(),h=$r(),c=r.get("selectedMode"),f=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&f.push(d.id)}),cQ(r.getData(),function(d,v){var p=d.get("name");if(!this.newlineDisabled&&(p===""||p===`
`)){var g=new W4;g.newline=!0,u.add(g);return}var m=i.getSeriesByName(p)[0];if(!h.get(p))if(m){var y=m.getData(),_=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),S=y.getVisual("style"),w=this._createItem(m,p,v,d,r,t,_,S,x,c,a);w.on("click",nC(x1e,p,null,a,f)).on("mouseover",nC(fQ,m.name,null,a,f)).on("mouseout",nC(dQ,m.name,null,a,f)),h.set(p,!0)}else i.eachRawSeries(function(b){if(!h.get(p)&&b.legendVisualProvider){var E=b.legendVisualProvider;if(!E.containName(p))return;var T=E.indexOfName(p),C=E.getItemVisual(T,"style"),A=E.getItemVisual(T,"legendIcon"),M=gv(C.fill);M&&M[3]===0&&(M[3]=.2,C=Mt(Mt({},C),{fill:W1(M,"rgba")}));var I=this._createItem(b,p,v,d,r,t,{},C,A,c,a);I.on("click",nC(x1e,null,p,a,f)).on("mouseover",nC(fQ,null,p,a,f)).on("mouseout",nC(dQ,null,p,a,f)),h.set(p,!0)}},this)},this),o&&this._createSelector(o,r,a,s,l)},e.prototype._createSelector=function(t,r,i,a,o){var s=this.getSelectorGroup();cQ(t,function(u){var h=u.type,c=new la({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(c);var f=r.getModel("selectorLabel"),d=r.getModel(["emphasis","selectorLabel"]);vc(c,{normal:f,emphasis:d},{defaultText:u.title}),CE(c)})},e.prototype._createItem=function(t,r,i,a,o,s,l,u,h,c,f){var d=t.visualDrawType,v=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(r),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");h=_||h||"roundRect";var x=mMt(h,a,l,u,d,g,f),S=new W4,w=a.getModel("textStyle");if(rn(t.getLegendIcon)&&(!_||_==="inherit"))S.add(t.getLegendIcon({itemWidth:v,itemHeight:p,icon:h,iconRotate:m,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var b=_==="inherit"&&t.getData().getVisual("symbol")?m==="inherit"?t.getData().getVisual("symbolRotate"):m:0;S.add(_Mt({itemWidth:v,itemHeight:p,icon:h,iconRotate:b,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}))}var E=s==="left"?v+5:-5,T=s,C=o.get("formatter"),A=r;Or(C)&&C?A=C.replace("{name}",r!=null?r:""):rn(C)&&(A=C(r));var M=g?w.getTextColor():a.get("inactiveColor");S.add(new la({style:is(w,{text:A,x:E,y:p/2,fill:M,align:T,verticalAlign:"middle"},{inheritColor:M})}));var I=new ta({shape:S.getBoundingRect(),invisible:!0}),R=a.getModel("tooltip");return R.get("show")&&DI({el:I,componentModel:o,itemName:r,itemTooltipOption:R.option}),S.add(I),S.eachChild(function(k){k.silent=!0}),I.silent=!c,this.getContentGroup().add(S),CE(S),S.__legendDataIndex=i,S},e.prototype.layoutInner=function(t,r,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();ME(t.get("orient"),l,t.get("itemGap"),i.width,i.height);var h=l.getBoundingRect(),c=[-h.x,-h.y];if(u.markRedraw(),l.markRedraw(),o){ME("horizontal",u,t.get("selectorItemGap",!0));var f=u.getBoundingRect(),d=[-f.x,-f.y],v=t.get("selectorButtonGap",!0),p=t.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",y=p===0?"y":"x";s==="end"?d[p]+=h[g]+v:c[p]+=f[g]+v,d[1-p]+=h[m]/2-f[m]/2,u.x=d[0],u.y=d[1],l.x=c[0],l.y=c[1];var _={x:0,y:0};return _[g]=h[g]+v+f[g],_[m]=Math.max(h[m],f[m]),_[y]=Math.min(0,f[y]+d[1-p]),_}else return l.x=c[0],l.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(pl);function mMt(n,e,t,r,i,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),cQ(g,function(y,_){g[_]==="inherit"&&(g[_]=m[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=n.lastIndexOf("empty",0)===0?"fill":"stroke",c=l.getShallow("decal");u.decal=!c||c==="inherit"?r.decal:vM(c,o),u.fill==="inherit"&&(u.fill=r[i]),u.stroke==="inherit"&&(u.stroke=r[h]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?r:t).opacity),s(u,r);var f=e.getModel("lineStyle"),d=f.getLineStyle();if(s(d,t),u.fill==="auto"&&(u.fill=r.fill),u.stroke==="auto"&&(u.stroke=r.fill),d.stroke==="auto"&&(d.stroke=r.fill),!a){var v=e.get("inactiveBorderWidth"),p=u[h];u.lineWidth=v==="auto"?r.lineWidth>0&&p?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=f.get("inactiveColor"),d.lineWidth=f.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function _Mt(n){var e=n.icon||"roundRect",t=hu(e,0,0,n.itemWidth,n.itemHeight,n.itemStyle.fill,n.symbolKeepAspect);return t.setStyle(n.itemStyle),t.rotation=(n.iconRotate||0)*Math.PI/180,t.setOrigin([n.itemWidth/2,n.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function x1e(n,e,t,r){dQ(n,e,t,r),t.dispatchAction({type:"legendToggleSelect",name:n!=null?n:e}),fQ(n,e,t,r)}function PBe(n){for(var e=n.getZr().storage.getDisplayList(),t,r=0,i=e.length;r<i&&!(t=e[r].states.emphasis);)r++;return t&&t.hoverLayer}function fQ(n,e,t,r){PBe(t)||t.dispatchAction({type:"highlight",seriesName:n,name:e,excludeSeriesId:r})}function dQ(n,e,t,r){PBe(t)||t.dispatchAction({type:"downplay",seriesName:n,name:e,excludeSeriesId:r})}const OBe=yMt;function xMt(n){var e=n.findComponents({mainType:"legend"});e&&e.length&&n.filterSeries(function(t){for(var r=0;r<e.length;r++)if(!e[r].isSelected(t.name))return!1;return!0})}function vP(n,e,t){var r={},i=n==="toggleSelected",a;return t.eachComponent("legend",function(o){i&&a!=null?o[a?"select":"unSelect"](e.name):n==="allSelect"||n==="inverseSelect"?o[n]():(o[n](e.name),a=o.isSelected(e.name));var s=o.getData();te(s,function(l){var u=l.get("name");if(!(u===`
`||u==="")){var h=o.isSelected(u);r.hasOwnProperty(u)?r[u]=r[u]&&h:r[u]=h}})}),n==="allSelect"||n==="inverseSelect"?{selected:r}:{name:e.name,selected:r}}function SMt(n){n.registerAction("legendToggleSelect","legendselectchanged",Un(vP,"toggleSelected")),n.registerAction("legendAllSelect","legendselectall",Un(vP,"allSelect")),n.registerAction("legendInverseSelect","legendinverseselect",Un(vP,"inverseSelect")),n.registerAction("legendSelect","legendselected",Un(vP,"select")),n.registerAction("legendUnSelect","legendunselected",Un(vP,"unSelect"))}function RBe(n){n.registerComponentModel(hQ),n.registerComponentView(OBe),n.registerProcessor(n.PRIORITY.PROCESSOR.SERIES_FILTER,xMt),n.registerSubTypeDefaulter("legend",function(){return"plain"}),SMt(n)}var wMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(t,r,i){var a=BI(t);n.prototype.init.call(this,t,r,i),S1e(this,t,a)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),S1e(this,this.option,t)},e.type="legend.scroll",e.defaultOption=xw(hQ.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(hQ);function S1e(n,e,t){var r=n.getOrient(),i=[1,1];i[r.index]=0,kS(e,t,{type:"box",ignoreSize:!!i})}const bMt=wMt;var w1e=Cn,aX=["width","height"],oX=["x","y"],EMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!0,t._currentIndex=0,t}return e.prototype.init=function(){n.prototype.init.call(this),this.group.add(this._containerGroup=new w1e),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new w1e)},e.prototype.resetInner=function(){n.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(t,r,i,a,o,s,l){var u=this;n.prototype.renderInner.call(this,t,r,i,a,o,s,l);var h=this._controllerGroup,c=r.get("pageIconSize",!0),f=Gt(c)?c:[c,c];v("pagePrev",0);var d=r.getModel("pageTextStyle");h.add(new la({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),v("pageNext",1);function v(p,g){var m=p+"DataIndex",y=_3(r.get("pageIcons",!0)[r.getOrient().name][g],{onclick:kr(u._pageGo,u,m,r,a)},{x:-f[0]/2,y:-f[1]/2,width:f[0],height:f[1]});y.name=p,h.add(y)}},e.prototype.layoutInner=function(t,r,i,a,o,s){var l=this.getSelectorGroup(),u=t.getOrient().index,h=aX[u],c=oX[u],f=aX[1-u],d=oX[1-u];o&&ME("horizontal",l,t.get("selectorItemGap",!0));var v=t.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],m=Sn(i);o&&(m[h]=i[h]-p[h]-v);var y=this._layoutContentAndController(t,a,m,u,h,f,d,c);if(o){if(s==="end")g[u]+=y[h]+v;else{var _=p[h]+v;g[u]-=_,y[c]-=_}y[h]+=p[h]+v,g[1-u]+=y[d]+y[f]/2-p[f]/2,y[f]=Math.max(y[f],p[f]),y[d]=Math.min(y[d],p[d]+g[1-u]),l.x=g[0],l.y=g[1],l.markRedraw()}return y},e.prototype._layoutContentAndController=function(t,r,i,a,o,s,l,u){var h=this.getContentGroup(),c=this._containerGroup,f=this._controllerGroup;ME(t.get("orient"),h,t.get("itemGap"),a?i.width:null,a?null:i.height),ME("horizontal",f,t.get("pageButtonItemGap",!0));var d=h.getBoundingRect(),v=f.getBoundingRect(),p=this._showController=d[o]>i[o],g=[-d.x,-d.y];r||(g[a]=h[u]);var m=[0,0],y=[-v.x,-v.y],_=ni(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(p){var x=t.get("pageButtonPosition",!0);x==="end"?y[a]+=i[o]-v[o]:m[a]+=v[o]+_}y[1-a]+=d[s]/2-v[s]/2,h.setPosition(g),c.setPosition(m),f.setPosition(y);var S={x:0,y:0};if(S[o]=p?i[o]:d[o],S[s]=Math.max(d[s],v[s]),S[l]=Math.min(0,v[l]+y[1-a]),c.__rectSize=i[o],p){var w={x:0,y:0};w[o]=Math.max(i[o]-v[o]-_,0),w[s]=S[s],c.setClipPath(new ta({shape:w})),c.__rectSize=w[o]}else f.eachChild(function(E){E.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(t);return b.pageIndex!=null&&ma(h,{x:b.contentPosition[0],y:b.contentPosition[1]},p?t:null),this._updatePageInfoView(t,b),S},e.prototype._pageGo=function(t,r,i){var a=this._getPageInfo(r)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:r.id})},e.prototype._updatePageInfoView=function(t,r){var i=this._controllerGroup;te(["pagePrev","pageNext"],function(h){var c=h+"DataIndex",f=r[c]!=null,d=i.childOfName(h);d&&(d.setStyle("fill",f?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),d.cursor=f?"pointer":"default")});var a=i.childOfName("pageText"),o=t.get("pageFormatter"),s=r.pageIndex,l=s!=null?s+1:0,u=r.pageCount;a&&o&&a.setStyle("text",Or(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var r=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=aX[o],l=oX[o],u=this._findTargetItemIndex(r),h=i.children(),c=h[u],f=h.length,d=f?1:0,v={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return v;var p=x(c);v.contentPosition[o]=-p.s;for(var g=u+1,m=p,y=p,_=null;g<=f;++g)_=x(h[g]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=m.i),++v.pageCount)),y=_;for(var g=u-1,m=p,y=p,_=null;g>=-1;--g)_=x(h[g]),(!_||!S(y,_.s))&&m.i<y.i&&(y=m,v.pagePrevDataIndex==null&&(v.pagePrevDataIndex=m.i),++v.pageCount,++v.pageIndex),m=_;return v;function x(w){if(w){var b=w.getBoundingRect(),E=b[l]+w[l];return{s:E,e:E+b[s],i:w.__legendDataIndex}}}function S(w,b){return w.e>=b&&w.s<=b+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var r,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(r=s)}),r!=null?r:a},e.type="legend.scroll",e}(OBe);const TMt=EMt;function CMt(n){n.registerAction("legendScroll","legendscroll",function(e,t){var r=e.scrollDataIndex;r!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(r)})})}function AMt(n){_i(RBe),n.registerComponentModel(bMt),n.registerComponentView(TMt),CMt(n)}function MMt(n){_i(RBe),_i(AMt)}var IMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=xw(TD.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(TD);const LMt=IMt;var aoe=na();function PMt(n,e,t){aoe(n).coordSysRecordMap.each(function(r){var i=r.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function OMt(n,e){for(var t=aoe(n).coordSysRecordMap,r=t.keys(),i=0;i<r.length;i++){var a=r[i],o=t.get(a),s=o.dataZoomInfoMap;if(s){var l=e.uid,u=s.get(l);u&&(s.removeKey(l),s.keys().length||DBe(t,o))}}}function DBe(n,e){if(e){n.removeKey(e.model.uid);var t=e.controller;t&&t.dispose()}}function RMt(n,e){var t={model:e,containsPoint:Un(NMt,e),dispatchAction:Un(DMt,n),dataZoomInfoMap:null,controller:null},r=t.controller=new P3(n.getZr());return te(["pan","zoom","scrollMove"],function(i){r.on(i,function(a){var o=[];t.dataZoomInfoMap.each(function(s){if(!!a.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[i],u=l&&l(s.dzReferCoordSysInfo,t.model.mainType,t.controller,a);!s.model.get("disabled",!0)&&u&&o.push({dataZoomId:s.model.id,start:u[0],end:u[1]})}}),o.length&&t.dispatchAction(o)})}),t}function DMt(n,e){n.isDisposed()||n.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function NMt(n,e,t,r){return n.coordinateSystem.containPoint([t,r])}function kMt(n){var e,t="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},i=!0;return n.each(function(a){var o=a.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;r[t+s]>r[t+e]&&(e=s),i=i&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function FMt(n){n.registerProcessor(n.PRIORITY.PROCESSOR.FILTER,function(e,t){var r=aoe(t),i=r.coordSysRecordMap||(r.coordSysRecordMap=$r());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=pBe(a);te(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,RMt(t,s.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=$r());h.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){DBe(i,a);return}var h=kMt(l);o.enable(h.controlType,h.opt),o.setPointerChecker(a.containsPoint),VI(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var BMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,r,i){if(n.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),PMt(i,t,{pan:kr(sX.pan,this),zoom:kr(sX.zoom,this),scrollMove:kr(sX.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){OMt(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Zae),sX={zoom:function(n,e,t,r){var i=this.range,a=i.slice(),o=n.axisModels[0];if(!!o){var s=lX[e](null,[r.originX,r.originY],o,t,n),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/r.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(J2(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:b1e(function(n,e,t,r,i,a){var o=lX[r]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return o.signal*(n[1]-n[0])*o.pixel/o.pixelLength}),scrollMove:b1e(function(n,e,t,r,i,a){var o=lX[r]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return o.signal*(n[1]-n[0])*a.scrollDelta})};function b1e(n){return function(e,t,r,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(!!s){var l=n(o,s,e,t,r,i);if(J2(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var lX={grid:function(n,e,t,r,i){var a=t.axis,o={},s=i.model.coordinateSystem.getRect();return n=n||[0,0],a.dim==="x"?(o.pixel=e[0]-n[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-n[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(n,e,t,r,i){var a=t.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return n=n?s.pointToCoord(n):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-n[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-n[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(n,e,t,r,i){var a=t.axis,o=i.model.coordinateSystem.getRect(),s={};return n=n||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-n[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-n[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};const GMt=BMt;function NBe(n){Kae(n),n.registerComponentModel(LMt),n.registerComponentView(GMt),FMt(n)}var zMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=xw(TD.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(TD);const UMt=zMt;var pP=ta,E1e=7,VMt=1,uX=30,$Mt=7,gP="horizontal",T1e="vertical",WMt=5,HMt=["line","bar","candlestick","scatter"],jMt={easing:"cubicOut",duration:100,delay:0},XMt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,r){this.api=r,this._onBrush=kr(this._onBrush,this),this._onBrushEnd=kr(this._onBrushEnd,this)},e.prototype.render=function(t,r,i,a){if(n.prototype.render.apply(this,arguments),VI(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),n.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){dD(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var r=this._displayables.sliderGroup=new Cn;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(r),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,r=this.api,i=t.get("brushSelect"),a=i?$Mt:0,o=this._findCoordRect(),s={width:r.getWidth(),height:r.getHeight()},l=this._orient===gP?{right:s.width-o.x-o.width,top:s.height-uX-E1e-a,width:o.width,height:uX}:{right:E1e,top:o.y,width:uX,height:o.height},u=BI(t.option);te(["right","top","width","height"],function(c){u[c]==="ph"&&(u[c]=l[c])});var h=Uu(u,s);this._location={x:h.x,y:h.y},this._size=[h.width,h.height],this._orient===T1e&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,r=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===gP&&!o?{scaleY:l?1:-1,scaleX:1}:i===gP&&o?{scaleY:l?1:-1,scaleX:-1}:i===T1e&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=r.x-u.x,t.y=r.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,r=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new pP({silent:!0,shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new pP({shape:{x:0,y:0,width:r[0],height:r[1]},style:{fill:"transparent"},z2:0,onclick:kr(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var r=this._size,i=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||r[0]!==i[0]||r[1]!==i[1]){var c=o.getDataExtent(l),f=(c[1]-c[0])*.3;c=[c[0]-f,c[1]+f];var d=[0,r[1]],v=[0,r[0]],p=[[r[0],0],[0,0]],g=[],m=v[1]/(o.count()-1),y=0,_=Math.round(o.count()/r[0]),x;o.each([l],function(T,C){if(_>0&&C%_){y+=m;return}var A=T==null||isNaN(T)||T==="",M=A?0:go(T,c,d,!0);A&&!x&&C?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!A&&x&&(p.push([y,0]),g.push([y,0])),p.push([y,M]),g.push([y,M]),y+=m,x=A}),u=this._shadowPolygonPts=p,h=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=l,this._shadowSize=[r[0],r[1]];var S=this.dataZoomModel;function w(T){var C=S.getModel(T?"selectedDataBackground":"dataBackground"),A=new Cn,M=new bd({shape:{points:u},segmentIgnoreThreshold:1,style:C.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),I=new Gd({shape:{points:h},segmentIgnoreThreshold:1,style:C.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return A.add(M),A.add(I),A}for(var b=0;b<3;b++){var E=w(b===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,r=t.get("showDataShadow");if(r!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();te(l,function(u){if(!i&&!(r!==!0&&gi(HMt,u.get("type"))<0)){var h=a.getComponent(iS(o),s).axis,c=YMt(o),f,d=u.coordinateSystem;c!=null&&d.getOtherAxis&&(f=d.getOtherAxis(h).inverse),c=u.getData().mapDimension(c),i={thisAxis:h,series:u,thisDim:o,otherDim:c,otherAxisInverse:f}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,r=this._displayables,i=r.handles=[null,null],a=r.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,c=l.get("brushSelect"),f=r.filler=new pP({silent:c,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new pP({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:VMt,fill:"rgba(0,0,0,0)"}})),te([0,1],function(_){var x=l.get("handleIcon");!gG[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=hu(x,-1,0,2,2,null,!0);S.attr({cursor:C1e(this._orient),draggable:!0,drift:kr(this._onDragMove,this,_),ondragend:kr(this._onDragEnd,this),onmouseover:kr(this._showDataInfo,this,!0),onmouseout:kr(this._showDataInfo,this,!1),z2:5});var w=S.getBoundingRect(),b=l.get("handleSize");this._handleHeight=xr(b,this._size[1]),this._handleWidth=w.width/w.height*this._handleHeight,S.setStyle(l.getModel("handleStyle").getItemStyle()),S.style.strokeNoScale=!0,S.rectHover=!0,S.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),CE(S);var E=l.get("handleColor");E!=null&&(S.style.fill=E),o.add(i[_]=S);var T=l.getModel("textStyle");t.add(a[_]=new la({silent:!0,invisible:!0,style:is(T,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:T.getTextColor(),font:T.getFont()}),z2:10}))},this);var d=f;if(c){var v=xr(l.get("moveHandleSize"),s[1]),p=r.moveHandle=new ta({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),g=v*.8,m=r.moveHandleIcon=hu(l.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);m.silent=!0,m.y=s[1]+v/2-.5,p.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(s[1]/2,Math.max(v,10));d=r.moveZone=new ta({invisible:!0,shape:{y:s[1]-y,height:v+y}}),d.on("mouseover",function(){u.enterEmphasis(p)}).on("mouseout",function(){u.leaveEmphasis(p)}),o.add(p),o.add(m),o.add(d)}d.attr({draggable:!0,cursor:C1e(this._orient),drift:kr(this._onDragMove,this,"all"),ondragstart:kr(this._showDataInfo,this,!0),ondragend:kr(this._onDragEnd,this),onmouseover:kr(this._showDataInfo,this,!0),onmouseout:kr(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),r=this._getViewExtent();this._handleEnds=[go(t[0],[0,100],r,!0),go(t[1],[0,100],r,!0)]},e.prototype._updateInterval=function(t,r){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];J2(r,a,o,i.get("zoomLock")?"all":t,s.minSpan!=null?go(s.minSpan,l,o,!0):null,s.maxSpan!=null?go(s.maxSpan,l,o,!0):null);var u=this._range,h=this._range=Op([go(a[0],o,l,!0),go(a[1],o,l,!0)]);return!u||u[0]!==h[0]||u[1]!==h[1]},e.prototype._updateView=function(t){var r=this._displayables,i=this._handleEnds,a=Op(i.slice()),o=this._size;te([0,1],function(d){var v=r.handles[d],p=this._handleHeight;v.attr({scaleX:p/2,scaleY:p/2,x:i[d]+(d?-1:1),y:o[1]/2-p/2})},this),r.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};r.moveHandle&&(r.moveHandle.setShape(s),r.moveZone.setShape(s),r.moveZone.getBoundingRect(),r.moveHandleIcon&&r.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=r.dataShadowSegs,u=[0,a[0],a[1],o[0]],h=0;h<l.length;h++){var c=l[h],f=c.getClipPath();f||(f=new ta,c.setClipPath(f)),f.setShape({x:u[h],y:0,width:u[h+1]-u[h],height:o[1]})}this._updateDataInfo(t)},e.prototype._updateDataInfo=function(t){var r=this.dataZoomModel,i=this._displayables,a=i.handleLabels,o=this._orient,s=["",""];if(r.get("showDetail")){var l=r.findRepresentativeAxisProxy();if(l){var u=l.getAxisModel().axis,h=this._range,c=t?l.calculateDataWindow({start:h[0],end:h[1]}).valueWindow:l.getDataValueWindow();s=[this._formatLabel(c[0],u),this._formatLabel(c[1],u)]}}var f=Op(this._handleEnds.slice());d.call(this,0),d.call(this,1);function d(v){var p=AE(i.handles[v].parent,this.group),g=eU(v===0?"right":"left",p),m=this._handleWidth/2+WMt,y=u0([f[v]+(v===0?-m:m),this._size[1]/2],p);a[v].setStyle({x:y[0],y:y[1],verticalAlign:o===gP?"middle":g,align:o===gP?g:"center",text:s[v]})}},e.prototype._formatLabel=function(t,r){var i=this.dataZoomModel,a=i.get("labelFormatter"),o=i.get("labelPrecision");(o==null||o==="auto")&&(o=r.getPixelPrecision());var s=t==null||isNaN(t)?"":r.type==="category"||r.type==="time"?r.scale.getLabel({value:Math.round(t)}):t.toFixed(Math.min(o,20));return rn(a)?a(t,s):Or(a)?a.replace("{value}",s):s},e.prototype._showDataInfo=function(t){t=this._dragging||t;var r=this._displayables,i=r.handleLabels;i[0].attr("invisible",!t),i[1].attr("invisible",!t),r.moveHandle&&this.api[t?"enterEmphasis":"leaveEmphasis"](r.moveHandle,1)},e.prototype._onDragMove=function(t,r,i,a){this._dragging=!0,l_(a.event);var o=this._displayables.sliderGroup.getLocalTransform(),s=u0([r,i],o,!0),l=this._updateInterval(t,s[0]),u=this.dataZoomModel.get("realtime");this._updateView(!u),l&&u&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1);var t=this.dataZoomModel.get("realtime");!t&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(t){var r=this._size,i=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>r[0]||i[1]<0||i[1]>r[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var r=t.offsetX,i=t.offsetY;this._brushStart=new qn(r,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(!!this._brushing){var r=this._displayables.brushRect;if(this._brushing=!1,!!r){r.attr("ignore",!0);var i=r.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Op([go(i.x,o,s,!0),go(i.x+i.width,o,s,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(l_(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,r){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new pP({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,r),h=l.transformCoordToLocal(s.x,s.y),c=this._size;u[0]=Math.max(Math.min(c[0],u[0]),0),o.setShape({x:h[0],y:0,width:u[0]-h[0],height:c[1]})},e.prototype._dispatchZoomAction=function(t){var r=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?jMt:null,start:r[0],end:r[1]})},e.prototype._findCoordRect=function(){var t,r=pBe(this.dataZoomModel).infoList;if(!t&&r.length){var i=r[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(Zae);function YMt(n){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[n]}function C1e(n){return n==="vertical"?"ns-resize":"ew-resize"}const qMt=XMt;function kBe(n){n.registerComponentModel(UMt),n.registerComponentView(qMt),Kae(n)}function ZMt(n){_i(NBe),_i(kBe)}var KMt={get:function(n,e,t){var r=Sn((JMt[n]||{})[e]);return t&&Gt(r)?r[r.length-1]:r}},JMt={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const FBe=KMt;var A1e=fc.mapVisual,QMt=fc.eachVisual,eIt=Gt,M1e=te,tIt=Op,rIt=go,nIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,r,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,r){var i=this.option;!r&&TBe(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var r=this.stateList;t=kr(t,this),this.controllerVisuals=sQ(this.option.controller,r,t),this.targetVisuals=sQ(this.option.target,r,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,r=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){r.push(a)}):r=Do(t),r},e.prototype.eachTargetSeries=function(t,r){te(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(r,a)},this)},e.prototype.isTargetSeries=function(t){var r=!1;return this.eachTargetSeries(function(i){i===t&&(r=!0)}),r},e.prototype.formatValueText=function(t,r,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],Gt(t)&&(t=t.slice(),u=!0);var h=r?t:u?[c(t[0]),c(t[1])]:c(t);if(Or(l))return l.replace("{value}",u?h[0]:h).replace("{value2}",u?h[1]:h);if(rn(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?i[0]+" "+h[1]:t[1]===s[1]?i[1]+" "+h[0]:h[0]+" - "+h[1];return h;function c(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,r=tIt([t.min,t.max]);this._dataExtent=r},e.prototype.getDataDimensionIndex=function(t){var r=this.option.dimension;if(r!=null)return t.getDimensionIndex(r);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,r=this.option,i={inRange:r.inRange,outOfRange:r.outOfRange},a=r.target||(r.target={}),o=r.controller||(r.controller={});ii(a,i),ii(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),h.call(this,o);function l(c){eIt(r.color)&&!c.inRange&&(c.inRange={color:r.color.slice().reverse()}),c.inRange=c.inRange||{color:t.get("gradientColor")}}function u(c,f,d){var v=c[f],p=c[d];v&&!p&&(p=c[d]={},M1e(v,function(g,m){if(!!fc.isValidType(m)){var y=FBe.get(m,"inactive",s);y!=null&&(p[m]=y,m==="color"&&!p.hasOwnProperty("opacity")&&!p.hasOwnProperty("colorAlpha")&&(p.opacity=[0,0]))}}))}function h(c){var f=(c.inRange||{}).symbol||(c.outOfRange||{}).symbol,d=(c.inRange||{}).symbolSize||(c.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),p=this.getItemSymbol(),g=p||"roundRect";M1e(this.stateList,function(m){var y=this.itemSize,_=c[m];_||(_=c[m]={color:s?v:[v]}),_.symbol==null&&(_.symbol=f&&Sn(f)||(s?g:[g])),_.symbolSize==null&&(_.symbolSize=d&&Sn(d)||(s?y[0]:[y[0],y[0]])),_.symbol=A1e(_.symbol,function(w){return w==="none"?g:w});var x=_.symbolSize;if(x!=null){var S=-1/0;QMt(x,function(w){w>S&&(S=w)}),_.symbolSize=A1e(x,function(w){return rIt(w,[0,S],[0,y[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(oa);const UG=nIt;var I1e=[20,140],iIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){n.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=I1e[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=I1e[1])},e.prototype._resetRange=function(){var t=this.getExtent(),r=this.option.range;!r||r.auto?(t.auto=1,this.option.range=t):Gt(r)&&(r[0]>r[1]&&r.reverse(),r[0]=Math.max(r[0],t[0]),r[1]=Math.min(r[1],t[1]))},e.prototype.completeVisualOption=function(){n.prototype.completeVisualOption.apply(this,arguments),te(this.stateList,function(t){var r=this.option.controller[t].symbolSize;r&&r[0]!==r[1]&&(r[0]=r[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),r=Op((this.get("range")||[]).slice());return r[0]>t[1]&&(r[0]=t[1]),r[1]>t[1]&&(r[1]=t[1]),r[0]<t[0]&&(r[0]=t[0]),r[1]<t[0]&&(r[1]=t[0]),r},e.prototype.getValueState=function(t){var r=this.option.range,i=this.getExtent();return(r[0]<=i[0]||r[0]<=t)&&(r[1]>=i[1]||t<=r[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),r.push({seriesId:i.id,dataIndex:a})},this),r},e.prototype.getVisualMeta=function(t){var r=L1e(this,"outOfRange",this.getExtent()),i=L1e(this,"inRange",this.option.range.slice()),a=[];function o(d,v){a.push({value:d,color:t(d,v)})}for(var s=0,l=0,u=i.length,h=r.length;l<h&&(!i.length||r[l]<=i[0]);l++)r[l]<i[s]&&o(r[l],"outOfRange");for(var c=1;s<u;s++,c=0)c&&a.length&&o(i[s],"outOfRange"),o(i[s],"inRange");for(var c=1;l<h;l++)(!i.length||i[i.length-1]<r[l])&&(c&&(a.length&&o(a[a.length-1].value,"outOfRange"),c=0),o(r[l],"outOfRange"));var f=a.length;return{stops:a,outerColors:[f?a[0].color:"transparent",f?a[f-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=xw(UG.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(UG);function L1e(n,e,t){if(t[0]===t[1])return t.slice();for(var r=200,i=(t[1]-t[0])/r,a=t[0],o=[],s=0;s<=r&&a<t[1];s++)o.push(a),a+=i;return o.push(t[1]),o}const aIt=iIt;var oIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t.autoPositionValues={left:1,right:1,top:1,bottom:1},t}return e.prototype.init=function(t,r){this.ecModel=t,this.api=r},e.prototype.render=function(t,r,i,a){if(this.visualMapModel=t,t.get("show")===!1){this.group.removeAll();return}this.doRender(t,r,i,a)},e.prototype.renderBackground=function(t){var r=this.visualMapModel,i=FI(r.get("padding")||0),a=t.getBoundingRect();t.add(new ta({z2:-1,silent:!0,shape:{x:a.x-i[3],y:a.y-i[0],width:a.width+i[3]+i[1],height:a.height+i[0]+i[2]},style:{fill:r.get("backgroundColor"),stroke:r.get("borderColor"),lineWidth:r.get("borderWidth")}}))},e.prototype.getControllerVisual=function(t,r,i){i=i||{};var a=i.forceState,o=this.visualMapModel,s={};if(r==="color"){var l=o.get("contentColor");s.color=l}function u(d){return s[d]}function h(d,v){s[d]=v}var c=o.controllerVisuals[a||o.getValueState(t)],f=fc.prepareVisualTypes(c);return te(f,function(d){var v=c[d];i.convertOpacityToAlpha&&d==="opacity"&&(d="colorAlpha",v=c.__alphaForOpacity),fc.dependsOn(d,r)&&v&&v.applyVisual(t,u,h)}),s[r]},e.prototype.positionGroup=function(t){var r=this.visualMapModel,i=this.api;sU(t,r.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},e.prototype.doRender=function(t,r,i,a){},e.type="visualMap",e}(pl);const BBe=oIt;var P1e=[["left","right","width"],["top","bottom","height"]];function GBe(n,e,t){var r=n.option,i=r.align;if(i!=null&&i!=="auto")return i;for(var a={width:e.getWidth(),height:e.getHeight()},o=r.orient==="horizontal"?1:0,s=P1e[o],l=[0,null,10],u={},h=0;h<3;h++)u[P1e[1-o][h]]=l[h],u[s[h]]=h===2?t[0]:r[s[h]];var c=[["x","width",3],["y","height",0]][o],f=Uu(u,a,r.padding);return s[(f.margin[c[2]]||0)+f[c[0]]+f[c[1]]*.5<a[c[1]]*.5?0:1]}function FB(n,e){return te(n||[],function(t){t.dataIndex!=null&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")}),n}var py=go,sIt=te,O1e=Math.min,hX=Math.max,lIt=12,uIt=6,hIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._shapes={},t._dataInterval=[],t._handleEnds=[],t._hoverLinkDataIndices=[],t}return e.prototype.doRender=function(t,r,i,a){this._api=i,(!a||a.type!=="selectDataRange"||a.from!==this.uid)&&this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,r=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(r);var i=t.get("text");this._renderEndsText(r,i,0),this._renderEndsText(r,i,1),this._updateView(!0),this.renderBackground(r),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(r)},e.prototype._renderEndsText=function(t,r,i){if(!!r){var a=r[1-i];a=a!=null?a+"":"";var o=this.visualMapModel,s=o.get("textGap"),l=o.itemSize,u=this._shapes.mainGroup,h=this._applyTransform([l[0]/2,i===0?-s:l[1]+s],u),c=this._applyTransform(i===0?"bottom":"top",u),f=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new la({style:is(d,{x:h[0],y:h[1],verticalAlign:f==="horizontal"?"middle":c,align:f==="horizontal"?c:"center",text:a})}))}},e.prototype._renderBar=function(t){var r=this.visualMapModel,i=this._shapes,a=r.itemSize,o=this._orient,s=this._useHandle,l=GBe(r,this.api,a),u=i.mainGroup=this._createBarGroup(l),h=new Cn;u.add(h),h.add(i.outOfRange=R1e()),h.add(i.inRange=R1e(null,s?N1e(this._orient):null,kr(this._dragHandle,this,"all",!1),kr(this._dragHandle,this,"all",!0))),h.setClipPath(new ta({shape:{x:0,y:0,width:a[0],height:a[1],r:3}}));var c=r.textStyleModel.getTextRect("\u56FD"),f=hX(c.width,c.height);s&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(r,u,0,a,f,o),this._createHandle(r,u,1,a,f,o)),this._createIndicator(r,u,a,f,o),t.add(u)},e.prototype._createHandle=function(t,r,i,a,o,s){var l=kr(this._dragHandle,this,i,!1),u=kr(this._dragHandle,this,i,!0),h=_0(t.get("handleSize"),a[0]),c=hu(t.get("handleIcon"),-h/2,-h/2,h,h,null,!0),f=N1e(this._orient);c.attr({cursor:f,draggable:!0,drift:l,ondragend:u,onmousemove:function(m){l_(m.event)}}),c.x=a[0]/2,c.useStyle(t.getModel("handleStyle").getItemStyle()),c.setStyle({strokeNoScale:!0,strokeFirst:!0}),c.style.lineWidth*=2,c.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),nE(c,!0),r.add(c);var d=this.visualMapModel.textStyleModel,v=new la({cursor:f,draggable:!0,drift:l,onmousemove:function(m){l_(m.event)},ondragend:u,style:is(d,{x:0,y:0,text:""})});v.ensureState("blur").style={opacity:.1},v.stateTransition={duration:200},this.group.add(v);var p=[h,0],g=this._shapes;g.handleThumbs[i]=c,g.handleLabelPoints[i]=p,g.handleLabels[i]=v},e.prototype._createIndicator=function(t,r,i,a,o){var s=_0(t.get("indicatorSize"),i[0]),l=hu(t.get("indicatorIcon"),-s/2,-s/2,s,s,null,!0);l.attr({cursor:"move",invisible:!0,silent:!0,x:i[0]/2});var u=t.getModel("indicatorStyle").getItemStyle();if(l instanceof xc){var h=l.style;l.useStyle(Mt({image:h.image,x:h.x,y:h.y,width:h.width,height:h.height},u))}else l.useStyle(u);r.add(l);var c=this.visualMapModel.textStyleModel,f=new la({silent:!0,invisible:!0,style:is(c,{x:0,y:0,text:""})});this.group.add(f);var d=[(o==="horizontal"?a/2:uIt)+i[0]/2,0],v=this._shapes;v.indicator=l,v.indicatorLabel=f,v.indicatorLabelPoint=d,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,r,i,a){if(!!this._useHandle){if(this._dragging=!r,!r){var o=this._applyTransform([i,a],this._shapes.mainGroup,!0);this._updateInterval(t,o[1]),this._hideIndicator(),this._updateView()}r===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),r?!this._hovering&&this._clearHoverLinkToSeries():D1e(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,r=this._dataInterval=t.getSelected(),i=t.getExtent(),a=[0,t.itemSize[1]];this._handleEnds=[py(r[0],i,a,!0),py(r[1],i,a,!0)]},e.prototype._updateInterval=function(t,r){r=r||0;var i=this.visualMapModel,a=this._handleEnds,o=[0,i.itemSize[1]];J2(r,a,o,t,0);var s=i.getExtent();this._dataInterval=[py(a[0],o,s,!0),py(a[1],o,s,!0)]},e.prototype._updateView=function(t){var r=this.visualMapModel,i=r.getExtent(),a=this._shapes,o=[0,r.itemSize[1]],s=t?o:this._handleEnds,l=this._createBarVisual(this._dataInterval,i,s,"inRange"),u=this._createBarVisual(i,i,o,"outOfRange");a.inRange.setStyle({fill:l.barColor}).setShape("points",l.barPoints),a.outOfRange.setStyle({fill:u.barColor}).setShape("points",u.barPoints),this._updateHandle(s,l)},e.prototype._createBarVisual=function(t,r,i,a){var o={forceState:a,convertOpacityToAlpha:!0},s=this._makeColorGradient(t,o),l=[this.getControllerVisual(t[0],"symbolSize",o),this.getControllerVisual(t[1],"symbolSize",o)],u=this._createBarPoints(i,l);return{barColor:new y3(0,0,0,1,s),barPoints:u,handlesColor:[s[0].color,s[s.length-1].color]}},e.prototype._makeColorGradient=function(t,r){var i=100,a=[],o=(t[1]-t[0])/i;a.push({color:this.getControllerVisual(t[0],"color",r),offset:0});for(var s=1;s<i;s++){var l=t[0]+o*s;if(l>t[1])break;a.push({color:this.getControllerVisual(l,"color",r),offset:s/i})}return a.push({color:this.getControllerVisual(t[1],"color",r),offset:1}),a},e.prototype._createBarPoints=function(t,r){var i=this.visualMapModel.itemSize;return[[i[0]-r[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-r[1],t[1]]]},e.prototype._createBarGroup=function(t){var r=this._orient,i=this.visualMapModel.get("inverse");return new Cn(r==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:r==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:r==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,r){if(!!this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent();sIt([0,1],function(h){var c=o[h];c.setStyle("fill",r.handlesColor[h]),c.y=t[h];var f=py(t[h],[0,l[1]],u,!0),d=this.getControllerVisual(f,"symbolSize");c.scaleX=c.scaleY=d/l[0],c.x=l[0]-d/2;var v=u0(i.handleLabelPoints[h],AE(c,this.group));s[h].setStyle({x:v[0],y:v[1],text:a.formatValueText(this._dataInterval[h]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,r,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],h=this._shapes,c=h.indicator;if(!!c){c.attr("invisible",!1);var f={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",f),v=this.getControllerVisual(t,"symbolSize"),p=py(t,s,u,!0),g=l[0]-v/2,m={x:c.x,y:c.y};c.y=p,c.x=g;var y=u0(h.indicatorLabelPoint,AE(c,this.group)),_=h.indicatorLabel;_.attr("invisible",!1);var x=this._applyTransform("left",h.mainGroup),S=this._orient,w=S==="horizontal";_.setStyle({text:(i||"")+o.formatValueText(r),verticalAlign:w?x:"middle",align:w?"center":x});var b={x:g,y:p,style:{fill:d}},E={style:{x:y[0],y:y[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var T={duration:100,easing:"cubicInOut",additive:!0};c.x=m.x,c.y=m.y,c.animateTo(b,T),_.animateTo(E,T)}else c.attr(b),_.attr(E);this._firstShowIndicator=!1;var C=this._shapes.handleLabels;if(C)for(var A=0;A<C.length;A++)this._api.enterBlur(C[A])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",function(r){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,a=t._applyTransform([r.offsetX,r.offsetY],t._shapes.mainGroup,!0,!0);a[1]=O1e(hX(0,a[1]),i[1]),t._doHoverLinkToSeries(a[1],0<=a[0]&&a[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},e.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(t,r){var i=this.visualMapModel,a=i.itemSize;if(!!i.option.hoverLink){var o=[0,a[1]],s=i.getExtent();t=O1e(hX(o[0],t),o[1]);var l=cIt(i,s,o),u=[t-l,t+l],h=py(t,o,s,!0),c=[py(u[0],o,s,!0),py(u[1],o,s,!0)];u[0]<o[0]&&(c[0]=-1/0),u[1]>o[1]&&(c[1]=1/0),r&&(c[0]===-1/0?this._showIndicator(h,c[1],"< ",l):c[1]===1/0?this._showIndicator(h,c[0],"> ",l):this._showIndicator(h,h,"\u2248 ",l));var f=this._hoverLinkDataIndices,d=[];(r||D1e(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(c));var v=eht(f,d);this._dispatchHighDown("downplay",FB(v[0],i)),this._dispatchHighDown("highlight",FB(v[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var r;if(aE(t.target,function(l){var u=Bn(l);if(u.dataIndex!=null)return r=u,!0},!0),!!r){var i=this.ecModel.getSeriesByIndex(r.seriesIndex),a=this.visualMapModel;if(!!a.isTargetSeries(i)){var o=i.getData(r.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),r.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var r=this._shapes.handleLabels;if(r)for(var i=0;i<r.length;i++)this._api.leaveBlur(r[i])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",FB(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,r,i,a){var o=AE(r,a?null:this.group);return Gt(t)?u0(t,o,i):eU(t,o,i)},e.prototype._dispatchHighDown=function(t,r){r&&r.length&&this.api.dispatchAction({type:t,batch:r})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.prototype.remove=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(BBe);function R1e(n,e,t,r){return new bd({shape:{points:n},draggable:!!t,cursor:e,drift:t,onmousemove:function(i){l_(i.event)},ondragend:r})}function cIt(n,e,t){var r=lIt/2,i=n.get("hoverLinkDataSize");return i&&(r=py(i,e,t,!0)/2),r}function D1e(n){var e=n.get("hoverLinkOnHandle");return!!(e==null?n.get("realtime"):e)}function N1e(n){return n==="vertical"?"ns-resize":"ew-resize"}const fIt=hIt;var dIt={type:"selectDataRange",event:"dataRangeSelected",update:"update"},vIt=function(n,e){e.eachComponent({mainType:"visualMap",query:n},function(t){t.setSelected(n.selected)})},pIt=[{createOnAllSeries:!0,reset:function(n,e){var t=[];return e.eachComponent("visualMap",function(r){var i=n.pipelineContext;!r.isTargetSeries(n)||i&&i.large||t.push(uAt(r.stateList,r.targetVisuals,kr(r.getValueState,r),r.getDataDimensionIndex(n.getData())))}),t}},{createOnAllSeries:!0,reset:function(n,e){var t=n.getData(),r=[];e.eachComponent("visualMap",function(i){if(i.isTargetSeries(n)){var a=i.getVisualMeta(kr(gIt,null,n,i))||{stops:[],outerColors:[]},o=i.getDataDimensionIndex(t);o>=0&&(a.dimension=o,r.push(a))}}),n.getData().setVisual("visualMeta",r)}}];function gIt(n,e,t,r){for(var i=e.targetVisuals[r],a=fc.prepareVisualTypes(i),o={color:w3(n.getData(),"color")},s=0,l=a.length;s<l;s++){var u=a[s],h=i[u==="opacity"?"__alphaForOpacity":u];h&&h.applyVisual(t,c,f)}return o.color;function c(d){return o[d]}function f(d,v){o[d]=v}}var k1e=te;function yIt(n){var e=n&&n.visualMap;Gt(e)||(e=e?[e]:[]),k1e(e,function(t){if(!!t){iC(t,"splitList")&&!iC(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var r=t.pieces;r&&Gt(r)&&k1e(r,function(i){dn(i)&&(iC(i,"start")&&!iC(i,"min")&&(i.min=i.start),iC(i,"end")&&!iC(i,"max")&&(i.max=i.end))})}})}function iC(n,e){return n&&n.hasOwnProperty&&n.hasOwnProperty(e)}var F1e=!1;function zBe(n){F1e||(F1e=!0,n.registerSubTypeDefaulter("visualMap",function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),n.registerAction(dIt,vIt),te(pIt,function(e){n.registerVisual(n.PRIORITY.VISUAL.COMPONENT,e)}),n.registerPreprocessor(yIt))}function UBe(n){n.registerComponentModel(aIt),n.registerComponentView(fIt),zBe(n)}var mIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,r){n.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],_It[this._mode].call(this,this._pieceList),this._resetSelected(t,r);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Sn(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=Vt(this._pieceList,function(l){return l=Sn(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,r={},i=fc.listVisualTypes(),a=this.isCategory();te(t.pieces,function(s){te(i,function(l){s.hasOwnProperty(l)&&(r[l]=1)})}),te(r,function(s,l){var u=!1;te(this.stateList,function(h){u=u||o(t,h,l)||o(t.target,h,l)},this),!u&&te(this.stateList,function(h){(t[h]||(t[h]={}))[l]=FBe.get(l,h==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}n.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,r){var i=this.option,a=this._pieceList,o=(r?i:t).selected||{};if(i.selected=o,te(a,function(l,u){var h=this.getSelectedMapKey(l);o.hasOwnProperty(h)||(o[h]=!0)},this),i.selectedMode==="single"){var s=!1;te(a,function(l,u){var h=this.getSelectedMapKey(l);o[h]&&(s?o[h]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Sn(t)},e.prototype.getValueState=function(t){var r=fc.findPieceIndex(t,this._pieceList);return r!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[r])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var r=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var h=fc.findPieceIndex(l,i);h===t&&o.push(u)},this),r.push({seriesId:a.id,dataIndex:o})},this),r},e.prototype.getRepresentValue=function(t){var r;if(this.isCategory())r=t.value;else if(t.value!=null)r=t.value;else{var i=t.interval||[];r=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return r},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var r=[],i=["",""],a=this;function o(h,c){var f=a.getRepresentValue({interval:h});c||(c=a.getValueState(f));var d=t(f,c);h[0]===-1/0?i[0]=d:h[1]===1/0?i[1]=d:r.push({value:h[0],color:d},{value:h[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return te(s,function(h){var c=h.interval;c&&(c[0]>u&&o([u,c[0]],"outOfRange"),o(c.slice()),u=c[1])},this),{stops:r,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=xw(UG.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(UG),_It={splitNumber:function(n){var e=this.option,t=Math.min(e.precision,20),r=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&n.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o<i;s+=a,o++){var l=o===i-1?r[1]:s+a;n.push({interval:[s,l],close:[1,1]})}e.maxOpen&&n.push({interval:[r[1],1/0],close:[0,0]}),Ive(n),te(n,function(u,h){u.index=h,u.text=this.formatValueText(u.interval)},this)},categories:function(n){var e=this.option;te(e.categories,function(t){n.push({text:this.formatValueText(t,!0),value:t})},this),B1e(e,n)},pieces:function(n){var e=this.option;te(e.pieces,function(t,r){dn(t)||(t={value:t});var i={text:"",index:r};if(t.label!=null&&(i.text=t.label),t.hasOwnProperty("value")){var a=i.value=t.value;i.interval=[a,a],i.close=[1,1]}else{for(var o=i.interval=[],s=i.close=[0,0],l=[1,0,1],u=[-1/0,1/0],h=[],c=0;c<2;c++){for(var f=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&o[c]==null;d++)o[c]=t[f[d]],s[c]=l[d],h[c]=d===2;o[c]==null&&(o[c]=u[c])}h[0]&&o[1]===1/0&&(s[0]=0),h[1]&&o[0]===-1/0&&(s[1]=0),o[0]===o[1]&&s[0]&&s[1]&&(i.value=o[0])}i.visual=fc.retrieveVisuals(t),n.push(i)},this),B1e(e,n),Ive(n),te(n,function(t){var r=t.close,i=[["<","\u2264"][r[1]],[">","\u2265"][r[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function B1e(n,e){var t=n.inverse;(n.orient==="vertical"?!t:t)&&e.reverse()}const xIt=mIt;var SIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var r=this.visualMapModel,i=r.get("textGap"),a=r.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=r.itemSize,h=this._getViewData(),c=h.endsText,f=Gh(r.get("showLabel",!0),!c);c&&this._renderEndsText(t,c[0],u,f,l),te(h.viewPieceList,function(d){var v=d.piece,p=new Cn;p.onclick=kr(this._onItemClick,this,v),this._enableHoverLink(p,d.indexInModelPieceList);var g=r.getRepresentValue(v);if(this._createItemSymbol(p,g,[0,0,u[0],u[1]]),f){var m=this.visualMapModel.getValueState(g);p.add(new la({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:v.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:m==="outOfRange"?.5:1}}))}t.add(p)},this),c&&this._renderEndsText(t,c[1],u,f,l),ME(r.get("orient"),t,r.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,r){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:FB(s.findTargetDataIndices(r),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,r=t.option;if(r.orient==="vertical")return GBe(t,this.api,t.itemSize);var i=r.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,r,i,a,o){if(!!r){var s=new Cn,l=this.visualMapModel.textStyleModel;s.add(new la({style:is(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:r})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,r=Vt(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?r.reverse():i&&(i=i.slice().reverse()),{viewPieceList:r,endsText:i}},e.prototype._createItemSymbol=function(t,r,i){t.add(hu(this.getControllerVisual(r,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(r,"color")))},e.prototype._onItemClick=function(t){var r=this.visualMapModel,i=r.option,a=i.selectedMode;if(!!a){var o=Sn(i.selected),s=r.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,te(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(BBe);const wIt=SIt;function VBe(n){n.registerComponentModel(xIt),n.registerComponentView(wIt),zBe(n)}function bIt(n){_i(UBe),_i(VBe)}var EIt={label:{enabled:!0},decal:{show:!1}},G1e=na(),TIt={};function CIt(n,e){var t=n.getModel("aria");if(!t.get("enabled"))return;var r=Sn(EIt);ii(r.label,n.getLocaleModel().get("aria"),!1),ii(t.option,r,!1),i(),a();function i(){var u=t.getModel("decal"),h=u.get("show");if(h){var c=$r();n.eachSeries(function(f){if(!f.isColorBySeries()){var d=c.get(f.type);d||(d={},c.set(f.type,d)),G1e(f).scope=d}}),n.eachRawSeries(function(f){if(n.isSeriesFiltered(f))return;if(rn(f.enableAriaDecal)){f.enableAriaDecal();return}var d=f.getData();if(f.isColorBySeries()){var y=pJ(f.ecModel,f.name,TIt,n.getSeriesCount()),_=d.getVisual("decal");d.setVisual("decal",x(_,y))}else{var v=f.getRawData(),p={},g=G1e(f).scope;d.each(function(S){var w=d.getRawIndex(S);p[w]=S});var m=v.count();v.each(function(S){var w=p[S],b=v.getName(S)||S+"",E=pJ(f.ecModel,b,g,m),T=d.getItemVisual(w,"decal");d.setItemVisual(w,"decal",x(T,E))})}function x(S,w){var b=S?Mt(Mt({},w),S):w;return b.dirty=!0,b}})}}function a(){var u=n.getLocaleModel().get("aria"),h=t.getModel("label");if(h.option=sn(h.option,u),!!h.get("enabled")){var c=e.getZr().dom;if(h.get("description")){c.setAttribute("aria-label",h.get("description"));return}var f=n.getSeriesCount(),d=h.get(["data","maxCount"])||10,v=h.get(["series","maxCount"])||10,p=Math.min(f,v),g;if(!(f<1)){var m=s();if(m){var y=h.get(["general","withTitle"]);g=o(y,{title:m})}else g=h.get(["general","withoutTitle"]);var _=[],x=f>1?h.get(["series","multiple","prefix"]):h.get(["series","single","prefix"]);g+=o(x,{seriesCount:f}),n.eachSeries(function(E,T){if(T<p){var C=void 0,A=E.get("name"),M=A?"withName":"withoutName";C=f>1?h.get(["series","multiple",M]):h.get(["series","single",M]),C=o(C,{seriesId:E.seriesIndex,seriesName:E.get("name"),seriesType:l(E.subType)});var I=E.getData();if(I.count()>d){var R=h.get(["data","partialData"]);C+=o(R,{displayCnt:d})}else C+=h.get(["data","allData"]);for(var k=h.get(["data","separator","middle"]),D=h.get(["data","separator","end"]),G=[],W=0;W<I.count();W++)if(W<d){var z=I.getName(W),V=I.getValues(W),q=h.get(["data",z?"withName":"withoutName"]);G.push(o(q,{name:z,value:V.join(k)}))}C+=G.join(k)+D,_.push(C)}});var S=h.getModel(["series","multiple","separator"]),w=S.get("middle"),b=S.get("end");g+=_.join(w)+b,c.setAttribute("aria-label",g)}}}function o(u,h){if(!Or(u))return u;var c=u;return te(h,function(f,d){c=c.replace(new RegExp("\\{\\s*"+d+"\\s*\\}","g"),f)}),c}function s(){var u=n.get("title");return u&&u.length&&(u=u[0]),u&&u.text}function l(u){return n.getLocaleModel().get(["series","typeNames"])[u]||"\u81EA\u5B9A\u4E49\u56FE"}}function AIt(n){if(!(!n||!n.aria)){var e=n.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},te(["description","general","series","data"],function(t){e[t]!=null&&(e.label[t]=e[t])})}}function MIt(n){n.registerPreprocessor(AIt),n.registerVisual(n.PRIORITY.VISUAL.ARIA,CIt)}var z1e={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},IIt=function(){function n(e){var t=this._condVal=Or(e)?new RegExp(e):clt(e)?e:null;if(t==null){var r="";ao(r)}}return n.prototype.evaluate=function(e){var t=typeof e;return Or(t)?this._condVal.test(e):ha(t)?this._condVal.test(e+""):!1},n}(),LIt=function(){function n(){}return n.prototype.evaluate=function(){return this.value},n}(),PIt=function(){function n(){}return n.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(!e[t].evaluate())return!1;return!0},n}(),OIt=function(){function n(){}return n.prototype.evaluate=function(){for(var e=this.children,t=0;t<e.length;t++)if(e[t].evaluate())return!0;return!1},n}(),RIt=function(){function n(){}return n.prototype.evaluate=function(){return!this.child.evaluate()},n}(),DIt=function(){function n(){}return n.prototype.evaluate=function(){for(var e=!!this.valueParser,t=this.getValue,r=t(this.valueGetterParam),i=e?this.valueParser(r):null,a=0;a<this.subCondList.length;a++)if(!this.subCondList[a].evaluate(e?i:r))return!1;return!0},n}();function ooe(n,e){if(n===!0||n===!1){var t=new LIt;return t.value=n,t}var r="";return $Be(n)||ao(r),n.and?U1e("and",n,e):n.or?U1e("or",n,e):n.not?NIt(n,e):kIt(n,e)}function U1e(n,e,t){var r=e[n],i="";Gt(r)||ao(i),r.length||ao(i);var a=n==="and"?new PIt:new OIt;return a.children=Vt(r,function(o){return ooe(o,t)}),a.children.length||ao(i),a}function NIt(n,e){var t=n.not,r="";$Be(t)||ao(r);var i=new RIt;return i.child=ooe(t,e),i.child||ao(r),i}function kIt(n,e){for(var t="",r=e.prepareGetValue(n),i=[],a=Li(n),o=n.parser,s=o?mFe(o):null,l=0;l<a.length;l++){var u=a[l];if(!(u==="parser"||e.valueGetterAttrMap.get(u))){var h=Fr(z1e,u)?z1e[u]:u,c=n[u],f=s?s(c):c,d=gdt(h,f)||h==="reg"&&new IIt(f);d||ao(t),i.push(d)}}i.length||ao(t);var v=new DIt;return v.valueGetterParam=r,v.valueParser=s,v.getValue=e.getValue,v.subCondList=i,v}function $Be(n){return dn(n)&&!Yc(n)}var FIt=function(){function n(e,t){this._cond=ooe(e,t)}return n.prototype.evaluate=function(){return this._cond.evaluate()},n}();function BIt(n,e){return new FIt(n,e)}var GIt={type:"echarts:filter",transform:function(n){for(var e=n.upstream,t,r=BIt(n.config,{valueGetterAttrMap:$r({dimension:!0}),prepareGetValue:function(s){var l="",u=s.dimension;Fr(s,"dimension")||ao(l);var h=e.getDimensionInfo(u);return h||ao(l),{dimIdx:h.index}},getValue:function(s){return e.retrieveValueFromItem(t,s.dimIdx)}}),i=[],a=0,o=e.count();a<o;a++)t=e.getRawDataItem(a),r.evaluate()&&i.push(t);return{data:i}}},zIt={type:"echarts:sort",transform:function(n){var e=n.upstream,t=n.config,r="",i=Do(t);i.length||ao(r);var a=[];te(i,function(h){var c=h.dimension,f=h.order,d=h.parser,v=h.incomparable;if(c==null&&ao(r),f!=="asc"&&f!=="desc"&&ao(r),v&&v!=="min"&&v!=="max"){var p="";ao(p)}if(f!=="asc"&&f!=="desc"){var g="";ao(g)}var m=e.getDimensionInfo(c);m||ao(r);var y=d?mFe(d):null;d&&!y&&ao(r),a.push({dimIdx:m.index,parser:y,comparator:new xFe(f,v)})});var o=e.sourceFormat;o!==qc&&o!==ag&&ao(r);for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(h,c){for(var f=0;f<a.length;f++){var d=a[f],v=e.retrieveValueFromItem(h,d.dimIdx),p=e.retrieveValueFromItem(c,d.dimIdx);d.parser&&(v=d.parser(v),p=d.parser(p));var g=d.comparator.evaluate(v,p);if(g!==0)return g}return 0}),{data:s}}};function UIt(n){n.registerTransform(GIt),n.registerTransform(zIt)}var VIt=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataset",t}return e.prototype.init=function(t,r,i){n.prototype.init.call(this,t,r,i),this._sourceManager=new EFe(this),$pe(this)},e.prototype.mergeOption=function(t,r){n.prototype.mergeOption.call(this,t,r),$pe(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Zy},e}(oa),$It=function(n){$e(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dataset",t}return e.type="dataset",e}(pl);function WIt(n){n.registerComponentModel(VIt),n.registerComponentView($It)}var ry=hm.CMD;function dA(n,e){return Math.abs(n-e)<1e-5}function vQ(n){var e=n.data,t=n.len(),r=[],i,a=0,o=0,s=0,l=0;function u(I,R){i&&i.length>2&&r.push(i),i=[I,R]}function h(I,R,k,D){dA(I,k)&&dA(R,D)||i.push(I,R,k,D,k,D)}function c(I,R,k,D,G,W){var z=Math.abs(R-I),V=Math.tan(z/4)*4/3,q=R<I?-1:1,Y=Math.cos(I),le=Math.sin(I),j=Math.cos(R),Q=Math.sin(R),ie=Y*G+k,oe=le*W+D,se=j*G+k,me=Q*W+D,Ce=G*V*q,Le=W*V*q;i.push(ie-Ce*le,oe+Le*Y,se+Ce*Q,me-Le*j,se,me)}for(var f,d,v,p,g=0;g<t;){var m=e[g++],y=g===1;switch(y&&(a=e[g],o=e[g+1],s=a,l=o,(m===ry.L||m===ry.C||m===ry.Q)&&(i=[s,l])),m){case ry.M:a=s=e[g++],o=l=e[g++],u(s,l);break;case ry.L:f=e[g++],d=e[g++],h(a,o,f,d),a=f,o=d;break;case ry.C:i.push(e[g++],e[g++],e[g++],e[g++],a=e[g++],o=e[g++]);break;case ry.Q:f=e[g++],d=e[g++],v=e[g++],p=e[g++],i.push(a+2/3*(f-a),o+2/3*(d-o),v+2/3*(f-v),p+2/3*(d-p),v,p),a=v,o=p;break;case ry.A:var _=e[g++],x=e[g++],S=e[g++],w=e[g++],b=e[g++],E=e[g++]+b;g+=1;var T=!e[g++];f=Math.cos(b)*S+_,d=Math.sin(b)*w+x,y?(s=f,l=d,u(s,l)):h(a,o,f,d),a=Math.cos(E)*S+_,o=Math.sin(E)*w+x;for(var C=(T?-1:1)*Math.PI/2,A=b;T?A>E:A<E;A+=C){var M=T?Math.max(A+C,E):Math.min(A+C,E);c(A,M,_,x,S,w)}break;case ry.R:s=a=e[g++],l=o=e[g++],f=s+e[g++],d=l+e[g++],u(f,l),h(f,l,f,d),h(f,d,s,d),h(s,d,s,l),h(s,l,f,l);break;case ry.Z:i&&h(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&r.push(i),r}function pQ(n,e,t,r,i,a,o,s,l,u){if(dA(n,t)&&dA(e,r)&&dA(i,o)&&dA(a,s)){l.push(o,s);return}var h=2/u,c=h*h,f=o-n,d=s-e,v=Math.sqrt(f*f+d*d);f/=v,d/=v;var p=t-n,g=r-e,m=i-o,y=a-s,_=p*p+g*g,x=m*m+y*y;if(_<c&&x<c){l.push(o,s);return}var S=f*p+d*g,w=-f*m-d*y,b=_-S*S,E=x-w*w;if(b<c&&S>=0&&E<c&&w>=0){l.push(o,s);return}var T=[],C=[];DS(n,t,i,o,.5,T),DS(e,r,a,s,.5,C),pQ(T[0],C[0],T[1],C[1],T[2],C[2],T[3],C[3],l,u),pQ(T[4],C[4],T[5],C[5],T[6],C[6],T[7],C[7],l,u)}function HIt(n,e){var t=vQ(n),r=[];e=e||1;for(var i=0;i<t.length;i++){var a=t[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var h=a[u++],c=a[u++],f=a[u++],d=a[u++],v=a[u++],p=a[u++];pQ(s,l,h,c,f,d,v,p,o,e),s=v,l=p}r.push(o)}return r}function WBe(n,e,t){var r=n[e],i=n[1-e],a=Math.abs(r/i),o=Math.ceil(Math.sqrt(a*t)),s=Math.floor(t/o);s===0&&(s=1,o=t);for(var l=[],u=0;u<o;u++)l.push(s);var h=o*s,c=t-h;if(c>0)for(var u=0;u<c;u++)l[u%o]+=1;return l}function V1e(n,e,t){for(var r=n.r0,i=n.r,a=n.startAngle,o=n.endAngle,s=Math.abs(o-a),l=s*i,u=i-r,h=l>Math.abs(u),c=WBe([l,u],h?0:1,e),f=(h?s:u)/c.length,d=0;d<c.length;d++)for(var v=(h?u:s)/c[d],p=0;p<c[d];p++){var g={};h?(g.startAngle=a+f*d,g.endAngle=a+f*(d+1),g.r0=r+v*p,g.r=r+v*(p+1)):(g.startAngle=a+v*p,g.endAngle=a+v*(p+1),g.r0=r+f*d,g.r=r+f*(d+1)),g.clockwise=n.clockwise,g.cx=n.cx,g.cy=n.cy,t.push(g)}}function jIt(n,e,t){for(var r=n.width,i=n.height,a=r>i,o=WBe([r,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",c=n[s]/o.length,f=0;f<o.length;f++)for(var d=n[l]/o[f],v=0;v<o[f];v++){var p={};p[u]=f*c,p[h]=v*d,p[s]=c,p[l]=d,p.x+=n.x,p.y+=n.y,t.push(p)}}function $1e(n,e,t,r){return n*r-t*e}function XIt(n,e,t,r,i,a,o,s){var l=t-n,u=r-e,h=o-i,c=s-a,f=$1e(h,c,l,u);if(Math.abs(f)<1e-6)return null;var d=n-i,v=e-a,p=$1e(d,v,h,c)/f;return p<0||p>1?null:new qn(p*l+n,p*u+e)}function YIt(n,e,t){var r=new qn;qn.sub(r,t,e),r.normalize();var i=new qn;qn.sub(i,n,e);var a=i.dot(r);return a}function aC(n,e){var t=n[n.length-1];t&&t[0]===e[0]&&t[1]===e[1]||n.push(e)}function qIt(n,e,t){for(var r=n.length,i=[],a=0;a<r;a++){var o=n[a],s=n[(a+1)%r],l=XIt(o[0],o[1],s[0],s[1],e.x,e.y,t.x,t.y);l&&i.push({projPt:YIt(l,e,t),pt:l,idx:a})}if(i.length<2)return[{points:n},{points:n}];i.sort(function(g,m){return g.projPt-m.projPt});var u=i[0],h=i[i.length-1];if(h.idx<u.idx){var c=u;u=h,h=c}for(var f=[u.pt.x,u.pt.y],d=[h.pt.x,h.pt.y],v=[f],p=[d],a=u.idx+1;a<=h.idx;a++)aC(v,n[a].slice());aC(v,d),aC(v,f);for(var a=h.idx+1;a<=u.idx+r;a++)aC(p,n[a%r].slice());return aC(p,f),aC(p,d),[{points:v},{points:p}]}function W1e(n){var e=n.points,t=[],r=[];Yz(e,t,r);var i=new ai(t[0],t[1],r[0]-t[0],r[1]-t[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new qn,h=new qn;return a>o?(u.x=h.x=s+a/2,u.y=l,h.y=l+o):(u.y=h.y=l+o/2,u.x=s,h.x=s+a),qIt(e,u,h)}function VG(n,e,t,r){if(t===1)r.push(e);else{var i=Math.floor(t/2),a=n(e);VG(n,a[0],i,r),VG(n,a[1],t-i,r)}return r}function ZIt(n,e){for(var t=[],r=0;r<e;r++)t.push(bie(n));return t}function KIt(n,e){e.setStyle(n.style),e.z=n.z,e.z2=n.z2,e.zlevel=n.zlevel}function JIt(n){for(var e=[],t=0;t<n.length;)e.push([n[t++],n[t++]]);return e}function QIt(n,e){var t=[],r=n.shape,i;switch(n.type){case"rect":jIt(r,e,t),i=ta;break;case"sector":V1e(r,e,t),i=wd;break;case"circle":V1e({r0:0,r:r.r,startAngle:0,endAngle:Math.PI*2,cx:r.cx,cy:r.cy},e,t),i=wd;break;default:var a=n.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=Vt(HIt(n.getUpdatedPathProxy(),o),function(m){return JIt(m)}),l=s.length;if(l===0)VG(W1e,{points:s[0]},e,t);else if(l===e)for(var u=0;u<l;u++)t.push({points:s[u]});else{var h=0,c=Vt(s,function(m){var y=[],_=[];Yz(m,y,_);var x=(_[1]-y[1])*(_[0]-y[0]);return h+=x,{poly:m,area:x}});c.sort(function(m,y){return y.area-m.area});for(var f=e,u=0;u<l;u++){var d=c[u];if(f<=0)break;var v=u===l-1?f:Math.ceil(d.area/h*e);v<0||(VG(W1e,{points:d.poly},v,t),f-=v)}}i=bd;break}if(!i)return ZIt(n,e);for(var p=[],u=0;u<t.length;u++){var g=new i;g.setShape(t[u]),KIt(n,g),p.push(g)}return p}function eLt(n,e){var t=n.length,r=e.length;if(t===r)return[n,e];for(var i=[],a=[],o=t<r?n:e,s=Math.min(t,r),l=Math.abs(r-t)/6,u=(s-2)/6,h=Math.ceil(l/u)+1,c=[o[0],o[1]],f=l,d=2;d<s;){var v=o[d-2],p=o[d-1],g=o[d++],m=o[d++],y=o[d++],_=o[d++],x=o[d++],S=o[d++];if(f<=0){c.push(g,m,y,_,x,S);continue}for(var w=Math.min(f,h-1)+1,b=1;b<=w;b++){var E=b/w;DS(v,g,y,x,E,i),DS(p,m,_,S,E,a),v=i[3],p=a[3],c.push(i[1],a[1],i[2],a[2],v,p),g=i[5],m=a[5],y=i[6],_=a[6]}f-=w-1}return o===n?[c,e]:[n,c]}function H1e(n,e){for(var t=n.length,r=n[t-2],i=n[t-1],a=[],o=0;o<e.length;)a[o++]=r,a[o++]=i;return a}function tLt(n,e){for(var t,r,i,a=[],o=[],s=0;s<Math.max(n.length,e.length);s++){var l=n[s],u=e[s],h=void 0,c=void 0;l?u?(t=eLt(l,u),h=t[0],c=t[1],r=h,i=c):(c=H1e(i||l,l),h=l):(h=H1e(r||u,u),c=u),a.push(h),o.push(c)}return[a,o]}function j1e(n){for(var e=0,t=0,r=0,i=n.length,a=0,o=i-2;a<i;o=a,a+=2){var s=n[o],l=n[o+1],u=n[a],h=n[a+1],c=s*h-u*l;e+=c,t+=(s+u)*c,r+=(l+h)*c}return e===0?[n[0]||0,n[1]||0]:[t/e/3,r/e/3,e]}function rLt(n,e,t,r){for(var i=(n.length-2)/6,a=1/0,o=0,s=n.length,l=s-2,u=0;u<i;u++){for(var h=u*6,c=0,f=0;f<s;f+=2){var d=f===0?h:(h+f-2)%l+2,v=n[d]-t[0],p=n[d+1]-t[1],g=e[f]-r[0],m=e[f+1]-r[1],y=g-v,_=m-p;c+=y*y+_*_}c<a&&(a=c,o=u)}return o}function nLt(n){for(var e=[],t=n.length,r=0;r<t;r+=2)e[r]=n[t-r-2],e[r+1]=n[t-r-1];return e}function iLt(n,e,t,r){for(var i=[],a,o=0;o<n.length;o++){var s=n[o],l=e[o],u=j1e(s),h=j1e(l);a==null&&(a=u[2]<0!=h[2]<0);var c=[],f=[],d=0,v=1/0,p=[],g=s.length;a&&(s=nLt(s));for(var m=rLt(s,l,u,h)*6,y=g-2,_=0;_<y;_+=2){var x=(m+_)%y+2;c[_+2]=s[x]-u[0],c[_+3]=s[x+1]-u[1]}if(c[0]=s[m]-u[0],c[1]=s[m+1]-u[1],t>0)for(var S=r/t,w=-r/2;w<=r/2;w+=S){for(var b=Math.sin(w),E=Math.cos(w),T=0,_=0;_<s.length;_+=2){var C=c[_],A=c[_+1],M=l[_]-h[0],I=l[_+1]-h[1],R=M*E-I*b,k=M*b+I*E;p[_]=R,p[_+1]=k;var D=R-C,G=k-A;T+=D*D+G*G}if(T<v){v=T,d=w;for(var W=0;W<p.length;W++)f[W]=p[W]}}else for(var z=0;z<g;z+=2)f[z]=l[z]-h[0],f[z+1]=l[z+1]-h[1];i.push({from:c,to:f,fromCp:u,toCp:h,rotation:-d})}return i}function $G(n){return n.__isCombineMorphing}var HBe="__mOriginal_";function WG(n,e,t){var r=HBe+e,i=n[r]||n[e];n[r]||(n[r]=n[e]);var a=t.replace,o=t.after,s=t.before;n[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function iR(n,e){var t=HBe+e;n[t]&&(n[e]=n[t],n[t]=null)}function X1e(n,e){for(var t=0;t<n.length;t++)for(var r=n[t],i=0;i<r.length;){var a=r[i],o=r[i+1];r[i++]=e[0]*a+e[2]*o+e[4],r[i++]=e[1]*a+e[3]*o+e[5]}}function jBe(n,e){var t=n.getUpdatedPathProxy(),r=e.getUpdatedPathProxy(),i=tLt(vQ(t),vQ(r)),a=i[0],o=i[1],s=n.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&X1e(a,s),l&&X1e(o,l),WG(e,"updateTransform",{replace:u}),e.transform=null;var h=iLt(a,o,10,Math.PI),c=[];WG(e,"buildPath",{replace:function(f){for(var d=e.__morphT,v=1-d,p=[],g=0;g<h.length;g++){var m=h[g],y=m.from,_=m.to,x=m.rotation*d,S=m.fromCp,w=m.toCp,b=Math.sin(x),E=Math.cos(x);_B(p,S,w,d);for(var T=0;T<y.length;T+=2){var C=y[T],A=y[T+1],M=_[T],I=_[T+1],R=C*v+M*d,k=A*v+I*d;c[T]=R*E-k*b+p[0],c[T+1]=R*b+k*E+p[1]}var D=c[0],G=c[1];f.moveTo(D,G);for(var T=2;T<y.length;){var M=c[T++],I=c[T++],W=c[T++],z=c[T++],V=c[T++],q=c[T++];D===M&&G===I&&W===V&&z===q?f.lineTo(V,q):f.bezierCurveTo(M,I,W,z,V,q),D=V,G=q}}}})}function soe(n,e,t){if(!n||!e)return e;var r=t.done,i=t.during;jBe(n,e),e.__morphT=0;function a(){iR(e,"buildPath"),iR(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},sn({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),r&&r()}},t)),e}function aLt(n,e,t,r,i,a){var o=16;n=i===t?0:Math.round(32767*(n-t)/(i-t)),e=a===r?0:Math.round(32767*(e-r)/(a-r));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var h=0,c=0;(n&u)>0&&(h=1),(e&u)>0&&(c=1),s+=u*u*(3*h^c),c===0&&(h===1&&(n=u-1-n,e=u-1-e),l=n,n=e,e=l)}return s}function HG(n){var e=1/0,t=1/0,r=-1/0,i=-1/0,a=Vt(n,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),h=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return e=Math.min(h,e),t=Math.min(c,t),r=Math.max(h,r),i=Math.max(c,i),[h,c]}),o=Vt(a,function(s,l){return{cp:s,z:aLt(s[0],s[1],e,t,r,i),path:n[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function XBe(n){return QIt(n.path,n.count)}function gQ(){return{fromIndividuals:[],toIndividuals:[],count:0}}function oLt(n,e,t){var r=[];function i(S){for(var w=0;w<S.length;w++){var b=S[w];$G(b)?i(b.childrenRef()):b instanceof Si&&r.push(b)}}i(n);var a=r.length;if(!a)return gQ();var o=t.dividePath||XBe,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),gQ();r=HG(r),s=HG(s);for(var l=t.done,u=t.during,h=t.individualDelay,c=new L1,f=0;f<a;f++){var d=r[f],v=s[f];v.parent=e,v.copyTransform(c),h||jBe(d,v)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function p(S){for(var w=0;w<s.length;w++)s[w].addSelfToZr(S)}WG(e,"addSelfToZr",{after:function(S){p(S)}}),WG(e,"removeSelfFromZr",{after:function(S){for(var w=0;w<s.length;w++)s[w].removeSelfFromZr(S)}});function g(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,iR(e,"addSelfToZr"),iR(e,"removeSelfFromZr")}var m=s.length;if(h)for(var y=m,_=function(){y--,y===0&&(g(),l&&l())},f=0;f<m;f++){var x=h?sn({delay:(t.delay||0)+h(f,m,r[f],s[f]),done:_},t):t;soe(r[f],s[f],x)}else e.__morphT=0,e.animateTo({__morphT:1},sn({during:function(S){for(var w=0;w<m;w++){var b=s[w];b.__morphT=e.__morphT,b.dirtyShape()}u&&u(S)},done:function(){g();for(var S=0;S<n.length;S++)iR(n[S],"updateTransform");l&&l()}},t));return e.__zr&&p(e.__zr),{fromIndividuals:r,toIndividuals:s,count:m}}function sLt(n,e,t){var r=e.length,i=[],a=t.dividePath||XBe;function o(d){for(var v=0;v<d.length;v++){var p=d[v];$G(p)?o(p.childrenRef()):p instanceof Si&&i.push(p)}}if($G(n)){o(n.childrenRef());var s=i.length;if(s<r)for(var l=0,u=s;u<r;u++)i.push(bie(i[l++%s]));i.length=r}else{i=a({path:n,count:r});for(var h=n.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(h);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),gQ()}i=HG(i),e=HG(e);for(var c=t.individualDelay,u=0;u<r;u++){var f=c?sn({delay:(t.delay||0)+c(u,r,i[u],e[u])},t):t;soe(i[u],e[u],f)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function Y1e(n){return Gt(n[0])}function q1e(n,e){for(var t=[],r=n.length,i=0;i<r;i++)t.push({one:n[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)t[o%r].many.push(e[i][o])}for(var s=0,i=r-1;i>=0;i--)if(!t[i].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var lLt={clone:function(n){for(var e=[],t=1-Math.pow(1-n.path.style.opacity,1/n.count),r=0;r<n.count;r++){var i=bie(n.path);i.setStyle("opacity",t),e.push(i)}return e},split:null};function cX(n,e,t,r,i,a){if(!n.length||!e.length)return;var o=RI("update",r,i);if(!(o&&o.duration>0))return;var s=r.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,h;Y1e(n)&&(u=n,h=e),Y1e(e)&&(u=e,h=n);function c(m,y,_,x,S){var w=m.many,b=m.one;if(w.length===1&&!S){var E=y?w[0]:b,T=y?b:w[0];if($G(E))c({many:[E],one:T},!0,_,x,!0);else{var C=s?sn({delay:s(_,x)},l):l;soe(E,T,C),a(E,T,E,T,C)}}else for(var A=sn({dividePath:lLt[t],individualDelay:s&&function(G,W,z,V){return s(G+_,x)}},l),M=y?oLt(w,b,A):sLt(b,w,A),I=M.fromIndividuals,R=M.toIndividuals,k=I.length,D=0;D<k;D++){var C=s?sn({delay:s(D,k)},l):l;a(I[D],R[D],y?w[D]:m.one,y?m.one:w[D],C)}}for(var f=u?u===n:n.length>e.length,d=u?q1e(h,u):q1e(f?e:n,[f?n:e]),v=0,p=0;p<d.length;p++)v+=d[p].many.length;for(var g=0,p=0;p<d.length;p++)c(d[p],f,g,v),g+=d[p].many.length}function kb(n){if(!n)return[];if(Gt(n)){for(var e=[],t=0;t<n.length;t++)e.push(kb(n[t]));return e}var r=[];return n.traverse(function(i){i instanceof Si&&!i.disableMorphing&&!i.invisible&&!i.ignore&&r.push(i)}),r}var YBe=1e4,uLt=na();function hLt(n){for(var e=n.dimensions,t=0;t<e.length;t++){var r=n.getDimensionInfo(e[t]);if(r&&r.otherDims.itemGroupId===0)return e[t]}}function Z1e(n){var e=[];return te(n,function(t){var r=t.data;if(!(r.count()>YBe))for(var i=r.getIndices(),a=hLt(r),o=0;o<i.length;o++)e.push({dataGroupId:t.dataGroupId,data:r,dim:t.dim||a,divide:t.divide,dataIndex:o})}),e}function fX(n,e,t){n.traverse(function(r){r instanceof Si&&Is(r,{style:{opacity:0}},e,{dataIndex:t,isFrom:!0})})}function dX(n){if(n.parent){var e=n.getComputedTransform();n.setLocalTransform(e),n.parent.remove(n)}}function oC(n){n.stopAnimation(),n.isGroup&&n.traverse(function(e){e.stopAnimation()})}function cLt(n,e,t){var r=RI("update",t,e);r&&n.traverse(function(i){if(i instanceof Vp){var a=qct(i);a&&i.animateFrom({style:a},r)}})}function fLt(n,e){var t=n.length;if(t!==e.length)return!1;for(var r=0;r<t;r++){var i=n[r],a=e[r];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function qBe(n,e,t){var r=Z1e(n),i=Z1e(e);function a(m,y,_,x,S){(_||m)&&y.animateFrom({style:_&&_!==m?Mt(Mt({},_.style),m.style):m.style},S)}function o(m){for(var y=0;y<m.length;y++)if(m[y].dim)return m[y].dim}var s=o(r),l=o(i),u=!1;function h(m,y){return function(_){var x=_.data,S=_.dataIndex;if(y)return x.getId(S);var w=_.dataGroupId,b=m?s||l:l||s,E=b&&x.getDimensionInfo(b),T=E&&E.ordinalMeta;if(E){var C=x.get(E.name,S);return T&&T.categories[C]||C+""}var A=x.getRawDataItem(S);return A&&A.groupId?A.groupId+"":w||x.getId(S)}}var c=fLt(r,i),f={};if(!c)for(var d=0;d<i.length;d++){var v=i[d],p=v.data.getItemGraphicEl(v.dataIndex);p&&(f[p.id]=!0)}function g(m,y){var _=r[y],x=i[m],S=x.data.hostModel,w=_.data.getItemGraphicEl(_.dataIndex),b=x.data.getItemGraphicEl(x.dataIndex);if(w===b){b&&cLt(b,x.dataIndex,S);return}w&&f[w.id]||b&&(oC(b),w?(oC(w),dX(w),u=!0,cX(kb(w),kb(b),x.divide,S,m,a)):fX(b,S,m))}new f_(r,i,h(!0,c),h(!1,c),null,"multiple").update(g).updateManyToOne(function(m,y){var _=i[m],x=_.data,S=x.hostModel,w=x.getItemGraphicEl(_.dataIndex),b=To(Vt(y,function(E){return r[E].data.getItemGraphicEl(r[E].dataIndex)}),function(E){return E&&E!==w&&!f[E.id]});w&&(oC(w),b.length?(te(b,function(E){oC(E),dX(E)}),u=!0,cX(kb(b),kb(w),_.divide,S,m,a)):fX(w,S,_.dataIndex))}).updateOneToMany(function(m,y){var _=r[y],x=_.data.getItemGraphicEl(_.dataIndex);if(!(x&&f[x.id])){var S=To(Vt(m,function(b){return i[b].data.getItemGraphicEl(i[b].dataIndex)}),function(b){return b&&b!==x}),w=i[m[0]].data.hostModel;S.length&&(te(S,function(b){return oC(b)}),x?(oC(x),dX(x),u=!0,cX(kb(x),kb(S),_.divide,w,m[0],a)):te(S,function(b){return fX(b,w,m[0])}))}}).updateManyToMany(function(m,y){new f_(y,m,function(_){return r[_].data.getId(r[_].dataIndex)},function(_){return i[_].data.getId(i[_].dataIndex)}).update(function(_,x){g(m[_],y[x])}).execute()}).execute(),u&&te(e,function(m){var y=m.data,_=y.hostModel,x=_&&t.getViewOfSeriesModel(_),S=RI("update",_,0);x&&_.isAnimationEnabled()&&S&&S.duration>0&&x.group.traverse(function(w){w instanceof Si&&!w.animators.length&&w.animateFrom({style:{opacity:0}},S)})})}function K1e(n){var e=n.getModel("universalTransition").get("seriesKey");return e||n.id}function J1e(n){return Gt(n)?n.sort().join(","):n}function kx(n){if(n.hostModel)return n.hostModel.getModel("universalTransition").get("divideShape")}function dLt(n,e){var t=$r(),r=$r(),i=$r();return te(n.oldSeries,function(a,o){var s=n.oldDataGroupIds[o],l=n.oldData[o],u=K1e(a),h=J1e(u);r.set(h,{dataGroupId:s,data:l}),Gt(u)&&te(u,function(c){i.set(c,{key:h,dataGroupId:s,data:l})})}),te(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=K1e(a),u=J1e(l),h=r.get(u);if(h)t.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:kx(h.data),data:h.data}],newSeries:[{dataGroupId:o,divide:kx(s),data:s}]});else if(Gt(l)){var c=[];te(l,function(v){var p=r.get(v);p.data&&c.push({dataGroupId:p.dataGroupId,divide:kx(p.data),data:p.data})}),c.length&&t.set(u,{oldSeries:c,newSeries:[{dataGroupId:o,data:s,divide:kx(s)}]})}else{var f=i.get(l);if(f){var d=t.get(f.key);d||(d={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:kx(f.data)}],newSeries:[]},t.set(f.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:kx(s)})}}}}),t}function Q1e(n,e){for(var t=0;t<n.length;t++){var r=e.seriesIndex!=null&&e.seriesIndex===n[t].seriesIndex||e.seriesId!=null&&e.seriesId===n[t].id;if(r)return t}}function vLt(n,e,t,r){var i=[],a=[];te(Do(n.from),function(o){var s=Q1e(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:kx(e.oldData[s]),dim:o.dimension})}),te(Do(n.to),function(o){var s=Q1e(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:kx(l),dim:o.dimension})}}),i.length>0&&a.length>0&&qBe(i,a,r)}function pLt(n){n.registerUpdateLifecycle("series:beforeupdate",function(e,t,r){te(Do(r.seriesTransition),function(i){te(Do(i.to),function(a){for(var o=r.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][PB]=!0)})})}),n.registerUpdateLifecycle("series:transition",function(e,t,r){var i=uLt(t);if(i.oldSeries&&r.updatedSeries&&r.optionChanged){var a=r.seriesTransition;if(a)te(Do(a),function(d){vLt(d,i,r,t)});else{var o=dLt(i,r);te(o.keys(),function(d){var v=o.get(d);qBe(v.oldSeries,v.newSeries,t)})}te(r.updatedSeries,function(d){d[PB]&&(d[PB]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],h=i.oldData=[],c=0;c<s.length;c++){var f=s[c].getData();f.count()<YBe&&(l.push(s[c]),u.push(s[c].get("dataGroupId")),h.push(f))}})}_i([O0t]);_i([T0t]);_i([ryt,xyt,Ryt,xmt,Fmt,P1t,l_t,Y_t,wxt,Pxt,Vxt,jSt,_wt,Owt,Jwt,abt,bbt,Rbt,jbt,eEt,dEt,JEt]);_i(S2t);_i(tTt);_i(W5e);_i(mTt);_i(L6e);_i(TTt);_i(DTt);_i(NCt);_i(iAt);_i(R3);_i(EAt);_i(AAt);_i(VAt);_i(JAt);_i(oMt);_i(vMt);_i(MMt);_i(ZMt);_i(NBe);_i(kBe);_i(bIt);_i(UBe);_i(VBe);_i(MIt);_i(UIt);_i(WIt);_i(pLt);_i(Hgt);let gLt={title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure\uFF01",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},yLt={title_dataFlowService:"\u6570\u636E\u6D41\u670D\u52A1",title_distributedAnalysis:"\u5206\u5E03\u5F0F\u5206\u6790",title_clientComputing:"\u5BA2\u6237\u7AEF\u8BA1\u7B97",title_dataServiceQuery:"\u6570\u636E\u670D\u52A1\u67E5\u8BE2",title_searchCity:"\u641C\u7D22\u57CE\u5E02",title_searchLayer:"\u641C\u7D22\u56FE\u5C42",text_input_value_inputDataFlowUrl:"\u8BF7\u8F93\u5165\u6570\u636E\u6D41\u670D\u52A1\u5730\u5740\u5982:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"\u663E\u793A\u8981\u7D20\u4FE1\u606F",text_subscribe:"\u8BA2\u9605",text_cancelSubscribe:"\u53D6\u6D88\u8BA2\u9605",text_densityAnalysis:"\u5BC6\u5EA6\u5206\u6790",text_CalculateTheValuePerUnitArea:"\u8BA1\u7B97\u70B9\u6307\u5B9A\u90BB\u57DF\u5F62\u72B6\u5185\u7684\u6BCF\u5355\u4F4D\u9762\u79EF\u91CF\u503C",text_option_selectDataset:"\u8BF7\u9009\u62E9\u6570\u636E\u96C6",text_label_dataset:"\u6570\u636E\u96C6",text_option_simplePointDensityAnalysis:"\u7B80\u5355\u70B9\u5BC6\u5EA6\u5206\u6790",text_option_nuclearDensityAnalysis:"\u6838\u5BC6\u5EA6\u5206\u6790",text_label_analyticalMethod:"\u5206\u6790\u65B9\u6CD5",text_option_quadrilateral:"\u56DB\u8FB9\u5F62",text_option_hexagon:"\u516D\u8FB9\u5F62",text_label_meshType:"\u7F51\u683C\u9762\u7C7B\u578B",text_option_notSet:"\u672A\u8BBE\u7F6E",text_label_weightField:"\u6743\u91CD\u5B57\u6BB5",text_label_gridSizeInMeters:"\u7F51\u683C\u5927\u5C0F",text_label_searchRadius:"\u641C\u7D22\u534A\u5F84",text_label_queryRange:"\u5206\u6790\u8303\u56F4",text_label_areaUnit:"\u9762\u79EF\u5355\u4F4D",text_option_equidistantSegmentation:"\u7B49\u8DDD\u79BB\u5206\u6BB5",text_option_logarithm:"\u5BF9\u6570",text_option_equalCountingSegment:"\u7B49\u8BA1\u6570\u5206\u6BB5",text_option_squareRootSegmentation:"\u5E73\u65B9\u6839\u5206\u6BB5",text_label_thematicMapSegmentationMode:"\u4E13\u9898\u56FE\u5206\u6BB5\u6A21\u5F0F",text_label_thematicMapSegmentationParameters:"\u4E13\u9898\u56FE\u5206\u6BB5\u53C2\u6570",text_option_greenOrangePurpleGradient:"\u7EFF\u6A59\u7D2B\u6E10\u53D8",text_option_greenOrangeRedGradient:"\u7EFF\u6A59\u7EA2\u6E10\u53D8",text_option_rainbowGradient:"\u5F69\u8679\u6E10\u53D8",text_option_spectralGradient:"\u5149\u8C31\u6E10\u53D8",text_option_terrainGradient:"\u5730\u5F62\u6E10\u53D8",text_label_thematicMapColorGradientMode:"\u4E13\u9898\u56FE\u989C\u8272\u6E10\u53D8\u6A21\u5F0F",text_label_resultLayerName:"\u7ED3\u679C\u56FE\u5C42\u540D\u79F0",text_chooseFile:"\u9009\u62E9\u6587\u4EF6",text_isoline:"\u7B49\u503C\u7EBF",text_extractDiscreteValue:"\u63D0\u53D6\u79BB\u6563\u503C\u751F\u6210\u66F2\u7EBF",text_buffer:"\u7F13\u51B2\u533A",text_specifyTheDistance:"\u6307\u5B9A\u8DDD\u79BB\u521B\u5EFA\u5468\u8FB9\u533A\u57DF",text_label_analysisLayer:"\u5206\u6790\u56FE\u5C42",text_label_extractField:"\u63D0\u53D6\u5B57\u6BB5",text_label_extractedValue:"\u63D0\u53D6\u503C",text_label_distanceAttenuation:"\u8DDD\u79BB\u8870\u51CF",text_label_gridSize:"\u6805\u683C\u5927\u5C0F",text_label_bufferRadius:"\u7F13\u51B2\u534A\u5F84",text_label_defaultkilometers:"\u9ED8\u8BA410\u5343\u7C73",text_option_kilometer:"\u5343\u7C73",text_label_unit:"\u5355\u4F4D",text_retainOriginal:"\u4FDD\u7559\u539F\u5BF9\u8C61\u5B57\u6BB5\u5C5E\u6027",text_mergeBuffer:"\u5408\u5E76\u7F13\u51B2\u533A",text_label_color:"\u989C\u8272",text_label_buffer:"[\u7F13\u51B2\u533A]",text_label_isolines:"[\u7B49\u503C\u7EBF]",text_label_queryRangeTips:"\u9ED8\u8BA4\u4E3A\u8F93\u5165\u6570\u636E\u7684\u5168\u5E45\u8303\u56F4\u3002\u8303\u4F8B\uFF1A-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"\u8981\u7D20 ID \u6570\u7EC4",text_label_maxFeatures:"\u6700\u591A\u53EF\u8FD4\u56DE\u7684\u8981\u7D20\u6570\u91CF",text_label_bufferDistance:"\u7F13\u51B2\u533A\u8DDD\u79BB",text_label_queryRange1:"\u67E5\u8BE2\u8303\u56F4",text_label_spatialQueryMode:"\u7A7A\u95F4\u67E5\u8BE2\u6A21\u5F0F",text_label_featureFilter:"\u8981\u7D20\u8FC7\u6EE4\u5668",text_label_geometricObject:"\u51E0\u4F55\u5BF9\u8C61",text_label_queryMode:"\u67E5\u8BE2\u6A21\u5F0F",text_label_searchTips:"\u641C\u7D22\u57CE\u5E02\u5730\u70B9\u6216\u56FE\u5C42\u8981\u7D20",text_label_chooseSearchLayers:"\u9009\u62E9\u67E5\u8BE2\u56FE\u5C42",text_loadSearchCriteria:"\u52A0\u8F7D\u641C\u7D22\u6761\u4EF6",text_saveSearchCriteria:"\u4FDD\u5B58\u641C\u7D22\u6761\u4EF6",btn_analyze:"\u5206\u6790",btn_analyzing:"\u5206\u6790\u4E2D",btn_emptyTheAnalysisLayer:"\u6E05\u7A7A\u5206\u6790\u56FE\u5C42",btn_cancelAnalysis:"\u53D6\u6D88",btn_query:"\u67E5\u8BE2",btn_querying:"\u67E5\u8BE2\u4E2D",btn_emptyTheRresultLayer:"\u6E05\u9664\u6240\u6709\u7ED3\u679C\u56FE\u5C42",msg_dataFlowServiceHasBeenSubscribed:"\u5DF2\u8BA2\u9605\u8BE5\u6570\u636E\u6D41\u670D\u52A1\u3002",msg_inputDataFlowUrlFirst:"\u8BF7\u5148\u8F93\u5165\u6570\u636E\u6D41\u670D\u52A1\u5730\u5740\u3002",msg_datasetOrMethodUnsupport:"\u8BE5\u6570\u636E\u96C6\u4E0D\u652F\u6301\u672C\u5206\u6790\u7C7B\u578B\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6570\u636E\u96C6",msg_selectDataset:"\u8BF7\u9009\u62E9\u6570\u636E\u96C6\uFF01",msg_setTheWeightField:"\u8BF7\u8BBE\u7F6E\u6743\u91CD\u5B57\u6BB5\uFF01",msg_theFieldNotSupportAnalysis:"\u60A8\u5F53\u524D\u9009\u62E9\u7684\u5B57\u6BB5\u4E0D\u652F\u6301\u5206\u6790\uFF01",msg_resultIsEmpty:"\u5206\u6790\u7684\u7ED3\u679C\u4E3A\u7A7A\uFF01",msg_dataReturnedIsEmpty:"\u8BF7\u6C42\u6210\u529F\uFF0C\u67E5\u8BE2\u8FD4\u56DE\u7684\u6570\u636E\u4E3A\u7A7A\u3002",msg_openFileFail:"\u6253\u5F00\u6587\u4EF6\u5931\u8D25\uFF01",msg_fileTypeUnsupported:"\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u683C\u5F0F\uFF01",msg_fileSizeExceeded:"\u6587\u4EF6\u5927\u5C0F\u8D85\u9650\uFF01\u6587\u4EF6\u5927\u5C0F\u4E0D\u5F97\u8D85\u8FC7 10M\uFF01",msg_dataInWrongGeoJSONFormat:"\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF01\u975E\u6807\u51C6\u7684 GEOJSON \u683C\u5F0F\u6570\u636E\uFF01",msg_dataInWrongFormat:"\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF01\u975E\u6807\u51C6\u7684 EXCEL, CSV \u6216 GEOJSON \u683C\u5F0F\u6570\u636E\uFF01",msg_searchKeywords:"\u641C\u7D22\u5173\u952E\u5B57\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u8BF7\u8F93\u5165\u641C\u7D22\u6761\u4EF6\u3002",msg_searchGeocodeField:"\u672A\u5339\u914D\u5230\u5730\u5740\u5339\u914D\u670D\u52A1\u6570\u636E\uFF01",msg_cityGeocodeField:"\u672A\u914D\u7F6E\u5F53\u524D\u57CE\u5E02\u7684\u5730\u5740\u5339\u914D\u670D\u52A1\u3002",msg_getFeatureField:"\u672A\u67E5\u627E\u5230\u76F8\u5173\u77E2\u91CF\u8981\u7D20\uFF01",msg_dataflowservicesubscribed:"\u5DF2\u8BA2\u9605\u8BE5\u6570\u636E\u6D41\u670D\u52A1\u3002",msg_subscribesucceeded:"\u6570\u636E\u6D41\u670D\u52A1\u8BA2\u9605\u6210\u529F\u3002",msg_crsunsupport:"\u4E0D\u652F\u6301\u5F53\u524D\u5730\u56FE\u7684\u5750\u6807\u7CFB",msg_tilematrixsetunsupport:"\u4E0D\u652F\u6301\u4F20\u5165\u7684TileMatrixSet",msg_jsonResolveFiled:"json\u683C\u5F0F\u89E3\u6790\u5931\u8D25\uFF01",msg_requestContentFiled:"\u901A\u8FC7iportal\u8BF7\u6C42\u6570\u636E\u5931\u8D25\uFF01",msg_getdatafailed:"\u83B7\u53D6\u6570\u636E\u5931\u8D25\uFF01"},rv={"en-US":gLt,"zh-CN":yLt,code:null,defaultCode:"en-US",getCode:function(){return rv.code||rv.setCode(),rv.code},setCode:function(){var n=this.getLanguageFromCookie();n||(n=rv.defaultCode,navigator.appName==="Netscape"?n=navigator.language:n=navigator.browserLanguage),n.indexOf("zh")===0&&(n="zh-CN"),n.indexOf("en")===0&&(n="en-US"),rv.code=n},getLanguageFromCookie(){for(var n="language=",e=document.cookie.split(";"),t=0;t<e.length;t++){for(var r=e[t];r.charAt(0)===" ";)r=r.substring(1);if(r.indexOf(n)!==-1)return r.substring(n.length,r.length)}return""},i18n:function(n){var e=rv[rv.getCode()],t=e&&e[n];return t||(t=n),t}};/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var Mp=1200,$C,mLt=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],loe={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},uoe=function(n){mLt.indexOf(n)!=-1&&(loe[0]=n)};function _Lt(){uoe(1252)}var r0=function(n){Mp=n,uoe(n)};function ZBe(){r0(1200),_Lt()}function e_e(n){for(var e=[],t=0,r=n.length;t<r;++t)e[t]=n.charCodeAt(t);return e}function KBe(n){for(var e=[],t=0;t<n.length>>1;++t)e[t]=String.fromCharCode(n.charCodeAt(2*t)+(n.charCodeAt(2*t+1)<<8));return e.join("")}function xLt(n){for(var e=[],t=0;t<n.length>>1;++t)e[t]=String.fromCharCode(n[2*t]+(n[2*t+1]<<8));return e.join("")}function JBe(n){for(var e=[],t=0;t<n.length>>1;++t)e[t]=String.fromCharCode(n.charCodeAt(2*t+1)+(n.charCodeAt(2*t)<<8));return e.join("")}var hO=function(n){var e=n.charCodeAt(0),t=n.charCodeAt(1);return e==255&&t==254?KBe(n.slice(2)):e==254&&t==255?JBe(n.slice(2)):e==65279?n.slice(1):n},H4=function(e){return String.fromCharCode(e)},t_e=function(e){return String.fromCharCode(e)},SLt=null,aS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r_e(n){for(var e="",t=0,r=0,i=0,a=0,o=0,s=0,l=0,u=0;u<n.length;)t=n.charCodeAt(u++),a=t>>2,r=n.charCodeAt(u++),o=(t&3)<<4|r>>4,i=n.charCodeAt(u++),s=(r&15)<<2|i>>6,l=i&63,isNaN(r)?s=l=64:isNaN(i)&&(l=64),e+=aS.charAt(a)+aS.charAt(o)+aS.charAt(s)+aS.charAt(l);return e}function Tv(n){var e="",t=0,r=0,i=0,a=0,o=0,s=0,l=0;n=n.replace(/^data:([^\/]+\/[^\/]+)?;base64\,/,"").replace(/[^\w\+\/\=]/g,"");for(var u=0;u<n.length;)a=aS.indexOf(n.charAt(u++)),o=aS.indexOf(n.charAt(u++)),t=a<<2|o>>4,e+=String.fromCharCode(t),s=aS.indexOf(n.charAt(u++)),r=(o&15)<<4|s>>2,s!==64&&(e+=String.fromCharCode(r)),l=aS.indexOf(n.charAt(u++)),i=(s&3)<<6|l,l!==64&&(e+=String.fromCharCode(i));return e}var oo=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Sw=function(){if(typeof Buffer<"u"){var n=!Buffer.from;if(!n)try{Buffer.from("foo","utf8")}catch{n=!0}return n?function(e,t){return t?new Buffer(e,t):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}(),MD=function(){if(typeof Buffer>"u")return!1;var n=Sw([65,0]);if(!n)return!1;var e=n.toString("utf16le");return e.length==1}();function VS(n){return oo?Buffer.alloc?Buffer.alloc(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}function n_e(n){return oo?Buffer.allocUnsafe?Buffer.allocUnsafe(n):new Buffer(n):typeof Uint8Array<"u"?new Uint8Array(n):new Array(n)}var iv=function(e){return oo?Sw(e,"binary"):e.split("").map(function(t){return t.charCodeAt(0)&255})};function p_(n){if(Array.isArray(n))return n.map(function(r){return String.fromCharCode(r)}).join("");for(var e=[],t=0;t<n.length;++t)e[t]=String.fromCharCode(n[t]);return e.join("")}function hoe(n){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(n instanceof ArrayBuffer)return hoe(new Uint8Array(n));for(var e=new Array(n.length),t=0;t<n.length;++t)e[t]=n[t];return e}var Yx=oo?function(n){return Buffer.concat(n.map(function(e){return Buffer.isBuffer(e)?e:Sw(e)}))}:function(n){if(typeof Uint8Array<"u"){var e=0,t=0;for(e=0;e<n.length;++e)t+=n[e].length;var r=new Uint8Array(t),i=0;for(e=0,t=0;e<n.length;t+=i,++e)i=n[e].length,n[e]instanceof Uint8Array?r.set(n[e],t):typeof n[e]=="string"?r.set(new Uint8Array(iv(n[e])),t):r.set(new Uint8Array(n[e]),t);return r}return[].concat.apply([],n.map(function(a){return Array.isArray(a)?a:[].slice.call(a)}))};function wLt(n){for(var e=[],t=0,r=n.length+250,i=VS(n.length+255),a=0;a<n.length;++a){var o=n.charCodeAt(a);if(o<128)i[t++]=o;else if(o<2048)i[t++]=192|o>>6&31,i[t++]=128|o&63;else if(o>=55296&&o<57344){o=(o&1023)+64;var s=n.charCodeAt(++a)&1023;i[t++]=240|o>>8&7,i[t++]=128|o>>2&63,i[t++]=128|s>>6&15|(o&3)<<4,i[t++]=128|s&63}else i[t++]=224|o>>12&15,i[t++]=128|o>>6&63,i[t++]=128|o&63;t>r&&(e.push(i.slice(0,t)),t=0,i=VS(65535),r=65530)}return e.push(i.slice(0,t)),Yx(e)}var Nf=/\u0000/g,cO=/[\u0001-\u0006]/g;function UA(n){for(var e="",t=n.length-1;t>=0;)e+=n.charAt(t--);return e}function n0(n,e){var t=""+n;return t.length>=e?t:wo("0",e-t.length)+t}function coe(n,e){var t=""+n;return t.length>=e?t:wo(" ",e-t.length)+t}function jG(n,e){var t=""+n;return t.length>=e?t:t+wo(" ",e-t.length)}function bLt(n,e){var t=""+Math.round(n);return t.length>=e?t:wo("0",e-t.length)+t}function ELt(n,e){var t=""+n;return t.length>=e?t:wo("0",e-t.length)+t}var i_e=Math.pow(2,32);function sC(n,e){if(n>i_e||n<-i_e)return bLt(n,e);var t=Math.round(n);return ELt(t,e)}function XG(n,e){return e=e||0,n.length>=7+e&&(n.charCodeAt(e)|32)===103&&(n.charCodeAt(e+1)|32)===101&&(n.charCodeAt(e+2)|32)===110&&(n.charCodeAt(e+3)|32)===101&&(n.charCodeAt(e+4)|32)===114&&(n.charCodeAt(e+5)|32)===97&&(n.charCodeAt(e+6)|32)===108}var a_e=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],vX=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function TLt(n){return n||(n={}),n[0]="General",n[1]="0",n[2]="0.00",n[3]="#,##0",n[4]="#,##0.00",n[9]="0%",n[10]="0.00%",n[11]="0.00E+00",n[12]="# ?/?",n[13]="# ??/??",n[14]="m/d/yy",n[15]="d-mmm-yy",n[16]="d-mmm",n[17]="mmm-yy",n[18]="h:mm AM/PM",n[19]="h:mm:ss AM/PM",n[20]="h:mm",n[21]="h:mm:ss",n[22]="m/d/yy h:mm",n[37]="#,##0 ;(#,##0)",n[38]="#,##0 ;[Red](#,##0)",n[39]="#,##0.00;(#,##0.00)",n[40]="#,##0.00;[Red](#,##0.00)",n[45]="mm:ss",n[46]="[h]:mm:ss",n[47]="mmss.0",n[48]="##0.0E+0",n[49]="@",n[56]='"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "',n}var ji={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "'},o_e={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},CLt={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function YG(n,e,t){for(var r=n<0?-1:1,i=n*r,a=0,o=1,s=0,l=1,u=0,h=0,c=Math.floor(i);u<e&&(c=Math.floor(i),s=c*o+a,h=c*u+l,!(i-c<5e-8));)i=1/(i-c),a=o,o=s,l=u,u=h;if(h>e&&(u>e?(h=l,s=a):(h=u,s=o)),!t)return[0,r*s,h];var f=Math.floor(r*s/h);return[f,r*s-f*h,h]}function uE(n,e,t){if(n>2958465||n<0)return null;var r=n|0,i=Math.floor(86400*(n-r)),a=0,o=[],s={D:r,T:i,u:86400*(n-r)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(s.u)<1e-6&&(s.u=0),e&&e.date1904&&(r+=1462),s.u>.9999&&(s.u=0,++i==86400&&(s.T=i=0,++r,++s.D)),r===60)o=t?[1317,10,29]:[1900,2,29],a=3;else if(r===0)o=t?[1317,8,29]:[1900,1,0],a=6;else{r>60&&--r;var l=new Date(1900,0,1);l.setDate(l.getDate()+r-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],a=l.getDay(),r<60&&(a=(a+6)%7),t&&(a=OLt(l,o))}return s.y=o[0],s.m=o[1],s.d=o[2],s.S=i%60,i=Math.floor(i/60),s.M=i%60,i=Math.floor(i/60),s.H=i,s.q=a,s}var QBe=new Date(1899,11,31,0,0,0),ALt=QBe.getTime(),MLt=new Date(1900,2,1,0,0,0);function e8e(n,e){var t=n.getTime();return e?t-=1461*24*60*60*1e3:n>=MLt&&(t+=24*60*60*1e3),(t-(ALt+(n.getTimezoneOffset()-QBe.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function foe(n){return n.indexOf(".")==-1?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function ILt(n){return n.indexOf("E")==-1?n:n.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function LLt(n){var e=n<0?12:11,t=foe(n.toFixed(12));return t.length<=e||(t=n.toPrecision(10),t.length<=e)?t:n.toExponential(5)}function PLt(n){var e=foe(n.toFixed(11));return e.length>(n<0?12:11)||e==="0"||e==="-0"?n.toPrecision(6):e}function ID(n){var e=Math.floor(Math.log(Math.abs(n))*Math.LOG10E),t;return e>=-4&&e<=-1?t=n.toPrecision(10+e):Math.abs(e)<=9?t=LLt(n):e===10?t=n.toFixed(10).substr(0,12):t=PLt(n),foe(ILt(t.toUpperCase()))}function e2(n,e){switch(typeof n){case"string":return n;case"boolean":return n?"TRUE":"FALSE";case"number":return(n|0)===n?n.toString(10):ID(n);case"undefined":return"";case"object":if(n==null)return"";if(n instanceof Date)return Cv(14,e8e(n,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+n)}function OLt(n,e){e[0]-=581;var t=n.getDay();return n<60&&(t=(t+6)%7),t}function RLt(n,e,t,r){var i="",a=0,o=0,s=t.y,l,u=0;switch(n){case 98:s=t.y+543;case 121:switch(e.length){case 1:case 2:l=s%100,u=2;break;default:l=s%1e4,u=4;break}break;case 109:switch(e.length){case 1:case 2:l=t.m,u=e.length;break;case 3:return vX[t.m-1][1];case 5:return vX[t.m-1][0];default:return vX[t.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=t.d,u=e.length;break;case 3:return a_e[t.q][0];default:return a_e[t.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(t.H+11)%12,u=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=t.H,u=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=t.M,u=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return t.u===0&&(e=="s"||e=="ss")?n0(t.S,e.length):(r>=2?o=r===3?1e3:100:o=r===1?10:1,a=Math.round(o*(t.S+t.u)),a>=60*o&&(a=0),e==="s"?a===0?"0":""+a/o:(i=n0(a,2+r),e==="ss"?i.substr(0,2):"."+i.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=t.D*24+t.H;break;case"[m]":case"[mm]":l=(t.D*24+t.H)*60+t.M;break;case"[s]":case"[ss]":l=((t.D*24+t.H)*60+t.M)*60+Math.round(t.S+t.u);break;default:throw"bad abstime format: "+e}u=e.length===3?1:2;break;case 101:l=s,u=1;break}var h=u>0?n0(l,u):"";return h}function O1(n){var e=3;if(n.length<=e)return n;for(var t=n.length%e,r=n.substr(0,t);t!=n.length;t+=e)r+=(r.length>0?",":"")+n.substr(t,e);return r}var t8e=/%/g;function DLt(n,e,t){var r=e.replace(t8e,""),i=e.length-r.length;return X1(n,r,t*Math.pow(10,2*i))+wo("%",i)}function NLt(n,e,t){for(var r=e.length-1;e.charCodeAt(r-1)===44;)--r;return X1(n,e.substr(0,r),t/Math.pow(10,3*(e.length-r)))}function r8e(n,e){var t,r=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+r8e(n,-e);var i=n.indexOf(".");i===-1&&(i=n.indexOf("E"));var a=Math.floor(Math.log(e)*Math.LOG10E)%i;if(a<0&&(a+=i),t=(e/Math.pow(10,a)).toPrecision(r+1+(i+a)%i),t.indexOf("e")===-1){var o=Math.floor(Math.log(e)*Math.LOG10E);for(t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(o-t.length+a):t+="E+"+(o-a);t.substr(0,2)==="0.";)t=t.charAt(0)+t.substr(2,i)+"."+t.substr(2+i),t=t.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(s,l,u,h){return l+u+h.substr(0,(i+a)%i)+"."+h.substr(a)+"E"})}else t=e.toExponential(r);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}var n8e=/# (\?+)( ?)\/( ?)(\d+)/;function kLt(n,e,t){var r=parseInt(n[4],10),i=Math.round(e*r),a=Math.floor(i/r),o=i-a*r,s=r;return t+(a===0?"":""+a)+" "+(o===0?wo(" ",n[1].length+1+n[4].length):coe(o,n[1].length)+n[2]+"/"+n[3]+n0(s,n[4].length))}function FLt(n,e,t){return t+(e===0?"":""+e)+wo(" ",n[1].length+2+n[4].length)}var i8e=/^#*0*\.([0#]+)/,a8e=/\).*[0#]/,o8e=/\(###\) ###\\?-####/;function bf(n){for(var e="",t,r=0;r!=n.length;++r)switch(t=n.charCodeAt(r)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(t)}return e}function s_e(n,e){var t=Math.pow(10,e);return""+Math.round(n*t)/t}function l_e(n,e){var t=n-Math.floor(n),r=Math.pow(10,e);return e<(""+Math.round(t*r)).length?0:Math.round(t*r)}function BLt(n,e){return e<(""+Math.round((n-Math.floor(n))*Math.pow(10,e))).length?1:0}function GLt(n){return n<2147483647&&n>-2147483648?""+(n>=0?n|0:n-1|0):""+Math.floor(n)}function rp(n,e,t){if(n.charCodeAt(0)===40&&!e.match(a8e)){var r=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?rp("n",r,t):"("+rp("n",r,-t)+")"}if(e.charCodeAt(e.length-1)===44)return NLt(n,e,t);if(e.indexOf("%")!==-1)return DLt(n,e,t);if(e.indexOf("E")!==-1)return r8e(e,t);if(e.charCodeAt(0)===36)return"$"+rp(n,e.substr(e.charAt(1)==" "?2:1),t);var i,a,o,s,l=Math.abs(t),u=t<0?"-":"";if(e.match(/^00+$/))return u+sC(l,e.length);if(e.match(/^[#?]+$/))return i=sC(t,0),i==="0"&&(i=""),i.length>e.length?i:bf(e.substr(0,e.length-i.length))+i;if(a=e.match(n8e))return kLt(a,l,u);if(e.match(/^#+0+$/))return u+sC(l,e.length-e.indexOf("0"));if(a=e.match(i8e))return i=s_e(t,a[1].length).replace(/^([^\.]+)$/,"$1."+bf(a[1])).replace(/\.$/,"."+bf(a[1])).replace(/\.(\d*)$/,function(v,p){return"."+p+wo("0",bf(a[1]).length-p.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),a=e.match(/^(0*)\.(#*)$/))return u+s_e(l,a[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=e.match(/^#{1,3},##0(\.?)$/))return u+O1(sC(l,0));if(a=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+rp(n,e,-t):O1(""+(Math.floor(t)+BLt(t,a[1].length)))+"."+n0(l_e(t,a[1].length),a[1].length);if(a=e.match(/^#,#*,#0/))return rp(n,e.replace(/^#,#*,/,""),t);if(a=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=UA(rp(n,e.replace(/[\\-]/g,""),t)),o=0,UA(UA(e.replace(/\\/g,"")).replace(/[0#]/g,function(v){return o<i.length?i.charAt(o++):v==="0"?"0":""}));if(e.match(o8e))return i=rp(n,"##########",t),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var h="";if(a=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(a[4].length,7),s=YG(l,Math.pow(10,o)-1,!1),i=""+u,h=X1("n",a[1],s[1]),h.charAt(h.length-1)==" "&&(h=h.substr(0,h.length-1)+"0"),i+=h+a[2]+"/"+a[3],h=jG(s[2],o),h.length<a[4].length&&(h=bf(a[4].substr(a[4].length-h.length))+h),i+=h,i;if(a=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(a[1].length,a[4].length),7),s=YG(l,Math.pow(10,o)-1,!0),u+(s[0]||(s[1]?"":"0"))+" "+(s[1]?coe(s[1],o)+a[2]+"/"+a[3]+jG(s[2],o):wo(" ",2*o+1+a[2].length+a[3].length));if(a=e.match(/^[#0?]+$/))return i=sC(t,0),e.length<=i.length?i:bf(e.substr(0,e.length-i.length))+i;if(a=e.match(/^([#0?]+)\.([#0]+)$/)){i=""+t.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var c=e.indexOf(".")-o,f=e.length-i.length-c;return bf(e.substr(0,c)+i+e.substr(e.length-f))}if(a=e.match(/^00,000\.([#0]*0)$/))return o=l_e(t,a[1].length),t<0?"-"+rp(n,e,-t):O1(GLt(t)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?n0(0,3-v.length):"")+v})+"."+n0(o,a[1].length);switch(e){case"###,##0.00":return rp(n,"#,##0.00",t);case"###,###":case"##,###":case"#,###":var d=O1(sC(l,0));return d!=="0"?u+d:"";case"###,###.00":return rp(n,"###,##0.00",t).replace(/^0\./,".");case"#,###.00":return rp(n,"#,##0.00",t).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function zLt(n,e,t){for(var r=e.length-1;e.charCodeAt(r-1)===44;)--r;return X1(n,e.substr(0,r),t/Math.pow(10,3*(e.length-r)))}function ULt(n,e,t){var r=e.replace(t8e,""),i=e.length-r.length;return X1(n,r,t*Math.pow(10,2*i))+wo("%",i)}function s8e(n,e){var t,r=n.indexOf("E")-n.indexOf(".")-1;if(n.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+s8e(n,-e);var i=n.indexOf(".");i===-1&&(i=n.indexOf("E"));var a=Math.floor(Math.log(e)*Math.LOG10E)%i;if(a<0&&(a+=i),t=(e/Math.pow(10,a)).toPrecision(r+1+(i+a)%i),!t.match(/[Ee]/)){var o=Math.floor(Math.log(e)*Math.LOG10E);t.indexOf(".")===-1?t=t.charAt(0)+"."+t.substr(1)+"E+"+(o-t.length+a):t+="E+"+(o-a),t=t.replace(/\+-/,"-")}t=t.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(s,l,u,h){return l+u+h.substr(0,(i+a)%i)+"."+h.substr(a)+"E"})}else t=e.toExponential(r);return n.match(/E\+00$/)&&t.match(/e[+-]\d$/)&&(t=t.substr(0,t.length-1)+"0"+t.charAt(t.length-1)),n.match(/E\-/)&&t.match(/e\+/)&&(t=t.replace(/e\+/,"e")),t.replace("e","E")}function gy(n,e,t){if(n.charCodeAt(0)===40&&!e.match(a8e)){var r=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return t>=0?gy("n",r,t):"("+gy("n",r,-t)+")"}if(e.charCodeAt(e.length-1)===44)return zLt(n,e,t);if(e.indexOf("%")!==-1)return ULt(n,e,t);if(e.indexOf("E")!==-1)return s8e(e,t);if(e.charCodeAt(0)===36)return"$"+gy(n,e.substr(e.charAt(1)==" "?2:1),t);var i,a,o,s,l=Math.abs(t),u=t<0?"-":"";if(e.match(/^00+$/))return u+n0(l,e.length);if(e.match(/^[#?]+$/))return i=""+t,t===0&&(i=""),i.length>e.length?i:bf(e.substr(0,e.length-i.length))+i;if(a=e.match(n8e))return FLt(a,l,u);if(e.match(/^#+0+$/))return u+n0(l,e.length-e.indexOf("0"));if(a=e.match(i8e))return i=(""+t).replace(/^([^\.]+)$/,"$1."+bf(a[1])).replace(/\.$/,"."+bf(a[1])),i=i.replace(/\.(\d*)$/,function(v,p){return"."+p+wo("0",bf(a[1]).length-p.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),a=e.match(/^(0*)\.(#*)$/))return u+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,a[1].length?"0.":".");if(a=e.match(/^#{1,3},##0(\.?)$/))return u+O1(""+l);if(a=e.match(/^#,##0\.([#0]*0)$/))return t<0?"-"+gy(n,e,-t):O1(""+t)+"."+wo("0",a[1].length);if(a=e.match(/^#,#*,#0/))return gy(n,e.replace(/^#,#*,/,""),t);if(a=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=UA(gy(n,e.replace(/[\\-]/g,""),t)),o=0,UA(UA(e.replace(/\\/g,"")).replace(/[0#]/g,function(v){return o<i.length?i.charAt(o++):v==="0"?"0":""}));if(e.match(o8e))return i=gy(n,"##########",t),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var h="";if(a=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(a[4].length,7),s=YG(l,Math.pow(10,o)-1,!1),i=""+u,h=X1("n",a[1],s[1]),h.charAt(h.length-1)==" "&&(h=h.substr(0,h.length-1)+"0"),i+=h+a[2]+"/"+a[3],h=jG(s[2],o),h.length<a[4].length&&(h=bf(a[4].substr(a[4].length-h.length))+h),i+=h,i;if(a=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(a[1].length,a[4].length),7),s=YG(l,Math.pow(10,o)-1,!0),u+(s[0]||(s[1]?"":"0"))+" "+(s[1]?coe(s[1],o)+a[2]+"/"+a[3]+jG(s[2],o):wo(" ",2*o+1+a[2].length+a[3].length));if(a=e.match(/^[#0?]+$/))return i=""+t,e.length<=i.length?i:bf(e.substr(0,e.length-i.length))+i;if(a=e.match(/^([#0]+)\.([#0]+)$/)){i=""+t.toFixed(Math.min(a[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var c=e.indexOf(".")-o,f=e.length-i.length-c;return bf(e.substr(0,c)+i+e.substr(e.length-f))}if(a=e.match(/^00,000\.([#0]*0)$/))return t<0?"-"+gy(n,e,-t):O1(""+t).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?n0(0,3-v.length):"")+v})+"."+n0(0,a[1].length);switch(e){case"###,###":case"##,###":case"#,###":var d=O1(""+l);return d!=="0"?u+d:"";default:if(e.match(/\.[0#?]*$/))return gy(n,e.slice(0,e.lastIndexOf(".")),t)+bf(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function X1(n,e,t){return(t|0)===t?gy(n,e,t):rp(n,e,t)}function VLt(n){for(var e=[],t=!1,r=0,i=0;r<n.length;++r)switch(n.charCodeAt(r)){case 34:t=!t;break;case 95:case 42:case 92:++r;break;case 59:e[e.length]=n.substr(i,r-i),i=r+1}if(e[e.length]=n.substr(i),t===!0)throw new Error("Format |"+n+"| unterminated string ");return e}var l8e=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function Q2(n){for(var e=0,t="",r="";e<n.length;)switch(t=n.charAt(e)){case"G":XG(n,e)&&(e+=6),e++;break;case'"':for(;n.charCodeAt(++e)!==34&&e<n.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(n.charAt(e+1)==="1"||n.charAt(e+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"\u4E0A":if(n.substr(e,3).toUpperCase()==="A/P"||n.substr(e,5).toUpperCase()==="AM/PM"||n.substr(e,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348")return!0;++e;break;case"[":for(r=t;n.charAt(e++)!=="]"&&e<n.length;)r+=n.charAt(e);if(r.match(l8e))return!0;break;case".":case"0":case"#":for(;e<n.length&&("0#?.,E+-%".indexOf(t=n.charAt(++e))>-1||t=="\\"&&n.charAt(e+1)=="-"&&"0#".indexOf(n.charAt(e+2))>-1););break;case"?":for(;n.charAt(++e)===t;);break;case"*":++e,(n.charAt(e)==" "||n.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<n.length&&"0123456789".indexOf(n.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function $Lt(n,e,t,r){for(var i=[],a="",o=0,s="",l="t",u,h,c,f="H";o<n.length;)switch(s=n.charAt(o)){case"G":if(!XG(n,o))throw new Error("unrecognized character "+s+" in "+n);i[i.length]={t:"G",v:"General"},o+=7;break;case'"':for(a="";(c=n.charCodeAt(++o))!==34&&o<n.length;)a+=String.fromCharCode(c);i[i.length]={t:"t",v:a},++o;break;case"\\":var d=n.charAt(++o),v=d==="("||d===")"?d:"t";i[i.length]={t:v,v:d},++o;break;case"_":i[i.length]={t:"t",v:" "},o+=2;break;case"@":i[i.length]={t:"T",v:e},++o;break;case"B":case"b":if(n.charAt(o+1)==="1"||n.charAt(o+1)==="2"){if(u==null&&(u=uE(e,t,n.charAt(o+1)==="2"),u==null))return"";i[i.length]={t:"X",v:n.substr(o,2)},l=s,o+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":s=s.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0||u==null&&(u=uE(e,t),u==null))return"";for(a=s;++o<n.length&&n.charAt(o).toLowerCase()===s;)a+=s;s==="m"&&l.toLowerCase()==="h"&&(s="M"),s==="h"&&(s=f),i[i.length]={t:s,v:a},l=s;break;case"A":case"a":case"\u4E0A":var p={t:s,v:s};if(u==null&&(u=uE(e,t)),n.substr(o,3).toUpperCase()==="A/P"?(u!=null&&(p.v=u.H>=12?n.charAt(o+2):s),p.t="T",f="h",o+=3):n.substr(o,5).toUpperCase()==="AM/PM"?(u!=null&&(p.v=u.H>=12?"PM":"AM"),p.t="T",o+=5,f="h"):n.substr(o,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348"?(u!=null&&(p.v=u.H>=12?"\u4E0B\u5348":"\u4E0A\u5348"),p.t="T",o+=5,f="h"):(p.t="t",++o),u==null&&p.t==="T")return"";i[i.length]=p,l=s;break;case"[":for(a=s;n.charAt(o++)!=="]"&&o<n.length;)a+=n.charAt(o);if(a.slice(-1)!=="]")throw'unterminated "[" block: |'+a+"|";if(a.match(l8e)){if(u==null&&(u=uE(e,t),u==null))return"";i[i.length]={t:"Z",v:a.toLowerCase()},l=a.charAt(1)}else a.indexOf("$")>-1&&(a=(a.match(/\$([^-\[\]]*)/)||[])[1]||"$",Q2(n)||(i[i.length]={t:"t",v:a}));break;case".":if(u!=null){for(a=s;++o<n.length&&(s=n.charAt(o))==="0";)a+=s;i[i.length]={t:"s",v:a};break}case"0":case"#":for(a=s;++o<n.length&&"0#?.,E+-%".indexOf(s=n.charAt(o))>-1;)a+=s;i[i.length]={t:"n",v:a};break;case"?":for(a=s;n.charAt(++o)===s;)a+=s;i[i.length]={t:s,v:a},l=s;break;case"*":++o,(n.charAt(o)==" "||n.charAt(o)=="*")&&++o;break;case"(":case")":i[i.length]={t:r===1?"t":s,v:s},++o;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(a=s;o<n.length&&"0123456789".indexOf(n.charAt(++o))>-1;)a+=n.charAt(o);i[i.length]={t:"D",v:a};break;case" ":i[i.length]={t:s,v:s},++o;break;case"$":i[i.length]={t:"t",v:"$"},++o;break;default:if(",$-+/():!^&'~{}<>=\u20ACacfijklopqrtuvwxzP".indexOf(s)===-1)throw new Error("unrecognized character "+s+" in "+n);i[i.length]={t:"t",v:s},++o;break}var g=0,m=0,y;for(o=i.length-1,l="t";o>=0;--o)switch(i[o].t){case"h":case"H":i[o].t=f,l="h",g<1&&(g=1);break;case"s":(y=i[o].v.match(/\.0+$/))&&(m=Math.max(m,y[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":l=i[o].t;break;case"m":l==="s"&&(i[o].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&i[o].v.match(/[Hh]/)&&(g=1),g<2&&i[o].v.match(/[Mm]/)&&(g=2),g<3&&i[o].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var _="",x;for(o=0;o<i.length;++o)switch(i[o].t){case"t":case"T":case" ":case"D":break;case"X":i[o].v="",i[o].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":i[o].v=RLt(i[o].t.charCodeAt(0),i[o].v,u,m),i[o].t="t";break;case"n":case"?":for(x=o+1;i[x]!=null&&((s=i[x].t)==="?"||s==="D"||(s===" "||s==="t")&&i[x+1]!=null&&(i[x+1].t==="?"||i[x+1].t==="t"&&i[x+1].v==="/")||i[o].t==="("&&(s===" "||s==="n"||s===")")||s==="t"&&(i[x].v==="/"||i[x].v===" "&&i[x+1]!=null&&i[x+1].t=="?"));)i[o].v+=i[x].v,i[x]={v:"",t:";"},++x;_+=i[o].v,o=x-1;break;case"G":i[o].t="t",i[o].v=e2(e,t);break}var S="",w,b;if(_.length>0){_.charCodeAt(0)==40?(w=e<0&&_.charCodeAt(0)===45?-e:e,b=X1("n",_,w)):(w=e<0&&r>1?-e:e,b=X1("n",_,w),w<0&&i[0]&&i[0].t=="t"&&(b=b.substr(1),i[0].v="-"+i[0].v)),x=b.length-1;var E=i.length;for(o=0;o<i.length;++o)if(i[o]!=null&&i[o].t!="t"&&i[o].v.indexOf(".")>-1){E=o;break}var T=i.length;if(E===i.length&&b.indexOf("E")===-1){for(o=i.length-1;o>=0;--o)i[o]==null||"n?".indexOf(i[o].t)===-1||(x>=i[o].v.length-1?(x-=i[o].v.length,i[o].v=b.substr(x+1,i[o].v.length)):x<0?i[o].v="":(i[o].v=b.substr(0,x+1),x=-1),i[o].t="t",T=o);x>=0&&T<i.length&&(i[T].v=b.substr(0,x+1)+i[T].v)}else if(E!==i.length&&b.indexOf("E")===-1){for(x=b.indexOf(".")-1,o=E;o>=0;--o)if(!(i[o]==null||"n?".indexOf(i[o].t)===-1)){for(h=i[o].v.indexOf(".")>-1&&o===E?i[o].v.indexOf(".")-1:i[o].v.length-1,S=i[o].v.substr(h+1);h>=0;--h)x>=0&&(i[o].v.charAt(h)==="0"||i[o].v.charAt(h)==="#")&&(S=b.charAt(x--)+S);i[o].v=S,i[o].t="t",T=o}for(x>=0&&T<i.length&&(i[T].v=b.substr(0,x+1)+i[T].v),x=b.indexOf(".")+1,o=E;o<i.length;++o)if(!(i[o]==null||"n?(".indexOf(i[o].t)===-1&&o!==E)){for(h=i[o].v.indexOf(".")>-1&&o===E?i[o].v.indexOf(".")+1:0,S=i[o].v.substr(0,h);h<i[o].v.length;++h)x<b.length&&(S+=b.charAt(x++));i[o].v=S,i[o].t="t",T=o}}}for(o=0;o<i.length;++o)i[o]!=null&&"n?".indexOf(i[o].t)>-1&&(w=r>1&&e<0&&o>0&&i[o-1].v==="-"?-e:e,i[o].v=X1(i[o].t,i[o].v,w),i[o].t="t");var C="";for(o=0;o!==i.length;++o)i[o]!=null&&(C+=i[o].v);return C}var u_e=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function h_e(n,e){if(e==null)return!1;var t=parseFloat(e[2]);switch(e[1]){case"=":if(n==t)return!0;break;case">":if(n>t)return!0;break;case"<":if(n<t)return!0;break;case"<>":if(n!=t)return!0;break;case">=":if(n>=t)return!0;break;case"<=":if(n<=t)return!0;break}return!1}function WLt(n,e){var t=VLt(n),r=t.length,i=t[r-1].indexOf("@");if(r<4&&i>-1&&--r,t.length>4)throw new Error("cannot find right format for |"+t.join("|")+"|");if(typeof e!="number")return[4,t.length===4||i>-1?t[t.length-1]:"@"];switch(t.length){case 1:t=i>-1?["General","General","General",t[0]]:[t[0],t[0],t[0],"@"];break;case 2:t=i>-1?[t[0],t[0],t[0],t[1]]:[t[0],t[1],t[0],"@"];break;case 3:t=i>-1?[t[0],t[1],t[0],t[2]]:[t[0],t[1],t[2],"@"];break}var a=e>0?t[0]:e<0?t[1]:t[2];if(t[0].indexOf("[")===-1&&t[1].indexOf("[")===-1)return[r,a];if(t[0].match(/\[[=<>]/)!=null||t[1].match(/\[[=<>]/)!=null){var o=t[0].match(u_e),s=t[1].match(u_e);return h_e(e,o)?[r,t[0]]:h_e(e,s)?[r,t[1]]:[r,t[o!=null&&s!=null?2:1]]}return[r,a]}function Cv(n,e,t){t==null&&(t={});var r="";switch(typeof n){case"string":n=="m/d/yy"&&t.dateNF?r=t.dateNF:r=n;break;case"number":n==14&&t.dateNF?r=t.dateNF:r=(t.table!=null?t.table:ji)[n],r==null&&(r=t.table&&t.table[o_e[n]]||ji[o_e[n]]),r==null&&(r=CLt[n]||"General");break}if(XG(r,0))return e2(e,t);e instanceof Date&&(e=e8e(e,t.date1904));var i=WLt(r,e);if(XG(i[1]))return e2(e,t);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return $Lt(i[1],e,t,i[0])}function HLt(n,e){if(typeof e!="number"){e=+e||-1;for(var t=0;t<392;++t){if(ji[t]==null){e<0&&(e=t);continue}if(ji[t]==n){e=t;break}}e<0&&(e=391)}return ji[e]=n,e}function u8e(){ji=TLt()}var jLt={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},h8e=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function XLt(n){var e=typeof n=="number"?ji[n]:n;return e=e.replace(h8e,"(\\d+)"),new RegExp("^"+e+"$")}function YLt(n,e,t){var r=-1,i=-1,a=-1,o=-1,s=-1,l=-1;(e.match(h8e)||[]).forEach(function(c,f){var d=parseInt(t[f+1],10);switch(c.toLowerCase().charAt(0)){case"y":r=d;break;case"d":a=d;break;case"h":o=d;break;case"s":l=d;break;case"m":o>=0?s=d:i=d;break}}),l>=0&&s==-1&&i>=0&&(s=i,i=-1);var u=(""+(r>=0?r:new Date().getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(a>=1?a:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var h=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return o==-1&&s==-1&&l==-1?u:r==-1&&i==-1&&a==-1?h:u+"T"+h}var qLt={"d.m":"d\\.m"};function OE(n,e){return HLt(qLt[n]||n,e)}var c_e=function(){var n={};n.version="1.2.0";function e(){for(var b=0,E=new Array(256),T=0;T!=256;++T)b=T,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,E[T]=b;return typeof Int32Array<"u"?new Int32Array(E):E}var t=e();function r(b){var E=0,T=0,C=0,A=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(C=0;C!=256;++C)A[C]=b[C];for(C=0;C!=256;++C)for(T=b[C],E=256+C;E<4096;E+=256)T=A[E]=T>>>8^b[T&255];var M=[];for(C=1;C!=16;++C)M[C-1]=typeof Int32Array<"u"&&typeof A.subarray=="function"?A.subarray(C*256,C*256+256):A.slice(C*256,C*256+256);return M}var i=r(t),a=i[0],o=i[1],s=i[2],l=i[3],u=i[4],h=i[5],c=i[6],f=i[7],d=i[8],v=i[9],p=i[10],g=i[11],m=i[12],y=i[13],_=i[14];function x(b,E){for(var T=E^-1,C=0,A=b.length;C<A;)T=T>>>8^t[(T^b.charCodeAt(C++))&255];return~T}function S(b,E){for(var T=E^-1,C=b.length-15,A=0;A<C;)T=_[b[A++]^T&255]^y[b[A++]^T>>8&255]^m[b[A++]^T>>16&255]^g[b[A++]^T>>>24]^p[b[A++]]^v[b[A++]]^d[b[A++]]^f[b[A++]]^c[b[A++]]^h[b[A++]]^u[b[A++]]^l[b[A++]]^s[b[A++]]^o[b[A++]]^a[b[A++]]^t[b[A++]];for(C+=15;A<C;)T=T>>>8^t[(T^b[A++])&255];return~T}function w(b,E){for(var T=E^-1,C=0,A=b.length,M=0,I=0;C<A;)M=b.charCodeAt(C++),M<128?T=T>>>8^t[(T^M)&255]:M<2048?(T=T>>>8^t[(T^(192|M>>6&31))&255],T=T>>>8^t[(T^(128|M&63))&255]):M>=55296&&M<57344?(M=(M&1023)+64,I=b.charCodeAt(C++)&1023,T=T>>>8^t[(T^(240|M>>8&7))&255],T=T>>>8^t[(T^(128|M>>2&63))&255],T=T>>>8^t[(T^(128|I>>6&15|(M&3)<<4))&255],T=T>>>8^t[(T^(128|I&63))&255]):(T=T>>>8^t[(T^(224|M>>12&15))&255],T=T>>>8^t[(T^(128|M>>6&63))&255],T=T>>>8^t[(T^(128|M&63))&255]);return~T}return n.table=t,n.bstr=x,n.buf=S,n.str=w,n}(),co=function(){var e={};e.version="1.2.2";function t(ue,xe){for(var ce=ue.split("/"),pe=xe.split("/"),we=0,Me=0,nt=Math.min(ce.length,pe.length);we<nt;++we){if(Me=ce[we].length-pe[we].length)return Me;if(ce[we]!=pe[we])return ce[we]<pe[we]?-1:1}return ce.length-pe.length}function r(ue){if(ue.charAt(ue.length-1)=="/")return ue.slice(0,-1).indexOf("/")===-1?ue:r(ue.slice(0,-1));var xe=ue.lastIndexOf("/");return xe===-1?ue:ue.slice(0,xe+1)}function i(ue){if(ue.charAt(ue.length-1)=="/")return i(ue.slice(0,-1));var xe=ue.lastIndexOf("/");return xe===-1?ue:ue.slice(xe+1)}function a(ue,xe){typeof xe=="string"&&(xe=new Date(xe));var ce=xe.getHours();ce=ce<<6|xe.getMinutes(),ce=ce<<5|xe.getSeconds()>>>1,ue.write_shift(2,ce);var pe=xe.getFullYear()-1980;pe=pe<<4|xe.getMonth()+1,pe=pe<<5|xe.getDate(),ue.write_shift(2,pe)}function o(ue){var xe=ue.read_shift(2)&65535,ce=ue.read_shift(2)&65535,pe=new Date,we=ce&31;ce>>>=5;var Me=ce&15;ce>>>=4,pe.setMilliseconds(0),pe.setFullYear(ce+1980),pe.setMonth(Me-1),pe.setDate(we);var nt=xe&31;xe>>>=5;var It=xe&63;return xe>>>=6,pe.setHours(xe),pe.setMinutes(It),pe.setSeconds(nt<<1),pe}function s(ue){eh(ue,0);for(var xe={},ce=0;ue.l<=ue.length-4;){var pe=ue.read_shift(2),we=ue.read_shift(2),Me=ue.l+we,nt={};switch(pe){case 21589:ce=ue.read_shift(1),ce&1&&(nt.mtime=ue.read_shift(4)),we>5&&(ce&2&&(nt.atime=ue.read_shift(4)),ce&4&&(nt.ctime=ue.read_shift(4))),nt.mtime&&(nt.mt=new Date(nt.mtime*1e3));break;case 1:{var It=ue.read_shift(4),ot=ue.read_shift(4);nt.usz=ot*Math.pow(2,32)+It,It=ue.read_shift(4),ot=ue.read_shift(4),nt.csz=ot*Math.pow(2,32)+It}break}ue.l=Me,xe[pe]=nt}return xe}var l;function u(){return l||(l=ZLt)}function h(ue,xe){if(ue[0]==80&&ue[1]==75)return yn(ue,xe);if((ue[0]|32)==109&&(ue[1]|32)==105)return No(ue,xe);if(ue.length<512)throw new Error("CFB file size "+ue.length+" < 512");var ce=3,pe=512,we=0,Me=0,nt=0,It=0,ot=0,ht=[],ut=ue.slice(0,512);eh(ut,0);var qt=c(ut);switch(ce=qt[0],ce){case 3:pe=512;break;case 4:pe=4096;break;case 0:if(qt[1]==0)return yn(ue,xe);default:throw new Error("Major Version: Expected 3 or 4 saw "+ce)}pe!==512&&(ut=ue.slice(0,pe),eh(ut,28));var fr=ue.slice(0,pe);f(ut,ce);var Wr=ut.read_shift(4,"i");if(ce===3&&Wr!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Wr);ut.l+=4,nt=ut.read_shift(4,"i"),ut.l+=4,ut.chk("00100000","Mini Stream Cutoff Size: "),It=ut.read_shift(4,"i"),we=ut.read_shift(4,"i"),ot=ut.read_shift(4,"i"),Me=ut.read_shift(4,"i");for(var gr=-1,Ar=0;Ar<109&&(gr=ut.read_shift(4,"i"),!(gr<0));++Ar)ht[Ar]=gr;var $n=d(ue,pe);g(ot,Me,$n,pe,ht);var bi=y($n,nt,ht,pe);nt<bi.length&&(bi[nt].name="!Directory"),we>0&&It!==I&&(bi[It].name="!MiniFAT"),bi[ht[0]].name="!FAT",bi.fat_addrs=ht,bi.ssz=pe;var qa={},Qo=[],Ds=[],af=[];_(nt,bi,$n,Qo,we,qa,Ds,It),v(Ds,af,Qo),Qo.shift();var mh={FileIndex:Ds,FullPaths:af};return xe&&xe.raw&&(mh.raw={header:fr,sectors:$n}),mh}function c(ue){if(ue[ue.l]==80&&ue[ue.l+1]==75)return[0,0];ue.chk(R,"Header Signature: "),ue.l+=16;var xe=ue.read_shift(2,"u");return[ue.read_shift(2,"u"),xe]}function f(ue,xe){var ce=9;switch(ue.l+=2,ce=ue.read_shift(2)){case 9:if(xe!=3)throw new Error("Sector Shift: Expected 9 saw "+ce);break;case 12:if(xe!=4)throw new Error("Sector Shift: Expected 12 saw "+ce);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+ce)}ue.chk("0600","Mini Sector Shift: "),ue.chk("000000000000","Reserved: ")}function d(ue,xe){for(var ce=Math.ceil(ue.length/xe)-1,pe=[],we=1;we<ce;++we)pe[we-1]=ue.slice(we*xe,(we+1)*xe);return pe[ce-1]=ue.slice(ce*xe),pe}function v(ue,xe,ce){for(var pe=0,we=0,Me=0,nt=0,It=0,ot=ce.length,ht=[],ut=[];pe<ot;++pe)ht[pe]=ut[pe]=pe,xe[pe]=ce[pe];for(;It<ut.length;++It)pe=ut[It],we=ue[pe].L,Me=ue[pe].R,nt=ue[pe].C,ht[pe]===pe&&(we!==-1&&ht[we]!==we&&(ht[pe]=ht[we]),Me!==-1&&ht[Me]!==Me&&(ht[pe]=ht[Me])),nt!==-1&&(ht[nt]=pe),we!==-1&&pe!=ht[pe]&&(ht[we]=ht[pe],ut.lastIndexOf(we)<It&&ut.push(we)),Me!==-1&&pe!=ht[pe]&&(ht[Me]=ht[pe],ut.lastIndexOf(Me)<It&&ut.push(Me));for(pe=1;pe<ot;++pe)ht[pe]===pe&&(Me!==-1&&ht[Me]!==Me?ht[pe]=ht[Me]:we!==-1&&ht[we]!==we&&(ht[pe]=ht[we]));for(pe=1;pe<ot;++pe)if(ue[pe].type!==0){if(It=pe,It!=ht[It])do It=ht[It],xe[pe]=xe[It]+"/"+xe[pe];while(It!==0&&ht[It]!==-1&&It!=ht[It]);ht[pe]=-1}for(xe[0]+="/",pe=1;pe<ot;++pe)ue[pe].type!==2&&(xe[pe]+="/")}function p(ue,xe,ce){for(var pe=ue.start,we=ue.size,Me=[],nt=pe;ce&&we>0&&nt>=0;)Me.push(xe.slice(nt*M,nt*M+M)),we-=M,nt=Yb(ce,nt*4);return Me.length===0?Ku(0):Yx(Me).slice(0,ue.size)}function g(ue,xe,ce,pe,we){var Me=I;if(ue===I){if(xe!==0)throw new Error("DIFAT chain shorter than expected")}else if(ue!==-1){var nt=ce[ue],It=(pe>>>2)-1;if(!nt)return;for(var ot=0;ot<It&&(Me=Yb(nt,ot*4))!==I;++ot)we.push(Me);xe>=1&&g(Yb(nt,pe-4),xe-1,ce,pe,we)}}function m(ue,xe,ce,pe,we){var Me=[],nt=[];we||(we=[]);var It=pe-1,ot=0,ht=0;for(ot=xe;ot>=0;){we[ot]=!0,Me[Me.length]=ot,nt.push(ue[ot]);var ut=ce[Math.floor(ot*4/pe)];if(ht=ot*4&It,pe<4+ht)throw new Error("FAT boundary crossed: "+ot+" 4 "+pe);if(!ue[ut])break;ot=Yb(ue[ut],ht)}return{nodes:Me,data:S_e([nt])}}function y(ue,xe,ce,pe){var we=ue.length,Me=[],nt=[],It=[],ot=[],ht=pe-1,ut=0,qt=0,fr=0,Wr=0;for(ut=0;ut<we;++ut)if(It=[],fr=ut+xe,fr>=we&&(fr-=we),!nt[fr]){ot=[];var gr=[];for(qt=fr;qt>=0;){gr[qt]=!0,nt[qt]=!0,It[It.length]=qt,ot.push(ue[qt]);var Ar=ce[Math.floor(qt*4/pe)];if(Wr=qt*4&ht,pe<4+Wr)throw new Error("FAT boundary crossed: "+qt+" 4 "+pe);if(!ue[Ar]||(qt=Yb(ue[Ar],Wr),gr[qt]))break}Me[fr]={nodes:It,data:S_e([ot])}}return Me}function _(ue,xe,ce,pe,we,Me,nt,It){for(var ot=0,ht=pe.length?2:0,ut=xe[ue].data,qt=0,fr=0,Wr;qt<ut.length;qt+=128){var gr=ut.slice(qt,qt+128);eh(gr,64),fr=gr.read_shift(2),Wr=poe(gr,0,fr-ht),pe.push(Wr);var Ar={name:Wr,type:gr.read_shift(1),color:gr.read_shift(1),L:gr.read_shift(4,"i"),R:gr.read_shift(4,"i"),C:gr.read_shift(4,"i"),clsid:gr.read_shift(16),state:gr.read_shift(4,"i"),start:0,size:0},$n=gr.read_shift(2)+gr.read_shift(2)+gr.read_shift(2)+gr.read_shift(2);$n!==0&&(Ar.ct=x(gr,gr.l-8));var bi=gr.read_shift(2)+gr.read_shift(2)+gr.read_shift(2)+gr.read_shift(2);bi!==0&&(Ar.mt=x(gr,gr.l-8)),Ar.start=gr.read_shift(4,"i"),Ar.size=gr.read_shift(4,"i"),Ar.size<0&&Ar.start<0&&(Ar.size=Ar.type=0,Ar.start=I,Ar.name=""),Ar.type===5?(ot=Ar.start,we>0&&ot!==I&&(xe[ot].name="!StreamData")):Ar.size>=4096?(Ar.storage="fat",xe[Ar.start]===void 0&&(xe[Ar.start]=m(ce,Ar.start,xe.fat_addrs,xe.ssz)),xe[Ar.start].name=Ar.name,Ar.content=xe[Ar.start].data.slice(0,Ar.size)):(Ar.storage="minifat",Ar.size<0?Ar.size=0:ot!==I&&Ar.start!==I&&xe[ot]&&(Ar.content=p(Ar,xe[ot].data,(xe[It]||{}).data))),Ar.content&&eh(Ar.content,0),Me[Wr]=Ar,nt.push(Ar)}}function x(ue,xe){return new Date((av(ue,xe+4)/1e7*Math.pow(2,32)+av(ue,xe)/1e7-11644473600)*1e3)}function S(ue,xe){return u(),h(l.readFileSync(ue),xe)}function w(ue,xe){var ce=xe&&xe.type;switch(ce||oo&&Buffer.isBuffer(ue)&&(ce="buffer"),ce||"base64"){case"file":return S(ue,xe);case"base64":return h(iv(Tv(ue)),xe);case"binary":return h(iv(ue),xe)}return h(ue,xe)}function b(ue,xe){var ce=xe||{},pe=ce.root||"Root Entry";if(ue.FullPaths||(ue.FullPaths=[]),ue.FileIndex||(ue.FileIndex=[]),ue.FullPaths.length!==ue.FileIndex.length)throw new Error("inconsistent CFB structure");ue.FullPaths.length===0&&(ue.FullPaths[0]=pe+"/",ue.FileIndex[0]={name:pe,type:5}),ce.CLSID&&(ue.FileIndex[0].clsid=ce.CLSID),E(ue)}function E(ue){var xe="Sh33tJ5";if(!co.find(ue,"/"+xe)){var ce=Ku(4);ce[0]=55,ce[1]=ce[3]=50,ce[2]=54,ue.FileIndex.push({name:xe,type:2,content:ce,size:4,L:69,R:69,C:69}),ue.FullPaths.push(ue.FullPaths[0]+xe),T(ue)}}function T(ue,xe){b(ue);for(var ce=!1,pe=!1,we=ue.FullPaths.length-1;we>=0;--we){var Me=ue.FileIndex[we];switch(Me.type){case 0:pe?ce=!0:(ue.FileIndex.pop(),ue.FullPaths.pop());break;case 1:case 2:case 5:pe=!0,isNaN(Me.R*Me.L*Me.C)&&(ce=!0),Me.R>-1&&Me.L>-1&&Me.R==Me.L&&(ce=!0);break;default:ce=!0;break}}if(!(!ce&&!xe)){var nt=new Date(1987,1,19),It=0,ot=Object.create?Object.create(null):{},ht=[];for(we=0;we<ue.FullPaths.length;++we)ot[ue.FullPaths[we]]=!0,ue.FileIndex[we].type!==0&&ht.push([ue.FullPaths[we],ue.FileIndex[we]]);for(we=0;we<ht.length;++we){var ut=r(ht[we][0]);for(pe=ot[ut];!pe;){for(;r(ut)&&!ot[r(ut)];)ut=r(ut);ht.push([ut,{name:i(ut).replace("/",""),type:1,clsid:D,ct:nt,mt:nt,content:null}]),ot[ut]=!0,ut=r(ht[we][0]),pe=ot[ut]}}for(ht.sort(function(Wr,gr){return t(Wr[0],gr[0])}),ue.FullPaths=[],ue.FileIndex=[],we=0;we<ht.length;++we)ue.FullPaths[we]=ht[we][0],ue.FileIndex[we]=ht[we][1];for(we=0;we<ht.length;++we){var qt=ue.FileIndex[we],fr=ue.FullPaths[we];if(qt.name=i(fr).replace("/",""),qt.L=qt.R=qt.C=-(qt.color=1),qt.size=qt.content?qt.content.length:0,qt.start=0,qt.clsid=qt.clsid||D,we===0)qt.C=ht.length>1?1:-1,qt.size=0,qt.type=5;else if(fr.slice(-1)=="/"){for(It=we+1;It<ht.length&&r(ue.FullPaths[It])!=fr;++It);for(qt.C=It>=ht.length?-1:It,It=we+1;It<ht.length&&r(ue.FullPaths[It])!=r(fr);++It);qt.R=It>=ht.length?-1:It,qt.type=1}else r(ue.FullPaths[we+1]||"")==r(fr)&&(qt.R=we+1),qt.type=2}}}function C(ue,xe){var ce=xe||{};if(ce.fileType=="mad")return Jo(ue,ce);switch(T(ue),ce.fileType){case"zip":return oi(ue,ce)}var pe=function(Wr){for(var gr=0,Ar=0,$n=0;$n<Wr.FileIndex.length;++$n){var bi=Wr.FileIndex[$n];if(!!bi.content){var qa=bi.content.length;qa>0&&(qa<4096?gr+=qa+63>>6:Ar+=qa+511>>9)}}for(var Qo=Wr.FullPaths.length+3>>2,Ds=gr+7>>3,af=gr+127>>7,mh=Ds+Ar+Qo+af,Zl=mh+127>>7,jd=Zl<=109?0:Math.ceil((Zl-109)/127);mh+Zl+jd+127>>7>Zl;)jd=++Zl<=109?0:Math.ceil((Zl-109)/127);var Nl=[1,jd,Zl,af,Qo,Ar,gr,0];return Wr.FileIndex[0].size=gr<<6,Nl[7]=(Wr.FileIndex[0].start=Nl[0]+Nl[1]+Nl[2]+Nl[3]+Nl[4]+Nl[5])+(Nl[6]+7>>3),Nl}(ue),we=Ku(pe[7]<<9),Me=0,nt=0;{for(Me=0;Me<8;++Me)we.write_shift(1,k[Me]);for(Me=0;Me<8;++Me)we.write_shift(2,0);for(we.write_shift(2,62),we.write_shift(2,3),we.write_shift(2,65534),we.write_shift(2,9),we.write_shift(2,6),Me=0;Me<3;++Me)we.write_shift(2,0);for(we.write_shift(4,0),we.write_shift(4,pe[2]),we.write_shift(4,pe[0]+pe[1]+pe[2]+pe[3]-1),we.write_shift(4,0),we.write_shift(4,1<<12),we.write_shift(4,pe[3]?pe[0]+pe[1]+pe[2]-1:I),we.write_shift(4,pe[3]),we.write_shift(-4,pe[1]?pe[0]-1:I),we.write_shift(4,pe[1]),Me=0;Me<109;++Me)we.write_shift(-4,Me<pe[2]?pe[1]+Me:-1)}if(pe[1])for(nt=0;nt<pe[1];++nt){for(;Me<236+nt*127;++Me)we.write_shift(-4,Me<pe[2]?pe[1]+Me:-1);we.write_shift(-4,nt===pe[1]-1?I:nt+1)}var It=function(Wr){for(nt+=Wr;Me<nt-1;++Me)we.write_shift(-4,Me+1);Wr&&(++Me,we.write_shift(-4,I))};for(nt=Me=0,nt+=pe[1];Me<nt;++Me)we.write_shift(-4,G.DIFSECT);for(nt+=pe[2];Me<nt;++Me)we.write_shift(-4,G.FATSECT);It(pe[3]),It(pe[4]);for(var ot=0,ht=0,ut=ue.FileIndex[0];ot<ue.FileIndex.length;++ot)ut=ue.FileIndex[ot],ut.content&&(ht=ut.content.length,!(ht<4096)&&(ut.start=nt,It(ht+511>>9)));for(It(pe[6]+7>>3);we.l&511;)we.write_shift(-4,G.ENDOFCHAIN);for(nt=Me=0,ot=0;ot<ue.FileIndex.length;++ot)ut=ue.FileIndex[ot],ut.content&&(ht=ut.content.length,!(!ht||ht>=4096)&&(ut.start=nt,It(ht+63>>6)));for(;we.l&511;)we.write_shift(-4,G.ENDOFCHAIN);for(Me=0;Me<pe[4]<<2;++Me){var qt=ue.FullPaths[Me];if(!qt||qt.length===0){for(ot=0;ot<17;++ot)we.write_shift(4,0);for(ot=0;ot<3;++ot)we.write_shift(4,-1);for(ot=0;ot<12;++ot)we.write_shift(4,0);continue}ut=ue.FileIndex[Me],Me===0&&(ut.start=ut.size?ut.start-1:I);var fr=Me===0&&ce.root||ut.name;if(fr.length>32&&(console.error("Name "+fr+" will be truncated to "+fr.slice(0,32)),fr=fr.slice(0,32)),ht=2*(fr.length+1),we.write_shift(64,fr,"utf16le"),we.write_shift(2,ht),we.write_shift(1,ut.type),we.write_shift(1,ut.color),we.write_shift(-4,ut.L),we.write_shift(-4,ut.R),we.write_shift(-4,ut.C),ut.clsid)we.write_shift(16,ut.clsid,"hex");else for(ot=0;ot<4;++ot)we.write_shift(4,0);we.write_shift(4,ut.state||0),we.write_shift(4,0),we.write_shift(4,0),we.write_shift(4,0),we.write_shift(4,0),we.write_shift(4,ut.start),we.write_shift(4,ut.size),we.write_shift(4,0)}for(Me=1;Me<ue.FileIndex.length;++Me)if(ut=ue.FileIndex[Me],ut.size>=4096)if(we.l=ut.start+1<<9,oo&&Buffer.isBuffer(ut.content))ut.content.copy(we,we.l,0,ut.size),we.l+=ut.size+511&-512;else{for(ot=0;ot<ut.size;++ot)we.write_shift(1,ut.content[ot]);for(;ot&511;++ot)we.write_shift(1,0)}for(Me=1;Me<ue.FileIndex.length;++Me)if(ut=ue.FileIndex[Me],ut.size>0&&ut.size<4096)if(oo&&Buffer.isBuffer(ut.content))ut.content.copy(we,we.l,0,ut.size),we.l+=ut.size+63&-64;else{for(ot=0;ot<ut.size;++ot)we.write_shift(1,ut.content[ot]);for(;ot&63;++ot)we.write_shift(1,0)}if(oo)we.l=we.length;else for(;we.l<we.length;)we.write_shift(1,0);return we}function A(ue,xe){var ce=ue.FullPaths.map(function(ot){return ot.toUpperCase()}),pe=ce.map(function(ot){var ht=ot.split("/");return ht[ht.length-(ot.slice(-1)=="/"?2:1)]}),we=!1;xe.charCodeAt(0)===47?(we=!0,xe=ce[0].slice(0,-1)+xe):we=xe.indexOf("/")!==-1;var Me=xe.toUpperCase(),nt=we===!0?ce.indexOf(Me):pe.indexOf(Me);if(nt!==-1)return ue.FileIndex[nt];var It=!Me.match(cO);for(Me=Me.replace(Nf,""),It&&(Me=Me.replace(cO,"!")),nt=0;nt<ce.length;++nt)if((It?ce[nt].replace(cO,"!"):ce[nt]).replace(Nf,"")==Me||(It?pe[nt].replace(cO,"!"):pe[nt]).replace(Nf,"")==Me)return ue.FileIndex[nt];return null}var M=64,I=-2,R="d0cf11e0a1b11ae1",k=[208,207,17,224,161,177,26,225],D="00000000000000000000000000000000",G={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:I,FREESECT:-1,HEADER_SIGNATURE:R,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:D,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function W(ue,xe,ce){u();var pe=C(ue,ce);l.writeFileSync(xe,pe)}function z(ue){for(var xe=new Array(ue.length),ce=0;ce<ue.length;++ce)xe[ce]=String.fromCharCode(ue[ce]);return xe.join("")}function V(ue,xe){var ce=C(ue,xe);switch(xe&&xe.type||"buffer"){case"file":return u(),l.writeFileSync(xe.filename,ce),ce;case"binary":return typeof ce=="string"?ce:z(ce);case"base64":return r_e(typeof ce=="string"?ce:z(ce));case"buffer":if(oo)return Buffer.isBuffer(ce)?ce:Sw(ce);case"array":return typeof ce=="string"?iv(ce):ce}return ce}var q;function Y(ue){try{var xe=ue.InflateRaw,ce=new xe;if(ce._processChunk(new Uint8Array([3,0]),ce._finishFlushFlag),ce.bytesRead)q=ue;else throw new Error("zlib does not expose bytesRead")}catch(pe){console.error("cannot use native zlib: "+(pe.message||pe))}}function le(ue,xe){if(!q)return Rn(ue,xe);var ce=q.InflateRaw,pe=new ce,we=pe._processChunk(ue.slice(ue.l),pe._finishFlushFlag);return ue.l+=pe.bytesRead,we}function j(ue){return q?q.deflateRawSync(ue):pt(ue)}var Q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ie=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],oe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function se(ue){var xe=(ue<<1|ue<<11)&139536|(ue<<5|ue<<15)&558144;return(xe>>16|xe>>8|xe)&255}for(var me=typeof Uint8Array<"u",Ce=me?new Uint8Array(1<<8):[],Le=0;Le<1<<8;++Le)Ce[Le]=se(Le);function re(ue,xe){var ce=Ce[ue&255];return xe<=8?ce>>>8-xe:(ce=ce<<8|Ce[ue>>8&255],xe<=16?ce>>>16-xe:(ce=ce<<8|Ce[ue>>16&255],ce>>>24-xe))}function yt(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=6?0:ue[pe+1]<<8))>>>ce&3}function je(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=5?0:ue[pe+1]<<8))>>>ce&7}function st(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=4?0:ue[pe+1]<<8))>>>ce&15}function Nt(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=3?0:ue[pe+1]<<8))>>>ce&31}function Zt(ue,xe){var ce=xe&7,pe=xe>>>3;return(ue[pe]|(ce<=1?0:ue[pe+1]<<8))>>>ce&127}function qe(ue,xe,ce){var pe=xe&7,we=xe>>>3,Me=(1<<ce)-1,nt=ue[we]>>>pe;return ce<8-pe||(nt|=ue[we+1]<<8-pe,ce<16-pe)||(nt|=ue[we+2]<<16-pe,ce<24-pe)||(nt|=ue[we+3]<<24-pe),nt&Me}function ur(ue,xe,ce){var pe=xe&7,we=xe>>>3;return pe<=5?ue[we]|=(ce&7)<<pe:(ue[we]|=ce<<pe&255,ue[we+1]=(ce&7)>>8-pe),xe+3}function Dt(ue,xe,ce){var pe=xe&7,we=xe>>>3;return ce=(ce&1)<<pe,ue[we]|=ce,xe+1}function ft(ue,xe,ce){var pe=xe&7,we=xe>>>3;return ce<<=pe,ue[we]|=ce&255,ce>>>=8,ue[we+1]=ce,xe+8}function Oe(ue,xe,ce){var pe=xe&7,we=xe>>>3;return ce<<=pe,ue[we]|=ce&255,ce>>>=8,ue[we+1]=ce&255,ue[we+2]=ce>>>8,xe+16}function J(ue,xe){var ce=ue.length,pe=2*ce>xe?2*ce:xe+5,we=0;if(ce>=xe)return ue;if(oo){var Me=n_e(pe);if(ue.copy)ue.copy(Me);else for(;we<ue.length;++we)Me[we]=ue[we];return Me}else if(me){var nt=new Uint8Array(pe);if(nt.set)nt.set(ue);else for(;we<ce;++we)nt[we]=ue[we];return nt}return ue.length=pe,ue}function We(ue){for(var xe=new Array(ue),ce=0;ce<ue;++ce)xe[ce]=0;return xe}function Tt(ue,xe,ce){var pe=1,we=0,Me=0,nt=0,It=0,ot=ue.length,ht=me?new Uint16Array(32):We(32);for(Me=0;Me<32;++Me)ht[Me]=0;for(Me=ot;Me<ce;++Me)ue[Me]=0;ot=ue.length;var ut=me?new Uint16Array(ot):We(ot);for(Me=0;Me<ot;++Me)ht[we=ue[Me]]++,pe<we&&(pe=we),ut[Me]=0;for(ht[0]=0,Me=1;Me<=pe;++Me)ht[Me+16]=It=It+ht[Me-1]<<1;for(Me=0;Me<ot;++Me)It=ue[Me],It!=0&&(ut[Me]=ht[It+16]++);var qt=0;for(Me=0;Me<ot;++Me)if(qt=ue[Me],qt!=0)for(It=re(ut[Me],pe)>>pe-qt,nt=(1<<pe+4-qt)-1;nt>=0;--nt)xe[It|nt<<qt]=qt&15|Me<<4;return pe}var Qe=me?new Uint16Array(512):We(512),zt=me?new Uint16Array(32):We(32);if(!me){for(var mt=0;mt<512;++mt)Qe[mt]=0;for(mt=0;mt<32;++mt)zt[mt]=0}(function(){for(var ue=[],xe=0;xe<32;xe++)ue.push(5);Tt(ue,zt,32);var ce=[];for(xe=0;xe<=143;xe++)ce.push(8);for(;xe<=255;xe++)ce.push(9);for(;xe<=279;xe++)ce.push(7);for(;xe<=287;xe++)ce.push(8);Tt(ce,Qe,288)})();var wt=function(){for(var xe=me?new Uint8Array(32768):[],ce=0,pe=0;ce<oe.length-1;++ce)for(;pe<oe[ce+1];++pe)xe[pe]=ce;for(;pe<32768;++pe)xe[pe]=29;var we=me?new Uint8Array(259):[];for(ce=0,pe=0;ce<ie.length-1;++ce)for(;pe<ie[ce+1];++pe)we[pe]=ce;function Me(It,ot){for(var ht=0;ht<It.length;){var ut=Math.min(65535,It.length-ht),qt=ht+ut==It.length;for(ot.write_shift(1,+qt),ot.write_shift(2,ut),ot.write_shift(2,~ut&65535);ut-- >0;)ot[ot.l++]=It[ht++]}return ot.l}function nt(It,ot){for(var ht=0,ut=0,qt=me?new Uint16Array(32768):[];ut<It.length;){var fr=Math.min(65535,It.length-ut);if(fr<10){for(ht=ur(ot,ht,+(ut+fr==It.length)),ht&7&&(ht+=8-(ht&7)),ot.l=ht/8|0,ot.write_shift(2,fr),ot.write_shift(2,~fr&65535);fr-- >0;)ot[ot.l++]=It[ut++];ht=ot.l*8;continue}ht=ur(ot,ht,+(ut+fr==It.length)+2);for(var Wr=0;fr-- >0;){var gr=It[ut];Wr=(Wr<<5^gr)&32767;var Ar=-1,$n=0;if((Ar=qt[Wr])&&(Ar|=ut&-32768,Ar>ut&&(Ar-=32768),Ar<ut))for(;It[Ar+$n]==It[ut+$n]&&$n<250;)++$n;if($n>2){gr=we[$n],gr<=22?ht=ft(ot,ht,Ce[gr+1]>>1)-1:(ft(ot,ht,3),ht+=5,ft(ot,ht,Ce[gr-23]>>5),ht+=3);var bi=gr<8?0:gr-4>>2;bi>0&&(Oe(ot,ht,$n-ie[gr]),ht+=bi),gr=xe[ut-Ar],ht=ft(ot,ht,Ce[gr]>>3),ht-=3;var qa=gr<4?0:gr-2>>1;qa>0&&(Oe(ot,ht,ut-Ar-oe[gr]),ht+=qa);for(var Qo=0;Qo<$n;++Qo)qt[Wr]=ut&32767,Wr=(Wr<<5^It[ut])&32767,++ut;fr-=$n-1}else gr<=143?gr=gr+48:ht=Dt(ot,ht,1),ht=ft(ot,ht,Ce[gr]),qt[Wr]=ut&32767,++ut}ht=ft(ot,ht,0)-1}return ot.l=(ht+7)/8|0,ot.l}return function(ot,ht){return ot.length<8?Me(ot,ht):nt(ot,ht)}}();function pt(ue){var xe=Ku(50+Math.floor(ue.length*1.1)),ce=wt(ue,xe);return xe.slice(0,ce)}var ar=me?new Uint16Array(32768):We(32768),kt=me?new Uint16Array(32768):We(32768),Dr=me?new Uint16Array(128):We(128),Sr=1,jr=1;function pn(ue,xe){var ce=Nt(ue,xe)+257;xe+=5;var pe=Nt(ue,xe)+1;xe+=5;var we=st(ue,xe)+4;xe+=4;for(var Me=0,nt=me?new Uint8Array(19):We(19),It=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ot=1,ht=me?new Uint8Array(8):We(8),ut=me?new Uint8Array(8):We(8),qt=nt.length,fr=0;fr<we;++fr)nt[Q[fr]]=Me=je(ue,xe),ot<Me&&(ot=Me),ht[Me]++,xe+=3;var Wr=0;for(ht[0]=0,fr=1;fr<=ot;++fr)ut[fr]=Wr=Wr+ht[fr-1]<<1;for(fr=0;fr<qt;++fr)(Wr=nt[fr])!=0&&(It[fr]=ut[Wr]++);var gr=0;for(fr=0;fr<qt;++fr)if(gr=nt[fr],gr!=0){Wr=Ce[It[fr]]>>8-gr;for(var Ar=(1<<7-gr)-1;Ar>=0;--Ar)Dr[Wr|Ar<<gr]=gr&7|fr<<3}var $n=[];for(ot=1;$n.length<ce+pe;)switch(Wr=Dr[Zt(ue,xe)],xe+=Wr&7,Wr>>>=3){case 16:for(Me=3+yt(ue,xe),xe+=2,Wr=$n[$n.length-1];Me-- >0;)$n.push(Wr);break;case 17:for(Me=3+je(ue,xe),xe+=3;Me-- >0;)$n.push(0);break;case 18:for(Me=11+Zt(ue,xe),xe+=7;Me-- >0;)$n.push(0);break;default:$n.push(Wr),ot<Wr&&(ot=Wr);break}var bi=$n.slice(0,ce),qa=$n.slice(ce);for(fr=ce;fr<286;++fr)bi[fr]=0;for(fr=pe;fr<30;++fr)qa[fr]=0;return Sr=Tt(bi,ar,286),jr=Tt(qa,kt,30),xe}function Jn(ue,xe){if(ue[0]==3&&!(ue[1]&3))return[VS(xe),2];for(var ce=0,pe=0,we=n_e(xe||1<<18),Me=0,nt=we.length>>>0,It=0,ot=0;(pe&1)==0;){if(pe=je(ue,ce),ce+=3,pe>>>1==0){ce&7&&(ce+=8-(ce&7));var ht=ue[ce>>>3]|ue[(ce>>>3)+1]<<8;if(ce+=32,ht>0)for(!xe&&nt<Me+ht&&(we=J(we,Me+ht),nt=we.length);ht-- >0;)we[Me++]=ue[ce>>>3],ce+=8;continue}else pe>>1==1?(It=9,ot=5):(ce=pn(ue,ce),It=Sr,ot=jr);for(;;){!xe&&nt<Me+32767&&(we=J(we,Me+32767),nt=we.length);var ut=qe(ue,ce,It),qt=pe>>>1==1?Qe[ut]:ar[ut];if(ce+=qt&15,qt>>>=4,(qt>>>8&255)===0)we[Me++]=qt;else{if(qt==256)break;qt-=257;var fr=qt<8?0:qt-4>>2;fr>5&&(fr=0);var Wr=Me+ie[qt];fr>0&&(Wr+=qe(ue,ce,fr),ce+=fr),ut=qe(ue,ce,ot),qt=pe>>>1==1?zt[ut]:kt[ut],ce+=qt&15,qt>>>=4;var gr=qt<4?0:qt-2>>1,Ar=oe[qt];for(gr>0&&(Ar+=qe(ue,ce,gr),ce+=gr),!xe&&nt<Wr&&(we=J(we,Wr+100),nt=we.length);Me<Wr;)we[Me]=we[Me-Ar],++Me}}}return xe?[we,ce+7>>>3]:[we.slice(0,Me),ce+7>>>3]}function Rn(ue,xe){var ce=ue.slice(ue.l||0),pe=Jn(ce,xe);return ue.l+=pe[1],pe[0]}function hi(ue,xe){if(ue)typeof console<"u"&&console.error(xe);else throw new Error(xe)}function yn(ue,xe){var ce=ue;eh(ce,0);var pe=[],we=[],Me={FileIndex:pe,FullPaths:we};b(Me,{root:xe.root});for(var nt=ce.length-4;(ce[nt]!=80||ce[nt+1]!=75||ce[nt+2]!=5||ce[nt+3]!=6)&&nt>=0;)--nt;ce.l=nt+4,ce.l+=4;var It=ce.read_shift(2);ce.l+=6;var ot=ce.read_shift(4);for(ce.l=ot,nt=0;nt<It;++nt){ce.l+=20;var ht=ce.read_shift(4),ut=ce.read_shift(4),qt=ce.read_shift(2),fr=ce.read_shift(2),Wr=ce.read_shift(2);ce.l+=8;var gr=ce.read_shift(4),Ar=s(ce.slice(ce.l+qt,ce.l+qt+fr));ce.l+=qt+fr+Wr;var $n=ce.l;ce.l=gr+4,Ar&&Ar[1]&&((Ar[1]||{}).usz&&(ut=Ar[1].usz),(Ar[1]||{}).csz&&(ht=Ar[1].csz)),Oi(ce,ht,ut,Me,Ar),ce.l=$n}return Me}function Oi(ue,xe,ce,pe,we){ue.l+=2;var Me=ue.read_shift(2),nt=ue.read_shift(2),It=o(ue);if(Me&8257)throw new Error("Unsupported ZIP encryption");for(var ot=ue.read_shift(4),ht=ue.read_shift(4),ut=ue.read_shift(4),qt=ue.read_shift(2),fr=ue.read_shift(2),Wr="",gr=0;gr<qt;++gr)Wr+=String.fromCharCode(ue[ue.l++]);if(fr){var Ar=s(ue.slice(ue.l,ue.l+fr));(Ar[21589]||{}).mt&&(It=Ar[21589].mt),(Ar[1]||{}).usz&&(ut=Ar[1].usz),(Ar[1]||{}).csz&&(ht=Ar[1].csz),we&&((we[21589]||{}).mt&&(It=we[21589].mt),(we[1]||{}).usz&&(ut=Ar[1].usz),(we[1]||{}).csz&&(ht=Ar[1].csz))}ue.l+=fr;var $n=ue.slice(ue.l,ue.l+ht);switch(nt){case 8:$n=le(ue,ut);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+nt)}var bi=!1;Me&8&&(ot=ue.read_shift(4),ot==134695760&&(ot=ue.read_shift(4),bi=!0),ht=ue.read_shift(4),ut=ue.read_shift(4)),ht!=xe&&hi(bi,"Bad compressed size: "+xe+" != "+ht),ut!=ce&&hi(bi,"Bad uncompressed size: "+ce+" != "+ut),hs(pe,Wr,$n,{unsafe:!0,mt:It})}function oi(ue,xe){var ce=xe||{},pe=[],we=[],Me=Ku(1),nt=ce.compression?8:0,It=0,ot=0,ht=0,ut=0,qt=0,fr=ue.FullPaths[0],Wr=fr,gr=ue.FileIndex[0],Ar=[],$n=0;for(ot=1;ot<ue.FullPaths.length;++ot)if(Wr=ue.FullPaths[ot].slice(fr.length),gr=ue.FileIndex[ot],!(!gr.size||!gr.content||Wr=="Sh33tJ5")){var bi=ut,qa=Ku(Wr.length);for(ht=0;ht<Wr.length;++ht)qa.write_shift(1,Wr.charCodeAt(ht)&127);qa=qa.slice(0,qa.l),Ar[qt]=typeof gr.content=="string"?c_e.bstr(gr.content,0):c_e.buf(gr.content,0);var Qo=typeof gr.content=="string"?iv(gr.content):gr.content;nt==8&&(Qo=j(Qo)),Me=Ku(30),Me.write_shift(4,67324752),Me.write_shift(2,20),Me.write_shift(2,It),Me.write_shift(2,nt),gr.mt?a(Me,gr.mt):Me.write_shift(4,0),Me.write_shift(-4,Ar[qt]),Me.write_shift(4,Qo.length),Me.write_shift(4,gr.content.length),Me.write_shift(2,qa.length),Me.write_shift(2,0),ut+=Me.length,pe.push(Me),ut+=qa.length,pe.push(qa),ut+=Qo.length,pe.push(Qo),Me=Ku(46),Me.write_shift(4,33639248),Me.write_shift(2,0),Me.write_shift(2,20),Me.write_shift(2,It),Me.write_shift(2,nt),Me.write_shift(4,0),Me.write_shift(-4,Ar[qt]),Me.write_shift(4,Qo.length),Me.write_shift(4,gr.content.length),Me.write_shift(2,qa.length),Me.write_shift(2,0),Me.write_shift(2,0),Me.write_shift(2,0),Me.write_shift(2,0),Me.write_shift(4,0),Me.write_shift(4,bi),$n+=Me.l,we.push(Me),$n+=qa.length,we.push(qa),++qt}return Me=Ku(22),Me.write_shift(4,101010256),Me.write_shift(2,0),Me.write_shift(2,0),Me.write_shift(2,qt),Me.write_shift(2,qt),Me.write_shift(4,$n),Me.write_shift(4,ut),Me.write_shift(2,0),Yx([Yx(pe),Yx(we),Me])}var Gi={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function ws(ue,xe){if(ue.ctype)return ue.ctype;var ce=ue.name||"",pe=ce.match(/\.([^\.]+)$/);return pe&&Gi[pe[1]]||xe&&(pe=(ce=xe).match(/[\.\\]([^\.\\])+$/),pe&&Gi[pe[1]])?Gi[pe[1]]:"application/octet-stream"}function Sl(ue){for(var xe=r_e(ue),ce=[],pe=0;pe<xe.length;pe+=76)ce.push(xe.slice(pe,pe+76));return ce.join(`\r
`)+`\r
`}function Os(ue){var xe=ue.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(ht){var ut=ht.charCodeAt(0).toString(16).toUpperCase();return"="+(ut.length==1?"0"+ut:ut)});xe=xe.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),xe.charAt(0)==`
`&&(xe="=0D"+xe.slice(1)),xe=xe.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var ce=[],pe=xe.split(`\r
`),we=0;we<pe.length;++we){var Me=pe[we];if(Me.length==0){ce.push("");continue}for(var nt=0;nt<Me.length;){var It=76,ot=Me.slice(nt,nt+It);ot.charAt(It-1)=="="?It--:ot.charAt(It-2)=="="?It-=2:ot.charAt(It-3)=="="&&(It-=3),ot=Me.slice(nt,nt+It),nt+=It,nt<Me.length&&(ot+="="),ce.push(ot)}}return ce.join(`\r
`)}function no(ue){for(var xe=[],ce=0;ce<ue.length;++ce){for(var pe=ue[ce];ce<=ue.length&&pe.charAt(pe.length-1)=="=";)pe=pe.slice(0,pe.length-1)+ue[++ce];xe.push(pe)}for(var we=0;we<xe.length;++we)xe[we]=xe[we].replace(/[=][0-9A-Fa-f]{2}/g,function(Me){return String.fromCharCode(parseInt(Me.slice(1),16))});return iv(xe.join(`\r
`))}function vo(ue,xe,ce){for(var pe="",we="",Me="",nt,It=0;It<10;++It){var ot=xe[It];if(!ot||ot.match(/^\s*$/))break;var ht=ot.match(/^(.*?):\s*([^\s].*)$/);if(ht)switch(ht[1].toLowerCase()){case"content-location":pe=ht[2].trim();break;case"content-type":Me=ht[2].trim();break;case"content-transfer-encoding":we=ht[2].trim();break}}switch(++It,we.toLowerCase()){case"base64":nt=iv(Tv(xe.slice(It).join("")));break;case"quoted-printable":nt=no(xe.slice(It));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+we)}var ut=hs(ue,pe.slice(ce.length),nt,{unsafe:!0});Me&&(ut.ctype=Me)}function No(ue,xe){if(z(ue.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var ce=xe&&xe.root||"",pe=(oo&&Buffer.isBuffer(ue)?ue.toString("binary"):z(ue)).split(`\r
`),we=0,Me="";for(we=0;we<pe.length;++we)if(Me=pe[we],!!/^Content-Location:/i.test(Me)&&(Me=Me.slice(Me.indexOf("file")),ce||(ce=Me.slice(0,Me.lastIndexOf("/")+1)),Me.slice(0,ce.length)!=ce))for(;ce.length>0&&(ce=ce.slice(0,ce.length-1),ce=ce.slice(0,ce.lastIndexOf("/")+1),Me.slice(0,ce.length)!=ce););var nt=(pe[1]||"").match(/boundary="(.*?)"/);if(!nt)throw new Error("MAD cannot find boundary");var It="--"+(nt[1]||""),ot=[],ht=[],ut={FileIndex:ot,FullPaths:ht};b(ut);var qt,fr=0;for(we=0;we<pe.length;++we){var Wr=pe[we];Wr!==It&&Wr!==It+"--"||(fr++&&vo(ut,pe.slice(qt,we),ce),qt=we)}return ut}function Jo(ue,xe){var ce=xe||{},pe=ce.boundary||"SheetJS";pe="------="+pe;for(var we=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+pe.slice(2)+'"',"","",""],Me=ue.FullPaths[0],nt=Me,It=ue.FileIndex[0],ot=1;ot<ue.FullPaths.length;++ot)if(nt=ue.FullPaths[ot].slice(Me.length),It=ue.FileIndex[ot],!(!It.size||!It.content||nt=="Sh33tJ5")){nt=nt.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function($n){return"_x"+$n.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function($n){return"_u"+$n.charCodeAt(0).toString(16)+"_"});for(var ht=It.content,ut=oo&&Buffer.isBuffer(ht)?ht.toString("binary"):z(ht),qt=0,fr=Math.min(1024,ut.length),Wr=0,gr=0;gr<=fr;++gr)(Wr=ut.charCodeAt(gr))>=32&&Wr<128&&++qt;var Ar=qt>=fr*4/5;we.push(pe),we.push("Content-Location: "+(ce.root||"file:///C:/SheetJS/")+nt),we.push("Content-Transfer-Encoding: "+(Ar?"quoted-printable":"base64")),we.push("Content-Type: "+ws(It,nt)),we.push(""),we.push(Ar?Os(ut):Sl(ut))}return we.push(pe+`--\r
`),we.join(`\r
`)}function Lo(ue){var xe={};return b(xe,ue),xe}function hs(ue,xe,ce,pe){var we=pe&&pe.unsafe;we||b(ue);var Me=!we&&co.find(ue,xe);if(!Me){var nt=ue.FullPaths[0];xe.slice(0,nt.length)==nt?nt=xe:(nt.slice(-1)!="/"&&(nt+="/"),nt=(nt+xe).replace("//","/")),Me={name:i(xe),type:2},ue.FileIndex.push(Me),ue.FullPaths.push(nt),we||co.utils.cfb_gc(ue)}return Me.content=ce,Me.size=ce?ce.length:0,pe&&(pe.CLSID&&(Me.clsid=pe.CLSID),pe.mt&&(Me.mt=pe.mt),pe.ct&&(Me.ct=pe.ct)),Me}function Rs(ue,xe){b(ue);var ce=co.find(ue,xe);if(ce){for(var pe=0;pe<ue.FileIndex.length;++pe)if(ue.FileIndex[pe]==ce)return ue.FileIndex.splice(pe,1),ue.FullPaths.splice(pe,1),!0}return!1}function Pn(ue,xe,ce){b(ue);var pe=co.find(ue,xe);if(pe){for(var we=0;we<ue.FileIndex.length;++we)if(ue.FileIndex[we]==pe)return ue.FileIndex[we].name=i(ce),ue.FullPaths[we]=ce,!0}return!1}function mo(ue){T(ue,!0)}return e.find=A,e.read=w,e.parse=h,e.write=V,e.writeFile=W,e.utils={cfb_new:Lo,cfb_add:hs,cfb_del:Rs,cfb_mov:Pn,cfb_gc:mo,ReadShift:aR,CheckField:R8e,prep_blob:eh,bconcat:Yx,use_zlib:Y,_deflateRaw:pt,_inflateRaw:Rn,consts:G},e}(),ZLt;function KLt(n){if(typeof Deno<"u")return Deno.readFileSync(n);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var e=File(n);e.open("r"),e.encoding="binary";var t=e.read();return e.close(),t}catch(r){if(!r.message||!r.message.match(/onstruct/))throw r}throw new Error("Cannot access file "+n)}function h0(n){for(var e=Object.keys(n),t=[],r=0;r<e.length;++r)Object.prototype.hasOwnProperty.call(n,e[r])&&t.push(e[r]);return t}function doe(n){for(var e=[],t=h0(n),r=0;r!==t.length;++r)e[n[t[r]]]=t[r];return e}var qG=new Date(1899,11,30,0,0,0);function Zc(n,e){var t=n.getTime();e&&(t-=1462*24*60*60*1e3);var r=qG.getTime()+(n.getTimezoneOffset()-qG.getTimezoneOffset())*6e4;return(t-r)/(24*60*60*1e3)}var c8e=new Date,JLt=qG.getTime()+(c8e.getTimezoneOffset()-qG.getTimezoneOffset())*6e4,f_e=c8e.getTimezoneOffset();function TU(n){var e=new Date;return e.setTime(n*24*60*60*1e3+JLt),e.getTimezoneOffset()!==f_e&&e.setTime(e.getTime()+(e.getTimezoneOffset()-f_e)*6e4),e}function QLt(n){var e=0,t=0,r=!1,i=n.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!i)throw new Error("|"+n+"| is not an ISO8601 Duration");for(var a=1;a!=i.length;++a)if(!!i[a]){switch(t=1,a>3&&(r=!0),i[a].slice(i[a].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[a].slice(i[a].length-1));case"D":t*=24;case"H":t*=60;case"M":if(r)t*=60;else throw new Error("Unsupported ISO Duration Field: M")}e+=t*parseInt(i[a],10)}return e}var d_e=new Date("2017-02-19T19:06:09.000Z"),f8e=isNaN(d_e.getFullYear())?new Date("2/19/17"):d_e,ePt=f8e.getFullYear()==2017;function pc(n,e){var t=new Date(n);if(ePt)return e>0?t.setTime(t.getTime()+t.getTimezoneOffset()*60*1e3):e<0&&t.setTime(t.getTime()-t.getTimezoneOffset()*60*1e3),t;if(n instanceof Date)return n;if(f8e.getFullYear()==1917&&!isNaN(t.getFullYear())){var r=t.getFullYear();return n.indexOf(""+r)>-1||t.setFullYear(t.getFullYear()+100),t}var i=n.match(/\d+/g)||["2017","2","19","0","0","0"],a=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return n.indexOf("Z")>-1&&(a=new Date(a.getTime()-a.getTimezoneOffset()*60*1e3)),a}function t2(n,e){if(oo&&Buffer.isBuffer(n)){if(e&&MD){if(n[0]==255&&n[1]==254)return dO(n.slice(2).toString("utf16le"));if(n[1]==254&&n[2]==255)return dO(JBe(n.slice(2).toString("binary")))}return n.toString("binary")}if(typeof TextDecoder<"u")try{if(e){if(n[0]==255&&n[1]==254)return dO(new TextDecoder("utf-16le").decode(n.slice(2)));if(n[0]==254&&n[1]==255)return dO(new TextDecoder("utf-16be").decode(n.slice(2)))}var t={"\u20AC":"\x80","\u201A":"\x82",\u0192:"\x83","\u201E":"\x84","\u2026":"\x85","\u2020":"\x86","\u2021":"\x87","\u02C6":"\x88","\u2030":"\x89",\u0160:"\x8A","\u2039":"\x8B",\u0152:"\x8C",\u017D:"\x8E","\u2018":"\x91","\u2019":"\x92","\u201C":"\x93","\u201D":"\x94","\u2022":"\x95","\u2013":"\x96","\u2014":"\x97","\u02DC":"\x98","\u2122":"\x99",\u0161:"\x9A","\u203A":"\x9B",\u0153:"\x9C",\u017E:"\x9E",\u0178:"\x9F"};return Array.isArray(n)&&(n=new Uint8Array(n)),new TextDecoder("latin1").decode(n).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(a){return t[a]||a})}catch{}for(var r=[],i=0;i!=n.length;++i)r.push(String.fromCharCode(n[i]));return r.join("")}function sh(n){if(typeof JSON<"u"&&!Array.isArray(n))return JSON.parse(JSON.stringify(n));if(typeof n!="object"||n==null)return n;if(n instanceof Date)return new Date(n.getTime());var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=sh(n[t]));return e}function wo(n,e){for(var t="";t.length<e;)t+=n;return t}function mv(n){var e=Number(n);if(!isNaN(e))return isFinite(e)?e:NaN;if(!/\d/.test(n))return e;var t=1,r=n.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return t*=100,""});return!isNaN(e=Number(r))||(r=r.replace(/[(](.*)[)]/,function(i,a){return t=-t,a}),!isNaN(e=Number(r)))?e/t:e}var tPt=/^(0?\d|1[0-2])(?:|:([0-5]?\d)(?:|(\.\d+)(?:|:([0-5]?\d))|:([0-5]?\d)(|\.\d+)))\s+([ap])m?$/;function rPt(n){return n[2]?n[3]?n[4]?new Date(1899,11,30,+n[1]%12+(n[7]=="p"?12:0),+n[2],+n[4],parseFloat(n[3])*1e3):new Date(1899,11,30,n[7]=="p"?12:0,+n[1],+n[2],parseFloat(n[3])*1e3):n[5]?new Date(1899,11,30,+n[1]%12+(n[7]=="p"?12:0),+n[2],+n[5],n[6]?parseFloat(n[6])*1e3:0):new Date(1899,11,30,+n[1]%12+(n[7]=="p"?12:0),+n[2],0,0):new Date(1899,11,30,+n[1]%12+(n[7]=="p"?12:0),0,0,0)}var nPt=["january","february","march","april","may","june","july","august","september","october","november","december"];function SM(n){var e=n.toLowerCase(),t=e.replace(/\s+/g," ").trim(),r=t.match(tPt);if(r)return rPt(r);var i=new Date(n),a=new Date(NaN),o=i.getYear();i.getMonth();var s=i.getDate();if(isNaN(s))return a;if(e.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(e=e.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),e.length>3&&nPt.indexOf(e)==-1)return a}else if(e.replace(/[ap]m?/,"").match(/[a-z]/))return a;return o<0||o>8099||n.match(/[^-0-9:,\/\\]/)?a:i}var iPt=function(){var n="abacaba".split(/(:?b)/i).length==5;return function(t,r,i){if(n||typeof r=="string")return t.split(r);for(var a=t.split(r),o=[a[0]],s=1;s<a.length;++s)o.push(i),o.push(a[s]);return o}}();function d8e(n){return n?n.content&&n.type?t2(n.content,!0):n.data?hO(n.data):n.asNodeBuffer&&oo?hO(n.asNodeBuffer().toString("binary")):n.asBinary?hO(n.asBinary()):n._data&&n._data.getContent?hO(t2(Array.prototype.slice.call(n._data.getContent(),0))):null:null}function v8e(n){if(!n)return null;if(n.data)return e_e(n.data);if(n.asNodeBuffer&&oo)return n.asNodeBuffer();if(n._data&&n._data.getContent){var e=n._data.getContent();return typeof e=="string"?e_e(e):Array.prototype.slice.call(e)}return n.content&&n.type?n.content:null}function aPt(n){return n&&n.name.slice(-4)===".bin"?v8e(n):d8e(n)}function hp(n,e){for(var t=n.FullPaths||h0(n.files),r=e.toLowerCase().replace(/[\/]/g,"\\"),i=r.replace(/\\/g,"/"),a=0;a<t.length;++a){var o=t[a].replace(/^Root Entry[\/]/,"").toLowerCase();if(r==o||i==o)return n.files?n.files[t[a]]:n.FileIndex[a]}return null}function voe(n,e){var t=hp(n,e);if(t==null)throw new Error("Cannot find file "+e+" in zip");return t}function Cu(n,e,t){if(!t)return aPt(voe(n,e));if(!e)return null;try{return Cu(n,e)}catch{return null}}function cd(n,e,t){if(!t)return d8e(voe(n,e));if(!e)return null;try{return cd(n,e)}catch{return null}}function p8e(n,e,t){if(!t)return v8e(voe(n,e));if(!e)return null;try{return p8e(n,e)}catch{return null}}function v_e(n){for(var e=n.FullPaths||h0(n.files),t=[],r=0;r<e.length;++r)e[r].slice(-1)!="/"&&t.push(e[r].replace(/^Root Entry[\/]/,""));return t.sort()}function oPt(n,e,t){if(n.FullPaths){if(typeof t=="string"){var r;return oo?r=Sw(t):r=wLt(t),co.utils.cfb_add(n,e,r)}co.utils.cfb_add(n,e,t)}else n.file(e,t)}function g8e(n,e){switch(e.type){case"base64":return co.read(n,{type:"base64"});case"binary":return co.read(n,{type:"binary"});case"buffer":case"array":return co.read(n,{type:"buffer"})}throw new Error("Unrecognized type "+e.type)}function fO(n,e){if(n.charAt(0)=="/")return n.slice(1);var t=e.split("/");e.slice(-1)!="/"&&t.pop();for(var r=n.split("/");r.length!==0;){var i=r.shift();i===".."?t.pop():i!=="."&&t.push(i)}return t.join("/")}var y8e=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
`,sPt=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,p_e=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,lPt=/<[^>]*>/g,nf=y8e.match(p_e)?p_e:lPt,uPt=/<\w*:/,hPt=/<(\/?)\w+:/;function Tn(n,e,t){for(var r={},i=0,a=0;i!==n.length&&!((a=n.charCodeAt(i))===32||a===10||a===13);++i);if(e||(r[0]=n.slice(0,i)),i===n.length)return r;var o=n.match(sPt),s=0,l="",u=0,h="",c="",f=1;if(o)for(u=0;u!=o.length;++u){for(c=o[u],a=0;a!=c.length&&c.charCodeAt(a)!==61;++a);for(h=c.slice(0,a).trim();c.charCodeAt(a+1)==32;)++a;for(f=(i=c.charCodeAt(a+1))==34||i==39?1:0,l=c.slice(a+1+f,c.length-f),s=0;s!=h.length&&h.charCodeAt(s)!==58;++s);if(s===h.length)h.indexOf("_")>0&&(h=h.slice(0,h.indexOf("_"))),r[h]=l,t||(r[h.toLowerCase()]=l);else{var d=(s===5&&h.slice(0,5)==="xmlns"?"xmlns":"")+h.slice(s+1);if(r[d]&&h.slice(s-3,s)=="ext")continue;r[d]=l,t||(r[d.toLowerCase()]=l)}}return r}function N0(n){return n.replace(hPt,"<$1")}var m8e={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},cPt=doe(m8e),so=function(){var n=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,e=/_x([\da-fA-F]{4})_/ig;function t(r){var i=r+"",a=i.indexOf("<![CDATA[");if(a==-1)return i.replace(n,function(s,l){return m8e[s]||String.fromCharCode(parseInt(l,s.indexOf("x")>-1?16:10))||s}).replace(e,function(s,l){return String.fromCharCode(parseInt(l,16))});var o=i.indexOf("]]>");return t(i.slice(0,a))+i.slice(a+9,o)+t(i.slice(o+3))}return function(i,a){var o=t(i);return a?o.replace(/\r\n/g,`
`):o}}(),fPt=/[&<>'"]/g,dPt=/[\u0000-\u001f]/g;function ZG(n){var e=n+"";return e.replace(fPt,function(t){return cPt[t]}).replace(/\n/g,"<br/>").replace(dPt,function(t){return"&#x"+("000"+t.charCodeAt(0).toString(16)).slice(-4)+";"})}var g_e=function(){var n=/&#(\d+);/g;function e(t,r){return String.fromCharCode(parseInt(r,10))}return function(r){return r.replace(n,e)}}();function ps(n){switch(n){case 1:case!0:case"1":case"true":return!0;case 0:case!1:case"0":case"false":return!1}return!1}function pX(n){for(var e="",t=0,r=0,i=0,a=0,o=0,s=0;t<n.length;){if(r=n.charCodeAt(t++),r<128){e+=String.fromCharCode(r);continue}if(i=n.charCodeAt(t++),r>191&&r<224){o=(r&31)<<6,o|=i&63,e+=String.fromCharCode(o);continue}if(a=n.charCodeAt(t++),r<240){e+=String.fromCharCode((r&15)<<12|(i&63)<<6|a&63);continue}o=n.charCodeAt(t++),s=((r&7)<<18|(i&63)<<12|(a&63)<<6|o&63)-65536,e+=String.fromCharCode(55296+(s>>>10&1023)),e+=String.fromCharCode(56320+(s&1023))}return e}function y_e(n){var e=VS(2*n.length),t,r,i=1,a=0,o=0,s;for(r=0;r<n.length;r+=i)i=1,(s=n.charCodeAt(r))<128?t=s:s<224?(t=(s&31)*64+(n.charCodeAt(r+1)&63),i=2):s<240?(t=(s&15)*4096+(n.charCodeAt(r+1)&63)*64+(n.charCodeAt(r+2)&63),i=3):(i=4,t=(s&7)*262144+(n.charCodeAt(r+1)&63)*4096+(n.charCodeAt(r+2)&63)*64+(n.charCodeAt(r+3)&63),t-=65536,o=55296+(t>>>10&1023),t=56320+(t&1023)),o!==0&&(e[a++]=o&255,e[a++]=o>>>8,o=0),e[a++]=t%256,e[a++]=t>>>8;return e.slice(0,a).toString("ucs2")}function m_e(n){return Sw(n,"binary").toString("utf8")}var j4="foo bar baz\xE2\x98\x83\xF0\x9F\x8D\xA3",As=oo&&(m_e(j4)==pX(j4)&&m_e||y_e(j4)==pX(j4)&&y_e)||pX,dO=oo?function(n){return Sw(n,"utf8").toString("binary")}:function(n){for(var e=[],t=0,r=0,i=0;t<n.length;)switch(r=n.charCodeAt(t++),!0){case r<128:e.push(String.fromCharCode(r));break;case r<2048:e.push(String.fromCharCode(192+(r>>6))),e.push(String.fromCharCode(128+(r&63)));break;case(r>=55296&&r<57344):r-=55296,i=n.charCodeAt(t++)-56320+(r<<10),e.push(String.fromCharCode(240+(i>>18&7))),e.push(String.fromCharCode(144+(i>>12&63))),e.push(String.fromCharCode(128+(i>>6&63))),e.push(String.fromCharCode(128+(i&63)));break;default:e.push(String.fromCharCode(224+(r>>12))),e.push(String.fromCharCode(128+(r>>6&63))),e.push(String.fromCharCode(128+(r&63)))}return e.join("")},LD=function(){var n={};return function(t,r){var i=t+"|"+(r||"");return n[i]?n[i]:n[i]=new RegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",r||"")}}(),_8e=function(){var n=[["nbsp"," "],["middot","\xB7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(t){for(var r=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
`).replace(/<[^>]*>/g,""),i=0;i<n.length;++i)r=r.replace(n[i][0],n[i][1]);return r}}(),vPt=function(){var n={};return function(t){return n[t]!==void 0?n[t]:n[t]=new RegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}(),pPt=/<\/?(?:vt:)?variant>/g,gPt=/<(?:vt:)([^>]*)>([\s\S]*)</;function __e(n,e){var t=Tn(n),r=n.match(vPt(t.baseType))||[],i=[];if(r.length!=t.size){if(e.WTF)throw new Error("unexpected vector length "+r.length+" != "+t.size);return i}return r.forEach(function(a){var o=a.replace(pPt,"").match(gPt);o&&i.push({v:As(o[2]),t:o[1]})}),i}var yPt=/(^\s|\s$|\n)/;function mPt(n){return h0(n).map(function(e){return" "+e+'="'+n[e]+'"'}).join("")}function _Pt(n,e,t){return"<"+n+(t!=null?mPt(t):"")+(e!=null?(e.match(yPt)?' xml:space="preserve"':"")+">"+e+"</"+n:"/")+">"}function CU(n){if(oo&&Buffer.isBuffer(n))return n.toString("utf8");if(typeof n=="string")return n;if(typeof Uint8Array<"u"&&n instanceof Uint8Array)return As(p_(hoe(n)));throw new Error("Bad input format: expected Buffer or string")}var Mu=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/](?:[^>=]|="[^"]*?")*)?>/mg,xPt={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},SPt=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function wPt(n,e){for(var t=1-2*(n[e+7]>>>7),r=((n[e+7]&127)<<4)+(n[e+6]>>>4&15),i=n[e+6]&15,a=5;a>=0;--a)i=i*256+n[e+a];return r==2047?i==0?t*(1/0):NaN:(r==0?r=-1022:(r-=1023,i+=Math.pow(2,52)),t*Math.pow(2,r-52)*i)}function bPt(n,e,t){var r=(e<0||1/e==-1/0?1:0)<<7,i=0,a=0,o=r?-e:e;isFinite(o)?o==0?i=a=0:(i=Math.floor(Math.log(o)/Math.LN2),a=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(a)||a<Math.pow(2,52))?i=-1022:(a-=Math.pow(2,52),i+=1023)):(i=2047,a=isNaN(e)?26985:0);for(var s=0;s<=5;++s,a/=256)n[t+s]=a&255;n[t+6]=(i&15)<<4|a&15,n[t+7]=i>>4|r}var x_e=function(n){for(var e=[],t=10240,r=0;r<n[0].length;++r)if(n[0][r])for(var i=0,a=n[0][r].length;i<a;i+=t)e.push.apply(e,n[0][r].slice(i,i+t));return e},S_e=oo?function(n){return n[0].length>0&&Buffer.isBuffer(n[0][0])?Buffer.concat(n[0].map(function(e){return Buffer.isBuffer(e)?e:Sw(e)})):x_e(n)}:x_e,w_e=function(n,e,t){for(var r=[],i=e;i<t;i+=2)r.push(String.fromCharCode(R1(n,i)));return r.join("").replace(Nf,"")},poe=oo?function(n,e,t){return!Buffer.isBuffer(n)||!MD?w_e(n,e,t):n.toString("utf16le",e,t).replace(Nf,"")}:w_e,b_e=function(n,e,t){for(var r=[],i=e;i<e+t;++i)r.push(("0"+n[i].toString(16)).slice(-2));return r.join("")},x8e=oo?function(n,e,t){return Buffer.isBuffer(n)?n.toString("hex",e,e+t):b_e(n,e,t)}:b_e,E_e=function(n,e,t){for(var r=[],i=e;i<t;i++)r.push(String.fromCharCode(WC(n,i)));return r.join("")},D3=oo?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf8",t,r):E_e(e,t,r)}:E_e,S8e=function(n,e){var t=av(n,e);return t>0?D3(n,e+4,e+4+t-1):""},w8e=S8e,b8e=function(n,e){var t=av(n,e);return t>0?D3(n,e+4,e+4+t-1):""},E8e=b8e,T8e=function(n,e){var t=2*av(n,e);return t>0?D3(n,e+4,e+4+t-1):""},C8e=T8e,A8e=function(e,t){var r=av(e,t);return r>0?poe(e,t+4,t+4+r):""},M8e=A8e,I8e=function(n,e){var t=av(n,e);return t>0?D3(n,e+4,e+4+t):""},L8e=I8e,P8e=function(n,e){return wPt(n,e)},KG=P8e,O8e=function(e){return Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array};oo&&(w8e=function(e,t){if(!Buffer.isBuffer(e))return S8e(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},E8e=function(e,t){if(!Buffer.isBuffer(e))return b8e(e,t);var r=e.readUInt32LE(t);return r>0?e.toString("utf8",t+4,t+4+r-1):""},C8e=function(e,t){if(!Buffer.isBuffer(e)||!MD)return T8e(e,t);var r=2*e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r-1)},M8e=function(e,t){if(!Buffer.isBuffer(e)||!MD)return A8e(e,t);var r=e.readUInt32LE(t);return e.toString("utf16le",t+4,t+4+r)},L8e=function(e,t){if(!Buffer.isBuffer(e))return I8e(e,t);var r=e.readUInt32LE(t);return e.toString("utf8",t+4,t+4+r)},KG=function(e,t){return Buffer.isBuffer(e)?e.readDoubleLE(t):P8e(e,t)},O8e=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array});var WC=function(n,e){return n[e]},R1=function(n,e){return n[e+1]*(1<<8)+n[e]},EPt=function(n,e){var t=n[e+1]*256+n[e];return t<32768?t:(65535-t+1)*-1},av=function(n,e){return n[e+3]*(1<<24)+(n[e+2]<<16)+(n[e+1]<<8)+n[e]},Yb=function(n,e){return n[e+3]<<24|n[e+2]<<16|n[e+1]<<8|n[e]},TPt=function(n,e){return n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3]};function aR(n,e){var t="",r,i,a=[],o,s,l,u;switch(e){case"dbcs":if(u=this.l,oo&&Buffer.isBuffer(this)&&MD)t=this.slice(this.l,this.l+2*n).toString("utf16le");else for(l=0;l<n;++l)t+=String.fromCharCode(R1(this,u)),u+=2;n*=2;break;case"utf8":t=D3(this,this.l,this.l+n);break;case"utf16le":n*=2,t=poe(this,this.l,this.l+n);break;case"wstr":return aR.call(this,n,"dbcs");case"lpstr-ansi":t=w8e(this,this.l),n=4+av(this,this.l);break;case"lpstr-cp":t=E8e(this,this.l),n=4+av(this,this.l);break;case"lpwstr":t=C8e(this,this.l),n=4+2*av(this,this.l);break;case"lpp4":n=4+av(this,this.l),t=M8e(this,this.l),n&2&&(n+=2);break;case"8lpp4":n=4+av(this,this.l),t=L8e(this,this.l),n&3&&(n+=4-(n&3));break;case"cstr":for(n=0,t="";(o=WC(this,this.l+n++))!==0;)a.push(H4(o));t=a.join("");break;case"_wstr":for(n=0,t="";(o=R1(this,this.l+n))!==0;)a.push(H4(o)),n+=2;n+=2,t=a.join("");break;case"dbcs-cont":for(t="",u=this.l,l=0;l<n;++l){if(this.lens&&this.lens.indexOf(u)!==-1)return o=WC(this,u),this.l=u+1,s=aR.call(this,n-l,o?"dbcs-cont":"sbcs-cont"),a.join("")+s;a.push(H4(R1(this,u))),u+=2}t=a.join(""),n*=2;break;case"cpstr":case"sbcs-cont":for(t="",u=this.l,l=0;l!=n;++l){if(this.lens&&this.lens.indexOf(u)!==-1)return o=WC(this,u),this.l=u+1,s=aR.call(this,n-l,o?"dbcs-cont":"sbcs-cont"),a.join("")+s;a.push(H4(WC(this,u))),u+=1}t=a.join("");break;default:switch(n){case 1:return r=WC(this,this.l),this.l++,r;case 2:return r=(e==="i"?EPt:R1)(this,this.l),this.l+=2,r;case 4:case-4:return e==="i"||(this[this.l+3]&128)===0?(r=(n>0?Yb:TPt)(this,this.l),this.l+=4,r):(i=av(this,this.l),this.l+=4,i);case 8:case-8:if(e==="f")return n==8?i=KG(this,this.l):i=KG([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;n=8;case 16:t=x8e(this,this.l,n);break}}return this.l+=n,t}var CPt=function(n,e,t){n[t]=e&255,n[t+1]=e>>>8&255,n[t+2]=e>>>16&255,n[t+3]=e>>>24&255},APt=function(n,e,t){n[t]=e&255,n[t+1]=e>>8&255,n[t+2]=e>>16&255,n[t+3]=e>>24&255},MPt=function(n,e,t){n[t]=e&255,n[t+1]=e>>>8&255};function IPt(n,e,t){var r=0,i=0;if(t==="dbcs"){for(i=0;i!=e.length;++i)MPt(this,e.charCodeAt(i),this.l+2*i);r=2*e.length}else if(t==="sbcs"||t=="cpstr"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=e.length;++i)this[this.l+i]=e.charCodeAt(i)&255;r=e.length}else if(t==="hex"){for(;i<n;++i)this[this.l++]=parseInt(e.slice(2*i,2*i+2),16)||0;return this}else if(t==="utf16le"){var a=Math.min(this.l+n,this.length);for(i=0;i<Math.min(e.length,n);++i){var o=e.charCodeAt(i);this[this.l++]=o&255,this[this.l++]=o>>8}for(;this.l<a;)this[this.l++]=0;return this}else switch(n){case 1:r=1,this[this.l]=e&255;break;case 2:r=2,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255;break;case 3:r=3,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255,e>>>=8,this[this.l+2]=e&255;break;case 4:r=4,CPt(this,e,this.l);break;case 8:if(r=8,t==="f"){bPt(this,e,this.l);break}case 16:break;case-4:r=4,APt(this,e,this.l);break}return this.l+=r,this}function R8e(n,e){var t=x8e(this,this.l,n.length>>1);if(t!==n)throw new Error(e+"Expected "+n+" saw "+t);this.l+=n.length>>1}function eh(n,e){n.l=e,n.read_shift=aR,n.chk=R8e,n.write_shift=IPt}function Kc(n,e){n.l+=e}function Ku(n){var e=VS(n);return eh(e,0),e}function B_(n,e,t){if(!!n){var r,i,a;eh(n,n.l||0);for(var o=n.length,s=0,l=0;n.l<o;){s=n.read_shift(1),s&128&&(s=(s&127)+((n.read_shift(1)&127)<<7));var u=n9[s]||n9[65535];for(r=n.read_shift(1),a=r&127,i=1;i<4&&r&128;++i)a+=((r=n.read_shift(1))&127)<<7*i;l=n.l+a;var h=u.f&&u.f(n,a,t);if(n.l=l,e(h,u,s))return}}}function yQ(){var n=[],e=oo?256:2048,t=function(u){var h=Ku(u);return eh(h,0),h},r=t(e),i=function(){!r||(r.l&&(r.length>r.l&&(r=r.slice(0,r.l),r.l=r.length),r.length>0&&n.push(r)),r=null)},a=function(u){return r&&u<r.length-r.l?r:(i(),r=t(Math.max(u+1,e)))},o=function(){return i(),Yx(n)},s=function(u){i(),r=u,r.l==null&&(r.l=r.length),a(e)};return{next:a,push:s,end:o,_bufs:n}}function oR(n,e,t){var r=sh(n);if(e.s?(r.cRel&&(r.c+=e.s.c),r.rRel&&(r.r+=e.s.r)):(r.cRel&&(r.c+=e.c),r.rRel&&(r.r+=e.r)),!t||t.biff<12){for(;r.c>=256;)r.c-=256;for(;r.r>=65536;)r.r-=65536}return r}function T_e(n,e,t){var r=sh(n);return r.s=oR(r.s,e.s,t),r.e=oR(r.e,e.s,t),r}function sR(n,e){if(n.cRel&&n.c<0)for(n=sh(n);n.c<0;)n.c+=e>8?16384:256;if(n.rRel&&n.r<0)for(n=sh(n);n.r<0;)n.r+=e>8?1048576:e>5?65536:16384;var t=bo(n);return!n.cRel&&n.cRel!=null&&(t=OPt(t)),!n.rRel&&n.rRel!=null&&(t=LPt(t)),t}function gX(n,e){return n.s.r==0&&!n.s.rRel&&n.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!n.e.rRel?(n.s.cRel?"":"$")+$o(n.s.c)+":"+(n.e.cRel?"":"$")+$o(n.e.c):n.s.c==0&&!n.s.cRel&&n.e.c==(e.biff>=12?16383:255)&&!n.e.cRel?(n.s.rRel?"":"$")+ys(n.s.r)+":"+(n.e.rRel?"":"$")+ys(n.e.r):sR(n.s,e.biff)+":"+sR(n.e,e.biff)}function goe(n){return parseInt(PPt(n),10)-1}function ys(n){return""+(n+1)}function LPt(n){return n.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function PPt(n){return n.replace(/\$(\d+)$/,"$1")}function yoe(n){for(var e=RPt(n),t=0,r=0;r!==e.length;++r)t=26*t+e.charCodeAt(r)-64;return t-1}function $o(n){if(n<0)throw new Error("invalid column "+n);var e="";for(++n;n;n=Math.floor((n-1)/26))e=String.fromCharCode((n-1)%26+65)+e;return e}function OPt(n){return n.replace(/^([A-Z])/,"$$$1")}function RPt(n){return n.replace(/^\$([A-Z])/,"$1")}function DPt(n){return n.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function zc(n){for(var e=0,t=0,r=0;r<n.length;++r){var i=n.charCodeAt(r);i>=48&&i<=57?e=10*e+(i-48):i>=65&&i<=90&&(t=26*t+(i-64))}return{c:t-1,r:e-1}}function bo(n){for(var e=n.c+1,t="";e;e=(e-1)/26|0)t=String.fromCharCode((e-1)%26+65)+t;return t+(n.r+1)}function eT(n){var e=n.indexOf(":");return e==-1?{s:zc(n),e:zc(n)}:{s:zc(n.slice(0,e)),e:zc(n.slice(e+1))}}function lo(n,e){return typeof e>"u"||typeof e=="number"?lo(n.s,n.e):(typeof n!="string"&&(n=bo(n)),typeof e!="string"&&(e=bo(e)),n==e?n:n+":"+e)}function NPt(n,e){if(!n&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(n)?"'"+n.replace(/'/g,"''")+"'":n}function cu(n){var e={s:{c:0,r:0},e:{c:0,r:0}},t=0,r=0,i=0,a=n.length;for(t=0;r<a&&!((i=n.charCodeAt(r)-64)<1||i>26);++r)t=26*t+i;for(e.s.c=--t,t=0;r<a&&!((i=n.charCodeAt(r)-48)<0||i>9);++r)t=10*t+i;if(e.s.r=--t,r===a||i!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++r,t=0;r!=a&&!((i=n.charCodeAt(r)-64)<1||i>26);++r)t=26*t+i;for(e.e.c=--t,t=0;r!=a&&!((i=n.charCodeAt(r)-48)<0||i>9);++r)t=10*t+i;return e.e.r=--t,e}function C_e(n,e){var t=n.t=="d"&&e instanceof Date;if(n.z!=null)try{return n.w=Cv(n.z,t?Zc(e):e)}catch{}try{return n.w=Cv((n.XF||{}).numFmtId||(t?14:0),t?Zc(e):e)}catch{return""+e}}function $S(n,e,t){return n==null||n.t==null||n.t=="z"?"":n.w!==void 0?n.w:(n.t=="d"&&!n.z&&t&&t.dateNF&&(n.z=t.dateNF),n.t=="e"?nT[n.v]||n.v:e==null?C_e(n,n.v):C_e(n,e))}function ww(n,e){var t=e&&e.sheet?e.sheet:"Sheet1",r={};return r[t]=n,{SheetNames:[t],Sheets:r}}function D8e(n,e,t){var r=t||{},i=n?n["!data"]!=null:r.dense,a=n||{};i&&!a["!data"]&&(a["!data"]=[]);var o=0,s=0;if(a&&r.origin!=null){if(typeof r.origin=="number")o=r.origin;else{var l=typeof r.origin=="string"?zc(r.origin):r.origin;o=l.r,s=l.c}a["!ref"]||(a["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(a["!ref"]){var h=cu(a["!ref"]);u.s.c=h.s.c,u.s.r=h.s.r,u.e.c=Math.max(u.e.c,h.e.c),u.e.r=Math.max(u.e.r,h.e.r),o==-1&&(u.e.r=o=h.e.r+1)}for(var c=[],f=0;f!=e.length;++f)if(!!e[f]){if(!Array.isArray(e[f]))throw new Error("aoa_to_sheet expects an array of arrays");var d=o+f,v=""+(d+1);i&&(a["!data"][d]||(a["!data"][d]=[]),c=a["!data"][d]);for(var p=0;p!=e[f].length;++p)if(!(typeof e[f][p]>"u")){var g={v:e[f][p]},m=s+p;if(u.s.r>d&&(u.s.r=d),u.s.c>m&&(u.s.c=m),u.e.r<d&&(u.e.r=d),u.e.c<m&&(u.e.c=m),e[f][p]&&typeof e[f][p]=="object"&&!Array.isArray(e[f][p])&&!(e[f][p]instanceof Date))g=e[f][p];else if(Array.isArray(g.v)&&(g.f=e[f][p][1],g.v=g.v[0]),g.v===null)if(g.f)g.t="n";else if(r.nullError)g.t="e",g.v=0;else if(r.sheetStubs)g.t="z";else continue;else typeof g.v=="number"?g.t="n":typeof g.v=="boolean"?g.t="b":g.v instanceof Date?(g.z=r.dateNF||ji[14],r.cellDates?(g.t="d",g.w=Cv(g.z,Zc(g.v,r.date1904))):(g.t="n",g.v=Zc(g.v,r.date1904),g.w=Cv(g.z,g.v))):g.t="s";if(i)c[m]&&c[m].z&&(g.z=c[m].z),c[m]=g;else{var y=$o(m)+v;a[y]&&a[y].z&&(g.z=a[y].z),a[y]=g}}}return u.s.c<1e7&&(a["!ref"]=lo(u)),a}function HI(n,e){return D8e(null,n,e)}function kPt(n){return n.read_shift(4,"i")}function Wc(n){var e=n.read_shift(4);return e===0?"":n.read_shift(e,"dbcs")}function FPt(n){return{ich:n.read_shift(2),ifnt:n.read_shift(2)}}function moe(n,e){var t=n.l,r=n.read_shift(1),i=Wc(n),a=[],o={t:i,h:i};if((r&1)!==0){for(var s=n.read_shift(4),l=0;l!=s;++l)a.push(FPt(n));o.r=a}else o.r=[{ich:0,ifnt:0}];return n.l=t+e,o}var BPt=moe;function og(n){var e=n.read_shift(4),t=n.read_shift(2);return t+=n.read_shift(1)<<16,n.l++,{c:e,iStyleRef:t}}function tT(n){var e=n.read_shift(2);return e+=n.read_shift(1)<<16,n.l++,{c:-1,iStyleRef:e}}var GPt=Wc;function _oe(n){var e=n.read_shift(4);return e===0||e===4294967295?"":n.read_shift(e,"dbcs")}var zPt=Wc,mQ=_oe;function xoe(n){var e=n.slice(n.l,n.l+4),t=e[0]&1,r=e[0]&2;n.l+=4;var i=r===0?KG([0,0,0,0,e[0]&252,e[1],e[2],e[3]],0):Yb(e,0)>>2;return t?i/100:i}function N8e(n){var e={s:{},e:{}};return e.s.r=n.read_shift(4),e.e.r=n.read_shift(4),e.s.c=n.read_shift(4),e.e.c=n.read_shift(4),e}var rT=N8e;function Bc(n){if(n.length-n.l<8)throw"XLS Xnum Buffer underflow";return n.read_shift(8,"f")}function UPt(n){var e={},t=n.read_shift(1),r=t>>>1,i=n.read_shift(1),a=n.read_shift(2,"i"),o=n.read_shift(1),s=n.read_shift(1),l=n.read_shift(1);switch(n.l++,r){case 0:e.auto=1;break;case 1:e.index=i;var u=RE[i];u&&(e.rgb=OD(u));break;case 2:e.rgb=OD([o,s,l]);break;case 3:e.theme=i;break}return a!=0&&(e.tint=a>0?a/32767:a/32768),e}function VPt(n){var e=n.read_shift(1);n.l++;var t={fBold:e&1,fItalic:e&2,fUnderline:e&4,fStrikeout:e&8,fOutline:e&16,fShadow:e&32,fCondense:e&64,fExtend:e&128};return t}function k8e(n,e){var t={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},r=n.read_shift(4);switch(r){case 0:return"";case 4294967295:case 4294967294:return t[n.read_shift(4)]||""}if(r>400)throw new Error("Unsupported Clipboard: "+r.toString(16));return n.l-=4,n.read_shift(0,e==1?"lpstr":"lpwstr")}function $Pt(n){return k8e(n,1)}function WPt(n){return k8e(n,2)}var Soe=2,id=3,X4=11,A_e=12,JG=19,Y4=64,HPt=65,jPt=71,XPt=4108,YPt=4126,Lh=80,F8e=81,qPt=[Lh,F8e],ZPt={1:{n:"CodePage",t:Soe},2:{n:"Category",t:Lh},3:{n:"PresentationFormat",t:Lh},4:{n:"ByteCount",t:id},5:{n:"LineCount",t:id},6:{n:"ParagraphCount",t:id},7:{n:"SlideCount",t:id},8:{n:"NoteCount",t:id},9:{n:"HiddenCount",t:id},10:{n:"MultimediaClipCount",t:id},11:{n:"ScaleCrop",t:X4},12:{n:"HeadingPairs",t:XPt},13:{n:"TitlesOfParts",t:YPt},14:{n:"Manager",t:Lh},15:{n:"Company",t:Lh},16:{n:"LinksUpToDate",t:X4},17:{n:"CharacterCount",t:id},19:{n:"SharedDoc",t:X4},22:{n:"HyperlinksChanged",t:X4},23:{n:"AppVersion",t:id,p:"version"},24:{n:"DigSig",t:HPt},26:{n:"ContentType",t:Lh},27:{n:"ContentStatus",t:Lh},28:{n:"Language",t:Lh},29:{n:"Version",t:Lh},255:{},2147483648:{n:"Locale",t:JG},2147483651:{n:"Behavior",t:JG},1919054434:{}},KPt={1:{n:"CodePage",t:Soe},2:{n:"Title",t:Lh},3:{n:"Subject",t:Lh},4:{n:"Author",t:Lh},5:{n:"Keywords",t:Lh},6:{n:"Comments",t:Lh},7:{n:"Template",t:Lh},8:{n:"LastAuthor",t:Lh},9:{n:"RevNumber",t:Lh},10:{n:"EditTime",t:Y4},11:{n:"LastPrinted",t:Y4},12:{n:"CreatedDate",t:Y4},13:{n:"ModifiedDate",t:Y4},14:{n:"PageCount",t:id},15:{n:"WordCount",t:id},16:{n:"CharCount",t:id},17:{n:"Thumbnail",t:jPt},18:{n:"Application",t:Lh},19:{n:"DocSecurity",t:id},255:{},2147483648:{n:"Locale",t:JG},2147483651:{n:"Behavior",t:JG},1919054434:{}},M_e={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},JPt=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function QPt(n){return n.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var eOt=QPt([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,0,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),RE=sh(eOt),nT={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},B8e={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},G8e=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"],I_e={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};function tOt(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function rOt(n){var e=tOt();if(!n||!n.match)return e;var t={};if((n.match(nf)||[]).forEach(function(r){var i=Tn(r);switch(i[0].replace(uPt,"<")){case"<?xml":break;case"<Types":e.xmlns=i["xmlns"+(i[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":t[i.Extension.toLowerCase()]=i.ContentType;break;case"<Override":e[I_e[i.ContentType]]!==void 0&&e[I_e[i.ContentType]].push(i.PartName);break}}),e.xmlns!==xPt.CT)throw new Error("Unknown Namespace: "+e.xmlns);return e.calcchain=e.calcchains.length>0?e.calcchains[0]:"",e.sst=e.strs.length>0?e.strs[0]:"",e.style=e.styles.length>0?e.styles[0]:"",e.defaults=t,delete e.calcchains,e}var vA={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",CONN:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function _Q(n){var e=n.lastIndexOf("/");return n.slice(0,e+1)+"_rels/"+n.slice(e+1)+".rels"}function lR(n,e){var t={"!id":{}};if(!n)return t;e.charAt(0)!=="/"&&(e="/"+e);var r={};return(n.match(nf)||[]).forEach(function(i){var a=Tn(i);if(a[0]==="<Relationship"){var o={};o.Type=a.Type,o.Target=so(a.Target),o.Id=a.Id,a.TargetMode&&(o.TargetMode=a.TargetMode);var s=a.TargetMode==="External"?a.Target:fO(a.Target,e);t[s]=o,r[a.Id]=o}}),t["!id"]=r,t}var nOt="application/vnd.oasis.opendocument.spreadsheet";function iOt(n,e){for(var t=CU(n),r,i;r=Mu.exec(t);)switch(r[3]){case"manifest":break;case"file-entry":if(i=Tn(r[0],!1),i.path=="/"&&i.type!==nOt)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(e&&e.WTF)throw r}}var uR=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],aOt=function(){for(var n=new Array(uR.length),e=0;e<uR.length;++e){var t=uR[e],r="(?:"+t[0].slice(0,t[0].indexOf(":"))+":)"+t[0].slice(t[0].indexOf(":")+1);n[e]=new RegExp("<"+r+"[^>]*>([\\s\\S]*?)</"+r+">")}return n}();function z8e(n){var e={};n=As(n);for(var t=0;t<uR.length;++t){var r=uR[t],i=n.match(aOt[t]);i!=null&&i.length>0&&(e[r[1]]=so(i[1])),r[2]==="date"&&e[r[1]]&&(e[r[1]]=pc(e[r[1]]))}return e}var oOt=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function U8e(n,e,t,r){var i=[];if(typeof n=="string")i=__e(n,r);else for(var a=0;a<n.length;++a)i=i.concat(n[a].map(function(h){return{v:h}}));var o=typeof e=="string"?__e(e,r).map(function(h){return h.v}):e,s=0,l=0;if(o.length>0)for(var u=0;u!==i.length;u+=2){switch(l=+i[u+1].v,i[u].v){case"Worksheets":case"\u5DE5\u4F5C\u8868":case"\u041B\u0438\u0441\u0442\u044B":case"\u0623\u0648\u0631\u0627\u0642 \u0627\u0644\u0639\u0645\u0644":case"\u30EF\u30FC\u30AF\u30B7\u30FC\u30C8":case"\u05D2\u05DC\u05D9\u05D5\u05E0\u05D5\u05EA \u05E2\u05D1\u05D5\u05D3\u05D4":case"Arbeitsbl\xE4tter":case"\xC7al\u0131\u015Fma Sayfalar\u0131":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de c\xE1lculo":case"Planilhas":case"Regneark":case"Hojas de c\xE1lculo":case"Werkbladen":t.Worksheets=l,t.SheetNames=o.slice(s,s+l);break;case"Named Ranges":case"Rangos con nombre":case"\u540D\u524D\u4ED8\u304D\u4E00\u89A7":case"Benannte Bereiche":case"Navngivne omr\xE5der":t.NamedRanges=l,t.DefinedNames=o.slice(s,s+l);break;case"Charts":case"Diagramme":t.Chartsheets=l,t.ChartNames=o.slice(s,s+l);break}s+=l}}function sOt(n,e,t){var r={};return e||(e={}),n=As(n),oOt.forEach(function(i){var a=(n.match(LD(i[0]))||[])[1];switch(i[2]){case"string":a&&(e[i[1]]=so(a));break;case"bool":e[i[1]]=a==="true";break;case"raw":var o=n.match(new RegExp("<"+i[0]+"[^>]*>([\\s\\S]*?)</"+i[0]+">"));o&&o.length>0&&(r[i[1]]=o[1]);break}}),r.HeadingPairs&&r.TitlesOfParts&&U8e(r.HeadingPairs,r.TitlesOfParts,e,t),e}var lOt=/<[^>]+>[^<]*/g;function uOt(n,e){var t={},r="",i=n.match(lOt);if(i)for(var a=0;a!=i.length;++a){var o=i[a],s=Tn(o);switch(N0(s[0])){case"<?xml":break;case"<Properties":break;case"<property":r=so(s.name);break;case"</property>":r=null;break;default:if(o.indexOf("<vt:")===0){var l=o.split(">"),u=l[0].slice(4),h=l[1];switch(u){case"lpstr":case"bstr":case"lpwstr":t[r]=so(h);break;case"bool":t[r]=ps(h);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":t[r]=parseInt(h,10);break;case"r4":case"r8":case"decimal":t[r]=parseFloat(h);break;case"filetime":case"date":t[r]=pc(h);break;case"cy":case"error":t[r]=so(h);break;default:if(u.slice(-1)=="/")break;e.WTF&&typeof console<"u"&&console.warn("Unexpected",o,u,l)}}else if(o.slice(0,2)!=="</"){if(e.WTF)throw new Error(o)}}}return t}var hOt={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},yX;function cOt(n,e,t){yX||(yX=doe(hOt)),e=yX[e]||e,n[e]=t}function woe(n){var e=n.read_shift(4),t=n.read_shift(4);return new Date((t/1e7*Math.pow(2,32)+e/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function V8e(n,e,t){var r=n.l,i=n.read_shift(0,"lpstr-cp");if(t)for(;n.l-r&3;)++n.l;return i}function $8e(n,e,t){var r=n.read_shift(0,"lpwstr");return t&&(n.l+=4-(r.length+1&3)&3),r}function W8e(n,e,t){return e===31?$8e(n):V8e(n,e,t)}function xQ(n,e,t){return W8e(n,e,t===!1?0:4)}function fOt(n,e){if(!e)throw new Error("VtUnalignedString must have positive length");return W8e(n,e,0)}function dOt(n){for(var e=n.read_shift(4),t=[],r=0;r!=e;++r){var i=n.l;t[r]=n.read_shift(0,"lpwstr").replace(Nf,""),n.l-i&2&&(n.l+=2)}return t}function vOt(n){for(var e=n.read_shift(4),t=[],r=0;r!=e;++r)t[r]=n.read_shift(0,"lpstr-cp").replace(Nf,"");return t}function pOt(n){var e=n.l,t=QG(n,F8e);n[n.l]==0&&n[n.l+1]==0&&n.l-e&2&&(n.l+=2);var r=QG(n,id);return[t,r]}function gOt(n){for(var e=n.read_shift(4),t=[],r=0;r<e/2;++r)t.push(pOt(n));return t}function L_e(n,e){for(var t=n.read_shift(4),r={},i=0;i!=t;++i){var a=n.read_shift(4),o=n.read_shift(4);r[a]=n.read_shift(o,e===1200?"utf16le":"utf8").replace(Nf,"").replace(cO,"!"),e===1200&&o%2&&(n.l+=2)}return n.l&3&&(n.l=n.l>>2+1<<2),r}function H8e(n){var e=n.read_shift(4),t=n.slice(n.l,n.l+e);return n.l+=e,(e&3)>0&&(n.l+=4-(e&3)&3),t}function yOt(n){var e={};return e.Size=n.read_shift(4),n.l+=e.Size+3-(e.Size-1)%4,e}function QG(n,e,t){var r=n.read_shift(2),i,a=t||{};if(n.l+=2,e!==A_e&&r!==e&&qPt.indexOf(e)===-1&&!((e&65534)==4126&&(r&65534)==4126))throw new Error("Expected type "+e+" saw "+r);switch(e===A_e?r:e){case 2:return i=n.read_shift(2,"i"),a.raw||(n.l+=2),i;case 3:return i=n.read_shift(4,"i"),i;case 11:return n.read_shift(4)!==0;case 19:return i=n.read_shift(4),i;case 30:return V8e(n,r,4).replace(Nf,"");case 31:return $8e(n);case 64:return woe(n);case 65:return H8e(n);case 71:return yOt(n);case 80:return xQ(n,r,!a.raw).replace(Nf,"");case 81:return fOt(n,r).replace(Nf,"");case 4108:return gOt(n);case 4126:case 4127:return r==4127?dOt(n):vOt(n);default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+r)}}function P_e(n,e){var t=n.l,r=n.read_shift(4),i=n.read_shift(4),a=[],o=0,s=0,l=-1,u={};for(o=0;o!=i;++o){var h=n.read_shift(4),c=n.read_shift(4);a[o]=[h,c+t]}a.sort(function(y,_){return y[1]-_[1]});var f={};for(o=0;o!=i;++o){if(n.l!==a[o][1]){var d=!0;if(o>0&&e)switch(e[a[o-1][0]].t){case 2:n.l+2===a[o][1]&&(n.l+=2,d=!1);break;case 80:n.l<=a[o][1]&&(n.l=a[o][1],d=!1);break;case 4108:n.l<=a[o][1]&&(n.l=a[o][1],d=!1);break}if((!e||o==0)&&n.l<=a[o][1]&&(d=!1,n.l=a[o][1]),d)throw new Error("Read Error: Expected address "+a[o][1]+" at "+n.l+" :"+o)}if(e){if(a[o][0]==0&&a.length>o+1&&a[o][1]==a[o+1][1])continue;var v=e[a[o][0]];if(f[v.n]=QG(n,v.t,{raw:!0}),v.p==="version"&&(f[v.n]=String(f[v.n]>>16)+"."+("0000"+String(f[v.n]&65535)).slice(-4)),v.n=="CodePage")switch(f[v.n]){case 0:f[v.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:r0(s=f[v.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+f[v.n])}}else if(a[o][0]===1){if(s=f.CodePage=QG(n,Soe),r0(s),l!==-1){var p=n.l;n.l=a[l][1],u=L_e(n,s),n.l=p}}else if(a[o][0]===0){if(s===0){l=o,n.l=a[o+1][1];continue}u=L_e(n,s)}else{var g=u[a[o][0]],m;switch(n[n.l]){case 65:n.l+=4,m=H8e(n);break;case 30:n.l+=4,m=xQ(n,n[n.l-4]).replace(/\u0000+$/,"");break;case 31:n.l+=4,m=xQ(n,n[n.l-4]).replace(/\u0000+$/,"");break;case 3:n.l+=4,m=n.read_shift(4,"i");break;case 19:n.l+=4,m=n.read_shift(4);break;case 5:n.l+=4,m=n.read_shift(8,"f");break;case 11:n.l+=4,m=tu(n,4);break;case 64:n.l+=4,m=pc(woe(n));break;default:throw new Error("unparsed value: "+n[n.l])}f[g]=m}}return n.l=t+r,f}function O_e(n,e,t){var r=n.content;if(!r)return{};eh(r,0);var i,a,o,s,l=0;r.chk("feff","Byte Order: "),r.read_shift(2);var u=r.read_shift(4),h=r.read_shift(16);if(h!==co.utils.consts.HEADER_CLSID&&h!==t)throw new Error("Bad PropertySet CLSID "+h);if(i=r.read_shift(4),i!==1&&i!==2)throw new Error("Unrecognized #Sets: "+i);if(a=r.read_shift(16),s=r.read_shift(4),i===1&&s!==r.l)throw new Error("Length mismatch: "+s+" !== "+r.l);i===2&&(o=r.read_shift(16),l=r.read_shift(4));var c=P_e(r,e),f={SystemIdentifier:u};for(var d in c)f[d]=c[d];if(f.FMTID=a,i===1)return f;if(l-r.l==2&&(r.l+=2),r.l!==l)throw new Error("Length mismatch 2: "+r.l+" !== "+l);var v;try{v=P_e(r,null)}catch{}for(d in v)f[d]=v[d];return f.FMTID=[a,o],f}function cx(n,e){return n.read_shift(e),null}function mOt(n,e,t){for(var r=[],i=n.l+e;n.l<i;)r.push(t(n,i-n.l));if(i!==n.l)throw new Error("Slurp error");return r}function tu(n,e){return n.read_shift(e)===1}function nu(n){return n.read_shift(2,"u")}function j8e(n,e){return mOt(n,e,nu)}function _Ot(n){var e=n.read_shift(1),t=n.read_shift(1);return t===1?e:e===1}function N3(n,e,t){var r=n.read_shift(t&&t.biff>=12?2:1),i="sbcs-cont",a=Mp;if(t&&t.biff>=8&&(Mp=1200),!t||t.biff==8){var o=n.read_shift(1);o&&(i="dbcs-cont")}else t.biff==12&&(i="wstr");t.biff>=2&&t.biff<=5&&(i="cpstr");var s=r?n.read_shift(r,i):"";return Mp=a,s}function xOt(n){var e=Mp;Mp=1200;var t=n.read_shift(2),r=n.read_shift(1),i=r&4,a=r&8,o=1+(r&1),s=0,l,u={};a&&(s=n.read_shift(2)),i&&(l=n.read_shift(4));var h=o==2?"dbcs-cont":"sbcs-cont",c=t===0?"":n.read_shift(t,h);return a&&(n.l+=4*s),i&&(n.l+=l),u.t=c,a||(u.raw="<t>"+u.t+"</t>",u.r=u.t),Mp=e,u}function r2(n,e,t){var r;if(t){if(t.biff>=2&&t.biff<=5)return n.read_shift(e,"cpstr");if(t.biff>=12)return n.read_shift(e,"dbcs-cont")}var i=n.read_shift(1);return i===0?r=n.read_shift(e,"sbcs-cont"):r=n.read_shift(e,"dbcs-cont"),r}function k3(n,e,t){var r=n.read_shift(t&&t.biff==2?1:2);return r===0?(n.l++,""):r2(n,r,t)}function iT(n,e,t){if(t.biff>5)return k3(n,e,t);var r=n.read_shift(1);return r===0?(n.l++,""):n.read_shift(r,t.biff<=4||!n.lens?"cpstr":"sbcs-cont")}function SOt(n){var e=n.read_shift(1);n.l++;var t=n.read_shift(2);return n.l+=2,[e,t]}function wOt(n){var e=n.read_shift(4),t=n.l,r=!1;e>24&&(n.l+=e-24,n.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(r=!0),n.l=t);var i=n.read_shift((r?e-24:e)>>1,"utf16le").replace(Nf,"");return r&&(n.l+=24),i}function bOt(n){for(var e=n.read_shift(2),t="";e-- >0;)t+="../";var r=n.read_shift(0,"lpstr-ansi");if(n.l+=2,n.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var i=n.read_shift(4);if(i===0)return t+r.replace(/\\/g,"/");var a=n.read_shift(4);if(n.read_shift(2)!=3)throw new Error("Bad FileMoniker");var o=n.read_shift(a>>1,"utf16le").replace(Nf,"");return t+o}function EOt(n,e){var t=n.read_shift(16);switch(t){case"e0c9ea79f9bace118c8200aa004ba90b":return wOt(n);case"0303000000000000c000000000000046":return bOt(n);default:throw new Error("Unsupported Moniker "+t)}}function q4(n){var e=n.read_shift(4),t=e>0?n.read_shift(e,"utf16le").replace(Nf,""):"";return t}function TOt(n,e){var t=n.l+e,r=n.read_shift(4);if(r!==2)throw new Error("Unrecognized streamVersion: "+r);var i=n.read_shift(2);n.l+=2;var a,o,s,l,u="",h,c;i&16&&(a=q4(n,t-n.l)),i&128&&(o=q4(n,t-n.l)),(i&257)===257&&(s=q4(n,t-n.l)),(i&257)===1&&(l=EOt(n,t-n.l)),i&8&&(u=q4(n,t-n.l)),i&32&&(h=n.read_shift(16)),i&64&&(c=woe(n)),n.l=t;var f=o||s||l||"";f&&u&&(f+="#"+u),f||(f="#"+u),i&2&&f.charAt(0)=="/"&&f.charAt(1)!="/"&&(f="file://"+f);var d={Target:f};return h&&(d.guid=h),c&&(d.time=c),a&&(d.Tooltip=a),d}function X8e(n){var e=n.read_shift(1),t=n.read_shift(1),r=n.read_shift(1),i=n.read_shift(1);return[e,t,r,i]}function Y8e(n,e){var t=X8e(n);return t[3]=0,t}function Pm(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2);return{r:e,c:t,ixfe:r}}function COt(n){var e=n.read_shift(2),t=n.read_shift(2);return n.l+=8,{type:e,flags:t}}function AOt(n,e,t){return e===0?"":iT(n,e,t)}function MOt(n,e,t){var r=t.biff>8?4:2,i=n.read_shift(r),a=n.read_shift(r,"i"),o=n.read_shift(r,"i");return[i,a,o]}function q8e(n){var e=n.read_shift(2),t=xoe(n);return[e,t]}function IOt(n,e,t){n.l+=4,e-=4;var r=n.l+e,i=N3(n,e,t),a=n.read_shift(2);if(r-=n.l,a!==r)throw new Error("Malformed AddinUdf: padding = "+r+" != "+a);return n.l+=a,i}function AU(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2),i=n.read_shift(2);return{s:{c:r,r:e},e:{c:i,r:t}}}function Z8e(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(1),i=n.read_shift(1);return{s:{c:r,r:e},e:{c:i,r:t}}}var LOt=Z8e;function K8e(n){n.l+=4;var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2);return n.l+=12,[t,e,r]}function POt(n){var e={};return n.l+=4,n.l+=16,e.fSharedNote=n.read_shift(2),n.l+=4,e}function OOt(n){var e={};return n.l+=4,n.cf=n.read_shift(2),e}function Ac(n){n.l+=2,n.l+=n.read_shift(2)}var ROt={0:Ac,4:Ac,5:Ac,6:Ac,7:OOt,8:Ac,9:Ac,10:Ac,11:Ac,12:Ac,13:POt,14:Ac,15:Ac,16:Ac,17:Ac,18:Ac,19:Ac,20:Ac,21:K8e};function DOt(n,e){for(var t=n.l+e,r=[];n.l<t;){var i=n.read_shift(2);n.l-=2;try{r[i]=ROt[i](n,t-n.l)}catch{return n.l=t,r}}return n.l!=t&&(n.l=t),r}function Z4(n,e){var t={BIFFVer:0,dt:0};switch(t.BIFFVer=n.read_shift(2),e-=2,e>=2&&(t.dt=n.read_shift(2),n.l-=2),t.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(e>6)throw new Error("Unexpected BIFF Ver "+t.BIFFVer)}return n.read_shift(e),t}function NOt(n,e){return e===0||n.read_shift(2),1200}function kOt(n,e,t){if(t.enc)return n.l+=e,"";var r=n.l,i=iT(n,0,t);return n.read_shift(e+r-n.l),i}function FOt(n,e,t){var r=t&&t.biff==8||e==2?n.read_shift(2):(n.l+=e,0);return{fDialog:r&16,fBelow:r&64,fRight:r&128}}function BOt(n,e,t){var r=n.read_shift(4),i=n.read_shift(1)&3,a=n.read_shift(1);switch(a){case 0:a="Worksheet";break;case 1:a="Macrosheet";break;case 2:a="Chartsheet";break;case 6:a="VBAModule";break}var o=N3(n,0,t);return o.length===0&&(o="Sheet1"),{pos:r,hs:i,dt:a,name:o}}function GOt(n,e){for(var t=n.l+e,r=n.read_shift(4),i=n.read_shift(4),a=[],o=0;o!=i&&n.l<t;++o)a.push(xOt(n));return a.Count=r,a.Unique=i,a}function zOt(n,e){var t={};return t.dsst=n.read_shift(2),n.l+=e-2,t}function UOt(n){var e={};e.r=n.read_shift(2),e.c=n.read_shift(2),e.cnt=n.read_shift(2)-e.c;var t=n.read_shift(2);n.l+=4;var r=n.read_shift(1);return n.l+=3,r&7&&(e.level=r&7),r&32&&(e.hidden=!0),r&64&&(e.hpt=t/20),e}function VOt(n){var e=COt(n);if(e.type!=2211)throw new Error("Invalid Future Record "+e.type);var t=n.read_shift(4);return t!==0}function $Ot(n){return n.read_shift(2),n.read_shift(4)}function R_e(n,e,t){var r=0;t&&t.biff==2||(r=n.read_shift(2));var i=n.read_shift(2);t&&t.biff==2&&(r=1-(i>>15),i&=32767);var a={Unsynced:r&1,DyZero:(r&2)>>1,ExAsc:(r&4)>>2,ExDsc:(r&8)>>3};return[a,i]}function WOt(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(2),i=n.read_shift(2),a=n.read_shift(2),o=n.read_shift(2),s=n.read_shift(2),l=n.read_shift(2),u=n.read_shift(2);return{Pos:[e,t],Dim:[r,i],Flags:a,CurTab:o,FirstTab:s,Selected:l,TabRatio:u}}function HOt(n,e,t){if(t&&t.biff>=2&&t.biff<5)return{};var r=n.read_shift(2);return{RTL:r&64}}function jOt(){}function XOt(n,e,t){var r={dyHeight:n.read_shift(2),fl:n.read_shift(2)};switch(t&&t.biff||8){case 2:break;case 3:case 4:n.l+=2;break;default:n.l+=10;break}return r.name=N3(n,0,t),r}function YOt(n){var e=Pm(n);return e.isst=n.read_shift(4),e}function qOt(n,e,t){t.biffguess&&t.biff==2&&(t.biff=5);var r=n.l+e,i=Pm(n);t.biff==2&&n.l++;var a=k3(n,r-n.l,t);return i.val=a,i}function ZOt(n,e,t){var r=n.read_shift(2),i=iT(n,0,t);return[r,i]}var KOt=iT;function D_e(n,e,t){var r=n.l+e,i=t.biff==8||!t.biff?4:2,a=n.read_shift(i),o=n.read_shift(i),s=n.read_shift(2),l=n.read_shift(2);return n.l=r,{s:{r:a,c:s},e:{r:o,c:l}}}function JOt(n){var e=n.read_shift(2),t=n.read_shift(2),r=q8e(n);return{r:e,c:t,ixfe:r[0],rknum:r[1]}}function QOt(n,e){for(var t=n.l+e-2,r=n.read_shift(2),i=n.read_shift(2),a=[];n.l<t;)a.push(q8e(n));if(n.l!==t)throw new Error("MulRK read error");var o=n.read_shift(2);if(a.length!=o-i+1)throw new Error("MulRK length mismatch");return{r,c:i,C:o,rkrec:a}}function eRt(n,e){for(var t=n.l+e-2,r=n.read_shift(2),i=n.read_shift(2),a=[];n.l<t;)a.push(n.read_shift(2));if(n.l!==t)throw new Error("MulBlank read error");var o=n.read_shift(2);if(a.length!=o-i+1)throw new Error("MulBlank length mismatch");return{r,c:i,C:o,ixfe:a}}function tRt(n,e,t,r){var i={},a=n.read_shift(4),o=n.read_shift(4),s=n.read_shift(4),l=n.read_shift(2);return i.patternType=JPt[s>>26],r.cellStyles&&(i.alc=a&7,i.fWrap=a>>3&1,i.alcV=a>>4&7,i.fJustLast=a>>7&1,i.trot=a>>8&255,i.cIndent=a>>16&15,i.fShrinkToFit=a>>20&1,i.iReadOrder=a>>22&2,i.fAtrNum=a>>26&1,i.fAtrFnt=a>>27&1,i.fAtrAlc=a>>28&1,i.fAtrBdr=a>>29&1,i.fAtrPat=a>>30&1,i.fAtrProt=a>>31&1,i.dgLeft=o&15,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=s&127,i.icvBottom=s>>7&127,i.icvDiag=s>>14&127,i.dgDiag=s>>21&15,i.icvFore=l&127,i.icvBack=l>>7&127,i.fsxButton=l>>14&1),i}function rRt(n,e,t){var r={};return r.ifnt=n.read_shift(2),r.numFmtId=n.read_shift(2),r.flags=n.read_shift(2),r.fStyle=r.flags>>2&1,e-=6,r.data=tRt(n,e,r.fStyle,t),r}function nRt(n){n.l+=4;var e=[n.read_shift(2),n.read_shift(2)];if(e[0]!==0&&e[0]--,e[1]!==0&&e[1]--,e[0]>7||e[1]>7)throw new Error("Bad Gutters: "+e.join("|"));return e}function N_e(n,e,t){var r=Pm(n);(t.biff==2||e==9)&&++n.l;var i=_Ot(n);return r.val=i,r.t=i===!0||i===!1?"b":"e",r}function iRt(n,e,t){t.biffguess&&t.biff==2&&(t.biff=5);var r=Pm(n),i=Bc(n);return r.val=i,r}var k_e=AOt;function aRt(n,e,t){var r=n.l+e,i=n.read_shift(2),a=n.read_shift(2);if(t.sbcch=a,a==1025||a==14849)return[a,i];if(a<1||a>255)throw new Error("Unexpected SupBook type: "+a);for(var o=r2(n,a),s=[];r>n.l;)s.push(k3(n));return[a,i,o,s]}function F_e(n,e,t){var r=n.read_shift(2),i,a={fBuiltIn:r&1,fWantAdvise:r>>>1&1,fWantPict:r>>>2&1,fOle:r>>>3&1,fOleLink:r>>>4&1,cf:r>>>5&1023,fIcon:r>>>15&1};return t.sbcch===14849&&(i=IOt(n,e-2,t)),a.body=i||n.read_shift(e-2),typeof i=="string"&&(a.Name=i),a}function B_e(n,e,t){var r=n.l+e,i=n.read_shift(2),a=n.read_shift(1),o=n.read_shift(1),s=n.read_shift(t&&t.biff==2?1:2),l=0;(!t||t.biff>=5)&&(t.biff!=5&&(n.l+=2),l=n.read_shift(2),t.biff==5&&(n.l+=2),n.l+=4);var u=r2(n,o,t);i&32&&(u=G8e[u.charCodeAt(0)]);var h=r-n.l;t&&t.biff==2&&--h;var c=r==n.l||s===0||!(h>0)?[]:z3t(n,h,t,s);return{chKey:a,Name:u,itab:l,rgce:c}}function J8e(n,e,t){if(t.biff<8||!(t.biff>8)&&e==n[n.l]+(n[n.l+1]==3?1:0)+1)return G_e(n,e,t);for(var r=[],i=n.l+e,a=n.read_shift(t.biff>8?4:2);a--!==0;)r.push(MOt(n,t.biff>8?12:6,t));if(n.l!=i)throw new Error("Bad ExternSheet: "+n.l+" != "+i);return r}function G_e(n,e,t){n[n.l+1]==3&&n[n.l]++;var r=N3(n,e,t);return r.charCodeAt(0)==3?r.slice(1):r}function oRt(n,e,t){if(t.biff<8){n.l+=e;return}var r=n.read_shift(2),i=n.read_shift(2),a=r2(n,r,t),o=r2(n,i,t);return[a,o]}function sRt(n,e,t){var r=Z8e(n);n.l++;var i=n.read_shift(1);return e-=8,[U3t(n,e,t),i,r]}function z_e(n,e,t){var r=LOt(n);switch(t.biff){case 2:n.l++,e-=7;break;case 3:case 4:n.l+=2,e-=8;break;default:n.l+=6,e-=12}return[r,B3t(n,e,t)]}function lRt(n){var e=n.read_shift(4)!==0,t=n.read_shift(4)!==0,r=n.read_shift(4);return[e,t,r]}function uRt(n,e,t){if(!(t.biff<8)){var r=n.read_shift(2),i=n.read_shift(2),a=n.read_shift(2),o=n.read_shift(2),s=iT(n,0,t);return t.biff<8&&n.read_shift(1),[{r,c:i},s,o,a]}}function hRt(n,e,t){return uRt(n,e,t)}function cRt(n,e){for(var t=[],r=n.read_shift(2);r--;)t.push(AU(n));return t}function fRt(n,e,t){if(t&&t.biff<8)return vRt(n,e,t);var r=K8e(n),i=DOt(n,e-22,r[1]);return{cmo:r,ft:i}}var dRt={8:function(n,e){var t=n.l+e;n.l+=10;var r=n.read_shift(2);n.l+=4,n.l+=2,n.l+=2,n.l+=2,n.l+=4;var i=n.read_shift(1);return n.l+=i,n.l=t,{fmt:r}}};function vRt(n,e,t){n.l+=4;var r=n.read_shift(2),i=n.read_shift(2),a=n.read_shift(2);n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=2,n.l+=6,e-=36;var o=[];return o.push((dRt[r]||Kc)(n,e,t)),{cmo:[i,r,a],ft:o}}function pRt(n,e,t){var r=n.l,i="";try{n.l+=4;var a=(t.lastobj||{cmo:[0,0]}).cmo[1],o;[0,5,7,11,12,14].indexOf(a)==-1?n.l+=6:o=SOt(n,6,t);var s=n.read_shift(2);n.read_shift(2),nu(n,2);var l=n.read_shift(2);n.l+=l;for(var u=1;u<n.lens.length-1;++u){if(n.l-r!=n.lens[u])throw new Error("TxO: bad continue record");var h=n[n.l],c=r2(n,n.lens[u+1]-n.lens[u]-1);if(i+=c,i.length>=(h?s:2*s))break}if(i.length!==s&&i.length!==s*2)throw new Error("cchText: "+s+" != "+i.length);return n.l=r+e,{t:i}}catch{return n.l=r+e,{t:i}}}function gRt(n,e){var t=AU(n);n.l+=16;var r=TOt(n,e-24);return[t,r]}function yRt(n,e){n.read_shift(2);var t=AU(n),r=n.read_shift((e-10)/2,"dbcs-cont");return r=r.replace(Nf,""),[t,r]}function mRt(n){var e=[0,0],t;return t=n.read_shift(2),e[0]=M_e[t]||t,t=n.read_shift(2),e[1]=M_e[t]||t,e}function _Rt(n){for(var e=n.read_shift(2),t=[];e-- >0;)t.push(Y8e(n));return t}function xRt(n){for(var e=n.read_shift(2),t=[];e-- >0;)t.push(Y8e(n));return t}function SRt(n){n.l+=2;var e={cxfs:0,crc:0};return e.cxfs=n.read_shift(2),e.crc=n.read_shift(4),e}function Q8e(n,e,t){if(!t.cellStyles)return Kc(n,e);var r=t&&t.biff>=12?4:2,i=n.read_shift(r),a=n.read_shift(r),o=n.read_shift(r),s=n.read_shift(r),l=n.read_shift(2);r==2&&(n.l+=2);var u={s:i,e:a,w:o,ixfe:s,flags:l};return(t.biff>=5||!t.biff)&&(u.level=l>>8&7),u}function wRt(n,e){var t={};return e<32||(n.l+=16,t.header=Bc(n),t.footer=Bc(n),n.l+=2),t}function bRt(n,e,t){var r={area:!1};if(t.biff!=5)return n.l+=e,r;var i=n.read_shift(1);return n.l+=3,i&16&&(r.area=!0),r}var ERt=Pm,TRt=j8e,CRt=k3;function ARt(n){var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(4),i={fmt:e,env:t,len:r,data:n.slice(n.l,n.l+r)};return n.l+=r,i}function MRt(n,e,t){t.biffguess&&t.biff==5&&(t.biff=2);var r=Pm(n);++n.l;var i=iT(n,e-7,t);return r.t="str",r.val=i,r}function IRt(n){var e=Pm(n);++n.l;var t=Bc(n);return e.t="n",e.val=t,e}function LRt(n){var e=Pm(n);++n.l;var t=n.read_shift(2);return e.t="n",e.val=t,e}function PRt(n){var e=n.read_shift(1);return e===0?(n.l++,""):n.read_shift(e,"sbcs-cont")}function ORt(n,e){n.l+=6,n.l+=2,n.l+=1,n.l+=3,n.l+=1,n.l+=e-13}function RRt(n,e,t){var r=n.l+e,i=Pm(n),a=n.read_shift(2),o=r2(n,a,t);return n.l=r,i.t="str",i.val=o,i}var DRt=[2,3,48,49,131,139,140,245],U_e=function(){var n={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},e=doe({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function t(s,l){var u=[],h=VS(1);switch(l.type){case"base64":h=iv(Tv(s));break;case"binary":h=iv(s);break;case"buffer":case"array":h=s;break}eh(h,0);var c=h.read_shift(1),f=!!(c&136),d=!1,v=!1;switch(c){case 2:break;case 3:break;case 48:d=!0,f=!0;break;case 49:d=!0,f=!0;break;case 131:break;case 139:break;case 140:v=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+c.toString(16))}var p=0,g=521;c==2&&(p=h.read_shift(2)),h.l+=3,c!=2&&(p=h.read_shift(4)),p>1048576&&(p=1e6),c!=2&&(g=h.read_shift(2));var m=h.read_shift(2);l.codepage,c!=2&&(h.l+=16,h.read_shift(1),h[h.l]!==0&&n[h[h.l]],h.l+=1,h.l+=2),v&&(h.l+=36);for(var y=[],_={},x=Math.min(h.length,c==2?521:g-10-(d?264:0)),S=v?32:11;h.l<x&&h[h.l]!=13;)switch(_={},_.name=p_(h.slice(h.l,h.l+S)).replace(/[\u0000\r\n].*$/g,""),h.l+=S,_.type=String.fromCharCode(h.read_shift(1)),c!=2&&!v&&(_.offset=h.read_shift(4)),_.len=h.read_shift(1),c==2&&(_.offset=h.read_shift(2)),_.dec=h.read_shift(1),_.name.length&&y.push(_),c!=2&&(h.l+=v?13:14),_.type){case"B":(!d||_.len!=8)&&l.WTF&&console.log("Skipping "+_.name+":"+_.type);break;case"G":case"P":l.WTF&&console.log("Skipping "+_.name+":"+_.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+_.type)}if(h[h.l]!==13&&(h.l=g-1),h.read_shift(1)!==13)throw new Error("DBF Terminator not found "+h.l+" "+h[h.l]);h.l=g;var w=0,b=0;for(u[0]=[],b=0;b!=y.length;++b)u[0][b]=y[b].name;for(;p-- >0;){if(h[h.l]===42){h.l+=m;continue}for(++h.l,u[++w]=[],b=0,b=0;b!=y.length;++b){var E=h.slice(h.l,h.l+y[b].len);h.l+=y[b].len,eh(E,0);var T=p_(E);switch(y[b].type){case"C":T.trim().length&&(u[w][b]=T.replace(/\s+$/,""));break;case"D":T.length===8?u[w][b]=new Date(+T.slice(0,4),+T.slice(4,6)-1,+T.slice(6,8)):u[w][b]=T;break;case"F":u[w][b]=parseFloat(T.trim());break;case"+":case"I":u[w][b]=v?E.read_shift(-4,"i")^2147483648:E.read_shift(4,"i");break;case"L":switch(T.trim().toUpperCase()){case"Y":case"T":u[w][b]=!0;break;case"N":case"F":u[w][b]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+T+"|")}break;case"M":if(!f)throw new Error("DBF Unexpected MEMO for type "+c.toString(16));u[w][b]="##MEMO##"+(v?parseInt(T.trim(),10):E.read_shift(4));break;case"N":T=T.replace(/\u0000/g,"").trim(),T&&T!="."&&(u[w][b]=+T||0);break;case"@":u[w][b]=new Date(E.read_shift(-8,"f")-621356832e5);break;case"T":u[w][b]=new Date((E.read_shift(4)-2440588)*864e5+E.read_shift(4));break;case"Y":u[w][b]=E.read_shift(4,"i")/1e4+E.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[w][b]=-E.read_shift(-8,"f");break;case"B":if(d&&y[b].len==8){u[w][b]=E.read_shift(8,"f");break}case"G":case"P":E.l+=y[b].len;break;case"0":if(y[b].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+y[b].type)}}}if(c!=2&&h.l<h.length&&h[h.l++]!=26)throw new Error("DBF EOF Marker missing "+(h.l-1)+" of "+h.length+" "+h[h.l-1].toString(16));return l&&l.sheetRows&&(u=u.slice(0,l.sheetRows)),l.DBF=y,u}function r(s,l){var u=l||{};u.dateNF||(u.dateNF="yyyymmdd");var h=HI(t(s,u),u);return h["!cols"]=u.DBF.map(function(c){return{wch:c.len,DBF:c}}),delete u.DBF,h}function i(s,l){try{var u=ww(r(s,l),l);return u.bookType="dbf",u}catch(h){if(l&&l.WTF)throw h}return{SheetNames:[],Sheets:{}}}var a={B:8,C:250,L:1,D:8,"?":0,"":0};function o(s,l){var u=l||{},h=Mp;if(+u.codepage>=0&&r0(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var c=yQ(),f=CQ(s,{header:1,raw:!0,cellDates:!0}),d=f[0],v=f.slice(1),p=s["!cols"]||[],g=0,m=0,y=0,_=1;for(g=0;g<d.length;++g){if(((p[g]||{}).DBF||{}).name){d[g]=p[g].DBF.name,++y;continue}if(d[g]!=null){if(++y,typeof d[g]=="number"&&(d[g]=d[g].toString(10)),typeof d[g]!="string")throw new Error("DBF Invalid column name "+d[g]+" |"+typeof d[g]+"|");if(d.indexOf(d[g])!==g){for(m=0;m<1024;++m)if(d.indexOf(d[g]+"_"+m)==-1){d[g]+="_"+m;break}}}}var x=cu(s["!ref"]),S=[],w=[],b=[];for(g=0;g<=x.e.c-x.s.c;++g){var E="",T="",C=0,A=[];for(m=0;m<v.length;++m)v[m][g]!=null&&A.push(v[m][g]);if(A.length==0||d[g]==null){S[g]="?";continue}for(m=0;m<A.length;++m){switch(typeof A[m]){case"number":T="B";break;case"string":T="C";break;case"boolean":T="L";break;case"object":T=A[m]instanceof Date?"D":"C";break;default:T="C"}C=Math.max(C,String(A[m]).length),E=E&&E!=T?"C":T}C>250&&(C=250),T=((p[g]||{}).DBF||{}).type,T=="C"&&p[g].DBF.len>C&&(C=p[g].DBF.len),E=="B"&&T=="N"&&(E="N",b[g]=p[g].DBF.dec,C=p[g].DBF.len),w[g]=E=="C"||T=="N"?C:a[E]||0,_+=w[g],S[g]=E}var M=c.next(32);for(M.write_shift(4,318902576),M.write_shift(4,v.length),M.write_shift(2,296+32*y),M.write_shift(2,_),g=0;g<4;++g)M.write_shift(4,0);var I=+e[Mp]||3;for(M.write_shift(4,0|I<<8),n[I]!=+u.codepage&&(u.codepage&&console.error("DBF Unsupported codepage "+Mp+", using 1252"),Mp=1252),g=0,m=0;g<d.length;++g)if(d[g]!=null){var R=c.next(32),k=(d[g].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);R.write_shift(1,k,"sbcs"),R.write_shift(1,S[g]=="?"?"C":S[g],"sbcs"),R.write_shift(4,m),R.write_shift(1,w[g]||a[S[g]]||0),R.write_shift(1,b[g]||0),R.write_shift(1,2),R.write_shift(4,0),R.write_shift(1,0),R.write_shift(4,0),R.write_shift(4,0),m+=w[g]||a[S[g]]||0}var D=c.next(264);for(D.write_shift(4,13),g=0;g<65;++g)D.write_shift(4,0);for(g=0;g<v.length;++g){var G=c.next(_);for(G.write_shift(1,0),m=0;m<d.length;++m)if(d[m]!=null)switch(S[m]){case"L":G.write_shift(1,v[g][m]==null?63:v[g][m]?84:70);break;case"B":G.write_shift(8,v[g][m]||0,"f");break;case"N":var W="0";for(typeof v[g][m]=="number"&&(W=v[g][m].toFixed(b[m]||0)),W.length>w[m]&&(W=W.slice(0,w[m])),y=0;y<w[m]-W.length;++y)G.write_shift(1,32);G.write_shift(1,W,"sbcs");break;case"D":v[g][m]?(G.write_shift(4,("0000"+v[g][m].getFullYear()).slice(-4),"sbcs"),G.write_shift(2,("00"+(v[g][m].getMonth()+1)).slice(-2),"sbcs"),G.write_shift(2,("00"+v[g][m].getDate()).slice(-2),"sbcs")):G.write_shift(8,"00000000","sbcs");break;case"C":var z=G.l,V=String(v[g][m]!=null?v[g][m]:"").slice(0,w[m]);for(G.write_shift(1,V,"cpstr"),z+=w[m]-G.l,y=0;y<z;++y)G.write_shift(1,32);break}}return Mp=h,c.next(1).write_shift(1,26),c.end()}return{to_workbook:i,to_sheet:r,from_sheet:o}}(),NRt=function(){var n={AA:"\xC0",BA:"\xC1",CA:"\xC2",DA:195,HA:"\xC4",JA:197,AE:"\xC8",BE:"\xC9",CE:"\xCA",HE:"\xCB",AI:"\xCC",BI:"\xCD",CI:"\xCE",HI:"\xCF",AO:"\xD2",BO:"\xD3",CO:"\xD4",DO:213,HO:"\xD6",AU:"\xD9",BU:"\xDA",CU:"\xDB",HU:"\xDC",Aa:"\xE0",Ba:"\xE1",Ca:"\xE2",Da:227,Ha:"\xE4",Ja:229,Ae:"\xE8",Be:"\xE9",Ce:"\xEA",He:"\xEB",Ai:"\xEC",Bi:"\xED",Ci:"\xEE",Hi:"\xEF",Ao:"\xF2",Bo:"\xF3",Co:"\xF4",Do:245,Ho:"\xF6",Au:"\xF9",Bu:"\xFA",Cu:"\xFB",Hu:"\xFC",KC:"\xC7",Kc:"\xE7",q:"\xE6",z:"\u0153",a:"\xC6",j:"\u0152",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},e=new RegExp("\x1BN("+h0(n).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),t=function(c,f){var d=n[f];return typeof d=="number"?t_e(d):d},r=function(c,f,d){var v=f.charCodeAt(0)-32<<4|d.charCodeAt(0)-48;return v==59?c:t_e(v)};n["|"]=254;function i(c,f){switch(f.type){case"base64":return a(Tv(c),f);case"binary":return a(c,f);case"buffer":return a(oo&&Buffer.isBuffer(c)?c.toString("binary"):p_(c),f);case"array":return a(t2(c),f)}throw new Error("Unrecognized type "+f.type)}function a(c,f){var d=c.split(/[\n\r]+/),v=-1,p=-1,g=0,m=0,y=[],_=[],x=null,S={},w=[],b=[],E=[],T=0,C,A={Workbook:{WBProps:{},Names:[]}};for(+f.codepage>=0&&r0(+f.codepage);g!==d.length;++g){T=0;var M=d[g].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,r).replace(e,t),I=M.replace(/;;/g,"\0").split(";").map(function(se){return se.replace(/\u0000/g,";")}),R=I[0],k;if(M.length>0)switch(R){case"ID":break;case"E":break;case"B":break;case"O":for(m=1;m<I.length;++m)switch(I[m].charAt(0)){case"V":{var D=parseInt(I[m].slice(1),10);D>=1&&D<=4&&(A.Workbook.WBProps.date1904=!0)}break}break;case"W":break;case"P":switch(I[1].charAt(0)){case"P":_.push(M.slice(3).replace(/;;/g,";"));break}break;case"NN":{var G={Sheet:0};for(m=1;m<I.length;++m)switch(I[m].charAt(0)){case"N":G.Name=I[m].slice(1);break;case"E":G.Ref=(f&&f.sheet||"Sheet1")+"!"+DE(I[m].slice(1));break}A.Workbook.Names.push(G)}break;case"C":var W=!1,z=!1,V=!1,q=!1,Y=-1,le=-1,j="",Q="z";for(m=1;m<I.length;++m)switch(I[m].charAt(0)){case"A":break;case"X":p=parseInt(I[m].slice(1),10)-1,z=!0;break;case"Y":for(v=parseInt(I[m].slice(1),10)-1,z||(p=0),C=y.length;C<=v;++C)y[C]=[];break;case"K":k=I[m].slice(1),k.charAt(0)==='"'?(k=k.slice(1,k.length-1),Q="s"):k==="TRUE"||k==="FALSE"?(k=k==="TRUE",Q="b"):isNaN(mv(k))?isNaN(SM(k).getDate())||(k=pc(k),Q="d",f.cellDates||(Q="n",k=Zc(k,A.Workbook.WBProps.date1904))):(k=mv(k),Q="n",x!==null&&Q2(x)&&f.cellDates&&(k=TU(A.Workbook.WBProps.date1904?k+1462:k),Q="d")),W=!0;break;case"E":q=!0,j=DE(I[m].slice(1),{r:v,c:p});break;case"S":V=!0;break;case"G":break;case"R":Y=parseInt(I[m].slice(1),10)-1;break;case"C":le=parseInt(I[m].slice(1),10)-1;break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+M)}if(W&&(y[v][p]?(y[v][p].t=Q,y[v][p].v=k):y[v][p]={t:Q,v:k},x&&(y[v][p].z=x),f.cellText!==!1&&x&&(y[v][p].w=Cv(y[v][p].z,y[v][p].v,{date1904:A.Workbook.WBProps.date1904})),x=null),V){if(q)throw new Error("SYLK shared formula cannot have own formula");var ie=Y>-1&&y[Y][le];if(!ie||!ie[1])throw new Error("SYLK shared formula cannot find base");j=uGe(ie[1],{r:v-Y,c:p-le})}j&&(y[v][p]?y[v][p].f=j:y[v][p]={t:"n",f:j});break;case"F":var oe=0;for(m=1;m<I.length;++m)switch(I[m].charAt(0)){case"X":p=parseInt(I[m].slice(1),10)-1,++oe;break;case"Y":for(v=parseInt(I[m].slice(1),10)-1,C=y.length;C<=v;++C)y[C]=[];break;case"M":T=parseInt(I[m].slice(1),10)/20;break;case"F":break;case"G":break;case"P":x=_[parseInt(I[m].slice(1),10)];break;case"S":break;case"D":break;case"N":break;case"W":for(E=I[m].slice(1).split(" "),C=parseInt(E[0],10);C<=parseInt(E[1],10);++C)T=parseInt(E[2],10),b[C-1]=T===0?{hidden:!0}:{wch:T};break;case"C":p=parseInt(I[m].slice(1),10)-1,b[p]||(b[p]={});break;case"R":v=parseInt(I[m].slice(1),10)-1,w[v]||(w[v]={}),T>0?(w[v].hpt=T,w[v].hpx=RD(T)):T===0&&(w[v].hidden=!0);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+M)}oe<1&&(x=null);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+M)}}return w.length>0&&(S["!rows"]=w),b.length>0&&(S["!cols"]=b),b.forEach(function(se){wM(se)}),f&&f.sheetRows&&(y=y.slice(0,f.sheetRows)),[y,S,A]}function o(c,f){var d=i(c,f),v=d[0],p=d[1],g=d[2],m=sh(f);m.date1904=(((g||{}).Workbook||{}).WBProps||{}).date1904;var y=HI(v,m);h0(p).forEach(function(x){y[x]=p[x]});var _=ww(y,f);return h0(g).forEach(function(x){_[x]=g[x]}),_.bookType="sylk",_}function s(c,f,d,v){var p="C;Y"+(d+1)+";X"+(v+1)+";K";switch(c.t){case"n":p+=c.v||0,c.f&&!c.F&&(p+=";E"+wNt(c.f,{r:d,c:v}));break;case"b":p+=c.v?"TRUE":"FALSE";break;case"e":p+=c.w||c.v;break;case"d":p+='"'+(c.w||c.v)+'"';break;case"s":p+='"'+(c.v==null?"":String(c.v)).replace(/"/g,"").replace(/;/g,";;")+'"';break}return p}function l(c,f){f.forEach(function(d,v){var p="F;W"+(v+1)+" "+(v+1)+" ";d.hidden?p+="0":(typeof d.width=="number"&&!d.wpx&&(d.wpx=t9(d.width)),typeof d.wpx=="number"&&!d.wch&&(d.wch=r9(d.wpx)),typeof d.wch=="number"&&(p+=Math.round(d.wch))),p.charAt(p.length-1)!=" "&&c.push(p)})}function u(c,f){f.forEach(function(d,v){var p="F;";d.hidden?p+="M0;":d.hpt?p+="M"+20*d.hpt+";":d.hpx&&(p+="M"+20*oGe(d.hpx)+";"),p.length>2&&c.push(p+"R"+(v+1))})}function h(c,f,d){var v=["ID;PSheetJS;N;E"],p=[],g=cu(c["!ref"]),m,y=c["!data"]!=null,_=`\r
`,x=(((d||{}).Workbook||{}).WBProps||{}).date1904;v.push("P;PGeneral"),v.push("F;P0;DG0G8;M255"),c["!cols"]&&l(v,c["!cols"]),c["!rows"]&&u(v,c["!rows"]),v.push("B;Y"+(g.e.r-g.s.r+1)+";X"+(g.e.c-g.s.c+1)+";D"+[g.s.c,g.s.r,g.e.c,g.e.r].join(" ")),v.push("O;L;D;B"+(x?";V4":"")+";K47;G100 0.001");for(var S=g.s.r;S<=g.e.r;++S)if(!(y&&!c["!data"][S])){for(var w=[],b=g.s.c;b<=g.e.c;++b)m=y?c["!data"][S][b]:c[$o(b)+ys(S)],!(!m||m.v==null&&(!m.f||m.F))&&w.push(s(m,c,S,b));p.push(w.join(_))}return v.join(_)+_+p.join(_)+_+"E"+_}return{to_workbook:o,from_sheet:h}}(),kRt=function(){function n(s,l){switch(l.type){case"base64":return e(Tv(s),l);case"binary":return e(s,l);case"buffer":return e(oo&&Buffer.isBuffer(s)?s.toString("binary"):p_(s),l);case"array":return e(t2(s),l)}throw new Error("Unrecognized type "+l.type)}function e(s,l){for(var u=s.split(`
`),h=-1,c=-1,f=0,d=[];f!==u.length;++f){if(u[f].trim()==="BOT"){d[++h]=[],c=0;continue}if(!(h<0)){var v=u[f].trim().split(","),p=v[0],g=v[1];++f;for(var m=u[f]||"";(m.match(/["]/g)||[]).length&1&&f<u.length-1;)m+=`
`+u[++f];switch(m=m.trim(),+p){case-1:if(m==="BOT"){d[++h]=[],c=0;continue}else if(m!=="EOD")throw new Error("Unrecognized DIF special command "+m);break;case 0:m==="TRUE"?d[h][c]=!0:m==="FALSE"?d[h][c]=!1:isNaN(mv(g))?isNaN(SM(g).getDate())?d[h][c]=g:d[h][c]=pc(g):d[h][c]=mv(g),++c;break;case 1:m=m.slice(1,m.length-1),m=m.replace(/""/g,'"'),m&&m.match(/^=".*"$/)&&(m=m.slice(2,-1)),d[h][c++]=m!==""?m:null;break}if(m==="EOD")break}}return l&&l.sheetRows&&(d=d.slice(0,l.sheetRows)),d}function t(s,l){return HI(n(s,l),l)}function r(s,l){var u=ww(t(s,l),l);return u.bookType="dif",u}function i(s,l){return"0,"+String(s)+`\r
`+l}function a(s){return`1,0\r
"`+s.replace(/"/g,'""')+'"'}function o(s){for(var l=cu(s["!ref"]),u=s["!data"]!=null,h=[`TABLE\r
0,1\r
"sheetjs"\r
`,`VECTORS\r
0,`+(l.e.r-l.s.r+1)+`\r
""\r
`,`TUPLES\r
0,`+(l.e.c-l.s.c+1)+`\r
""\r
`,`DATA\r
0,0\r
""\r
`],c=l.s.r;c<=l.e.r;++c){for(var f=u?s["!data"][c]:[],d=`-1,0\r
BOT\r
`,v=l.s.c;v<=l.e.c;++v){var p=u?f&&f[v]:s[bo({r:c,c:v})];if(p==null){d+=`1,0\r
""\r
`;continue}switch(p.t){case"n":p.w!=null?d+="0,"+p.w+`\r
V`:p.v!=null?d+=i(p.v,"V"):p.f!=null&&!p.F?d+=a("="+p.f):d+=`1,0\r
""`;break;case"b":d+=p.v?i(1,"TRUE"):i(0,"FALSE");break;case"s":d+=a(isNaN(+p.v)?p.v:'="'+p.v+'"');break;case"d":p.w||(p.w=Cv(p.z||ji[14],Zc(pc(p.v)))),d+=i(p.w,"V");break;default:d+=`1,0\r
""`}d+=`\r
`}h.push(d)}return h.join("")+`-1,0\r
EOD`}return{to_workbook:r,to_sheet:t,from_sheet:o}}(),FRt=function(){function n(c){return c.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
`)}function e(c){return c.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function t(c,f){for(var d=c.split(`
`),v=-1,p=-1,g=0,m=[];g!==d.length;++g){var y=d[g].trim().split(":");if(y[0]==="cell"){var _=zc(y[1]);if(m.length<=_.r)for(v=m.length;v<=_.r;++v)m[v]||(m[v]=[]);switch(v=_.r,p=_.c,y[2]){case"t":m[v][p]=n(y[3]);break;case"v":m[v][p]=+y[3];break;case"vtf":var x=y[y.length-1];case"vtc":switch(y[3]){case"nl":m[v][p]=!!+y[4];break;default:m[v][p]=+y[4];break}y[2]=="vtf"&&(m[v][p]=[m[v][p],x])}}}return f&&f.sheetRows&&(m=m.slice(0,f.sheetRows)),m}function r(c,f){return HI(t(c,f),f)}function i(c,f){return ww(r(c,f),f)}var a=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
`),o=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
`)+`
`,s=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
`),l="--SocialCalcSpreadsheetControlSave--";function u(c){if(!c||!c["!ref"])return"";for(var f=[],d=[],v,p="",g=eT(c["!ref"]),m=c["!data"]!=null,y=g.s.r;y<=g.e.r;++y)for(var _=g.s.c;_<=g.e.c;++_)if(p=bo({r:y,c:_}),v=m?(c["!data"][y]||[])[_]:c[p],!(!v||v.v==null||v.t==="z")){switch(d=["cell",p,"t"],v.t){case"s":case"str":d.push(e(v.v));break;case"n":v.f?(d[2]="vtf",d[3]="n",d[4]=v.v,d[5]=e(v.f)):(d[2]="v",d[3]=v.v);break;case"b":d[2]="vt"+(v.f?"f":"c"),d[3]="nl",d[4]=v.v?"1":"0",d[5]=e(v.f||(v.v?"TRUE":"FALSE"));break;case"d":var x=Zc(pc(v.v));d[2]="vtc",d[3]="nd",d[4]=""+x,d[5]=v.w||Cv(v.z||ji[14],x);break;case"e":continue}f.push(d.join(":"))}return f.push("sheet:c:"+(g.e.c-g.s.c+1)+":r:"+(g.e.r-g.s.r+1)+":tvf:1"),f.push("valueformat:1:text-wiki"),f.join(`
`)}function h(c){return[a,o,s,o,u(c),l].join(`
`)}return{to_workbook:i,to_sheet:r,from_sheet:h}}(),PD=function(){function n(h,c,f,d,v){v.raw?c[f][d]=h:h===""||(h==="TRUE"?c[f][d]=!0:h==="FALSE"?c[f][d]=!1:isNaN(mv(h))?isNaN(SM(h).getDate())?c[f][d]=h:c[f][d]=pc(h):c[f][d]=mv(h))}function e(h,c){var f=c||{},d=[];if(!h||h.length===0)return d;for(var v=h.split(/[\r\n]/),p=v.length-1;p>=0&&v[p].length===0;)--p;for(var g=10,m=0,y=0;y<=p;++y)m=v[y].indexOf(" "),m==-1?m=v[y].length:m++,g=Math.max(g,m);for(y=0;y<=p;++y){d[y]=[];var _=0;for(n(v[y].slice(0,g).trim(),d,y,_,f),_=1;_<=(v[y].length-g)/10+1;++_)n(v[y].slice(g+(_-1)*10,g+_*10).trim(),d,y,_,f)}return f.sheetRows&&(d=d.slice(0,f.sheetRows)),d}var t={44:",",9:" ",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function i(h){for(var c={},f=!1,d=0,v=0;d<h.length;++d)(v=h.charCodeAt(d))==34?f=!f:!f&&v in t&&(c[v]=(c[v]||0)+1);v=[];for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&v.push([c[d],d]);if(!v.length){c=r;for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&v.push([c[d],d])}return v.sort(function(p,g){return p[0]-g[0]||r[p[1]]-r[g[1]]}),t[v.pop()[1]]||44}function a(h,c){var f=c||{},d="",v={};f.dense&&(v["!data"]=[]);var p={s:{c:0,r:0},e:{c:0,r:0}};h.slice(0,4)=="sep="?h.charCodeAt(5)==13&&h.charCodeAt(6)==10?(d=h.charAt(4),h=h.slice(7)):h.charCodeAt(5)==13||h.charCodeAt(5)==10?(d=h.charAt(4),h=h.slice(6)):d=i(h.slice(0,1024)):f&&f.FS?d=f.FS:d=i(h.slice(0,1024));var g=0,m=0,y=0,_=0,x=0,S=d.charCodeAt(0),w=!1,b=0,E=h.charCodeAt(0),T=f.dateNF!=null?XLt(f.dateNF):null;function C(){var A=h.slice(_,x);A.slice(-1)=="\r"&&(A=A.slice(0,-1));var M={};if(A.charAt(0)=='"'&&A.charAt(A.length-1)=='"'&&(A=A.slice(1,-1).replace(/""/g,'"')),A.length===0)M.t="z";else if(f.raw)M.t="s",M.v=A;else if(A.trim().length===0)M.t="s",M.v=A;else if(A.charCodeAt(0)==61)A.charCodeAt(1)==34&&A.charCodeAt(A.length-1)==34?(M.t="s",M.v=A.slice(2,-1).replace(/""/g,'"')):ENt(A)?(M.t="n",M.f=A.slice(1)):(M.t="s",M.v=A);else if(A=="TRUE")M.t="b",M.v=!0;else if(A=="FALSE")M.t="b",M.v=!1;else if(!isNaN(y=mv(A)))M.t="n",f.cellText!==!1&&(M.w=A),M.v=y;else if(!isNaN((y=SM(A)).getDate())||T&&A.match(T)){M.z=f.dateNF||ji[14];var I=0;T&&A.match(T)&&(A=YLt(A,f.dateNF,A.match(T)||[]),I=1,y=pc(A,I)),f.cellDates?(M.t="d",M.v=y):(M.t="n",M.v=Zc(y)),f.cellText!==!1&&(M.w=Cv(M.z,M.v instanceof Date?Zc(M.v):M.v)),f.cellNF||delete M.z}else M.t="s",M.v=A;if(M.t=="z"||(f.dense?(v["!data"][g]||(v["!data"][g]=[]),v["!data"][g][m]=M):v[bo({c:m,r:g})]=M),_=x+1,E=h.charCodeAt(_),p.e.c<m&&(p.e.c=m),p.e.r<g&&(p.e.r=g),b==S)++m;else if(m=0,++g,f.sheetRows&&f.sheetRows<=g)return!0}e:for(;x<h.length;++x)switch(b=h.charCodeAt(x)){case 34:E===34&&(w=!w);break;case 13:if(w)break;h.charCodeAt(x+1)==10&&++x;case S:case 10:if(!w&&C())break e;break}return x-_>0&&C(),v["!ref"]=lo(p),v}function o(h,c){return!(c&&c.PRN)||c.FS||h.slice(0,4)=="sep="||h.indexOf(" ")>=0||h.indexOf(",")>=0||h.indexOf(";")>=0?a(h,c):HI(e(h,c),c)}function s(h,c){var f="",d=c.type=="string"?[0,0,0,0]:Ioe(h,c);switch(c.type){case"base64":f=Tv(h);break;case"binary":f=h;break;case"buffer":c.codepage==65001?f=h.toString("utf8"):c.codepage&&typeof $C<"u"?f=$C.utils.decode(c.codepage,h):f=oo&&Buffer.isBuffer(h)?h.toString("binary"):p_(h);break;case"array":f=t2(h);break;case"string":f=h;break;default:throw new Error("Unrecognized type "+c.type)}return d[0]==239&&d[1]==187&&d[2]==191?f=As(f.slice(3)):c.type!="string"&&c.type!="buffer"&&c.codepage==65001?f=As(f):c.type=="binary"&&typeof $C<"u"&&c.codepage&&(f=$C.utils.decode(c.codepage,$C.utils.encode(28591,f))),f.slice(0,19)=="socialcalc:version:"?FRt.to_sheet(c.type=="string"?f:As(f),c):o(f,c)}function l(h,c){return ww(s(h,c),c)}function u(h){for(var c=[],f=cu(h["!ref"]),d,v=h["!data"]!=null,p=f.s.r;p<=f.e.r;++p){for(var g=[],m=f.s.c;m<=f.e.c;++m){var y=bo({r:p,c:m});if(d=v?(h["!data"][p]||[])[m]:h[y],!d||d.v==null){g.push(" ");continue}for(var _=(d.w||($S(d),d.w)||"").slice(0,10);_.length<10;)_+=" ";g.push(_+(m===0?" ":""))}c.push(g.join(""))}return c.join(`
`)}return{to_workbook:l,to_sheet:s,from_sheet:u}}();function BRt(n,e){var t=e||{},r=!!t.WTF;t.WTF=!0;try{var i=NRt.to_workbook(n,t);return t.WTF=r,i}catch(a){if(t.WTF=r,!a.message.match(/SYLK bad record ID/)&&r)throw a;return PD.to_workbook(n,e)}}var hR=function(){function n(j,Q,ie){if(!!j){eh(j,j.l||0);for(var oe=ie.Enum||q;j.l<j.length;){var se=j.read_shift(2),me=oe[se]||oe[65535],Ce=j.read_shift(2),Le=j.l+Ce,re=me.f&&me.f(j,Ce,ie);if(j.l=Le,Q(re,me,se))return}}}function e(j,Q){switch(Q.type){case"base64":return t(iv(Tv(j)),Q);case"binary":return t(iv(j),Q);case"buffer":case"array":return t(j,Q)}throw"Unsupported type "+Q.type}function t(j,Q){if(!j)return j;var ie=Q||{},oe={},se="Sheet1",me="",Ce=0,Le={},re=[],yt=[],je=[];ie.dense&&(je=oe["!data"]=[]);var st={s:{r:0,c:0},e:{r:0,c:0}},Nt=ie.sheetRows||0;if(j[4]==81&&j[5]==80&&j[6]==87)return le(j,Q);if(j[2]==0&&(j[3]==8||j[3]==9)&&j.length>=16&&j[14]==5&&j[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(j[2]==2)ie.Enum=q,n(j,function(Dt,ft,Oe){switch(Oe){case 0:ie.vers=Dt,Dt>=4096&&(ie.qpro=!0);break;case 255:ie.vers=Dt,ie.works=!0;break;case 6:st=Dt;break;case 204:Dt&&(me=Dt);break;case 222:me=Dt;break;case 15:case 51:(!ie.qpro&&!ie.works||Oe==51)&&Dt[1].v.charCodeAt(0)<48&&(Dt[1].v=Dt[1].v.slice(1)),(ie.works||ie.works2)&&(Dt[1].v=Dt[1].v.replace(/\r\n/g,`
`));case 13:case 14:case 16:Oe==14&&(Dt[2]&112)==112&&(Dt[2]&15)>1&&(Dt[2]&15)<15&&(Dt[1].z=ie.dateNF||ji[14],ie.cellDates&&(Dt[1].t="d",Dt[1].v=TU(Dt[1].v))),ie.qpro&&Dt[3]>Ce&&(oe["!ref"]=lo(st),Le[se]=oe,re.push(se),oe={},ie.dense&&(je=oe["!data"]=[]),st={s:{r:0,c:0},e:{r:0,c:0}},Ce=Dt[3],se=me||"Sheet"+(Ce+1),me="");var J=ie.dense?(je[Dt[0].r]||[])[Dt[0].c]:oe[bo(Dt[0])];if(J){J.t=Dt[1].t,J.v=Dt[1].v,Dt[1].z!=null&&(J.z=Dt[1].z),Dt[1].f!=null&&(J.f=Dt[1].f);break}ie.dense?(je[Dt[0].r]||(je[Dt[0].r]=[]),je[Dt[0].r][Dt[0].c]=Dt[1]):oe[bo(Dt[0])]=Dt[1];break;case 21509:ie.works2=!0;break}},ie);else if(j[2]==26||j[2]==14)ie.Enum=Y,j[2]==14&&(ie.qpro=!0,j.l=0),n(j,function(Dt,ft,Oe){switch(Oe){case 204:se=Dt;break;case 22:Dt[1].v.charCodeAt(0)<48&&(Dt[1].v=Dt[1].v.slice(1)),Dt[1].v=Dt[1].v.replace(/\x0F./g,function(J){return String.fromCharCode(J.charCodeAt(1)-32)}).replace(/\r\n/g,`
`);case 23:case 24:case 25:case 37:case 39:case 40:if(Dt[3]>Ce&&(oe["!ref"]=lo(st),Le[se]=oe,re.push(se),oe={},ie.dense&&(je=oe["!data"]=[]),st={s:{r:0,c:0},e:{r:0,c:0}},Ce=Dt[3],se="Sheet"+(Ce+1)),Nt>0&&Dt[0].r>=Nt)break;ie.dense?(je[Dt[0].r]||(je[Dt[0].r]=[]),je[Dt[0].r][Dt[0].c]=Dt[1]):oe[bo(Dt[0])]=Dt[1],st.e.c<Dt[0].c&&(st.e.c=Dt[0].c),st.e.r<Dt[0].r&&(st.e.r=Dt[0].r);break;case 27:Dt[14e3]&&(yt[Dt[14e3][0]]=Dt[14e3][1]);break;case 1537:yt[Dt[0]]=Dt[1],Dt[0]==Ce&&(se=Dt[1]);break}},ie);else throw new Error("Unrecognized LOTUS BOF "+j[2]);if(oe["!ref"]=lo(st),Le[me||se]=oe,re.push(me||se),!yt.length)return{SheetNames:re,Sheets:Le};for(var Zt={},qe=[],ur=0;ur<yt.length;++ur)Le[re[ur]]?(qe.push(yt[ur]||re[ur]),Zt[yt[ur]]=Le[yt[ur]]||Le[re[ur]]):(qe.push(yt[ur]),Zt[yt[ur]]={"!ref":"A1"});return{SheetNames:qe,Sheets:Zt}}function r(j,Q){var ie=Q||{};if(+ie.codepage>=0&&r0(+ie.codepage),ie.type=="string")throw new Error("Cannot write WK1 to JS string");var oe=yQ(),se=cu(j["!ref"]),me=j["!data"]!=null,Ce=[];Ag(oe,0,a(1030)),Ag(oe,6,l(se));for(var Le=Math.min(se.e.r,8191),re=se.s.c;re<=se.e.c;++re)Ce[re]=$o(re);for(var yt=se.s.r;yt<=Le;++yt){var je=ys(yt);for(re=se.s.c;re<=se.e.c;++re){var st=me?(j["!data"][yt]||[])[re]:j[Ce[re]+je];if(!(!st||st.t=="z"))if(st.t=="n")(st.v|0)==st.v&&st.v>=-32768&&st.v<=32767?Ag(oe,13,v(yt,re,st.v)):Ag(oe,14,g(yt,re,st.v));else{var Nt=$S(st);Ag(oe,15,c(yt,re,Nt.slice(0,239)))}}}return Ag(oe,1),oe.end()}function i(j,Q){var ie=Q||{};if(+ie.codepage>=0&&r0(+ie.codepage),ie.type=="string")throw new Error("Cannot write WK3 to JS string");var oe=yQ();Ag(oe,0,o(j));for(var se=0,me=0;se<j.SheetNames.length;++se)(j.Sheets[j.SheetNames[se]]||{})["!ref"]&&Ag(oe,27,V(j.SheetNames[se],me++));var Ce=0;for(se=0;se<j.SheetNames.length;++se){var Le=j.Sheets[j.SheetNames[se]];if(!(!Le||!Le["!ref"])){for(var re=cu(Le["!ref"]),yt=Le["!data"]!=null,je=[],st=Math.min(re.e.r,8191),Nt=re.s.r;Nt<=st;++Nt)for(var Zt=ys(Nt),qe=re.s.c;qe<=re.e.c;++qe){Nt===re.s.r&&(je[qe]=$o(qe));var ur=je[qe]+Zt,Dt=yt?(Le["!data"][Nt]||[])[qe]:Le[ur];if(!(!Dt||Dt.t=="z"))if(Dt.t=="n")Ag(oe,23,A(Nt,qe,Ce,Dt.v));else{var ft=$S(Dt);Ag(oe,22,E(Nt,qe,Ce,ft.slice(0,239)))}}++Ce}}return Ag(oe,1),oe.end()}function a(j){var Q=Ku(2);return Q.write_shift(2,j),Q}function o(j){var Q=Ku(26);Q.write_shift(2,4096),Q.write_shift(2,4),Q.write_shift(4,0);for(var ie=0,oe=0,se=0,me=0;me<j.SheetNames.length;++me){var Ce=j.SheetNames[me],Le=j.Sheets[Ce];if(!(!Le||!Le["!ref"])){++se;var re=eT(Le["!ref"]);ie<re.e.r&&(ie=re.e.r),oe<re.e.c&&(oe=re.e.c)}}return ie>8191&&(ie=8191),Q.write_shift(2,ie),Q.write_shift(1,se),Q.write_shift(1,oe),Q.write_shift(2,0),Q.write_shift(2,0),Q.write_shift(1,1),Q.write_shift(1,2),Q.write_shift(4,0),Q.write_shift(4,0),Q}function s(j,Q,ie){var oe={s:{c:0,r:0},e:{c:0,r:0}};return Q==8&&ie.qpro?(oe.s.c=j.read_shift(1),j.l++,oe.s.r=j.read_shift(2),oe.e.c=j.read_shift(1),j.l++,oe.e.r=j.read_shift(2),oe):(oe.s.c=j.read_shift(2),oe.s.r=j.read_shift(2),Q==12&&ie.qpro&&(j.l+=2),oe.e.c=j.read_shift(2),oe.e.r=j.read_shift(2),Q==12&&ie.qpro&&(j.l+=2),oe.s.c==65535&&(oe.s.c=oe.e.c=oe.s.r=oe.e.r=0),oe)}function l(j){var Q=Ku(8);return Q.write_shift(2,j.s.c),Q.write_shift(2,j.s.r),Q.write_shift(2,j.e.c),Q.write_shift(2,j.e.r),Q}function u(j,Q,ie){var oe=[{c:0,r:0},{t:"n",v:0},0,0];return ie.qpro&&ie.vers!=20768?(oe[0].c=j.read_shift(1),oe[3]=j.read_shift(1),oe[0].r=j.read_shift(2),j.l+=2):ie.works?(oe[0].c=j.read_shift(2),oe[0].r=j.read_shift(2),oe[2]=j.read_shift(2)):(oe[2]=j.read_shift(1),oe[0].c=j.read_shift(2),oe[0].r=j.read_shift(2)),oe}function h(j,Q,ie){var oe=j.l+Q,se=u(j,Q,ie);if(se[1].t="s",ie.vers==20768){j.l++;var me=j.read_shift(1);return se[1].v=j.read_shift(me,"utf8"),se}return ie.qpro&&j.l++,se[1].v=j.read_shift(oe-j.l,"cstr"),se}function c(j,Q,ie){var oe=Ku(7+ie.length);oe.write_shift(1,255),oe.write_shift(2,Q),oe.write_shift(2,j),oe.write_shift(1,39);for(var se=0;se<oe.length;++se){var me=ie.charCodeAt(se);oe.write_shift(1,me>=128?95:me)}return oe.write_shift(1,0),oe}function f(j,Q,ie){var oe=j.l+Q,se=u(j,Q,ie);if(se[1].t="s",ie.vers==20768){var me=j.read_shift(1);return se[1].v=j.read_shift(me,"utf8"),se}return se[1].v=j.read_shift(oe-j.l,"cstr"),se}function d(j,Q,ie){var oe=u(j,Q,ie);return oe[1].v=j.read_shift(2,"i"),oe}function v(j,Q,ie){var oe=Ku(7);return oe.write_shift(1,255),oe.write_shift(2,Q),oe.write_shift(2,j),oe.write_shift(2,ie,"i"),oe}function p(j,Q,ie){var oe=u(j,Q,ie);return oe[1].v=j.read_shift(8,"f"),oe}function g(j,Q,ie){var oe=Ku(13);return oe.write_shift(1,255),oe.write_shift(2,Q),oe.write_shift(2,j),oe.write_shift(8,ie,"f"),oe}function m(j,Q,ie){var oe=j.l+Q,se=u(j,Q,ie);if(se[1].v=j.read_shift(8,"f"),ie.qpro)j.l=oe;else{var me=j.read_shift(2);S(j.slice(j.l,j.l+me),se),j.l+=me}return se}function y(j,Q,ie){var oe=Q&32768;return Q&=-32769,Q=(oe?j:0)+(Q>=8192?Q-16384:Q),(oe?"":"$")+(ie?$o(Q):ys(Q))}var _={31:["NA",0],33:["ABS",1],34:["TRUNC",1],35:["SQRT",1],36:["LOG",1],37:["LN",1],38:["PI",0],39:["SIN",1],40:["COS",1],41:["TAN",1],42:["ATAN2",2],43:["ATAN",1],44:["ASIN",1],45:["ACOS",1],46:["EXP",1],47:["MOD",2],49:["ISNA",1],50:["ISERR",1],51:["FALSE",0],52:["TRUE",0],53:["RAND",0],63:["ROUND",2],68:["ISNUMBER",1],69:["ISTEXT",1],70:["LEN",1],71:["VALUE",1],73:["MID",3],74:["CHAR",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],102:["UPPER",1],103:["LOWER",1],107:["PROPER",1],109:["TRIM",1],111:["T",1]},x=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function S(j,Q){eh(j,0);for(var ie=[],oe=0,se="",me="",Ce="",Le="";j.l<j.length;){var re=j[j.l++];switch(re){case 0:ie.push(j.read_shift(8,"f"));break;case 1:me=y(Q[0].c,j.read_shift(2),!0),se=y(Q[0].r,j.read_shift(2),!1),ie.push(me+se);break;case 2:{var yt=y(Q[0].c,j.read_shift(2),!0),je=y(Q[0].r,j.read_shift(2),!1);me=y(Q[0].c,j.read_shift(2),!0),se=y(Q[0].r,j.read_shift(2),!1),ie.push(yt+je+":"+me+se)}break;case 3:if(j.l<j.length){console.error("WK1 premature formula end");return}break;case 4:ie.push("("+ie.pop()+")");break;case 5:ie.push(j.read_shift(2));break;case 6:{for(var st="";re=j[j.l++];)st+=String.fromCharCode(re);ie.push('"'+st.replace(/"/g,'""')+'"')}break;case 8:ie.push("-"+ie.pop());break;case 23:ie.push("+"+ie.pop());break;case 22:ie.push("NOT("+ie.pop()+")");break;case 20:case 21:Le=ie.pop(),Ce=ie.pop(),ie.push(["AND","OR"][re-20]+"("+Ce+","+Le+")");break;default:if(re<32&&x[re])Le=ie.pop(),Ce=ie.pop(),ie.push(Ce+x[re]+Le);else if(_[re]){if(oe=_[re][1],oe==69&&(oe=j[j.l++]),oe>ie.length){console.error("WK1 bad formula parse 0x"+re.toString(16)+":|"+ie.join("|")+"|");return}var Nt=ie.slice(-oe);ie.length-=oe,ie.push(_[re][0]+"("+Nt.join(",")+")")}else return re<=7?console.error("WK1 invalid opcode "+re.toString(16)):re<=24?console.error("WK1 unsupported op "+re.toString(16)):re<=30?console.error("WK1 invalid opcode "+re.toString(16)):re<=115?console.error("WK1 unsupported function opcode "+re.toString(16)):console.error("WK1 unrecognized opcode "+re.toString(16))}}ie.length==1?Q[1].f=""+ie[0]:console.error("WK1 bad formula parse |"+ie.join("|")+"|")}function w(j){var Q=[{c:0,r:0},{t:"n",v:0},0];return Q[0].r=j.read_shift(2),Q[3]=j[j.l++],Q[0].c=j[j.l++],Q}function b(j,Q){var ie=w(j);return ie[1].t="s",ie[1].v=j.read_shift(Q-4,"cstr"),ie}function E(j,Q,ie,oe){var se=Ku(6+oe.length);se.write_shift(2,j),se.write_shift(1,ie),se.write_shift(1,Q),se.write_shift(1,39);for(var me=0;me<oe.length;++me){var Ce=oe.charCodeAt(me);se.write_shift(1,Ce>=128?95:Ce)}return se.write_shift(1,0),se}function T(j,Q){var ie=w(j);ie[1].v=j.read_shift(2);var oe=ie[1].v>>1;if(ie[1].v&1)switch(oe&7){case 0:oe=(oe>>3)*5e3;break;case 1:oe=(oe>>3)*500;break;case 2:oe=(oe>>3)/20;break;case 3:oe=(oe>>3)/200;break;case 4:oe=(oe>>3)/2e3;break;case 5:oe=(oe>>3)/2e4;break;case 6:oe=(oe>>3)/16;break;case 7:oe=(oe>>3)/64;break}return ie[1].v=oe,ie}function C(j,Q){var ie=w(j),oe=j.read_shift(4),se=j.read_shift(4),me=j.read_shift(2);if(me==65535)return oe===0&&se===3221225472?(ie[1].t="e",ie[1].v=15):oe===0&&se===3489660928?(ie[1].t="e",ie[1].v=42):ie[1].v=0,ie;var Ce=me&32768;return me=(me&32767)-16446,ie[1].v=(1-Ce*2)*(se*Math.pow(2,me+32)+oe*Math.pow(2,me)),ie}function A(j,Q,ie,oe){var se=Ku(14);if(se.write_shift(2,j),se.write_shift(1,ie),se.write_shift(1,Q),oe==0)return se.write_shift(4,0),se.write_shift(4,0),se.write_shift(2,65535),se;var me=0,Ce=0,Le=0,re=0;return oe<0&&(me=1,oe=-oe),Ce=Math.log2(oe)|0,oe/=Math.pow(2,Ce-31),re=oe>>>0,(re&2147483648)==0&&(oe/=2,++Ce,re=oe>>>0),oe-=re,re|=2147483648,re>>>=0,oe*=Math.pow(2,32),Le=oe>>>0,se.write_shift(4,Le),se.write_shift(4,re),Ce+=16383+(me?32768:0),se.write_shift(2,Ce),se}function M(j,Q){var ie=C(j);return j.l+=Q-14,ie}function I(j,Q){var ie=w(j),oe=j.read_shift(4);return ie[1].v=oe>>6,ie}function R(j,Q){var ie=w(j),oe=j.read_shift(8,"f");return ie[1].v=oe,ie}function k(j,Q){var ie=R(j);return j.l+=Q-12,ie}function D(j,Q){return j[j.l+Q-1]==0?j.read_shift(Q,"cstr"):""}function G(j,Q){var ie=j[j.l++];ie>Q-1&&(ie=Q-1);for(var oe="";oe.length<ie;)oe+=String.fromCharCode(j[j.l++]);return oe}function W(j,Q,ie){if(!(!ie.qpro||Q<21)){var oe=j.read_shift(1);j.l+=17,j.l+=1,j.l+=2;var se=j.read_shift(Q-21,"cstr");return[oe,se]}}function z(j,Q){for(var ie={},oe=j.l+Q;j.l<oe;){var se=j.read_shift(2);if(se==14e3){for(ie[se]=[0,""],ie[se][0]=j.read_shift(2);j[j.l];)ie[se][1]+=String.fromCharCode(j[j.l]),j.l++;j.l++}}return ie}function V(j,Q){var ie=Ku(5+j.length);ie.write_shift(2,14e3),ie.write_shift(2,Q);for(var oe=0;oe<j.length;++oe){var se=j.charCodeAt(oe);ie[ie.l++]=se>127?95:se}return ie[ie.l++]=0,ie}var q={0:{n:"BOF",f:nu},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:s},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:d},14:{n:"NUMBER",f:p},15:{n:"LABEL",f:h},16:{n:"FORMULA",f:m},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:D},222:{n:"SHEETNAMELP",f:G},255:{n:"BOF",f:nu},65535:{n:""}},Y={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:b},23:{n:"NUMBER17",f:C},24:{n:"NUMBER18",f:T},25:{n:"FORMULA19",f:M},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:z},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:I},38:{n:"??"},39:{n:"NUMBER27",f:R},40:{n:"FORMULA28",f:k},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:D},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:W},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};function le(j,Q){eh(j,0);var ie=Q||{},oe={};ie.dense&&(oe["!data"]=[]);var se=[],me="",Ce={s:{r:-1,c:-1},e:{r:-1,c:-1}},Le=0,re=0,yt=0,je=0,st={SheetNames:[],Sheets:{}};e:for(;j.l<j.length;){var Nt=j.read_shift(2),Zt=j.read_shift(2),qe=j.slice(j.l,j.l+Zt);switch(eh(qe,0),Nt){case 1:if(qe.read_shift(4)!=962023505)throw"Bad QPW9 BOF!";break;case 2:break e;case 1025:break;case 1026:break;case 1031:for(qe.l+=12;qe.l<qe.length;)Le=qe.read_shift(2),re=qe.read_shift(1),se.push(qe.read_shift(Le,"cstr"));break;case 1032:break;case 1537:{var ur=qe.read_shift(2);oe={},ie.dense&&(oe["!data"]=[]),Ce.s.c=qe.read_shift(2),Ce.e.c=qe.read_shift(2),Ce.s.r=qe.read_shift(4),Ce.e.r=qe.read_shift(4),qe.l+=4,qe.l+2<qe.length&&(Le=qe.read_shift(2),re=qe.read_shift(1),me=Le==0?"":qe.read_shift(Le,"cstr")),me||(me=$o(ur))}break;case 1538:{if(Ce.s.c>255||Ce.s.r>999999)break;Ce.e.c<Ce.s.c&&(Ce.e.c=Ce.s.c),Ce.e.r<Ce.s.r&&(Ce.e.r=Ce.s.r),oe["!ref"]=lo(Ce),LU(st,oe,me)}break;case 2561:yt=qe.read_shift(2),Ce.e.c<yt&&(Ce.e.c=yt),Ce.s.c>yt&&(Ce.s.c=yt),je=qe.read_shift(4),Ce.s.r>je&&(Ce.s.r=je),je=qe.read_shift(4),Ce.e.r<je&&(Ce.e.r=je);break;case 3073:{je=qe.read_shift(4),Le=qe.read_shift(4),Ce.s.r>je&&(Ce.s.r=je),Ce.e.r<je+Le-1&&(Ce.e.r=je+Le-1);for(var Dt=$o(yt);qe.l<qe.length;){var ft={t:"z"},Oe=qe.read_shift(1);Oe&128&&(qe.l+=2);var J=Oe&64?qe.read_shift(2)-1:0;switch(Oe&31){case 1:break;case 2:ft={t:"n",v:qe.read_shift(2)};break;case 3:ft={t:"n",v:qe.read_shift(2,"i")};break;case 5:ft={t:"n",v:qe.read_shift(8,"f")};break;case 7:ft={t:"s",v:se[re=qe.read_shift(4)-1]};break;case 8:ft={t:"n",v:qe.read_shift(8,"f")},qe.l+=2,qe.l+=4;break;default:throw"Unrecognized QPW cell type "+(Oe&31)}var We=0;if(Oe&32)switch(Oe&31){case 2:We=qe.read_shift(2);break;case 3:We=qe.read_shift(2,"i");break;case 7:We=qe.read_shift(2);break;default:throw"Unsupported delta for QPW cell type "+(Oe&31)}for(!ie.sheetStubs&&ft.t=="z"||(oe["!data"]!=null?(oe["!data"][je]||(oe["!data"][je]=[]),oe["!data"][je][yt]=ft):oe[Dt+ys(je)]=ft),++je,--Le;J-- >0&&Le>=0;){if(Oe&32)switch(Oe&31){case 2:ft={t:"n",v:ft.v+We&65535};break;case 3:ft={t:"n",v:ft.v+We&65535},ft.v>32767&&(ft.v-=65536);break;case 7:ft={t:"s",v:se[re=re+We>>>0]};break;default:throw"Cannot apply delta for QPW cell type "+(Oe&31)}else switch(Oe&31){case 1:ft={t:"z"};break;case 2:ft={t:"n",v:qe.read_shift(2)};break;case 7:ft={t:"s",v:se[re=qe.read_shift(4)-1]};break;default:throw"Cannot apply repeat for QPW cell type "+(Oe&31)}!ie.sheetStubs&&ft.t=="z"||(oe["!data"]!=null?(oe["!data"][je]||(oe["!data"][je]=[]),oe["!data"][je][yt]=ft):oe[Dt+ys(je)]=ft),++je,--Le}}}break}j.l+=Zt}return st}return{sheet_to_wk1:r,book_to_wk3:i,to_workbook:e}}();function GRt(n){var e={},t=n.match(nf),r=0,i=!1;if(t)for(;r!=t.length;++r){var a=Tn(t[r]);switch(a[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!a.val)break;case"<shadow>":case"<shadow/>":e.shadow=1;break;case"</shadow>":break;case"<charset":if(a.val=="1")break;e.cp=loe[parseInt(a.val,10)];break;case"<outline":if(!a.val)break;case"<outline>":case"<outline/>":e.outline=1;break;case"</outline>":break;case"<rFont":e.name=a.val;break;case"<sz":e.sz=a.val;break;case"<strike":if(!a.val)break;case"<strike>":case"<strike/>":e.strike=1;break;case"</strike>":break;case"<u":if(!a.val)break;switch(a.val){case"double":e.uval="double";break;case"singleAccounting":e.uval="single-accounting";break;case"doubleAccounting":e.uval="double-accounting";break}case"<u>":case"<u/>":e.u=1;break;case"</u>":break;case"<b":if(a.val=="0")break;case"<b>":case"<b/>":e.b=1;break;case"</b>":break;case"<i":if(a.val=="0")break;case"<i>":case"<i/>":e.i=1;break;case"</i>":break;case"<color":a.rgb&&(e.color=a.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":e.family=a.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":e.valign=a.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a[0].charCodeAt(1)!==47&&!i)throw new Error("Unrecognized rich format "+a[0])}}return e}var zRt=function(){var n=LD("t"),e=LD("rPr");function t(a){var o=a.match(n);if(!o)return{t:"s",v:""};var s={t:"s",v:so(o[1])},l=a.match(e);return l&&(s.s=GRt(l[1])),s}var r=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(o){return o.replace(r,"").split(i).map(t).filter(function(s){return s.v})}}(),URt=function(){var e=/(\r\n|\n)/g;function t(i,a,o){var s=[];i.u&&s.push("text-decoration: underline;"),i.uval&&s.push("text-underline-style:"+i.uval+";"),i.sz&&s.push("font-size:"+i.sz+"pt;"),i.outline&&s.push("text-effect: outline;"),i.shadow&&s.push("text-shadow: auto;"),a.push('<span style="'+s.join("")+'">'),i.b&&(a.push("<b>"),o.push("</b>")),i.i&&(a.push("<i>"),o.push("</i>")),i.strike&&(a.push("<s>"),o.push("</s>"));var l=i.valign||"";return l=="superscript"||l=="super"?l="sup":l=="subscript"&&(l="sub"),l!=""&&(a.push("<"+l+">"),o.push("</"+l+">")),o.push("</span>"),i}function r(i){var a=[[],i.v,[]];return i.v?(i.s&&t(i.s,a[0],a[2]),a[0].join("")+a[1].replace(e,"<br/>")+a[2].join("")):""}return function(a){return a.map(r).join("")}}(),VRt=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,$Rt=/<(?:\w+:)?r\b[^>]*>/,WRt=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function boe(n,e){var t=e?e.cellHTML:!0,r={};return n?(n.match(/^\s*<(?:\w+:)?t[^>]*>/)?(r.t=so(As(n.slice(n.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""),!0),r.r=As(n),t&&(r.h=ZG(r.t))):n.match($Rt)&&(r.r=As(n),r.t=so(As((n.replace(WRt,"").match(VRt)||[]).join("").replace(nf,"")),!0),t&&(r.h=URt(zRt(r.r)))),r):{t:""}}var HRt=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,jRt=/<(?:\w+:)?(?:si|sstItem)>/g,XRt=/<\/(?:\w+:)?(?:si|sstItem)>/;function YRt(n,e){var t=[],r="";if(!n)return t;var i=n.match(HRt);if(i){r=i[2].replace(jRt,"").split(XRt);for(var a=0;a!=r.length;++a){var o=boe(r[a].trim(),e);o!=null&&(t[t.length]=o)}i=Tn(i[1]),t.Count=i.count,t.Unique=i.uniqueCount}return t}function qRt(n){return[n.read_shift(4),n.read_shift(4)]}function ZRt(n,e){var t=[],r=!1;return B_(n,function(a,o,s){switch(s){case 159:t.Count=a[0],t.Unique=a[1];break;case 19:t.push(a);break;case 160:return!0;case 35:r=!0;break;case 36:r=!1;break;default:if(o.T,!r||e.WTF)throw new Error("Unexpected record 0x"+s.toString(16))}}),t}function eGe(n){for(var e=[],t=n.split(""),r=0;r<t.length;++r)e[r]=t[r].charCodeAt(0);return e}function Y1(n,e){var t={};return t.Major=n.read_shift(2),t.Minor=n.read_shift(2),e>=4&&(n.l+=e-4),t}function KRt(n){var e={};return e.id=n.read_shift(0,"lpp4"),e.R=Y1(n,4),e.U=Y1(n,4),e.W=Y1(n,4),e}function JRt(n){for(var e=n.read_shift(4),t=n.l+e-4,r={},i=n.read_shift(4),a=[];i-- >0;)a.push({t:n.read_shift(4),v:n.read_shift(0,"lpp4")});if(r.name=n.read_shift(0,"lpp4"),r.comps=a,n.l!=t)throw new Error("Bad DataSpaceMapEntry: "+n.l+" != "+t);return r}function QRt(n){var e=[];n.l+=4;for(var t=n.read_shift(4);t-- >0;)e.push(JRt(n));return e}function eDt(n){var e=[];n.l+=4;for(var t=n.read_shift(4);t-- >0;)e.push(n.read_shift(0,"lpp4"));return e}function tDt(n){var e={};return n.read_shift(4),n.l+=4,e.id=n.read_shift(0,"lpp4"),e.name=n.read_shift(0,"lpp4"),e.R=Y1(n,4),e.U=Y1(n,4),e.W=Y1(n,4),e}function rDt(n){var e=tDt(n);if(e.ename=n.read_shift(0,"8lpp4"),e.blksz=n.read_shift(4),e.cmode=n.read_shift(4),n.read_shift(4)!=4)throw new Error("Bad !Primary record");return e}function tGe(n,e){var t=n.l+e,r={};r.Flags=n.read_shift(4)&63,n.l+=4,r.AlgID=n.read_shift(4);var i=!1;switch(r.AlgID){case 26126:case 26127:case 26128:i=r.Flags==36;break;case 26625:i=r.Flags==4;break;case 0:i=r.Flags==16||r.Flags==4||r.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+r.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return r.AlgIDHash=n.read_shift(4),r.KeySize=n.read_shift(4),r.ProviderType=n.read_shift(4),n.l+=8,r.CSPName=n.read_shift(t-n.l>>1,"utf16le"),n.l=t,r}function rGe(n,e){var t={},r=n.l+e;return n.l+=4,t.Salt=n.slice(n.l,n.l+16),n.l+=16,t.Verifier=n.slice(n.l,n.l+16),n.l+=16,n.read_shift(4),t.VerifierHash=n.slice(n.l,r),n.l=r,t}function nDt(n){var e=Y1(n);switch(e.Minor){case 2:return[e.Minor,iDt(n)];case 3:return[e.Minor,aDt()];case 4:return[e.Minor,oDt(n)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+e.Minor)}function iDt(n){var e=n.read_shift(4);if((e&63)!=36)throw new Error("EncryptionInfo mismatch");var t=n.read_shift(4),r=tGe(n,t),i=rGe(n,n.length-n.l);return{t:"Std",h:r,v:i}}function aDt(){throw new Error("File is password-protected: ECMA-376 Extensible")}function oDt(n){var e=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];n.l+=4;var t=n.read_shift(n.length-n.l,"utf8"),r={};return t.replace(nf,function(a){var o=Tn(a);switch(N0(o[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":e.forEach(function(s){r[s]=o[s]});break;case"<dataIntegrity":r.encryptedHmacKey=o.encryptedHmacKey,r.encryptedHmacValue=o.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":r.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":r.uri=o.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":r.encs.push(o);break;default:throw o[0]}}),r}function sDt(n,e){var t={},r=t.EncryptionVersionInfo=Y1(n,4);if(e-=4,r.Minor!=2)throw new Error("unrecognized minor version code: "+r.Minor);if(r.Major>4||r.Major<2)throw new Error("unrecognized major version code: "+r.Major);t.Flags=n.read_shift(4),e-=4;var i=n.read_shift(4);return e-=4,t.EncryptionHeader=tGe(n,i),e-=i,t.EncryptionVerifier=rGe(n,e),t}function lDt(n){var e={},t=e.EncryptionVersionInfo=Y1(n,4);if(t.Major!=1||t.Minor!=1)throw"unrecognized version code "+t.Major+" : "+t.Minor;return e.Salt=n.read_shift(16),e.EncryptedVerifier=n.read_shift(16),e.EncryptedVerifierHash=n.read_shift(16),e}function uDt(n){var e=0,t,r=eGe(n),i=r.length+1,a,o,s,l,u;for(t=VS(i),t[0]=r.length,a=1;a!=i;++a)t[a]=r[a-1];for(a=i-1;a>=0;--a)o=t[a],s=(e&16384)===0?0:1,l=e<<1&32767,u=s|l,e=u^o;return e^52811}var nGe=function(){var n=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],e=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],t=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],r=function(o){return(o/2|o*128)&255},i=function(o,s){return r(o^s)},a=function(o){for(var s=e[o.length-1],l=104,u=o.length-1;u>=0;--u)for(var h=o[u],c=0;c!=7;++c)h&64&&(s^=t[l]),h*=2,--l;return s};return function(o){for(var s=eGe(o),l=a(s),u=s.length,h=VS(16),c=0;c!=16;++c)h[c]=0;var f,d,v;for((u&1)===1&&(f=l>>8,h[u]=i(n[0],f),--u,f=l&255,d=s[s.length-1],h[u]=i(d,f));u>0;)--u,f=l>>8,h[u]=i(s[u],f),--u,f=l&255,h[u]=i(s[u],f);for(u=15,v=15-s.length;v>0;)f=l>>8,h[u]=i(n[v],f),--u,--v,f=l&255,h[u]=i(s[u],f),--u,--v;return h}}(),hDt=function(n,e,t,r,i){i||(i=e),r||(r=nGe(n));var a,o;for(a=0;a!=e.length;++a)o=e[a],o^=r[t],o=(o>>5|o<<3)&255,i[a]=o,++t;return[i,t,r]},cDt=function(n){var e=0,t=nGe(n);return function(r){var i=hDt("",r,e,t);return e=i[1],i[0]}};function fDt(n,e,t,r){var i={key:nu(n),verificationBytes:nu(n)};return t.password&&(i.verifier=uDt(t.password)),r.valid=i.verificationBytes===i.verifier,r.valid&&(r.insitu=cDt(t.password)),i}function dDt(n,e,t){var r=t||{};return r.Info=n.read_shift(2),n.l-=2,r.Info===1?r.Data=lDt(n):r.Data=sDt(n,e),r}function vDt(n,e,t){var r={Type:t.biff>=8?n.read_shift(2):0};return r.Type?dDt(n,e-2,r):fDt(n,t.biff>=8?e:e-2,t,r),r}function pDt(n,e){switch(e.type){case"base64":return K4(Tv(n),e);case"binary":return K4(n,e);case"buffer":return K4(oo&&Buffer.isBuffer(n)?n.toString("binary"):p_(n),e);case"array":return K4(t2(n),e)}throw new Error("Unrecognized type "+e.type)}function K4(n,e){var t=e||{},r={},i=t.dense;i&&(r["!data"]=[]);var a=n.match(/\\trowd[\s\S]*?\\row\b/g);if(!a)throw new Error("RTF missing table");var o={s:{c:0,r:0},e:{c:0,r:a.length-1}},s=[];return a.forEach(function(l,u){i&&(s=r["!data"][u]=[]);for(var h=/\\[\w\-]+\b/g,c=0,f,d=-1,v=[];(f=h.exec(l))!=null;){var p=l.slice(c,h.lastIndex-f[0].length);switch(p.charCodeAt(0)==32&&(p=p.slice(1)),p.length&&v.push(p),f[0]){case"\\cell":if(++d,v.length){var g={v:v.join(""),t:"s"};g.v=="TRUE"||g.v=="FALSE"?(g.v=g.v=="TRUE",g.t="b"):isNaN(mv(g.v))||(g.t="n",t.cellText!==!1&&(g.w=g.v),g.v=mv(g.v)),i?s[d]=g:r[bo({r:u,c:d})]=g}v=[];break;case"\\par":v.push(`
`);break}c=h.lastIndex}d>o.e.c&&(o.e.c=d)}),r["!ref"]=lo(o),r}function gDt(n,e){var t=ww(pDt(n,e),e);return t.bookType="rtf",t}function yDt(n){var e=n.slice(n[0]==="#"?1:0).slice(0,6);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function OD(n){for(var e=0,t=1;e!=3;++e)t=t*256+(n[e]>255?255:n[e]<0?0:n[e]);return t.toString(16).toUpperCase().slice(1)}function mDt(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a;if(o===0)return[0,0,e];var s=0,l=0,u=i+a;switch(l=o/(u>1?2-u:u),i){case e:s=((t-r)/o+6)%6;break;case t:s=(r-e)/o+2;break;case r:s=(e-t)/o+4;break}return[s/6,l,u/2]}function _Dt(n){var e=n[0],t=n[1],r=n[2],i=t*2*(r<.5?r:1-r),a=r-i/2,o=[a,a,a],s=6*e,l;if(t!==0)switch(s|0){case 0:case 6:l=i*s,o[0]+=i,o[1]+=l;break;case 1:l=i*(2-s),o[0]+=l,o[1]+=i;break;case 2:l=i*(s-2),o[1]+=i,o[2]+=l;break;case 3:l=i*(4-s),o[1]+=l,o[2]+=i;break;case 4:l=i*(s-4),o[2]+=i,o[0]+=l;break;case 5:l=i*(6-s),o[2]+=l,o[0]+=i;break}for(var u=0;u!=3;++u)o[u]=Math.round(o[u]*255);return o}function e9(n,e){if(e===0)return n;var t=mDt(yDt(n));return e<0?t[2]=t[2]*(1+e):t[2]=1-(1-t[2])*(1-e),OD(_Dt(t))}var iGe=6,xDt=15,SDt=1,Ef=iGe;function t9(n){return Math.floor((n+Math.round(128/Ef)/256)*Ef)}function r9(n){return Math.floor((n-5)/Ef*100+.5)/100}function SQ(n){return Math.round((n*Ef+5)/Ef*256)/256}function mX(n){return SQ(r9(t9(n)))}function Eoe(n){var e=Math.abs(n-mX(n)),t=Ef;if(e>.005)for(Ef=SDt;Ef<xDt;++Ef)Math.abs(n-mX(n))<=e&&(e=Math.abs(n-mX(n)),t=Ef);Ef=t}function wM(n){n.width?(n.wpx=t9(n.width),n.wch=r9(n.wpx),n.MDW=Ef):n.wpx?(n.wch=r9(n.wpx),n.width=SQ(n.wch),n.MDW=Ef):typeof n.wch=="number"&&(n.width=SQ(n.wch),n.wpx=t9(n.width),n.MDW=Ef),n.customWidth&&delete n.customWidth}var wDt=96,aGe=wDt;function oGe(n){return n*96/aGe}function RD(n){return n*aGe/96}var bDt={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function EDt(n,e,t,r){e.Borders=[];var i={},a=!1;(n[0].match(nf)||[]).forEach(function(o){var s=Tn(o);switch(N0(s[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":i={},s.diagonalUp&&(i.diagonalUp=ps(s.diagonalUp)),s.diagonalDown&&(i.diagonalDown=ps(s.diagonalDown)),e.Borders.push(i);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+s[0]+" in borders")}})}function TDt(n,e,t,r){e.Fills=[];var i={},a=!1;(n[0].match(nf)||[]).forEach(function(o){var s=Tn(o);switch(N0(s[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":i={},e.Fills.push(i);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":e.Fills.push(i),i={};break;case"<patternFill":case"<patternFill>":s.patternType&&(i.patternType=s.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":i.bgColor||(i.bgColor={}),s.indexed&&(i.bgColor.indexed=parseInt(s.indexed,10)),s.theme&&(i.bgColor.theme=parseInt(s.theme,10)),s.tint&&(i.bgColor.tint=parseFloat(s.tint)),s.rgb&&(i.bgColor.rgb=s.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":i.fgColor||(i.fgColor={}),s.theme&&(i.fgColor.theme=parseInt(s.theme,10)),s.tint&&(i.fgColor.tint=parseFloat(s.tint)),s.rgb!=null&&(i.fgColor.rgb=s.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+s[0]+" in fills")}})}function CDt(n,e,t,r){e.Fonts=[];var i={},a=!1;(n[0].match(nf)||[]).forEach(function(o){var s=Tn(o);switch(N0(s[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":e.Fonts.push(i),i={};break;case"<name":s.val&&(i.name=As(s.val));break;case"<name/>":case"</name>":break;case"<b":i.bold=s.val?ps(s.val):1;break;case"<b/>":i.bold=1;break;case"<i":i.italic=s.val?ps(s.val):1;break;case"<i/>":i.italic=1;break;case"<u":switch(s.val){case"none":i.underline=0;break;case"single":i.underline=1;break;case"double":i.underline=2;break;case"singleAccounting":i.underline=33;break;case"doubleAccounting":i.underline=34;break}break;case"<u/>":i.underline=1;break;case"<strike":i.strike=s.val?ps(s.val):1;break;case"<strike/>":i.strike=1;break;case"<outline":i.outline=s.val?ps(s.val):1;break;case"<outline/>":i.outline=1;break;case"<shadow":i.shadow=s.val?ps(s.val):1;break;case"<shadow/>":i.shadow=1;break;case"<condense":i.condense=s.val?ps(s.val):1;break;case"<condense/>":i.condense=1;break;case"<extend":i.extend=s.val?ps(s.val):1;break;case"<extend/>":i.extend=1;break;case"<sz":s.val&&(i.sz=+s.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":s.val&&(i.vertAlign=s.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":s.val&&(i.family=parseInt(s.val,10));break;case"<family/>":case"</family>":break;case"<scheme":s.val&&(i.scheme=s.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(s.val=="1")break;s.codepage=loe[parseInt(s.val,10)];break;case"<color":if(i.color||(i.color={}),s.auto&&(i.color.auto=ps(s.auto)),s.rgb)i.color.rgb=s.rgb.slice(-6);else if(s.indexed){i.color.index=parseInt(s.indexed,10);var l=RE[i.color.index];i.color.index==81&&(l=RE[1]),l||(l=RE[1]),i.color.rgb=l[0].toString(16)+l[1].toString(16)+l[2].toString(16)}else s.theme&&(i.color.theme=parseInt(s.theme,10),s.tint&&(i.color.tint=parseFloat(s.tint)),s.theme&&t.themeElements&&t.themeElements.clrScheme&&(i.color.rgb=e9(t.themeElements.clrScheme[i.color.theme].rgb,i.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":a=!0;break;case"</AlternateContent>":a=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+s[0]+" in fonts")}})}function ADt(n,e,t){e.NumberFmt=[];for(var r=h0(ji),i=0;i<r.length;++i)e.NumberFmt[r[i]]=ji[r[i]];var a=n[0].match(nf);if(!!a)for(i=0;i<a.length;++i){var o=Tn(a[i]);switch(N0(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var s=so(As(o.formatCode)),l=parseInt(o.numFmtId,10);if(e.NumberFmt[l]=s,l>0){if(l>392){for(l=392;l>60&&e.NumberFmt[l]!=null;--l);e.NumberFmt[l]=s}OE(s,l)}}break;case"</numFmt>":break;default:if(t.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}var J4=["numFmtId","fillId","fontId","borderId","xfId"],Q4=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function MDt(n,e,t){e.CellXf=[];var r,i=!1;(n[0].match(nf)||[]).forEach(function(a){var o=Tn(a),s=0;switch(N0(o[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(r=o,delete r[0],s=0;s<J4.length;++s)r[J4[s]]&&(r[J4[s]]=parseInt(r[J4[s]],10));for(s=0;s<Q4.length;++s)r[Q4[s]]&&(r[Q4[s]]=ps(r[Q4[s]]));if(e.NumberFmt&&r.numFmtId>392){for(s=392;s>60;--s)if(e.NumberFmt[r.numFmtId]==e.NumberFmt[s]){r.numFmtId=s;break}}e.CellXf.push(r);break;case"</xf>":break;case"<alignment":case"<alignment/>":var l={};o.vertical&&(l.vertical=o.vertical),o.horizontal&&(l.horizontal=o.horizontal),o.textRotation!=null&&(l.textRotation=o.textRotation),o.indent&&(l.indent=o.indent),o.wrapText&&(l.wrapText=ps(o.wrapText)),r.alignment=l;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":i=!0;break;case"</AlternateContent>":i=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(t&&t.WTF&&!i)throw new Error("unrecognized "+o[0]+" in cellXfs")}})}var IDt=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,t=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,r=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,i=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,a=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(s,l,u){var h={};if(!s)return h;s=s.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var c;return(c=s.match(e))&&ADt(c,h,u),(c=s.match(i))&&CDt(c,h,l,u),(c=s.match(r))&&TDt(c,h,l,u),(c=s.match(a))&&EDt(c,h,l,u),(c=s.match(t))&&MDt(c,h,u),h}}();function LDt(n,e){var t=n.read_shift(2),r=Wc(n);return[t,r]}function PDt(n,e,t){var r={};r.sz=n.read_shift(2)/20;var i=VPt(n);i.fItalic&&(r.italic=1),i.fCondense&&(r.condense=1),i.fExtend&&(r.extend=1),i.fShadow&&(r.shadow=1),i.fOutline&&(r.outline=1),i.fStrikeout&&(r.strike=1);var a=n.read_shift(2);switch(a===700&&(r.bold=1),n.read_shift(2)){case 1:r.vertAlign="superscript";break;case 2:r.vertAlign="subscript";break}var o=n.read_shift(1);o!=0&&(r.underline=o);var s=n.read_shift(1);s>0&&(r.family=s);var l=n.read_shift(1);switch(l>0&&(r.charset=l),n.l++,r.color=UPt(n),n.read_shift(1)){case 1:r.scheme="major";break;case 2:r.scheme="minor";break}return r.name=Wc(n),r}var ODt=Kc;function RDt(n,e){var t=n.l+e,r=n.read_shift(2),i=n.read_shift(2);return n.l=t,{ixfe:r,numFmtId:i}}var DDt=Kc;function NDt(n,e,t){var r={};r.NumberFmt=[];for(var i in ji)r.NumberFmt[i]=ji[i];r.CellXf=[],r.Fonts=[];var a=[],o=!1;return B_(n,function(l,u,h){switch(h){case 44:r.NumberFmt[l[0]]=l[1],OE(l[1],l[0]);break;case 43:r.Fonts.push(l),l.color.theme!=null&&e&&e.themeElements&&e.themeElements.clrScheme&&(l.color.rgb=e9(e.themeElements.clrScheme[l.color.theme].rgb,l.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:a[a.length-1]==617&&r.CellXf.push(l);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:a.push(h),o=!0;break;case 38:a.pop(),o=!1;break;default:if(u.T>0)a.push(h);else if(u.T<0)a.pop();else if(!o||t.WTF&&a[a.length-1]!=37)throw new Error("Unexpected record 0x"+h.toString(16))}}),r}var kDt=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function FDt(n,e,t){e.themeElements.clrScheme=[];var r={};(n[0].match(nf)||[]).forEach(function(i){var a=Tn(i);switch(a[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":r.rgb=a.val;break;case"<a:sysClr":r.rgb=a.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":a[0].charAt(1)==="/"?(e.themeElements.clrScheme[kDt.indexOf(a[0])]=r,r={}):r.name=a[0].slice(3,a[0].length-1);break;default:if(t&&t.WTF)throw new Error("Unrecognized "+a[0]+" in clrScheme")}})}function BDt(){}function GDt(){}var zDt=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,UDt=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,VDt=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function $Dt(n,e,t){e.themeElements={};var r;[["clrScheme",zDt,FDt],["fontScheme",UDt,BDt],["fmtScheme",VDt,GDt]].forEach(function(i){if(!(r=n.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](r,e,t)})}var WDt=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function sGe(n,e){(!n||n.length===0)&&(n=HDt());var t,r={};if(!(t=n.match(WDt)))throw new Error("themeElements not found in theme");return $Dt(t[0],r,e),r.raw=n,r}function HDt(n,e){if(e&&e.themeXLSX)return e.themeXLSX;if(n&&typeof n.raw=="string")return n.raw;var t=[y8e];return t[t.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',t[t.length]="<a:themeElements>",t[t.length]='<a:clrScheme name="Office">',t[t.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',t[t.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',t[t.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',t[t.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',t[t.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',t[t.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',t[t.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',t[t.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',t[t.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',t[t.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',t[t.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',t[t.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',t[t.length]="</a:clrScheme>",t[t.length]='<a:fontScheme name="Office">',t[t.length]="<a:majorFont>",t[t.length]='<a:latin typeface="Cambria"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/>',t[t.length]='<a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/>',t[t.length]='<a:font script="Hans" typeface="\u5B8B\u4F53"/>',t[t.length]='<a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/>',t[t.length]='<a:font script="Arab" typeface="Times New Roman"/>',t[t.length]='<a:font script="Hebr" typeface="Times New Roman"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="MoolBoran"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Times New Roman"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:majorFont>",t[t.length]="<a:minorFont>",t[t.length]='<a:latin typeface="Calibri"/>',t[t.length]='<a:ea typeface=""/>',t[t.length]='<a:cs typeface=""/>',t[t.length]='<a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/>',t[t.length]='<a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/>',t[t.length]='<a:font script="Hans" typeface="\u5B8B\u4F53"/>',t[t.length]='<a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/>',t[t.length]='<a:font script="Arab" typeface="Arial"/>',t[t.length]='<a:font script="Hebr" typeface="Arial"/>',t[t.length]='<a:font script="Thai" typeface="Tahoma"/>',t[t.length]='<a:font script="Ethi" typeface="Nyala"/>',t[t.length]='<a:font script="Beng" typeface="Vrinda"/>',t[t.length]='<a:font script="Gujr" typeface="Shruti"/>',t[t.length]='<a:font script="Khmr" typeface="DaunPenh"/>',t[t.length]='<a:font script="Knda" typeface="Tunga"/>',t[t.length]='<a:font script="Guru" typeface="Raavi"/>',t[t.length]='<a:font script="Cans" typeface="Euphemia"/>',t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>',t[t.length]='<a:font script="Deva" typeface="Mangal"/>',t[t.length]='<a:font script="Telu" typeface="Gautami"/>',t[t.length]='<a:font script="Taml" typeface="Latha"/>',t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',t[t.length]='<a:font script="Orya" typeface="Kalinga"/>',t[t.length]='<a:font script="Mlym" typeface="Kartika"/>',t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>',t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',t[t.length]='<a:font script="Viet" typeface="Arial"/>',t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>',t[t.length]="</a:minorFont>",t[t.length]="</a:fontScheme>",t[t.length]='<a:fmtScheme name="Office">',t[t.length]="<a:fillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="1"/>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:lin ang="16200000" scaled="0"/>',t[t.length]="</a:gradFill>",t[t.length]="</a:fillStyleLst>",t[t.length]="<a:lnStyleLst>",t[t.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',t[t.length]="</a:lnStyleLst>",t[t.length]="<a:effectStyleLst>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]="</a:effectStyle>",t[t.length]="<a:effectStyle>",t[t.length]="<a:effectLst>",t[t.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',t[t.length]="</a:effectLst>",t[t.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',t[t.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',t[t.length]="</a:effectStyle>",t[t.length]="</a:effectStyleLst>",t[t.length]="<a:bgFillStyleLst>",t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]='<a:gradFill rotWithShape="1">',t[t.length]="<a:gsLst>",t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',t[t.length]="</a:gsLst>",t[t.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',t[t.length]="</a:gradFill>",t[t.length]="</a:bgFillStyleLst>",t[t.length]="</a:fmtScheme>",t[t.length]="</a:themeElements>",t[t.length]="<a:objectDefaults>",t[t.length]="<a:spDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',t[t.length]="</a:spDef>",t[t.length]="<a:lnDef>",t[t.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',t[t.length]="</a:lnDef>",t[t.length]="</a:objectDefaults>",t[t.length]="<a:extraClrSchemeLst/>",t[t.length]="</a:theme>",t.join("")}function jDt(n,e,t){var r=n.l+e,i=n.read_shift(4);if(i!==124226){if(!t.cellStyles){n.l=r;return}var a=n.slice(n.l);n.l=r;var o;try{o=g8e(a,{type:"array"})}catch{return}var s=cd(o,"theme/theme/theme1.xml",!0);if(!!s)return sGe(s,t)}}function XDt(n){return n.read_shift(4)}function YDt(n){var e={};switch(e.xclrType=n.read_shift(2),e.nTintShade=n.read_shift(2),e.xclrType){case 0:n.l+=4;break;case 1:e.xclrValue=qDt(n,4);break;case 2:e.xclrValue=X8e(n);break;case 3:e.xclrValue=XDt(n);break;case 4:n.l+=4;break}return n.l+=8,e}function qDt(n,e){return Kc(n,e)}function ZDt(n,e){return Kc(n,e)}function KDt(n){var e=n.read_shift(2),t=n.read_shift(2)-4,r=[e];switch(e){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:r[1]=YDt(n);break;case 6:r[1]=ZDt(n,t);break;case 14:case 15:r[1]=n.read_shift(t===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+e+" "+t)}return r}function JDt(n,e){var t=n.l+e;n.l+=2;var r=n.read_shift(2);n.l+=2;for(var i=n.read_shift(2),a=[];i-- >0;)a.push(KDt(n,t-n.l));return{ixfe:r,ext:a}}function QDt(n,e){e.forEach(function(t){switch(t[0]){}})}function eNt(n,e){return{flags:n.read_shift(4),version:n.read_shift(4),name:Wc(n)}}function tNt(n){for(var e=[],t=n.read_shift(4);t-- >0;)e.push([n.read_shift(4),n.read_shift(4)]);return e}function rNt(n){return n.l+=4,n.read_shift(4)!=0}function nNt(n,e,t){var r={Types:[],Cell:[],Value:[]},i=t||{},a=[],o=!1,s=2;return B_(n,function(l,u,h){switch(h){case 335:r.Types.push({name:l.name});break;case 51:l.forEach(function(c){s==1?r.Cell.push({type:r.Types[c[0]-1].name,index:c[1]}):s==0&&r.Value.push({type:r.Types[c[0]-1].name,index:c[1]})});break;case 337:s=l?1:0;break;case 338:s=2;break;case 35:a.push(h),o=!0;break;case 36:a.pop(),o=!1;break;default:if(!u.T){if(!o||i.WTF&&a[a.length-1]!=35)throw new Error("Unexpected record 0x"+h.toString(16))}}}),r}function iNt(n,e,t){var r={Types:[],Cell:[],Value:[]};if(!n)return r;var i=!1,a=2,o;return n.replace(nf,function(s){var l=Tn(s);switch(N0(l[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":r.Types.push({name:l.name});break;case"</metadataType>":break;case"<futureMetadata":for(var u=0;u<r.Types.length;++u)r.Types[u].name==l.name&&(o=r.Types[u]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":a==1?r.Cell.push({type:r.Types[l.t-1].name,index:+l.v}):a==0&&r.Value.push({type:r.Types[l.t-1].name,index:+l.v});break;case"</rc>":break;case"<cellMetadata":a=1;break;case"</cellMetadata>":a=2;break;case"<valueMetadata":a=0;break;case"</valueMetadata>":a=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;case"<rvb":if(!o)break;o.offsets||(o.offsets=[]),o.offsets.push(+l.i);break;default:if(!i&&(t==null?void 0:t.WTF))throw new Error("unrecognized "+l[0]+" in metadata")}return s}),r}function aNt(n){var e=[];if(!n)return e;var t=1;return(n.match(nf)||[]).forEach(function(r){var i=Tn(r);switch(i[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete i[0],i.i?t=i.i:i.i=t,e.push(i);break}}),e}function oNt(n){var e={};e.i=n.read_shift(4);var t={};t.r=n.read_shift(4),t.c=n.read_shift(4),e.r=bo(t);var r=n.read_shift(1);return r&2&&(e.l="1"),r&8&&(e.a="1"),e}function sNt(n,e,t){var r=[];return B_(n,function(a,o,s){switch(s){case 63:r.push(a);break;default:if(!o.T)throw new Error("Unexpected record 0x"+s.toString(16))}}),r}function lNt(n,e,t,r){if(!n)return n;var i=r||{},a=!1;B_(n,function(s,l,u){switch(u){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:a=!0;break;case 36:a=!1;break;default:if(!l.T){if(!a||i.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}},i)}function uNt(n,e){if(!n)return"??";var t=(n.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return e["!id"][t].Target}function V_e(n,e,t,r){var i=n["!data"]!=null,a;e.forEach(function(o){var s=zc(o.ref);if(!(s.r<0||s.c<0)){if(i?(n["!data"][s.r]||(n["!data"][s.r]=[]),a=n["!data"][s.r][s.c]):a=n[o.ref],!a){a={t:"z"},i?n["!data"][s.r][s.c]=a:n[o.ref]=a;var l=cu(n["!ref"]||"BDWGO1000001:A1");l.s.r>s.r&&(l.s.r=s.r),l.e.r<s.r&&(l.e.r=s.r),l.s.c>s.c&&(l.s.c=s.c),l.e.c<s.c&&(l.e.c=s.c);var u=lo(l);n["!ref"]=u}a.c||(a.c=[]);var h={a:o.author,t:o.t,r:o.r,T:t};o.h&&(h.h=o.h);for(var c=a.c.length-1;c>=0;--c){if(!t&&a.c[c].T)return;t&&!a.c[c].T&&a.c.splice(c,1)}if(t&&r){for(c=0;c<r.length;++c)if(h.a==r[c].id){h.a=r[c].name||h.a;break}}a.c.push(h)}})}function hNt(n,e){if(n.match(/<(?:\w+:)?comments *\/>/))return[];var t=[],r=[],i=n.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach(function(o){if(!(o===""||o.trim()==="")){var s=o.match(/<(?:\w+:)?author[^>]*>(.*)/);s&&t.push(s[1])}});var a=n.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return a&&a[1]&&a[1].split(/<\/\w*:?comment>/).forEach(function(o){if(!(o===""||o.trim()==="")){var s=o.match(/<(?:\w+:)?comment[^>]*>/);if(!!s){var l=Tn(s[0]),u={author:l.authorId&&t[l.authorId]||"sheetjsghost",ref:l.ref,guid:l.guid},h=zc(l.ref);if(!(e.sheetRows&&e.sheetRows<=h.r)){var c=o.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),f=!!c&&!!c[1]&&boe(c[1])||{r:"",t:"",h:""};u.r=f.r,f.r=="<t></t>"&&(f.t=f.h=""),u.t=(f.t||"").replace(/\r\n/g,`
`).replace(/\r/g,`
`),e.cellHTML&&(u.h=f.h),r.push(u)}}}}),r}function cNt(n,e){var t=[],r=!1,i={},a=0;return n.replace(nf,function(s,l){var u=Tn(s);switch(N0(u[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":i={author:u.personId,guid:u.id,ref:u.ref,T:1};break;case"</threadedComment>":i.t!=null&&t.push(i);break;case"<text>":case"<text":a=l+s.length;break;case"</text>":i.t=n.slice(a,l).replace(/\r\n/g,`
`).replace(/\r/g,`
`);break;case"<mentions":case"<mentions>":r=!0;break;case"</mentions>":r=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":r=!0;break;case"</ext>":r=!1;break;default:if(!r&&e.WTF)throw new Error("unrecognized "+u[0]+" in threaded comments")}return s}),t}function fNt(n,e){var t=[],r=!1;return n.replace(nf,function(a){var o=Tn(a);switch(N0(o[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":t.push({name:o.displayname,id:o.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":r=!0;break;case"</ext>":r=!1;break;default:if(!r&&e.WTF)throw new Error("unrecognized "+o[0]+" in threaded comments")}return a}),t}function dNt(n){var e={};e.iauthor=n.read_shift(4);var t=rT(n);return e.rfx=t.s,e.ref=bo(t.s),n.l+=16,e}var vNt=Wc;function pNt(n,e){var t=[],r=[],i={},a=!1;return B_(n,function(s,l,u){switch(u){case 632:r.push(s);break;case 635:i=s;break;case 637:i.t=s.t,i.h=s.h,i.r=s.r;break;case 636:if(i.author=r[i.iauthor],delete i.iauthor,e.sheetRows&&i.rfx&&e.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,t.push(i);break;case 3072:break;case 35:a=!0;break;case 36:a=!1;break;case 37:break;case 38:break;default:if(!l.T){if(!a||e.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}),t}var gNt="application/vnd.ms-office.vbaProject";function yNt(n){var e=co.utils.cfb_new({root:"R"});return n.FullPaths.forEach(function(t,r){if(!(t.slice(-1)==="/"||!t.match(/_VBA_PROJECT_CUR/))){var i=t.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");co.utils.cfb_add(e,i,n.FileIndex[r].content)}}),co.write(e)}function mNt(){return{"!type":"dialog"}}function _Nt(){return{"!type":"dialog"}}function xNt(){return{"!type":"macro"}}function SNt(){return{"!type":"macro"}}var DE=function(){var n=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,e={r:0,c:0};function t(r,i,a,o){var s=!1,l=!1;a.length==0?l=!0:a.charAt(0)=="["&&(l=!0,a=a.slice(1,-1)),o.length==0?s=!0:o.charAt(0)=="["&&(s=!0,o=o.slice(1,-1));var u=a.length>0?parseInt(a,10)|0:0,h=o.length>0?parseInt(o,10)|0:0;return s?h+=e.c:--h,l?u+=e.r:--u,i+(s?"":"$")+$o(h)+(l?"":"$")+ys(u)}return function(i,a){return e=a,i.replace(n,t)}}(),lGe=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,wNt=function(){return function(e,t){return e.replace(lGe,function(r,i,a,o,s,l){var u=yoe(o)-(a?0:t.c),h=goe(l)-(s?0:t.r),c=s=="$"?h+1:h==0?"":"["+h+"]",f=a=="$"?u+1:u==0?"":"["+u+"]";return i+"R"+c+"C"+f})}}();function uGe(n,e){return n.replace(lGe,function(t,r,i,a,o,s){return r+(i=="$"?i+a:$o(yoe(a)+e.c))+(o=="$"?o+s:ys(goe(s)+e.r))})}function bNt(n,e,t){var r=eT(e),i=r.s,a=zc(t),o={r:a.r-i.r,c:a.c-i.c};return uGe(n,o)}function ENt(n){return n.length!=1}function $_e(n){return n.replace(/_xlfn\./g,"")}function bu(n){n.l+=1}function WS(n,e){var t=n.read_shift(e==1?1:2);return[t&16383,t>>14&1,t>>15&1]}function hGe(n,e,t){var r=2;if(t){if(t.biff>=2&&t.biff<=5)return cGe(n);t.biff==12&&(r=4)}var i=n.read_shift(r),a=n.read_shift(r),o=WS(n,2),s=WS(n,2);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:a,c:s[0],cRel:s[1],rRel:s[2]}}}function cGe(n){var e=WS(n,2),t=WS(n,2),r=n.read_shift(1),i=n.read_shift(1);return{s:{r:e[0],c:r,cRel:e[1],rRel:e[2]},e:{r:t[0],c:i,cRel:t[1],rRel:t[2]}}}function TNt(n,e,t){if(t.biff<8)return cGe(n);var r=n.read_shift(t.biff==12?4:2),i=n.read_shift(t.biff==12?4:2),a=WS(n,2),o=WS(n,2);return{s:{r,c:a[0],cRel:a[1],rRel:a[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function fGe(n,e,t){if(t&&t.biff>=2&&t.biff<=5)return CNt(n);var r=n.read_shift(t&&t.biff==12?4:2),i=WS(n,2);return{r,c:i[0],cRel:i[1],rRel:i[2]}}function CNt(n){var e=WS(n,2),t=n.read_shift(1);return{r:e[0],c:t,cRel:e[1],rRel:e[2]}}function ANt(n){var e=n.read_shift(2),t=n.read_shift(2);return{r:e,c:t&255,fQuoted:!!(t&16384),cRel:t>>15,rRel:t>>15}}function MNt(n,e,t){var r=t&&t.biff?t.biff:8;if(r>=2&&r<=5)return INt(n);var i=n.read_shift(r>=12?4:2),a=n.read_shift(2),o=(a&16384)>>14,s=(a&32768)>>15;if(a&=16383,s==1)for(;i>524287;)i-=1048576;if(o==1)for(;a>8191;)a=a-16384;return{r:i,c:a,cRel:o,rRel:s}}function INt(n){var e=n.read_shift(2),t=n.read_shift(1),r=(e&32768)>>15,i=(e&16384)>>14;return e&=16383,r==1&&e>=8192&&(e=e-16384),i==1&&t>=128&&(t=t-256),{r:e,c:t,cRel:i,rRel:r}}function LNt(n,e,t){var r=(n[n.l++]&96)>>5,i=hGe(n,t.biff>=2&&t.biff<=5?6:8,t);return[r,i]}function PNt(n,e,t){var r=(n[n.l++]&96)>>5,i=n.read_shift(2,"i"),a=8;if(t)switch(t.biff){case 5:n.l+=12,a=6;break;case 12:a=12;break}var o=hGe(n,a,t);return[r,i,o]}function ONt(n,e,t){var r=(n[n.l++]&96)>>5;return n.l+=t&&t.biff>8?12:t.biff<8?6:8,[r]}function RNt(n,e,t){var r=(n[n.l++]&96)>>5,i=n.read_shift(2),a=8;if(t)switch(t.biff){case 5:n.l+=12,a=6;break;case 12:a=12;break}return n.l+=a,[r,i]}function DNt(n,e,t){var r=(n[n.l++]&96)>>5,i=TNt(n,e-1,t);return[r,i]}function NNt(n,e,t){var r=(n[n.l++]&96)>>5;return n.l+=t.biff==2?6:t.biff==12?14:7,[r]}function W_e(n){var e=n[n.l+1]&1,t=1;return n.l+=4,[e,t]}function kNt(n,e,t){n.l+=2;for(var r=n.read_shift(t&&t.biff==2?1:2),i=[],a=0;a<=r;++a)i.push(n.read_shift(t&&t.biff==2?1:2));return i}function FNt(n,e,t){var r=n[n.l+1]&255?1:0;return n.l+=2,[r,n.read_shift(t&&t.biff==2?1:2)]}function BNt(n,e,t){var r=n[n.l+1]&255?1:0;return n.l+=2,[r,n.read_shift(t&&t.biff==2?1:2)]}function GNt(n){var e=n[n.l+1]&255?1:0;return n.l+=2,[e,n.read_shift(2)]}function zNt(n,e,t){var r=n[n.l+1]&255?1:0;return n.l+=t&&t.biff==2?3:4,[r]}function dGe(n){var e=n.read_shift(1),t=n.read_shift(1);return[e,t]}function UNt(n){return n.read_shift(2),dGe(n)}function VNt(n){return n.read_shift(2),dGe(n)}function $Nt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=fGe(n,0,t);return[r,i]}function WNt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=MNt(n,0,t);return[r,i]}function HNt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=n.read_shift(2);t&&t.biff==5&&(n.l+=12);var a=fGe(n,0,t);return[r,i,a]}function jNt(n,e,t){var r=(n[n.l]&96)>>5;n.l+=1;var i=n.read_shift(t&&t.biff<=3?1:2);return[X3t[i],gGe[i],r]}function XNt(n,e,t){var r=n[n.l++],i=n.read_shift(1),a=t&&t.biff<=3?[r==88?-1:0,n.read_shift(1)]:YNt(n);return[i,(a[0]===0?gGe:j3t)[a[1]]]}function YNt(n){return[n[n.l+1]>>7,n.read_shift(2)&32767]}function qNt(n,e,t){n.l+=t&&t.biff==2?3:4}function ZNt(n,e,t){if(n.l++,t&&t.biff==12)return[n.read_shift(4,"i"),0];var r=n.read_shift(2),i=n.read_shift(t&&t.biff==2?1:2);return[r,i]}function KNt(n){return n.l++,nT[n.read_shift(1)]}function JNt(n){return n.l++,n.read_shift(2)}function QNt(n){return n.l++,n.read_shift(1)!==0}function e3t(n){return n.l++,Bc(n)}function t3t(n,e,t){return n.l++,N3(n,e-1,t)}function r3t(n,e){var t=[n.read_shift(1)];if(e==12)switch(t[0]){case 2:t[0]=4;break;case 4:t[0]=16;break;case 0:t[0]=1;break;case 1:t[0]=2;break}switch(t[0]){case 4:t[1]=tu(n,1)?"TRUE":"FALSE",e!=12&&(n.l+=7);break;case 37:case 16:t[1]=nT[n[n.l]],n.l+=e==12?4:8;break;case 0:n.l+=8;break;case 1:t[1]=Bc(n);break;case 2:t[1]=iT(n,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+t[0])}return t}function n3t(n,e,t){for(var r=n.read_shift(t.biff==12?4:2),i=[],a=0;a!=r;++a)i.push((t.biff==12?rT:AU)(n));return i}function i3t(n,e,t){var r=0,i=0;t.biff==12?(r=n.read_shift(4),i=n.read_shift(4)):(i=1+n.read_shift(1),r=1+n.read_shift(2)),t.biff>=2&&t.biff<8&&(--r,--i==0&&(i=256));for(var a=0,o=[];a!=r&&(o[a]=[]);++a)for(var s=0;s!=i;++s)o[a][s]=r3t(n,t.biff);return o}function a3t(n,e,t){var r=n.read_shift(1)>>>5&3,i=!t||t.biff>=8?4:2,a=n.read_shift(i);switch(t.biff){case 2:n.l+=5;break;case 3:case 4:n.l+=8;break;case 5:n.l+=12;break}return[r,0,a]}function o3t(n,e,t){if(t.biff==5)return s3t(n);var r=n.read_shift(1)>>>5&3,i=n.read_shift(2),a=n.read_shift(4);return[r,i,a]}function s3t(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2,"i");n.l+=8;var r=n.read_shift(2);return n.l+=12,[e,t,r]}function l3t(n,e,t){var r=n.read_shift(1)>>>5&3;n.l+=t&&t.biff==2?3:4;var i=n.read_shift(t&&t.biff==2?1:2);return[r,i]}function u3t(n,e,t){var r=n.read_shift(1)>>>5&3,i=n.read_shift(t&&t.biff==2?1:2);return[r,i]}function h3t(n,e,t){var r=n.read_shift(1)>>>5&3;return n.l+=4,t.biff<8&&n.l--,t.biff==12&&(n.l+=2),[r]}function c3t(n,e,t){var r=(n[n.l++]&96)>>5,i=n.read_shift(2),a=4;if(t)switch(t.biff){case 5:a=15;break;case 12:a=6;break}return n.l+=a,[r,i]}var f3t=Kc,d3t=Kc,v3t=Kc;function F3(n,e,t){return n.l+=2,[ANt(n)]}function Toe(n){return n.l+=6,[]}var p3t=F3,g3t=Toe,y3t=Toe,m3t=F3;function vGe(n){return n.l+=2,[nu(n),n.read_shift(2)&1]}var _3t=F3,x3t=vGe,S3t=Toe,w3t=F3,b3t=F3,E3t=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function T3t(n){n.l+=2;var e=n.read_shift(2),t=n.read_shift(2),r=n.read_shift(4),i=n.read_shift(2),a=n.read_shift(2),o=E3t[t>>2&31];return{ixti:e,coltype:t&3,rt:o,idx:r,c:i,C:a}}function C3t(n){return n.l+=2,[n.read_shift(4)]}function A3t(n,e,t){return n.l+=5,n.l+=2,n.l+=t.biff==2?1:4,["PTGSHEET"]}function M3t(n,e,t){return n.l+=t.biff==2?4:5,["PTGENDSHEET"]}function I3t(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2);return[e,t]}function L3t(n){var e=n.read_shift(1)>>>5&3,t=n.read_shift(2);return[e,t]}function P3t(n){return n.l+=4,[0,0]}var H_e={1:{n:"PtgExp",f:ZNt},2:{n:"PtgTbl",f:v3t},3:{n:"PtgAdd",f:bu},4:{n:"PtgSub",f:bu},5:{n:"PtgMul",f:bu},6:{n:"PtgDiv",f:bu},7:{n:"PtgPower",f:bu},8:{n:"PtgConcat",f:bu},9:{n:"PtgLt",f:bu},10:{n:"PtgLe",f:bu},11:{n:"PtgEq",f:bu},12:{n:"PtgGe",f:bu},13:{n:"PtgGt",f:bu},14:{n:"PtgNe",f:bu},15:{n:"PtgIsect",f:bu},16:{n:"PtgUnion",f:bu},17:{n:"PtgRange",f:bu},18:{n:"PtgUplus",f:bu},19:{n:"PtgUminus",f:bu},20:{n:"PtgPercent",f:bu},21:{n:"PtgParen",f:bu},22:{n:"PtgMissArg",f:bu},23:{n:"PtgStr",f:t3t},26:{n:"PtgSheet",f:A3t},27:{n:"PtgEndSheet",f:M3t},28:{n:"PtgErr",f:KNt},29:{n:"PtgBool",f:QNt},30:{n:"PtgInt",f:JNt},31:{n:"PtgNum",f:e3t},32:{n:"PtgArray",f:NNt},33:{n:"PtgFunc",f:jNt},34:{n:"PtgFuncVar",f:XNt},35:{n:"PtgName",f:a3t},36:{n:"PtgRef",f:$Nt},37:{n:"PtgArea",f:LNt},38:{n:"PtgMemArea",f:l3t},39:{n:"PtgMemErr",f:f3t},40:{n:"PtgMemNoMem",f:d3t},41:{n:"PtgMemFunc",f:u3t},42:{n:"PtgRefErr",f:h3t},43:{n:"PtgAreaErr",f:ONt},44:{n:"PtgRefN",f:WNt},45:{n:"PtgAreaN",f:DNt},46:{n:"PtgMemAreaN",f:I3t},47:{n:"PtgMemNoMemN",f:L3t},57:{n:"PtgNameX",f:o3t},58:{n:"PtgRef3d",f:HNt},59:{n:"PtgArea3d",f:PNt},60:{n:"PtgRefErr3d",f:c3t},61:{n:"PtgAreaErr3d",f:RNt},255:{}},O3t={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},R3t={1:{n:"PtgElfLel",f:vGe},2:{n:"PtgElfRw",f:w3t},3:{n:"PtgElfCol",f:p3t},6:{n:"PtgElfRwV",f:b3t},7:{n:"PtgElfColV",f:m3t},10:{n:"PtgElfRadical",f:_3t},11:{n:"PtgElfRadicalS",f:S3t},13:{n:"PtgElfColS",f:g3t},15:{n:"PtgElfColSV",f:y3t},16:{n:"PtgElfRadicalLel",f:x3t},25:{n:"PtgList",f:T3t},29:{n:"PtgSxName",f:C3t},255:{}},D3t={0:{n:"PtgAttrNoop",f:P3t},1:{n:"PtgAttrSemi",f:zNt},2:{n:"PtgAttrIf",f:BNt},4:{n:"PtgAttrChoose",f:kNt},8:{n:"PtgAttrGoto",f:FNt},16:{n:"PtgAttrSum",f:qNt},32:{n:"PtgAttrBaxcel",f:W_e},33:{n:"PtgAttrBaxcel",f:W_e},64:{n:"PtgAttrSpace",f:UNt},65:{n:"PtgAttrSpaceSemi",f:VNt},128:{n:"PtgAttrIfError",f:GNt},255:{}};function B3(n,e,t,r){if(r.biff<8)return Kc(n,e);for(var i=n.l+e,a=[],o=0;o!==t.length;++o)switch(t[o][0]){case"PtgArray":t[o][1]=i3t(n,0,r),a.push(t[o][1]);break;case"PtgMemArea":t[o][2]=n3t(n,t[o][1],r),a.push(t[o][2]);break;case"PtgExp":r&&r.biff==12&&(t[o][1][1]=n.read_shift(4),a.push(t[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+t[o][0]}return e=i-n.l,e!==0&&a.push(Kc(n,e)),a}function G3(n,e,t){for(var r=n.l+e,i,a,o=[];r!=n.l;)e=r-n.l,a=n[n.l],i=H_e[a]||H_e[O3t[a]],(a===24||a===25)&&(i=(a===24?R3t:D3t)[n[n.l+1]]),!i||!i.f?Kc(n,e):o.push([i.n,i.f(n,e,t)]);return o}function N3t(n){for(var e=[],t=0;t<n.length;++t){for(var r=n[t],i=[],a=0;a<r.length;++a){var o=r[a];if(o)switch(o[0]){case 2:i.push('"'+o[1].replace(/"/g,'""')+'"');break;default:i.push(o[1])}else i.push("")}e.push(i.join(","))}return e.join(";")}var k3t={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function F3t(n,e){var t=n.lastIndexOf("!"),r=e.lastIndexOf("!");return t==-1&&r==-1?n+":"+e:t>0&&r>0&&n.slice(0,t).toLowerCase()==e.slice(0,r).toLowerCase()?n+":"+e.slice(r+1):(console.error("Cannot hydrate range",n,e),n+":"+e)}function pGe(n,e,t){if(!n)return"SH33TJSERR0";if(t.biff>8&&(!n.XTI||!n.XTI[e]))return n.SheetNames[e];if(!n.XTI)return"SH33TJSERR6";var r=n.XTI[e];if(t.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":n.XTI[e-1];if(!r)return"SH33TJSERR1";var i="";if(t.biff>8)switch(n[r[0]][0]){case 357:return i=r[1]==-1?"#REF":n.SheetNames[r[1]],r[1]==r[2]?i:i+":"+n.SheetNames[r[2]];case 358:return t.SID!=null?n.SheetNames[t.SID]:"SH33TJSSAME"+n[r[0]][0];case 355:default:return"SH33TJSSRC"+n[r[0]][0]}switch(n[r[0]][0][0]){case 1025:return i=r[1]==-1?"#REF":n.SheetNames[r[1]]||"SH33TJSERR3",r[1]==r[2]?i:i+":"+n.SheetNames[r[2]];case 14849:return n[r[0]].slice(1).map(function(a){return a.Name}).join(";;");default:return n[r[0]][0][3]?(i=r[1]==-1?"#REF":n[r[0]][0][3][r[1]]||"SH33TJSERR4",r[1]==r[2]?i:i+":"+n[r[0]][0][3][r[2]]):"SH33TJSERR2"}}function j_e(n,e,t){var r=pGe(n,e,t);return r=="#REF"?r:NPt(r,t)}function kc(n,e,t,r,i){var a=i&&i.biff||8,o={s:{c:0,r:0},e:{c:0,r:0}},s=[],l,u,h,c=0,f=0,d,v="";if(!n[0]||!n[0][0])return"";for(var p=-1,g="",m=0,y=n[0].length;m<y;++m){var _=n[0][m];switch(_[0]){case"PtgUminus":s.push("-"+s.pop());break;case"PtgUplus":s.push("+"+s.pop());break;case"PtgPercent":s.push(s.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(l=s.pop(),u=s.pop(),p>=0){switch(n[0][p][1][0]){case 0:g=wo(" ",n[0][p][1][1]);break;case 1:g=wo("\r",n[0][p][1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][p][1][0])}u=u+g,p=-1}s.push(u+k3t[_[0]]+l);break;case"PtgIsect":l=s.pop(),u=s.pop(),s.push(u+" "+l);break;case"PtgUnion":l=s.pop(),u=s.pop(),s.push(u+","+l);break;case"PtgRange":l=s.pop(),u=s.pop(),s.push(F3t(u,l));break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":h=oR(_[1][1],o,i),s.push(sR(h,a));break;case"PtgRefN":h=t?oR(_[1][1],t,i):_[1][1],s.push(sR(h,a));break;case"PtgRef3d":c=_[1][1],h=oR(_[1][2],o,i),v=j_e(r,c,i),s.push(v+"!"+sR(h,a));break;case"PtgFunc":case"PtgFuncVar":var x=_[1][0],S=_[1][1];x||(x=0),x&=127;var w=x==0?[]:s.slice(-x);s.length-=x,S==="User"&&(S=w.shift()),s.push(S+"("+w.join(",")+")");break;case"PtgBool":s.push(_[1]?"TRUE":"FALSE");break;case"PtgInt":s.push(_[1]);break;case"PtgNum":s.push(String(_[1]));break;case"PtgStr":s.push('"'+_[1].replace(/"/g,'""')+'"');break;case"PtgErr":s.push(_[1]);break;case"PtgAreaN":d=T_e(_[1][1],t?{s:t}:o,i),s.push(gX(d,i));break;case"PtgArea":d=T_e(_[1][1],o,i),s.push(gX(d,i));break;case"PtgArea3d":c=_[1][1],d=_[1][2],v=j_e(r,c,i),s.push(v+"!"+gX(d,i));break;case"PtgAttrSum":s.push("SUM("+s.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":f=_[1][2];var b=(r.names||[])[f-1]||(r[0]||[])[f],E=b?b.Name:"SH33TJSNAME"+String(f);E&&E.slice(0,6)=="_xlfn."&&!i.xlfn&&(E=E.slice(6)),s.push(E);break;case"PtgNameX":var T=_[1][1];f=_[1][2];var C;if(i.biff<=5)T<0&&(T=-T),r[T]&&(C=r[T][f]);else{var A="";if(((r[T]||[])[0]||[])[0]==14849||(((r[T]||[])[0]||[])[0]==1025?r[T][f]&&r[T][f].itab>0&&(A=r.SheetNames[r[T][f].itab-1]+"!"):A=r.SheetNames[f-1]+"!"),r[T]&&r[T][f])A+=r[T][f].Name;else if(r[0]&&r[0][f])A+=r[0][f].Name;else{var M=(pGe(r,T,i)||"").split(";;");M[f-1]?A=M[f-1]:A+="SH33TJSERRX"}s.push(A);break}C||(C={Name:"SH33TJSERRY"}),s.push(C.Name);break;case"PtgParen":var I="(",R=")";if(p>=0){switch(g="",n[0][p][1][0]){case 2:I=wo(" ",n[0][p][1][1])+I;break;case 3:I=wo("\r",n[0][p][1][1])+I;break;case 4:R=wo(" ",n[0][p][1][1])+R;break;case 5:R=wo("\r",n[0][p][1][1])+R;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+n[0][p][1][0])}p=-1}s.push(I+s.pop()+R);break;case"PtgRefErr":s.push("#REF!");break;case"PtgRefErr3d":s.push("#REF!");break;case"PtgExp":h={c:_[1][1],r:_[1][0]};var k={c:t.c,r:t.r};if(r.sharedf[bo(h)]){var D=r.sharedf[bo(h)];s.push(kc(D,o,k,r,i))}else{var G=!1;for(l=0;l!=r.arrayf.length;++l)if(u=r.arrayf[l],!(h.c<u[0].s.c||h.c>u[0].e.c)&&!(h.r<u[0].s.r||h.r>u[0].e.r)){s.push(kc(u[1],o,k,r,i)),G=!0;break}G||s.push(_[1])}break;case"PtgArray":s.push("{"+N3t(_[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":p=m;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":s.push("");break;case"PtgAreaErr":s.push("#REF!");break;case"PtgAreaErr3d":s.push("#REF!");break;case"PtgList":s.push("Table"+_[1].idx+"[#"+_[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(_));default:throw new Error("Unrecognized Formula Token: "+String(_))}var W=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&p>=0&&W.indexOf(n[0][m][0])==-1){_=n[0][p];var z=!0;switch(_[1][0]){case 4:z=!1;case 0:g=wo(" ",_[1][1]);break;case 5:z=!1;case 1:g=wo("\r",_[1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+_[1][0])}s.push((z?g:"")+s.pop()+(z?"":g)),p=-1}}if(s.length>1&&i.WTF)throw new Error("bad formula stack");return s[0]=="TRUE"?!0:s[0]=="FALSE"?!1:s[0]}function B3t(n,e,t){var r=n.l+e,i=t.biff==2?1:2,a,o=n.read_shift(i);if(o==65535)return[[],Kc(n,e-2)];var s=G3(n,o,t);return e!==o+i&&(a=B3(n,e-o-i,s,t)),n.l=r,[s,a]}function G3t(n,e,t){var r=n.l+e,i=t.biff==2?1:2,a,o=n.read_shift(i);if(o==65535)return[[],Kc(n,e-2)];var s=G3(n,o,t);return e!==o+i&&(a=B3(n,e-o-i,s,t)),n.l=r,[s,a]}function z3t(n,e,t,r){var i=n.l+e,a=G3(n,r,t),o;return i!==n.l&&(o=B3(n,i-n.l,a,t)),[a,o]}function U3t(n,e,t){var r=n.l+e,i,a=n.read_shift(2),o=G3(n,a,t);return a==65535?[[],Kc(n,e-2)]:(e!==a+2&&(i=B3(n,r-a-2,o,t)),[o,i])}function V3t(n){var e;if(R1(n,n.l+6)!==65535)return[Bc(n),"n"];switch(n[n.l]){case 0:return n.l+=8,["String","s"];case 1:return e=n[n.l+2]===1,n.l+=8,[e,"b"];case 2:return e=n[n.l+2],n.l+=8,[e,"e"];case 3:return n.l+=8,["","s"]}return[]}function _X(n,e,t){var r=n.l+e,i=Pm(n);t.biff==2&&++n.l;var a=V3t(n),o=n.read_shift(1);t.biff!=2&&(n.read_shift(1),t.biff>=5&&n.read_shift(4));var s=G3t(n,r-n.l,t);return{cell:i,val:a[0],formula:s,shared:o>>3&1,tt:a[1]}}function MU(n,e,t){var r=n.read_shift(4),i=G3(n,r,t),a=n.read_shift(4),o=a>0?B3(n,a,i,t):null;return[i,o]}var $3t=MU,IU=MU,W3t=MU,H3t=MU,j3t={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},gGe={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},X3t={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function X_e(n){return n.slice(0,3)=="of:"&&(n=n.slice(3)),n.charCodeAt(0)==61&&(n=n.slice(1),n.charCodeAt(0)==61&&(n=n.slice(1))),n=n.replace(/COM\.MICROSOFT\./g,""),n=n.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,t){return t.replace(/\./g,"")}),n=n.replace(/\$'([^']|'')+'/g,function(e){return e.slice(1)}),n=n.replace(/\$([^\]\. #$]+)/g,function(e,t){return t.match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})?$/)?e:t}),n=n.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),n.replace(/[;~]/g,",").replace(/\|/g,";")}function xX(n){n=n.replace(/\$'([^']|'')+'/g,function(r){return r.slice(1)}),n=n.replace(/\$([^\]\. #$]+)/g,function(r,i){return i.match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})?$/)?r:i});var e=n.split(":"),t=e[0].split(".")[0];return[t,e[0].split(".")[1]+(e.length>1?":"+(e[1].split(".")[1]||e[1].split(".")[0]):"")]}var cR={},VA={};function fR(n,e){if(!!n){var t=[.7,.7,.75,.75,.3,.3];e=="xlml"&&(t=[1,1,1,1,.5,.5]),n.left==null&&(n.left=t[0]),n.right==null&&(n.right=t[1]),n.top==null&&(n.top=t[2]),n.bottom==null&&(n.bottom=t[3]),n.header==null&&(n.header=t[4]),n.footer==null&&(n.footer=t[5])}}function yGe(n,e,t,r,i,a){try{r.cellNF&&(n.z=ji[e])}catch(s){if(r.WTF)throw s}if(!(n.t==="z"&&!r.cellStyles)){if(n.t==="d"&&typeof n.v=="string"&&(n.v=pc(n.v)),(!r||r.cellText!==!1)&&n.t!=="z")try{if(ji[e]==null&&OE(jLt[e]||"General",e),n.t==="e")n.w=n.w||nT[n.v];else if(e===0)if(n.t==="n")(n.v|0)===n.v?n.w=n.v.toString(10):n.w=ID(n.v);else if(n.t==="d"){var o=Zc(n.v);(o|0)===o?n.w=o.toString(10):n.w=ID(o)}else{if(n.v===void 0)return"";n.w=e2(n.v,VA)}else n.t==="d"?n.w=Cv(e,Zc(n.v),VA):n.w=Cv(e,n.v,VA)}catch(s){if(r.WTF)throw s}if(!!r.cellStyles&&t!=null)try{n.s=a.Fills[t],n.s.fgColor&&n.s.fgColor.theme&&!n.s.fgColor.rgb&&(n.s.fgColor.rgb=e9(i.themeElements.clrScheme[n.s.fgColor.theme].rgb,n.s.fgColor.tint||0),r.WTF&&(n.s.fgColor.raw_rgb=i.themeElements.clrScheme[n.s.fgColor.theme].rgb)),n.s.bgColor&&n.s.bgColor.theme&&(n.s.bgColor.rgb=e9(i.themeElements.clrScheme[n.s.bgColor.theme].rgb,n.s.bgColor.tint||0),r.WTF&&(n.s.bgColor.raw_rgb=i.themeElements.clrScheme[n.s.bgColor.theme].rgb))}catch(s){if(r.WTF&&a.Fills)throw s}}}function Y3t(n,e){var t=cu(e);t.s.r<=t.e.r&&t.s.c<=t.e.c&&t.s.r>=0&&t.s.c>=0&&(n["!ref"]=lo(t))}var q3t=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,Z3t=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,K3t=/<(?:\w:)?hyperlink [^>]*>/mg,J3t=/"(\w*:\w*)"/,Q3t=/<(?:\w:)?col\b[^>]*[\/]?>/g,ekt=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,tkt=/<(?:\w:)?pageMargins[^>]*\/>/g,mGe=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,rkt=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,nkt=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function ikt(n,e,t,r,i,a,o){if(!n)return n;r||(r={"!id":{}});var s={};e.dense&&(s["!data"]=[]);var l={s:{r:2e6,c:2e6},e:{r:0,c:0}},u="",h="",c=n.match(Z3t);c?(u=n.slice(0,c.index),h=n.slice(c.index+c[0].length)):u=h=n;var f=u.match(mGe);f?Coe(f[0],s,i,t):(f=u.match(rkt))&&akt(f[0],f[1]||"",s,i,t);var d=(u.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(d>0){var v=u.slice(d,d+50).match(J3t);v&&!(e&&e.nodim)&&Y3t(s,v[1])}var p=u.match(nkt);p&&p[1]&&ckt(p[1],i);var g=[];if(e.cellStyles){var m=u.match(Q3t);m&&lkt(g,m)}c&&fkt(c[1],s,e,l,a,o);var y=h.match(ekt);y&&(s["!autofilter"]=ukt(y[0]));var _=[],x=h.match(q3t);if(x)for(d=0;d!=x.length;++d)_[d]=cu(x[d].slice(x[d].indexOf('"')+1));var S=h.match(K3t);S&&okt(s,S,r);var w=h.match(tkt);if(w&&(s["!margins"]=skt(Tn(w[0]))),e&&e.nodim&&(l.s.c=l.s.r=0),!s["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(s["!ref"]=lo(l)),e.sheetRows>0&&s["!ref"]){var b=cu(s["!ref"]);e.sheetRows<=+b.e.r&&(b.e.r=e.sheetRows-1,b.e.r>l.e.r&&(b.e.r=l.e.r),b.e.r<b.s.r&&(b.s.r=b.e.r),b.e.c>l.e.c&&(b.e.c=l.e.c),b.e.c<b.s.c&&(b.s.c=b.e.c),s["!fullref"]=s["!ref"],s["!ref"]=lo(b))}return g.length>0&&(s["!cols"]=g),_.length>0&&(s["!merges"]=_),s}function Coe(n,e,t,r){var i=Tn(n);t.Sheets[r]||(t.Sheets[r]={}),i.codeName&&(t.Sheets[r].CodeName=so(As(i.codeName)))}function akt(n,e,t,r,i){Coe(n.slice(0,n.indexOf(">")),t,r,i)}function okt(n,e,t){for(var r=n["!data"]!=null,i=0;i!=e.length;++i){var a=Tn(As(e[i]),!0);if(!a.ref)return;var o=((t||{})["!id"]||[])[a.id];o?(a.Target=o.Target,a.location&&(a.Target+="#"+so(a.location))):(a.Target="#"+so(a.location),o={Target:a.Target,TargetMode:"Internal"}),a.Rel=o,a.tooltip&&(a.Tooltip=a.tooltip,delete a.tooltip);for(var s=cu(a.ref),l=s.s.r;l<=s.e.r;++l)for(var u=s.s.c;u<=s.e.c;++u){var h=$o(u)+ys(l);r?(n["!data"][l]||(n["!data"][l]=[]),n["!data"][l][u]||(n["!data"][l][u]={t:"z",v:void 0}),n["!data"][l][u].l=a):(n[h]||(n[h]={t:"z",v:void 0}),n[h].l=a)}}}function skt(n){var e={};return["left","right","top","bottom","header","footer"].forEach(function(t){n[t]&&(e[t]=parseFloat(n[t]))}),e}function lkt(n,e){for(var t=!1,r=0;r!=e.length;++r){var i=Tn(e[r],!0);i.hidden&&(i.hidden=ps(i.hidden));var a=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!t&&i.width&&(t=!0,Eoe(i.width)),wM(i);a<=o;)n[a++]=sh(i)}}function ukt(n){var e={ref:(n.match(/ref="([^"]*)"/)||[])[1]};return e}var hkt=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/g;function ckt(n,e){e.Views||(e.Views=[{}]),(n.match(hkt)||[]).forEach(function(t,r){var i=Tn(t);e.Views[r]||(e.Views[r]={}),+i.zoomScale&&(e.Views[r].zoom=+i.zoomScale),i.rightToLeft&&ps(i.rightToLeft)&&(e.Views[r].RTL=!0)})}var fkt=function(){var n=/<(?:\w+:)?c[ \/>]/,e=/<\/(?:\w+:)?row>/,t=/r=["']([^"']*)["']/,r=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,a=LD("v"),o=LD("f");return function(l,u,h,c,f,d){for(var v=0,p="",g=[],m=[],y=0,_=0,x=0,S="",w,b,E=0,T=0,C,A,M=0,I=0,R=Array.isArray(d.CellXf),k,D=[],G=[],W=u["!data"]!=null,z=[],V={},q=!1,Y=!!h.sheetStubs,le=l.split(e),j=0,Q=le.length;j!=Q;++j){p=le[j].trim();var ie=p.length;if(ie===0)continue;var oe=0;e:for(v=0;v<ie;++v)switch(p[v]){case">":if(p[v-1]!="/"){++v;break e}if(h&&h.cellStyles){if(b=Tn(p.slice(oe,v),!0),E=b.r!=null?parseInt(b.r,10):E+1,T=-1,h.sheetRows&&h.sheetRows<E)continue;V={},q=!1,b.ht&&(q=!0,V.hpt=parseFloat(b.ht),V.hpx=RD(V.hpt)),b.hidden&&ps(b.hidden)&&(q=!0,V.hidden=!0),b.outlineLevel!=null&&(q=!0,V.level=+b.outlineLevel),q&&(z[E-1]=V)}break;case"<":oe=v;break}if(oe>=v)break;if(b=Tn(p.slice(oe,v),!0),E=b.r!=null?parseInt(b.r,10):E+1,T=-1,!(h.sheetRows&&h.sheetRows<E)){h.nodim||(c.s.r>E-1&&(c.s.r=E-1),c.e.r<E-1&&(c.e.r=E-1)),h&&h.cellStyles&&(V={},q=!1,b.ht&&(q=!0,V.hpt=parseFloat(b.ht),V.hpx=RD(V.hpt)),b.hidden&&ps(b.hidden)&&(q=!0,V.hidden=!0),b.outlineLevel!=null&&(q=!0,V.level=+b.outlineLevel),q&&(z[E-1]=V)),g=p.slice(v).split(n);for(var se=0;se!=g.length&&g[se].trim().charAt(0)=="<";++se);for(g=g.slice(se),v=0;v!=g.length;++v)if(p=g[v].trim(),p.length!==0){if(m=p.match(t),y=v,_=0,x=0,p="<c "+(p.slice(0,1)=="<"?">":"")+p,m!=null&&m.length===2){for(y=0,S=m[1],_=0;_!=S.length&&!((x=S.charCodeAt(_)-64)<1||x>26);++_)y=26*y+x;--y,T=y}else++T;for(_=0;_!=p.length&&p.charCodeAt(_)!==62;++_);if(++_,b=Tn(p.slice(0,_),!0),b.r||(b.r=bo({r:E-1,c:T})),S=p.slice(_),w={t:""},(m=S.match(a))!=null&&m[1]!==""&&(w.v=so(m[1])),h.cellFormula){if((m=S.match(o))!=null&&m[1]!==""){if(w.f=so(As(m[1]),!0),h.xlfn||(w.f=$_e(w.f)),m[0].indexOf('t="array"')>-1)w.F=(S.match(i)||[])[1],w.F.indexOf(":")>-1&&D.push([cu(w.F),w.F]);else if(m[0].indexOf('t="shared"')>-1){A=Tn(m[0]);var me=so(As(m[1]));h.xlfn||(me=$_e(me)),G[parseInt(A.si,10)]=[A,me,b.r]}}else(m=S.match(/<f[^>]*\/>/))&&(A=Tn(m[0]),G[A.si]&&(w.f=bNt(G[A.si][1],G[A.si][2],b.r)));var Ce=zc(b.r);for(_=0;_<D.length;++_)Ce.r>=D[_][0].s.r&&Ce.r<=D[_][0].e.r&&Ce.c>=D[_][0].s.c&&Ce.c<=D[_][0].e.c&&(w.F=D[_][1])}if(b.t==null&&w.v===void 0)if(w.f||w.F)w.v=0,w.t="n";else if(Y)w.t="z";else continue;else w.t=b.t||"n";switch(c.s.c>T&&(c.s.c=T),c.e.c<T&&(c.e.c=T),w.t){case"n":if(w.v==""||w.v==null){if(!Y)continue;w.t="z"}else w.v=parseFloat(w.v);break;case"s":if(typeof w.v>"u"){if(!Y)continue;w.t="z"}else C=cR[parseInt(w.v,10)],w.v=C.t,w.r=C.r,h.cellHTML&&(w.h=C.h);break;case"str":w.t="s",w.v=w.v!=null?so(As(w.v),!0):"",h.cellHTML&&(w.h=ZG(w.v));break;case"inlineStr":m=S.match(r),w.t="s",m!=null&&(C=boe(m[1]))?(w.v=C.t,h.cellHTML&&(w.h=C.h)):w.v="";break;case"b":w.v=ps(w.v);break;case"d":h.cellDates?w.v=pc(w.v,1):(w.v=Zc(pc(w.v,1)),w.t="n");break;case"e":(!h||h.cellText!==!1)&&(w.w=w.v),w.v=B8e[w.v];break}if(M=I=0,k=null,R&&b.s!==void 0&&(k=d.CellXf[b.s],k!=null&&(k.numFmtId!=null&&(M=k.numFmtId),h.cellStyles&&k.fillId!=null&&(I=k.fillId))),yGe(w,M,I,h,f,d),h.cellDates&&R&&w.t=="n"&&Q2(ji[M])&&(w.t="d",w.v=TU(w.v)),b.cm&&h.xlmeta){var Le=(h.xlmeta.Cell||[])[+b.cm-1];Le&&Le.type=="XLDAPR"&&(w.D=!0)}var re;h.nodim&&(re=zc(b.r),c.s.r>re.r&&(c.s.r=re.r),c.e.r<re.r&&(c.e.r=re.r)),W?(re=zc(b.r),u["!data"][re.r]||(u["!data"][re.r]=[]),u["!data"][re.r][re.c]=w):u[b.r]=w}}}z.length>0&&(u["!rows"]=z)}}();function dkt(n,e){var t={},r=n.l+e;t.r=n.read_shift(4),n.l+=4;var i=n.read_shift(2);n.l+=1;var a=n.read_shift(1);return n.l=r,a&7&&(t.level=a&7),a&16&&(t.hidden=!0),a&32&&(t.hpt=i/20),t}var vkt=rT;function pkt(){}function gkt(n,e){var t={},r=n[n.l];return++n.l,t.above=!(r&64),t.left=!(r&128),n.l+=18,t.name=GPt(n),t}function ykt(n){var e=og(n);return[e]}function mkt(n){var e=tT(n);return[e]}function _kt(n){var e=og(n),t=n.read_shift(1);return[e,t,"b"]}function xkt(n){var e=tT(n),t=n.read_shift(1);return[e,t,"b"]}function Skt(n){var e=og(n),t=n.read_shift(1);return[e,t,"e"]}function wkt(n){var e=tT(n),t=n.read_shift(1);return[e,t,"e"]}function bkt(n){var e=og(n),t=n.read_shift(4);return[e,t,"s"]}function Ekt(n){var e=tT(n),t=n.read_shift(4);return[e,t,"s"]}function Tkt(n){var e=og(n),t=Bc(n);return[e,t,"n"]}function _Ge(n){var e=tT(n),t=Bc(n);return[e,t,"n"]}function Ckt(n){var e=og(n),t=xoe(n);return[e,t,"n"]}function Akt(n){var e=tT(n),t=xoe(n);return[e,t,"n"]}function Mkt(n){var e=og(n),t=moe(n);return[e,t,"is"]}function Ikt(n){var e=og(n),t=Wc(n);return[e,t,"str"]}function Lkt(n){var e=tT(n),t=Wc(n);return[e,t,"str"]}function Pkt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=n.read_shift(1),o=[i,a,"b"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}function Okt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=n.read_shift(1),o=[i,a,"e"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}function Rkt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=Bc(n),o=[i,a,"n"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}function Dkt(n,e,t){var r=n.l+e,i=og(n);i.r=t["!row"];var a=Wc(n),o=[i,a,"str"];if(t.cellFormula){n.l+=2;var s=IU(n,r-n.l,t);o[3]=kc(s,null,i,t.supbooks,t)}else n.l=r;return o}var Nkt=rT;function kkt(n,e){var t=n.l+e,r=rT(n),i=_oe(n),a=Wc(n),o=Wc(n),s=Wc(n);n.l=t;var l={rfx:r,relId:i,loc:a,display:s};return o&&(l.Tooltip=o),l}function Fkt(){}function Bkt(n,e,t){var r=n.l+e,i=N8e(n),a=n.read_shift(1),o=[i];if(o[2]=a,t.cellFormula){var s=$3t(n,r-n.l,t);o[1]=s}else n.l=r;return o}function Gkt(n,e,t){var r=n.l+e,i=rT(n),a=[i];if(t.cellFormula){var o=H3t(n,r-n.l,t);a[1]=o,n.l=r}else n.l=r;return a}var zkt=["left","right","top","bottom","header","footer"];function Ukt(n){var e={};return zkt.forEach(function(t){e[t]=Bc(n)}),e}function Vkt(n){var e=n.read_shift(2);return n.l+=28,{RTL:e&32}}function $kt(){}function Wkt(){}function Hkt(n,e,t,r,i,a,o){if(!n)return n;var s=e||{};r||(r={"!id":{}});var l={};s.dense&&(l["!data"]=[]);var u,h={s:{r:2e6,c:2e6},e:{r:0,c:0}},c=!1,f=!1,d,v,p,g,m,y,_,x,S,w=[];s.biff=12,s["!row"]=0;var b=0,E=!1,T=[],C={},A=s.supbooks||i.supbooks||[[]];if(A.sharedf=C,A.arrayf=T,A.SheetNames=i.SheetNames||i.Sheets.map(function(W){return W.name}),!s.supbooks&&(s.supbooks=A,i.Names))for(var M=0;M<i.Names.length;++M)A[0][M+1]=i.Names[M];var I=[],R=[],k=!1;n9[16]={n:"BrtShortReal",f:_Ge};var D;if(B_(n,function(z,V,q){if(!f)switch(q){case 148:u=z;break;case 0:d=z,s.sheetRows&&s.sheetRows<=d.r&&(f=!0),x=ys(g=d.r),s["!row"]=d.r,(z.hidden||z.hpt||z.level!=null)&&(z.hpt&&(z.hpx=RD(z.hpt)),R[z.r]=z);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(v={t:z[2]},z[2]){case"n":v.v=z[1];break;case"s":_=cR[z[1]],v.v=_.t,v.r=_.r;break;case"b":v.v=!!z[1];break;case"e":v.v=z[1],s.cellText!==!1&&(v.w=nT[v.v]);break;case"str":v.t="s",v.v=z[1];break;case"is":v.t="s",v.v=z[1].t;break}if((p=o.CellXf[z[0].iStyleRef])&&yGe(v,p.numFmtId,null,s,a,o),m=z[0].c==-1?m+1:z[0].c,s.dense?(l["!data"][g]||(l["!data"][g]=[]),l["!data"][g][m]=v):l[$o(m)+x]=v,s.cellFormula){for(E=!1,b=0;b<T.length;++b){var Y=T[b];d.r>=Y[0].s.r&&d.r<=Y[0].e.r&&m>=Y[0].s.c&&m<=Y[0].e.c&&(v.F=lo(Y[0]),E=!0)}!E&&z.length>3&&(v.f=z[3])}if(h.s.r>d.r&&(h.s.r=d.r),h.s.c>m&&(h.s.c=m),h.e.r<d.r&&(h.e.r=d.r),h.e.c<m&&(h.e.c=m),s.cellDates&&p&&v.t=="n"&&Q2(ji[p.numFmtId])){var le=uE(v.v);le&&(v.t="d",v.v=new Date(le.y,le.m-1,le.d,le.H,le.M,le.S,le.u))}D&&(D.type=="XLDAPR"&&(v.D=!0),D=void 0);break;case 1:case 12:if(!s.sheetStubs||c)break;v={t:"z",v:void 0},m=z[0].c==-1?m+1:z[0].c,s.dense?(l["!data"][g]||(l["!data"][g]=[]),l["!data"][g][m]=v):l[$o(m)+x]=v,h.s.r>d.r&&(h.s.r=d.r),h.s.c>m&&(h.s.c=m),h.e.r<d.r&&(h.e.r=d.r),h.e.c<m&&(h.e.c=m),D&&(D.type=="XLDAPR"&&(v.D=!0),D=void 0);break;case 176:w.push(z);break;case 49:D=((s.xlmeta||{}).Cell||[])[z-1];break;case 494:var j=r["!id"][z.relId];for(j?(z.Target=j.Target,z.loc&&(z.Target+="#"+z.loc),z.Rel=j):z.relId==""&&(z.Target="#"+z.loc),g=z.rfx.s.r;g<=z.rfx.e.r;++g)for(m=z.rfx.s.c;m<=z.rfx.e.c;++m)s.dense?(l["!data"][g]||(l["!data"][g]=[]),l["!data"][g][m]||(l["!data"][g][m]={t:"z",v:void 0}),l["!data"][g][m].l=z):(y=$o(m)+ys(g),l[y]||(l[y]={t:"z",v:void 0}),l[y].l=z);break;case 426:if(!s.cellFormula)break;T.push(z),S=s.dense?l["!data"][g][m]:l[$o(m)+x],S.f=kc(z[1],h,{r:d.r,c:m},A,s),S.F=lo(z[0]);break;case 427:if(!s.cellFormula)break;C[bo(z[0].s)]=z[1],S=s.dense?l["!data"][g][m]:l[$o(m)+x],S.f=kc(z[1],h,{r:d.r,c:m},A,s);break;case 60:if(!s.cellStyles)break;for(;z.e>=z.s;)I[z.e--]={width:z.w/256,hidden:!!(z.flags&1),level:z.level},k||(k=!0,Eoe(z.w/256)),wM(I[z.e+1]);break;case 161:l["!autofilter"]={ref:lo(z)};break;case 476:l["!margins"]=z;break;case 147:i.Sheets[t]||(i.Sheets[t]={}),z.name&&(i.Sheets[t].CodeName=z.name),(z.above||z.left)&&(l["!outline"]={above:z.above,left:z.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),z.RTL&&(i.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:c=!0;break;case 36:c=!1;break;case 37:c=!0;break;case 38:c=!1;break;default:if(!V.T){if(!c||s.WTF)throw new Error("Unexpected record 0x"+q.toString(16))}}},s),delete s.supbooks,delete s["!row"],!l["!ref"]&&(h.s.r<2e6||u&&(u.e.r>0||u.e.c>0||u.s.r>0||u.s.c>0))&&(l["!ref"]=lo(u||h)),s.sheetRows&&l["!ref"]){var G=cu(l["!ref"]);s.sheetRows<=+G.e.r&&(G.e.r=s.sheetRows-1,G.e.r>h.e.r&&(G.e.r=h.e.r),G.e.r<G.s.r&&(G.s.r=G.e.r),G.e.c>h.e.c&&(G.e.c=h.e.c),G.e.c<G.s.c&&(G.s.c=G.e.c),l["!fullref"]=l["!ref"],l["!ref"]=lo(G))}return w.length>0&&(l["!merges"]=w),I.length>0&&(l["!cols"]=I),R.length>0&&(l["!rows"]=R),l}function jkt(n){var e=[],t=n.match(/^<c:numCache>/),r;(n.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(a){var o=a.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);!o||(e[+o[1]]=t?+o[2]:o[2])});var i=so((n.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(n.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(a){r=a.replace(/<.*?>/g,"")}),[e,i,r]}function Xkt(n,e,t,r,i,a){var o=a||{"!type":"chart"};if(!n)return a;var s=0,l=0,u="A",h={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(n.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(c){var f=jkt(c);h.s.r=h.s.c=0,h.e.c=s,u=$o(s),f[0].forEach(function(d,v){o["!data"]?(o["!data"][v]||(o["!data"][v]=[]),o["!data"][v][s]={t:"n",v:d,z:f[1]}):o[u+ys(v)]={t:"n",v:d,z:f[1]},l=v}),h.e.r<l&&(h.e.r=l),++s}),s>0&&(o["!ref"]=lo(h)),o}function Ykt(n,e,t,r,i){if(!n)return n;r||(r={"!id":{}});var a={"!type":"chart","!drawel":null,"!rel":""},o,s=n.match(mGe);return s&&Coe(s[0],a,i,t),(o=n.match(/drawing r:id="(.*?)"/))&&(a["!rel"]=o[1]),r["!id"][a["!rel"]]&&(a["!drawel"]=r["!id"][a["!rel"]]),a}function qkt(n,e){n.l+=10;var t=Wc(n);return{name:t}}function Zkt(n,e,t,r,i){if(!n)return n;r||(r={"!id":{}});var a={"!type":"chart","!drawel":null,"!rel":""},o=!1;return B_(n,function(l,u,h){switch(h){case 550:a["!rel"]=l;break;case 651:i.Sheets[t]||(i.Sheets[t]={}),l.name&&(i.Sheets[t].CodeName=l.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:break;case 38:break;default:if(!(u.T>0)){if(!(u.T<0)){if(!o||e.WTF)throw new Error("Unexpected record 0x"+h.toString(16))}}}},e),r["!id"][a["!rel"]]&&(a["!drawel"]=r["!id"][a["!rel"]]),a}var xGe=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],Kkt=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],Jkt=[],Qkt=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function Y_e(n,e){for(var t=0;t!=n.length;++t)for(var r=n[t],i=0;i!=e.length;++i){var a=e[i];if(r[a[0]]==null)r[a[0]]=a[1];else switch(a[2]){case"bool":typeof r[a[0]]=="string"&&(r[a[0]]=ps(r[a[0]]));break;case"int":typeof r[a[0]]=="string"&&(r[a[0]]=parseInt(r[a[0]],10));break}}}function q_e(n,e){for(var t=0;t!=e.length;++t){var r=e[t];if(n[r[0]]==null)n[r[0]]=r[1];else switch(r[2]){case"bool":typeof n[r[0]]=="string"&&(n[r[0]]=ps(n[r[0]]));break;case"int":typeof n[r[0]]=="string"&&(n[r[0]]=parseInt(n[r[0]],10));break}}}function SGe(n){q_e(n.WBProps,xGe),q_e(n.CalcPr,Qkt),Y_e(n.WBView,Kkt),Y_e(n.Sheets,Jkt),VA.date1904=ps(n.WBProps.date1904)}var eFt=":][*?/\\".split("");function tFt(n,e){try{if(n=="")throw new Error("Sheet name cannot be blank");if(n.length>31)throw new Error("Sheet name cannot exceed 31 chars");if(n.charCodeAt(0)==39||n.charCodeAt(n.length-1)==39)throw new Error("Sheet name cannot start or end with apostrophe (')");if(n.toLowerCase()=="history")throw new Error("Sheet name cannot be 'History'");eFt.forEach(function(t){if(n.indexOf(t)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")})}catch(t){if(e)return!1;throw t}return!0}var rFt=/<\w+:workbook/;function nFt(n,e){if(!n)throw new Error("Could not find file");var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},r=!1,i="xmlns",a={},o=0;if(n.replace(nf,function(l,u){var h=Tn(l);switch(N0(h[0])){case"<?xml":break;case"<workbook":l.match(rFt)&&(i="xmlns"+l.match(/<(\w+):/)[1]),t.xmlns=h[i];break;case"</workbook>":break;case"<fileVersion":delete h[0],t.AppVersion=h;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":xGe.forEach(function(c){if(h[c[0]]!=null)switch(c[2]){case"bool":t.WBProps[c[0]]=ps(h[c[0]]);break;case"int":t.WBProps[c[0]]=parseInt(h[c[0]],10);break;default:t.WBProps[c[0]]=h[c[0]]}}),h.codeName&&(t.WBProps.CodeName=As(h.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete h[0],t.WBView.push(h);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(h.state){case"hidden":h.Hidden=1;break;case"veryHidden":h.Hidden=2;break;default:h.Hidden=0}delete h.state,h.name=so(As(h.name)),delete h[0],t.Sheets.push(h);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":r=!0;break;case"</definedNames>":r=!1;break;case"<definedName":a={},a.Name=As(h.name),h.comment&&(a.Comment=h.comment),h.localSheetId&&(a.Sheet=+h.localSheetId),ps(h.hidden||"0")&&(a.Hidden=!0),o=u+l.length;break;case"</definedName>":a.Ref=so(As(n.slice(o,u))),t.Names.push(a);break;case"<definedName/>":break;case"<calcPr":delete h[0],t.CalcPr=h;break;case"<calcPr/>":delete h[0],t.CalcPr=h;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":r=!0;break;case"</ext>":r=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":r=!0;break;case"</AlternateContent>":r=!1;break;case"<revisionPtr":break;default:if(!r&&e.WTF)throw new Error("unrecognized "+h[0]+" in workbook")}return l}),SPt.indexOf(t.xmlns)===-1)throw new Error("Unknown Namespace: "+t.xmlns);return SGe(t),t}function iFt(n,e){var t={};return t.Hidden=n.read_shift(4),t.iTabID=n.read_shift(4),t.strRelID=mQ(n),t.name=Wc(n),t}function aFt(n,e){var t={},r=n.read_shift(4);t.defaultThemeVersion=n.read_shift(4);var i=e>8?Wc(n):"";return i.length>0&&(t.CodeName=i),t.autoCompressPictures=!!(r&65536),t.backupFile=!!(r&64),t.checkCompatibility=!!(r&4096),t.date1904=!!(r&1),t.filterPrivacy=!!(r&8),t.hidePivotFieldList=!!(r&1024),t.promptedSolutions=!!(r&16),t.publishItems=!!(r&2048),t.refreshAllConnections=!!(r&262144),t.saveExternalLinkValues=!!(r&128),t.showBorderUnselectedTables=!!(r&4),t.showInkAnnotation=!!(r&32),t.showObjects=["all","placeholders","none"][r>>13&3],t.showPivotChartFilter=!!(r&32768),t.updateLinks=["userSet","never","always"][r>>8&3],t}function oFt(n,e){var t={};return n.read_shift(4),t.ArchID=n.read_shift(4),n.l+=e-8,t}function sFt(n,e,t){var r=n.l+e,i=n.read_shift(4);n.l+=1;var a=n.read_shift(4),o=zPt(n),s=W3t(n,0,t),l=_oe(n);i&32&&(o="_xlnm."+o),n.l=r;var u={Name:o,Ptg:s,Flags:i};return a<268435455&&(u.Sheet=a),l&&(u.Comment=l),u}function lFt(n,e){var t={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},r=[],i=!1;e||(e={}),e.biff=12;var a=[],o=[[]];return o.SheetNames=[],o.XTI=[],n9[16]={n:"BrtFRTArchID$",f:oFt},B_(n,function(l,u,h){switch(h){case 156:o.SheetNames.push(l.name),t.Sheets.push(l);break;case 153:t.WBProps=l;break;case 39:l.Sheet!=null&&(e.SID=l.Sheet),l.Ref=kc(l.Ptg,null,null,o,e),delete e.SID,delete l.Ptg,a.push(l);break;case 1036:break;case 357:case 358:case 355:case 667:o[0].length?o.push([h,l]):o[0]=[h,l],o[o.length-1].XTI=[];break;case 362:o.length===0&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(l),o.XTI=o.XTI.concat(l);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:r.push(h),i=!0;break;case 36:r.pop(),i=!1;break;case 37:r.push(h),i=!0;break;case 38:r.pop(),i=!1;break;case 16:break;default:if(!u.T){if(!i||e.WTF&&r[r.length-1]!=37&&r[r.length-1]!=35)throw new Error("Unexpected record 0x"+h.toString(16))}}},e),SGe(t),t.Names=a,t.supbooks=o,t}function uFt(n,e,t){return e.slice(-4)===".bin"?lFt(n,t):nFt(n,t)}function hFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?Hkt(n,r,t,i,a,o,s):ikt(n,r,t,i,a,o,s)}function cFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?Zkt(n,r,t,i,a):Ykt(n,r,t,i,a)}function fFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?xNt():SNt()}function dFt(n,e,t,r,i,a,o,s){return e.slice(-4)===".bin"?mNt():_Nt()}function vFt(n,e,t,r){return e.slice(-4)===".bin"?NDt(n,t,r):IDt(n,t,r)}function pFt(n,e,t){return e.slice(-4)===".bin"?ZRt(n,t):YRt(n,t)}function gFt(n,e,t){return e.slice(-4)===".bin"?pNt(n,t):hNt(n,t)}function yFt(n,e,t){return e.slice(-4)===".bin"?sNt(n):aNt(n)}function mFt(n,e,t,r){return t.slice(-4)===".bin"?lNt(n,e,t,r):void 0}function _Ft(n,e,t){return e.slice(-4)===".bin"?nNt(n,e,t):iNt(n,e,t)}var wGe=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,bGe=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function Cg(n,e){var t=n.split(/\s+/),r=[];if(e||(r[0]=t[0]),t.length===1)return r;var i=n.match(wGe),a,o,s,l;if(i)for(l=0;l!=i.length;++l)a=i[l].match(bGe),(o=a[1].indexOf(":"))===-1?r[a[1]]=a[2].slice(1,a[2].length-1):(a[1].slice(0,6)==="xmlns:"?s="xmlns"+a[1].slice(6):s=a[1].slice(o+1),r[s]=a[2].slice(1,a[2].length-1));return r}function xFt(n){var e=n.split(/\s+/),t={};if(e.length===1)return t;var r=n.match(wGe),i,a,o,s;if(r)for(s=0;s!=r.length;++s)i=r[s].match(bGe),(a=i[1].indexOf(":"))===-1?t[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(a+1),t[o]=i[2].slice(1,i[2].length-1));return t}var dR;function SFt(n,e){var t=dR[n]||so(n);return t==="General"?e2(e):Cv(t,e)}function wFt(n,e,t,r){var i=r;switch((t[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=ps(r);break;case"i2":case"int":i=parseInt(r,10);break;case"r4":case"float":i=parseFloat(r);break;case"date":case"dateTime.tz":i=pc(r);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+t[0])}n[so(e)]=i}function bFt(n,e,t){if(n.t!=="z"){if(!t||t.cellText!==!1)try{n.t==="e"?n.w=n.w||nT[n.v]:e==="General"?n.t==="n"?(n.v|0)===n.v?n.w=n.v.toString(10):n.w=ID(n.v):n.w=e2(n.v):n.w=SFt(e||"General",n.v)}catch(a){if(t.WTF)throw a}try{var r=dR[e]||e||"General";if(t.cellNF&&(n.z=r),t.cellDates&&n.t=="n"&&Q2(r)){var i=uE(n.v);i&&(n.t="d",n.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(a){if(t.WTF)throw a}}}function EFt(n,e,t){if(t.cellStyles&&e.Interior){var r=e.Interior;r.Pattern&&(r.patternType=bDt[r.Pattern]||r.Pattern)}n[e.ID]=e}function TFt(n,e,t,r,i,a,o,s,l,u){var h="General",c=r.StyleID,f={};u=u||{};var d=[],v=0;for(c===void 0&&s&&(c=s.StyleID),c===void 0&&o&&(c=o.StyleID);a[c]!==void 0&&(a[c].nf&&(h=a[c].nf),a[c].Interior&&d.push(a[c].Interior),!!a[c].Parent);)c=a[c].Parent;switch(t.Type){case"Boolean":r.t="b",r.v=ps(n);break;case"String":r.t="s",r.r=g_e(so(n)),r.v=n.indexOf("<")>-1?so(e||n).replace(/<.*?>/g,""):r.r;break;case"DateTime":n.slice(-1)!="Z"&&(n+="Z"),r.v=(pc(n)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3),r.v!==r.v?r.v=so(n):r.v<60&&(r.v=r.v-1),(!h||h=="General")&&(h="yyyy-mm-dd");case"Number":r.v===void 0&&(r.v=+n),r.t||(r.t="n");break;case"Error":r.t="e",r.v=B8e[n],u.cellText!==!1&&(r.w=n);break;default:n==""&&e==""?r.t="z":(r.t="s",r.v=g_e(e||n));break}if(bFt(r,h,u),u.cellFormula!==!1)if(r.Formula){var p=so(r.Formula);p.charCodeAt(0)==61&&(p=p.slice(1)),r.f=DE(p,i),delete r.Formula,r.ArrayRange=="RC"?r.F=DE("RC:RC",i):r.ArrayRange&&(r.F=DE(r.ArrayRange,i),l.push([cu(r.F),r.F]))}else for(v=0;v<l.length;++v)i.r>=l[v][0].s.r&&i.r<=l[v][0].e.r&&i.c>=l[v][0].s.c&&i.c<=l[v][0].e.c&&(r.F=l[v][1]);u.cellStyles&&(d.forEach(function(g){!f.patternType&&g.patternType&&(f.patternType=g.patternType)}),r.s=f),r.StyleID!==void 0&&(r.ixfe=r.StyleID)}function CFt(n){return G8e.indexOf("_xlnm."+n)>-1?"_xlnm."+n:n}function AFt(n){n.t=n.v||"",n.t=n.t.replace(/\r\n/g,`
`).replace(/\r/g,`
`),n.v=n.w=n.ixfe=void 0}function SX(n,e){var t=e||{};u8e();var r=hO(CU(n));(t.type=="binary"||t.type=="array"||t.type=="base64")&&(r=As(r));var i=r.slice(0,1024).toLowerCase(),a=!1;if(i=i.replace(/".*?"/g,""),(i.indexOf(">")&1023)>Math.min(i.indexOf(",")&1023,i.indexOf(";")&1023)){var o=sh(t);return o.type="string",PD.to_workbook(r,o)}if(i.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(qe){i.indexOf("<"+qe)>=0&&(a=!0)}),a)return kFt(r,t);dR={"General Number":"General","General Date":ji[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":ji[15],"Short Date":ji[14],"Long Time":ji[19],"Medium Time":ji[18],"Short Time":ji[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:ji[2],Standard:ji[4],Percent:ji[10],Scientific:ji[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var s,l=[],u,h={},c=[],f={},d="";t.dense&&(f["!data"]=[]);var v={},p={},g=Cg('<Data ss:Type="String">'),m=0,y=0,_=0,x={s:{r:2e6,c:2e6},e:{r:0,c:0}},S={},w={},b="",E=0,T=[],C={},A={},M=0,I=[],R=[],k={},D=[],G,W=!1,z=[],V=[],q={},Y=0,le=0,j={Sheets:[],WBProps:{date1904:!1}},Q={};Mu.lastIndex=0,r=r.replace(/<!--([\s\S]*?)-->/mg,"");for(var ie="";s=Mu.exec(r);)switch(s[3]=(ie=s[3]).toLowerCase()){case"data":if(ie=="data"){if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else s[0].charAt(s[0].length-2)!=="/"&&l.push([s[3],!0]);break}if(l[l.length-1][1])break;s[1]==="/"?TFt(r.slice(m,s.index),b,g,l[l.length-1][0]=="comment"?k:v,{c:y,r:_},S,D[y],p,z,t):(b="",g=Cg(s[0]),m=s.index+s[0].length);break;case"cell":if(s[1]==="/")if(R.length>0&&(v.c=R),(!t.sheetRows||t.sheetRows>_)&&v.v!==void 0&&(t.dense?(f["!data"][_]||(f["!data"][_]=[]),f["!data"][_][y]=v):f[$o(y)+ys(_)]=v),v.HRef&&(v.l={Target:so(v.HRef)},v.HRefScreenTip&&(v.l.Tooltip=v.HRefScreenTip),delete v.HRef,delete v.HRefScreenTip),(v.MergeAcross||v.MergeDown)&&(Y=y+(parseInt(v.MergeAcross,10)|0),le=_+(parseInt(v.MergeDown,10)|0),(Y>y||le>_)&&T.push({s:{c:y,r:_},e:{c:Y,r:le}})),!t.sheetStubs)v.MergeAcross?y=Y+1:++y;else if(v.MergeAcross||v.MergeDown){for(var oe=y;oe<=Y;++oe)for(var se=_;se<=le;++se)(oe>y||se>_)&&(t.dense?(f["!data"][se]||(f["!data"][se]=[]),f["!data"][se][oe]={t:"z"}):f[$o(oe)+ys(se)]={t:"z"});y=Y+1}else++y;else v=xFt(s[0]),v.Index&&(y=+v.Index-1),y<x.s.c&&(x.s.c=y),y>x.e.c&&(x.e.c=y),s[0].slice(-2)==="/>"&&++y,R=[];break;case"row":s[1]==="/"||s[0].slice(-2)==="/>"?(_<x.s.r&&(x.s.r=_),_>x.e.r&&(x.e.r=_),s[0].slice(-2)==="/>"&&(p=Cg(s[0]),p.Index&&(_=+p.Index-1)),y=0,++_):(p=Cg(s[0]),p.Index&&(_=+p.Index-1),q={},(p.AutoFitHeight=="0"||p.Height)&&(q.hpx=parseInt(p.Height,10),q.hpt=oGe(q.hpx),V[_]=q),p.Hidden=="1"&&(q.hidden=!0,V[_]=q));break;case"worksheet":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"));c.push(d),x.s.r<=x.e.r&&x.s.c<=x.e.c&&(f["!ref"]=lo(x),t.sheetRows&&t.sheetRows<=x.e.r&&(f["!fullref"]=f["!ref"],x.e.r=t.sheetRows-1,f["!ref"]=lo(x))),T.length&&(f["!merges"]=T),D.length>0&&(f["!cols"]=D),V.length>0&&(f["!rows"]=V),h[d]=f}else x={s:{r:2e6,c:2e6},e:{r:0,c:0}},_=y=0,l.push([s[3],!1]),u=Cg(s[0]),d=so(u.Name),f={},t.dense&&(f["!data"]=[]),T=[],z=[],V=[],Q={name:d,Hidden:0},j.Sheets.push(Q);break;case"table":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else{if(s[0].slice(-2)=="/>")break;l.push([s[3],!1]),D=[],W=!1}break;case"style":s[1]==="/"?EFt(S,w,t):w=Cg(s[0]);break;case"numberformat":w.nf=so(Cg(s[0]).Format||"General"),dR[w.nf]&&(w.nf=dR[w.nf]);for(var me=0;me!=392&&ji[me]!=w.nf;++me);if(me==392){for(me=57;me!=392;++me)if(ji[me]==null){OE(w.nf,me);break}}break;case"column":if(l[l.length-1][0]!=="table"||s[1]==="/")break;if(G=Cg(s[0]),G.Hidden&&(G.hidden=!0,delete G.Hidden),G.Width&&(G.wpx=parseInt(G.Width,10)),!W&&G.wpx>10){W=!0,Ef=iGe;for(var Ce=0;Ce<D.length;++Ce)D[Ce]&&wM(D[Ce])}W&&wM(G),D[G.Index-1||D.length]=G;for(var Le=0;Le<+G.Span;++Le)D[D.length]=sh(G);break;case"namedrange":if(s[1]==="/")break;j.Names||(j.Names=[]);var re=Tn(s[0]),yt={Name:CFt(re.Name),Ref:DE(re.RefersTo.slice(1),{r:0,c:0})};j.Sheets.length>0&&(yt.Sheet=j.Sheets.length-1),j.Names.push(yt);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(s[0].slice(-2)==="/>")break;s[1]==="/"?b+=r.slice(E,s.index):E=s.index+s[0].length;break;case"interior":if(!t.cellStyles)break;w.Interior=Cg(s[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(s[0].slice(-2)==="/>")break;s[1]==="/"?cOt(C,ie,r.slice(M,s.index)):M=s.index+s[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else l.push([s[3],!1]);break;case"comment":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"));AFt(k),R.push(k)}else l.push([s[3],!1]),u=Cg(s[0]),k={a:u.Author};break;case"autofilter":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else if(s[0].charAt(s[0].length-2)!=="/"){var je=Cg(s[0]);f["!autofilter"]={ref:DE(je.Range).replace(/\$/g,"")},l.push([s[3],!0])}break;case"name":break;case"datavalidation":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else s[0].charAt(s[0].length-2)!=="/"&&l.push([s[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(s[1]==="/"){if((u=l.pop())[0]!==s[3])throw new Error("Bad state: "+u.join("|"))}else s[0].charAt(s[0].length-2)!=="/"&&l.push([s[3],!0]);break;case"null":break;default:if(l.length==0&&s[3]=="document"||l.length==0&&s[3]=="uof")return exe(r,t);var st=!0;switch(l[l.length-1][0]){case"officedocumentsettings":switch(s[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:st=!1}break;case"componentoptions":switch(s[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:st=!1}break;case"excelworkbook":switch(s[3]){case"date1904":j.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:st=!1}break;case"workbookoptions":switch(s[3]){case"owcversion":break;case"height":break;case"width":break;default:st=!1}break;case"worksheetoptions":switch(s[3]){case"visible":if(s[0].slice(-2)!=="/>")if(s[1]==="/")switch(r.slice(M,s.index)){case"SheetHidden":Q.Hidden=1;break;case"SheetVeryHidden":Q.Hidden=2;break}else M=s.index+s[0].length;break;case"header":f["!margins"]||fR(f["!margins"]={},"xlml"),isNaN(+Tn(s[0]).Margin)||(f["!margins"].header=+Tn(s[0]).Margin);break;case"footer":f["!margins"]||fR(f["!margins"]={},"xlml"),isNaN(+Tn(s[0]).Margin)||(f["!margins"].footer=+Tn(s[0]).Margin);break;case"pagemargins":var Nt=Tn(s[0]);f["!margins"]||fR(f["!margins"]={},"xlml"),isNaN(+Nt.Top)||(f["!margins"].top=+Nt.Top),isNaN(+Nt.Left)||(f["!margins"].left=+Nt.Left),isNaN(+Nt.Right)||(f["!margins"].right=+Nt.Right),isNaN(+Nt.Bottom)||(f["!margins"].bottom=+Nt.Bottom);break;case"displayrighttoleft":j.Views||(j.Views=[]),j.Views[0]||(j.Views[0]={}),j.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":f["!outline"]||(f["!outline"]={}),f["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":f["!outline"]||(f["!outline"]={}),f["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:st=!1}break;case"pivottable":case"pivotcache":switch(s[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:st=!1}break;case"pagebreaks":switch(s[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:st=!1}break;case"autofilter":switch(s[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:st=!1}break;case"querytable":switch(s[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:st=!1}break;case"datavalidation":switch(s[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:st=!1}break;case"sorting":case"conditionalformatting":switch(s[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:st=!1}break;case"mapinfo":case"schema":case"data":switch(s[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:st=!1}break;case"smarttags":break;default:st=!1;break}if(st||s[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+s[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(s[0].slice(-2)==="/>")break;s[1]==="/"?wFt(A,ie,I,r.slice(M,s.index)):(I=s,M=s.index+s[0].length);break}if(t.WTF)throw"Unrecognized tag: "+s[3]+"|"+l.join("|")}var Zt={};return!t.bookSheets&&!t.bookProps&&(Zt.Sheets=h),Zt.SheetNames=c,Zt.Workbook=j,Zt.SSF=sh(ji),Zt.Props=C,Zt.Custprops=A,Zt.bookType="xlml",Zt}function wQ(n,e){switch(Moe(e=e||{}),e.type||"base64"){case"base64":return SX(Tv(n),e);case"binary":case"buffer":case"file":return SX(n,e);case"array":return SX(p_(n),e)}}function MFt(n){var e={},t=n.content;if(t.l=28,e.AnsiUserType=t.read_shift(0,"lpstr-ansi"),e.AnsiClipboardFormat=$Pt(t),t.length-t.l<=4)return e;var r=t.read_shift(4);if(r==0||r>40||(t.l-=4,e.Reserved1=t.read_shift(0,"lpstr-ansi"),t.length-t.l<=4)||(r=t.read_shift(4),r!==1907505652)||(e.UnicodeClipboardFormat=WPt(t),r=t.read_shift(4),r==0||r>40))return e;t.l-=4,e.Reserved2=t.read_shift(0,"lpwstr")}var IFt=[60,1084,2066,2165,2175];function LFt(n,e,t,r,i){var a=r,o=[],s=t.slice(t.l,t.l+a);if(i&&i.enc&&i.enc.insitu&&s.length>0)switch(n){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:i.enc.insitu(s)}o.push(s),t.l+=a;for(var l=R1(t,t.l),u=bQ[l],h=0;u!=null&&IFt.indexOf(l)>-1;)a=R1(t,t.l+2),h=t.l+4,l==2066?h+=4:(l==2165||l==2175)&&(h+=12),s=t.slice(h,t.l+4+a),o.push(s),t.l+=4+a,u=bQ[l=R1(t,t.l)];var c=Yx(o);eh(c,0);var f=0;c.lens=[];for(var d=0;d<o.length;++d)c.lens.push(f),f+=o[d].length;if(c.length<r)throw"XLS Record 0x"+n.toString(16)+" Truncated: "+c.length+" < "+r;return e.f(c,c.length,i)}function ny(n,e,t){if(n.t!=="z"&&!!n.XF){var r=0;try{r=n.z||n.XF.numFmtId||0,e.cellNF&&(n.z=ji[r])}catch(a){if(e.WTF)throw a}if(!e||e.cellText!==!1)try{n.t==="e"?n.w=n.w||nT[n.v]:r===0||r=="General"?n.t==="n"?(n.v|0)===n.v?n.w=n.v.toString(10):n.w=ID(n.v):n.w=e2(n.v):n.w=Cv(r,n.v,{date1904:!!t,dateNF:e&&e.dateNF})}catch(a){if(e.WTF)throw a}if(e.cellDates&&r&&n.t=="n"&&Q2(ji[r]||String(r))){var i=uE(n.v);i&&(n.t="d",n.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}}function e5(n,e,t){return{v:n,ixfe:e,t}}function PFt(n,e){var t={opts:{}},r={},i={};e.dense&&(i["!data"]=[]);var a={},o={},s=null,l=[],u="",h={},c,f="",d,v,p,g,m={},y=[],_,x,S=[],w=[],b={Sheets:[],WBProps:{date1904:!1},Views:[{}]},E={},T=function(pt){return pt<8?RE[pt]:pt<64&&w[pt-8]||RE[pt]},C=function(pt,ar,kt){var Dr=ar.XF.data;if(!(!Dr||!Dr.patternType||!kt||!kt.cellStyles)){ar.s={},ar.s.patternType=Dr.patternType;var Sr;(Sr=OD(T(Dr.icvFore)))&&(ar.s.fgColor={rgb:Sr}),(Sr=OD(T(Dr.icvBack)))&&(ar.s.bgColor={rgb:Sr})}},A=function(pt,ar,kt){if(!(q>1)&&!(kt.sheetRows&&pt.r>=kt.sheetRows)){if(kt.cellStyles&&ar.XF&&ar.XF.data&&C(pt,ar,kt),delete ar.ixfe,delete ar.XF,c=pt,f=bo(pt),(!o||!o.s||!o.e)&&(o={s:{r:0,c:0},e:{r:0,c:0}}),pt.r<o.s.r&&(o.s.r=pt.r),pt.c<o.s.c&&(o.s.c=pt.c),pt.r+1>o.e.r&&(o.e.r=pt.r+1),pt.c+1>o.e.c&&(o.e.c=pt.c+1),kt.cellFormula&&ar.f){for(var Dr=0;Dr<y.length;++Dr)if(!(y[Dr][0].s.c>pt.c||y[Dr][0].s.r>pt.r)&&!(y[Dr][0].e.c<pt.c||y[Dr][0].e.r<pt.r)){ar.F=lo(y[Dr][0]),(y[Dr][0].s.c!=pt.c||y[Dr][0].s.r!=pt.r)&&delete ar.f,ar.f&&(ar.f=""+kc(y[Dr][1],o,pt,z,M));break}}kt.dense?(i["!data"][pt.r]||(i["!data"][pt.r]=[]),i["!data"][pt.r][pt.c]=ar):i[f]=ar}},M={enc:!1,sbcch:0,snames:[],sharedf:m,arrayf:y,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!e&&!!e.cellStyles,WTF:!!e&&!!e.wtf};e.password&&(M.password=e.password);var I,R=[],k=[],D=[],G=[],W=!1,z=[];z.SheetNames=M.snames,z.sharedf=M.sharedf,z.arrayf=M.arrayf,z.names=[],z.XTI=[];var V=0,q=0,Y=0,le=[],j=[],Q;M.codepage=1200,r0(1200);for(var ie=!1;n.l<n.length-1;){var oe=n.l,se=n.read_shift(2);if(se===0&&V===10)break;var me=n.l===n.length?0:n.read_shift(2),Ce=bQ[se];if(q==0&&[9,521,1033,2057].indexOf(se)==-1)break;if(Ce&&Ce.f){if(e.bookSheets&&V===133&&se!==133)break;if(V=se,Ce.r===2||Ce.r==12){var Le=n.read_shift(2);if(me-=2,!M.enc&&Le!==se&&((Le&255)<<8|Le>>8)!==se)throw new Error("rt mismatch: "+Le+"!="+se);Ce.r==12&&(n.l+=10,me-=10)}var re={};if(se===10?re=Ce.f(n,me,M):re=LFt(se,Ce,n,me,M),q==0&&[9,521,1033,2057].indexOf(V)===-1)continue;switch(se){case 34:t.opts.Date1904=b.WBProps.date1904=re;break;case 134:t.opts.WriteProtect=!0;break;case 47:if(M.enc||(n.l=0),M.enc=re,!e.password)throw new Error("File is password-protected");if(re.valid==null)throw new Error("Encryption scheme unsupported");if(!re.valid)throw new Error("Password is incorrect");break;case 92:M.lastuser=re;break;case 66:var yt=Number(re);switch(yt){case 21010:yt=1200;break;case 32768:yt=1e4;break;case 32769:yt=1252;break}r0(M.codepage=yt),ie=!0;break;case 317:M.rrtabid=re;break;case 25:M.winlocked=re;break;case 439:t.opts.RefreshAll=re;break;case 12:t.opts.CalcCount=re;break;case 16:t.opts.CalcDelta=re;break;case 17:t.opts.CalcIter=re;break;case 13:t.opts.CalcMode=re;break;case 14:t.opts.CalcPrecision=re;break;case 95:t.opts.CalcSaveRecalc=re;break;case 15:M.CalcRefMode=re;break;case 2211:t.opts.FullCalc=re;break;case 129:re.fDialog&&(i["!type"]="dialog"),re.fBelow||((i["!outline"]||(i["!outline"]={})).above=!0),re.fRight||((i["!outline"]||(i["!outline"]={})).left=!0);break;case 224:S.push(re);break;case 430:z.push([re]),z[z.length-1].XTI=[];break;case 35:case 547:z[z.length-1].push(re);break;case 24:case 536:Q={Name:re.Name,Ref:kc(re.rgce,o,null,z,M)},re.itab>0&&(Q.Sheet=re.itab-1),z.names.push(Q),z[0]||(z[0]=[],z[0].XTI=[]),z[z.length-1].push(re),re.Name=="_xlnm._FilterDatabase"&&re.itab>0&&re.rgce&&re.rgce[0]&&re.rgce[0][0]&&re.rgce[0][0][0]=="PtgArea3d"&&(j[re.itab-1]={ref:lo(re.rgce[0][0][1][2])});break;case 22:M.ExternCount=re;break;case 23:z.length==0&&(z[0]=[],z[0].XTI=[]),z[z.length-1].XTI=z[z.length-1].XTI.concat(re),z.XTI=z.XTI.concat(re);break;case 2196:if(M.biff<8)break;Q!=null&&(Q.Comment=re[1]);break;case 18:i["!protect"]=re;break;case 19:re!==0&&M.WTF&&console.error("Password verifier: "+re);break;case 133:a[re.pos]=re,M.snames.push(re.name);break;case 10:{if(--q)break;if(o.e){if(o.e.r>0&&o.e.c>0){if(o.e.r--,o.e.c--,i["!ref"]=lo(o),e.sheetRows&&e.sheetRows<=o.e.r){var je=o.e.r;o.e.r=e.sheetRows-1,i["!fullref"]=i["!ref"],i["!ref"]=lo(o),o.e.r=je}o.e.r++,o.e.c++}R.length>0&&(i["!merges"]=R),k.length>0&&(i["!objects"]=k),D.length>0&&(i["!cols"]=D),G.length>0&&(i["!rows"]=G),b.Sheets.push(E)}u===""?h=i:r[u]=i,i={},e.dense&&(i["!data"]=[])}break;case 9:case 521:case 1033:case 2057:{if(M.biff===8&&(M.biff={9:2,521:3,1033:4}[se]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[re.BIFFVer]||8),M.biffguess=re.BIFFVer==0,re.BIFFVer==0&&re.dt==4096&&(M.biff=5,ie=!0,r0(M.codepage=28591)),M.biff==8&&re.BIFFVer==0&&re.dt==16&&(M.biff=2),q++)break;if(i={},e.dense&&(i["!data"]=[]),M.biff<8&&!ie&&(ie=!0,r0(M.codepage=e.codepage||1252)),M.biff<5||re.BIFFVer==0&&re.dt==4096){u===""&&(u="Sheet1"),o={s:{r:0,c:0},e:{r:0,c:0}};var st={pos:n.l-me,name:u};a[st.pos]=st,M.snames.push(u)}else u=(a[oe]||{name:""}).name;re.dt==32&&(i["!type"]="chart"),re.dt==64&&(i["!type"]="macro"),R=[],k=[],M.arrayf=y=[],D=[],G=[],W=!1,E={Hidden:(a[oe]||{hs:0}).hs,name:u}}break;case 515:case 3:case 2:i["!type"]=="chart"&&(e.dense?(i["!data"][re.r]||[])[re.c]:i[$o(re.c)+ys(re.r)])&&++re.c,_={ixfe:re.ixfe,XF:S[re.ixfe]||{},v:re.val,t:"n"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 5:case 517:_={ixfe:re.ixfe,XF:S[re.ixfe],v:re.val,t:re.t},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 638:_={ixfe:re.ixfe,XF:S[re.ixfe],v:re.rknum,t:"n"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 189:for(var Nt=re.c;Nt<=re.C;++Nt){var Zt=re.rkrec[Nt-re.c][0];_={ixfe:Zt,XF:S[Zt],v:re.rkrec[Nt-re.c][1],t:"n"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:Nt,r:re.r},_,e)}break;case 6:case 518:case 1030:{if(re.val=="String"){s=re;break}if(_=e5(re.val,re.cell.ixfe,re.tt),_.XF=S[_.ixfe],e.cellFormula){var qe=re.formula;if(qe&&qe[0]&&qe[0][0]&&qe[0][0][0]=="PtgExp"){var ur=qe[0][0][1][0],Dt=qe[0][0][1][1],ft=bo({r:ur,c:Dt});m[ft]?_.f=""+kc(re.formula,o,re.cell,z,M):_.F=((e.dense?(i["!data"][ur]||[])[Dt]:i[ft])||{}).F}else _.f=""+kc(re.formula,o,re.cell,z,M)}Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A(re.cell,_,e),s=re}break;case 7:case 519:if(s)s.val=re,_=e5(re,s.cell.ixfe,"s"),_.XF=S[_.ixfe],e.cellFormula&&(_.f=""+kc(s.formula,o,s.cell,z,M)),Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A(s.cell,_,e),s=null;else throw new Error("String record expects Formula");break;case 33:case 545:{y.push(re);var Oe=bo(re[0].s);if(d=e.dense?(i["!data"][re[0].s.r]||[])[re[0].s.c]:i[Oe],e.cellFormula&&d){if(!s||!Oe||!d)break;d.f=""+kc(re[1],o,re[0],z,M),d.F=lo(re[0])}}break;case 1212:{if(!e.cellFormula)break;if(f){if(!s)break;m[bo(s.cell)]=re[0],d=e.dense?(i["!data"][s.cell.r]||[])[s.cell.c]:i[bo(s.cell)],(d||{}).f=""+kc(re[0],o,c,z,M)}}break;case 253:_=e5(l[re.isst].t,re.ixfe,"s"),l[re.isst].h&&(_.h=l[re.isst].h),_.XF=S[_.ixfe],Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 513:e.sheetStubs&&(_={ixfe:re.ixfe,XF:S[re.ixfe],t:"z"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e));break;case 190:if(e.sheetStubs)for(var J=re.c;J<=re.C;++J){var We=re.ixfe[J-re.c];_={ixfe:We,XF:S[We],t:"z"},Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:J,r:re.r},_,e)}break;case 214:case 516:case 4:_=e5(re.val,re.ixfe,"s"),_.XF=S[_.ixfe],Y>0&&(_.z=le[_.ixfe>>8&63]),ny(_,e,t.opts.Date1904),A({c:re.c,r:re.r},_,e);break;case 0:case 512:q===1&&(o=re);break;case 252:l=re;break;case 1054:if(M.biff==4){le[Y++]=re[1];for(var Tt=0;Tt<Y+163&&ji[Tt]!=re[1];++Tt);Tt>=163&&OE(re[1],Y+163)}else OE(re[1],re[0]);break;case 30:{le[Y++]=re;for(var Qe=0;Qe<Y+163&&ji[Qe]!=re;++Qe);Qe>=163&&OE(re,Y+163)}break;case 229:R=R.concat(re);break;case 93:k[re.cmo[0]]=M.lastobj=re;break;case 438:M.lastobj.TxO=re;break;case 127:M.lastobj.ImData=re;break;case 440:for(g=re[0].s.r;g<=re[0].e.r;++g)for(p=re[0].s.c;p<=re[0].e.c;++p)d=e.dense?(i["!data"][g]||[])[p]:i[bo({c:p,r:g})],d&&(d.l=re[1]);break;case 2048:for(g=re[0].s.r;g<=re[0].e.r;++g)for(p=re[0].s.c;p<=re[0].e.c;++p)d=e.dense?(i["!data"][g]||[])[p]:i[bo({c:p,r:g})],d&&d.l&&(d.l.Tooltip=re[1]);break;case 28:{if(M.biff<=5&&M.biff>=2)break;d=e.dense?(i["!data"][re[0].r]||[])[re[0].c]:i[bo(re[0])];var zt=k[re[2]];d||(e.dense?(i["!data"][re[0].r]||(i["!data"][re[0].r]=[]),d=i["!data"][re[0].r][re[0].c]={t:"z"}):d=i[bo(re[0])]={t:"z"},o.e.r=Math.max(o.e.r,re[0].r),o.s.r=Math.min(o.s.r,re[0].r),o.e.c=Math.max(o.e.c,re[0].c),o.s.c=Math.min(o.s.c,re[0].c)),d.c||(d.c=[]),v={a:re[1],t:zt.TxO.t},d.c.push(v)}break;case 2173:QDt(S[re.ixfe],re.ext);break;case 125:{if(!M.cellStyles)break;for(;re.e>=re.s;)D[re.e--]={width:re.w/256,level:re.level||0,hidden:!!(re.flags&1)},W||(W=!0,Eoe(re.w/256)),wM(D[re.e+1])}break;case 520:{var mt={};re.level!=null&&(G[re.r]=mt,mt.level=re.level),re.hidden&&(G[re.r]=mt,mt.hidden=!0),re.hpt&&(G[re.r]=mt,mt.hpt=re.hpt,mt.hpx=RD(re.hpt))}break;case 38:case 39:case 40:case 41:i["!margins"]||fR(i["!margins"]={}),i["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[se]]=re;break;case 161:i["!margins"]||fR(i["!margins"]={}),i["!margins"].header=re.header,i["!margins"].footer=re.footer;break;case 574:re.RTL&&(b.Views[0].RTL=!0);break;case 146:w=re;break;case 2198:I=re;break;case 140:x=re;break;case 442:u?E.CodeName=re||E.name:b.WBProps.CodeName=re||"ThisWorkbook";break}}else Ce||console.error("Missing Info for XLS Record 0x"+se.toString(16)),n.l+=me}return t.SheetNames=h0(a).sort(function(wt,pt){return Number(wt)-Number(pt)}).map(function(wt){return a[wt].name}),e.bookSheets||(t.Sheets=r),!t.SheetNames.length&&h["!ref"]?(t.SheetNames.push("Sheet1"),t.Sheets&&(t.Sheets.Sheet1=h)):t.Preamble=h,t.Sheets&&j.forEach(function(wt,pt){t.Sheets[t.SheetNames[pt]]["!autofilter"]=wt}),t.Strings=l,t.SSF=sh(ji),M.enc&&(t.Encryption=M.enc),I&&(t.Themes=I),t.Metadata={},x!==void 0&&(t.Metadata.Country=x),z.names.length>0&&(b.Names=z.names),t.Workbook=b,t}var Z_e={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function OFt(n,e,t){var r=co.find(n,"/!DocumentSummaryInformation");if(r&&r.size>0)try{var i=O_e(r,ZPt,Z_e.DSI);for(var a in i)e[a]=i[a]}catch(u){if(t.WTF)throw u}var o=co.find(n,"/!SummaryInformation");if(o&&o.size>0)try{var s=O_e(o,KPt,Z_e.SI);for(var l in s)e[l]==null&&(e[l]=s[l])}catch(u){if(t.WTF)throw u}e.HeadingPairs&&e.TitlesOfParts&&(U8e(e.HeadingPairs,e.TitlesOfParts,e,t),delete e.HeadingPairs,delete e.TitlesOfParts)}function EGe(n,e){e||(e={}),Moe(e),ZBe(),e.codepage&&uoe(e.codepage);var t,r;if(n.FullPaths){if(co.find(n,"/encryption"))throw new Error("File is password-protected");t=co.find(n,"!CompObj"),r=co.find(n,"/Workbook")||co.find(n,"/Book")}else{switch(e.type){case"base64":n=iv(Tv(n));break;case"binary":n=iv(n);break;case"buffer":break;case"array":Array.isArray(n)||(n=Array.prototype.slice.call(n));break}eh(n,0),r={content:n}}var i,a;if(t&&MFt(t),e.bookProps&&!e.bookSheets)i={};else{var o=oo?"buffer":"array";if(r&&r.content)i=PFt(r.content,e);else if((a=co.find(n,"PerfectOffice_MAIN"))&&a.content)i=hR.to_workbook(a.content,(e.type=o,e));else if((a=co.find(n,"NativeContent_MAIN"))&&a.content)i=hR.to_workbook(a.content,(e.type=o,e));else throw(a=co.find(n,"MN0"))&&a.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");e.bookVBA&&n.FullPaths&&co.find(n,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=yNt(n))}var s={};return n.FullPaths&&OFt(n,s,e),i.Props=i.Custprops=s,e.bookFiles&&(i.cfb=n),i}var n9={0:{f:dkt},1:{f:ykt},2:{f:Ckt},3:{f:Skt},4:{f:_kt},5:{f:Tkt},6:{f:Ikt},7:{f:bkt},8:{f:Dkt},9:{f:Rkt},10:{f:Pkt},11:{f:Okt},12:{f:mkt},13:{f:Akt},14:{f:wkt},15:{f:xkt},16:{f:_Ge},17:{f:Lkt},18:{f:Ekt},19:{f:moe},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:sFt},40:{},42:{},43:{f:PDt},44:{f:LDt},45:{f:ODt},46:{f:DDt},47:{f:RDt},48:{},49:{f:kPt},50:{},51:{f:tNt},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:Q8e},62:{f:Mkt},63:{f:oNt},64:{f:$kt},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Kc,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Vkt},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:gkt},148:{f:vkt,p:16},151:{f:Fkt},152:{},153:{f:aFt},154:{},155:{},156:{f:iFt},157:{},158:{},159:{T:1,f:qRt},160:{T:-1},161:{T:1,f:rT},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Nkt},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:eNt},336:{T:-1},337:{f:rNt,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:mQ},357:{},358:{},359:{},360:{T:1},361:{},362:{f:J8e},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Bkt},427:{f:Gkt},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Ukt},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:pkt},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:kkt},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:mQ},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:vNt},633:{T:1},634:{T:-1},635:{T:1,f:dNt},636:{T:-1},637:{f:BPt},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:qkt},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:Wkt},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},bQ={6:{f:_X},10:{f:cx},12:{f:nu},13:{f:nu},14:{f:tu},15:{f:tu},16:{f:Bc},17:{f:tu},18:{f:tu},19:{f:nu},20:{f:k_e},21:{f:k_e},23:{f:J8e},24:{f:B_e},25:{f:tu},26:{},27:{},28:{f:hRt},29:{},34:{f:tu},35:{f:F_e},38:{f:Bc},39:{f:Bc},40:{f:Bc},41:{f:Bc},42:{f:tu},43:{f:tu},47:{f:vDt},49:{f:XOt},51:{f:nu},60:{},61:{f:WOt},64:{f:tu},65:{f:jOt},66:{f:nu},77:{},80:{},81:{},82:{},85:{f:nu},89:{},90:{},91:{},92:{f:kOt},93:{f:fRt},94:{},95:{f:tu},96:{},97:{},99:{f:tu},125:{f:Q8e},128:{f:nRt},129:{f:FOt},130:{f:nu},131:{f:tu},132:{f:tu},133:{f:BOt},134:{},140:{f:mRt},141:{f:nu},144:{},146:{f:xRt},151:{},152:{},153:{},154:{},155:{},156:{f:nu},157:{},158:{},160:{f:TRt},161:{f:wRt},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:QOt},190:{f:eRt},193:{f:cx},197:{},198:{},199:{},200:{},201:{},202:{f:tu},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:nu},220:{},221:{f:tu},222:{},224:{f:rRt},225:{f:NOt},226:{f:cx},227:{},229:{f:cRt},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:GOt},253:{f:YOt},255:{f:zOt},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:j8e},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:tu},353:{f:cx},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:aRt},431:{f:tu},432:{},433:{},434:{},437:{},438:{f:pRt},439:{f:tu},440:{f:gRt},441:{},442:{f:k3},443:{},444:{f:nu},445:{},446:{},448:{f:cx},449:{f:$Ot,r:2},450:{f:cx},512:{f:D_e},513:{f:ERt},515:{f:iRt},516:{f:qOt},517:{f:N_e},519:{f:CRt},520:{f:UOt},523:{},545:{f:z_e},549:{f:R_e},566:{},574:{f:HOt},638:{f:JOt},659:{},1048:{},1054:{f:ZOt},1084:{},1212:{f:sRt},2048:{f:yRt},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Z4},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:cx},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:SRt,r:12},2173:{f:JDt,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:tu,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:oRt,r:12},2197:{},2198:{f:jDt,r:12},2199:{},2200:{},2201:{},2202:{f:lRt,r:12},2203:{f:cx},2204:{},2205:{},2206:{},2207:{},2211:{f:VOt},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:nu},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:bRt},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:_Rt},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:D_e},1:{},2:{f:LRt},3:{f:IRt},4:{f:MRt},5:{f:N_e},7:{f:PRt},8:{},9:{f:Z4},11:{},22:{f:nu},30:{f:KOt},31:{},32:{},33:{f:z_e},36:{},37:{f:R_e},50:{f:ORt},62:{},52:{},67:{},68:{f:nu},69:{},86:{},126:{},127:{f:ARt},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:RRt},223:{},234:{},354:{},421:{},518:{f:_X},521:{f:Z4},536:{f:B_e},547:{f:F_e},561:{},579:{},1030:{f:_X},1033:{f:Z4},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},101:{},102:{},105:{},106:{},107:{},109:{},112:{},114:{},29282:{}};function Ag(n,e,t,r){var i=e;if(!isNaN(i)){var a=r||(t||[]).length||0,o=n.next(4);o.write_shift(2,i),o.write_shift(2,a),a>0&&O8e(t)&&n.push(t)}}function K_e(n,e){var t=e||{},r=t.dense!=null?t.dense:SLt,i={};r&&(i["!data"]=[]),n=n.replace(/<!--.*?-->/g,"");var a=n.match(/<table/i);if(!a)throw new Error("Invalid HTML: could not find <table>");var o=n.match(/<\/table/i),s=a.index,l=o&&o.index||n.length,u=iPt(n.slice(s,l),/(:?<tr[^>]*>)/i,"<tr>"),h=-1,c=0,f=0,d=0,v={s:{r:1e7,c:1e7},e:{r:0,c:0}},p=[];for(s=0;s<u.length;++s){var g=u[s].trim(),m=g.slice(0,3).toLowerCase();if(m=="<tr"){if(++h,t.sheetRows&&t.sheetRows<=h){--h;break}c=0;continue}if(!(m!="<td"&&m!="<th")){var y=g.split(/<\/t[dh]>/i);for(l=0;l<y.length;++l){var _=y[l].trim();if(!!_.match(/<t[dh]/i)){for(var x=_,S=0;x.charAt(0)=="<"&&(S=x.indexOf(">"))>-1;)x=x.slice(S+1);for(var w=0;w<p.length;++w){var b=p[w];b.s.c==c&&b.s.r<h&&h<=b.e.r&&(c=b.e.c+1,w=-1)}var E=Tn(_.slice(0,_.indexOf(">")));d=E.colspan?+E.colspan:1,((f=+E.rowspan)>1||d>1)&&p.push({s:{r:h,c},e:{r:h+(f||1)-1,c:c+d-1}});var T=E.t||E["data-t"]||"";if(!x.length){c+=d;continue}if(x=_8e(x),v.s.r>h&&(v.s.r=h),v.e.r<h&&(v.e.r=h),v.s.c>c&&(v.s.c=c),v.e.c<c&&(v.e.c=c),!x.length){c+=d;continue}var C={t:"s",v:x};t.raw||!x.trim().length||T=="s"||(x==="TRUE"?C={t:"b",v:!0}:x==="FALSE"?C={t:"b",v:!1}:isNaN(mv(x))?isNaN(SM(x).getDate())||(C={t:"d",v:pc(x)},t.cellDates||(C={t:"n",v:Zc(C.v)}),C.z=t.dateNF||ji[14]):C={t:"n",v:mv(x)}),r?(i["!data"][h]||(i["!data"][h]=[]),i["!data"][h][c]=C):i[bo({r:h,c})]=C,c+=d}}}}return i["!ref"]=lo(v),p.length&&(i["!merges"]=p),i}function RFt(n,e,t,r){for(var i=n["!merges"]||[],a=[],o={},s=n["!data"]!=null,l=e.s.c;l<=e.e.c;++l){for(var u=0,h=0,c=0;c<i.length;++c)if(!(i[c].s.r>t||i[c].s.c>l)&&!(i[c].e.r<t||i[c].e.c<l)){if(i[c].s.r<t||i[c].s.c<l){u=-1;break}u=i[c].e.r-i[c].s.r+1,h=i[c].e.c-i[c].s.c+1;break}if(!(u<0)){var f=$o(l)+ys(t),d=s?(n["!data"][t]||[])[l]:n[f],v=d&&d.v!=null&&(d.h||ZG(d.w||($S(d),d.w)||""))||"";o={},u>1&&(o.rowspan=u),h>1&&(o.colspan=h),r.editable?v='<span contenteditable="true">'+v+"</span>":d&&(o["data-t"]=d&&d.t||"z",d.v!=null&&(o["data-v"]=d.v),d.z!=null&&(o["data-z"]=d.z),d.l&&(d.l.Target||"#").charAt(0)!="#"&&(v='<a href="'+ZG(d.l.Target)+'">'+v+"</a>")),o.id=(r.id||"sjs")+"-"+f,a.push(_Pt("td",v,o))}}var p="<tr>";return p+a.join("")+"</tr>"}var DFt='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',NFt="</body></html>";function kFt(n,e){var t=n.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!t||t.length==0)throw new Error("Invalid HTML: could not find <table>");if(t.length==1){var r=ww(K_e(t[0],e),e);return r.bookType="html",r}var i=Loe();return t.forEach(function(a,o){LU(i,K_e(a,e),"Sheet"+(o+1))}),i.bookType="html",i}function FFt(n,e,t){var r=[];return r.join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}function BFt(n,e){var t=e||{},r=t.header!=null?t.header:DFt,i=t.footer!=null?t.footer:NFt,a=[r],o=eT(n["!ref"]);a.push(FFt(n,o,t));for(var s=o.s.r;s<=o.e.r;++s)a.push(RFt(n,o,s,t));return a.push("</table>"+i),a.join("")}function TGe(n,e,t){var r=e.rows;if(!r)throw"Unsupported origin when "+e.tagName+" is not a TABLE";var i=t||{},a=n["!data"]!=null,o=0,s=0;if(i.origin!=null)if(typeof i.origin=="number")o=i.origin;else{var l=typeof i.origin=="string"?zc(i.origin):i.origin;o=l.r,s=l.c}var u=Math.min(i.sheetRows||1e7,r.length),h={s:{r:0,c:0},e:{r:o,c:s}};if(n["!ref"]){var c=eT(n["!ref"]);h.s.r=Math.min(h.s.r,c.s.r),h.s.c=Math.min(h.s.c,c.s.c),h.e.r=Math.max(h.e.r,c.e.r),h.e.c=Math.max(h.e.c,c.e.c),o==-1&&(h.e.r=o=c.e.r+1)}var f=[],d=0,v=n["!rows"]||(n["!rows"]=[]),p=0,g=0,m=0,y=0,_=0,x=0;for(n["!cols"]||(n["!cols"]=[]);p<r.length&&g<u;++p){var S=r[p];if(J_e(S)){if(i.display)continue;v[g]={hidden:!0}}var w=S.cells;for(m=y=0;m<w.length;++m){var b=w[m];if(!(i.display&&J_e(b))){var E=b.hasAttribute("data-v")?b.getAttribute("data-v"):b.hasAttribute("v")?b.getAttribute("v"):_8e(b.innerHTML),T=b.getAttribute("data-z")||b.getAttribute("z");for(d=0;d<f.length;++d){var C=f[d];C.s.c==y+s&&C.s.r<g+o&&g+o<=C.e.r&&(y=C.e.c+1-s,d=-1)}x=+b.getAttribute("colspan")||1,((_=+b.getAttribute("rowspan")||1)>1||x>1)&&f.push({s:{r:g+o,c:y+s},e:{r:g+o+(_||1)-1,c:y+s+(x||1)-1}});var A={t:"s",v:E},M=b.getAttribute("data-t")||b.getAttribute("t")||"";E!=null&&(E.length==0?A.t=M||"z":i.raw||E.trim().length==0||M=="s"||(E==="TRUE"?A={t:"b",v:!0}:E==="FALSE"?A={t:"b",v:!1}:isNaN(mv(E))?isNaN(SM(E).getDate())||(A={t:"d",v:pc(E)},i.cellDates||(A={t:"n",v:Zc(A.v)}),A.z=i.dateNF||ji[14]):A={t:"n",v:mv(E)})),A.z===void 0&&T!=null&&(A.z=T);var I="",R=b.getElementsByTagName("A");if(R&&R.length)for(var k=0;k<R.length&&!(R[k].hasAttribute("href")&&(I=R[k].getAttribute("href"),I.charAt(0)!="#"));++k);I&&I.charAt(0)!="#"&&I.slice(0,11).toLowerCase()!="javascript:"&&(A.l={Target:I}),a?(n["!data"][g+o]||(n["!data"][g+o]=[]),n["!data"][g+o][y+s]=A):n[bo({c:y+s,r:g+o})]=A,h.e.c<y+s&&(h.e.c=y+s),y+=x}}++g}return f.length&&(n["!merges"]=(n["!merges"]||[]).concat(f)),h.e.r=Math.max(h.e.r,g-1+o),n["!ref"]=lo(h),g>=u&&(n["!fullref"]=lo((h.e.r=r.length-p+g-1+o,h))),n}function CGe(n,e){var t=e||{},r={};return t.dense&&(r["!data"]=[]),TGe(r,n,e)}function GFt(n,e){var t=ww(CGe(n,e),e);return t}function J_e(n){var e="",t=zFt(n);return t&&(e=t(n).getPropertyValue("display")),e||(e=n.style&&n.style.display),e==="none"}function zFt(n){return n.ownerDocument.defaultView&&typeof n.ownerDocument.defaultView.getComputedStyle=="function"?n.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function UFt(n){var e=n.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(r,i){return Array(parseInt(i,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,`
`),t=so(e.replace(/<[^>]*>/g,""));return[t]}function AGe(n,e,t){var r=t||{},i=CU(n);Mu.lastIndex=0,i=i.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");for(var a,o,s="",l="",u,h=0,c=-1,f="";a=Mu.exec(i);)switch(a[3]=a[3].replace(/_.*$/,"")){case"number-style":case"currency-style":case"percentage-style":case"date-style":case"time-style":case"text-style":a[1]==="/"?(o["truncate-on-overflow"]=="false"&&(s.match(/h/)?s=s.replace(/h+/,"[$&]"):s.match(/m/)?s=s.replace(/m+/,"[$&]"):s.match(/s/)&&(s=s.replace(/s+/,"[$&]"))),r[o.name]=s,s=""):a[0].charAt(a[0].length-2)!=="/"&&(s="",o=Tn(a[0],!1));break;case"boolean-style":a[1]==="/"?(r[o.name]="General",s=""):a[0].charAt(a[0].length-2)!=="/"&&(s="",o=Tn(a[0],!1));break;case"boolean":s+="General";break;case"text":a[1]==="/"?(f=i.slice(c,Mu.lastIndex-a[0].length),f=="%"&&o[0]=="<number:percentage-style"?s+="%":s+='"'+f.replace(/"/g,'""')+'"'):a[0].charAt(a[0].length-2)!=="/"&&(c=Mu.lastIndex);break;case"day":switch(u=Tn(a[0],!1),u.style){case"short":s+="d";break;case"long":s+="dd";break;default:s+="dd";break}break;case"day-of-week":switch(u=Tn(a[0],!1),u.style){case"short":s+="ddd";break;case"long":s+="dddd";break;default:s+="ddd";break}break;case"era":switch(u=Tn(a[0],!1),u.style){case"short":s+="ee";break;case"long":s+="eeee";break;default:s+="eeee";break}break;case"hours":switch(u=Tn(a[0],!1),u.style){case"short":s+="h";break;case"long":s+="hh";break;default:s+="hh";break}break;case"minutes":switch(u=Tn(a[0],!1),u.style){case"short":s+="m";break;case"long":s+="mm";break;default:s+="mm";break}break;case"month":switch(u=Tn(a[0],!1),u.textual&&(s+="mm"),u.style){case"short":s+="m";break;case"long":s+="mm";break;default:s+="m";break}break;case"seconds":{switch(u=Tn(a[0],!1),u.style){case"short":s+="s";break;case"long":s+="ss";break;default:s+="ss";break}u["decimal-places"]&&(s+="."+wo("0",+u["decimal-places"]))}break;case"year":switch(u=Tn(a[0],!1),u.style){case"short":s+="yy";break;case"long":s+="yyyy";break;default:s+="yy";break}break;case"am-pm":s+="AM/PM";break;case"week-of-year":case"quarter":console.error("Excel does not support ODS format token "+a[3]);break;case"fill-character":a[1]==="/"?(f=i.slice(c,Mu.lastIndex-a[0].length),s+='"'+f.replace(/"/g,'""')+'"*'):a[0].charAt(a[0].length-2)!=="/"&&(c=Mu.lastIndex);break;case"scientific-number":u=Tn(a[0],!1),s+="0."+wo("0",+u["min-decimal-places"]||+u["decimal-places"]||2)+wo("?",+u["decimal-places"]-+u["min-decimal-places"]||0)+"E"+(ps(u["forced-exponent-sign"])?"+":"")+wo("0",+u["min-exponent-digits"]||2);break;case"fraction":u=Tn(a[0],!1),+u["min-integer-digits"]?s+=wo("0",+u["min-integer-digits"]):s+="#",s+=" ",s+=wo("?",+u["min-numerator-digits"]||1),s+="/",+u["denominator-value"]?s+=u["denominator-value"]:s+=wo("?",+u["min-denominator-digits"]||1);break;case"currency-symbol":a[1]==="/"?s+='"'+i.slice(c,Mu.lastIndex-a[0].length).replace(/"/g,'""')+'"':a[0].charAt(a[0].length-2)!=="/"?c=Mu.lastIndex:s+="$";break;case"text-properties":switch(u=Tn(a[0],!1),(u.color||"").toLowerCase().replace("#","")){case"ff0000":case"red":s="[Red]"+s;break}break;case"text-content":s+="@";break;case"map":u=Tn(a[0],!1),so(u.condition)=="value()>=0"?s=r[u["apply-style-name"]]+";"+s:console.error("ODS number format may be incorrect: "+u.condition);break;case"number":if(a[1]==="/")break;u=Tn(a[0],!1),l="",l+=wo("0",+u["min-integer-digits"]||1),ps(u.grouping)&&(l=O1(wo("#",Math.max(0,4-l.length))+l)),(+u["min-decimal-places"]||+u["decimal-places"])&&(l+="."),+u["min-decimal-places"]&&(l+=wo("0",+u["min-decimal-places"]||1)),+u["decimal-places"]-(+u["min-decimal-places"]||0)&&(l+=wo("0",+u["decimal-places"]-(+u["min-decimal-places"]||0))),s+=l;break;case"embedded-text":a[1]==="/"?h==0?s+='"'+i.slice(c,Mu.lastIndex-a[0].length).replace(/"/g,'""')+'"':s=s.slice(0,h)+'"'+i.slice(c,Mu.lastIndex-a[0].length).replace(/"/g,'""')+'"'+s.slice(h):a[0].charAt(a[0].length-2)!=="/"&&(c=Mu.lastIndex,h=-+Tn(a[0],!1).position||0);break}return r}function MGe(n,e,t){var r=e||{},i=CU(n),a=[],o,s,l,u="",h=0,c,f,d={},v=[],p={};r.dense&&(p["!data"]=[]);var g,m,y={value:""},_="",x=0,S=[],w=-1,b=-1,E={s:{r:1e6,c:1e7},e:{r:0,c:0}},T=0,C=t||{},A={},M=[],I={},R=0,k=0,D=[],G=1,W=1,z=[],V={Names:[],WBProps:{}},q={},Y=["",""],le=[],j={},Q="",ie=0,oe=!1,se=!1,me=0,Ce=0;for(Mu.lastIndex=0,i=i.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");g=Mu.exec(i);)switch(g[3]=g[3].replace(/_.*$/,"")){case"table":case"\u5DE5\u4F5C\u8868":g[1]==="/"?(E.e.c>=E.s.c&&E.e.r>=E.s.r?p["!ref"]=lo(E):p["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=E.e.r&&(p["!fullref"]=p["!ref"],E.e.r=r.sheetRows-1,p["!ref"]=lo(E)),M.length&&(p["!merges"]=M),D.length&&(p["!rows"]=D),c.name=c.\u540D\u79F0||c.name,typeof JSON<"u"&&JSON.stringify(c),v.push(c.name),d[c.name]=p,se=!1):g[0].charAt(g[0].length-2)!=="/"&&(c=Tn(g[0],!1),w=b=-1,E.s.r=E.s.c=1e7,E.e.r=E.e.c=0,p={},r.dense&&(p["!data"]=[]),M=[],D=[],se=!0);break;case"table-row-group":g[1]==="/"?--T:++T;break;case"table-row":case"\u884C":if(g[1]==="/"){w+=G,G=1;break}if(f=Tn(g[0],!1),f.\u884C\u53F7?w=f.\u884C\u53F7-1:w==-1&&(w=0),G=+f["number-rows-repeated"]||1,G<10)for(me=0;me<G;++me)T>0&&(D[w+me]={level:T});b=-1;break;case"covered-table-cell":g[1]!=="/"&&++b,r.sheetStubs&&(r.dense?(p["!data"][w]||(p["!data"][w]=[]),p["!data"][w][b]={t:"z"}):p[bo({r:w,c:b})]={t:"z"}),_="",S=[];break;case"table-cell":case"\u6570\u636E":if(g[0].charAt(g[0].length-2)==="/")++b,y=Tn(g[0],!1),W=parseInt(y["number-columns-repeated"]||"1",10),m={t:"z",v:null},y.formula&&r.cellFormula!=!1&&(m.f=X_e(so(y.formula))),y["style-name"]&&A[y["style-name"]]&&(m.z=A[y["style-name"]]),(y.\u6570\u636E\u7C7B\u578B||y["value-type"])=="string"&&(m.t="s",m.v=so(y["string-value"]||""),r.dense?(p["!data"][w]||(p["!data"][w]=[]),p["!data"][w][b]=m):p[$o(b)+ys(w)]=m),b+=W-1;else if(g[1]!=="/"){++b,_="",x=0,S=[],W=1;var Le=G?w+G-1:w;if(b>E.e.c&&(E.e.c=b),b<E.s.c&&(E.s.c=b),w<E.s.r&&(E.s.r=w),Le>E.e.r&&(E.e.r=Le),y=Tn(g[0],!1),le=[],j={},m={t:y.\u6570\u636E\u7C7B\u578B||y["value-type"],v:null},y["style-name"]&&A[y["style-name"]]&&(m.z=A[y["style-name"]]),r.cellFormula)if(y.formula&&(y.formula=so(y.formula)),y["number-matrix-columns-spanned"]&&y["number-matrix-rows-spanned"]&&(R=parseInt(y["number-matrix-rows-spanned"],10)||0,k=parseInt(y["number-matrix-columns-spanned"],10)||0,I={s:{r:w,c:b},e:{r:w+R-1,c:b+k-1}},m.F=lo(I),z.push([I,m.F])),y.formula)m.f=X_e(y.formula);else for(me=0;me<z.length;++me)w>=z[me][0].s.r&&w<=z[me][0].e.r&&b>=z[me][0].s.c&&b<=z[me][0].e.c&&(m.F=z[me][1]);switch((y["number-columns-spanned"]||y["number-rows-spanned"])&&(R=parseInt(y["number-rows-spanned"],10)||0,k=parseInt(y["number-columns-spanned"],10)||0,I={s:{r:w,c:b},e:{r:w+R-1,c:b+k-1}},M.push(I)),y["number-columns-repeated"]&&(W=parseInt(y["number-columns-repeated"],10)),m.t){case"boolean":m.t="b",m.v=ps(y["boolean-value"])||+y["boolean-value"]>=1;break;case"float":m.t="n",m.v=parseFloat(y.value);break;case"percentage":m.t="n",m.v=parseFloat(y.value);break;case"currency":m.t="n",m.v=parseFloat(y.value);break;case"date":m.t="d",m.v=pc(y["date-value"]),r.cellDates||(m.t="n",m.v=Zc(m.v,V.WBProps.date1904)-Ce),m.z||(m.z="m/d/yy");break;case"time":m.t="n",m.v=QLt(y["time-value"])/86400,r.cellDates&&(m.t="d",m.v=TU(m.v)),m.z||(m.z="HH:MM:SS");break;case"number":m.t="n",m.v=parseFloat(y.\u6570\u636E\u6570\u503C);break;default:if(m.t==="string"||m.t==="text"||!m.t)m.t="s",y["string-value"]!=null&&(_=so(y["string-value"]),S=[]);else throw new Error("Unsupported value type "+m.t)}}else{if(oe=!1,m.t==="s"&&(m.v=_||"",S.length&&(m.R=S),oe=x==0),q.Target&&(m.l=q),le.length>0&&(m.c=le,le=[]),_&&r.cellText!==!1&&(m.w=_),oe&&(m.t="z",delete m.v),(!oe||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=w))for(var re=0;re<G;++re){if(W=parseInt(y["number-columns-repeated"]||"1",10),r.dense)for(p["!data"][w+re]||(p["!data"][w+re]=[]),p["!data"][w+re][b]=re==0?m:sh(m);--W>0;)p["!data"][w+re][b+W]=sh(m);else for(p[bo({r:w+re,c:b})]=m;--W>0;)p[bo({r:w+re,c:b+W})]=sh(m);E.e.c<=b&&(E.e.c=b)}W=parseInt(y["number-columns-repeated"]||"1",10),b+=W-1,W=0,m={},_="",S=[]}q={};break;case"document":case"document-content":case"\u7535\u5B50\u8868\u683C\u6587\u6863":case"spreadsheet":case"\u4E3B\u4F53":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(g[1]==="/"){if((o=a.pop())[0]!==g[3])throw"Bad state: "+o}else g[0].charAt(g[0].length-2)!=="/"&&a.push([g[3],!0]);break;case"annotation":if(g[1]==="/"){if((o=a.pop())[0]!==g[3])throw"Bad state: "+o;j.t=_,S.length&&(j.R=S),j.a=Q,le.push(j)}else g[0].charAt(g[0].length-2)!=="/"&&a.push([g[3],!1]);Q="",ie=0,_="",x=0,S=[];break;case"creator":g[1]==="/"?Q=i.slice(ie,g.index):ie=g.index+g[0].length;break;case"meta":case"\u5143\u6570\u636E":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(g[1]==="/"){if((o=a.pop())[0]!==g[3])throw"Bad state: "+o}else g[0].charAt(g[0].length-2)!=="/"&&a.push([g[3],!1]);_="",x=0,S=[];break;case"scientific-number":case"currency-symbol":case"fill-character":break;case"text-style":case"boolean-style":case"number-style":case"currency-style":case"percentage-style":case"date-style":case"time-style":if(g[1]==="/"){var yt=Mu.lastIndex;AGe(i.slice(l,Mu.lastIndex),e,C),Mu.lastIndex=yt}else g[0].charAt(g[0].length-2)!=="/"&&(l=Mu.lastIndex-g[0].length);break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":{var je=Tn(g[0],!1);je.family=="table-cell"&&C[je["data-style-name"]]&&(A[je.name]=C[je["data-style-name"]])}break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":break;case"boolean":break;case"text":if(g[0].slice(-2)==="/>")break;if(g[1]==="/")switch(a[a.length-1][0]){case"number-style":case"date-style":case"time-style":u+=i.slice(h,g.index);break}else h=g.index+g[0].length;break;case"named-range":s=Tn(g[0],!1),Y=xX(s["cell-range-address"]);var st={Name:s.name,Ref:Y[0]+"!"+Y[1]};se&&(st.Sheet=v.length),V.Names.push(st);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"\u7535\u5B50\u8868\u683C":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":switch(s=Tn(g[0],!1),s["date-value"]){case"1904-01-01":V.WBProps.date1904=!0;case"1900-01-01":Ce=0}break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"\u6587\u672C\u4E32":if(["master-styles"].indexOf(a[a.length-1][0])>-1)break;if(g[1]==="/"&&(!y||!y["string-value"])){var Nt=UFt(i.slice(x,g.index));_=(_.length>0?_+`
`:"")+Nt[0]}else Tn(g[0],!1),x=g.index+g[0].length;break;case"s":break;case"database-range":if(g[1]==="/")break;try{Y=xX(Tn(g[0])["target-range-address"]),d[Y[0]]["!autofilter"]={ref:Y[1]}}catch{}break;case"date":break;case"object":break;case"title":case"\u6807\u9898":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(g[1]!=="/"){if(q=Tn(g[0],!1),!q.href)break;q.Target=so(q.href),delete q.href,q.Target.charAt(0)=="#"&&q.Target.indexOf(".")>-1?(Y=xX(q.Target.slice(1)),q.Target="#"+Y[0]+"!"+Y[1]):q.Target.match(/^\.\.[\\\/]/)&&(q.Target=q.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(g[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"\u8868:":case"\u5B57:":break;default:if(r.WTF)throw new Error(g)}}var Zt={Sheets:d,SheetNames:v,Workbook:V};return r.bookSheets&&delete Zt.Sheets,Zt}function Q_e(n,e){e=e||{},hp(n,"META-INF/manifest.xml")&&iOt(Cu(n,"META-INF/manifest.xml"),e);var t=cd(n,"styles.xml"),r=t&&AGe(As(t)),i=cd(n,"content.xml");if(!i)throw new Error("Missing content.xml in ODS / UOF file");var a=MGe(As(i),e,r);return hp(n,"meta.xml")&&(a.Props=z8e(Cu(n,"meta.xml"))),a.bookType="ods",a}function exe(n,e){var t=MGe(n,e);return t.bookType="fods",t}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */var Uc=function(){try{return typeof Uint8Array>"u"||typeof Uint8Array.prototype.subarray>"u"?"slice":typeof Buffer<"u"?typeof Buffer.prototype.subarray>"u"?"slice":(typeof Buffer.from=="function"?Buffer.from([72,62]):new Buffer([72,62]))instanceof Uint8Array?"subarray":"slice":"subarray"}catch{return"slice"}}();function DD(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function EQ(n){return typeof TextDecoder<"u"?new TextDecoder().decode(n):As(p_(n))}function IGe(n){for(var e=0,t=0;t<n.length;++t)e+=n[t].length;var r=new Uint8Array(e),i=0;for(t=0;t<n.length;++t){var a=n[t],o=a.length;if(o<250)for(var s=0;s<o;++s)r[i++]=a[s];else r.set(a,i),i+=o}return r}function TQ(n){return n-=n>>1&1431655765,n=(n&858993459)+(n>>2&858993459),(n+(n>>4)&252645135)*16843009>>>24}function VFt(n,e){for(var t=(n[e+15]&127)<<7|n[e+14]>>1,r=n[e+14]&1,i=e+13;i>=e;--i)r=r*256+n[i];return(n[e+15]&128?-r:r)*Math.pow(10,t-6176)}function i9(n,e){var t=e.l,r=n[t]&127;e:if(n[t++]>=128&&(r|=(n[t]&127)<<7,n[t++]<128||(r|=(n[t]&127)<<14,n[t++]<128)||(r|=(n[t]&127)<<21,n[t++]<128)||(r+=(n[t]&127)*Math.pow(2,28),++t,n[t++]<128)||(r+=(n[t]&127)*Math.pow(2,35),++t,n[t++]<128)||(r+=(n[t]&127)*Math.pow(2,42),++t,n[t++]<128)))break e;return e.l=t,r}function Vs(n){var e=0,t=n[e]&127;e:if(n[e++]>=128){if(t|=(n[e]&127)<<7,n[e++]<128||(t|=(n[e]&127)<<14,n[e++]<128)||(t|=(n[e]&127)<<21,n[e++]<128))break e;t|=(n[e]&127)<<28}return t}function au(n){for(var e=[],t={l:0};t.l<n.length;){var r=t.l,i=i9(n,t),a=i&7;i=i/8|0;var o,s=t.l;switch(a){case 0:{for(;n[s++]>=128;);o=n[Uc](t.l,s),t.l=s}break;case 1:o=n[Uc](s,s+8),t.l=s+8;break;case 2:{var l=i9(n,t);o=n[Uc](t.l,t.l+l),t.l+=l}break;case 5:o=n[Uc](s,s+4),t.l=s+4;break;default:throw new Error("PB Type ".concat(a," for Field ").concat(i," at offset ").concat(r))}var u={data:o,type:a};e[i]==null&&(e[i]=[]),e[i].push(u)}return e}function Aoe(n,e){return(n==null?void 0:n.map(function(t){return e(t.data)}))||[]}function $Ft(n){for(var e,t=[],r={l:0};r.l<n.length;){var i=i9(n,r),a=au(n[Uc](r.l,r.l+i));r.l+=i;var o={id:Vs(a[1][0].data),messages:[]};a[2].forEach(function(s){var l=au(s.data),u=Vs(l[3][0].data);o.messages.push({meta:l,data:n[Uc](r.l,r.l+u)}),r.l+=u}),(e=a[3])!=null&&e[0]&&(o.merge=Vs(a[3][0].data)>>>0>0),t.push(o)}return t}function WFt(n,e){if(n!=0)throw new Error("Unexpected Snappy chunk type ".concat(n));for(var t={l:0},r=i9(e,t),i=[],a=t.l;a<e.length;){var o=e[a]&3;if(o==0){var s=e[a++]>>2;if(s<60)++s;else{var l=s-59;s=e[a],l>1&&(s|=e[a+1]<<8),l>2&&(s|=e[a+2]<<16),l>3&&(s|=e[a+3]<<24),s>>>=0,s++,a+=l}i.push(e[Uc](a,a+s)),a+=s;continue}else{var u=0,h=0;if(o==1?(h=(e[a]>>2&7)+4,u=(e[a++]&224)<<3,u|=e[a++]):(h=(e[a++]>>2)+1,o==2?(u=e[a]|e[a+1]<<8,a+=2):(u=(e[a]|e[a+1]<<8|e[a+2]<<16|e[a+3]<<24)>>>0,a+=4)),u==0)throw new Error("Invalid offset 0");for(var c=i.length-1,f=u;c>=0&&f>=i[c].length;)f-=i[c].length,--c;if(c<0)if(f==0)f=i[c=0].length;else throw new Error("Invalid offset beyond length");if(h<f)i.push(i[c][Uc](i[c].length-f,i[c].length-f+h));else{for(f>0&&(i.push(i[c][Uc](i[c].length-f)),h-=f),++c;h>=i[c].length;)i.push(i[c]),h-=i[c].length,++c;h&&i.push(i[c][Uc](0,h))}i.length>25&&(i=[IGe(i)])}}for(var d=0,v=0;v<i.length;++v)d+=i[v].length;if(d!=r)throw new Error("Unexpected length: ".concat(d," != ").concat(r));return i}function HFt(n){Array.isArray(n)&&(n=new Uint8Array(n));for(var e=[],t=0;t<n.length;){var r=n[t++],i=n[t]|n[t+1]<<8|n[t+2]<<16;t+=3,e.push.apply(e,WFt(r,n[Uc](t,t+i))),t+=i}if(t!==n.length)throw new Error("data is not a valid framed stream!");return e.length==1?e[0]:IGe(e)}var jFt=function(){return{sst:[],rsst:[],ofmt:[],nfmt:[]}};function LGe(n,e,t,r,i){var a,o,s,l,u=e&255,h=e>>8,c=h>=5?i:r;e:if(t&(h>4?8:4)&&n.t=="n"&&u==7){var f=(a=c[7])!=null&&a[0]?Vs(c[7][0].data):-1;if(f==-1)break e;var d=(o=c[15])!=null&&o[0]?Vs(c[15][0].data):-1,v=(s=c[16])!=null&&s[0]?Vs(c[16][0].data):-1,p=(l=c[40])!=null&&l[0]?Vs(c[40][0].data):-1,g=n.v,m=g;t:if(p){if(g==0){d=v=2;break t}g>=604800?d=1:g>=86400?d=2:g>=3600?d=4:g>=60?d=8:g>=1?d=16:d=32,Math.floor(g)!=g?v=32:g%60?v=16:g%3600?v=8:g%86400?v=4:g%604800&&(v=2),v<d&&(v=d)}if(d==-1||v==-1)break e;var y=[],_=[];d==1&&(m=g/604800,v==1?_.push('d"d"'):(m|=0,g-=604800*m),y.push(m+(f==2?" week"+(m==1?"":"s"):f==1?"w":""))),d<=2&&v>=2&&(m=g/86400,v>2&&(m|=0,g-=86400*m),_.push('d"d"'),y.push(m+(f==2?" day"+(m==1?"":"s"):f==1?"d":""))),d<=4&&v>=4&&(m=g/3600,v>4&&(m|=0,g-=3600*m),_.push((d>=4?"[h]":"h")+'"h"'),y.push(m+(f==2?" hour"+(m==1?"":"s"):f==1?"h":""))),d<=8&&v>=8&&(m=g/60,v>8&&(m|=0,g-=60*m),_.push((d>=8?"[m]":"m")+'"m"'),f==0?y.push((d==8&&v==8||m>=10?"":"0")+m):y.push(m+(f==2?" minute"+(m==1?"":"s"):f==1?"m":""))),d<=16&&v>=16&&(m=g,v>16&&(m|=0,g-=m),_.push((d>=16?"[s]":"s")+'"s"'),f==0?y.push((v==16&&d==16||m>=10?"":"0")+m):y.push(m+(f==2?" second"+(m==1?"":"s"):f==1?"s":""))),v>=32&&(m=Math.round(1e3*g),d<32&&_.push('.000"ms"'),f==0?y.push((m>=100?"":m>=10?"0":"00")+m):y.push(m+(f==2?" millisecond"+(m==1?"":"s"):f==1?"ms":""))),n.w=y.join(f==0?":":" "),n.z=_.join(f==0?'":"':" "),f==0&&(n.w=n.w.replace(/:(\d\d\d)$/,".$1"))}}function XFt(n,e,t){var r=DD(n),i=r.getUint32(4,!0),a=-1,o=-1,s=-1,l=NaN,u=new Date(2001,0,1),h=t>1?12:8;i&2&&(s=r.getUint32(h,!0),h+=4),h+=TQ(i&(t>1?3468:396))*4,i&512&&(a=r.getUint32(h,!0),h+=4),h+=TQ(i&(t>1?12288:4096))*4,i&16&&(o=r.getUint32(h,!0),h+=4),i&32&&(l=r.getFloat64(h,!0),h+=8),i&64&&(u.setTime(u.getTime()+r.getFloat64(h,!0)*1e3),h+=8),t>1&&(i=r.getUint32(8,!0)>>>16,i&255&&(s==-1&&(s=r.getUint32(h,!0)),h+=4));var c,f=n[t>=4?1:2];switch(f){case 0:return;case 2:c={t:"n",v:l};break;case 3:c={t:"s",v:e.sst[o]};break;case 5:c={t:"d",v:u};break;case 6:c={t:"b",v:l>0};break;case 7:c={t:"n",v:l};break;case 8:c={t:"e",v:0};break;case 9:if(a>-1)c={t:"s",v:e.rsst[a]};else throw new Error("Unsupported cell type ".concat(n[Uc](0,4)));break;default:throw new Error("Unsupported cell type ".concat(n[Uc](0,4)))}return s>-1&&LGe(c,f|t<<8,i,e.ofmt[s],e.nfmt[s]),f==7&&(c.v/=86400),c}function YFt(n,e){var t=DD(n);t.getUint32(4,!0);var r=t.getUint32(8,!0),i=12,a=-1,o=-1,s=-1,l=NaN,u=NaN,h=new Date(2001,0,1);r&1&&(l=VFt(n,i),i+=16),r&2&&(u=t.getFloat64(i,!0),i+=8),r&4&&(h.setTime(h.getTime()+t.getFloat64(i,!0)*1e3),i+=8),r&8&&(o=t.getUint32(i,!0),i+=4),r&16&&(a=t.getUint32(i,!0),i+=4);var c,f=n[1];switch(f){case 0:return;case 2:c={t:"n",v:l};break;case 3:c={t:"s",v:e.sst[o]};break;case 5:c={t:"d",v:h};break;case 6:c={t:"b",v:u>0};break;case 7:c={t:"n",v:u};break;case 8:c={t:"e",v:0};break;case 9:c={t:"s",v:e.rsst[a]};break;case 10:c={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(n[1]," : ").concat(r&31," : ").concat(n[Uc](0,4)))}return i+=TQ(r&8160)*4,r&516096&&(s==-1&&(s=t.getUint32(i,!0)),i+=4),s>-1&&LGe(c,f|5<<8,r>>13,e.ofmt[s],e.nfmt[s]),f==7&&(c.v/=86400),c}function qFt(n,e){switch(n[0]){case 0:case 1:case 2:case 3:case 4:return XFt(n,e,n[0]);case 5:return YFt(n,e);default:throw new Error("Unsupported payload version ".concat(n[0]))}}function Hg(n){var e=au(n);return Vs(e[1][0].data)}function t5(n,e){var t=au(e.data),r=Vs(t[1][0].data),i=t[3],a=[];return(i||[]).forEach(function(o){var s=au(o.data);if(!!s[1]){var l=Vs(s[1][0].data)>>>0;switch(r){case 1:a[l]=EQ(s[3][0].data);break;case 8:{var u=n[Hg(s[9][0].data)][0],h=au(u.data),c=n[Hg(h[1][0].data)][0],f=Vs(c.meta[1][0].data);if(f!=2001)throw new Error("2000 unexpected reference to ".concat(f));var d=au(c.data);a[l]=d[3].map(function(v){return EQ(v.data)}).join("")}break;case 2:a[l]=au(s[6][0].data);break;default:throw r}}}),a}function ZFt(n,e){var t,r,i,a,o,s,l,u,h,c,f,d,v,p,g=au(n),m=Vs(g[1][0].data)>>>0,y=Vs(g[2][0].data)>>>0,_=((r=(t=g[8])==null?void 0:t[0])==null?void 0:r.data)&&Vs(g[8][0].data)>0||!1,x,S;if(((a=(i=g[7])==null?void 0:i[0])==null?void 0:a.data)&&e!=0)x=(s=(o=g[7])==null?void 0:o[0])==null?void 0:s.data,S=(u=(l=g[6])==null?void 0:l[0])==null?void 0:u.data;else if(((c=(h=g[4])==null?void 0:h[0])==null?void 0:c.data)&&e!=1)x=(d=(f=g[4])==null?void 0:f[0])==null?void 0:d.data,S=(p=(v=g[3])==null?void 0:v[0])==null?void 0:p.data;else throw"NUMBERS Tile missing ".concat(e," cell storage");for(var w=_?4:1,b=DD(x),E=[],T=0;T<x.length/2;++T){var C=b.getUint16(T*2,!0);C<65535&&E.push([T,C])}if(E.length!=y)throw"Expected ".concat(y," cells, found ").concat(E.length);var A=[];for(T=0;T<E.length-1;++T)A[E[T][0]]=S[Uc](E[T][1]*w,E[T+1][1]*w);return E.length>=1&&(A[E[E.length-1][0]]=S[Uc](E[E.length-1][1]*w)),{R:m,cells:A}}function KFt(n,e){var t,r=au(e.data),i=-1;(t=r==null?void 0:r[7])!=null&&t[0]&&(Vs(r[7][0].data)>>>0?i=1:i=0);var a=Aoe(r[5],function(o){return ZFt(o,i)});return{nrows:Vs(r[4][0].data)>>>0,data:a.reduce(function(o,s){return o[s.R]||(o[s.R]=[]),s.cells.forEach(function(l,u){if(o[s.R][u])throw new Error("Duplicate cell r=".concat(s.R," c=").concat(u));o[s.R][u]=l}),o},[])}}function JFt(n,e,t){var r,i,a,o,s,l,u=au(e.data),h={s:{r:0,c:0},e:{r:0,c:0}};if(h.e.r=(Vs(u[6][0].data)>>>0)-1,h.e.r<0)throw new Error("Invalid row varint ".concat(u[6][0].data));if(h.e.c=(Vs(u[7][0].data)>>>0)-1,h.e.c<0)throw new Error("Invalid col varint ".concat(u[7][0].data));t["!ref"]=lo(h);var c=t["!data"]!=null,f=t,d=au(u[4][0].data),v=jFt();(r=d[4])!=null&&r[0]&&(v.sst=t5(n,n[Hg(d[4][0].data)][0])),(i=d[11])!=null&&i[0]&&(v.ofmt=t5(n,n[Hg(d[11][0].data)][0])),(a=d[17])!=null&&a[0]&&(v.rsst=t5(n,n[Hg(d[17][0].data)][0])),(o=d[22])!=null&&o[0]&&(v.nfmt=t5(n,n[Hg(d[22][0].data)][0]));var p=au(d[3][0].data),g=0;if(p[1].forEach(function(_){var x=au(_.data),S=n[Hg(x[2][0].data)][0],w=Vs(S.meta[1][0].data);if(w!=6002)throw new Error("6001 unexpected reference to ".concat(w));var b=KFt(n,S);b.data.forEach(function(E,T){E.forEach(function(C,A){var M=qFt(C,v);M&&(c?(f["!data"][g+T]||(f["!data"][g+T]=[]),f["!data"][g+T][A]=M):t[$o(A)+ys(g+T)]=M)})}),g+=b.nrows}),(s=d[13])!=null&&s[0]){var m=n[Hg(d[13][0].data)][0],y=Vs(m.meta[1][0].data);if(y!=6144)throw new Error("Expected merge type 6144, found ".concat(y));t["!merges"]=(l=au(m.data))==null?void 0:l[1].map(function(_){var x=au(_.data),S=DD(au(x[1][0].data)[1][0].data),w=DD(au(x[2][0].data)[1][0].data);return{s:{r:S.getUint16(0,!0),c:S.getUint16(2,!0)},e:{r:S.getUint16(0,!0)+w.getUint16(0,!0)-1,c:S.getUint16(2,!0)+w.getUint16(2,!0)-1}}})}}function QFt(n,e,t){var r=au(e.data),i={"!ref":"A1"};t!=null&&t.dense&&(i["!data"]=[]);var a=n[Hg(r[2][0].data)],o=Vs(a[0].meta[1][0].data);if(o!=6001)throw new Error("6000 unexpected reference to ".concat(o));return JFt(n,a[0],i),i}function e4t(n,e,t){var r,i=au(e.data),a={name:(r=i[1])!=null&&r[0]?EQ(i[1][0].data):"",sheets:[]},o=Aoe(i[2],Hg);return o.forEach(function(s){n[s].forEach(function(l){var u=Vs(l.meta[1][0].data);u==6e3&&a.sheets.push(QFt(n,l,t))})}),a}function t4t(n,e,t){var r,i=Loe(),a=au(e.data);if((r=a[2])!=null&&r[0])throw new Error("Keynote presentations are not supported");var o=Aoe(a[1],Hg);if(o.forEach(function(s){n[s].forEach(function(l){var u=Vs(l.meta[1][0].data);if(u==2){var h=e4t(n,l,t);h.sheets.forEach(function(c,f){LU(i,c,f==0?h.name:h.name+"_"+f,!0)})}})}),i.SheetNames.length==0)throw new Error("Empty NUMBERS file");return i.bookType="numbers",i}function wX(n,e){var t,r,i,a,o,s,l,u={},h=[];if(n.FullPaths.forEach(function(f){if(f.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),n.FileIndex.forEach(function(f){if(!!f.name.match(/\.iwa$/)&&f.content[0]==0){var d;try{d=HFt(f.content)}catch(p){return console.log("?? "+f.content.length+" "+(p.message||p))}var v;try{v=$Ft(d)}catch(p){return console.log("## "+(p.message||p))}v.forEach(function(p){u[p.id]=p.messages,h.push(p.id)})}}),!h.length)throw new Error("File has no messages");if(((i=(r=(t=u==null?void 0:u[1])==null?void 0:t[0].meta)==null?void 0:r[1])==null?void 0:i[0].data)&&Vs(u[1][0].meta[1][0].data)==1e4)throw new Error("Pages documents are not supported");var c=((l=(s=(o=(a=u==null?void 0:u[1])==null?void 0:a[0])==null?void 0:o.meta)==null?void 0:s[1])==null?void 0:l[0].data)&&Vs(u[1][0].meta[1][0].data)==1&&u[1][0];if(c||h.forEach(function(f){u[f].forEach(function(d){var v=Vs(d.meta[1][0].data)>>>0;if(v==1)if(!c)c=d;else throw new Error("Document has multiple roots")})}),!c)throw new Error("Cannot find Document root");return t4t(u,c,e)}function r4t(n){return function(t){for(var r=0;r!=n.length;++r){var i=n[r];t[i[0]]===void 0&&(t[i[0]]=i[1]),i[2]==="n"&&(t[i[0]]=Number(t[i[0]]))}}}function Moe(n){r4t([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(n)}function n4t(n){return vA.WS.indexOf(n)>-1?"sheet":n==vA.CS?"chart":n==vA.DS?"dialog":n==vA.MS?"macro":n&&n.length?n:"sheet"}function i4t(n,e){if(!n)return 0;try{n=e.map(function(r){return r.id||(r.id=r.strRelID),[r.name,n["!id"][r.id].Target,n4t(n["!id"][r.id].Type)]})}catch{return null}return!n||n.length===0?null:n}function a4t(n,e,t,r,i,a,o,s,l,u,h,c){try{a[r]=lR(cd(n,t,!0),e);var f=Cu(n,e),d;switch(s){case"sheet":d=hFt(f,e,i,l,a[r],u,h,c);break;case"chart":if(d=cFt(f,e,i,l,a[r],u,h,c),!d||!d["!drawel"])break;var v=fO(d["!drawel"].Target,e),p=_Q(v),g=uNt(cd(n,v,!0),lR(cd(n,p,!0),v)),m=fO(g,v),y=_Q(m);d=Xkt(cd(n,m,!0),m,l,lR(cd(n,y,!0),m),u,d);break;case"macro":d=fFt(f,e,i,l,a[r],u,h,c);break;case"dialog":d=dFt(f,e,i,l,a[r],u,h,c);break;default:throw new Error("Unrecognized sheet type "+s)}o[r]=d;var _=[],x=[];a&&a[r]&&h0(a[r]).forEach(function(S){var w="";if(a[r][S].Type==vA.CMNT){if(w=fO(a[r][S].Target,e),_=gFt(Cu(n,w,!0),w,l),!_||!_.length)return;V_e(d,_,!1)}a[r][S].Type==vA.TCMNT&&(w=fO(a[r][S].Target,e),x=x.concat(cNt(Cu(n,w,!0),l)))}),x&&x.length&&V_e(d,x,!0,l.people||[])}catch(S){if(l.WTF)throw S}}function Zv(n){return n.charAt(0)=="/"?n.slice(1):n}function o4t(n,e){if(u8e(),e=e||{},Moe(e),hp(n,"META-INF/manifest.xml")||hp(n,"objectdata.xml"))return Q_e(n,e);if(hp(n,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof wX<"u"){if(n.FileIndex)return wX(n,e);var t=co.utils.cfb_new();return v_e(n).forEach(function(k){oPt(t,k,p8e(n,k))}),wX(t,e)}throw new Error("Unsupported NUMBERS file")}if(!hp(n,"[Content_Types].xml")){if(hp(n,"index.xml.gz"))throw new Error("Unsupported NUMBERS 08 file");if(hp(n,"index.xml"))throw new Error("Unsupported NUMBERS 09 file");var r=co.find(n,"Index.zip");if(r)return e=sh(e),delete e.type,typeof r.content=="string"&&(e.type="binary"),typeof Bun<"u"&&Buffer.isBuffer(r.content)?ND(new Uint8Array(r.content),e):ND(r.content,e);throw new Error("Unsupported ZIP file")}var i=v_e(n),a=rOt(cd(n,"[Content_Types].xml")),o=!1,s,l;if(a.workbooks.length===0&&(l="xl/workbook.xml",Cu(n,l,!0)&&a.workbooks.push(l)),a.workbooks.length===0){if(l="xl/workbook.bin",!Cu(n,l,!0))throw new Error("Could not find workbook");a.workbooks.push(l),o=!0}a.workbooks[0].slice(-3)=="bin"&&(o=!0);var u={},h={};if(!e.bookSheets&&!e.bookProps){if(cR=[],a.sst)try{cR=pFt(Cu(n,Zv(a.sst)),a.sst,e)}catch(k){if(e.WTF)throw k}e.cellStyles&&a.themes.length&&(u=sGe(cd(n,a.themes[0].replace(/^\//,""),!0)||"",e)),a.style&&(h=vFt(Cu(n,Zv(a.style)),a.style,u,e))}a.links.map(function(k){try{var D=lR(cd(n,_Q(Zv(k))),k);return mFt(Cu(n,Zv(k)),D,k,e)}catch{}});var c=uFt(Cu(n,Zv(a.workbooks[0])),a.workbooks[0],e),f={},d="";a.coreprops.length&&(d=Cu(n,Zv(a.coreprops[0]),!0),d&&(f=z8e(d)),a.extprops.length!==0&&(d=Cu(n,Zv(a.extprops[0]),!0),d&&sOt(d,f,e)));var v={};(!e.bookSheets||e.bookProps)&&a.custprops.length!==0&&(d=cd(n,Zv(a.custprops[0]),!0),d&&(v=uOt(d,e)));var p={};if((e.bookSheets||e.bookProps)&&(c.Sheets?s=c.Sheets.map(function(D){return D.name}):f.Worksheets&&f.SheetNames.length>0&&(s=f.SheetNames),e.bookProps&&(p.Props=f,p.Custprops=v),e.bookSheets&&typeof s<"u"&&(p.SheetNames=s),e.bookSheets?p.SheetNames:e.bookProps))return p;s={};var g={};e.bookDeps&&a.calcchain&&(g=yFt(Cu(n,Zv(a.calcchain)),a.calcchain));var m=0,y={},_,x;{var S=c.Sheets;f.Worksheets=S.length,f.SheetNames=[];for(var w=0;w!=S.length;++w)f.SheetNames[w]=S[w].name}var b=o?"bin":"xml",E=a.workbooks[0].lastIndexOf("/"),T=(a.workbooks[0].slice(0,E+1)+"_rels/"+a.workbooks[0].slice(E+1)+".rels").replace(/^\//,"");hp(n,T)||(T="xl/_rels/workbook."+b+".rels");var C=lR(cd(n,T,!0),T.replace(/_rels.*/,"s5s"));(a.metadata||[]).length>=1&&(e.xlmeta=_Ft(Cu(n,Zv(a.metadata[0])),a.metadata[0],e)),(a.people||[]).length>=1&&(e.people=fNt(Cu(n,Zv(a.people[0])),e)),C&&(C=i4t(C,c.Sheets));var A=Cu(n,"xl/worksheets/sheet.xml",!0)?1:0;e:for(m=0;m!=f.Worksheets;++m){var M="sheet";if(C&&C[m]?(_="xl/"+C[m][1].replace(/[\/]?xl\//,""),hp(n,_)||(_=C[m][1]),hp(n,_)||(_=T.replace(/_rels\/.*$/,"")+C[m][1]),M=C[m][2]):(_="xl/worksheets/sheet"+(m+1-A)+"."+b,_=_.replace(/sheet0\./,"sheet.")),x=_.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),e&&e.sheets!=null)switch(typeof e.sheets){case"number":if(m!=e.sheets)continue e;break;case"string":if(f.SheetNames[m].toLowerCase()!=e.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(e.sheets)){for(var I=!1,R=0;R!=e.sheets.length;++R)typeof e.sheets[R]=="number"&&e.sheets[R]==m&&(I=1),typeof e.sheets[R]=="string"&&e.sheets[R].toLowerCase()==f.SheetNames[m].toLowerCase()&&(I=1);if(!I)continue e}}a4t(n,_,x,f.SheetNames[m],m,y,s,M,e,c,u,h)}return p={Directory:a,Workbook:c,Props:f,Custprops:v,Deps:g,Sheets:s,SheetNames:f.SheetNames,Strings:cR,Styles:h,Themes:u,SSF:sh(ji)},e&&e.bookFiles&&(n.files?(p.keys=i,p.files=n.files):(p.keys=[],p.files={},n.FullPaths.forEach(function(k,D){k=k.replace(/^Root Entry[\/]/,""),p.keys.push(k),p.files[k]=n.FileIndex[D]}))),e&&e.bookVBA&&(a.vba.length>0?p.vbaraw=Cu(n,Zv(a.vba[0]),!0):a.defaults&&a.defaults.bin===gNt&&(p.vbaraw=Cu(n,"xl/vbaProject.bin",!0))),p.bookType=o?"xlsb":"xlsx",p}function s4t(n,e){var t=e||{},r="Workbook",i=co.find(n,r);try{if(r="/!DataSpaces/Version",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);if(KRt(i.content),r="/!DataSpaces/DataSpaceMap",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var a=QRt(i.content);if(a.length!==1||a[0].comps.length!==1||a[0].comps[0].t!==0||a[0].name!=="StrongEncryptionDataSpace"||a[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+r);if(r="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var o=eDt(i.content);if(o.length!=1||o[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+r);if(r="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);rDt(i.content)}catch{}if(r="/EncryptionInfo",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);var s=nDt(i.content);if(r="/EncryptedPackage",i=co.find(n,r),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+r);if(s[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(s[1],i.content,t.password||"",t);if(s[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(s[1],i.content,t.password||"",t);throw new Error("File is password-protected")}function Ioe(n,e){var t="";switch((e||{}).type||"base64"){case"buffer":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];case"base64":t=Tv(n.slice(0,12));break;case"binary":t=n;break;case"array":return[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function l4t(n,e){return co.find(n,"EncryptedPackage")?s4t(n,e):EGe(n,e)}function u4t(n,e){var t,r=n,i=e||{};return i.type||(i.type=oo&&Buffer.isBuffer(n)?"buffer":"base64"),t=g8e(r,i),o4t(t,i)}function PGe(n,e){var t=0;e:for(;t<n.length;)switch(n.charCodeAt(t)){case 10:case 13:case 32:++t;break;case 60:return wQ(n.slice(t),e);default:break e}return PD.to_workbook(n,e)}function h4t(n,e){var t="",r=Ioe(n,e);switch(e.type){case"base64":t=Tv(n);break;case"binary":t=n;break;case"buffer":t=n.toString("binary");break;case"array":t=t2(n);break;default:throw new Error("Unrecognized type "+e.type)}return r[0]==239&&r[1]==187&&r[2]==191&&(t=As(t)),e.type="binary",PGe(t,e)}function c4t(n,e){var t=n;return e.type=="base64"&&(t=Tv(t)),typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer&&(t=new Uint8Array(n)),t=oo&&Buffer.isBuffer(n)?n.slice(2).toString("utf16le"):typeof Uint8Array<"u"&&t instanceof Uint8Array?typeof TextDecoder<"u"?new TextDecoder("utf-16le").decode(t.slice(2)):xLt(t.slice(2)):KBe(t.slice(2)),e.type="binary",PGe(t,e)}function f4t(n){return n.match(/[^\x00-\x7F]/)?dO(n):n}function bX(n,e,t,r){return r?(t.type="string",PD.to_workbook(n,t)):PD.to_workbook(e,t)}function ND(n,e){ZBe();var t=e||{};if(t.codepage&&typeof $C>"u"&&console.error("Codepage tables are not loaded. Non-ASCII characters may not give expected results"),typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer)return ND(new Uint8Array(n),(t=sh(t),t.type="array",t));typeof Uint8Array<"u"&&n instanceof Uint8Array&&!t.type&&(t.type=typeof Deno<"u"?"buffer":"array");var r=n,i=[0,0,0,0],a=!1;if(t.cellStyles&&(t.cellNF=!0,t.sheetStubs=!0),VA={},t.dateNF&&(VA.dateNF=t.dateNF),t.type||(t.type=oo&&Buffer.isBuffer(n)?"buffer":"base64"),t.type=="file"&&(t.type=oo?"buffer":"binary",r=KLt(n),typeof Uint8Array<"u"&&!oo&&(t.type="array")),t.type=="string"&&(a=!0,t.type="binary",t.codepage=65001,r=f4t(n)),t.type=="array"&&typeof Uint8Array<"u"&&n instanceof Uint8Array&&typeof ArrayBuffer<"u"){var o=new ArrayBuffer(3),s=new Uint8Array(o);if(s.foo="bar",!s.foo)return t=sh(t),t.type="array",ND(hoe(r),t)}switch((i=Ioe(r,t))[0]){case 208:if(i[1]===207&&i[2]===17&&i[3]===224&&i[4]===161&&i[5]===177&&i[6]===26&&i[7]===225)return l4t(co.read(r,t),t);break;case 9:if(i[1]<=8)return EGe(r,t);break;case 60:return wQ(r,t);case 73:if(i[1]===73&&i[2]===42&&i[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(i[1]===68)return BRt(r,t);break;case 84:if(i[1]===65&&i[2]===66&&i[3]===76)return kRt.to_workbook(r,t);break;case 80:return i[1]===75&&i[2]<9&&i[3]<9?u4t(r,t):bX(n,r,t,a);case 239:return i[3]===60?wQ(r,t):bX(n,r,t,a);case 255:if(i[1]===254)return c4t(r,t);if(i[1]===0&&i[2]===2&&i[3]===0)return hR.to_workbook(r,t);break;case 0:if(i[1]===0&&(i[2]>=2&&i[3]===0||i[2]===0&&(i[3]===8||i[3]===9)))return hR.to_workbook(r,t);break;case 3:case 131:case 139:case 140:return U_e.to_workbook(r,t);case 123:if(i[1]===92&&i[2]===114&&i[3]===116)return gDt(r,t);break;case 10:case 13:case 32:return h4t(r,t);case 137:if(i[1]===80&&i[2]===78&&i[3]===71)throw new Error("PNG Image File is not a spreadsheet");break;case 8:if(i[1]===231)throw new Error("Unsupported Multiplan 1.x file!");break;case 12:if(i[1]===236)throw new Error("Unsupported Multiplan 2.x file!");if(i[1]===237)throw new Error("Unsupported Multiplan 3.x file!");break}return DRt.indexOf(i[0])>-1&&i[2]<=12&&i[3]<=31?U_e.to_workbook(r,t):bX(n,r,t,a)}function d4t(n,e,t,r,i,a,o){var s=ys(t),l=o.defval,u=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),h=!0,c=n["!data"]!=null,f=i===1?[]:{};if(i!==1)if(Object.defineProperty)try{Object.defineProperty(f,"__rowNum__",{value:t,enumerable:!1})}catch{f.__rowNum__=t}else f.__rowNum__=t;if(!c||n["!data"][t])for(var d=e.s.c;d<=e.e.c;++d){var v=c?(n["!data"][t]||[])[d]:n[r[d]+s];if(v===void 0||v.t===void 0){if(l===void 0)continue;a[d]!=null&&(f[a[d]]=l);continue}var p=v.v;switch(v.t){case"z":if(p==null)break;continue;case"e":p=p==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+v.t)}if(a[d]!=null){if(p==null)if(v.t=="e"&&p===null)f[a[d]]=null;else if(l!==void 0)f[a[d]]=l;else if(u&&p===null)f[a[d]]=null;else continue;else f[a[d]]=u&&(v.t!=="n"||v.t==="n"&&o.rawNumbers!==!1)?p:$S(v,p,o);p!=null&&(h=!1)}}return{row:f,isempty:h}}function CQ(n,e){if(n==null||n["!ref"]==null)return[];var t={t:"n",v:0},r=0,i=1,a=[],o=0,s="",l={s:{r:0,c:0},e:{r:0,c:0}},u=e||{},h=u.range!=null?u.range:n["!ref"];switch(u.header===1?r=1:u.header==="A"?r=2:Array.isArray(u.header)?r=3:u.header==null&&(r=0),typeof h){case"string":l=cu(h);break;case"number":l=cu(n["!ref"]),l.s.r=h;break;default:l=h}r>0&&(i=0);var c=ys(l.s.r),f=[],d=[],v=0,p=0,g=n["!data"]!=null,m=l.s.r,y=0,_={};g&&!n["!data"][m]&&(n["!data"][m]=[]);var x=u.skipHidden&&n["!cols"]||[],S=u.skipHidden&&n["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(x[y]||{}).hidden)switch(f[y]=$o(y),t=g?n["!data"][m][y]:n[f[y]+c],r){case 1:a[y]=y-l.s.c;break;case 2:a[y]=f[y];break;case 3:a[y]=u.header[y-l.s.c];break;default:if(t==null&&(t={w:"__EMPTY",t:"s"}),s=o=$S(t,null,u),p=_[o]||0,!p)_[o]=1;else{do s=o+"_"+p++;while(_[s]);_[o]=p,_[s]=1}a[y]=s}for(m=l.s.r+i;m<=l.e.r;++m)if(!(S[m]||{}).hidden){var w=d4t(n,l,m,f,r,a,u);(w.isempty===!1||(r===1?u.blankrows!==!1:!!u.blankrows))&&(d[v++]=w.row)}return d.length=v,d}var txe=/"/g;function v4t(n,e,t,r,i,a,o,s){for(var l=!0,u=[],h="",c=ys(t),f=n["!data"]!=null,d=f&&n["!data"][t]||[],v=e.s.c;v<=e.e.c;++v)if(!!r[v]){var p=f?d[v]:n[r[v]+c];if(p==null)h="";else if(p.v!=null){l=!1,h=""+(s.rawNumbers&&p.t=="n"?p.v:$S(p,null,s));for(var g=0,m=0;g!==h.length;++g)if((m=h.charCodeAt(g))===i||m===a||m===34||s.forceQuotes){h='"'+h.replace(txe,'""')+'"';break}h=="ID"&&(h='"ID"')}else p.f!=null&&!p.F?(l=!1,h="="+p.f,h.indexOf(",")>=0&&(h='"'+h.replace(txe,'""')+'"')):h="";u.push(h)}return s.blankrows===!1&&l?null:u.join(o)}function OGe(n,e){var t=[],r=e==null?{}:e;if(n==null||n["!ref"]==null)return"";for(var i=cu(n["!ref"]),a=r.FS!==void 0?r.FS:",",o=a.charCodeAt(0),s=r.RS!==void 0?r.RS:`
`,l=s.charCodeAt(0),u=new RegExp((a=="|"?"\\|":a)+"+$"),h="",c=[],f=r.skipHidden&&n["!cols"]||[],d=r.skipHidden&&n["!rows"]||[],v=i.s.c;v<=i.e.c;++v)(f[v]||{}).hidden||(c[v]=$o(v));for(var p=0,g=i.s.r;g<=i.e.r;++g)(d[g]||{}).hidden||(h=v4t(n,i,g,c,o,l,a,r),h!=null&&(r.strip&&(h=h.replace(u,"")),(h||r.blankrows!==!1)&&t.push((p++?s:"")+h)));return t.join("")}function p4t(n,e){e||(e={}),e.FS=" ",e.RS=`
`;var t=OGe(n,e);return t}function g4t(n){var e="",t,r="";if(n==null||n["!ref"]==null)return[];var i=cu(n["!ref"]),a="",o=[],s,l=[],u=n["!data"]!=null;for(s=i.s.c;s<=i.e.c;++s)o[s]=$o(s);for(var h=i.s.r;h<=i.e.r;++h)for(a=ys(h),s=i.s.c;s<=i.e.c;++s)if(e=o[s]+a,t=u?(n["!data"][h]||[])[s]:n[e],r="",t!==void 0){if(t.F!=null){if(e=t.F,!t.f)continue;r=t.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(t.f!=null)r=t.f;else{if(t.t=="z")continue;if(t.t=="n"&&t.v!=null)r=""+t.v;else if(t.t=="b")r=t.v?"TRUE":"FALSE";else if(t.w!==void 0)r="'"+t.w;else{if(t.v===void 0)continue;t.t=="s"?r="'"+t.v:r=""+t.v}}l[l.length]=e+"="+r}return l}function RGe(n,e,t){var r=t||{},i=n?n["!data"]!=null:r.dense,a=+!r.skipHeader,o=n||{};!n&&i&&(o["!data"]=[]);var s=0,l=0;if(o&&r.origin!=null)if(typeof r.origin=="number")s=r.origin;else{var u=typeof r.origin=="string"?zc(r.origin):r.origin;s=u.r,l=u.c}var h={s:{c:0,r:0},e:{c:l,r:s+e.length-1+a}};if(o["!ref"]){var c=cu(o["!ref"]);h.e.c=Math.max(h.e.c,c.e.c),h.e.r=Math.max(h.e.r,c.e.r),s==-1&&(s=c.e.r+1,h.e.r=s+e.length-1+a)}else s==-1&&(s=0,h.e.r=e.length-1+a);var f=r.header||[],d=0,v=[];e.forEach(function(g,m){i&&!o["!data"][s+m+a]&&(o["!data"][s+m+a]=[]),i&&(v=o["!data"][s+m+a]),h0(g).forEach(function(y){(d=f.indexOf(y))==-1&&(f[d=f.length]=y);var _=g[y],x="z",S="",w=i?"":$o(l+d)+ys(s+m+a),b=i?v[l+d]:o[w];_&&typeof _=="object"&&!(_ instanceof Date)?i?v[l+d]=_:o[w]=_:(typeof _=="number"?x="n":typeof _=="boolean"?x="b":typeof _=="string"?x="s":_ instanceof Date?(x="d",r.cellDates||(x="n",_=Zc(_)),S=b!=null&&b.z&&Q2(b.z)?b.z:r.dateNF||ji[14]):_===null&&r.nullError&&(x="e",_=0),b?(b.t=x,b.v=_,delete b.w,delete b.R,S&&(b.z=S)):i?v[l+d]=b={t:x,v:_}:o[w]=b={t:x,v:_},S&&(b.z=S))})}),h.e.c=Math.max(h.e.c,l+f.length-1);var p=ys(s);if(i&&!o["!data"][s]&&(o["!data"][s]=[]),a)for(d=0;d<f.length;++d)i?o["!data"][s][d+l]={t:"s",v:f[d]}:o[$o(d+l)+p]={t:"s",v:f[d]};return o["!ref"]=lo(h),o}function y4t(n,e){return RGe(null,n,e)}function a9(n,e,t){if(typeof e=="string"){if(n["!data"]!=null){var r=zc(e);return n["!data"][r.r]||(n["!data"][r.r]=[]),n["!data"][r.r][r.c]||(n["!data"][r.r][r.c]={t:"z"})}return n[e]||(n[e]={t:"z"})}return typeof e!="number"?a9(n,bo(e)):a9(n,$o(t||0)+ys(e))}function m4t(n,e){if(typeof e=="number"){if(e>=0&&n.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var t=n.SheetNames.indexOf(e);if(t>-1)return t;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function Loe(){return{SheetNames:[],Sheets:{}}}function LU(n,e,t,r){var i=1;if(!t)for(;i<=65535&&n.SheetNames.indexOf(t="Sheet"+i)!=-1;++i,t=void 0);if(!t||n.SheetNames.length>=65535)throw new Error("Too many worksheets");if(r&&n.SheetNames.indexOf(t)>=0){var a=t.match(/(^.*?)(\d+)$/);i=a&&+a[2]||0;var o=a&&a[1]||t;for(++i;i<=65535&&n.SheetNames.indexOf(t=o+i)!=-1;++i);}if(tFt(t),n.SheetNames.indexOf(t)>=0)throw new Error("Worksheet with name |"+t+"| already exists!");return n.SheetNames.push(t),n.Sheets[t]=e,t}function _4t(n,e,t){n.Workbook||(n.Workbook={}),n.Workbook.Sheets||(n.Workbook.Sheets=[]);var r=m4t(n,e);switch(n.Workbook.Sheets[r]||(n.Workbook.Sheets[r]={}),t){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+t)}n.Workbook.Sheets[r].Hidden=t}function x4t(n,e){return n.z=e,n}function DGe(n,e,t){return e?(n.l={Target:e},t&&(n.l.Tooltip=t)):delete n.l,n}function S4t(n,e,t){return DGe(n,"#"+e,t)}function w4t(n,e,t){n.c||(n.c=[]),n.c.push({t:e,a:t||"SheetJS"})}function b4t(n,e,t,r){for(var i=typeof e!="string"?e:cu(e),a=typeof e=="string"?e:lo(e),o=i.s.r;o<=i.e.r;++o)for(var s=i.s.c;s<=i.e.c;++s){var l=a9(n,o,s);l.t="n",l.F=a,delete l.v,o==i.s.r&&s==i.s.c&&(l.f=t,r&&(l.D=!0))}var u=eT(n["!ref"]);return u.s.r>i.s.r&&(u.s.r=i.s.r),u.s.c>i.s.c&&(u.s.c=i.s.c),u.e.r<i.e.r&&(u.e.r=i.e.r),u.e.c<i.e.c&&(u.e.c=i.e.c),n["!ref"]=lo(u),n}var E4t={encode_col:$o,encode_row:ys,encode_cell:bo,encode_range:lo,decode_col:yoe,decode_row:goe,split_cell:DPt,decode_cell:zc,decode_range:eT,format_cell:$S,sheet_add_aoa:D8e,sheet_add_json:RGe,sheet_add_dom:TGe,aoa_to_sheet:HI,json_to_sheet:y4t,table_to_sheet:CGe,table_to_book:GFt,sheet_to_csv:OGe,sheet_to_txt:p4t,sheet_to_json:CQ,sheet_to_html:BFt,sheet_to_formulae:g4t,sheet_to_row_object_array:CQ,sheet_get_cell:a9,book_new:Loe,book_append_sheet:LU,book_set_sheet_visibility:_4t,cell_set_number_format:x4t,cell_set_hyperlink:DGe,cell_set_internal_link:S4t,cell_add_comment:w4t,sheet_set_array_formula:b4t,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};let AQ={rABS:typeof FileReader<"u"&&FileReader.prototype&&FileReader.prototype.readAsBinaryString,rABF:typeof FileReader<"u"&&FileReader.prototype&&FileReader.prototype.readAsArrayBuffer,rAT:typeof FileReader<"u"&&FileReader.prototype&&FileReader.prototype.readAsText,readFile(n,e,t,r,i){UF.JSON===n||UF.GEOJSON===n?this.readTextFile(e,t,r,i):(UF.EXCEL===n||UF.CSV===n)&&this.readXLSXFile(e,t,r,i)},readTextFile(n,e,t,r){let i=new FileReader;i.onloadend=function(a){e&&e.call(r,a.target.result)},i.onerror=function(a){t&&t.call(r,a)},this.rAT?i.readAsText(n.file,"utf-8"):i.readAsBinaryString(n.file)},readXLSXFile(n,e,t,r){let i=new FileReader;i.onloadend=function(a){let o=new Uint8Array(a.target.result),s=ND(o,{type:"array"});try{if(s&&s.SheetNames&&s.SheetNames.length>0){let l=s.SheetNames[0],u=E4t.sheet_to_csv(s.Sheets[l]);e&&e.call(r,u)}}catch(l){t&&t.call(r,l)}},i.onerror=function(a){t&&t.call(r,a)},this.rABF&&i.readAsArrayBuffer(n.file)},processDataToGeoJson(n,e,t,r,i){let a=null;if(n==="EXCEL"||n==="CSV")a=this.processExcelDataToGeoJson(e),t&&t.call(i,a);else if(n==="JSON"||n==="GEOJSON"){let o=e;typeof o=="string"&&(o=JSON.parse(o)),o.type==="ISERVER"?a=o.data.recordsets[0].features:o.type==="FeatureCollection"?a=o:r&&r.call(i,rv.i18n("msg_dataInWrongGeoJSONFormat")),t&&t.call(i,a)}else r&&r.call(i,rv.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson(n){let e=this.string2Csv(n),t=e.colTitles,r=-1,i=-1;for(let o=0,s=t.length;o<s;o++)this.isXField(t[o])&&(r=o),this.isYField(t[o])&&(i=o);let a=[];for(let o=0,s=e.rows.length;o<s;o++){let l=e.rows[o],u=Number(l[r]),h=Number(l[i]),c={};for(let d in e.colTitles){let v=e.colTitles[d];c[v]=e.rows[o][d]}let f={type:"Feature",geometry:{type:"Point",coordinates:[u,h]},properties:c};a.push(f)}return a},isXField(n){var e=n.toLowerCase();return e==="x"||e==="smx"||e==="jd"||e==="\u7ECF\u5EA6"||e==="\u4E1C\u7ECF"||e==="longitude"||e==="lot"||e==="lon"||e==="lng"||e==="x\u5750\u6807"},isYField(n){var e=n.toLowerCase();return e==="y"||e==="smy"||e==="wd"||e==="\u7EAC\u5EA6"||e==="\u5317\u7EAC"||e==="latitude"||e==="lat"||e==="y\u5750\u6807"},string2Csv(n,e){let t=n.split(`
`),r={};e?r.colTitles=[]:r.colTitles=t[0].split(","),r.rows=[];for(let i=e?0:1;i<t.length;i++)t[i]&&r.rows.push(t[i].split(","));return r}};class T4t{constructor(e){this.datasets=e,this.EVENT_TYPES=["getdatafailed"],this.events=new y0(this,null,this.EVENT_TYPES)}getDatasetInfo(e){let t=this.datasets.url,r=this;li.get(t).then(function(i){return i.json()}).then(function(i){if(i.datasetInfo){let a=i.datasetInfo;r.datasetsInfo={dataSourceName:a.dataSourceName,datasetName:a.name,mapName:i.name},e({result:r.datasetsInfo})}}).catch(function(i){console.log(i),r._fireFailedEvent(i)})}getDataFeatures(e,t){let r=e.result,i,a,o,s={name:r.datasetName+"@"+r.dataSourceName};Object.assign(s,this.datasets.queryInfo),i=new Of(s),a=new VR({queryParameter:i,datasetNames:[r.dataSourceName+":"+r.datasetName],fromIndex:0,toIndex:1e5}),o=new H8(r.dataUrl),o.processAsync(a,t)}getLayerFeatures(e,t){let r=e.result,i,a,o,s={name:r.mapName};Object.assign(s,this.datasets.queryInfo),i=new Of(s),a=new ZR({queryParams:[i],expectCount:1e5}),o=new j8(r.dataUrl),o.processAsync(a,t)}getDataInfoByIptl(e){this.getServiceInfo(this.datasets.url,e)}getServiceInfo(e,t){let r=this;li.get(e,null,{withCredentials:this.datasets.withCredentials}).then(i=>i.json()).then(i=>{if(i.succeed===!1){r._fireFailedEvent(i);return}if(i.dataItemServices&&i.dataItemServices.length>0){let a=i.dataItemServices,o;a.forEach(s=>{if(s.serviceType==="RESTDATA"&&s.serviceStatus==="PUBLISHED")o=s;else if(s.serviceType==="RESTMAP"&&s.serviceStatus==="PUBLISHED")o=s;else{r.getDatafromContent(e,t);return}}),o&&r.getDatafromRest(o.serviceType,o.address,t)}else{r.getDatafromContent(e,t);return}}).catch(i=>{console.log(i),r._fireFailedEvent(i)})}getDatafromContent(e,t){let r={result:{}},i=this;e+="/content.json?pageSize=9999999&currentPage=1",li.get(e,null,{withCredentials:this.datasets.withCredentials}).then(a=>a.json()).then(a=>{if(a.succeed===!1){i._fireFailedEvent(a);return}if(a.type){if(a.type==="JSON"||a.type==="GEOJSON"){if(a.content=JSON.parse(a.content.trim()),!a.content.features){console.log(rv.i18n("msg_jsonResolveFiled"));return}let o=this._formatGeoJSON(a.content);r.result.features={type:a.content.type,features:o}}else if(a.type==="EXCEL"||a.type==="CSV"){let o=this._excelData2Feature(a.content);r.result.features={type:"FeatureCollection",features:o}}t(r,"content")}},this).catch(a=>{console.log(a),i._fireFailedEvent(a)})}getDatafromRest(e,t,r){let i=this,a=this.datasets.withCredentials;if(e==="RESTDATA"){let o=`${t}/data/datasources`,s,l;li.get(o,null,{withCredentials:a}).then(u=>u.json()).then(u=>{s=u.datasourceNames[0],o=`${t}/data/datasources/${s}/datasets`,li.get(o,null,{withCredentials:a}).then(h=>h.json()).then(h=>(l=h.datasetNames[0],i.getDatafromRestData(`${t}/data`,[s+":"+l],r),[s+":"+l])).catch(function(h){i._fireFailedEvent(h)})}).catch(function(u){i._fireFailedEvent(u)})}else{let o=`${t}/maps`,s,l,u;li.get(o,null,{withCredentials:a}).then(h=>h.json()).then(h=>{s=h[0].name,u=h[0].path,o=o=`${t}/maps/${s}/layers`,li.get(o,null,{withCredentials:a}).then(c=>c.json()).then(c=>(l=c[0].subLayers.layers[0].caption,i.getDatafromRestMap(l,u,r),l)).catch(function(c){i._fireFailedEvent(c)})}).catch(function(h){i._fireFailedEvent(h)})}}getDatafromRestData(e,t,r){let i=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,a=>{r(a,"RESTDATA")},a=>{console.log(a),i._fireFailedEvent(a)})}getDatafromRestMap(e,t,r){let i=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,a=>{r(a,"RESTMAP")},a=>{console.log(a),i._fireFailedEvent(a)})}_getFeatureBySQL(e,t,r,i,a){let o,s,l,u={name:t.join().replace(":","@")};Object.assign(u,r),o=new Of(u),l=new VR({queryParameter:o,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),s=new H8(e),s.processAsync(l,function(h){h.type==="processCompleted"?i&&i(h):a&&a(h)})}_queryFeatureBySQL(e,t,r,i,a,o,s,l,u,h){var c,f,d={name:t};Object.assign(d,r),c=new Of(d),i&&(c.fields=i);var v={queryParams:[c]};h&&(v.queryOption=dz.ATTRIBUTE),l&&(v.startRecord=l),u&&(v.expectCount=u),a&&(v.prjCoordSys={epsgCode:a}),f=new ZR(v),this._queryBySQL(e,f,p=>{p.type==="processCompleted"?o(p):s(p)})}_queryBySQL(e,t,r,i){var a=this,o=new j8(e,{format:a._processFormat(i)});o.processAsync(t,r)}_processFormat(e){return e||Ni.GEOJSON}_formatGeoJSON(e){let t=e.features;return t.forEach((r,i)=>{r.properties.index=i}),t}_excelData2Feature(e){let t=e.colTitles,r=-1,i=-1;for(let o=0,s=t.length;o<s;o++)AQ.isXField(t[o])&&(r=o),AQ.isYField(t[o])&&(i=o);let a=[];for(let o=0,s=e.rows.length;o<s;o++){let l=e.rows[o],u=Number(l[r]),h=Number(l[i]),c={};for(let d in e.colTitles){let v=e.colTitles[d];c[v]=e.rows[o][d]}c.index=o+"";let f={type:"Feature",geometry:{type:"Point",coordinates:[u,h]},properties:c};a.push(f)}return a}_fireFailedEvent(e){let t=e?{error:e,message:rv.i18n("msg_getdatafailed")}:{message:rv.i18n("msg_getdatafailed")};this.events.triggerEvent("getdatafailed",t)}}class NGe{constructor(e){this.datasets=e.datasets,this.xField=[],this.yField=[],this.grid={top:"50px",bottom:"50px",left:"50px",right:"60px"},this.chartType=e.type||"bar",this._initXYField(e.chartOptions),this.EVENT_TYPES=["getdatafailed"],this.events=new y0(this,null,this.EVENT_TYPES)}_initXYField(e){let t=this;e&&e.length>0&&e.forEach(function(r){r.xAxis&&t.xField.push({field:r.xAxis.field,name:r.xAxis.name}),r.yAxis&&t.yField.push({field:r.yAxis.field,name:r.yAxis.name})})}getDatasetInfo(e){this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new T4t(this.datasets),this.datasets.type==="iServer"?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):this.datasets.type==="iPortal"&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:t=>{this.events.triggerEvent("getdatafailed",t)}}))}_getDatasetInfoSuccess(e){let t=this.datasets.url,r=t.indexOf("rest");if(r>0){let i=t.indexOf("/",r+5),a=t.substring(r+5,i),o=t.substring(0,r+4)+"/data";if(a==="maps"){let s=t.indexOf("/",i+1),l=t.substring(i+1,s);o=t.substring(0,r+4)+"/maps/"+l,e.result.dataUrl=o,this._getLayerFeatures(e)}else a==="data"&&(e.result.dataUrl=o,this._getDataFeatures(e))}}_getDataInfoSuccess(e,t){let r=this;t==="RESTMAP"?r._getChartDatasFromLayer(e):r._getChartDatas(e)}_getDataFeatures(e){this.chartModel.getDataFeatures(e,this._getChartDatas.bind(this))}_getLayerFeatures(e){this.chartModel.getLayerFeatures(e,this._getChartDatasFromLayer.bind(this))}_getChartDatas(e){if(e){this.features=e.result.features;let t=this.features.features,r={};if(t.length){let i=t[0],a=[],o=[];for(let s in i.properties)a.push(s),o.push(this._getDataType(i.properties[s]));r={features:t,fieldCaptions:a,fieldTypes:o,fieldValues:[]};for(let s in o){let l=[];for(let u in t){let h=t[u],c=r.fieldCaptions[s],f=h.properties[c];l.push(f)}r.fieldValues.push(l)}this.createChart(r)}}}_getChartDatasFromLayer(e){if(e.result.recordsets){let t=e.result.recordsets[0],r=t.features.features;this.features=t.features;let i={};if(r.length){i={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]};for(let a in i.fieldCaptions){let o=[];for(let s in r){let l=r[s],u=i.fieldCaptions[a],h=l.properties[u];o.push(h)}i.fieldValues.push(o)}this.createChart(i)}}}_createChartOptions(e){return this.calculatedData=this._createChartDatas(e),this.updateChartOptions(this.chartType)}changeType(e){if(e!==this.chartType)return this.chartType=e,this.updateChartOptions(this.chartType)}updateData(e,t,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(t),e.type=e.type||"iServer",e.withCredentials=e.withCredentials||!1,this.datasets=e,this.getDatasetInfo(this._updateDataSuccess.bind(this))}_updateDataSuccess(e){let t=this._createChartOptions(e);this.updateChart(t)}updateChartOptions(e,t){if(this.calculatedData){let r=this.grid,i=this._createChartSeries(this.calculatedData,e),a=[];for(let h in this.calculatedData.XData)a.push({value:this.calculatedData.XData[h].fieldsData});let o={type:"category",name:this.xField[0].name||"X",data:a,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},l={formatter:"{b0}: {c0}"},u="#404a59";return t&&(t.grid&&(r=t.grid),t.tooltip&&(l=t.tooltip),t.backgroundColor&&(u=t.backgroundColor)),{backgroundColor:u,grid:r,series:i,xAxis:o,yAxis:s,tooltip:l}}}_createChartDatas(e){let t=0,r=[],i=e.fieldCaptions,a=this;i.forEach(function(l,u){a.xField[0]&&l===a.xField[0].field&&(t=u)}),this.yFieldName="",this.yField.forEach(function(l,u){u!==0&&(a.yFieldName=a.yFieldName+","),a.yFieldName=a.yFieldName+l.name,i.forEach(function(h,c){h===l.field&&r.push(c)})});let o=this._getAttrData(e,t),s=[];if(r.length>0)r.forEach(function(l){let u=[];for(let h in e.fieldValues[l])u.push({value:e.fieldValues[l][h]});s.push(u)});else{let l=[],u=[],h=o.length;for(let c=0;c<h;c++){let f=!1;for(let d=0,v=u.length;d<v;d++)if(o[c].fieldsData===u[d].fieldsData){l[d].value++,u[d].recordIndexs.push(c),f=!0;break}f||o[c].fieldsData&&(u.push({fieldsData:o[c].fieldsData,recordIndexs:[c]}),l.push({value:1}))}o=u,s=[l]}return{XData:o,YData:s}}_getAttrData(e,t){t===0&&(this.xField=[{field:e.fieldCaptions[t],name:e.fieldCaptions[t]}]);let r=[];for(let i=0,a=e.fieldValues[t].length;i<a;i++){let o=e.fieldValues[t][i];r.push({recordIndexs:i,fieldsData:o})}return r}_createChartSeries(e,t){let r=[];return e.YData.forEach(function(a){let o=0,s=[];for(let u of a)o=u.value,s.push({value:o});let l={type:t,data:s,name:"y"};r.push(l)}),r}_isDate(e){return/((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/ig.test(e)}_isNumber(e){let t=Number(e);return t===0?!0:!isNaN(t)}_getDataType(e){if(e!=null&&e!==""){if(this._isDate(e))return"DATE";if(this._isNumber(e))return"NUMBER"}return"STRING"}_checkUrl(e){let t;return e===""||!this._isMatchUrl(e)||/^http[s]?:\/\/localhost/.test(e)||/^http[s]?:\/\/127.0.0.1/.test(e)?t=!1:t=!0,t}_isMatchUrl(e){var t=new RegExp("(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]");return t.test(e)}getStyle(){return{grid:this.grid,tooltip:this.tooltip,backgroundColor:this.backgroundColor}}getFeatures(){return this.features}setStyle(e){return this.updateChartOptions(this.chartType,e)}}class C4t{constructor(e,t){this.domID=e,this.chartType=t.type||"bar",t.datasets.type=t.datasets.type||"iServer",t.datasets.withCredentials=t.datasets.withCredentials||!1,this.viewModel=new NGe(t),this._fillDataToView()}onAdd(e){this.addChart=e}_fillDataToView(){let e=new UNe;this.viewModel.getDatasetInfo(this._createChart.bind(this)),this.viewModel.events.on({getdatafailed:t=>{e.showView(t.message)}})}getStyle(){return this.viewModel.getStyle()}getFeatures(){return this.viewModel.getFeatures()}setStyle(e){let t=this.viewModel.setStyle(e);this._updateChart(t)}changeType(e){if(this.chartType!==e){this.chartType=e;let t=this.viewModel.changeType(e);this._updateChart(t)}}updateData(e,t){let r=this;this.viewModel.updateData(e,t,function(i){r._updateChart(i),r.addChart&&r.addChart()})}_createChart(e){this.echart=spt(document.getElementById(this.domID),null,{renderer:"canvas"});let t=this.viewModel._createChartOptions(e);this.echart.setOption(t),this.addChart&&this.addChart()}_updateChart(e){this.echart&&(this.echart.clear(),this.echart.setOption(e))}}class bw{constructor(e){e=e||{},this.id=e.id?e.id:null,this.rootContainer=null}getElement(){return this.id&&(this.rootContainer.id=this.id),this.rootContainer}_initView(){}showView(){this.rootContainer.hidden=!1}closeView(){this.rootContainer.hidden=!0}}class A4t extends bw{constructor(e){super(e);let t=e.title?e.title:"";this._initView(t)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-container");const r=document.createElement("div");r.setAttribute("class","component-title");const i=document.createElement("div");i.innerHTML=e,r.appendChild(i),t.appendChild(r);const a=document.createElement("div");return a.setAttribute("class","component-content"),t.appendChild(a),this.content=a,this.rootContainer=t,t}getContentElement(){return this.content}appendContent(e){this.content.appendChild(e)}}class M4t extends bw{constructor(e){super(e),this._initView(e)}_initView(e){let t=this._createElement("div","component-selecttool");if(e.labelName){let h=this._createElement("label","component-selecttool__lable--describe",t);h.innerHTML=e.labelName}let r=this._createElement("div","component-selecttool--chart",t);r.setAttribute("tabindex","1");let i=this._createElement("div","component-selecttool__name",r);i.title=e.optionsArr[0],i.innerHTML=e.optionsArr[0];let a=this._createElement("div","component-selecttool__trianglebtn--chart",r),o=this._createElement("div","component-triangle-down-img",a),s=this._createElement("div","component-selecttool__content",r),l=this._createElement("div","component-selecttool__content--chart",s),u=this._createElement("div","component-selecttool__scrollarea__content",l);u.setAttribute("tabindex","1"),this.createOptions(u,e.optionsArr),this.optionClickEvent(u,i,e.optionsClickCb),this._selectClickEvent(r,s,o),this.rootContainer=t}createOptions(e,t){for(let r in t){let i=this._createElement("div","component-selecttool__option",e);i.title=t[r],i.innerHTML=t[r]}}_selectClickEvent(e,t,r){e.onclick=function(i){t.style.display==="block"?(t.style.display="none",r.className="component-triangle-down-img"):(t.style.display="block",r.className="triangle-up-img"),i.preventDefault(),i.stopPropagation()},e.onmousedown=function(i){i.target!==this&&(this.focus(),i.preventDefault(),i.stopPropagation())},e.onblur=function(){t.style.display="none",r.className="component-triangle-down-img"}}_createElement(e,t,r){let i=document.createElement(e||"div");return t&&(i.className=t),r&&r.appendChild(i),i}optionClickEvent(e,t,r){for(let i=0;i<e.children.length;i++){let a=e.children[i];a.onclick=function(){t.innerHTML=a.innerHTML,t.title=a.title,a.getAttribute("data-value")&&t.setAttribute("data-value",a.getAttribute("data-value")),r&&r(a)}}}}class I4t extends bw{constructor(e){super(e),this._initView(e)}_initView(e){let t=document.createElement("div");t.className="component-dropdownbox--container";let r=document.createElement("div");r.setAttribute("tabindex","1"),r.className="component-dropdownbox",t.appendChild(r);let i=document.createElement("div");r.appendChild(i),this._createDropDownOption(e[0],i);let a=document.createElement("div");a.className="component-dropdownbox__triangle-btn",r.appendChild(a);let o=document.createElement("div");o.className="component-triangle-down-img",a.appendChild(o);let s={parentEle:r,dropDownContent:["component-dropdownbox__content component-dropdownbox__content--chart","dropDownContent"],scrollareaContent:"component-selecttool__scrollarea__content",optionsArr:e,triangleBtn:o,dropDownTopContainer:i};this._createDropDownBox(s),this.rootContainer=t}_createDropDownBox(e){let t=e.parentEle,r=e.dropDownTopContainer,i=document.createElement("div");i.className=e.dropDownContent[0],t.appendChild(i);let a=document.createElement("div");a.className=e.scrollareaContent,i.appendChild(a);let o=e.optionsArr;for(let u=0;u<o.length;u++)this._createDropDownOption(o[u],a);let s=e.triangleBtn;this._dropDownClickEvent(t,i,s),this._eleOnblur(t,i,s);let l=a.children;for(let u=0;u<l.length;u++)l[u].onclick=function(){r.innerHTML=l[u].outerHTML}}_createDropDownOption(e,t){let r=document.createElement("div");r.className="component-dropdownbox__item";let i=e;i.dataValue&&r.setAttribute("data-value",i.dataValue),t.appendChild(r);let a=document.createElement("div");a.className="component-dropdownbox__item__img",r.appendChild(a);let o=document.createElement("div");i.icon.className&&(o.className=i.icon.className),i.icon.background&&(o.style.background=i.icon.background),a.appendChild(o);let s=document.createElement("div");s.className="component-dropdownbox__item__title",s.title=i.title,s.innerHTML=i.title,r.appendChild(s);let l=document.createElement("div");l.className="component-dropdownbox__item__remark",l.title=i.remark,l.innerHTML=i.remark,r.appendChild(l)}_dropDownClickEvent(e,t,r){e.onclick=function(i){t.style.display==="block"?(t.style.display="none",r.className="component-triangle-down-img"):(t.style.display="block",r.className="triangle-up-img"),i.preventDefault(),i.stopPropagation()},e.onmousedown=function(i){i.target!==this&&(this.focus(),i.preventDefault(),i.stopPropagation())}}_eleOnblur(e,t,r){e.onblur=function(){t.style.display="none",r.className="component-triangle-down-img"}}_createElement(e,t,r){let i=document.createElement(e||"div");return t&&(i.className=t),r&&r.appendChild(i),i}}class kGe extends bw{constructor(e){e=e||{},super(e),e.title=e.title?e.title:"",this._initView(e.title)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-popcontainer");const r=document.createElement("div");r.setAttribute("class","component-popcontainer__header");const i=document.createElement("label");i.setAttribute("class","component-popcontainer__header__title"),i.innerHTML=e,r.appendChild(i);const a=document.createElement("span");a.setAttribute("class","supermapol-icons-clear component-popcontainer__header__close"),a.onclick=this.closeView.bind(this),t.appendChild(a),t.appendChild(r);const o=document.createElement("div");o.setAttribute("class","component-popcontainer__content"),this.content=o,t.appendChild(o),this.rootContainer=t}appendContent(e){this.content.appendChild(e)}}class L4t extends kGe{constructor(e){e.title=e.title?e.title:"\u5C5E\u6027",super(e),this.rootContainer.firstChild.hidden=!0,e.attributes=e.attributes?e.attributes:[],this._createAttributesTable(e.attributes)}_createAttributesTable(e){const t=document.createElement("table");t.setAttribute("class","component-popcontainer__content__table");const r=document.createElement("tbody");let i=!0;for(let a in e){const o=document.createElement("tr");i&&o.setAttribute("class","component-popcontainer__content__td--color");const s=document.createElement("td"),l=document.createElement("Span");l.innerHTML=a,s.appendChild(l);const u=document.createElement("td");u.innerHTML=e[a],o.appendChild(s),o.appendChild(u),r.appendChild(o),i=!i}t.appendChild(r),this.appendContent(t)}}class FGe extends bw{constructor(e){super(e),this._initView()}_initView(){const e=document.createElement("div");e.setAttribute("class","component-tabpage");const t=document.createElement("ul");this.header=t;const r=document.createElement("div");r.setAttribute("class","component-tabpage__content"),this.content=r,e.appendChild(t),e.appendChild(r),this.rootContainer=e}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t<e.length;t++){let r=document.createElement("span");r.index=t,r.appendChild(document.createTextNode(e[t].title)),r.onclick=this._changeTabsPage.bind(this);let i=e[t].content;i.index=t,i.hidden=!0,this.header.appendChild(r),this.content.appendChild(i)}this.header.firstChild.setAttribute("class","on"),this.content.firstChild.hidden=!1}removeTab(e){this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}removeAllTabs(){for(let e=this.header.children.length;e>0;e--)this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}_changeTabsPage(e){const t=e.target.index;for(let r=0;r<this.header.children.length;r++)this.header.children[r].setAttribute("class",""),this.content.children[r].hidden=!0,r===t&&(this.header.children[r].setAttribute("class","on"),this.content.children[r].hidden=!1)}}class P4t extends FGe{constructor(e){super(e),this.rootContainer.classList.add("component-citytabpage--noneBoxShadow"),this.config=e.config,H.isArray(this.config)?(this.header.hidden=!0,this._createCityItem("\u57CE\u5E02",this.config),this.content.style.border="none"):(this._createTabs(),this.header.onclick=t=>{for(let r=0;r<this.header.children.length;r++)this.header.children[r].setAttribute("class","");t.target.setAttribute("class","on"),this._createCityContent(t.target.innerHTML)})}_createTabs(){if(H.isArray(this.config))for(let e=0;e<this.config.length;e++){let t="";for(const i in this.config[e])t+=i;let r=document.createElement("li");r.innerHTML=t,this.header.appendChild(r)}else for(const e in this.config){let t=document.createElement("li");t.innerHTML=e,this.header.appendChild(t)}this.header.firstChild.setAttribute("class","on"),this._createCityContent(this.header.firstChild.innerHTML)}_createCityContent(e){for(let r=this.content.children.length;r>0;r--)this.content.removeChild(this.content.children[r-1]);const t=this.config[e];for(let r in t)this._createCityItem(r,t[r])}_createCityItem(e,t){const r=document.createElement("div"),i=document.createElement("div");i.setAttribute("class","component-citytabpag__py-key"),i.innerHTML=e,r.appendChild(i);const a=document.createElement("div");a.setAttribute("class","component-citytabpag__content");for(let o=0;o<t.length;o++){let s=document.createElement("span");s.innerHTML=t[o],a.appendChild(s)}e==="HOT"&&(a.style.width="428px"),r.appendChild(a),this.content.appendChild(r)}}class O4t extends bw{constructor(e){super(e),this.navTabsTitle=null,this.navTabsContent=null,e.tabs=e.tabs?e.tabs:[],this._initView(e.tabs)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-navtabspage");const r=document.createElement("span");r.setAttribute("class","supermapol-icons-close"),r.onclick=this.closeView.bind(this),t.appendChild(r);const i=document.createElement("div");this.navTabsTitle=i,i.setAttribute("class","component-navtabspage__title"),t.appendChild(i);const a=document.createElement("div");this.navTabsContent=a,a.setAttribute("class","component-navtabspage__content"),t.appendChild(a),e.length>0&&this.appendTabs(e),this.rootContainer=t}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t<e.length;t++){let r=document.createElement("span");r.index=t,r.appendChild(document.createTextNode(e[t].title)),r.onclick=this._changeTabsPage.bind(this);let i=e[t].content;i.index=t,i.hidden=!0,this.navTabsTitle.appendChild(r),this.navTabsContent.appendChild(i)}this.navTabsTitle.firstChild.setAttribute("class","component-navtabspage__tabs--select"),this.navTabsContent.firstChild.hidden=!1}removeTab(e){this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}removeAllTabs(){for(let e=this.navTabsTitle.children.length;e>0;e--)this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}_changeTabsPage(e){const t=e.target.index;for(let r=0;r<this.navTabsTitle.children.length;r++)this.navTabsTitle.children[r].setAttribute("class",""),this.navTabsContent.children[r].hidden=!0,r===t&&(this.navTabsTitle.children[r].setAttribute("class","component-navtabspage__tabs--select"),this.navTabsContent.children[r].hidden=!1)}}class R4t extends bw{constructor(e){e=e||{},super(e),this.currentPage=0,this.pageNumberLis=[],this.currentPageNumberLis=[],this.linkageEvent=null,e.contents=e.contents?e.contents:null,e.pageCounts=e.pageCounts?e.pageCounts:0,this._initView(e.contents,e.pageCounts)}setLinkageEvent(e){this.linkageEvent=e}_initView(e,t){const r=document.createElement("div");r.setAttribute("class","component-pagination");const i=document.createElement("div");i.setAttribute("class","component-pagination__content"),r.appendChild(i),this.content=i;const a=document.createElement("ul");a.setAttribute("class","component-pagination__link"),a.onclick=this._changePageEvent.bind(this),r.appendChild(a),this._createLink(a),this.link=a,e&&this.setContent(e),t!==0&&this.setPageLink(t),this.rootContainer=r}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){this.content.appendChild(e)}clearContent(){for(let e=this.content.children.length-1;e>=0;e--)this.content.removeChild(this.content.children[e])}setPageLink(e){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(e),this._appendPageLink()}_createPageLi(e){for(let t=0;t<e;t++){const r=document.createElement("li");r.innerHTML=t+1,this.pageNumberLis.push(r)}if(this.pageNumberLis[0].setAttribute("class","active"),this.currentPage=1,e<5)this.currentPageNumberLis=this.pageNumberLis;else for(let t=0;t<5;t++)this.currentPageNumberLis.push(this.pageNumberLis[t])}_appendPageLink(){for(let e=0;e<this.currentPageNumberLis.length;e++)this.link.insertBefore(this.currentPageNumberLis[e],this.link.childNodes[this.link.children.length-2]);for(let e=0;e<this.currentPageNumberLis.length;e++)this.currentPageNumberLis[e].setAttribute("class",""),Number(this.currentPageNumberLis[e].innerHTML)===this.currentPage&&this.currentPageNumberLis[e].setAttribute("class","active");this._changeDisableState(),this.linkageEvent&&this.linkageEvent(this.currentPage)}clearPageLink(){for(let e=this.link.children.length-3;e>1;e--)this.link.removeChild(this.link.children[e])}_createLink(e){for(let t=0;t<4;t++){const r=document.createElement("li");r.setAttribute("class","disable");const i=document.createElement("span");r.appendChild(i),t===0?(i.id="first",i.setAttribute("class","supermapol-icons-first")):t===1?(i.id="prev",i.setAttribute("class","supermapol-icons-prev")):t===2?(i.id="next",i.setAttribute("class","supermapol-icons-next")):t===3&&(i.id="last",i.setAttribute("class","supermapol-icons-last")),e.appendChild(r)}}_changePageEvent(e){const t=e.target;if(t.parentElement.classList[0]==="disable")return;let r;if(t.id)r=t.id;else if(Number(t.innerHTML))r=Number(t.innerHTML);else return;this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}_changeDisableState(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),this.currentPage===1&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}_prePageNum(e){const t=[];if(e==="first"?this.currentPage=1:e==="last"?this.currentPage=this.pageNumberLis.length:e==="prev"?this.currentPage=this.currentPage-1:e==="next"?this.currentPage=this.currentPage+1:this.currentPage=e,this.pageNumberLis.length<=5)for(let r=0;r<this.pageNumberLis.length;r++)t.push(this.pageNumberLis[r]);else if(this.currentPage<=3)for(let r=0;r<5;r++)t.push(this.pageNumberLis[r]);else if(this.currentPage>=this.pageNumberLis.length-3)for(let r=this.pageNumberLis.length-5;r<this.pageNumberLis.length;r++)t.push(this.pageNumberLis[r]);else for(let r=this.currentPage-3;r<=this.currentPage+1;r++)t.push(this.pageNumberLis[r]);t.length>0&&(this.currentPageNumberLis=t)}}var MQ={exports:{}};(function(n,e){var t=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,o=2,s=1/0,l=9007199254740991,u="[object Arguments]",h="[object Array]",c="[object Boolean]",f="[object Date]",d="[object Error]",v="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Object]",_="[object Promise]",x="[object RegExp]",S="[object Set]",w="[object String]",b="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",C="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",I="[object Int8Array]",R="[object Int16Array]",k="[object Int32Array]",D="[object Uint8Array]",G="[object Uint8ClampedArray]",W="[object Uint16Array]",z="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,Y=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,ie=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,se={};se[A]=se[M]=se[I]=se[R]=se[k]=se[D]=se[G]=se[W]=se[z]=!0,se[u]=se[h]=se[T]=se[c]=se[C]=se[f]=se[d]=se[v]=se[g]=se[m]=se[y]=se[x]=se[S]=se[w]=se[E]=!1;var me=typeof at=="object"&&at&&at.Object===Object&&at,Ce=typeof self=="object"&&self&&self.Object===Object&&self,Le=me||Ce||Function("return this")(),re=e&&!e.nodeType&&e,yt=re&&!0&&n&&!n.nodeType&&n,je=yt&&yt.exports===re,st=je&&me.process,Nt=function(){try{return st&&st.binding("util")}catch{}}(),Zt=Nt&&Nt.isTypedArray;function qe(ee,Se){var Ze=ee?ee.length:0;return!!Ze&&Oe(ee,Se,0)>-1}function ur(ee,Se,Ze){for(var Ct=-1,vr=ee?ee.length:0;++Ct<vr;)if(Ze(Se,ee[Ct]))return!0;return!1}function Dt(ee,Se){for(var Ze=-1,Ct=ee?ee.length:0;++Ze<Ct;)if(Se(ee[Ze],Ze,ee))return!0;return!1}function ft(ee,Se,Ze,Ct){for(var vr=ee.length,Cr=Ze+(Ct?1:-1);Ct?Cr--:++Cr<vr;)if(Se(ee[Cr],Cr,ee))return Cr;return-1}function Oe(ee,Se,Ze){if(Se!==Se)return ft(ee,J,Ze);for(var Ct=Ze-1,vr=ee.length;++Ct<vr;)if(ee[Ct]===Se)return Ct;return-1}function J(ee){return ee!==ee}function We(ee){return function(Se){return Se==null?void 0:Se[ee]}}function Tt(ee,Se){for(var Ze=-1,Ct=Array(ee);++Ze<ee;)Ct[Ze]=Se(Ze);return Ct}function Qe(ee){return function(Se){return ee(Se)}}function zt(ee,Se){return ee.has(Se)}function mt(ee,Se){return ee==null?void 0:ee[Se]}function wt(ee){var Se=!1;if(ee!=null&&typeof ee.toString!="function")try{Se=!!(ee+"")}catch{}return Se}function pt(ee){var Se=-1,Ze=Array(ee.size);return ee.forEach(function(Ct,vr){Ze[++Se]=[vr,Ct]}),Ze}function ar(ee,Se){return function(Ze){return ee(Se(Ze))}}function kt(ee){var Se=-1,Ze=Array(ee.size);return ee.forEach(function(Ct){Ze[++Se]=Ct}),Ze}var Dr=Array.prototype,Sr=Function.prototype,jr=Object.prototype,pn=Le["__core-js_shared__"],Jn=function(){var ee=/[^.]+$/.exec(pn&&pn.keys&&pn.keys.IE_PROTO||"");return ee?"Symbol(src)_1."+ee:""}(),Rn=Sr.toString,hi=jr.hasOwnProperty,yn=jr.toString,Oi=RegExp("^"+Rn.call(hi).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oi=Le.Symbol,Gi=Le.Uint8Array,ws=jr.propertyIsEnumerable,Sl=Dr.splice,Os=ar(Object.keys,Object),no=uf(Le,"DataView"),vo=uf(Le,"Map"),No=uf(Le,"Promise"),Jo=uf(Le,"Set"),Lo=uf(Le,"WeakMap"),hs=uf(Object,"create"),Rs=B(no),Pn=B(vo),mo=B(No),ue=B(Jo),xe=B(Lo),ce=oi?oi.prototype:void 0,pe=ce?ce.valueOf:void 0,we=ce?ce.toString:void 0;function Me(ee){var Se=-1,Ze=ee?ee.length:0;for(this.clear();++Se<Ze;){var Ct=ee[Se];this.set(Ct[0],Ct[1])}}function nt(){this.__data__=hs?hs(null):{}}function It(ee){return this.has(ee)&&delete this.__data__[ee]}function ot(ee){var Se=this.__data__;if(hs){var Ze=Se[ee];return Ze===i?void 0:Ze}return hi.call(Se,ee)?Se[ee]:void 0}function ht(ee){var Se=this.__data__;return hs?Se[ee]!==void 0:hi.call(Se,ee)}function ut(ee,Se){var Ze=this.__data__;return Ze[ee]=hs&&Se===void 0?i:Se,this}Me.prototype.clear=nt,Me.prototype.delete=It,Me.prototype.get=ot,Me.prototype.has=ht,Me.prototype.set=ut;function qt(ee){var Se=-1,Ze=ee?ee.length:0;for(this.clear();++Se<Ze;){var Ct=ee[Se];this.set(Ct[0],Ct[1])}}function fr(){this.__data__=[]}function Wr(ee){var Se=this.__data__,Ze=qf(Se,ee);if(Ze<0)return!1;var Ct=Se.length-1;return Ze==Ct?Se.pop():Sl.call(Se,Ze,1),!0}function gr(ee){var Se=this.__data__,Ze=qf(Se,ee);return Ze<0?void 0:Se[Ze][1]}function Ar(ee){return qf(this.__data__,ee)>-1}function $n(ee,Se){var Ze=this.__data__,Ct=qf(Ze,ee);return Ct<0?Ze.push([ee,Se]):Ze[Ct][1]=Se,this}qt.prototype.clear=fr,qt.prototype.delete=Wr,qt.prototype.get=gr,qt.prototype.has=Ar,qt.prototype.set=$n;function bi(ee){var Se=-1,Ze=ee?ee.length:0;for(this.clear();++Se<Ze;){var Ct=ee[Se];this.set(Ct[0],Ct[1])}}function qa(){this.__data__={hash:new Me,map:new(vo||qt),string:new Me}}function Qo(ee){return bc(this,ee).delete(ee)}function Ds(ee){return bc(this,ee).get(ee)}function af(ee){return bc(this,ee).has(ee)}function mh(ee,Se){return bc(this,ee).set(ee,Se),this}bi.prototype.clear=qa,bi.prototype.delete=Qo,bi.prototype.get=Ds,bi.prototype.has=af,bi.prototype.set=mh;function Zl(ee){var Se=-1,Ze=ee?ee.length:0;for(this.__data__=new bi;++Se<Ze;)this.add(ee[Se])}function jd(ee){return this.__data__.set(ee,i),this}function Nl(ee){return this.__data__.has(ee)}Zl.prototype.add=Zl.prototype.push=jd,Zl.prototype.has=Nl;function ec(ee){this.__data__=new qt(ee)}function js(){this.__data__=new qt}function fg(ee){return this.__data__.delete(ee)}function dg(ee){return this.__data__.get(ee)}function Xd(ee){return this.__data__.has(ee)}function Yd(ee,Se){var Ze=this.__data__;if(Ze instanceof qt){var Ct=Ze.__data__;if(!vo||Ct.length<t-1)return Ct.push([ee,Se]),this;Ze=this.__data__=new bi(Ct)}return Ze.set(ee,Se),this}ec.prototype.clear=js,ec.prototype.delete=fg,ec.prototype.get=dg,ec.prototype.has=Xd,ec.prototype.set=Yd;function vg(ee,Se){var Ze=X(ee)||U(ee)?Tt(ee.length,String):[],Ct=Ze.length,vr=!!Ct;for(var Cr in ee)(Se||hi.call(ee,Cr))&&!(vr&&(Cr=="length"||Uv(Cr,Ct)))&&Ze.push(Cr);return Ze}function qf(ee,Se){for(var Ze=ee.length;Ze--;)if(N(ee[Ze][0],Se))return Ze;return-1}function Zf(ee,Se){Se=_h(Se,ee)?[Se]:q0(Se);for(var Ze=0,Ct=Se.length;ee!=null&&Ze<Ct;)ee=ee[gt(Se[Ze++])];return Ze&&Ze==Ct?ee:void 0}function pg(ee){return yn.call(ee)}function Kf(ee,Se){return ee!=null&&Se in Object(ee)}function of(ee,Se,Ze,Ct,vr){return ee===Se?!0:ee==null||Se==null||!Je(ee)&&!Xe(Se)?ee!==ee&&Se!==Se:X0(ee,Se,of,Ze,Ct,vr)}function X0(ee,Se,Ze,Ct,vr,Cr){var Jr=X(ee),nn=X(Se),Dn=h,si=h;Jr||(Dn=Ec(ee),Dn=Dn==u?y:Dn),nn||(si=Ec(Se),si=si==u?y:si);var An=Dn==y&&!wt(ee),qi=si==y&&!wt(Se),_o=Dn==si;if(_o&&!An)return Cr||(Cr=new ec),Jr||rt(ee)?Xs(ee,Se,Ze,Ct,vr,Cr):Hm(ee,Se,Dn,Ze,Ct,vr,Cr);if(!(vr&o)){var cs=An&&hi.call(ee,"__wrapped__"),wl=qi&&hi.call(Se,"__wrapped__");if(cs||wl){var xu=cs?ee.value():ee,fa=wl?Se.value():Se;return Cr||(Cr=new ec),Ze(xu,fa,Ct,vr,Cr)}}return _o?(Cr||(Cr=new ec),zv(ee,Se,Ze,Ct,vr,Cr)):!1}function Y0(ee,Se,Ze,Ct){var vr=Ze.length,Cr=vr,Jr=!Ct;if(ee==null)return!Cr;for(ee=Object(ee);vr--;){var nn=Ze[vr];if(Jr&&nn[2]?nn[1]!==ee[nn[0]]:!(nn[0]in ee))return!1}for(;++vr<Cr;){nn=Ze[vr];var Dn=nn[0],si=ee[Dn],An=nn[1];if(Jr&&nn[2]){if(si===void 0&&!(Dn in ee))return!1}else{var qi=new ec;if(Ct)var _o=Ct(si,An,Dn,ee,Se,qi);if(!(_o===void 0?of(An,si,Ct,a|o,qi):_o))return!1}}return!0}function Kl(ee){if(!Je(ee)||hf(ee))return!1;var Se=Re(ee)||wt(ee)?Oi:ie;return Se.test(B(ee))}function sf(ee){return Xe(ee)&&Be(ee.length)&&!!se[yn.call(ee)]}function mu(ee){return typeof ee=="function"?ee:ee==null?Ue:typeof ee=="object"?X(ee)?gg(ee[0],ee[1]):lf(ee):$t(ee)}function bs(ee){if(!_u(ee))return Os(ee);var Se=[];for(var Ze in Object(ee))hi.call(ee,Ze)&&Ze!="constructor"&&Se.push(Ze);return Se}function lf(ee){var Se=yg(ee);return Se.length==1&&Se[0][2]?_g(Se[0][0],Se[0][1]):function(Ze){return Ze===ee||Y0(Ze,ee,Se)}}function gg(ee,Se){return _h(ee)&&$v(Se)?_g(gt(ee),Se):function(Ze){var Ct=Yt(Ze,ee);return Ct===void 0&&Ct===Se?ne(Ze,ee):of(Se,Ct,void 0,a|o)}}function Wm(ee){return function(Se){return Zf(Se,ee)}}function ho(ee){if(typeof ee=="string")return ee;if(_t(ee))return we?we.call(ee):"";var Se=ee+"";return Se=="0"&&1/ee==-s?"-0":Se}function Es(ee,Se,Ze){var Ct=-1,vr=qe,Cr=ee.length,Jr=!0,nn=[],Dn=nn;if(Ze)Jr=!1,vr=ur;else if(Cr>=t){var si=Se?null:tc(ee);if(si)return kt(si);Jr=!1,vr=zt,Dn=new Zl}else Dn=Se?[]:nn;e:for(;++Ct<Cr;){var An=ee[Ct],qi=Se?Se(An):An;if(An=Ze||An!==0?An:0,Jr&&qi===qi){for(var _o=Dn.length;_o--;)if(Dn[_o]===qi)continue e;Se&&Dn.push(qi),nn.push(An)}else vr(Dn,qi,Ze)||(Dn!==nn&&Dn.push(qi),nn.push(An))}return nn}function q0(ee){return X(ee)?ee:Te(ee)}var tc=Jo&&1/kt(new Jo([,-0]))[1]==s?function(ee){return new Jo(ee)}:Bt;function Xs(ee,Se,Ze,Ct,vr,Cr){var Jr=vr&o,nn=ee.length,Dn=Se.length;if(nn!=Dn&&!(Jr&&Dn>nn))return!1;var si=Cr.get(ee);if(si&&Cr.get(Se))return si==Se;var An=-1,qi=!0,_o=vr&a?new Zl:void 0;for(Cr.set(ee,Se),Cr.set(Se,ee);++An<nn;){var cs=ee[An],wl=Se[An];if(Ct)var xu=Jr?Ct(wl,cs,An,Se,ee,Cr):Ct(cs,wl,An,ee,Se,Cr);if(xu!==void 0){if(xu)continue;qi=!1;break}if(_o){if(!Dt(Se,function(fa,Ft){if(!_o.has(Ft)&&(cs===fa||Ze(cs,fa,Ct,vr,Cr)))return _o.add(Ft)})){qi=!1;break}}else if(!(cs===wl||Ze(cs,wl,Ct,vr,Cr))){qi=!1;break}}return Cr.delete(ee),Cr.delete(Se),qi}function Hm(ee,Se,Ze,Ct,vr,Cr,Jr){switch(Ze){case C:if(ee.byteLength!=Se.byteLength||ee.byteOffset!=Se.byteOffset)return!1;ee=ee.buffer,Se=Se.buffer;case T:return!(ee.byteLength!=Se.byteLength||!Ct(new Gi(ee),new Gi(Se)));case c:case f:case m:return N(+ee,+Se);case d:return ee.name==Se.name&&ee.message==Se.message;case x:case w:return ee==Se+"";case g:var nn=pt;case S:var Dn=Cr&o;if(nn||(nn=kt),ee.size!=Se.size&&!Dn)return!1;var si=Jr.get(ee);if(si)return si==Se;Cr|=a,Jr.set(ee,Se);var An=Xs(nn(ee),nn(Se),Ct,vr,Cr,Jr);return Jr.delete(ee),An;case b:if(pe)return pe.call(ee)==pe.call(Se)}return!1}function zv(ee,Se,Ze,Ct,vr,Cr){var Jr=vr&o,nn=ye(ee),Dn=nn.length,si=ye(Se),An=si.length;if(Dn!=An&&!Jr)return!1;for(var qi=Dn;qi--;){var _o=nn[qi];if(!(Jr?_o in Se:hi.call(Se,_o)))return!1}var cs=Cr.get(ee);if(cs&&Cr.get(Se))return cs==Se;var wl=!0;Cr.set(ee,Se),Cr.set(Se,ee);for(var xu=Jr;++qi<Dn;){_o=nn[qi];var fa=ee[_o],Ft=Se[_o];if(Ct)var nr=Jr?Ct(Ft,fa,_o,Se,ee,Cr):Ct(fa,Ft,_o,ee,Se,Cr);if(!(nr===void 0?fa===Ft||Ze(fa,Ft,Ct,vr,Cr):nr)){wl=!1;break}xu||(xu=_o=="constructor")}if(wl&&!xu){var Wn=ee.constructor,Zi=Se.constructor;Wn!=Zi&&"constructor"in ee&&"constructor"in Se&&!(typeof Wn=="function"&&Wn instanceof Wn&&typeof Zi=="function"&&Zi instanceof Zi)&&(wl=!1)}return Cr.delete(ee),Cr.delete(Se),wl}function bc(ee,Se){var Ze=ee.__data__;return Vv(Se)?Ze[typeof Se=="string"?"string":"hash"]:Ze.map}function yg(ee){for(var Se=ye(ee),Ze=Se.length;Ze--;){var Ct=Se[Ze],vr=ee[Ct];Se[Ze]=[Ct,vr,$v(vr)]}return Se}function uf(ee,Se){var Ze=mt(ee,Se);return Kl(Ze)?Ze:void 0}var Ec=pg;(no&&Ec(new no(new ArrayBuffer(1)))!=C||vo&&Ec(new vo)!=g||No&&Ec(No.resolve())!=_||Jo&&Ec(new Jo)!=S||Lo&&Ec(new Lo)!=E)&&(Ec=function(ee){var Se=yn.call(ee),Ze=Se==y?ee.constructor:void 0,Ct=Ze?B(Ze):void 0;if(Ct)switch(Ct){case Rs:return C;case Pn:return g;case mo:return _;case ue:return S;case xe:return E}return Se});function mg(ee,Se,Ze){Se=_h(Se,ee)?[Se]:q0(Se);for(var Ct,vr=-1,Jr=Se.length;++vr<Jr;){var Cr=gt(Se[vr]);if(!(Ct=ee!=null&&Ze(ee,Cr)))break;ee=ee[Cr]}if(Ct)return Ct;var Jr=ee?ee.length:0;return!!Jr&&Be(Jr)&&Uv(Cr,Jr)&&(X(ee)||U(ee))}function Uv(ee,Se){return Se=Se==null?l:Se,!!Se&&(typeof ee=="number"||oe.test(ee))&&ee>-1&&ee%1==0&&ee<Se}function _h(ee,Se){if(X(ee))return!1;var Ze=typeof ee;return Ze=="number"||Ze=="symbol"||Ze=="boolean"||ee==null||_t(ee)?!0:q.test(ee)||!V.test(ee)||Se!=null&&ee in Object(Se)}function Vv(ee){var Se=typeof ee;return Se=="string"||Se=="number"||Se=="symbol"||Se=="boolean"?ee!=="__proto__":ee===null}function hf(ee){return!!Jn&&Jn in ee}function _u(ee){var Se=ee&&ee.constructor,Ze=typeof Se=="function"&&Se.prototype||jr;return ee===Ze}function $v(ee){return ee===ee&&!Je(ee)}function _g(ee,Se){return function(Ze){return Ze==null?!1:Ze[ee]===Se&&(Se!==void 0||ee in Object(Ze))}}var Te=F(function(ee){ee=Ht(ee);var Se=[];return Y.test(ee)&&Se.push(""),ee.replace(le,function(Ze,Ct,vr,Cr){Se.push(vr?Cr.replace(Q,"$1"):Ct||Ze)}),Se});function gt(ee){if(typeof ee=="string"||_t(ee))return ee;var Se=ee+"";return Se=="0"&&1/ee==-s?"-0":Se}function B(ee){if(ee!=null){try{return Rn.call(ee)}catch{}try{return ee+""}catch{}}return""}function O(ee,Se){return ee&&ee.length?Es(ee,mu(Se)):[]}function F(ee,Se){if(typeof ee!="function"||Se&&typeof Se!="function")throw new TypeError(r);var Ze=function(){var Ct=arguments,vr=Se?Se.apply(this,Ct):Ct[0],Cr=Ze.cache;if(Cr.has(vr))return Cr.get(vr);var Jr=ee.apply(this,Ct);return Ze.cache=Cr.set(vr,Jr),Jr};return Ze.cache=new(F.Cache||bi),Ze}F.Cache=bi;function N(ee,Se){return ee===Se||ee!==ee&&Se!==Se}function U(ee){return Ae(ee)&&hi.call(ee,"callee")&&(!ws.call(ee,"callee")||yn.call(ee)==u)}var X=Array.isArray;function Z(ee){return ee!=null&&Be(ee.length)&&!Re(ee)}function Ae(ee){return Xe(ee)&&Z(ee)}function Re(ee){var Se=Je(ee)?yn.call(ee):"";return Se==v||Se==p}function Be(ee){return typeof ee=="number"&&ee>-1&&ee%1==0&&ee<=l}function Je(ee){var Se=typeof ee;return!!ee&&(Se=="object"||Se=="function")}function Xe(ee){return!!ee&&typeof ee=="object"}function _t(ee){return typeof ee=="symbol"||Xe(ee)&&yn.call(ee)==b}var rt=Zt?Qe(Zt):sf;function Ht(ee){return ee==null?"":ho(ee)}function Yt(ee,Se,Ze){var Ct=ee==null?void 0:Zf(ee,Se);return Ct===void 0?Ze:Ct}function ne(ee,Se){return ee!=null&&mg(ee,Se,Kf)}function ye(ee){return Z(ee)?vg(ee):bs(ee)}function Ue(ee){return ee}function Bt(){}function $t(ee){return _h(ee)?We(gt(ee)):Wm(ee)}n.exports=O})(MQ,MQ.exports);const D4t=MQ.exports;function rxe(n,e){const t=e&&e.styles&&e.styles.style,r=e&&e.captionFields&&e.captionFields.captionField,i={nodes:[],edges:[]};return n.forEach(a=>{const o=a.path;if(o){const{nodes:s,edges:l}=N4t(o,t,r);i.nodes.push(...s),i.edges.push(...l)}else if(BGe(a)){const s=zGe(a,t);i.edges.push(s)}else{const s=GGe(a,t,r);i.nodes.push(s)}}),{nodes:nxe(i.nodes),edges:nxe(i.edges,"edgeId")}}function nxe(n,e="id"){return D4t(n,e)}function BGe(n){return n.hasOwnProperty("start")&&n.hasOwnProperty("end")}function N4t(n,e,t){const r={nodes:[],edges:[]};return n.forEach(i=>{if(BGe(i)){const a=zGe(i,e);r.edges.push(a)}else{const a=GGe(i,e,t);r.nodes.push(a)}}),r}function GGe(n,e,t){const{id:r,properties:i,lables:a}=n,o=e?F4t(n,e):{},s=B4t(n,t),l=o.fillColor||"",u={id:r+"",label:s,properties:i,lables:a};return o.size&&(u.size=o.size,delete o.size),o.fillColor&&(u.style={fill:l,stroke:l},delete o.fillColor),Object.keys(o).length!==0&&(u.labelCfg={style:o}),u}function zGe(n,e){const{start:t,end:r,id:i,type:a,properties:o}=n,s=e?k4t(n,e):{},l={source:t+"",target:r+"",edgeId:i+"",label:a,style:{},labelCfg:{},properties:o};return s.stroke&&(l.style.stroke=s.stroke,l.style.endArrow={path:"M 0,0 L 4,2 L 4,-2 Z",fill:s.stroke},delete s.stroke),s.lineWidth&&(l.style.lineWidth=s.lineWidth,delete s.lineWidth),l.labelCfg={style:s},l}function k4t(n,e){if(!e)return{};const{id:t,type:r}=n,i=e.filter(a=>a.type==="relationShip");for(let a=0;a<i.length;a++){const{color:o,width:s,textColor:l,font:u,relationTypes:h,relationIds:c}=i[a],f=JSON.parse(c||"[]"),d=JSON.parse(h||"[]");if(f.includes(t)||d.includes(r))return{stroke:o,lineWidth:Number(s)*1.4,fontSize:u.fontSize,fill:l,...UGe(u.fontName),...Poe(u.fontStyle)}}return{}}function F4t(n,e){if(!e)return{};const{id:t,labels:r}=n,i=e.filter(a=>a.type==="entity");for(let a=0;a<i.length;a++){const{color:o,textColor:s,font:l,size:u,entityTypes:h,entityIds:c}=i[a],f=JSON.parse(c||"[]"),d=JSON.parse(h||"[]");if(f.includes(t)||d.includes(r[0]))return{fillColor:o,fontSize:l.fontSize,fill:s,size:u,...UGe(l.fontName),...Poe(l.fontStyle)}}return{}}function B4t(n,e){const{id:t,labels:r,properties:i}=n;if(e){const a=e instanceof Array?e:[e];for(let o=0;o<a.length;o++){const{name:s,entityTypes:l,entityIds:u}=a[o],h=JSON.parse(u||"[]"),c=JSON.parse(l||"[]"),f=r&&r.join("&");if(h.includes(t)||c.includes(f))return i[s]||""}}return i[i._labelfieldname]||""}function Poe(n){return n===1||n==="bold"?{fontWeight:"bold"}:n===2||n==="italic"?{fontStyle:"italic"}:n==="bolditalic"?{fontWeight:"bold",fontStyle:"italic"}:{}}function UGe(n){if(!n)return{};const e=n.split(".");return{fontFamily:e[0],...Poe(e[1])}}function G4t(n){const{expand:e,collapse:t,hidden:r}=n.dataContent;return{expand:e&&JSON.parse(e),collapse:t&&JSON.parse(t),hidden:r&&JSON.parse(r)}}var IQ=function(n,e){return IQ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},IQ(n,e)};function Kn(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");IQ(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ve=function(){return ve=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ve.apply(this,arguments)};function rh(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function VGe(n,e,t,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(o=n[s])&&(a=(i<3?o(a):i>3?o(e,t,a):o(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a}function $Ge(n,e){return function(t,r){e(t,r,n)}}function WGe(n,e,t,r,i,a){function o(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var s=r.kind,l=s==="getter"?"get":s==="setter"?"set":"value",u=!e&&n?r.static?n:n.prototype:null,h=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),c,f=!1,d=t.length-1;d>=0;d--){var v={};for(var p in r)v[p]=p==="access"?{}:r[p];for(var p in r.access)v.access[p]=r.access[p];v.addInitializer=function(m){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(m||null))};var g=(0,t[d])(s==="accessor"?{get:h.get,set:h.set}:h[l],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(h.get=c),(c=o(g.set))&&(h.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):h[l]=c)}u&&Object.defineProperty(u,r.name,h),f=!0}function HGe(n,e,t){for(var r=arguments.length>2,i=0;i<e.length;i++)t=r?e[i].call(n,t):e[i].call(n);return r?t:void 0}function jGe(n){return typeof n=="symbol"?n:"".concat(n)}function XGe(n,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function YGe(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function Qd(n,e,t,r){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(h){try{u(r.next(h))}catch(c){o(c)}}function l(h){try{u(r.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):i(h.value).then(s,l)}u((r=r.apply(n,e||[])).next())})}function ev(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(h){u=[6,h],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var PU=Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]};function qGe(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&PU(e,n,t)}function o9(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ooe(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return a}function ZGe(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(Ooe(arguments[e]));return n}function OU(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function _v(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))}function bM(n){return this instanceof bM?(this.v=n,this):new bM(n)}function KGe(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(v){return Promise.resolve(v).then(d,c)}}function s(d,v){r[d]&&(i[d]=function(p){return new Promise(function(g,m){a.push([d,p,g,m])>1||l(d,p)})},v&&(i[d]=v(i[d])))}function l(d,v){try{u(r[d](v))}catch(p){f(a[0][3],p)}}function u(d){d.value instanceof bM?Promise.resolve(d.value.v).then(h,c):f(a[0][2],d)}function h(d){l("next",d)}function c(d){l("throw",d)}function f(d,v){d(v),a.shift(),a.length&&l(a[0][0],a[0][1])}}function JGe(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=n[i]?function(o){return(t=!t)?{value:bM(n[i](o)),done:!1}:a?a(o):o}:a}}function QGe(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof o9=="function"?o9(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=n[a]&&function(o){return new Promise(function(s,l){o=n[a](o),i(s,l,o.done,o.value)})}}function i(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function e9e(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var z4t=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e},LQ=function(n){return LQ=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},LQ(n)};function t9e(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t=LQ(n),r=0;r<t.length;r++)t[r]!=="default"&&PU(e,n,t[r]);return z4t(e,n),e}function r9e(n){return n&&n.__esModule?n:{default:n}}function n9e(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function i9e(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t}function a9e(n,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?e===n:n.has(e)}function o9e(n,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),n.stack.push({value:e,dispose:r,async:t})}else t&&n.stack.push({async:!0});return e}var U4t=typeof SuppressedError=="function"?SuppressedError:function(n,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=n,r.suppressed=e,r};function s9e(n){function e(a){n.error=n.hasError?new U4t(a,n.error,"An error was suppressed during disposal."):a,n.hasError=!0}var t,r=0;function i(){for(;t=n.stack.pop();)try{if(!t.async&&r===1)return r=0,n.stack.push(t),Promise.resolve().then(i);if(t.dispose){var a=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(a).then(i,function(o){return e(o),i()})}else r|=1}catch(o){e(o)}if(r===1)return n.hasError?Promise.reject(n.error):Promise.resolve();if(n.hasError)throw n.error}return i()}function l9e(n,e){return typeof n=="string"&&/^\.\.?\//.test(n)?n.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,i,a,o){return r?e?".jsx":".js":i&&(!a||!o)?t:i+a+"."+o.toLowerCase()+"js"}):n}const V4t={__extends:Kn,__assign:ve,__rest:rh,__decorate:VGe,__param:$Ge,__esDecorate:WGe,__runInitializers:HGe,__propKey:jGe,__setFunctionName:XGe,__metadata:YGe,__awaiter:Qd,__generator:ev,__createBinding:PU,__exportStar:qGe,__values:o9,__read:Ooe,__spread:ZGe,__spreadArrays:OU,__spreadArray:_v,__await:bM,__asyncGenerator:KGe,__asyncDelegator:JGe,__asyncValues:QGe,__makeTemplateObject:e9e,__importStar:t9e,__importDefault:r9e,__classPrivateFieldGet:n9e,__classPrivateFieldSet:i9e,__classPrivateFieldIn:a9e,__addDisposableResource:o9e,__disposeResources:s9e,__rewriteRelativeImportExtension:l9e},$4t=Object.freeze(Object.defineProperty({__proto__:null,__extends:Kn,get __assign(){return ve},__rest:rh,__decorate:VGe,__param:$Ge,__esDecorate:WGe,__runInitializers:HGe,__propKey:jGe,__setFunctionName:XGe,__metadata:YGe,__awaiter:Qd,__generator:ev,__createBinding:PU,__exportStar:qGe,__values:o9,__read:Ooe,__spread:ZGe,__spreadArrays:OU,__spreadArray:_v,__await:bM,__asyncGenerator:KGe,__asyncDelegator:JGe,__asyncValues:QGe,__makeTemplateObject:e9e,__importStar:t9e,__importDefault:r9e,__classPrivateFieldGet:n9e,__classPrivateFieldSet:i9e,__classPrivateFieldIn:a9e,__addDisposableResource:o9e,__disposeResources:s9e,__rewriteRelativeImportExtension:l9e,default:V4t},Symbol.toStringTag,{value:"Module"}));var Ed=function(n){return n!==null&&typeof n!="function"&&isFinite(n.length)},s9=function(n,e){return Ed(n)?n.indexOf(e)>-1:!1},RU=function(n,e){if(!Ed(n))return n;for(var t=[],r=0;r<n.length;r++){var i=n[r];e(i,r)&&t.push(i)}return t},W4t=function(n,e){return e===void 0&&(e=[]),RU(n,function(t){return!s9(e,t)})},H4t={}.toString,k0=function(n,e){return H4t.call(n)==="[object "+e+"]"};const nl=function(n){return k0(n,"Function")};var an=function(n){return n==null};const vn=function(n){return Array.isArray?Array.isArray(n):k0(n,"Array")},Wh=function(n){var e=typeof n;return n!==null&&e==="object"||e==="function"};function At(n,e){if(!!n){var t;if(vn(n))for(var r=0,i=n.length;r<i&&(t=e(n[r],r),t!==!1);r++);else if(Wh(n)){for(var a in n)if(n.hasOwnProperty(a)&&(t=e(n[a],a),t===!1))break}}}var u9e=Object.keys?function(n){return Object.keys(n)}:function(n){var e=[];return At(n,function(t,r){nl(n)&&r==="prototype"||e.push(r)}),e};function h9e(n,e){var t=u9e(e),r=t.length;if(an(n))return!r;for(var i=0;i<r;i+=1){var a=t[i];if(e[a]!==n[a]||!(a in n))return!1}return!0}var l9=function(n){return typeof n=="object"&&n!==null},kh=function(n){if(!l9(n)||!k0(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e};function j4t(n,e){if(!vn(n))return null;var t;if(nl(e)&&(t=e),kh(e)&&(t=function(i){return h9e(i,e)}),t){for(var r=0;r<n.length;r+=1)if(t(n[r]))return n[r]}return null}function X4t(n,e,t){t===void 0&&(t=0);for(var r=t;r<n.length;r++)if(e(n[r],r))return r;return-1}var Y4t=function(n,e){for(var t=null,r=0;r<n.length;r++){var i=n[r],a=i[e];if(!an(a)){vn(a)?t=a[0]:t=a;break}}return t},q4t=function(n){if(!vn(n))return[];for(var e=[],t=0;t<n.length;t++)e=e.concat(n[t]);return e},c9e=function(n,e){if(e===void 0&&(e=[]),!vn(n))e.push(n);else for(var t=0;t<n.length;t+=1)c9e(n[t],e);return e};const fm=function(n){if(!!vn(n))return n.reduce(function(e,t){return Math.max(e,t)},n[0])},dm=function(n){if(!!vn(n))return n.reduce(function(e,t){return Math.min(e,t)},n[0])};var f9e=function(n){var e=n.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(vn(n[0])){for(var t=[],r=0;r<n.length;r++)t=t.concat(n[r]);e=t}var i=fm(e),a=dm(e);return{min:a,max:i}},d9e=Array.prototype,Z4t=d9e.splice,K4t=d9e.indexOf,J4t=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r++)for(var i=e[r],a=-1;(a=K4t.call(n,i))>-1;)Z4t.call(n,a,1);return n},Q4t=Array.prototype.splice,v9e=function(e,t){if(!Ed(e))return[];for(var r=e?t.length:0,i=r-1;r--;){var a=void 0,o=t[r];(r===i||o!==a)&&(a=o,Q4t.call(e,o,1))}return e},p9e=function(n,e,t){if(!vn(n)&&!kh(n))return n;var r=t;return At(n,function(i,a){r=e(r,i,a)}),r},e5t=function(n,e){var t=[];if(!Ed(n))return t;for(var r=-1,i=[],a=n.length;++r<a;){var o=n[r];e(o,r,n)&&(t.push(o),i.push(r))}return v9e(n,i),t};const rr=function(n){return k0(n,"String")};function t5t(n,e){var t;if(nl(e))t=function(i,a){return e(i)-e(a)};else{var r=[];rr(e)?r.push(e):vn(e)&&(r=e),t=function(i,a){for(var o=0;o<r.length;o+=1){var s=r[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return n.sort(t),n}function kD(n,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++){var a=n[r];e.has(a)||(t.push(a),e.set(a,!0))}return t}var r5t=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return kD([].concat.apply([],n))};const n5t=function(n,e){for(var t=[],r={},i=0;i<n.length;i++){var a=n[i],o=a[e];if(!an(o)){vn(o)||(o=[o]);for(var s=0;s<o.length;s++){var l=o[s];r[l]||(t.push(l),r[l]=!0)}}}return t};function Ky(n){if(Ed(n))return n[0]}function Fp(n){if(Ed(n)){var e=n;return e[e.length-1]}}function i5t(n,e){return vn(n)||rr(n)?n[0]===e:!1}function a5t(n,e){return vn(n)||rr(n)?n[n.length-1]===e:!1}var o5t=function(n,e){for(var t=0;t<n.length;t++)if(!e(n[t],t))return!1;return!0},s5t=function(n,e){for(var t=0;t<n.length;t++)if(e(n[t],t))return!0;return!1},l5t=Object.prototype.hasOwnProperty;function u9(n,e){if(!e||!vn(n))return{};for(var t={},r=nl(e)?e:function(s){return s[e]},i,a=0;a<n.length;a++){var o=n[a];i=r(o),l5t.call(t,i)?t[i].push(o):t[i]=[o]}return t}function g9e(n,e){if(!e)return{0:n};if(!nl(e)){var t=vn(e)?e:e.replace(/\s+/g,"").split("*");e=function(r){for(var i="_",a=0,o=t.length;a<o;a++)i+=r[t[a]]&&r[t[a]].toString();return i}}return u9(n,e)}const u5t=function(n,e){if(!e)return[n];var t=g9e(n,e),r=[];for(var i in t)r.push(t[i]);return r};function h5t(n,e){return n["_wrap_"+e]}function hE(n,e){if(n["_wrap_"+e])return n["_wrap_"+e];var t=function(r){n[e](r)};return n["_wrap_"+e]=t,t}var ixe={};function c5t(n){var e=ixe[n];if(!e){for(var t=n.toString(16),r=t.length;r<6;r++)t="0"+t;e="#"+t,ixe[n]=e}return e}function f5t(n){var e=0,t=0,r=0,i=0;return vn(n)?n.length===1?e=t=r=i=n[0]:n.length===2?(e=r=n[0],t=i=n[1]):n.length===3?(e=n[0],t=i=n[1],r=n[2]):(e=n[0],t=n[1],r=n[2],i=n[3]):e=t=r=i=n,{r1:e,r2:t,r3:r,r4:i}}var d5t=function(n,e,t){return n<e?e:n>t?t:n},BB=function(n,e){var t=e.toString(),r=t.indexOf(".");if(r===-1)return Math.round(n);var i=t.substr(r+1).length;return i>20&&(i=20),parseFloat(n.toFixed(i))},on=function(n){return k0(n,"Number")},v5t=function(n){return on(n)&&n%1!==0},p5t=function(n){return on(n)&&n%2===0},g5t=Number.isInteger?Number.isInteger:function(n){return on(n)&&n%1===0},y5t=function(n){return on(n)&&n<0},m5t=1e-5;function y9e(n,e,t){return t===void 0&&(t=m5t),Math.abs(n-e)<t}var _5t=function(n){return on(n)&&n%2!==0},x5t=function(n){return on(n)&&n>0};const S5t=function(n,e){if(!!vn(n)){for(var t,r=-1/0,i=0;i<n.length;i++){var a=n[i],o=nl(e)?e(a):a[e];o>r&&(t=a,r=o)}return t}},w5t=function(n,e){if(!!vn(n)){for(var t,r=1/0,i=0;i<n.length;i++){var a=n[i],o=nl(e)?e(a):a[e];o<r&&(t=a,r=o)}return t}};var DU=function(n,e){return(n%e+e)%e},b5t=180/Math.PI,E5t=function(n){return b5t*n};const T5t=parseInt;var C5t=Math.PI/180,NU=function(n){return C5t*n};const axe=function(n,e){return n.hasOwnProperty(e)};var Roe=Object.values?function(n){return Object.values(n)}:function(n){var e=[];return At(n,function(t,r){nl(n)&&r==="prototype"||e.push(t)}),e};const A5t=function(n,e){return s9(Roe(n),e)},jI=function(n){return an(n)?"":n.toString()};var M5t=function(n){return jI(n).toLowerCase()},I5t=function(n){var e=jI(n);return e.charAt(0).toLowerCase()+e.substring(1)};function L5t(n,e){return!n||!e?n:n.replace(/\\?\{([^{}]+)\}/g,function(t,r){return t.charAt(0)==="\\"?t.slice(1):e[r]===void 0?"":e[r]})}var P5t=function(n){return jI(n).toUpperCase()},EM=function(n){var e=jI(n);return e.charAt(0).toUpperCase()+e.substring(1)},O5t={}.toString,m9e=function(n){return O5t.call(n).replace(/^\[object /,"").replace(/]$/,"")},R5t=function(n){return k0(n,"Arguments")},z3=function(n){return k0(n,"Boolean")},Doe=function(n){return k0(n,"Date")},D5t=function(n){return k0(n,"Error")};function N5t(n){return on(n)&&isFinite(n)}var k5t=function(n){return n===null},F5t=Object.prototype,_9e=function(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||F5t;return n===t},B5t=function(n){return k0(n,"RegExp")},G5t=function(n){return n===void 0},z5t=function(n){return n instanceof Element||n instanceof HTMLDocument};function x9e(n){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(n)}function S9e(n){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(n)}function EX(n,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(n[t]=e[t])}function _n(n,e,t,r){return e&&EX(n,e),t&&EX(n,t),r&&EX(n,r),n}var U5t=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=n[0],r=1;r<n.length;r++){var i=n[r];nl(i)&&(i=i.prototype),_n(t.prototype,i)}},Xi=function(n){if(typeof n!="object"||n===null)return n;var e;if(vn(n)){e=[];for(var t=0,r=n.length;t<r;t++)typeof n[t]=="object"&&n[t]!=null?e[t]=Xi(n[t]):e[t]=n[t]}else{e={};for(var i in n)typeof n[i]=="object"&&n[i]!=null?e[i]=Xi(n[i]):e[i]=n[i]}return e};function U3(n,e,t){var r;return function(){var i=this,a=arguments,o=function(){r=null,t||n.apply(i,a)},s=t&&!r;clearTimeout(r),r=setTimeout(o,e),s&&n.apply(i,a)}}const w9e=function(n,e){if(!nl(n))throw new TypeError("Expected a function");var t=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=e?e.apply(this,r):r[0],o=t.cache;if(o.has(a))return o.get(a);var s=n.apply(this,r);return o.set(a,s),s};return t.cache=new Map,t};var V5t=5;function b9e(n,e,t,r){t=t||0,r=r||V5t;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];a!==null&&kh(a)?(kh(n[i])||(n[i]={}),t<r?b9e(n[i],a,t+1,r):n[i]=e[i]):vn(a)?(n[i]=[],n[i]=n[i].concat(a)):a!==void 0&&(n[i]=a)}}var ms=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r+=1)b9e(n,e[r]);return n},$5t=function(n,e,t,r){nl(e)||(t=e,e=n,n=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function l(){}l.prototype=o;var u=new l;return u.constructor=s,u},a=i(e.prototype,n);return n.prototype=_n(a,n.prototype),n.superclass=i(e.prototype,e),_n(a,t),_n(n,r),n},Noe=function(n,e){if(!Ed(n))return-1;var t=Array.prototype.indexOf;if(t)return t.call(n,e);for(var r=-1,i=0;i<n.length;i++)if(n[i]===e){r=i;break}return r},W5t=Object.prototype.hasOwnProperty;function E9e(n){if(an(n))return!0;if(Ed(n))return!n.length;var e=m9e(n);if(e==="Map"||e==="Set")return!n.size;if(_9e(n))return!Object.keys(n).length;for(var t in n)if(W5t.call(n,t))return!1;return!0}var HS=function(n,e){if(n===e)return!0;if(!n||!e||rr(n)||rr(e))return!1;if(Ed(n)||Ed(e)){if(n.length!==e.length)return!1;for(var t=!0,r=0;r<n.length&&(t=HS(n[r],e[r]),!!t);r++);return t}if(l9(n)||l9(e)){var i=Object.keys(n),a=Object.keys(e);if(i.length!==a.length)return!1;for(var t=!0,r=0;r<i.length&&(t=HS(n[i[r]],e[i[r]]),!!t);r++);return t}return!1};const H5t=function(n,e,t){return nl(t)?!!t(n,e):HS(n,e)};var n2=function(n,e){if(!Ed(n))return n;for(var t=[],r=0;r<n.length;r++){var i=n[r];t.push(e(i,r))}return t},j5t=function(n){return n};const X5t=function(n,e){e===void 0&&(e=j5t);var t={};return Wh(n)&&!an(n)&&Object.keys(n).forEach(function(r){t[r]=e(n[r],r)}),t},y1=function(n,e,t){for(var r=0,i=rr(e)?e.split("."):e;n&&r<i.length;)n=n[i[r++]];return n===void 0||r<i.length?t:n},Y5t=function(n,e,t){var r=n,i=rr(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(Wh(r[a])||(r[a]=on(i[o+1])?[]:{}),r=r[a]):r[a]=t}),n};var q5t=Object.prototype.hasOwnProperty;const Z5t=function(n,e){if(n===null||!kh(n))return{};var t={};return At(e,function(r){q5t.call(n,r)&&(t[r]=n[r])}),t},K5t=function(n,e){return p9e(n,function(t,r,i){return e.includes(i)||(t[i]=r),t},{})},FD=function(n,e,t){var r,i,a,o,s=0;t||(t={});var l=function(){s=t.leading===!1?0:Date.now(),r=null,o=n.apply(i,a),r||(i=a=null)},u=function(){var h=Date.now();!s&&t.leading===!1&&(s=h);var c=e-(h-s);return i=this,a=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=h,o=n.apply(i,a),r||(i=a=null)):!r&&t.trailing!==!1&&(r=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(r),s=0,r=i=a=null},u},T9e=function(n){return Ed(n)?Array.prototype.slice.call(n):[]};var r5={};const vm=function(n){return n=n||"g",r5[n]?r5[n]+=1:r5[n]=1,n+r5[n]},vO=function(){},J5t=function(n){return n};function kU(n){return an(n)?0:Ed(n)?n.length:Object.keys(n).length}var n5;const pO=w9e(function(n,e){e===void 0&&(e={});var t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return n5||(n5=document.createElement("canvas").getContext("2d")),n5.font=[a,o,i,t+"px",r].join(" "),n5.measureText(rr(n)?n:"").width},function(n,e){return e===void 0&&(e={}),OU([n],Roe(e)).join("")}),Q5t=function(n,e,t,r){r===void 0&&(r="...");var i=16,a=pO(r,t),o=rr(n)?n:jI(n),s=e,l=[],u,h;if(pO(n,t)<=e)return n;for(;u=o.substr(0,i),h=pO(u,t),!(h+a>s&&h>s);)if(l.push(u),s-=h,o=o.substr(i),!o)return l.join("");for(;u=o.substr(0,1),h=pO(u,t),!(h+a>s);)if(l.push(u),s-=h,o=o.substr(1),!o)return l.join("");return""+l.join("")+r};var e6t=function(){function n(){this.map={}}return n.prototype.has=function(e){return this.map[e]!==void 0},n.prototype.get=function(e,t){var r=this.map[e];return r===void 0?t:r},n.prototype.set=function(e,t){this.map[e]=t},n.prototype.clear=function(){this.map={}},n.prototype.delete=function(e){delete this.map[e]},n.prototype.size=function(){return Object.keys(this.map).length},n}();const t6t=Object.freeze(Object.defineProperty({__proto__:null,contains:s9,includes:s9,difference:W4t,find:j4t,findIndex:X4t,firstValue:Y4t,flatten:q4t,flattenDeep:c9e,getRange:f9e,pull:J4t,pullAt:v9e,reduce:p9e,remove:e5t,sortBy:t5t,union:r5t,uniq:kD,valuesOfKey:n5t,head:Ky,last:Fp,startsWith:i5t,endsWith:a5t,filter:RU,every:o5t,some:s5t,group:u5t,groupBy:u9,groupToMap:g9e,getWrapBehavior:h5t,wrapBehavior:hE,number2color:c5t,parseRadius:f5t,clamp:d5t,fixedBase:BB,isDecimal:v5t,isEven:p5t,isInteger:g5t,isNegative:y5t,isNumberEqual:y9e,isOdd:_5t,isPositive:x5t,max:fm,maxBy:S5t,min:dm,minBy:w5t,mod:DU,toDegree:E5t,toInteger:T5t,toRadian:NU,forIn:At,has:axe,hasKey:axe,hasValue:A5t,keys:u9e,isMatch:h9e,values:Roe,lowerCase:M5t,lowerFirst:I5t,substitute:L5t,upperCase:P5t,upperFirst:EM,getType:m9e,isArguments:R5t,isArray:vn,isArrayLike:Ed,isBoolean:z3,isDate:Doe,isError:D5t,isFunction:nl,isFinite:N5t,isNil:an,isNull:k5t,isNumber:on,isObject:Wh,isObjectLike:l9,isPlainObject:kh,isPrototype:_9e,isRegExp:B5t,isString:rr,isType:k0,isUndefined:G5t,isElement:z5t,requestAnimationFrame:x9e,clearAnimationFrame:S9e,augment:U5t,clone:Xi,debounce:U3,memoize:w9e,deepMix:ms,each:At,extend:$5t,indexOf:Noe,isEmpty:E9e,isEqual:HS,isEqualWith:H5t,map:n2,mapValues:X5t,mix:_n,assign:_n,get:y1,set:Y5t,pick:Z5t,omit:K5t,throttle:FD,toArray:T9e,toString:jI,uniqueId:vm,noop:vO,identity:J5t,size:kU,measureTextWidth:pO,getEllipsisText:Q5t,Cache:e6t},Symbol.toStringTag,{value:"Module"})),r6t={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,r=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),At(r,function(i,a){e.on(a,i)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,r=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),At(t,function(i,a){e.off(a,i)}),e.get("canvas").set("draggable",r)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}};var koe=function(){function n(){}return n.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var r=Xi(r6t);Object.assign(r,t);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var l=this.getEvents();this.events=null;var u={};l&&(At(l,function(h,c){u[c]=hE(s,h)}),this.events=u)};i.prototype=r,n.types[e]=i},n.hasBehavior=function(e){return!!n.types[e]},n.getBehavior=function(e){return n.types[e]},n.types={},n}(),n6t="*",C9e=function(){function n(){this._events={}}return n.prototype.on=function(e,t,r){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!r}),this},n.prototype.once=function(e,t){return this.on(e,t,!0)},n.prototype.emit=function(e){for(var t=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=this._events[e]||[],o=this._events[n6t]||[],s=function(l){for(var u=l.length,h=0;h<u;h++)if(!!l[h]){var c=l[h],f=c.callback,d=c.once;d&&(l.splice(h,1),l.length===0&&delete t._events[e],u--,h--),f.apply(t,r)}};s(a),s(o)},n.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var r=this._events[e]||[],i=r.length,a=0;a<i;a++)r[a].callback===t&&(r.splice(a,1),i--,a--);r.length===0&&delete this._events[e]}return this},n.prototype.getEvents=function(){return this._events},n}(),In=1e-6,ca=typeof Float32Array<"u"?Float32Array:Array,i0=Math.random;function i6t(n){ca=n}var a6t=Math.PI/180;function o6t(n){return n*a6t}function s6t(n,e){return Math.abs(n-e)<=In*Math.max(1,Math.abs(n),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var n=0,e=arguments.length;e--;)n+=arguments[e]*arguments[e];return Math.sqrt(n)});const l6t=Object.freeze(Object.defineProperty({__proto__:null,EPSILON:In,get ARRAY_TYPE(){return ca},RANDOM:i0,setMatrixArrayType:i6t,toRadian:o6t,equals:s6t},Symbol.toStringTag,{value:"Module"}));function u6t(){var n=new ca(4);return ca!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n}function h6t(n){var e=new ca(4);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e}function c6t(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}function f6t(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n}function d6t(n,e,t,r){var i=new ca(4);return i[0]=n,i[1]=e,i[2]=t,i[3]=r,i}function v6t(n,e,t,r,i){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function p6t(n,e){if(n===e){var t=e[1];n[1]=e[2],n[2]=t}else n[0]=e[0],n[1]=e[2],n[2]=e[1],n[3]=e[3];return n}function g6t(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t*a-i*r;return o?(o=1/o,n[0]=a*o,n[1]=-r*o,n[2]=-i*o,n[3]=t*o,n):null}function y6t(n,e){var t=e[0];return n[0]=e[3],n[1]=-e[1],n[2]=-e[2],n[3]=t,n}function m6t(n){return n[0]*n[3]-n[2]*n[1]}function A9e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],h=t[3];return n[0]=r*s+a*l,n[1]=i*s+o*l,n[2]=r*u+a*h,n[3]=i*u+o*h,n}function _6t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l+a*s,n[1]=i*l+o*s,n[2]=r*-s+a*l,n[3]=i*-s+o*l,n}function x6t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1];return n[0]=r*s,n[1]=i*s,n[2]=a*l,n[3]=o*l,n}function S6t(n,e){var t=Math.sin(e),r=Math.cos(e);return n[0]=r,n[1]=t,n[2]=-t,n[3]=r,n}function w6t(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=e[1],n}function b6t(n){return"mat2("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}function E6t(n){return Math.hypot(n[0],n[1],n[2],n[3])}function T6t(n,e,t,r){return n[2]=r[2]/r[0],t[0]=r[0],t[1]=r[1],t[3]=r[3]-n[2]*t[1],[n,e,t]}function C6t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n}function M9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n}function A6t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]}function M6t(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(t-o)<=In*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(r-s)<=In*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=In*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=In*Math.max(1,Math.abs(a),Math.abs(u))}function I6t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function L6t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n[3]=e[3]+t[3]*r,n}var P6t=A9e,O6t=M9e;const R6t=Object.freeze(Object.defineProperty({__proto__:null,create:u6t,clone:h6t,copy:c6t,identity:f6t,fromValues:d6t,set:v6t,transpose:p6t,invert:g6t,adjoint:y6t,determinant:m6t,multiply:A9e,rotate:_6t,scale:x6t,fromRotation:S6t,fromScaling:w6t,str:b6t,frob:E6t,LDU:T6t,add:C6t,subtract:M9e,exactEquals:A6t,equals:M6t,multiplyScalar:I6t,multiplyScalarAndAdd:L6t,mul:P6t,sub:O6t},Symbol.toStringTag,{value:"Module"}));function D6t(){var n=new ca(6);return ca!=Float32Array&&(n[1]=0,n[2]=0,n[4]=0,n[5]=0),n[0]=1,n[3]=1,n}function N6t(n){var e=new ca(6);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e}function k6t(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function F6t(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n}function B6t(n,e,t,r,i,a){var o=new ca(6);return o[0]=n,o[1]=e,o[2]=t,o[3]=r,o[4]=i,o[5]=a,o}function G6t(n,e,t,r,i,a,o){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n}function z6t(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=t*a-r*i;return l?(l=1/l,n[0]=a*l,n[1]=-r*l,n[2]=-i*l,n[3]=t*l,n[4]=(i*s-a*o)*l,n[5]=(r*o-t*s)*l,n):null}function U6t(n){return n[0]*n[3]-n[1]*n[2]}function I9e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=t[0],h=t[1],c=t[2],f=t[3],d=t[4],v=t[5];return n[0]=r*u+a*h,n[1]=i*u+o*h,n[2]=r*c+a*f,n[3]=i*c+o*f,n[4]=r*d+a*v+s,n[5]=i*d+o*v+l,n}function V6t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(t),h=Math.cos(t);return n[0]=r*h+a*u,n[1]=i*h+o*u,n[2]=r*-u+a*h,n[3]=i*-u+o*h,n[4]=s,n[5]=l,n}function $6t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=t[0],h=t[1];return n[0]=r*u,n[1]=i*u,n[2]=a*h,n[3]=o*h,n[4]=s,n[5]=l,n}function W6t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=t[0],h=t[1];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=r*u+a*h+s,n[5]=i*u+o*h+l,n}function H6t(n,e){var t=Math.sin(e),r=Math.cos(e);return n[0]=r,n[1]=t,n[2]=-t,n[3]=r,n[4]=0,n[5]=0,n}function j6t(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=e[1],n[4]=0,n[5]=0,n}function X6t(n,e){return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=e[0],n[5]=e[1],n}function Y6t(n){return"mat2d("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+")"}function q6t(n){return Math.hypot(n[0],n[1],n[2],n[3],n[4],n[5],1)}function Z6t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n}function L9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n}function K6t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n}function J6t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n[3]=e[3]+t[3]*r,n[4]=e[4]+t[4]*r,n[5]=e[5]+t[5]*r,n}function Q6t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]}function eBt(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=e[0],u=e[1],h=e[2],c=e[3],f=e[4],d=e[5];return Math.abs(t-l)<=In*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(r-u)<=In*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-h)<=In*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-c)<=In*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-f)<=In*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-d)<=In*Math.max(1,Math.abs(s),Math.abs(d))}var tBt=I9e,rBt=L9e;const nBt=Object.freeze(Object.defineProperty({__proto__:null,create:D6t,clone:N6t,copy:k6t,identity:F6t,fromValues:B6t,set:G6t,invert:z6t,determinant:U6t,multiply:I9e,rotate:V6t,scale:$6t,translate:W6t,fromRotation:H6t,fromScaling:j6t,fromTranslation:X6t,str:Y6t,frob:q6t,add:Z6t,subtract:L9e,multiplyScalar:K6t,multiplyScalarAndAdd:J6t,exactEquals:Q6t,equals:eBt,mul:tBt,sub:rBt},Symbol.toStringTag,{value:"Module"}));function P9e(){var n=new ca(9);return ca!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function iBt(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n}function aBt(n){var e=new ca(9);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e}function oBt(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function sBt(n,e,t,r,i,a,o,s,l){var u=new ca(9);return u[0]=n,u[1]=e,u[2]=t,u[3]=r,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u[8]=l,u}function lBt(n,e,t,r,i,a,o,s,l,u){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n[6]=s,n[7]=l,n[8]=u,n}function uBt(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=1,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function hBt(n,e){if(n===e){var t=e[1],r=e[2],i=e[5];n[1]=e[3],n[2]=e[6],n[3]=t,n[5]=e[7],n[6]=r,n[7]=i}else n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8];return n}function Foe(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=h*o-s*u,f=-h*a+s*l,d=u*a-o*l,v=t*c+r*f+i*d;return v?(v=1/v,n[0]=c*v,n[1]=(-h*r+i*u)*v,n[2]=(s*r-i*o)*v,n[3]=f*v,n[4]=(h*t-i*l)*v,n[5]=(-s*t+i*a)*v,n[6]=d*v,n[7]=(-u*t+r*l)*v,n[8]=(o*t-r*a)*v,n):null}function cBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],h=e[8];return n[0]=o*h-s*u,n[1]=i*u-r*h,n[2]=r*s-i*o,n[3]=s*l-a*h,n[4]=t*h-i*l,n[5]=i*a-t*s,n[6]=a*u-o*l,n[7]=r*l-t*u,n[8]=t*o-r*a,n}function fBt(n){var e=n[0],t=n[1],r=n[2],i=n[3],a=n[4],o=n[5],s=n[6],l=n[7],u=n[8];return e*(u*a-o*l)+t*(-u*i+o*s)+r*(l*i-a*s)}function Om(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],f=t[0],d=t[1],v=t[2],p=t[3],g=t[4],m=t[5],y=t[6],_=t[7],x=t[8];return n[0]=f*r+d*o+v*u,n[1]=f*i+d*s+v*h,n[2]=f*a+d*l+v*c,n[3]=p*r+g*o+m*u,n[4]=p*i+g*s+m*h,n[5]=p*a+g*l+m*c,n[6]=y*r+_*o+x*u,n[7]=y*i+_*s+x*h,n[8]=y*a+_*l+x*c,n}function dBt(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],f=t[0],d=t[1];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n[6]=f*r+d*o+u,n[7]=f*i+d*s+h,n[8]=f*a+d*l+c,n}function vBt(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],f=Math.sin(t),d=Math.cos(t);return n[0]=d*r+f*o,n[1]=d*i+f*s,n[2]=d*a+f*l,n[3]=d*o-f*r,n[4]=d*s-f*i,n[5]=d*l-f*a,n[6]=u,n[7]=h,n[8]=c,n}function pBt(n,e,t){var r=t[0],i=t[1];return n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=i*e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n}function Boe(n,e){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=1,n[5]=0,n[6]=e[0],n[7]=e[1],n[8]=1,n}function Goe(n,e){var t=Math.sin(e),r=Math.cos(e);return n[0]=r,n[1]=t,n[2]=0,n[3]=-t,n[4]=r,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function zoe(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=0,n[4]=e[1],n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function gBt(n,e){return n[0]=e[0],n[1]=e[1],n[2]=0,n[3]=e[2],n[4]=e[3],n[5]=0,n[6]=e[4],n[7]=e[5],n[8]=1,n}function yBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t+t,s=r+r,l=i+i,u=t*o,h=r*o,c=r*s,f=i*o,d=i*s,v=i*l,p=a*o,g=a*s,m=a*l;return n[0]=1-c-v,n[3]=h-m,n[6]=f+g,n[1]=h+m,n[4]=1-u-v,n[7]=d-p,n[2]=f-g,n[5]=d+p,n[8]=1-u-c,n}function mBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],f=e[10],d=e[11],v=e[12],p=e[13],g=e[14],m=e[15],y=t*s-r*o,_=t*l-i*o,x=t*u-a*o,S=r*l-i*s,w=r*u-a*s,b=i*u-a*l,E=h*p-c*v,T=h*g-f*v,C=h*m-d*v,A=c*g-f*p,M=c*m-d*p,I=f*m-d*g,R=y*I-_*M+x*A+S*C-w*T+b*E;return R?(R=1/R,n[0]=(s*I-l*M+u*A)*R,n[1]=(l*C-o*I-u*T)*R,n[2]=(o*M-s*C+u*E)*R,n[3]=(i*M-r*I-a*A)*R,n[4]=(t*I-i*C+a*T)*R,n[5]=(r*C-t*M-a*E)*R,n[6]=(p*b-g*w+m*S)*R,n[7]=(g*x-v*b-m*_)*R,n[8]=(v*w-p*x+m*y)*R,n):null}function _Bt(n,e,t){return n[0]=2/e,n[1]=0,n[2]=0,n[3]=0,n[4]=-2/t,n[5]=0,n[6]=-1,n[7]=1,n[8]=1,n}function xBt(n){return"mat3("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+")"}function SBt(n){return Math.hypot(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])}function wBt(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n}function O9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n}function bBt(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n}function EBt(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n[3]=e[3]+t[3]*r,n[4]=e[4]+t[4]*r,n[5]=e[5]+t[5]*r,n[6]=e[6]+t[6]*r,n[7]=e[7]+t[7]*r,n[8]=e[8]+t[8]*r,n}function TBt(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]&&n[8]===e[8]}function CBt(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=n[6],u=n[7],h=n[8],c=e[0],f=e[1],d=e[2],v=e[3],p=e[4],g=e[5],m=e[6],y=e[7],_=e[8];return Math.abs(t-c)<=In*Math.max(1,Math.abs(t),Math.abs(c))&&Math.abs(r-f)<=In*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=In*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-v)<=In*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=In*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=In*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-m)<=In*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(u-y)<=In*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(h-_)<=In*Math.max(1,Math.abs(h),Math.abs(_))}var ABt=Om,MBt=O9e;const R9e=Object.freeze(Object.defineProperty({__proto__:null,create:P9e,fromMat4:iBt,clone:aBt,copy:oBt,fromValues:sBt,set:lBt,identity:uBt,transpose:hBt,invert:Foe,adjoint:cBt,determinant:fBt,multiply:Om,translate:dBt,rotate:vBt,scale:pBt,fromTranslation:Boe,fromRotation:Goe,fromScaling:zoe,fromMat2d:gBt,fromQuat:yBt,normalFromMat4:mBt,projection:_Bt,str:xBt,frob:SBt,add:wBt,subtract:O9e,multiplyScalar:bBt,multiplyScalarAndAdd:EBt,exactEquals:TBt,equals:CBt,mul:ABt,sub:MBt},Symbol.toStringTag,{value:"Module"}));function IBt(){var n=new ca(16);return ca!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n}function LBt(n){var e=new ca(16);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],e}function PBt(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function OBt(n,e,t,r,i,a,o,s,l,u,h,c,f,d,v,p){var g=new ca(16);return g[0]=n,g[1]=e,g[2]=t,g[3]=r,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=l,g[9]=u,g[10]=h,g[11]=c,g[12]=f,g[13]=d,g[14]=v,g[15]=p,g}function RBt(n,e,t,r,i,a,o,s,l,u,h,c,f,d,v,p,g){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n[6]=s,n[7]=l,n[8]=u,n[9]=h,n[10]=c,n[11]=f,n[12]=d,n[13]=v,n[14]=p,n[15]=g,n}function D9e(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function DBt(n,e){if(n===e){var t=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=r,n[9]=a,n[11]=e[14],n[12]=i,n[13]=o,n[14]=s}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15];return n}function NBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],f=e[10],d=e[11],v=e[12],p=e[13],g=e[14],m=e[15],y=t*s-r*o,_=t*l-i*o,x=t*u-a*o,S=r*l-i*s,w=r*u-a*s,b=i*u-a*l,E=h*p-c*v,T=h*g-f*v,C=h*m-d*v,A=c*g-f*p,M=c*m-d*p,I=f*m-d*g,R=y*I-_*M+x*A+S*C-w*T+b*E;return R?(R=1/R,n[0]=(s*I-l*M+u*A)*R,n[1]=(i*M-r*I-a*A)*R,n[2]=(p*b-g*w+m*S)*R,n[3]=(f*w-c*b-d*S)*R,n[4]=(l*C-o*I-u*T)*R,n[5]=(t*I-i*C+a*T)*R,n[6]=(g*x-v*b-m*_)*R,n[7]=(h*b-f*x+d*_)*R,n[8]=(o*M-s*C+u*E)*R,n[9]=(r*C-t*M-a*E)*R,n[10]=(v*w-p*x+m*y)*R,n[11]=(c*x-h*w-d*y)*R,n[12]=(s*T-o*A-l*E)*R,n[13]=(t*A-r*T+i*E)*R,n[14]=(p*_-v*S-g*y)*R,n[15]=(h*S-c*_+f*y)*R,n):null}function kBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],f=e[10],d=e[11],v=e[12],p=e[13],g=e[14],m=e[15];return n[0]=s*(f*m-d*g)-c*(l*m-u*g)+p*(l*d-u*f),n[1]=-(r*(f*m-d*g)-c*(i*m-a*g)+p*(i*d-a*f)),n[2]=r*(l*m-u*g)-s*(i*m-a*g)+p*(i*u-a*l),n[3]=-(r*(l*d-u*f)-s*(i*d-a*f)+c*(i*u-a*l)),n[4]=-(o*(f*m-d*g)-h*(l*m-u*g)+v*(l*d-u*f)),n[5]=t*(f*m-d*g)-h*(i*m-a*g)+v*(i*d-a*f),n[6]=-(t*(l*m-u*g)-o*(i*m-a*g)+v*(i*u-a*l)),n[7]=t*(l*d-u*f)-o*(i*d-a*f)+h*(i*u-a*l),n[8]=o*(c*m-d*p)-h*(s*m-u*p)+v*(s*d-u*c),n[9]=-(t*(c*m-d*p)-h*(r*m-a*p)+v*(r*d-a*c)),n[10]=t*(s*m-u*p)-o*(r*m-a*p)+v*(r*u-a*s),n[11]=-(t*(s*d-u*c)-o*(r*d-a*c)+h*(r*u-a*s)),n[12]=-(o*(c*g-f*p)-h*(s*g-l*p)+v*(s*f-l*c)),n[13]=t*(c*g-f*p)-h*(r*g-i*p)+v*(r*f-i*c),n[14]=-(t*(s*g-l*p)-o*(r*g-i*p)+v*(r*l-i*s)),n[15]=t*(s*f-l*c)-o*(r*f-i*c)+h*(r*l-i*s),n}function FBt(n){var e=n[0],t=n[1],r=n[2],i=n[3],a=n[4],o=n[5],s=n[6],l=n[7],u=n[8],h=n[9],c=n[10],f=n[11],d=n[12],v=n[13],p=n[14],g=n[15],m=e*o-t*a,y=e*s-r*a,_=e*l-i*a,x=t*s-r*o,S=t*l-i*o,w=r*l-i*s,b=u*v-h*d,E=u*p-c*d,T=u*g-f*d,C=h*p-c*v,A=h*g-f*v,M=c*g-f*p;return m*M-y*A+_*C+x*T-S*E+w*b}function N9e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],f=e[9],d=e[10],v=e[11],p=e[12],g=e[13],m=e[14],y=e[15],_=t[0],x=t[1],S=t[2],w=t[3];return n[0]=_*r+x*s+S*c+w*p,n[1]=_*i+x*l+S*f+w*g,n[2]=_*a+x*u+S*d+w*m,n[3]=_*o+x*h+S*v+w*y,_=t[4],x=t[5],S=t[6],w=t[7],n[4]=_*r+x*s+S*c+w*p,n[5]=_*i+x*l+S*f+w*g,n[6]=_*a+x*u+S*d+w*m,n[7]=_*o+x*h+S*v+w*y,_=t[8],x=t[9],S=t[10],w=t[11],n[8]=_*r+x*s+S*c+w*p,n[9]=_*i+x*l+S*f+w*g,n[10]=_*a+x*u+S*d+w*m,n[11]=_*o+x*h+S*v+w*y,_=t[12],x=t[13],S=t[14],w=t[15],n[12]=_*r+x*s+S*c+w*p,n[13]=_*i+x*l+S*f+w*g,n[14]=_*a+x*u+S*d+w*m,n[15]=_*o+x*h+S*v+w*y,n}function BBt(n,e,t){var r=t[0],i=t[1],a=t[2],o,s,l,u,h,c,f,d,v,p,g,m;return e===n?(n[12]=e[0]*r+e[4]*i+e[8]*a+e[12],n[13]=e[1]*r+e[5]*i+e[9]*a+e[13],n[14]=e[2]*r+e[6]*i+e[10]*a+e[14],n[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],u=e[3],h=e[4],c=e[5],f=e[6],d=e[7],v=e[8],p=e[9],g=e[10],m=e[11],n[0]=o,n[1]=s,n[2]=l,n[3]=u,n[4]=h,n[5]=c,n[6]=f,n[7]=d,n[8]=v,n[9]=p,n[10]=g,n[11]=m,n[12]=o*r+h*i+v*a+e[12],n[13]=s*r+c*i+p*a+e[13],n[14]=l*r+f*i+g*a+e[14],n[15]=u*r+d*i+m*a+e[15]),n}function GBt(n,e,t){var r=t[0],i=t[1],a=t[2];return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n[4]=e[4]*i,n[5]=e[5]*i,n[6]=e[6]*i,n[7]=e[7]*i,n[8]=e[8]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11]*a,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function zBt(n,e,t,r){var i=r[0],a=r[1],o=r[2],s=Math.hypot(i,a,o),l,u,h,c,f,d,v,p,g,m,y,_,x,S,w,b,E,T,C,A,M,I,R,k;return s<In?null:(s=1/s,i*=s,a*=s,o*=s,l=Math.sin(t),u=Math.cos(t),h=1-u,c=e[0],f=e[1],d=e[2],v=e[3],p=e[4],g=e[5],m=e[6],y=e[7],_=e[8],x=e[9],S=e[10],w=e[11],b=i*i*h+u,E=a*i*h+o*l,T=o*i*h-a*l,C=i*a*h-o*l,A=a*a*h+u,M=o*a*h+i*l,I=i*o*h+a*l,R=a*o*h-i*l,k=o*o*h+u,n[0]=c*b+p*E+_*T,n[1]=f*b+g*E+x*T,n[2]=d*b+m*E+S*T,n[3]=v*b+y*E+w*T,n[4]=c*C+p*A+_*M,n[5]=f*C+g*A+x*M,n[6]=d*C+m*A+S*M,n[7]=v*C+y*A+w*M,n[8]=c*I+p*R+_*k,n[9]=f*I+g*R+x*k,n[10]=d*I+m*R+S*k,n[11]=v*I+y*R+w*k,e!==n&&(n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n)}function UBt(n,e,t){var r=Math.sin(t),i=Math.cos(t),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],h=e[9],c=e[10],f=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=a*i+u*r,n[5]=o*i+h*r,n[6]=s*i+c*r,n[7]=l*i+f*r,n[8]=u*i-a*r,n[9]=h*i-o*r,n[10]=c*i-s*r,n[11]=f*i-l*r,n}function VBt(n,e,t){var r=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],h=e[9],c=e[10],f=e[11];return e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=a*i-u*r,n[1]=o*i-h*r,n[2]=s*i-c*r,n[3]=l*i-f*r,n[8]=a*r+u*i,n[9]=o*r+h*i,n[10]=s*r+c*i,n[11]=l*r+f*i,n}function $Bt(n,e,t){var r=Math.sin(t),i=Math.cos(t),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],h=e[5],c=e[6],f=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=a*i+u*r,n[1]=o*i+h*r,n[2]=s*i+c*r,n[3]=l*i+f*r,n[4]=u*i-a*r,n[5]=h*i-o*r,n[6]=c*i-s*r,n[7]=f*i-l*r,n}function WBt(n,e){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function HBt(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function jBt(n,e,t){var r=t[0],i=t[1],a=t[2],o=Math.hypot(r,i,a),s,l,u;return o<In?null:(o=1/o,r*=o,i*=o,a*=o,s=Math.sin(e),l=Math.cos(e),u=1-l,n[0]=r*r*u+l,n[1]=i*r*u+a*s,n[2]=a*r*u-i*s,n[3]=0,n[4]=r*i*u-a*s,n[5]=i*i*u+l,n[6]=a*i*u+r*s,n[7]=0,n[8]=r*a*u+i*s,n[9]=i*a*u-r*s,n[10]=a*a*u+l,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n)}function XBt(n,e){var t=Math.sin(e),r=Math.cos(e);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=r,n[6]=t,n[7]=0,n[8]=0,n[9]=-t,n[10]=r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function YBt(n,e){var t=Math.sin(e),r=Math.cos(e);return n[0]=r,n[1]=0,n[2]=-t,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=t,n[9]=0,n[10]=r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function qBt(n,e){var t=Math.sin(e),r=Math.cos(e);return n[0]=r,n[1]=t,n[2]=0,n[3]=0,n[4]=-t,n[5]=r,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function k9e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,l=i+i,u=a+a,h=r*s,c=r*l,f=r*u,d=i*l,v=i*u,p=a*u,g=o*s,m=o*l,y=o*u;return n[0]=1-(d+p),n[1]=c+y,n[2]=f-m,n[3]=0,n[4]=c-y,n[5]=1-(h+p),n[6]=v+g,n[7]=0,n[8]=f+m,n[9]=v-g,n[10]=1-(h+d),n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}function ZBt(n,e){var t=new ca(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=r*r+i*i+a*a+o*o;return c>0?(t[0]=(s*o+h*r+l*a-u*i)*2/c,t[1]=(l*o+h*i+u*r-s*a)*2/c,t[2]=(u*o+h*a+s*i-l*r)*2/c):(t[0]=(s*o+h*r+l*a-u*i)*2,t[1]=(l*o+h*i+u*r-s*a)*2,t[2]=(u*o+h*a+s*i-l*r)*2),k9e(n,e,t),n}function F9e(n,e){return n[0]=e[12],n[1]=e[13],n[2]=e[14],n}function B9e(n,e){var t=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],u=e[9],h=e[10];return n[0]=Math.hypot(t,r,i),n[1]=Math.hypot(a,o,s),n[2]=Math.hypot(l,u,h),n}function G9e(n,e){var t=new ca(3);B9e(t,e);var r=1/t[0],i=1/t[1],a=1/t[2],o=e[0]*r,s=e[1]*i,l=e[2]*a,u=e[4]*r,h=e[5]*i,c=e[6]*a,f=e[8]*r,d=e[9]*i,v=e[10]*a,p=o+h+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,n[3]=.25*g,n[0]=(c-d)/g,n[1]=(f-l)/g,n[2]=(s-u)/g):o>h&&o>v?(g=Math.sqrt(1+o-h-v)*2,n[3]=(c-d)/g,n[0]=.25*g,n[1]=(s+u)/g,n[2]=(f+l)/g):h>v?(g=Math.sqrt(1+h-o-v)*2,n[3]=(f-l)/g,n[0]=(s+u)/g,n[1]=.25*g,n[2]=(c+d)/g):(g=Math.sqrt(1+v-o-h)*2,n[3]=(s-u)/g,n[0]=(f+l)/g,n[1]=(c+d)/g,n[2]=.25*g),n}function KBt(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,h=o+o,c=i*l,f=i*u,d=i*h,v=a*u,p=a*h,g=o*h,m=s*l,y=s*u,_=s*h,x=r[0],S=r[1],w=r[2];return n[0]=(1-(v+g))*x,n[1]=(f+_)*x,n[2]=(d-y)*x,n[3]=0,n[4]=(f-_)*S,n[5]=(1-(c+g))*S,n[6]=(p+m)*S,n[7]=0,n[8]=(d+y)*w,n[9]=(p-m)*w,n[10]=(1-(c+v))*w,n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}function JBt(n,e,t,r,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,h=o+o,c=s+s,f=a*u,d=a*h,v=a*c,p=o*h,g=o*c,m=s*c,y=l*u,_=l*h,x=l*c,S=r[0],w=r[1],b=r[2],E=i[0],T=i[1],C=i[2],A=(1-(p+m))*S,M=(d+x)*S,I=(v-_)*S,R=(d-x)*w,k=(1-(f+m))*w,D=(g+y)*w,G=(v+_)*b,W=(g-y)*b,z=(1-(f+p))*b;return n[0]=A,n[1]=M,n[2]=I,n[3]=0,n[4]=R,n[5]=k,n[6]=D,n[7]=0,n[8]=G,n[9]=W,n[10]=z,n[11]=0,n[12]=t[0]+E-(A*E+R*T+G*C),n[13]=t[1]+T-(M*E+k*T+W*C),n[14]=t[2]+C-(I*E+D*T+z*C),n[15]=1,n}function QBt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t+t,s=r+r,l=i+i,u=t*o,h=r*o,c=r*s,f=i*o,d=i*s,v=i*l,p=a*o,g=a*s,m=a*l;return n[0]=1-c-v,n[1]=h+m,n[2]=f-g,n[3]=0,n[4]=h-m,n[5]=1-u-v,n[6]=d+p,n[7]=0,n[8]=f+g,n[9]=d-p,n[10]=1-u-c,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function e8t(n,e,t,r,i,a,o){var s=1/(t-e),l=1/(i-r),u=1/(a-o);return n[0]=a*2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a*2*l,n[6]=0,n[7]=0,n[8]=(t+e)*s,n[9]=(i+r)*l,n[10]=(o+a)*u,n[11]=-1,n[12]=0,n[13]=0,n[14]=o*a*2*u,n[15]=0,n}function z9e(n,e,t,r,i){var a=1/Math.tan(e/2),o;return n[0]=a/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0?(o=1/(r-i),n[10]=(i+r)*o,n[14]=2*i*r*o):(n[10]=-1,n[14]=-2*r),n}var t8t=z9e;function r8t(n,e,t,r,i){var a=1/Math.tan(e/2),o;return n[0]=a/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0?(o=1/(r-i),n[10]=i*o,n[14]=i*r*o):(n[10]=-1,n[14]=-r),n}function n8t(n,e,t,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return n[0]=l,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=u,n[6]=0,n[7]=0,n[8]=-((o-s)*l*.5),n[9]=(i-a)*u*.5,n[10]=r/(t-r),n[11]=-1,n[12]=0,n[13]=0,n[14]=r*t/(t-r),n[15]=0,n}function U9e(n,e,t,r,i,a,o){var s=1/(e-t),l=1/(r-i),u=1/(a-o);return n[0]=-2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*u,n[11]=0,n[12]=(e+t)*s,n[13]=(i+r)*l,n[14]=(o+a)*u,n[15]=1,n}var i8t=U9e;function a8t(n,e,t,r,i,a,o){var s=1/(e-t),l=1/(r-i),u=1/(a-o);return n[0]=-2*s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=u,n[11]=0,n[12]=(e+t)*s,n[13]=(i+r)*l,n[14]=a*u,n[15]=1,n}function o8t(n,e,t,r){var i,a,o,s,l,u,h,c,f,d,v=e[0],p=e[1],g=e[2],m=r[0],y=r[1],_=r[2],x=t[0],S=t[1],w=t[2];return Math.abs(v-x)<In&&Math.abs(p-S)<In&&Math.abs(g-w)<In?D9e(n):(h=v-x,c=p-S,f=g-w,d=1/Math.hypot(h,c,f),h*=d,c*=d,f*=d,i=y*f-_*c,a=_*h-m*f,o=m*c-y*h,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=c*o-f*a,l=f*i-h*o,u=h*a-c*i,d=Math.hypot(s,l,u),d?(d=1/d,s*=d,l*=d,u*=d):(s=0,l=0,u=0),n[0]=i,n[1]=s,n[2]=h,n[3]=0,n[4]=a,n[5]=l,n[6]=c,n[7]=0,n[8]=o,n[9]=u,n[10]=f,n[11]=0,n[12]=-(i*v+a*p+o*g),n[13]=-(s*v+l*p+u*g),n[14]=-(h*v+c*p+f*g),n[15]=1,n)}function s8t(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=r[0],l=r[1],u=r[2],h=i-t[0],c=a-t[1],f=o-t[2],d=h*h+c*c+f*f;d>0&&(d=1/Math.sqrt(d),h*=d,c*=d,f*=d);var v=l*f-u*c,p=u*h-s*f,g=s*c-l*h;return d=v*v+p*p+g*g,d>0&&(d=1/Math.sqrt(d),v*=d,p*=d,g*=d),n[0]=v,n[1]=p,n[2]=g,n[3]=0,n[4]=c*g-f*p,n[5]=f*v-h*g,n[6]=h*p-c*v,n[7]=0,n[8]=h,n[9]=c,n[10]=f,n[11]=0,n[12]=i,n[13]=a,n[14]=o,n[15]=1,n}function l8t(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function u8t(n){return Math.hypot(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}function h8t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n}function V9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n}function c8t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n}function f8t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n[3]=e[3]+t[3]*r,n[4]=e[4]+t[4]*r,n[5]=e[5]+t[5]*r,n[6]=e[6]+t[6]*r,n[7]=e[7]+t[7]*r,n[8]=e[8]+t[8]*r,n[9]=e[9]+t[9]*r,n[10]=e[10]+t[10]*r,n[11]=e[11]+t[11]*r,n[12]=e[12]+t[12]*r,n[13]=e[13]+t[13]*r,n[14]=e[14]+t[14]*r,n[15]=e[15]+t[15]*r,n}function d8t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]&&n[8]===e[8]&&n[9]===e[9]&&n[10]===e[10]&&n[11]===e[11]&&n[12]===e[12]&&n[13]===e[13]&&n[14]===e[14]&&n[15]===e[15]}function v8t(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=n[6],u=n[7],h=n[8],c=n[9],f=n[10],d=n[11],v=n[12],p=n[13],g=n[14],m=n[15],y=e[0],_=e[1],x=e[2],S=e[3],w=e[4],b=e[5],E=e[6],T=e[7],C=e[8],A=e[9],M=e[10],I=e[11],R=e[12],k=e[13],D=e[14],G=e[15];return Math.abs(t-y)<=In*Math.max(1,Math.abs(t),Math.abs(y))&&Math.abs(r-_)<=In*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-x)<=In*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-S)<=In*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(o-w)<=In*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-b)<=In*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(l-E)<=In*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-T)<=In*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(h-C)<=In*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(c-A)<=In*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(f-M)<=In*Math.max(1,Math.abs(f),Math.abs(M))&&Math.abs(d-I)<=In*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(v-R)<=In*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(p-k)<=In*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(g-D)<=In*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(m-G)<=In*Math.max(1,Math.abs(m),Math.abs(G))}var p8t=N9e,g8t=V9e;const y8t=Object.freeze(Object.defineProperty({__proto__:null,create:IBt,clone:LBt,copy:PBt,fromValues:OBt,set:RBt,identity:D9e,transpose:DBt,invert:NBt,adjoint:kBt,determinant:FBt,multiply:N9e,translate:BBt,scale:GBt,rotate:zBt,rotateX:UBt,rotateY:VBt,rotateZ:$Bt,fromTranslation:WBt,fromScaling:HBt,fromRotation:jBt,fromXRotation:XBt,fromYRotation:YBt,fromZRotation:qBt,fromRotationTranslation:k9e,fromQuat2:ZBt,getTranslation:F9e,getScaling:B9e,getRotation:G9e,fromRotationTranslationScale:KBt,fromRotationTranslationScaleOrigin:JBt,fromQuat:QBt,frustum:e8t,perspectiveNO:z9e,perspective:t8t,perspectiveZO:r8t,perspectiveFromFieldOfView:n8t,orthoNO:U9e,ortho:i8t,orthoZO:a8t,lookAt:o8t,targetTo:s8t,str:l8t,frob:u8t,add:h8t,subtract:V9e,multiplyScalar:c8t,multiplyScalarAndAdd:f8t,exactEquals:d8t,equals:v8t,mul:p8t,sub:g8t},Symbol.toStringTag,{value:"Module"}));function Uoe(){var n=new ca(3);return ca!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function m8t(n){var e=new ca(3);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e}function $9e(n){var e=n[0],t=n[1],r=n[2];return Math.hypot(e,t,r)}function PQ(n,e,t){var r=new ca(3);return r[0]=n,r[1]=e,r[2]=t,r}function _8t(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n}function x8t(n,e,t,r){return n[0]=e,n[1]=t,n[2]=r,n}function S8t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n}function W9e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n}function H9e(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}function j9e(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n}function w8t(n,e){return n[0]=Math.ceil(e[0]),n[1]=Math.ceil(e[1]),n[2]=Math.ceil(e[2]),n}function b8t(n,e){return n[0]=Math.floor(e[0]),n[1]=Math.floor(e[1]),n[2]=Math.floor(e[2]),n}function E8t(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.min(e[2],t[2]),n}function T8t(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n}function C8t(n,e){return n[0]=Math.round(e[0]),n[1]=Math.round(e[1]),n[2]=Math.round(e[2]),n}function A8t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n}function M8t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n}function X9e(n,e){var t=e[0]-n[0],r=e[1]-n[1],i=e[2]-n[2];return Math.hypot(t,r,i)}function Y9e(n,e){var t=e[0]-n[0],r=e[1]-n[1],i=e[2]-n[2];return t*t+r*r+i*i}function q9e(n){var e=n[0],t=n[1],r=n[2];return e*e+t*t+r*r}function I8t(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}function L8t(n,e){return n[0]=1/e[0],n[1]=1/e[1],n[2]=1/e[2],n}function Z9e(n,e){var t=e[0],r=e[1],i=e[2],a=t*t+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n}function Voe(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function GB(n,e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return n[0]=i*l-a*s,n[1]=a*o-r*l,n[2]=r*s-i*o,n}function P8t(n,e,t,r){var i=e[0],a=e[1],o=e[2];return n[0]=i+r*(t[0]-i),n[1]=a+r*(t[1]-a),n[2]=o+r*(t[2]-o),n}function O8t(n,e,t,r,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),h=o*(3-2*a);return n[0]=e[0]*s+t[0]*l+r[0]*u+i[0]*h,n[1]=e[1]*s+t[1]*l+r[1]*u+i[1]*h,n[2]=e[2]*s+t[2]*l+r[2]*u+i[2]*h,n}function R8t(n,e,t,r,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,h=3*a*s,c=3*l*o,f=l*a;return n[0]=e[0]*u+t[0]*h+r[0]*c+i[0]*f,n[1]=e[1]*u+t[1]*h+r[1]*c+i[1]*f,n[2]=e[2]*u+t[2]*h+r[2]*c+i[2]*f,n}function D8t(n,e){e=e||1;var t=i0()*2*Math.PI,r=i0()*2-1,i=Math.sqrt(1-r*r)*e;return n[0]=Math.cos(t)*i,n[1]=Math.sin(t)*i,n[2]=r*e,n}function N8t(n,e,t){var r=e[0],i=e[1],a=e[2],o=t[3]*r+t[7]*i+t[11]*a+t[15];return o=o||1,n[0]=(t[0]*r+t[4]*i+t[8]*a+t[12])/o,n[1]=(t[1]*r+t[5]*i+t[9]*a+t[13])/o,n[2]=(t[2]*r+t[6]*i+t[10]*a+t[14])/o,n}function FU(n,e,t){var r=e[0],i=e[1],a=e[2];return n[0]=r*t[0]+i*t[3]+a*t[6],n[1]=r*t[1]+i*t[4]+a*t[7],n[2]=r*t[2]+i*t[5]+a*t[8],n}function k8t(n,e,t){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],h=i*u-a*l,c=a*s-r*u,f=r*l-i*s,d=i*f-a*c,v=a*h-r*f,p=r*c-i*h,g=o*2;return h*=g,c*=g,f*=g,d*=2,v*=2,p*=2,n[0]=s+h+d,n[1]=l+c+v,n[2]=u+f+p,n}function F8t(n,e,t,r){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),n[0]=a[0]+t[0],n[1]=a[1]+t[1],n[2]=a[2]+t[2],n}function B8t(n,e,t,r){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),n[0]=a[0]+t[0],n[1]=a[1]+t[1],n[2]=a[2]+t[2],n}function G8t(n,e,t,r){var i=[],a=[];return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],n[0]=a[0]+t[0],n[1]=a[1]+t[1],n[2]=a[2]+t[2],n}function z8t(n,e){var t=n[0],r=n[1],i=n[2],a=e[0],o=e[1],s=e[2],l=Math.sqrt(t*t+r*r+i*i),u=Math.sqrt(a*a+o*o+s*s),h=l*u,c=h&&Voe(n,e)/h;return Math.acos(Math.min(Math.max(c,-1),1))}function U8t(n){return n[0]=0,n[1]=0,n[2]=0,n}function V8t(n){return"vec3("+n[0]+", "+n[1]+", "+n[2]+")"}function $8t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]}function W8t(n,e){var t=n[0],r=n[1],i=n[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=In*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(r-o)<=In*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=In*Math.max(1,Math.abs(i),Math.abs(s))}var H8t=W9e,j8t=H9e,X8t=j9e,Y8t=X9e,q8t=Y9e,K9e=$9e,Z8t=q9e,K8t=function(){var n=Uoe();return function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),i?l=Math.min(i*t+r,e.length):l=e.length,s=r;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2];return e}}();const J8t=Object.freeze(Object.defineProperty({__proto__:null,create:Uoe,clone:m8t,length:$9e,fromValues:PQ,copy:_8t,set:x8t,add:S8t,subtract:W9e,multiply:H9e,divide:j9e,ceil:w8t,floor:b8t,min:E8t,max:T8t,round:C8t,scale:A8t,scaleAndAdd:M8t,distance:X9e,squaredDistance:Y9e,squaredLength:q9e,negate:I8t,inverse:L8t,normalize:Z9e,dot:Voe,cross:GB,lerp:P8t,hermite:O8t,bezier:R8t,random:D8t,transformMat4:N8t,transformMat3:FU,transformQuat:k8t,rotateX:F8t,rotateY:B8t,rotateZ:G8t,angle:z8t,zero:U8t,str:V8t,exactEquals:$8t,equals:W8t,sub:H8t,mul:j8t,div:X8t,dist:Y8t,sqrDist:q8t,len:K9e,sqrLen:Z8t,forEach:K8t},Symbol.toStringTag,{value:"Module"}));function J9e(){var n=new ca(4);return ca!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0),n}function Q9e(n){var e=new ca(4);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e}function e7e(n,e,t,r){var i=new ca(4);return i[0]=n,i[1]=e,i[2]=t,i[3]=r,i}function t7e(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n}function r7e(n,e,t,r,i){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function n7e(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n}function i7e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n}function a7e(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n[3]=e[3]*t[3],n}function o7e(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n[3]=e[3]/t[3],n}function Q8t(n,e){return n[0]=Math.ceil(e[0]),n[1]=Math.ceil(e[1]),n[2]=Math.ceil(e[2]),n[3]=Math.ceil(e[3]),n}function eGt(n,e){return n[0]=Math.floor(e[0]),n[1]=Math.floor(e[1]),n[2]=Math.floor(e[2]),n[3]=Math.floor(e[3]),n}function tGt(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n[2]=Math.min(e[2],t[2]),n[3]=Math.min(e[3],t[3]),n}function rGt(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n[2]=Math.max(e[2],t[2]),n[3]=Math.max(e[3],t[3]),n}function nGt(n,e){return n[0]=Math.round(e[0]),n[1]=Math.round(e[1]),n[2]=Math.round(e[2]),n[3]=Math.round(e[3]),n}function s7e(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function iGt(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n[3]=e[3]+t[3]*r,n}function l7e(n,e){var t=e[0]-n[0],r=e[1]-n[1],i=e[2]-n[2],a=e[3]-n[3];return Math.hypot(t,r,i,a)}function u7e(n,e){var t=e[0]-n[0],r=e[1]-n[1],i=e[2]-n[2],a=e[3]-n[3];return t*t+r*r+i*i+a*a}function $oe(n){var e=n[0],t=n[1],r=n[2],i=n[3];return Math.hypot(e,t,r,i)}function Woe(n){var e=n[0],t=n[1],r=n[2],i=n[3];return e*e+t*t+r*r+i*i}function aGt(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n}function oGt(n,e){return n[0]=1/e[0],n[1]=1/e[1],n[2]=1/e[2],n[3]=1/e[3],n}function h7e(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t*t+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=r*o,n[2]=i*o,n[3]=a*o,n}function c7e(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}function sGt(n,e,t,r){var i=t[0]*r[1]-t[1]*r[0],a=t[0]*r[2]-t[2]*r[0],o=t[0]*r[3]-t[3]*r[0],s=t[1]*r[2]-t[2]*r[1],l=t[1]*r[3]-t[3]*r[1],u=t[2]*r[3]-t[3]*r[2],h=e[0],c=e[1],f=e[2],d=e[3];return n[0]=c*u-f*l+d*s,n[1]=-(h*u)+f*o-d*a,n[2]=h*l-c*o+d*i,n[3]=-(h*s)+c*a-f*i,n}function f7e(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=e[3];return n[0]=i+r*(t[0]-i),n[1]=a+r*(t[1]-a),n[2]=o+r*(t[2]-o),n[3]=s+r*(t[3]-s),n}function lGt(n,e){e=e||1;var t,r,i,a,o,s;do t=i0()*2-1,r=i0()*2-1,o=t*t+r*r;while(o>=1);do i=i0()*2-1,a=i0()*2-1,s=i*i+a*a;while(s>=1);var l=Math.sqrt((1-o)/s);return n[0]=e*t,n[1]=e*r,n[2]=e*i*l,n[3]=e*a*l,n}function uGt(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3];return n[0]=t[0]*r+t[4]*i+t[8]*a+t[12]*o,n[1]=t[1]*r+t[5]*i+t[9]*a+t[13]*o,n[2]=t[2]*r+t[6]*i+t[10]*a+t[14]*o,n[3]=t[3]*r+t[7]*i+t[11]*a+t[15]*o,n}function hGt(n,e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2],u=t[3],h=u*r+s*a-l*i,c=u*i+l*r-o*a,f=u*a+o*i-s*r,d=-o*r-s*i-l*a;return n[0]=h*u+d*-o+c*-l-f*-s,n[1]=c*u+d*-s+f*-o-h*-l,n[2]=f*u+d*-l+h*-s-c*-o,n[3]=e[3],n}function cGt(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n}function fGt(n){return"vec4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}function d7e(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]}function v7e(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=e[0],s=e[1],l=e[2],u=e[3];return Math.abs(t-o)<=In*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(r-s)<=In*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=In*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=In*Math.max(1,Math.abs(a),Math.abs(u))}var dGt=i7e,vGt=a7e,pGt=o7e,gGt=l7e,yGt=u7e,mGt=$oe,_Gt=Woe,xGt=function(){var n=J9e();return function(e,t,r,i,a,o){var s,l;for(t||(t=4),r||(r=0),i?l=Math.min(i*t+r,e.length):l=e.length,s=r;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],n[3]=e[s+3],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2],e[s+3]=n[3];return e}}();const SGt=Object.freeze(Object.defineProperty({__proto__:null,create:J9e,clone:Q9e,fromValues:e7e,copy:t7e,set:r7e,add:n7e,subtract:i7e,multiply:a7e,divide:o7e,ceil:Q8t,floor:eGt,min:tGt,max:rGt,round:nGt,scale:s7e,scaleAndAdd:iGt,distance:l7e,squaredDistance:u7e,length:$oe,squaredLength:Woe,negate:aGt,inverse:oGt,normalize:h7e,dot:c7e,cross:sGt,lerp:f7e,random:lGt,transformMat4:uGt,transformQuat:hGt,zero:cGt,str:fGt,exactEquals:d7e,equals:v7e,sub:dGt,mul:vGt,div:pGt,dist:gGt,sqrDist:yGt,len:mGt,sqrLen:_Gt,forEach:xGt},Symbol.toStringTag,{value:"Module"}));function h9(){var n=new ca(4);return ca!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function wGt(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function p7e(n,e,t){t=t*.5;var r=Math.sin(t);return n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=Math.cos(t),n}function bGt(n,e){var t=Math.acos(e[3])*2,r=Math.sin(t/2);return r>In?(n[0]=e[0]/r,n[1]=e[1]/r,n[2]=e[2]/r):(n[0]=1,n[1]=0,n[2]=0),t}function EGt(n,e){var t=joe(n,e);return Math.acos(2*t*t-1)}function g7e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],h=t[3];return n[0]=r*h+o*s+i*u-a*l,n[1]=i*h+o*l+a*s-r*u,n[2]=a*h+o*u+r*l-i*s,n[3]=o*h-r*s-i*l-a*u,n}function y7e(n,e,t){t*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l+o*s,n[1]=i*l+a*s,n[2]=a*l-i*s,n[3]=o*l-r*s,n}function m7e(n,e,t){t*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l-a*s,n[1]=i*l+o*s,n[2]=a*l+r*s,n[3]=o*l-i*s,n}function _7e(n,e,t){t*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return n[0]=r*l+i*s,n[1]=i*l-r*s,n[2]=a*l+o*s,n[3]=o*l-a*s,n}function TGt(n,e){var t=e[0],r=e[1],i=e[2];return n[0]=t,n[1]=r,n[2]=i,n[3]=Math.sqrt(Math.abs(1-t*t-r*r-i*i)),n}function x7e(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+r*r+i*i),s=Math.exp(a),l=o>0?s*Math.sin(o)/o:0;return n[0]=t*l,n[1]=r*l,n[2]=i*l,n[3]=s*Math.cos(o),n}function S7e(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(t*t+r*r+i*i),s=o>0?Math.atan2(o,a)/o:0;return n[0]=t*s,n[1]=r*s,n[2]=i*s,n[3]=.5*Math.log(t*t+r*r+i*i+a*a),n}function CGt(n,e,t){return S7e(n,e),b7e(n,n,t),x7e(n,n),n}function zB(n,e,t,r){var i=e[0],a=e[1],o=e[2],s=e[3],l=t[0],u=t[1],h=t[2],c=t[3],f,d,v,p,g;return d=i*l+a*u+o*h+s*c,d<0&&(d=-d,l=-l,u=-u,h=-h,c=-c),1-d>In?(f=Math.acos(d),v=Math.sin(f),p=Math.sin((1-r)*f)/v,g=Math.sin(r*f)/v):(p=1-r,g=r),n[0]=p*i+g*l,n[1]=p*a+g*u,n[2]=p*o+g*h,n[3]=p*s+g*c,n}function AGt(n){var e=i0(),t=i0(),r=i0(),i=Math.sqrt(1-e),a=Math.sqrt(e);return n[0]=i*Math.sin(2*Math.PI*t),n[1]=i*Math.cos(2*Math.PI*t),n[2]=a*Math.sin(2*Math.PI*r),n[3]=a*Math.cos(2*Math.PI*r),n}function MGt(n,e){var t=e[0],r=e[1],i=e[2],a=e[3],o=t*t+r*r+i*i+a*a,s=o?1/o:0;return n[0]=-t*s,n[1]=-r*s,n[2]=-i*s,n[3]=a*s,n}function IGt(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n}function w7e(n,e){var t=e[0]+e[4]+e[8],r;if(t>0)r=Math.sqrt(t+1),n[3]=.5*r,r=.5/r,n[0]=(e[5]-e[7])*r,n[1]=(e[6]-e[2])*r,n[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),n[i]=.5*r,r=.5/r,n[3]=(e[a*3+o]-e[o*3+a])*r,n[a]=(e[a*3+i]+e[i*3+a])*r,n[o]=(e[o*3+i]+e[i*3+o])*r}return n}function LGt(n,e,t,r){var i=.5*Math.PI/180;e*=i,t*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(t),l=Math.cos(t),u=Math.sin(r),h=Math.cos(r);return n[0]=a*l*h-o*s*u,n[1]=o*s*h+a*l*u,n[2]=o*l*u-a*s*h,n[3]=o*l*h+a*s*u,n}function PGt(n){return"quat("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}var OGt=Q9e,RGt=e7e,Hoe=t7e,DGt=r7e,NGt=n7e,kGt=g7e,b7e=s7e,joe=c7e,FGt=f7e,Xoe=$oe,BGt=Xoe,Yoe=Woe,GGt=Yoe,qoe=h7e,zGt=d7e,UGt=v7e,VGt=function(){var n=Uoe(),e=PQ(1,0,0),t=PQ(0,1,0);return function(r,i,a){var o=Voe(i,a);return o<-.999999?(GB(n,e,i),K9e(n)<1e-6&&GB(n,t,i),Z9e(n,n),p7e(r,n,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(GB(n,i,a),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=1+o,qoe(r,r))}}(),$Gt=function(){var n=h9(),e=h9();return function(t,r,i,a,o,s){return zB(n,r,o,s),zB(e,i,a,s),zB(t,n,e,2*s*(1-s)),t}}(),WGt=function(){var n=P9e();return function(e,t,r,i){return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-t[0],n[5]=-t[1],n[8]=-t[2],qoe(e,w7e(e,n))}}();const HGt=Object.freeze(Object.defineProperty({__proto__:null,create:h9,identity:wGt,setAxisAngle:p7e,getAxisAngle:bGt,getAngle:EGt,multiply:g7e,rotateX:y7e,rotateY:m7e,rotateZ:_7e,calculateW:TGt,exp:x7e,ln:S7e,pow:CGt,slerp:zB,random:AGt,invert:MGt,conjugate:IGt,fromMat3:w7e,fromEuler:LGt,str:PGt,clone:OGt,fromValues:RGt,copy:Hoe,set:DGt,add:NGt,mul:kGt,scale:b7e,dot:joe,lerp:FGt,length:Xoe,len:BGt,squaredLength:Yoe,sqrLen:GGt,normalize:qoe,exactEquals:zGt,equals:UGt,rotationTo:VGt,sqlerp:$Gt,setAxes:WGt},Symbol.toStringTag,{value:"Module"}));function jGt(){var n=new ca(8);return ca!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0),n[3]=1,n}function XGt(n){var e=new ca(8);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e}function YGt(n,e,t,r,i,a,o,s){var l=new ca(8);return l[0]=n,l[1]=e,l[2]=t,l[3]=r,l[4]=i,l[5]=a,l[6]=o,l[7]=s,l}function qGt(n,e,t,r,i,a,o){var s=new ca(8);s[0]=n,s[1]=e,s[2]=t,s[3]=r;var l=i*.5,u=a*.5,h=o*.5;return s[4]=l*r+u*t-h*e,s[5]=u*r+h*n-l*t,s[6]=h*r+l*e-u*n,s[7]=-l*n-u*e-h*t,s}function E7e(n,e,t){var r=t[0]*.5,i=t[1]*.5,a=t[2]*.5,o=e[0],s=e[1],l=e[2],u=e[3];return n[0]=o,n[1]=s,n[2]=l,n[3]=u,n[4]=r*u+i*l-a*s,n[5]=i*u+a*o-r*l,n[6]=a*u+r*s-i*o,n[7]=-r*o-i*s-a*l,n}function ZGt(n,e){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n[4]=e[0]*.5,n[5]=e[1]*.5,n[6]=e[2]*.5,n[7]=0,n}function KGt(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=0,n[5]=0,n[6]=0,n[7]=0,n}function JGt(n,e){var t=h9();G9e(t,e);var r=new ca(3);return F9e(r,e),E7e(n,t,r),n}function T7e(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n}function QGt(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n}function e9t(n,e,t,r,i,a,o,s,l){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n[6]=s,n[7]=l,n}var t9t=Hoe;function r9t(n,e){return n[0]=e[4],n[1]=e[5],n[2]=e[6],n[3]=e[7],n}var n9t=Hoe;function i9t(n,e){return n[4]=e[0],n[5]=e[1],n[6]=e[2],n[7]=e[3],n}function a9t(n,e){var t=e[4],r=e[5],i=e[6],a=e[7],o=-e[0],s=-e[1],l=-e[2],u=e[3];return n[0]=(t*u+a*o+r*l-i*s)*2,n[1]=(r*u+a*s+i*o-t*l)*2,n[2]=(i*u+a*l+t*s-r*o)*2,n}function o9t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0]*.5,l=t[1]*.5,u=t[2]*.5,h=e[4],c=e[5],f=e[6],d=e[7];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=o*s+i*u-a*l+h,n[5]=o*l+a*s-r*u+c,n[6]=o*u+r*l-i*s+f,n[7]=-r*s-i*l-a*u+d,n}function s9t(n,e,t){var r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=s*o+h*r+l*a-u*i,f=l*o+h*i+u*r-s*a,d=u*o+h*a+s*i-l*r,v=h*o-s*r-l*i-u*a;return y7e(n,e,t),r=n[0],i=n[1],a=n[2],o=n[3],n[4]=c*o+v*r+f*a-d*i,n[5]=f*o+v*i+d*r-c*a,n[6]=d*o+v*a+c*i-f*r,n[7]=v*o-c*r-f*i-d*a,n}function l9t(n,e,t){var r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=s*o+h*r+l*a-u*i,f=l*o+h*i+u*r-s*a,d=u*o+h*a+s*i-l*r,v=h*o-s*r-l*i-u*a;return m7e(n,e,t),r=n[0],i=n[1],a=n[2],o=n[3],n[4]=c*o+v*r+f*a-d*i,n[5]=f*o+v*i+d*r-c*a,n[6]=d*o+v*a+c*i-f*r,n[7]=v*o-c*r-f*i-d*a,n}function u9t(n,e,t){var r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=s*o+h*r+l*a-u*i,f=l*o+h*i+u*r-s*a,d=u*o+h*a+s*i-l*r,v=h*o-s*r-l*i-u*a;return _7e(n,e,t),r=n[0],i=n[1],a=n[2],o=n[3],n[4]=c*o+v*r+f*a-d*i,n[5]=f*o+v*i+d*r-c*a,n[6]=d*o+v*a+c*i-f*r,n[7]=v*o-c*r-f*i-d*a,n}function h9t(n,e,t){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],h=e[3];return n[0]=s*o+h*r+l*a-u*i,n[1]=l*o+h*i+u*r-s*a,n[2]=u*o+h*a+s*i-l*r,n[3]=h*o-s*r-l*i-u*a,s=e[4],l=e[5],u=e[6],h=e[7],n[4]=s*o+h*r+l*a-u*i,n[5]=l*o+h*i+u*r-s*a,n[6]=u*o+h*a+s*i-l*r,n[7]=h*o-s*r-l*i-u*a,n}function c9t(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[0],l=t[1],u=t[2],h=t[3];return n[0]=r*h+o*s+i*u-a*l,n[1]=i*h+o*l+a*s-r*u,n[2]=a*h+o*u+r*l-i*s,n[3]=o*h-r*s-i*l-a*u,s=t[4],l=t[5],u=t[6],h=t[7],n[4]=r*h+o*s+i*u-a*l,n[5]=i*h+o*l+a*s-r*u,n[6]=a*h+o*u+r*l-i*s,n[7]=o*h-r*s-i*l-a*u,n}function f9t(n,e,t,r){if(Math.abs(r)<In)return T7e(n,e);var i=Math.hypot(t[0],t[1],t[2]);r=r*.5;var a=Math.sin(r),o=a*t[0]/i,s=a*t[1]/i,l=a*t[2]/i,u=Math.cos(r),h=e[0],c=e[1],f=e[2],d=e[3];n[0]=h*u+d*o+c*l-f*s,n[1]=c*u+d*s+f*o-h*l,n[2]=f*u+d*l+h*s-c*o,n[3]=d*u-h*o-c*s-f*l;var v=e[4],p=e[5],g=e[6],m=e[7];return n[4]=v*u+m*o+p*l-g*s,n[5]=p*u+m*s+g*o-v*l,n[6]=g*u+m*l+v*s-p*o,n[7]=m*u-v*o-p*s-g*l,n}function d9t(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n}function C7e(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t[4],l=t[5],u=t[6],h=t[7],c=e[4],f=e[5],d=e[6],v=e[7],p=t[0],g=t[1],m=t[2],y=t[3];return n[0]=r*y+o*p+i*m-a*g,n[1]=i*y+o*g+a*p-r*m,n[2]=a*y+o*m+r*g-i*p,n[3]=o*y-r*p-i*g-a*m,n[4]=r*h+o*s+i*u-a*l+c*y+v*p+f*m-d*g,n[5]=i*h+o*l+a*s-r*u+f*y+v*g+d*p-c*m,n[6]=a*h+o*u+r*l-i*s+d*y+v*m+c*g-f*p,n[7]=o*h-r*s-i*l-a*u+v*y-c*p-f*g-d*m,n}var v9t=C7e;function p9t(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n}var A7e=joe;function g9t(n,e,t,r){var i=1-r;return A7e(e,t)<0&&(r=-r),n[0]=e[0]*i+t[0]*r,n[1]=e[1]*i+t[1]*r,n[2]=e[2]*i+t[2]*r,n[3]=e[3]*i+t[3]*r,n[4]=e[4]*i+t[4]*r,n[5]=e[5]*i+t[5]*r,n[6]=e[6]*i+t[6]*r,n[7]=e[7]*i+t[7]*r,n}function y9t(n,e){var t=BU(e);return n[0]=-e[0]/t,n[1]=-e[1]/t,n[2]=-e[2]/t,n[3]=e[3]/t,n[4]=-e[4]/t,n[5]=-e[5]/t,n[6]=-e[6]/t,n[7]=e[7]/t,n}function m9t(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=e[7],n}var M7e=Xoe,_9t=M7e,BU=Yoe,x9t=BU;function S9t(n,e){var t=BU(e);if(t>0){t=Math.sqrt(t);var r=e[0]/t,i=e[1]/t,a=e[2]/t,o=e[3]/t,s=e[4],l=e[5],u=e[6],h=e[7],c=r*s+i*l+a*u+o*h;n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=(s-r*c)/t,n[5]=(l-i*c)/t,n[6]=(u-a*c)/t,n[7]=(h-o*c)/t}return n}function w9t(n){return"quat2("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+")"}function b9t(n,e){return n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]}function E9t(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=n[6],u=n[7],h=e[0],c=e[1],f=e[2],d=e[3],v=e[4],p=e[5],g=e[6],m=e[7];return Math.abs(t-h)<=In*Math.max(1,Math.abs(t),Math.abs(h))&&Math.abs(r-c)<=In*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-f)<=In*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-d)<=In*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-v)<=In*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=In*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(l-g)<=In*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-m)<=In*Math.max(1,Math.abs(u),Math.abs(m))}const T9t=Object.freeze(Object.defineProperty({__proto__:null,create:jGt,clone:XGt,fromValues:YGt,fromRotationTranslationValues:qGt,fromRotationTranslation:E7e,fromTranslation:ZGt,fromRotation:KGt,fromMat4:JGt,copy:T7e,identity:QGt,set:e9t,getReal:t9t,getDual:r9t,setReal:n9t,setDual:i9t,getTranslation:a9t,translate:o9t,rotateX:s9t,rotateY:l9t,rotateZ:u9t,rotateByQuatAppend:h9t,rotateByQuatPrepend:c9t,rotateAroundAxis:f9t,add:d9t,multiply:C7e,mul:v9t,scale:p9t,dot:A7e,lerp:g9t,invert:y9t,conjugate:m9t,length:M7e,len:_9t,squaredLength:BU,sqrLen:x9t,normalize:S9t,str:w9t,exactEquals:b9t,equals:E9t},Symbol.toStringTag,{value:"Module"}));function I7e(){var n=new ca(2);return ca!=Float32Array&&(n[0]=0,n[1]=0),n}function C9t(n){var e=new ca(2);return e[0]=n[0],e[1]=n[1],e}function A9t(n,e){var t=new ca(2);return t[0]=n,t[1]=e,t}function M9t(n,e){return n[0]=e[0],n[1]=e[1],n}function I9t(n,e,t){return n[0]=e,n[1]=t,n}function Oh(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n}function L7e(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function P7e(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n}function O7e(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n}function L9t(n,e){return n[0]=Math.ceil(e[0]),n[1]=Math.ceil(e[1]),n}function P9t(n,e){return n[0]=Math.floor(e[0]),n[1]=Math.floor(e[1]),n}function Ax(n,e,t){return n[0]=Math.min(e[0],t[0]),n[1]=Math.min(e[1],t[1]),n}function Mx(n,e,t){return n[0]=Math.max(e[0],t[0]),n[1]=Math.max(e[1],t[1]),n}function O9t(n,e){return n[0]=Math.round(e[0]),n[1]=Math.round(e[1]),n}function Gc(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n}function R9t(n,e,t,r){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n}function c9(n,e){var t=e[0]-n[0],r=e[1]-n[1];return Math.hypot(t,r)}function R7e(n,e){var t=e[0]-n[0],r=e[1]-n[1];return t*t+r*r}function D7e(n){var e=n[0],t=n[1];return Math.hypot(e,t)}function N7e(n){var e=n[0],t=n[1];return e*e+t*t}function D9t(n,e){return n[0]=-e[0],n[1]=-e[1],n}function N9t(n,e){return n[0]=1/e[0],n[1]=1/e[1],n}function SS(n,e){var t=e[0],r=e[1],i=t*t+r*r;return i>0&&(i=1/Math.sqrt(i)),n[0]=e[0]*i,n[1]=e[1]*i,n}function Zoe(n,e){return n[0]*e[0]+n[1]*e[1]}function k9t(n,e,t){var r=e[0]*t[1]-e[1]*t[0];return n[0]=n[1]=0,n[2]=r,n}function F9t(n,e,t,r){var i=e[0],a=e[1];return n[0]=i+r*(t[0]-i),n[1]=a+r*(t[1]-a),n}function B9t(n,e){e=e||1;var t=i0()*2*Math.PI;return n[0]=Math.cos(t)*e,n[1]=Math.sin(t)*e,n}function G9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[2]*i,n[1]=t[1]*r+t[3]*i,n}function z9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[2]*i+t[4],n[1]=t[1]*r+t[3]*i+t[5],n}function U9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function V9t(n,e,t){var r=e[0],i=e[1];return n[0]=t[0]*r+t[4]*i+t[12],n[1]=t[1]*r+t[5]*i+t[13],n}function $9t(n,e,t,r){var i=e[0]-t[0],a=e[1]-t[1],o=Math.sin(r),s=Math.cos(r);return n[0]=i*s-a*o+t[0],n[1]=i*o+a*s+t[1],n}function k7e(n,e){var t=n[0],r=n[1],i=e[0],a=e[1],o=Math.sqrt(t*t+r*r)*Math.sqrt(i*i+a*a),s=o&&(t*i+r*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function W9t(n){return n[0]=0,n[1]=0,n}function H9t(n){return"vec2("+n[0]+", "+n[1]+")"}function Koe(n,e){return n[0]===e[0]&&n[1]===e[1]}function j9t(n,e){var t=n[0],r=n[1],i=e[0],a=e[1];return Math.abs(t-i)<=In*Math.max(1,Math.abs(t),Math.abs(i))&&Math.abs(r-a)<=In*Math.max(1,Math.abs(r),Math.abs(a))}var X9t=D7e,UB=L7e,Y9t=P7e,q9t=O7e,Z9t=c9,K9t=R7e,J9t=N7e,Q9t=function(){var n=I7e();return function(e,t,r,i,a,o){var s,l;for(t||(t=2),r||(r=0),i?l=Math.min(i*t+r,e.length):l=e.length,s=r;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],a(n,n,o),e[s]=n[0],e[s+1]=n[1];return e}}();const e7t=Object.freeze(Object.defineProperty({__proto__:null,create:I7e,clone:C9t,fromValues:A9t,copy:M9t,set:I9t,add:Oh,subtract:L7e,multiply:P7e,divide:O7e,ceil:L9t,floor:P9t,min:Ax,max:Mx,round:O9t,scale:Gc,scaleAndAdd:R9t,distance:c9,squaredDistance:R7e,length:D7e,squaredLength:N7e,negate:D9t,inverse:N9t,normalize:SS,dot:Zoe,cross:k9t,lerp:F9t,random:B9t,transformMat2:G9t,transformMat2d:z9t,transformMat3:U9t,transformMat4:V9t,rotate:$9t,angle:k7e,zero:W9t,str:H9t,exactEquals:Koe,equals:j9t,len:X9t,sub:UB,mul:Y9t,div:q9t,dist:Z9t,sqrDist:K9t,sqrLen:J9t,forEach:Q9t},Symbol.toStringTag,{value:"Module"})),t7t=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:l6t,mat2:R6t,mat2d:nBt,mat3:R9e,mat4:y8t,quat:HGt,quat2:T9t,vec2:e7t,vec3:J8t,vec4:SGt},Symbol.toStringTag,{value:"Module"}));function r7t(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return Boe(r,t),Om(n,r,e)}function n7t(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return Goe(r,t),Om(n,r,e)}function i7t(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return zoe(r,t),Om(n,r,e)}function a7t(n,e,t){return Om(n,t,e)}function sg(n,e){for(var t=n?[].concat(n):[1,0,0,0,1,0,0,0,1],r=0,i=e.length;r<i;r++){var a=e[r];switch(a[0]){case"t":r7t(t,t,[a[1],a[2]]);break;case"s":i7t(t,t,[a[1],a[2]]);break;case"r":n7t(t,t,a[1]);break;case"m":a7t(t,t,a[1]);break}}return t}var i2=function(e,t){var r=e.nodes,i=e.edges,a=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,h=o[l],c=o[u];!h&&h!==0||!c&&c!==0||(a[h][c]=1,t||(a[c][h]=1))}),a},o7t=function(e,t){return e===t},oxe=function(){function n(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return n.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},n}(),F7e=function(){function n(e){e===void 0&&(e=o7t),this.head=null,this.tail=null,this.compare=e}return n.prototype.prepend=function(e){var t=new oxe(e,this.head);return this.head=t,this.tail||(this.tail=t),this},n.prototype.append=function(e){var t=new oxe(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},n.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var r=this.head;if(r!==null)for(;r.next;)this.compare(r.next.value,e)?(t=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,e)&&(this.tail=r),t},n.prototype.find=function(e){var t=e.value,r=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||r!==void 0&&this.compare(o.value,r))return o;o=o.next}return null},n.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},n.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},n.prototype.fromArray=function(e){var t=this;return e.forEach(function(r){return t.append(r)}),this},n.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},n.prototype.reverse=function(){for(var e=this.head,t=null,r=null;e;)r=e.next,e.next=t,t=e,e=r;this.tail=this.head,this.head=t},n.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},n}(),s7t=function(){function n(){this.linkedList=new F7e}return n.prototype.isEmpty=function(){return!this.linkedList.head},n.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},n.prototype.enqueue=function(e){this.linkedList.append(e)},n.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},n.prototype.toString=function(e){return this.linkedList.toString(e)},n}(),cv=function(e,t,r){t===void 0&&(t=[]);var i=t.filter(function(l){return l.source===e||l.target===e});if(r==="target"){var a=function(u){return u.source===e};return i.filter(a).map(function(l){return l.target})}if(r==="source"){var o=function(u){return u.target===e};return i.filter(o).map(function(l){return l.source})}var s=function(u){return u.source===e?u.target:u.source};return i.map(s)},l7t=function(e,t){return t.filter(function(r){return r.source===e})},VB=function(e,t){return t.filter(function(r){return r.source===e||r.target===e})},B7e=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),r="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(r)};function u7t(n){n===void 0&&(n={});var e=n,t=function(){},r=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=n.allowTraversal||r,e.enter=n.enter||t,e.leave=n.leave||t,e}var G7e=function(e,t,r,i){i===void 0&&(i=!0);var a=u7t(r),o=new s7t,s=e.edges,l=s===void 0?[]:s;o.enqueue(t);for(var u="",h=function(){var f=o.dequeue();a.enter({current:f,previous:u}),cv(f,l,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:u,current:f,next:d})&&o.enqueue(d)}),a.leave({current:f,previous:u}),u=f};!o.isEmpty();)h()},h7t=function(e){for(var t=e.nodes,r=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l=[],u=function d(v){l.push(v),s[v.id]=!0;for(var p=cv(v.id,a),g=function(_){var x=p[_];if(!s[x]){var S=r.filter(function(w){return w.id===x});S.length>0&&d(S[0])}},m=0;m<p.length;++m)g(m)},h=0;h<r.length;h++){var c=r[h];if(!s[c.id]){u(c);for(var f=[];l.length>0;)f.push(l.pop());o.push(f)}}return o},z7e=function(e){for(var t=e.nodes,r=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},h=[],c=0,f=function g(m){l[m.id]=c,u[m.id]=c,c+=1,o.push(m),s[m.id]=!0;for(var y=cv(m.id,a,"target").filter(function(b){return r.map(function(E){return E.id}).indexOf(b)>-1}),_=function(E){var T=y[E];if(!l[T]&&l[T]!==0){var C=r.filter(function(A){return A.id===T});C.length>0&&g(C[0]),u[m.id]=Math.min(u[m.id],u[T])}else s[T]&&(u[m.id]=Math.min(u[m.id],l[T]))},x=0;x<y.length;x++)_(x);if(u[m.id]===l[m.id]){for(var S=[];o.length>0;){var w=o.pop();if(s[w.id]=!1,S.push(w),w===m)break}S.length>0&&h.push(S)}},d=0,v=r;d<v.length;d++){var p=v[d];!l[p.id]&&l[p.id]!==0&&f(p)}return h};function Joe(n,e){return e?z7e(n):h7t(n)}var g_=function(e){var t={},r=e.nodes,i=r===void 0?[]:r,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},U7e=function(e,t){var r=g_(e);return r[t]?g_(e)[t].inDegree:0},V7e=function(e,t){var r=g_(e);return r[t]?g_(e)[t].outDegree:0};function c7t(n){n===void 0&&(n={});var e=n,t=function(){},r=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=n.allowTraversal||r,e.enter=n.enter||t,e.leave=n.leave||t,e}function $7e(n,e,t,r,i){i===void 0&&(i=!0),r.enter({current:e,previous:t});var a=n.edges,o=a===void 0?[]:a;cv(e,o,i?"target":void 0).forEach(function(s){r.allowTraversal({previous:t,current:e,next:s})&&$7e(n,s,e,r,i)}),r.leave({current:e,previous:t})}function Qoe(n,e,t,r){r===void 0&&(r=!0),$7e(n,e,"",c7t(t),r)}var ese=function(e){var t=null,r=e.nodes,i=r===void 0?[]:r,a={},o={},s={},l={};i.forEach(function(c){o[c.id]=c});for(var u={enter:function(f){var d=f.current,v=f.previous;if(s[d]){t={};for(var p=d,g=v;g!==d;)t[p]=g,p=g,g=a[g];t[p]=g}else s[d]=d,delete o[d],a[d]=v},leave:function(f){var d=f.current;l[d]=d,delete s[d]},allowTraversal:function(f){var d=f.next;return t?!1:!l[d]}};Object.keys(o).length;){var h=Object.keys(o)[0];Qoe(e,h,u)}return t},tse=function(e,t,r){var i,a;r===void 0&&(r=!0);for(var o=[],s=Joe(e,!1),l=0,u=s;l<u.length;l++){var h=u[l];if(!!h.length)for(var c=h[0],f=c.id,d=[c],v=(i={},i[f]=c,i),p=(a={},a[f]=new Set,a);d.length>0;)for(var g=d.pop(),m=g.id,y=cv(m,e.edges),_=function(w){var b,E=y[w],T=e.nodes.find(function(k){return k.id===E});if(E===m)o.push((b={},b[E]=g,b));else if(!(E in p))v[E]=g,d.push(T),p[E]=new Set([g]);else if(!p[m].has(T)){for(var C=!0,A=[T,g],M=v[m];p[E].size&&!p[E].has(M)&&(A.push(M),M!==v[M.id]);)M=v[M.id];if(A.push(M),t&&r?(C=!1,A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!0)):t&&!r&&A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!1),C){for(var I={},R=1;R<A.length;R+=1)I[A[R-1].id]=A[R];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[E].add(g)}},x=0;x<y.length;x+=1)_(x)}return o},rse=function(e,t,r){r===void 0&&(r=!0);for(var i=[],a=new Set,o=[],s=[],l={},u={},h=function(M){for(var I=[M];I.length>0;){var R=I.pop();a.has(R)&&(a.delete(R),o[R.id].forEach(function(k){I.push(k)}),o[R.id].clear())}},c=function A(M,I,R){var k=!1;if(t&&r===!1&&t.indexOf(M.id)>-1)return k;i.push(M),a.add(M);for(var D=R[M.id],G=0;G<D.length;G+=1){var W=l[D[G]];if(W===I){for(var z={},V=1;V<i.length;V+=1)z[i[V-1].id]=i[V];i.length&&(z[i[i.length-1].id]=i[0]),s.push(z),k=!0}else a.has(W)||A(W,I,R)&&(k=!0)}if(k)h(M);else for(var G=0;G<D.length;G+=1){var W=l[D[G]];o[W.id].has(M)||o[W.id].add(M)}return i.pop(),k},f=e.nodes,d=f===void 0?[]:f,v=0;v<d.length;v+=1){var p=d[v],g=p.id;u[g]=v,l[v]=p}if(t&&r)for(var m=function(M){var I=t[M];u[d[M].id]=u[I],u[I]=0,l[0]=d.find(function(R){return R.id===I}),l[u[d[M].id]]=d[M]},v=0;v<t.length;v++)m(v);for(var y=function(M){for(var I,R,k=1/0,D=0;D<M.length;D+=1)for(var G=M[D],W=0;W<G.length;W++){var z=u[G[W].id];z<k&&(k=z,R=D)}for(var V=M[R],q=[],D=0;D<V.length;D+=1){var Y=V[D];q[Y.id]=[];for(var le=0,j=cv(Y.id,e.edges,"target").filter(function(oe){return V.map(function(se){return se.id}).indexOf(oe)>-1});le<j.length;le++){var Q=j[le];Q===Y.id&&!(r===!1&&t.indexOf(Y.id)>-1)?s.push((I={},I[Y.id]=Y,I)):q[Y.id].push(u[Q])}}return{component:V,adjList:q,minIdx:k}},_=0;_<d.length;){var x=d.filter(function(A){return u[A.id]>=_}),S=z7e({nodes:x,edges:e.edges}).filter(function(A){return A.length>1});if(S.length===0)break;var w=y(S),b=w.minIdx,E=w.adjList,T=w.component;if(T.length>1){T.forEach(function(A){o[A.id]=new Set});var C=l[b];if(t&&r&&t.indexOf(C.id)===-1)return s;c(C,C,E),_=b+1}else break}return s},W7e=function(e,t,r,i){return i===void 0&&(i=!0),t?rse(e,r,i):tse(e,r,i)},f7t=function(e,t,r){for(var i=1/0,a,o=0;o<t.length;o++){var s=t[o].id;!r[s]&&e[s]<=i&&(i=e[s],a=t[o])}return a},BD=function(e,t,r,i){var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},h={},c={};o.forEach(function(y,_){var x=y.id;h[x]=1/0,x===t&&(h[x]=0)});for(var f=o.length,d=function(_){var x=f7t(h,o,u),S=x.id;if(u[S]=!0,h[S]===1/0)return"continue";var w=[];r?w=l7t(S,l):w=VB(S,l),w.forEach(function(b){var E=b.target,T=b.source,C=E===S?T:E,A=i&&b[i]?b[i]:1;h[C]>h[x.id]+A?(h[C]=h[x.id]+A,c[C]=[x.id]):h[C]===h[x.id]+A&&c[C].push(x.id)})},v=0;v<f;v++)d();c[t]=[t];var p={};for(var g in h)h[g]!==1/0&&H7e(t,g,c,p);var m={};for(var g in p)m[g]=p[g][0];return{length:h,path:m,allPath:p}};function H7e(n,e,t,r){if(n===e)return[n];if(r[e])return r[e];for(var i=[],a=0,o=t[e];a<o.length;a++){var s=o[a],l=H7e(n,s,t,r);if(!l)return;for(var u=0,h=l;u<h.length;u++){var c=h[u];vn(c)?i.push(_v(_v([],c,!0),[e],!1)):i.push([c,e])}}return r[e]=i,r[e]}var j7e=function(e,t,r,i,a){var o=BD(e,t,i,a),s=o.length,l=o.path,u=o.allPath;return{length:s[r],path:l[r],allPath:u[r]}},X7e=function(e,t,r,i){var a;if(t===r)return[[t]];var o=e.edges,s=o===void 0?[]:o,l=[t],u=(a={},a[t]=!0,a),h=[],c=[],f=i?cv(t,s,"target"):cv(t,s);for(h.push(f);l.length>0&&h.length>0;){var d=h[h.length-1];if(d.length){var v=d.shift();v&&(l.push(v),u[v]=!0,f=i?cv(v,s,"target"):cv(v,s),h.push(f.filter(function(m){return!u[m]})))}else{var p=l.pop();u[p]=!1,h.pop();continue}if(l[l.length-1]===r){var g=l.map(function(y){return y});c.push(g);var p=l.pop();u[p]=!1,h.pop()}}return c},GD=function(e,t){for(var r=i2(e,t),i=[],a=r.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:r[o][s]===0||!r[o][s]?i[o][s]=1/0:i[o][s]=r[o][s]}for(var l=0;l<a;l+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},Y7e=function(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},h={};o.forEach(function(_,x){var S=B7e();_.clusterId=S,u[S]={id:S,nodes:[_]},h[_.id]={node:_,idx:x}});var c=i2(e,t),f={};c.forEach(function(_,x){var S=o[x].id;f[S]={},_.forEach(function(w,b){if(!!w){var E=o[b].id;f[S][E]=w}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(S){var w={};Object.keys(f[S.id]).forEach(function(R){var k=f[S.id][R],D=h[R].node,G=D.clusterId;w[G]||(w[G]=0),w[G]+=k});var b=-1/0,E=[];if(Object.keys(w).forEach(function(R){b<w[R]?(b=w[R],E=[R]):b===w[R]&&E.push(R)}),!(E.length===1&&E[0]===S.clusterId)){var T=E.indexOf(S.clusterId);if(T>=0&&E.splice(T,1),E&&E.length){x=!0;var C=u[S.clusterId],A=C.nodes.indexOf(S);C.nodes.splice(A,1);var M=Math.floor(Math.random()*E.length),I=u[E[M]];I.nodes.push(S),S.clusterId=I.id}}}),!x)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(u).forEach(function(_){var x=u[_];(!x.nodes||!x.nodes.length)&&delete u[_]});var g=[],m={};l.forEach(function(_){var x=_.source,S=_.target,w=_[r]||1,b=h[x].node.clusterId,E=h[S].node.clusterId,T="".concat(b,"---").concat(E);if(m[T])m[T].weight+=w,m[T].count++;else{var C={source:b,target:E,weight:w,count:1};m[T]=C,g.push(C)}});var y=[];return Object.keys(u).forEach(function(_){y.push(u[_])}),{clusters:y,clusterEdges:g}},Ip=function(){function n(e){this.arr=e}return n.prototype.getArr=function(){return this.arr||[]},n.prototype.add=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new n(r);if(!(r!=null&&r.length))return new n(this.arr);if(this.arr.length===r.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+r[a];return new n(i)}},n.prototype.subtract=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new n(r);if(!(r!=null&&r.length))return new n(this.arr);if(this.arr.length===r.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-r[a];return new n(i)}},n.prototype.avg=function(e){var t=[];if(e!==0)for(var r in this.arr)t[r]=this.arr[r]/e;return new n(t)},n.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new n(e)},n.prototype.squareEuclideanDistance=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},n.prototype.euclideanDistance=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},n.prototype.normalize=function(){var e=[],t=Xi(this.arr);t.sort(function(o,s){return o-s});var r=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(r-i);return new n(e)},n.prototype.norm2=function(){var e;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return 0;var t=0;for(var r in this.arr)t+=Math.pow(this.arr[r],2);return Math.sqrt(t)},n.prototype.dot=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},n.prototype.equal=function(e){var t,r=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(r==null?void 0:r.length))return!1;for(var i in this.arr)if(this.arr[i]!==r[i])return!1;return!0},n}(),nse=function(e,t){t===void 0&&(t=void 0);var r=[];return e.forEach(function(i){t===void 0&&r.push(i),i[t]!==void 0&&r.push(i[t])}),r},jg;(function(n){n.EuclideanDistance="euclideanDistance"})(jg||(jg={}));var d7t=function(e,t,r){var i=[];t!=null&&t.length?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=kD(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(l){l[o]!==void 0&&l[o]!==""&&s.push(l[o])}),s.length&&!(r!=null&&r.includes(o))&&(a[o]=kD(s))}),a},ise=function(e,t,r){var i=d7t(e,t,r),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(l){return l.every(function(u){return typeof u=="number"})});return e.forEach(function(l,u){var h=[];Object.keys(i).forEach(function(c){var f=l[c],d=i[c],v=d.findIndex(function(m){return f===m}),p=[];if(s)p.push(f);else for(var g=0;g<d.length;g++)g===v?p.push(1):p.push(0);h=h.concat(p)}),a[u]=h}),a},sxe=function(e,t,r,i){r===void 0&&(r=jg.EuclideanDistance);var a=0;switch(r){case jg.EuclideanDistance:a=new Ip(e).euclideanDistance(new Ip(t));break}return a},lxe=function(e,t,r,i){for(var a=t.length,o=2*i,s=0,l=0;l<a;l++)for(var u=e[l].clusterId,h=0;h<a;h++){var c=e[h].clusterId;if(u===c){var f=t[l][h]||0,d=r[l]||0,v=r[h]||0;s+=f-d*v/o}}return s*=1/o,s},TX=function(e,t){e===void 0&&(e=[]);for(var r=e.length,i=new Ip([]),a=0;a<r;a++)i=i.add(new Ip(t[a]));var o=i.avg(r);o.normalize();for(var s=0,a=0;a<r;a++){var l=new Ip(t[a]),u=l.squareEuclideanDistance(o);s+=u}var h=[];e.forEach(function(){h.push([])});for(var a=0;a<r;a++){var l=new Ip(t[a]);e[a].clusterInertial=0;for(var c=0;c<r;c++){if(a===c){h[a][c]=0;continue}var f=new Ip(t[c]);h[a][c]=l.squareEuclideanDistance(f),e[a].clusterInertial+=h[a][c]}}for(var d=0,v=2*r*s,a=0;a<r;a++)for(var p=e[a].clusterId,c=0;c<r;c++){var g=e[c].clusterId;if(!(a===c||p!==g)){var m=e[a].clusterInertial*e[c].clusterInertial/Math.pow(v,2)-h[a][c]/v;d+=m}}return Number(d.toFixed(4))},ase=function(e,t,r,i,a,o,s,l,u){t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),l===void 0&&(l=["id"]),u===void 0&&(u=1);var h=e.nodes,c=h===void 0?[]:h,f=e.edges,d=f===void 0?[]:f,v=[];if(a){c.forEach(function(z,V){z.properties=z.properties||{},z.originIndex=V});var p=[];c.every(function(z){return z.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(z){return z.nodeType}))),c.forEach(function(z){z.properties.nodeType=p.findIndex(function(V){return V===z.nodeType})}));var g=nse(c,o);v=ise(g,s,l)}var m=1,y={},_={};c.forEach(function(z,V){var q=String(m++);z.clusterId=q,y[q]={id:q,nodes:[z]},_[z.id]={node:z,idx:V}});var x=i2(e,t),S=[],w={},b=0;x.forEach(function(z,V){var q=0,Y=c[V].id;w[Y]={},z.forEach(function(le,j){if(!!le){q+=le;var Q=c[j].id;w[Y][Q]=le,b+=le}}),S.push(q)}),b/=2;for(var E=1/0,T=1/0,C=0,A=[],M={};;){a&&c.every(function(z){return z.hasOwnProperty("properties")})?E=lxe(c,x,S,b)+TX(c,v)*u:E=lxe(c,x,S,b),C===0&&(T=E,A=c,M=y);var I=E>0&&E>T&&E-T<i;if(E>T&&(A=c.map(function(z){return{node:z,clusterId:z.clusterId}}),M=Xi(y),T=E),I||C>100)break;C++,Object.keys(y).forEach(function(z){var V=0;d.forEach(function(q){var Y=q.source,le=q.target,j=_[Y].node.clusterId,Q=_[le].node.clusterId;(j===z&&Q!==z||Q===z&&j!==z)&&(V=V+(q[r]||1))}),y[z].sumTot=V}),c.forEach(function(z,V){var q=y[z.clusterId],Y=0,le,j=S[V]/(2*b),Q=0,ie=q.nodes;ie.forEach(function(st){var Nt=_[st.id].idx;Q+=x[V][Nt]||0});var oe=Q-q.sumTot*j,se=ie.filter(function(st){return st.id!==z.id});se.forEach(function(st,Nt){v[st.originIndex]});var me=TX(se,v)*u,Ce=w[z.id];if(Object.keys(Ce).forEach(function(st){var Nt=_[st].node,Zt=Nt.clusterId;if(Zt!==z.clusterId){var qe=y[Zt],ur=qe.nodes;if(!(!ur||!ur.length)){var Dt=0;ur.forEach(function(Tt){var Qe=_[Tt.id].idx;Dt+=x[V][Qe]||0});var ft=Dt-qe.sumTot*j,Oe=ur.concat([z]);Oe.forEach(function(Tt,Qe){v[Tt.originIndex]});var J=TX(Oe,v)*u,We=ft-oe;a&&(We=ft+J-(oe+me)),We>Y&&(Y=We,le=qe)}}}),Y>0){le.nodes.push(z);var Le=z.clusterId;z.clusterId=le.id;var re=q.nodes.indexOf(z);q.nodes.splice(re,1);var yt=0,je=0;d.forEach(function(st){var Nt=st.source,Zt=st.target,qe=_[Nt].node.clusterId,ur=_[Zt].node.clusterId;(qe===le.id&&ur!==le.id||ur===le.id&&qe!==le.id)&&(yt=yt+(st[r]||1)),(qe===Le&&ur!==Le||ur===Le&&qe!==Le)&&(je=je+(st[r]||1))}),le.sumTot=yt,q.sumTot=je}})}var R={},k=0;Object.keys(M).forEach(function(z){var V=M[z];if(!V.nodes||!V.nodes.length){delete M[z];return}var q=String(k+1);q!==z&&(V.id=q,V.nodes=V.nodes.map(function(Y){return{id:Y.id,clusterId:q}}),M[q]=V,R[z]=q,delete M[z],k++)}),A.forEach(function(z){var V=z.node,q=z.clusterId;!V||(V.clusterId=q,V.clusterId&&R[V.clusterId]&&(V.clusterId=R[V.clusterId]))});var D=[],G={};d.forEach(function(z){var V=z.source,q=z.target,Y=z[r]||1,le=_[V].node.clusterId,j=_[q].node.clusterId;if(!(!le||!j)){var Q="".concat(le,"---").concat(j);if(G[Q])G[Q].weight+=Y,G[Q].count++;else{var ie={source:le,target:j,weight:Y,count:1};G[Q]=ie,D.push(ie)}}});var W=[];return Object.keys(M).forEach(function(z){W.push(M[z])}),{clusters:W,clusterEdges:D}},q7e=function(e,t,r,i,a,o,s,l){return t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),l===void 0&&(l=1),ase(e,t,r,i,!0,a,o,s,l)},Z7e=function(e,t){var r;t===void 0&&(t=1);for(var i=Xi(e),a=i.nodes,o=a===void 0?[]:a,s=i.edges,l=s===void 0?[]:s,u=function(){var f=g_({nodes:o,edges:l}),d=Object.keys(f);d.sort(function(g,m){var y,_;return((y=f[g])===null||y===void 0?void 0:y.degree)-((_=f[m])===null||_===void 0?void 0:_.degree)});var v=d[0];if(!o.length||((r=f[v])===null||r===void 0?void 0:r.degree)>=t)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),l=l.filter(function(g){return!(g.source===v||g.target===v)})};;){var h=u();if(h==="break")break}return{nodes:o,edges:l}},uxe=function(e,t,r){var i=[];switch(e){case jg.EuclideanDistance:i=t[r];break;default:i=[];break}return i},K7e=function(e,t,r,i,a,o){t===void 0&&(t=3),r===void 0&&(r=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=jg.EuclideanDistance);var s=e.nodes,l=s===void 0?[]:s,u=e.edges,h=u===void 0?[]:u,c={clusters:[{id:"0",nodes:l}],clusterEdges:[]};if(o===jg.EuclideanDistance&&!l.every(function(q){return q.hasOwnProperty(r)}))return c;var f=[],d=[];if(o===jg.EuclideanDistance&&(f=nse(l,r),d=ise(f,i,a)),!d.length)return c;for(var v=kD(d.map(function(q){return q.join("")})),p=Math.min(t,l.length,v.length),g=0;g<l.length;g++)l[g].originIndex=g;for(var m=[],y=[],_=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*l.length);switch(o){case jg.EuclideanDistance:m[g]=d[x];break;default:m[g]=[];break}y.push(x),_[g]=[l[x]],l[x].clusterId=String(g)}else{for(var S=-1/0,w=0,b=function(le){if(!y.includes(le)){for(var j=0,Q=0;Q<m.length;Q++){var ie=0;switch(o){case jg.EuclideanDistance:ie=sxe(d[l[le].originIndex],m[Q],o);break}j+=ie}var oe=j/m.length;oe>S&&!m.find(function(se){return HS(se,uxe(o,d,l[le].originIndex))})&&(S=oe,w=le)}},E=0;E<l.length;E++)b(E);m[g]=uxe(o,d,w),y.push(w),_[g]=[l[w]],l[w].clusterId=String(g)}for(var T=0;;){for(var g=0;g<l.length;g++){var C=0,A=1/0;if(!(T===0&&y.includes(g))){for(var M=0;M<m.length;M++){var I=0;switch(o){case jg.EuclideanDistance:I=sxe(d[g],m[M],o);break}I<A&&(A=I,C=M)}if(l[g].clusterId!==void 0)for(var R=_[Number(l[g].clusterId)].length-1;R>=0;R--)_[Number(l[g].clusterId)][R].id===l[g].id&&_[Number(l[g].clusterId)].splice(R,1);l[g].clusterId=String(C),_[C].push(l[g])}}for(var k=!1,g=0;g<_.length;g++){for(var D=_[g],G=new Ip([]),M=0;M<D.length;M++)G=G.add(new Ip(d[D[M].originIndex]));var W=G.avg(D.length);W.equal(new Ip(m[g]))||(k=!0,m[g]=W.getArr())}if(T++,l.every(function(q){return q.clusterId!==void 0})&&k||T>=1e3)break}var z=[],V={};return h.forEach(function(q){var Y,le,j=q.source,Q=q.target,ie=(Y=l.find(function(Ce){return Ce.id===j}))===null||Y===void 0?void 0:Y.clusterId,oe=(le=l.find(function(Ce){return Ce.id===Q}))===null||le===void 0?void 0:le.clusterId,se="".concat(ie,"---").concat(oe);if(V[se])V[se].count++;else{var me={source:ie,target:oe,count:1};V[se]=me,z.push(me)}}),{clusters:_,clusterEdges:z}},ose=function(e,t){var r=new Ip(t),i=r.norm2(),a=new Ip(e),o=a.norm2(),s=r.dot(a),l=i*o,u=l?s/l:0;return u},J7e=function(e,t,r,i,a){e===void 0&&(e=[]),r===void 0&&(r=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=Xi(e.filter(function(f){return f.id!==t.id})),s=e.findIndex(function(f){return f.id===t.id}),l=nse(e,r),u=ise(l,i,a),h=u[s],c=[];return o.forEach(function(f,d){if(f.id!==t.id){var v=u[d],p=ose(v,h);c.push(p),f.cosineSimilarity=p}}),o.sort(function(f,d){return d.cosineSimilarity-f.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},v7t=function(){function n(e){this.count=e.length,this.parent={};for(var t=0,r=e;t<r.length;t++){var i=r[t];this.parent[i]=i}}return n.prototype.find=function(e){for(;this.parent[e]!==e;)e=this.parent[e];return e},n.prototype.union=function(e,t){var r=this.find(e),i=this.find(t);r!==i&&(r<i?(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]):(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]))},n.prototype.connected=function(e,t){return this.find(e)===this.find(t)},n}(),p7t=function(e,t){return e-t},g7t=function(){function n(e){e===void 0&&(e=p7t),this.compareFn=e,this.list=[]}return n.prototype.getLeft=function(e){return 2*e+1},n.prototype.getRight=function(e){return 2*e+2},n.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},n.prototype.isEmpty=function(){return this.list.length<=0},n.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},n.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},n.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},n.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var r=this.list[t];this.list[t]=this.list[e],this.list[e]=r,e=t,t=this.getParent(e)}},n.prototype.moveDown=function(e){var t,r=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[r],this.list[i])>0?r=i:a!==null&&a<o&&this.compareFn(this.list[r],this.list[a])>0&&(r=a),e!==r&&(t=[this.list[r],this.list[e]],this.list[e]=t[0],this.list[r]=t[1],this.moveDown(r))},n}(),y7t=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=a[0],u=new Set;u.add(l);var h=function(g,m){return t?g.weight-m.weight:0},c=new g7t(h);for(VB(l.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var f=c.delMin(),d=f.source,v=f.target;u.has(d)&&u.has(v)||(r.push(f),u.has(d)||(u.add(d),VB(d,s).forEach(function(p){c.insert(p)})),u.has(v)||(u.add(v),VB(v,s).forEach(function(p){c.insert(p)})))}return r},hxe=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=s.map(function(d){return d});t&&l.sort(function(d,v){return d.weight-v.weight});for(var u=new v7t(a.map(function(d){return d.id}));l.length>0;){var h=l.shift(),c=h.source,f=h.target;u.connected(c,f)||(r.push(h),u.union(c,f))}return r},Q7e=function(e,t,r){var i={prim:y7t,kruskal:hxe};return r?i[r](e,t):hxe(e,t)},eze=function(e,t,r){typeof t!="number"&&(t=1e-6),typeof r!="number"&&(r=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,h=u===void 0?[]:u,c=l.length,f,d={},v={},p=0;p<c;++p){var g=l[p],m=g.id;d[m]=1/c,v[m]=1/c}for(var y=g_(e);o>0&&i>t;){a=0;for(var p=0;p<c;++p){var g=l[p],m=g.id;if(f=0,y[g.id].inDegree===0)d[m]=0;else{for(var _=cv(m,h,"source"),x=0;x<_.length;++x){var S=_[x],w=y[S].outDegree;w>0&&(f+=v[S]/w)}d[m]=r*f,a+=d[m]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=l[p],m=g.id;f=d[m]+a,i+=Math.abs(f-v[m]),v[m]=f}o-=1}return v},m7t=-1,f9=-1,tze="-1",Gy="-1",rze=-1,cxe=function(){function n(e,t,r,i){e===void 0&&(e=m7t),t===void 0&&(t=f9),r===void 0&&(r=f9),i===void 0&&(i=tze),this.id=e,this.from=t,this.to=r,this.label=i}return n}(),_7t=function(){function n(e,t){e===void 0&&(e=f9),t===void 0&&(t=Gy),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return n.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},n}(),nze=function(){function n(e,t,r){e===void 0&&(e=f9),t===void 0&&(t=!0),r===void 0&&(r=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=r}return n.prototype.getNodeNum=function(){return this.nodes.length},n.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var r=new _7t(e,t);this.nodes.push(r),this.nodeMap[e]=r,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},n.prototype.addEdge=function(e,t,r,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[r]&&this.nodeMap[r].edgeMap[e])){var a=new cxe(e,t,r,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new cxe(e,r,t,i);this.nodeMap[r].addEdge(o),this.edgeLabelMap[i].push(o)}}},n}(),Fb=function(){function n(e,t,r,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:r||Gy,edgeLabel:i||tze,nodeLabel2:a||Gy}}return n.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},n.prototype.notEqualTo=function(e){return!this.equalTo(e)},n}(),fxe=function(){function n(){this.rmpath=[],this.dfsEdgeList=[]}return n.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,r=e.length;if(t!==r)return!1;for(var i=0;i<t;i++)if(this.dfsEdgeList[i]!==e[i])return!1;return!0},n.prototype.notEqualTo=function(e){return!this.equalTo(e)},n.prototype.pushBack=function(e,t,r,i,a){return this.dfsEdgeList.push(new Fb(e,t,r,i,a)),this.dfsEdgeList},n.prototype.toGraph=function(e,t){e===void 0&&(e=rze),t===void 0&&(t=!1);var r=new nze(e,!0,t);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,l=s.nodeLabel1,u=s.edgeLabel,h=s.nodeLabel2;l!==Gy&&r.addNode(a,l),h!==Gy&&r.addNode(o,h),l!==Gy&&h!==l&&r.addEdge(void 0,a,o,u)}),r},n.prototype.buildRmpath=function(){this.rmpath=[];for(var e=void 0,t=this.dfsEdgeList.length,r=t-1;r>=0;r--){var i=this.dfsEdgeList[r],a=i.fromNode,o=i.toNode;a<o&&(e===void 0||o===e)&&(this.rmpath.push(r),e=a)}return this.rmpath},n.prototype.getNodeNum=function(){var e={};return this.dfsEdgeList.forEach(function(t){e[t.fromNode]||(e[t.fromNode]=!0),e[t.toNode]||(e[t.toNode]=!0)}),Object.keys(e).length},n}(),i5=function(){function n(e){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!e){for(;e;){var t=e.edge;this.edges.push(t),this.nodesUsed[t.from]=1,this.nodesUsed[t.to]=1,this.edgesUsed[t.id]=1,e=e.preNode}this.edges=this.edges.reverse()}}return n.prototype.hasNode=function(e){return this.nodesUsed[e.id]===1},n.prototype.hasEdge=function(e){return this.edgesUsed[e.id]===1},n}(),x7t=function(){function n(e){var t=e.graphs,r=e.minSupport,i=r===void 0?2:r,a=e.minNodeNum,o=a===void 0?1:a,s=e.maxNodeNum,l=s===void 0?4:s,u=e.top,h=u===void 0?10:u,c=e.directed,f=c===void 0?!1:c,d=e.verbose,v=d===void 0?!1:d;this.graphs=t,this.dfsCode=new fxe,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=h,this.directed=f,this.counter=0,this.maxNodeNum=l,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return n.prototype.findForwardRootEdges=function(e,t){var r=this,i=[],a=e.nodeMap;return t.edges.forEach(function(o){(r.directed||t.label<=a[o.to].label)&&i.push(o)}),i},n.prototype.findBackwardEdge=function(e,t,r,i){if(!this.directed&&t===r)return null;for(var a=e.nodeMap,o=a[r.to],s=o.edges,l=s.length,u=0;u<l;u++){var h=s[u];if(!(i.hasEdge(h)||h.to!==t.from)){if(this.directed){if(a[t.from].label<a[r.to].label||a[t.from].label===a[r.to].label&&t.label<=h.label)return h}else if(t.label<h.label||t.label===h.label&&a[t.to].label<=a[r.to].label)return h}}return null},n.prototype.findForwardPureEdges=function(e,t,r,i){for(var a=[],o=t.to,s=e.nodeMap[o].edges,l=s.length,u=0;u<l;u++){var h=s[u],c=e.nodeMap[h.to];r<=c.label&&!i.hasNode(c)&&a.push(h)}return a},n.prototype.findForwardRmpathEdges=function(e,t,r,i){for(var a=[],o=e.nodeMap,s=o[t.to].label,l=o[t.from],u=l.edges,h=u.length,c=0;c<h;c++){var f=u[c],d=o[f.to].label;t.to===f.to||r>d||i.hasNode(o[f.to])||(t.label<f.label||t.label===f.label&&s<=d)&&a.push(f)}return a},n.prototype.getSupport=function(e){var t={};return e.forEach(function(r){t[r.graphId]||(t[r.graphId]=!0)}),Object.keys(t).length},n.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(r){var i=e[r],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<t.nodeLabel1||a===t.nodeLabel1&&o<t.edgeLabel||a===t.nodeLabel1&&o===t.edgeLabel&&s<t.nodeLabel2)&&(t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),t},n.prototype.isMin=function(){var e=this,t=this.dfsCode;if(this.verbose&&console.log("isMin checking",t),t.dfsEdgeList.length===1)return!0;var r=this.directed,i=t.toGraph(rze,r),a=i.nodeMap,o=new fxe,s={};i.nodes.forEach(function(c){var f=e.findForwardRootEdges(i,c);f.forEach(function(d){var v=a[d.to],p="".concat(c.label,"-").concat(d.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:v.label});var g={graphId:i.id,edge:d,preNode:null};s[p].projected.push(g)})});var l=this.findMinLabel(s);if(!!l){o.dfsEdgeList.push(new Fb(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var u=function c(f){for(var d=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[d[0]].toNode,g={},m=!1,y=0,_=r?-1:0,x=function(G){if(m)return"break";f.forEach(function(W){var z=new i5(W),V=e.findBackwardEdge(i,z.edges[d[G]],z.edges[d[0]],z);V&&(g[V.label]||(g[V.label]={projected:[],edgeLabel:V.label}),g[V.label].projected.push({graphId:i.id,edge:g,preNode:W}),y=o.dfsEdgeList[d[G]].fromNode,m=!0)})},S=d.length-1;S>_;S--){var w=x(S);if(w==="break")break}if(m){var b=e.findMinLabel(g);o.dfsEdgeList.push(new Fb(p,y,Gy,b.edgeLabel,Gy));var E=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[E]!==o.dfsEdgeList[E]?!1:c(g[b.edgeLabel].projected)}var T={};m=!1;var C=0;f.forEach(function(D){var G=new i5(D),W=e.findForwardPureEdges(i,G.edges[d[0]],v,G);W.length>0&&(m=!0,C=p,W.forEach(function(z){var V="".concat(z.label,"-").concat(a[z.to].label);T[V]||(T[V]={projected:[],edgeLabel:z.label,nodeLabel2:a[z.to].label}),T[V].projected.push({graphId:i.id,edge:z,preNode:D})}))});for(var A=d.length,M=function(G){if(m)return"break";var W=d[G];f.forEach(function(z){var V=new i5(z),q=e.findForwardRmpathEdges(i,V.edges[W],v,V);q.length>0&&(m=!0,C=o.dfsEdgeList[W].fromNode,q.forEach(function(Y){var le="".concat(Y.label,"-").concat(a[Y.to].label);T[le]||(T[le]={projected:[],edgeLabel:Y.label,nodeLabel2:a[Y.to].label}),T[le].projected.push({graphId:i.id,edge:Y,preNode:z})}))})},S=0;S<A;S++){var I=M(S);if(I==="break")break}if(!m)return!0;var R=e.findMinLabel(T);o.dfsEdgeList.push(new Fb(C,p+1,Gy,R.edgeLabel,R.nodeLabel2));var k=o.dfsEdgeList.length-1;return t.dfsEdgeList[k]!==o.dfsEdgeList[k]?!1:c(T["".concat(R.edgeLabel,"-").concat(R.nodeLabel2)].projected)},h="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return u(s[h].projected)}},n.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var e=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Xi(e))}},n.prototype.subGraphMining=function(e){var t=this,r=this.getSupport(e);if(!(r<this.minSupport)&&!!this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},u={};e.forEach(function(h){for(var c=t.graphs[h.graphId],f=c.nodeMap,d=new i5(h),v=a.length-1;v>=0;v--){var p=t.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(t.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);u[g]||(u[g]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),u[g].projected.push({graphId:h.graphId,edge:p,preNode:h})}}if(!(i>=t.maxNodeNum)){var m=t.findForwardPureEdges(c,d.edges[a[0]],s,d);m.forEach(function(_){var x="".concat(o,"-").concat(_.label,"-").concat(f[_.to].label);l[x]||(l[x]={projected:[],fromNodeId:o,edgeLabel:_.label,nodeLabel2:f[_.to].label}),l[x].projected.push({graphId:h.graphId,edge:_,preNode:h})});for(var y=function(x){var S=t.findForwardRmpathEdges(c,d.edges[a[x]],s,d);S.forEach(function(w){var b="".concat(t.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(w.label,"-").concat(f[w.to].label);l[b]||(l[b]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:w.label,nodeLabel2:f[w.to].label}),l[b].projected.push({graphId:h.graphId,edge:w,preNode:h})})},v=0;v<a.length;v++)y(v)}}),Object.keys(u).forEach(function(h){var c=u[h],f=c.toNodeId,d=c.edgeLabel;t.dfsCode.dfsEdgeList.push(new Fb(o,f,"-1",d,"-1")),t.subGraphMining(u[h].projected),t.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(h){var c=l[h],f=c.fromNodeId,d=c.edgeLabel,v=c.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Fb(f,o+1,Gy,d,v)),t.subGraphMining(l[h].projected),t.dfsCode.dfsEdgeList.pop()})}},n.prototype.generate1EdgeFrequentSubGraphs=function(){var e=this.graphs,t=this.directed,r=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(e).forEach(function(l){var u=e[l],h=u.nodeMap;u.nodes.forEach(function(c,f){var d=c.label,v="".concat(l,"-").concat(d);if(!s[v]){var p=a[d]||0;p++,a[d]=p}s[v]={graphKey:l,label:d},c.edges.forEach(function(g){var m=d,y=h[g.to].label;if(!t&&m>y){var _=y;y=m,m=_}var x=g.label,S="".concat(m,"-").concat(x,"-").concat(y);if(!o[S]){var w=o[S]||0;w++,o[S]=w}})})}),Object.keys(a).forEach(function(l){var u=a[l];if(!(u<r)){var h={nodes:[],edges:[]};h.nodes.push({id:"0",label:l}),i.push(h)}}),i},n.prototype.run=function(){var e=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var t=this.graphs;this.directed;var r={};Object.keys(t).forEach(function(i){var a=t[i],o=a.nodeMap;a.nodes.forEach(function(s){var l=e.findForwardRootEdges(a,s);l.forEach(function(u){var h=o[u.to],c="".concat(s.label,"-").concat(u.label,"-").concat(h.label);r[c]||(r[c]={projected:[],nodeLabel1:s.label,edgeLabel:u.label,nodeLabel2:h.label});var f={graphId:i,edge:u,preNode:null};r[c].projected.push(f)})})}),Object.keys(r).forEach(function(i){var a=r[i],o=a.projected,s=a.nodeLabel1,l=a.edgeLabel,u=a.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Fb(0,1,s,l,u)),e.subGraphMining(o),e.dfsCode.dfsEdgeList.pop()})}},n}(),S7t=function(e,t,r,i){var a={};return Object.keys(e).forEach(function(o,s){var l=e[o],u=new nze(s,!0,t),h={};l.nodes.forEach(function(c,f){u.addNode(f,c[r]),h[c.id]=f}),l.edges.forEach(function(c,f){var d=h[c.source],v=h[c.target];u.addEdge(-1,d,v,c[i])}),u&&u.getNodeNum()&&(a[u.id]=u)}),a},w7t=function(e,t,r){var i=[];return e.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var l;o.nodes.push((l={id:"".concat(s.id)},l[t]=s.label,l))}),a.edges.forEach(function(s){var l;o.edges.push((l={source:"".concat(s.from),target:"".concat(s.to)},l[r]=s.label,l))}),i.push(o)}),i},dxe="cluster",b7t=function(e){var t=e.graphs,r=e.directed,i=r===void 0?!1:r,a=e.nodeLabelProp,o=a===void 0?dxe:a,s=e.edgeLabelProp,l=s===void 0?dxe:s,u=S7t(t,i,o,l),h=e.minSupport,c=e.maxNodeNum,f=e.minNodeNum,d=e.verbose,v=e.top,p={graphs:u,minSupport:h,maxNodeNum:c,minNodeNum:f,top:v,verbose:d,directed:i},g=new x7t(p);g.run();var m=w7t(g.frequentSubgraphs,o,l);return m},vxe=function(e,t,r,i){r===void 0&&(r="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,l){a.push(ize(o,s,l,r,i))}),a},ize=function(e,t,r,i,a){var o=[r],s=[],l={};return t.forEach(function(u,h){if(u<=a&&r!==h){o.push(h),s.push(e[h]);var c=e[h][i];l[c]?(l[c].count++,l[c].dists.push(u)):l[c]={count:1,dists:[u]}}}),Object.keys(l).forEach(function(u){l[u].dists=l[u].dists.sort(function(h,c){return h-c})}),{nodeIdx:r,nodeId:e[r].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:l}},E7t=function(e,t,r,i,a){var o=Math.ceil(r/t),s={},l=0;return i.forEach(function(u,h){for(var c=0,f=0,d=u.nodeIdxs,v=u.neighborNum-1;c<o;){for(var p=d[1+Math.floor(Math.random()*v)],g=0;(s["".concat(h,"-").concat(p)]||s["".concat(p,"-").concat(h)])&&(p=Math.floor(Math.random()*t),g++,!(g>2*t)););if(g<2*t&&(s["".concat(h,"-").concat(p)]={start:h,end:p,distance:a[h][p]},c++,l++,l>=r))return s;if(f++,f>2*t)break}if(c<o){var m=o-c;o=(o+m)/(t-h-1)}}),s},$B=function(e,t,r,i){var a=r.nodes;return i||(i={}),Object.keys(e).forEach(function(o){var s,l;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var u=e[o],h=(s=t[u.start])===null||s===void 0?void 0:s.nodeIdxs,c=(l=t[u.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!h||!c)){var f=new Set(c),d=h.filter(function(y){return f.has(y)});if(!(!d||!d.length)){for(var v={},p=d.length,g=0;g<p;g++){var m=a[d[g]];i[o].nodes.push(m),v[m.id]=!0}r.edges.forEach(function(y){v[y.source]&&v[y.target]&&i[o].edges.push(y)})}}}}),i},WB=function(e,t,r,i){var a,o,s={};e.nodes.forEach(function(u){s[u.id]=u});var l=0;return!(!((a=t==null?void 0:t.edges)===null||a===void 0)&&a.length)||((o=t==null?void 0:t.nodes)===null||o===void 0?void 0:o.length)<2?0:(e.edges.forEach(function(u){var h=s[u.source][r],c=s[u.target][r],f=t==null?void 0:t.nodes[0][r],d=t==null?void 0:t.nodes[1][r],v=t==null?void 0:t.edges[0][i];u[i]===v&&(h===f&&c===d||h===d&&c===f)&&l++}),l)},T7t=function(e,t,r){for(var i=1/0,a=0,o=function(u){var h=e[u],c=Object.keys(h).sort(function(y,_){return h[y]-h[_]}),f=10,d=[];c.forEach(function(y,_){d[_%f]||(d[_%f]={graphs:[],totalCount:0,aveCount:0}),d[_%f].graphs.push(y),d[_%f].totalCount+=h[y]});var v=0,p=[];d.forEach(function(y){var _=y.totalCount/y.graphs.length;y.aveCount=_,p.push(_);var x=0,S=y.length;y.graphs.forEach(function(w,b){var E=h[w];y.graphs.forEach(function(T,C){b!==C&&(x+=Math.abs(E-h[T]))})}),x/=S*(S-1)/2,v+=x}),v/=d.length;var g=0;p.forEach(function(y,_){p.forEach(function(x,S){_!==S&&(g+=Math.abs(y-x))}),g/=p.length*(p.length-1)/2});var m=g-v;i<m&&(i=m,a=u)},s=0;s<t;s++)o(s);return{structure:r[a],structureCountMap:e[a]}},pxe=function(e,t){var r={},i={};return e.forEach(function(a,o){r[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[t];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:r,nodeLabelMap:i}},gxe=function(e,t,r){var i={},a={};return e.forEach(function(o,s){i["".concat(B7e)]={idx:s,edge:o};var l=o[t];a[l]||(a[l]=[]),a[l].push(o);var u=r[o.source];u&&(u.degree++,u.outDegree++);var h=r[o.target];h&&(h.degree++,h.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},yxe=function(e,t,r){var i=t.length,a={};return t.forEach(function(o,s){for(var l=r?0:s+1,u=e[s].id,h=l;h<i;h++)if(s!==h){var c=e[h].id,f=o[h];a["".concat(u,"-").concat(c)]=f,r||(a["".concat(c,"-").concat(u)]=f)}}),a},C7t=function(e,t,r,i,a,o,s,l,u,h,c){var f,d="".concat(t.id,"-").concat(r.id);if(h&&h[d])return h[d];var v=c?c[d]:void 0;if(!v){var p=(f={},f[d]={start:i[t.id].idx,end:i[r.id].idx,distance:a},f);c=$B(p,o,e,c),v=c[d]}return WB(v,s,l,u)},mxe=function(e,t,r,i){var a,o,s,l=(a=e[t])===null||a===void 0?void 0:a.degree,u=(o=e[t])===null||o===void 0?void 0:o.inDegree,h=(s=e[t])===null||s===void 0?void 0:s.outDegree;return e[t]===void 0&&(l=1/0,u=1/0,h=1/0,i[t].forEach(function(c){var f=r[c.id].degree;l>f&&(l=f);var d=r[c.id].inDegree;u>d&&(u=d);var v=r[c.id].outDegree;h>v&&(h=v)}),e[t]={degree:l,inDegree:u,outDegree:h}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:h}},aze=function(e,t,r,i,a,o,s){var l;if(r===void 0&&(r=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var h=GD(e,r),c=GD(t,r),f=yxe(e.nodes,h,r),d=yxe(t.nodes,c,r),v=pxe(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,m=pxe(t.nodes,o),y=m.nodeMap,_=m.nodeLabelMap;gxe(e.edges,s,p);var x=gxe(t.edges,s,y).edgeLabelMap,S=[];c==null||c.forEach(function(ft){S=S.concat(ft)}),a||(a=Math.max.apply(Math,_v(_v([],S,!1),[2],!1))),i||(i=a);var w=vxe(e,h,o,i),b=vxe(t,c,o,i),E=Math.min(100,u*(u-1)/2),T=E7t(i,u,E,w,h),C=$B(T,w,e),A=10,M=1,I=1,R=4,k={graphs:C,nodeLabelProp:o,edgeLabelProp:s,minSupport:M,minNodeNum:I,maxNodeNum:R,directed:r},D=b7t(k).slice(0,A),G=D.length,W=[];D.forEach(function(ft,Oe){W[Oe]={},Object.keys(C).forEach(function(J){var We=C[J],Tt=WB(We,ft,o,s);W[Oe][J]=Tt})});var z=T7t(W,G,D),V=z.structure,q=z.structureCountMap,Y=t.nodes[0],le=[],j=(l=t.nodes[0])===null||l===void 0?void 0:l[o],Q=-1/0;t.nodes.forEach(function(ft){var Oe=ft[o],J=g[Oe];(J==null?void 0:J.length)>Q&&(Q=J.length,le=J,j=Oe,Y=ft)});var ie={},oe={},se={},me={},Ce={},Le={};Object.keys(_).forEach(function(ft,Oe){Ce[ft]=[],r&&(Le[ft]=[]);var J=_[ft],We={};J.forEach(function(wt){var pt=d["".concat(Y.id,"-").concat(wt.id)];if(pt&&Ce[ft].push(pt),We["".concat(Y.id,"-").concat(wt.id)]={start:0,end:y[wt.id].idx,distance:pt},r){var ar=d["".concat(wt.id,"-").concat(Y.id)];ar&&Le[ft].push(ar)}}),Ce[ft]=Ce[ft].sort(function(wt,pt){return wt-pt}),r&&(Le[ft]=Le[ft].sort(function(wt,pt){return wt-pt})),oe=$B(We,b,t,oe);var Tt=[];if(Object.keys(We).forEach(function(wt){if(se[wt]){Tt.push(se[wt]);return}var pt=oe[wt];se[wt]=WB(pt,V,o,s),Tt.push(se[wt])}),Tt=Tt.sort(function(wt,pt){return pt-wt}),me["".concat(Y.id,"-").concat(ft)]=Tt,ft!==j)for(var Qe=(le==null?void 0:le.length)||0,zt=function(pt){var ar=le[pt],kt=w[p[ar.id].idx],Dr=kt.nodeLabelCountMap[ft],Sr=_[ft].length;if(!Dr||Dr.count<Sr)return le.splice(pt,1),"continue";for(var jr=!1,pn=0;pn<Sr;pn++)if(Dr.dists[pn]>Ce[ft][pn]){jr=!0;break}if(jr)return le.splice(pt,1),"continue";var Jn={};kt.neighbors.forEach(function(yn){var Oi=f["".concat(ar.id,"-").concat(yn.id)];Jn["".concat(ar.id,"-").concat(yn.id)]={start:p[ar.id].idx,end:p[yn.id].idx,distance:Oi}}),C=$B(Jn,w,e,C);var Rn=[];Object.keys(Jn).forEach(function(yn){if(q[yn]){Rn.push(q[yn]);return}var Oi=C[yn];q[yn]=WB(Oi,V,o,s),Rn.push(q[yn])}),Rn=Rn.sort(function(yn,Oi){return Oi-yn});for(var hi=!1,pn=0;pn<Sr;pn++)if(Rn[pn]<Tt[pn]){hi=!0;break}if(hi)return le.splice(pt,1),"continue"},mt=Qe-1;mt>=0;mt--)zt(mt)});var re=[];le==null||le.forEach(function(ft){for(var Oe=p[ft.id].idx,J=ize(e.nodes,h[Oe],Oe,o,a),We=J.neighbors,Tt=We.length,Qe=!1,zt=Tt-1;zt>=0;zt--){if(We.length+1<t.nodes.length){Qe=!0;return}var mt=We[zt],wt=mt[o];if(!_[wt]||!_[wt].length){We.splice(zt,1);continue}if(!Ce[wt]||!Ce[wt].length){We.splice(zt,1);continue}var pt="".concat(ft.id,"-").concat(mt.id),ar=f[pt],kt=Ce[wt].length-1,Dr=Ce[wt][kt];if(ar>Dr){We.splice(zt,1);continue}if(r){var Sr="".concat(mt.id,"-").concat(ft.id),jr=f[Sr];kt=Le[wt].length-1;var pn=Le[wt][kt];if(jr>pn){We.splice(zt,1);continue}}var Jn=q[pt]?q[pt]:C7t(e,ft,mt,p,ar,w,V,o,s,q,C),Rn="".concat(Y.id,"-").concat(wt),hi=me[Rn][me[Rn].length-1];if(Jn<hi){We.splice(zt,1);continue}var yn=mxe(ie,wt,y,_),Oi=yn.minPatternNodeLabelDegree;if(yn.minPatternNodeLabelInDegree,yn.minPatternNodeLabelOutDegree,p[mt.id].degree<Oi){We.splice(zt,1);continue}}Qe||re.push({nodes:[ft].concat(We)})});var yt=BD(t,Y.id,!1).length,je={};r?(Object.keys(yt).forEach(function(ft){var Oe=y[ft].node[o];je[Oe]?je[Oe].push(yt[ft]):je[Oe]=[yt[ft]]}),Object.keys(je).forEach(function(ft){je[ft].sort(function(Oe,J){return Oe-J})})):je=Ce;for(var st=re.length,Nt=function(Oe){var J=re[Oe],We=J.nodes[0],Tt={},Qe={};J.nodes.forEach(function(ue,xe){Qe[ue.id]={idx:xe,node:ue,degree:0,inDegree:0,outDegree:0};var ce=ue[o];Tt[ce]?Tt[ce]++:Tt[ce]=1});var zt=[],mt={};e.edges.forEach(function(ue){Qe[ue.source]&&Qe[ue.target]&&(zt.push(ue),mt[ue[s]]?mt[ue[s]]++:mt[ue[s]]=1,Qe[ue.source].degree++,Qe[ue.target].degree++,Qe[ue.source].outDegree++,Qe[ue.target].inDegree++)});for(var wt=Object.keys(x).length,pt=!1,ar=0;ar<wt;ar++){var kt=Object.keys(x)[ar];if(!mt[kt]||mt[kt]<x[kt].length){pt=!0;break}}if(pt)return re.splice(Oe,1),"continue";var Dr=zt.length;if(Dr<t.edges.length)return re.splice(Oe,1),"break";for(var Sr=!1,jr=function(xe){var ce=zt[xe],pe=ce[s],we=x[pe];if(!we||!we.length)return mt[pe]--,we&&mt[pe]<we.length?(Sr=!0,"break"):(zt.splice(xe,1),Qe[ce.source].degree--,Qe[ce.target].degree--,Qe[ce.source].outDegree--,Qe[ce.target].inDegree--,"continue");var Me=Qe[ce.source].node[o],nt=Qe[ce.target].node[o],It=!1;if(we.forEach(function(ot){var ht=y[ot.source].node,ut=y[ot.target].node;ht[o]===Me&&ut[o]===nt&&(It=!0),!r&&ht[o]===nt&&ut[o]===Me&&(It=!0)}),!It)return mt[pe]--,we&&mt[pe]<we.length?(Sr=!0,"break"):(zt.splice(xe,1),Qe[ce.source].degree--,Qe[ce.target].degree--,Qe[ce.source].outDegree--,Qe[ce.target].inDegree--,"continue")},ar=Dr-1;ar>=0;ar--){var pn=jr(ar);if(pn==="break")break}if(Sr)return re.splice(Oe,1),"continue";J.edges=zt;var Jn=BD(J,J.nodes[0].id,!1).length;if(Object.keys(Jn).reverse().forEach(function(ue){if(!(ue===J.nodes[0].id||Sr)){if(Jn[ue]===1/0){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0;return}var pe=p[ue].node[o];if(!je[pe]||!je[pe].length||Jn[ue]>je[pe][je[pe].length-1]){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0}}}),Sr)return re.splice(Oe,1),"continue";for(var Rn=!0,hi=0;Rn&&!Sr;){Rn=!1;var yn=r?Qe[We.id].degree<y[Y.id].degree||Qe[We.id].inDegree<y[Y.id].inDegree||Qe[We.id].outDegree<y[Y.id].outDegree:Qe[We.id].degree<y[Y.id].degree;if(yn){Sr=!0;break}if(Tt[We[o]]<_[We[o]].length){Sr=!0;break}for(var Oi=J.nodes.length,oi=Oi-1;oi>=0;oi--){var Gi=J.nodes[oi],ws=Qe[Gi.id].degree,Sl=Qe[Gi.id].inDegree,Os=Qe[Gi.id].outDegree,no=Gi[o],vo=mxe(ie,no,y,_),No=vo.minPatternNodeLabelDegree,Jo=vo.minPatternNodeLabelInDegree,Lo=vo.minPatternNodeLabelOutDegree,hs=r?ws<No||Sl<Jo||Os<Lo:ws<No;if(hs){if(Tt[Gi[o]]--,Tt[Gi[o]]<_[Gi[o]].length){Sr=!0;break}J.nodes.splice(oi,1),Qe[Gi.id]=void 0,Rn=!0}}if(Sr||!Rn&&hi!==0)break;Dr=zt.length;for(var Rs=Dr-1;Rs>=0;Rs--){var Pn=zt[Rs];if(!Qe[Pn.source]||!Qe[Pn.target]){zt.splice(Rs,1);var mo=Pn[s];if(mt[mo]--,Qe[Pn.source]&&(Qe[Pn.source].degree--,Qe[Pn.source].outDegree--),Qe[Pn.target]&&(Qe[Pn.target].degree--,Qe[Pn.target].inDegree--),x[mo]&&mt[mo]<x[mo].length){Sr=!0;break}Rn=!0}}hi++}if(Sr||Sr||J.nodes.length<t.nodes.length||zt.length<t.edges.length)return re.splice(Oe,1),"continue"},Zt=st-1;Zt>=0;Zt--){var qe=Nt(Zt);if(qe==="break")break}for(var ur=re.length,Dt=function(Oe){var J=re[Oe],We={};J.edges.forEach(function(zt){var mt="".concat(zt.source,"-").concat(zt.target,"-").concat(zt.label);We[mt]?We[mt]++:We[mt]=1});for(var Tt=function(mt){var wt=re[mt],pt={};wt.edges.forEach(function(kt){var Dr="".concat(kt.source,"-").concat(kt.target,"-").concat(kt.label);pt[Dr]?pt[Dr]++:pt[Dr]=1});var ar=!0;Object.keys(pt).length!==Object.keys(We).length?ar=!1:Object.keys(We).forEach(function(kt){pt[kt]!==We[kt]&&(ar=!1)}),ar&&re.splice(mt,1)},Qe=ur-1;Qe>Oe;Qe--)Tt(Qe);ur=re.length},Zt=0;Zt<=ur-1;Zt++)Dt(Zt);return re}}},pA=function(){function n(e){e===void 0&&(e=10),this.linkedList=new F7e,this.maxStep=e}return Object.defineProperty(n.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),n.prototype.isEmpty=function(){return!this.linkedList.head},n.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},n.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},n.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},n.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},n.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},n.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},n}(),oze=ese;const A7t={getAdjMatrix:i2,breadthFirstSearch:G7e,connectedComponent:Joe,getDegree:g_,getInDegree:U7e,getOutDegree:V7e,detectCycle:ese,detectDirectedCycle:oze,detectAllCycles:W7e,detectAllDirectedCycle:rse,detectAllUndirectedCycle:tse,depthFirstSearch:Qoe,dijkstra:BD,findAllPath:X7e,findShortestPath:j7e,floydWarshall:GD,labelPropagation:Y7e,louvain:ase,iLouvain:q7e,kCore:Z7e,kMeans:K7e,cosineSimilarity:ose,nodesCosineSimilarity:J7e,minimumSpanningTree:Q7e,pageRank:eze,getNeighbors:cv,Stack:pA,GADDI:aze},M7t=Object.freeze(Object.defineProperty({__proto__:null,getAdjMatrix:i2,breadthFirstSearch:G7e,connectedComponent:Joe,getDegree:g_,getInDegree:U7e,getOutDegree:V7e,detectCycle:ese,detectDirectedCycle:oze,detectAllCycles:W7e,detectAllDirectedCycle:rse,detectAllUndirectedCycle:tse,depthFirstSearch:Qoe,dijkstra:BD,findAllPath:X7e,findShortestPath:j7e,floydWarshall:GD,labelPropagation:Y7e,louvain:ase,iLouvain:q7e,kCore:Z7e,kMeans:K7e,cosineSimilarity:ose,nodesCosineSimilarity:J7e,minimumSpanningTree:Q7e,pageRank:eze,getNeighbors:cv,Stack:pA,GADDI:aze,default:A7t},Symbol.toStringTag,{value:"Module"}));var d9=sg,I7t=function(e){return function(t,r){return t[e]-r[e]}},_xe=function(e,t,r){return e>=t&&e<=r},GU=function(e,t,r,i){var a=1e-4,o={x:r.x-e.x,y:r.y-e.y},s={x:t.x-e.x,y:t.y-e.y},l={x:i.x-r.x,y:i.y-r.y},u=s.x*l.y-s.y*l.x,h=u*u,c=1/u,f=s.x*s.x+s.y*s.y,d=l.x*l.x+l.y*l.y;if(h>a*f*d){var v=(o.x*l.y-o.y*l.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!_xe(v,0,1)||!_xe(p,0,1)?null:{x:e.x+v*s.x,y:e.y+v*s.y}}return null},sze=function(e,t){var r=e.x,i=e.y,a=e.width,o=e.height,s=r+a/2,l=i+o/2,u=[],h={x:s,y:l};u.push({x:r,y:i}),u.push({x:r+a,y:i}),u.push({x:r+a,y:i+o}),u.push({x:r,y:i+o}),u.push({x:r,y:i});for(var c=null,f=1;f<u.length&&(c=GU(u[f-1],u[f],h,t),!c);f++);return c},lze=function(e,t){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,l=o-r,u=s-i;if(l*l+u*u<a*a)return null;var h=Math.atan(u/l);return{x:r+Math.abs(a*Math.cos(h))*Math.sign(l),y:i+Math.abs(a*Math.sin(h))*Math.sign(u)}},uze=function(e,t){var r=e.rx,i=e.ry,a=e.x,o=e.y,s=t.x-a,l=t.y-o,u=Math.atan2(l/i,s/r);return u<0&&(u+=2*Math.PI),{x:a+r*Math.cos(u),y:o+i*Math.sin(u)}},$A=function(e,t,r){r===void 0&&(r=1);var i=[e.x,e.y,r];return(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]),FU(i,i,t),{x:i[0],y:i[1]}},hze=function(e,t,r){r===void 0&&(r=1),(!t||isNaN(t[0]))&&(t=[1,0,0,0,1,0,0,0,1]);var i=Foe([1,0,0,0,1,0,0,0,1],t);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[e.x,e.y,r];return FU(a,a,i),{x:a[0],y:a[1]}},OQ=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=e.x-r.x,s=e.y-r.y,l=(e.x*e.x-t.x*t.x-t.y*t.y+e.y*e.y)/2,u=(e.x*e.x-r.x*r.x-r.y*r.y+e.y*e.y)/2,h=a*o-i*s;return{x:-(s*l-a*u)/h,y:-(i*u-o*l)/h}},v9=function(e,t){var r=e.x-t.x,i=e.y-t.y;return Math.sqrt(r*r+i*i)},L7t=function(e,t){var r=[];return e.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*t)}),r.push(a)}),r},P7t=function(e){for(var t=[],r=e.length,i=0;i<r;i+=1){t[i]=[];for(var a=0;a<r;a+=1)i===a?t[i][a]=0:e[i][a]===0||!e[i][a]?t[i][a]=1/0:t[i][a]=e[i][a]}for(var o=0;o<r;o+=1)for(var i=0;i<r;i+=1)for(var a=0;a<r;a+=1)t[i][a]>t[i][o]+t[o][a]&&(t[i][a]=t[i][o]+t[o][a]);return t},O7t=function(e,t){var r=e.nodes,i=e.edges,a=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,h=o[l],c=o[u];a[h][c]=1,t||(a[c][h]=1)}),a},cze=function(e,t){e.translate(t.x,t.y)},RQ=function(e,t,r,i){i===void 0&&(i={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,l=t.y-o.minY;if(r){var u=s*a[0],h=l*a[4],c=0,f=0,d=0,v=0;e.animate(function(g){return d=u*g,v=h*g,a=d9(a,[["t",d-c,v-f]]),c=d,f=v,{matrix:a}},i)}else{var p=d9(a,[["t",s,l]]);e.setMatrix(p)}},R7t=function(e,t){var r=e.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var i=t;vn(t)||(i=[t,t]),vn(t)&&t.length===1&&(i=[t[0],t[0]]),r=d9(r,[["s",i[0],i[1]]]),e.setMatrix(r)},D7t=function(e,t){var r=e.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=d9(r,[["r",t]]),e.setMatrix(r)},N7t=function(e,t,r){for(var i=[],a=0;a<e;a++)i[a]=0;return r.forEach(function(o){o.source&&(i[t[o.source]]+=1),o.target&&(i[t[o.target]]+=1)}),i};function k7t(n,e,t){return(t[0]-n[0])*(e[1]-n[1])===(e[0]-n[0])*(t[1]-n[1])&&Math.min(n[0],e[0])<=t[0]&&t[0]<=Math.max(n[0],e[0])&&Math.min(n[1],e[1])<=t[1]&&t[1]<=Math.max(n[1],e[1])}var zD=function(e,t,r){var i=!1,a=e.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var l=0;l<a;l++){var u=e[l],h=e[(l+1)%a];if(k7t(u,h,[t,r]))return!0;s(u[1]-r)>0!=s(h[1]-r)>0&&s(t-(r-u[1])*(u[0]-h[0])/(u[1]-h[1])-u[0])<0&&(i=!i)}return i},fze=function(e,t){return!(t.minX>e.maxX||t.maxX<e.minX||t.minY>e.maxY||t.maxY<e.minY)},F7t=function(e,t){var r=!1;return At(e,function(i){if(GU(i.from,i.to,t.from,t.to))return r=!0,!1}),r},dze=function(e,t){var r=function(f){var d=f.map(function(p){return p[0]}),v=f.map(function(p){return p[1]});return{minX:Math.min.apply(null,d),maxX:Math.max.apply(null,d),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(f){for(var d=[],v=f.length,p=0;p<v-1;p++){var g=f[p],m=f[p+1];d.push({from:{x:g[0],y:g[1]},to:{x:m[0],y:m[1]}})}if(d.length>1){var y=f[0],_=f[v-1];d.push({from:{x:_[0],y:_[1]},to:{x:y[0],y:y[1]}})}return d};if(e.length<2||t.length<2)return!1;var a=r(e),o=r(t);if(!fze(a,o))return!1;var s=!1;if(At(t,function(c){if(zD(e,c[0],c[1]))return s=!0,!1}),s||(At(e,function(c){if(zD(t,c[0],c[1]))return s=!0,!1}),s))return!0;var l=i(e),u=i(t),h=!1;return At(u,function(c){if(F7t(l,c))return h=!0,!1}),h},a2=function(){function n(e,t,r,i){this.x1=e,this.y1=t,this.x2=r,this.y2=i}return n.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:r,maxY:i,width:r-e,height:i-t};return a},n}(),sse=function(e,t){var r={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return r[t]},B7t=function(e,t){var r=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),i=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=r/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},vze=function(e,t){for(var r=["top","left","bottom","right"],i=e.getBBox(),a=0,o=[],s=0;s<4;s++){var l=sse(i,r[s]),u=l[0],h=l[1],c=l[2],f=l[3];o[s]=GU({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:u,y:h},{x:c,y:f}),o[s]&&(a+=1)}return[o,a]},lse=function(e,t){for(var r=["top","left","bottom","right"],i=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var l=sse(i,r[s]),u=l[0],h=l[1],c=l[2],f=l[3],d=B7t(t,new a2(u,h,c,f));d=Math.abs(d-.5),d>=0&&d<=1&&(o+=1,a=d<a?d:a)}return o===0?-1:a},pze=function(e){var t=0,r=0;if(e.length>0){for(var i=0,a=e;i<a.length;i++){var o=a[i];t+=o.x,r+=o.y}t/=e.length,r/=e.length}return{x:t,y:r}},p9=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},gze=function(e,t){var r=t.x1,i=t.y1,a=t.x2-r,o=t.y2-i,s=e.x-r,l=e.y-i,u=s*a+l*o,h;u<=0?h=0:(s=a-s,l=o-l,u=s*a+l*o,u<=0?h=0:h=u*u/(a*a+o*o));var c=s*s+l*l-h;return c<0&&(c=0),c},DQ=function(e,t,r){return r===void 0&&(r=.001),Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(r,2)},yze=function(e,t){var r=e.x<t.x,i=e.x>t.x+t.width,a=e.y>t.y+t.height,o=e.y<t.y,s=r||i||a||o;if(!s)return 0;if(a&&!r&&!i)return Math.pow(t.y+t.height-e.y,2);if(o&&!r&&!i)return Math.pow(e.y-t.y,2);if(r&&!a&&!o)return Math.pow(t.x-e.x,2);if(i&&!a&&!o)return Math.pow(t.x+t.width-e.x,2);var l=Math.min(Math.abs(t.x-e.x),Math.abs(t.x+t.width-e.x)),u=Math.min(Math.abs(t.y-e.y),Math.abs(t.y+t.height-e.y));return l*l+u*u},G7t=function(e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=t.x,l=t.y,u=[a-r,o-i];if(Koe(u,[0,0]))return NaN;var h=[-u[1],u[0]];SS(h,h);var c=[s-r,l-i];return Math.abs(Zoe(c,h))},use=function(e,t,r){return e+(t-e)*r},NQ=function(e,t,r){for(var i=Math.min(e.length,t.length),a=new Array(i),o=0;o<i;o++)a[o]=use(e[o],t[o],r);return a};const z7t=Object.freeze(Object.defineProperty({__proto__:null,compare:I7t,getLineIntersect:GU,getRectIntersectByPoint:sze,getCircleIntersectByPoint:lze,getEllipseIntersectByPoint:uze,applyMatrix:$A,invertMatrix:hze,getCircleCenterByPoints:OQ,distance:v9,scaleMatrix:L7t,floydWarshall:P7t,getAdjMatrix:O7t,translate:cze,move:RQ,scale:R7t,rotate:D7t,getDegree:N7t,isPointInPolygon:zD,intersectBBox:fze,isPolygonsIntersect:dze,Line:a2,getBBoxBoundLine:sse,itemIntersectByLine:vze,fractionToLine:lse,getPointsCenter:pze,squareDist:p9,pointLineSquareDist:gze,isPointsOverlap:DQ,pointRectSquareDist:yze,pointLineDistance:G7t,lerp:use,lerpArray:NQ},Symbol.toStringTag,{value:"Module"}));var fx="rgb(95, 149, 255)",U7t="rgb(255, 255, 255)",xxe="rgb(0, 0, 0)",CX="rgb(247, 250, 255)",mze="rgb(239, 244, 255)",a5="rgb(253, 253, 253)",Sxe="rgb(250, 250, 250)",o5="rgb(224, 224, 224)",wxe="rgb(234, 234, 234)",V7t="rgb(245, 245, 245)",$7t="rgb(191, 213, 255)",bxe="#4572d9",W7t="rgb(223, 234, 255)",ja={mainStroke:fx,mainFill:mze,activeStroke:fx,activeFill:CX,inactiveStroke:$7t,inactiveFill:CX,selectedStroke:fx,selectedFill:U7t,highlightStroke:bxe,highlightFill:W7t,disableStroke:o5,disableFill:Sxe,edgeMainStroke:o5,edgeActiveStroke:fx,edgeInactiveStroke:wxe,edgeSelectedStroke:fx,edgeHighlightStroke:fx,edgeDisableStroke:V7t,comboMainStroke:o5,comboMainFill:a5,comboActiveStroke:fx,comboActiveFill:CX,comboInactiveStroke:o5,comboInactiveFill:a5,comboSelectedStroke:fx,comboSelectedFill:a5,comboHighlightStroke:bxe,comboHighlightFill:a5,comboDisableStroke:wxe,comboDisableFill:Sxe};const tn={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:ja.mainStroke,fill:mze},size:20,color:ja.mainStroke,linkPoints:{size:8,lineWidth:1,fill:ja.activeFill,stroke:ja.activeStroke}},nodeStateStyles:{active:{fill:ja.activeFill,stroke:ja.activeStroke,lineWidth:2,shadowColor:ja.mainStroke,shadowBlur:10},selected:{fill:ja.selectedFill,stroke:ja.selectedStroke,lineWidth:4,shadowColor:ja.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:ja.highlightFill,stroke:ja.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:ja.inactiveFill,stroke:ja.inactiveStroke,lineWidth:1},disable:{fill:ja.disableFill,stroke:ja.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:xxe,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:ja.edgeMainStroke,lineAppendWidth:2},color:ja.edgeMainStroke},edgeStateStyles:{active:{stroke:ja.edgeActiveStroke,lineWidth:1},selected:{stroke:ja.edgeSelectedStroke,lineWidth:2,shadowColor:ja.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ja.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:ja.edgeInactiveStroke,lineWidth:1},disable:{stroke:ja.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:xxe,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:ja.comboMainFill,lineWidth:1,stroke:ja.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:ja.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:ja.comboActiveStroke,lineWidth:1,fill:ja.comboActiveFill},selected:{stroke:ja.comboSelectedStroke,lineWidth:2,fill:ja.comboSelectedFill,shadowColor:ja.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ja.comboHighlightStroke,lineWidth:2,fill:ja.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:ja.comboInactiveStroke,fill:ja.comboInactiveFill,lineWidth:1},disable:{stroke:ja.comboDisableStroke,fill:ja.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},H7t={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var _y=Math.PI,kQ=Math.sin,FQ=Math.cos,bh=kQ(_y/8),Eh=FQ(_y/8),g9=function(e,t){var r=e.getBBox(),i={x:r.minX,y:r.minY},a={x:r.maxX,y:r.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=$A(i,o),a=$A(a,o)}var s=i.x,l=i.y,u=a.x,h=a.y;return{x:s,y:l,minX:s,minY:l,maxX:u,maxY:h,width:u-s,height:h-l}},_ze=function(e){var t=e.sourceNode||e.targetNode,r=t.get("group"),i=r.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},l=s.dist||Math.max(o.width,o.height)*2,u=s.position||tn.defaultLoopPosition,h=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[e.startPoint.x,e.startPoint.y],f=[e.endPoint.x,e.endPoint.y],d=o.height/2,v=o.width/2,p=d,g=d,m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,S=a.get("type"),w=Math.min(d/2,v/2),b=Math.min(d,v),E=s!=null&&s.pointPadding?Math.min(b,s==null?void 0:s.pointPadding):w;if(c[0]===f[0]&&c[1]===f[1]){switch(u){case"top":S==="circle"?(c=[h[0]-m,h[1]-y],f=[h[0]+_,h[1]-x]):(c=[h[0]-E,h[1]-d],f=[h[0]+E,h[1]-d]);break;case"top-right":p=d,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+m,h[1]-y],f=[h[0]+x,h[1]-_]):(c=[h[0]+v-E,h[1]-d],f=[h[0]+v,h[1]-d+E]);break;case"right":p=v,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+y,h[1]-m],f=[h[0]+x,h[1]+_]):(c=[h[0]+v,h[1]-E],f=[h[0]+v,h[1]+E]);break;case"bottom-right":p=v,g=d,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+y,h[1]+m],f=[h[0]+_,h[1]+x]):(c=[h[0]+v,h[1]+d-E],f=[h[0]+v-E,h[1]+d]);break;case"bottom":p=d,g=d,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]+m,h[1]+y],f=[h[0]-_,h[1]+x]):(c=[h[0]-E,h[1]+d],f=[h[0]+E,h[1]+d]);break;case"bottom-left":p=d,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-m,h[1]+y],f=[h[0]-x,h[1]+_]):(c=[h[0]-v,h[1]+d-E],f=[h[0]-v+E,h[1]+d]);break;case"left":p=v,g=v,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-y,h[1]+m],f=[h[0]-x,h[1]-_]):(c=[h[0]-v,h[1]-E],f=[h[0]-v,h[1]+E]);break;case"top-left":p=v,g=d,S==="circle"?(m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-y,h[1]-m],f=[h[0]-_,h[1]-x]):(c=[h[0]-v+E,h[1]-d],f=[h[0]-v,h[1]-d+E]);break;default:p=v,g=v,m=p*bh,y=p*Eh,_=g*bh,x=g*Eh,c=[h[0]-m,h[1]-y],f=[h[0]+_,h[1]-x]}if(s.clockwise===!1){var T=[c[0],c[1]];c=[f[0],f[1]],f=[T[0],T[1]]}}var C=[c[0]-h[0],c[1]-h[1]],A=(p+l)/p,M=(g+l)/g;s.clockwise===!1&&(A=(g+l)/g,M=(p+l)/p);var I=Gc([0,0],C,A),R=[h[0]+I[0],h[1]+I[1]],k=[f[0]-h[0],f[1]-h[1]],D=Gc([0,0],k,M),G=[h[0]+D[0],h[1]+D[1]];return e.startPoint={x:c[0],y:c[1]},e.endPoint={x:f[0],y:f[1]},e.controlPoints=[{x:R[0],y:R[1]},{x:G[0],y:G[1]}],e},xze=function(e,t,r,i,a){var o=1e-4,s=[],l=e==null?void 0:e.getPoint(t);if(!l)return{x:0,y:0,angle:0};if(t<o)s=e.getStartTangent().reverse();else if(t>1-o)s=e.getEndTangent();else{var u=e==null?void 0:e.getPoint(t+o);s.push([l.x,l.y]),s.push([u.x,u.y])}var h=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(h<0&&(h+=_y*2),r&&(l.x+=FQ(h)*r,l.y+=kQ(h)*r),i){var c=h-_y/2;h>1/2*_y&&h<3*1/2*_y&&(c-=_y),l.x+=FQ(c)*i,l.y+=kQ(c)*i}var f={x:l.x,y:l.y,angle:h};return a?(h>.5*_y&&h<1.5*_y&&(h-=_y),ve({rotate:h},f)):f},j7t=function n(e,t,r,i){if(i(e,t,r)===!1)return!1;if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!n(e.children[a],e,a,i))return!1}return!0},X7t=function n(e,t,r,i){if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!n(e.children[a],e,a,i))return}return i(e,t,r)!==!1},Fc=function(e,t){typeof t=="function"&&j7t(e,null,-1,t)},xy=function(e,t){typeof t=="function"&&X7t(e,null,-1,t)},Sze=function(e,t){return t*(H7t[e]||1)},wze=function(e,t){var r=0,i=new RegExp("[\u4E00-\u9FA5]+");return e.split("").forEach(function(a){i.test(a)?r+=t:r+=Sze(a,t)}),[r,t]},bze=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},BQ=function(e,t){var r=[],i={},a={};e.forEach(function(l){a[l.id]=l}),e.forEach(function(l,u){var h=Xi(l);h.itemType="combo",h.children=void 0,h.parentId===h.id?(console.warn("The parentId for combo ".concat(h.id," can not be the same as the combo's id")),delete h.parentId):h.parentId&&!a[h.parentId]&&(console.warn("The parent combo for combo ".concat(h.id," does not exist!")),delete h.parentId);var c=i[h.id];if(c){if(h.children=c.children,i[h.id]=h,c=h,!c.parentId){r.push(c);return}var f=i[c.parentId];if(f)f.children?f.children.push(h):f.children=[h];else{var d={id:c.parentId,children:[c]};i[c.parentId]=d,i[h.id]=h}return}if(rr(l.parentId)){var v=i[l.parentId];if(v)v.children?v.children.push(h):v.children=[h],i[h.id]=h;else{var p={id:l.parentId,children:[h]};i[p.id]=p,i[h.id]=h}}else r.push(h),i[h.id]=h});var o={};(t||[]).forEach(function(l){o[l.id]=l;var u=i[l.comboId];if(u){var h={id:l.id,comboId:l.comboId};u.children?u.children.push(h):u.children=[h],h.itemType="node",i[l.id]=h}});var s=0;return r.forEach(function(l){l.depth=s+10,Fc(l,function(u){var h,c=i[u.id].itemType;c==="node"?h=i[u.comboId]:h=i[u.parentId],h&&c==="node"?u.depth=s+1:u.depth=s+10,s<u.depth&&(s=u.depth);var f=o[u.id];return f&&(f.depth=u.depth),!0})}),r},GQ=function(e,t,r){var i,a=e,o,s={root:{children:e}},l=!1,u="root";(e||[]).forEach(function(v){if(!l){if(v.id===t){o=v,v.itemType==="combo"?o.parentId=r:o.comboId=r,l=!0;return}Fc(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||t===p.id)&&a?(u=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=r:o.comboId=r,l=!0,!1):!0})}}),a=(i=s[u])===null||i===void 0?void 0:i.children;var h=a?a.indexOf(o):-1;if(h>-1&&a.splice(h,1),l||(o={id:t,itemType:"node",comboId:r},s[t]={children:void 0}),t){var c=!1;if(r){var f=0;(e||[]).forEach(function(v){c||Fc(v,function(p){return r===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],f=p.depth,o.itemType==="node"?o.depth=f+2:o.depth=f+1,!1):!0})})}else(!r||!c)&&o.itemType!=="node"&&e.push(o);var d=o.depth;Fc(o,function(v){return v.itemType==="node"?d+=2:d+=1,v.depth=d,!0})}return e},HB=function(e,t,r){var i={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!e||e.length===0){var a=r==null?void 0:r.getModel(),o=a||{},s=o.x,l=o.y,u=o.fixSize,h=o.collapsed,c=o.fixCollapseSize,f=h?c:u,d=vn(f)?f:[f,f],v=d[0],p=d[1],g=[v/2,p/2];return{minX:s-g[0],minY:l-g[1],maxX:s+g[0],maxY:l+g[1],x:s,y:l,width:v,height:p}}return e.forEach(function(m){var y=t.findById(m.id);if(!(!y||!y.isVisible())){y.set("bboxCanvasCache",void 0);var _=y.getCanvasBBox();_.x&&i.minX>_.minX&&(i.minX=_.minX),_.y&&i.minY>_.minY&&(i.minY=_.minY),_.x&&i.maxX<_.maxX&&(i.maxX=_.maxX),_.y&&i.maxY<_.maxY&&(i.maxY=_.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(r==null?void 0:r.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(m){(i[m]===1/0||i[m]===-1/0)&&(i[m]=void 0)}),i},Y7t=function(e){var t=on(e.x)||on(e.y)||e.type||e.anchorPoints||e.size;return e.style&&(t=t||on(e.style.r)||on(e.style.width)||on(e.style.height)||on(e.style.rx)||on(e.style.ry)),t},jB=function(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r];if(!(r==="img"&&!rr(i)))if(Wh(i)&&!vn(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!rr(s)||(a[o]=Xi(s))}),t[r]=a}else t[r]=Xi(i)}),t},UD=function(e){var t=e.animateCfg,r=e.callback,i;if(!t)i={duration:500,callback:r};else if(i=Xi(t),t.callback){var a=t.callback;i.callback=function(){r(),a()}}else i.callback=r;return i};const q7t=Object.freeze(Object.defineProperty({__proto__:null,getBBox:g9,getLoopCfgs:_ze,getLabelPosition:xze,traverseTree:Fc,traverseTreeUp:xy,getLetterWidth:Sze,getTextSize:wze,truncateLabelByLength:bze,plainCombosToTrees:BQ,reconstructTree:GQ,getComboBBox:HB,shouldRefreshEdge:Y7t,cloneBesidesImg:jB,getAnimateCfgWithCallback:UD},Symbol.toStringTag,{value:"Module"}));var Exe=function(e){if(!e)return console.error("G6 Error Tips: the data must be defined"),!1;var t=e.nodes,r=e.edges,i=e.combos,a=i===void 0?[]:i;if(!t&&!r){var o=!0;return Fc(e,function(f){return rr(f.id)?!0:(o=!1,!1)}),o}var s=(t||[]).find(function(f){return!rr(f.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var l=(t||[]).map(function(f){return f.id}),u=a==null?void 0:a.map(function(f){return f.id}),h=_v(_v([],l,!0),u,!0),c=(r||[]).find(function(f){return!h.includes(f.source)||!h.includes(f.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Z7t=function(e,t){if(e==="node"||e==="combo"){if(t.id&&!rr(t.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(t.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(e==="edge"&&(!t.source||!t.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},K7t=function(){function n(e){this.graph=e,this.destroyed=!1,this.modes=e.get("modes")||{default:[]},this.formatModes(),this.mode=e.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return n.prototype.formatModes=function(){var e=this.modes;At(e,function(t){At(t,function(r,i){rr(r)&&(t[i]={type:r})})})},n.prototype.setBehaviors=function(e){var t=this.graph,r=this.modes[e],i=[],a;At(r||[],function(o){var s=koe.getBehavior(o.type||o);!s||(a=new s(o),a&&(a.bind(t),i.push(a)))}),this.currentBehaves=i},n.mergeBehaviors=function(e,t){return At(t,function(r){e.indexOf(r)<0&&(rr(r)&&(r={type:r}),e.push(r))}),e},n.filterBehaviors=function(e,t){var r=[];return e.forEach(function(i){var a="";rr(i)?a=i:a=i.type,t.indexOf(a)<0&&r.push(i)}),r},n.prototype.setMode=function(e){var t=this,r=t.modes,i=t.graph,a=e,o=r[a];!o||(i.emit("beforemodechange",{mode:e}),At(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:e}),this.mode=e)},n.prototype.getMode=function(){return this.mode},n.prototype.manipulateBehaviors=function(e,t,r){var i=this,a;if(vn(e)?a=e:a=[e],vn(t))return At(t,function(s){i.modes[s]?r?i.modes[s]=n.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=n.filterBehaviors(i.modes[s]||[],a):r&&(i.modes[s]=a)}),this;var o=t;return t||(o=this.mode),this.modes[o]||r&&(this.modes[o]=a),r?this.modes[o]=n.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=n.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},n.prototype.updateBehavior=function(e,t,r){rr(e)&&(e={type:e});var i=[];if(!r||r===this.mode||r==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===e.type)return s.updateCfg(t),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[r],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var l=i.length,o=0;o<l;o++){var s=i[o];if(s.type===e.type||s===e.type)return s===e.type&&(s={type:s}),Object.assign(s,t),i[o]=s,this;o===l-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},n.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},n}(),vR=`
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,J7t=new RegExp("([a-z])["+vR+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+vR+"]*,?["+vR+"]*)+)","ig"),Q7t=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+vR+"]*,?["+vR+"]*","ig"),gA=function(n){if(!n)return null;if(vn(n))return n;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(n).replace(J7t,function(r,i,a){var o=[],s=i.toLowerCase();if(a.replace(Q7t,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return n}),t},zQ=function(n,e){for(var t=[],r=0,i=n.length;i-2*!e>r;r+=2){var a=[{x:+n[r-2],y:+n[r-1]},{x:+n[r],y:+n[r+1]},{x:+n[r+2],y:+n[r+3]},{x:+n[r+4],y:+n[r+5]}];e?r?i-4===r?a[3]={x:+n[0],y:+n[1]}:i-2===r&&(a[2]={x:+n[0],y:+n[1]},a[3]={x:+n[2],y:+n[3]}):a[0]={x:+n[i-2],y:+n[i-1]}:i-4===r?a[3]=a[2]:r||(a[0]={x:+n[r],y:+n[r+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},s5=function(n,e,t,r,i){var a=[];if(i===null&&r===null&&(r=t),n=+n,e=+e,t=+t,r=+r,i!==null){var o=Math.PI/180,s=n+t*Math.cos(-r*o),l=n+t*Math.cos(-i*o),u=e+t*Math.sin(-r*o),h=e+t*Math.sin(-i*o);a=[["M",s,u],["A",t,t,0,+(i-r>180),0,l,h]]}else a=[["M",n,e],["m",0,-r],["a",t,r,0,1,1,0,2*r],["a",t,r,0,1,1,0,-2*r],["z"]];return a},UQ=function(n){if(n=gA(n),!n||!n.length)return[["M",0,0]];var e=[],t=0,r=0,i=0,a=0,o=0,s,l;n[0][0]==="M"&&(t=+n[0][1],r=+n[0][2],i=t,a=r,o++,e[0]=["M",t,r]);for(var u=n.length===3&&n[0][0]==="M"&&n[1][0].toUpperCase()==="R"&&n[2][0].toUpperCase()==="Z",h=void 0,c=void 0,f=o,d=n.length;f<d;f++){if(e.push(h=[]),c=n[f],s=c[0],s!==s.toUpperCase())switch(h[0]=s.toUpperCase(),h[0]){case"A":h[1]=c[1],h[2]=c[2],h[3]=c[3],h[4]=c[4],h[5]=c[5],h[6]=+c[6]+t,h[7]=+c[7]+r;break;case"V":h[1]=+c[1]+r;break;case"H":h[1]=+c[1]+t;break;case"R":l=[t,r].concat(c.slice(1));for(var v=2,p=l.length;v<p;v++)l[v]=+l[v]+t,l[++v]=+l[v]+r;e.pop(),e=e.concat(zQ(l,u));break;case"O":e.pop(),l=s5(t,r,c[1],c[2]),l.push(l[0]),e=e.concat(l);break;case"U":e.pop(),e=e.concat(s5(t,r,c[1],c[2],c[3])),h=["U"].concat(e[e.length-1].slice(-2));break;case"M":i=+c[1]+t,a=+c[2]+r;break;default:for(var v=1,p=c.length;v<p;v++)h[v]=+c[v]+(v%2?t:r)}else if(s==="R")l=[t,r].concat(c.slice(1)),e.pop(),e=e.concat(zQ(l,u)),h=["R"].concat(c.slice(-2));else if(s==="O")e.pop(),l=s5(t,r,c[1],c[2]),l.push(l[0]),e=e.concat(l);else if(s==="U")e.pop(),e=e.concat(s5(t,r,c[1],c[2],c[3])),h=["U"].concat(e[e.length-1].slice(-2));else for(var g=0,m=c.length;g<m;g++)h[g]=c[g];if(s=s.toUpperCase(),s!=="O")switch(h[0]){case"Z":t=+i,r=+a;break;case"H":t=h[1];break;case"V":r=h[1];break;case"M":i=h[h.length-2],a=h[h.length-1];break;default:t=h[h.length-2],r=h[h.length-1]}}return e},l5=function(n,e,t,r){return[n,e,t,r,t,r]},Txe=function(n,e,t,r,i,a){var o=.3333333333333333,s=2/3;return[o*n+s*t,o*e+s*r,o*i+s*t,o*a+s*r,i,a]},Eze=function(n,e,t,r,i,a,o,s,l,u){t===r&&(t+=1);var h=Math.PI*120/180,c=Math.PI/180*(+i||0),f=[],d,v,p,g,m,y=function(oe,se,me){var Ce=oe*Math.cos(me)-se*Math.sin(me),Le=oe*Math.sin(me)+se*Math.cos(me);return{x:Ce,y:Le}};if(u)v=u[0],p=u[1],g=u[2],m=u[3];else{d=y(n,e,-c),n=d.x,e=d.y,d=y(s,l,-c),s=d.x,l=d.y,n===s&&e===l&&(s+=1,l+=1);var _=(n-s)/2,x=(e-l)/2,S=_*_/(t*t)+x*x/(r*r);S>1&&(S=Math.sqrt(S),t=S*t,r=S*r);var w=t*t,b=r*r,E=(a===o?-1:1)*Math.sqrt(Math.abs((w*b-w*x*x-b*_*_)/(w*x*x+b*_*_)));g=E*t*x/r+(n+s)/2,m=E*-r*_/t+(e+l)/2,v=Math.asin(((e-m)/r).toFixed(9)),p=Math.asin(((l-m)/r).toFixed(9)),v=n<g?Math.PI-v:v,p=s<g?Math.PI-p:p,v<0&&(v=Math.PI*2+v),p<0&&(p=Math.PI*2+p),o&&v>p&&(v=v-Math.PI*2),!o&&p>v&&(p=p-Math.PI*2)}var T=p-v;if(Math.abs(T)>h){var C=p,A=s,M=l;p=v+h*(o&&p>v?1:-1),s=g+t*Math.cos(p),l=m+r*Math.sin(p),f=Eze(s,l,t,r,i,0,o,A,M,[p,C,g,m])}T=p-v;var I=Math.cos(v),R=Math.sin(v),k=Math.cos(p),D=Math.sin(p),G=Math.tan(T/4),W=4/3*t*G,z=4/3*r*G,V=[n,e],q=[n+W*R,e-z*I],Y=[s+W*D,l-z*k],le=[s,l];if(q[0]=2*V[0]-q[0],q[1]=2*V[1]-q[1],u)return[q,Y,le].concat(f);f=[q,Y,le].concat(f).join().split(",");for(var j=[],Q=0,ie=f.length;Q<ie;Q++)j[Q]=Q%2?y(f[Q-1],f[Q],c).y:y(f[Q],f[Q+1],c).x;return j},VQ=function(n,e){var t=UQ(n),r=e&&UQ(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],l="",u="",h,c=function(_,x,S){var w,b;if(!_)return["C",x.x,x.y,x.x,x.y,x.x,x.y];switch(!(_[0]in{T:1,Q:1})&&(x.qx=x.qy=null),_[0]){case"M":x.X=_[1],x.Y=_[2];break;case"A":_=["C"].concat(Eze.apply(0,[x.x,x.y].concat(_.slice(1))));break;case"S":S==="C"||S==="S"?(w=x.x*2-x.bx,b=x.y*2-x.by):(w=x.x,b=x.y),_=["C",w,b].concat(_.slice(1));break;case"T":S==="Q"||S==="T"?(x.qx=x.x*2-x.qx,x.qy=x.y*2-x.qy):(x.qx=x.x,x.qy=x.y),_=["C"].concat(Txe(x.x,x.y,x.qx,x.qy,_[1],_[2]));break;case"Q":x.qx=_[1],x.qy=_[2],_=["C"].concat(Txe(x.x,x.y,_[1],_[2],_[3],_[4]));break;case"L":_=["C"].concat(l5(x.x,x.y,_[1],_[2]));break;case"H":_=["C"].concat(l5(x.x,x.y,_[1],x.y));break;case"V":_=["C"].concat(l5(x.x,x.y,x.x,_[1]));break;case"Z":_=["C"].concat(l5(x.x,x.y,x.X,x.Y));break}return _},f=function(_,x){if(_[x].length>7){_[x].shift();for(var S=_[x];S.length;)o[x]="A",r&&(s[x]="A"),_.splice(x++,0,["C"].concat(S.splice(0,6)));_.splice(x,1),h=Math.max(t.length,r&&r.length||0)}},d=function(_,x,S,w,b){_&&x&&_[b][0]==="M"&&x[b][0]!=="M"&&(x.splice(b,0,["M",w.x,w.y]),S.bx=0,S.by=0,S.x=_[b][1],S.y=_[b][2],h=Math.max(t.length,r&&r.length||0))};h=Math.max(t.length,r&&r.length||0);for(var v=0;v<h;v++){t[v]&&(l=t[v][0]),l!=="C"&&(o[v]=l,v&&(u=o[v-1])),t[v]=c(t[v],i,u),o[v]!=="A"&&l==="C"&&(o[v]="C"),f(t,v),r&&(r[v]&&(l=r[v][0]),l!=="C"&&(s[v]=l,v&&(u=s[v-1])),r[v]=c(r[v],a,u),s[v]!=="A"&&l==="C"&&(s[v]="C"),f(r,v)),d(t,r,i,a,v),d(r,t,a,i,v);var p=t[v],g=r&&r[v],m=p.length,y=r&&g.length;i.x=p[m-2],i.y=p[m-1],i.bx=parseFloat(p[m-4])||i.x,i.by=parseFloat(p[m-3])||i.y,a.bx=r&&(parseFloat(g[y-4])||a.x),a.by=r&&(parseFloat(g[y-3])||a.y),a.x=r&&g[y-2],a.y=r&&g[y-1]}return r?[t,r]:t},ezt=/,?([a-z]),?/gi,Tze=function(n){return n.join(",").replace(ezt,"$1")},Cxe=function(n,e,t,r,i){var a=-3*e+9*t-9*r+3*i,o=n*a+6*e-12*t+6*r;return n*o-3*e+3*t},Axe=function(n,e,t,r,i,a,o,s,l){l===null&&(l=1),l=l>1?1:l<0?0:l;for(var u=l/2,h=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,v=0;v<h;v++){var p=u*c[v]+u,g=Cxe(p,n,t,i,o),m=Cxe(p,e,r,a,s),y=g*g+m*m;d+=f[v]*Math.sqrt(y)}return u*d},tzt=function(n,e,t,r,i,a,o,s){for(var l=[],u=[[],[]],h,c,f,d,v=0;v<2;++v){if(v===0?(c=6*n-12*t+6*i,h=-3*n+9*t-9*i+3*o,f=3*t-3*n):(c=6*e-12*r+6*a,h=-3*e+9*r-9*a+3*s,f=3*r-3*e),Math.abs(h)<1e-12){if(Math.abs(c)<1e-12)continue;d=-f/c,d>0&&d<1&&l.push(d);continue}var p=c*c-4*f*h,g=Math.sqrt(p);if(!(p<0)){var m=(-c+g)/(2*h);m>0&&m<1&&l.push(m);var y=(-c-g)/(2*h);y>0&&y<1&&l.push(y)}}for(var _=l.length,x=_,S;_--;)d=l[_],S=1-d,u[0][_]=S*S*S*n+3*S*S*d*t+3*S*d*d*i+d*d*d*o,u[1][_]=S*S*S*e+3*S*S*d*r+3*S*d*d*a+d*d*d*s;return u[0][x]=n,u[1][x]=e,u[0][x+1]=o,u[1][x+1]=s,u[0].length=u[1].length=x+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}},rzt=function(n,e,t,r,i,a,o,s){if(!(Math.max(n,t)<Math.min(i,o)||Math.min(n,t)>Math.max(i,o)||Math.max(e,r)<Math.min(a,s)||Math.min(e,r)>Math.max(a,s))){var l=(n*r-e*t)*(i-o)-(n-t)*(i*s-a*o),u=(n*r-e*t)*(a-s)-(e-r)*(i*s-a*o),h=(n-t)*(a-s)-(e-r)*(i-o);if(!!h){var c=l/h,f=u/h,d=+c.toFixed(2),v=+f.toFixed(2);if(!(d<+Math.min(n,t).toFixed(2)||d>+Math.max(n,t).toFixed(2)||d<+Math.min(i,o).toFixed(2)||d>+Math.max(i,o).toFixed(2)||v<+Math.min(e,r).toFixed(2)||v>+Math.max(e,r).toFixed(2)||v<+Math.min(a,s).toFixed(2)||v>+Math.max(a,s).toFixed(2)))return{x:c,y:f}}}},dx=function(n,e,t){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},Cze=function(n,e,t,r,i){if(i)return[["M",+n+ +i,e],["l",t-i*2,0],["a",i,i,0,0,1,i,i],["l",0,r-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-t,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-r],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",n,e],["l",t,0],["l",0,r],["l",-t,0],["z"]];return a.parsePathArray=Tze,a},$Q=function(n,e,t,r){return n===null&&(n=e=t=r=0),e===null&&(e=n.y,t=n.width,r=n.height,n=n.x),{x:n,y:e,width:t,w:t,height:r,h:r,x2:n+t,y2:e+r,cx:n+t/2,cy:e+r/2,r1:Math.min(t,r)/2,r2:Math.max(t,r)/2,r0:Math.sqrt(t*t+r*r)/2,path:Cze(n,e,t,r),vb:[n,e,t,r].join(" ")}},nzt=function(n,e){return n=$Q(n),e=$Q(e),dx(e,n.x,n.y)||dx(e,n.x2,n.y)||dx(e,n.x,n.y2)||dx(e,n.x2,n.y2)||dx(n,e.x,e.y)||dx(n,e.x2,e.y)||dx(n,e.x,e.y2)||dx(n,e.x2,e.y2)||(n.x<e.x2&&n.x>e.x||e.x<n.x2&&e.x>n.x)&&(n.y<e.y2&&n.y>e.y||e.y<n.y2&&e.y>n.y)},Mxe=function(n,e,t,r,i,a,o,s){vn(n)||(n=[n,e,t,r,i,a,o,s]);var l=tzt.apply(null,n);return $Q(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},Ixe=function(n,e,t,r,i,a,o,s,l){var u=1-l,h=Math.pow(u,3),c=Math.pow(u,2),f=l*l,d=f*l,v=h*n+c*3*l*t+u*3*l*l*i+d*o,p=h*e+c*3*l*r+u*3*l*l*a+d*s,g=n+2*l*(t-n)+f*(i-2*t+n),m=e+2*l*(r-e)+f*(a-2*r+e),y=t+2*l*(i-t)+f*(o-2*i+t),_=r+2*l*(a-r)+f*(s-2*a+r),x=u*n+l*t,S=u*e+l*r,w=u*i+l*o,b=u*a+l*s,E=90-Math.atan2(g-y,m-_)*180/Math.PI;return{x:v,y:p,m:{x:g,y:m},n:{x:y,y:_},start:{x,y:S},end:{x:w,y:b},alpha:E}},izt=function(n,e,t){var r=Mxe(n),i=Mxe(e);if(!nzt(r,i))return t?0:[];for(var a=Axe.apply(0,n),o=Axe.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],h=[],c={},f=t?0:[],d=0;d<s+1;d++){var v=Ixe.apply(0,n.concat(d/s));u.push({x:v.x,y:v.y,t:d/s})}for(var d=0;d<l+1;d++){var v=Ixe.apply(0,e.concat(d/l));h.push({x:v.x,y:v.y,t:d/l})}for(var d=0;d<s;d++)for(var p=0;p<l;p++){var g=u[d],m=u[d+1],y=h[p],_=h[p+1],x=Math.abs(m.x-g.x)<.001?"y":"x",S=Math.abs(_.x-y.x)<.001?"y":"x",w=rzt(g.x,g.y,m.x,m.y,y.x,y.y,_.x,_.y);if(w){if(c[w.x.toFixed(4)]===w.y.toFixed(4))continue;c[w.x.toFixed(4)]=w.y.toFixed(4);var b=g.t+Math.abs((w[x]-g[x])/(m[x]-g[x]))*(m.t-g.t),E=y.t+Math.abs((w[S]-y[S])/(_[S]-y[S]))*(_.t-y.t);b>=0&&b<=1&&E>=0&&E<=1&&(t?f+=1:f.push({x:w.x,y:w.y,t1:b,t2:E}))}}return f},azt=function(n,e,t){n=VQ(n),e=VQ(e);for(var r,i,a,o,s,l,u,h,c,f,d=t?0:[],v=0,p=n.length;v<p;v++){var g=n[v];if(g[0]==="M")r=s=g[1],i=l=g[2];else{g[0]==="C"?(c=[r,i].concat(g.slice(1)),r=c[6],i=c[7]):(c=[r,i,r,i,s,l,s,l],r=s,i=l);for(var m=0,y=e.length;m<y;m++){var _=e[m];if(_[0]==="M")a=u=_[1],o=h=_[2];else{_[0]==="C"?(f=[a,o].concat(_.slice(1)),a=f[6],o=f[7]):(f=[a,o,a,o,u,h,u,h],a=u,o=h);var x=izt(c,f,t);if(t)d+=x;else{for(var S=0,w=x.length;S<w;S++)x[S].segment1=v,x[S].segment2=m,x[S].bez1=c,x[S].bez2=f;d=d.concat(x)}}}}}return d},ozt=function(n,e){return azt(n,e)};function szt(n,e){var t=[],r=[];function i(a,o){if(a.length===1)t.push(a[0]),r.push(a[0]);else{for(var s=[],l=0;l<a.length-1;l++)l===0&&t.push(a[0]),l===a.length-2&&r.push(a[l+1]),s[l]=[(1-o)*a[l][0]+o*a[l+1][0],(1-o)*a[l][1]+o*a[l+1][1]];i(s,o)}}return n.length&&i(n,e),{left:t,right:r.reverse()}}function lzt(n,e,t){var r=[[n[1],n[2]]];t=t||2;var i=[];e[0]==="A"?(r.push(e[6]),r.push(e[7])):e[0]==="C"?(r.push([e[1],e[2]]),r.push([e[3],e[4]]),r.push([e[5],e[6]])):e[0]==="S"||e[0]==="Q"?(r.push([e[1],e[2]]),r.push([e[3],e[4]])):r.push([e[1],e[2]]);for(var a=r,o=1/t,s=0;s<t-1;s++){var l=o/(1-o*s),u=szt(a,l);i.push(u.left),a=u.right}i.push(a);var h=i.map(function(c){var f=[];return c.length===4&&(f.push("C"),f=f.concat(c[2])),c.length>=3&&(c.length===3&&f.push("Q"),f=f.concat(c[1])),c.length===2&&f.push("L"),f=f.concat(c[c.length-1]),f});return h}var uzt=function(n,e,t){if(t===1)return[[].concat(n)];var r=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")r=r.concat(lzt(n,e,t));else{var i=[].concat(n);i[0]==="M"&&(i[0]="L");for(var a=0;a<=t-1;a++)r.push(i)}return r},hzt=function(n,e){if(n.length===1)return n;var t=n.length-1,r=e.length-1,i=t/r,a=[];if(n.length===1&&n[0][0]==="M"){for(var o=0;o<r-t;o++)n.push(n[0]);return n}for(var o=0;o<r;o++){var s=Math.floor(i*o);a[s]=(a[s]||0)+1}var l=a.reduce(function(u,h,c){return c===t?u.concat(n[t]):u.concat(uzt(n[c],n[c+1],h))},[]);return l.unshift(n[0]),(e[r]==="Z"||e[r]==="z")&&l.push("Z"),l},czt=function(n,e){if(n.length!==e.length)return!1;var t=!0;return At(n,function(r,i){if(r!==e[i])return t=!1,!1}),t};function fzt(n,e,t){var r=null,i=t;return e<i&&(i=e,r="add"),n<i&&(i=n,r="del"),{type:r,min:i}}var dzt=function(n,e){var t=n.length,r=e.length,i,a,o=0;if(t===0||r===0)return null;for(var s=[],l=0;l<=t;l++)s[l]=[],s[l][0]={min:l};for(var u=0;u<=r;u++)s[0][u]={min:u};for(var l=1;l<=t;l++){i=n[l-1];for(var u=1;u<=r;u++){a=e[u-1],czt(i,a)?o=0:o=1;var h=s[l-1][u].min+1,c=s[l][u-1].min+1,f=s[l-1][u-1].min+o;s[l][u]=fzt(h,c,f)}}return s},Aze=function(n,e){var t=dzt(n,e),r=n.length,i=e.length,a=[],o=1,s=1;if(t[r][i].min!==r){for(var l=1;l<=r;l++){var u=t[l][l].min;s=l;for(var h=o;h<=i;h++)t[l][h].min<u&&(u=t[l][h].min,s=h);o=s,t[l][o].type&&a.push({index:l-1,type:t[l][o].type})}for(var l=a.length-1;l>=0;l--)o=a[l].index,a[l].type==="add"?n.splice(o,0,[].concat(n[o])):n.splice(o,1)}r=n.length;var c=i-r;if(r<i)for(var l=0;l<c;l++)n[r-1][0]==="z"||n[r-1][0]==="Z"?n.splice(r-2,0,n[r-2]):n.push(n[r-1]),r+=1;return n};function AX(n,e,t){for(var r=[].concat(n),i,a=1/(t+1),o=Mze(e)[0],s=1;s<=t;s++)a*=s,i=Math.floor(n.length*a),i===0?r.unshift([o[0]*a+n[i][0]*(1-a),o[1]*a+n[i][1]*(1-a)]):r.splice(i,0,[o[0]*a+n[i][0]*(1-a),o[1]*a+n[i][1]*(1-a)]);return r}function Mze(n){var e=[];switch(n[0]){case"M":e.push([n[1],n[2]]);break;case"L":e.push([n[1],n[2]]);break;case"A":e.push([n[6],n[7]]);break;case"Q":e.push([n[3],n[4]]),e.push([n[1],n[2]]);break;case"T":e.push([n[1],n[2]]);break;case"C":e.push([n[5],n[6]]),e.push([n[1],n[2]]),e.push([n[3],n[4]]);break;case"S":e.push([n[3],n[4]]),e.push([n[1],n[2]]);break;case"H":e.push([n[1],n[1]]);break;case"V":e.push([n[1],n[1]]);break}return e}var WQ=function(n,e){if(n.length<=1)return n;for(var t,r=0;r<e.length;r++)if(n[r][0]!==e[r][0])switch(t=Mze(n[r]),e[r][0]){case"M":n[r]=["M"].concat(t[0]);break;case"L":n[r]=["L"].concat(t[0]);break;case"A":n[r]=[].concat(e[r]),n[r][6]=t[0][0],n[r][7]=t[0][1];break;case"Q":if(t.length<2)if(r>0)t=AX(t,n[r-1],1);else{n[r]=e[r];break}n[r]=["Q"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"T":n[r]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(r>0)t=AX(t,n[r-1],2);else{n[r]=e[r];break}n[r]=["C"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(t.length<2)if(r>0)t=AX(t,n[r-1],1);else{n[r]=e[r];break}n[r]=["S"].concat(t.reduce(function(i,a){return i.concat(a)},[]));break;default:n[r]=e[r]}return n};const vzt=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:zQ,fillPath:hzt,fillPathByDiff:Aze,formatPath:WQ,intersection:ozt,parsePathArray:Tze,parsePathString:gA,pathToAbsolute:UQ,pathToCurve:VQ,rectPath:Cze},Symbol.toStringTag,{value:"Module"}));var Ize=function(){function n(e,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return n.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},n.prototype.save=function(){},n.prototype.restore=function(){},n}();function Lze(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1)}var Lxe=typeof window<"u"&&typeof window.document<"u";function Pze(n,e){if(n.isCanvas())return!0;for(var t=e.getParent(),r=!1;t;){if(t===n){r=!0;break}t=t.getParent()}return r}function HQ(n){return n.cfg.visible&&n.cfg.capture}var pzt=function(n){Kn(e,n);function e(t){var r=n.call(this)||this;r.destroyed=!1;var i=r.getDefaultCfg();return r.cfg=_n(i,t),r}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,r){this.cfg[t]=r},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(C9e),Pxe=globalThis&&globalThis.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))},gzt=function(){function n(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"}return n}(),yzt=function(){function n(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return n}(),mzt=function(){function n(e,t,r,i){this.name=e,this.version=t,this.os=r,this.bot=i,this.type="bot-device"}return n}(),_zt=function(){function n(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return n}(),xzt=function(){function n(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return n}(),Szt=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,wzt=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Oxe=3,bzt=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Szt]],Rxe=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Oze(n){return n?Dxe(n):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new xzt:typeof navigator<"u"?Dxe(navigator.userAgent):Czt()}function Ezt(n){return n!==""&&bzt.reduce(function(e,t){var r=t[0],i=t[1];if(e)return e;var a=i.exec(n);return!!a&&[r,a]},!1)}function Dxe(n){var e=Ezt(n);if(!e)return null;var t=e[0],r=e[1];if(t==="searchbot")return new _zt;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length<Oxe&&(i=Pxe(Pxe([],i,!0),Azt(Oxe-i.length),!0)):i=[];var a=i.join("."),o=Tzt(n),s=wzt.exec(n);return s&&s[1]?new mzt(t,a,o,s[1]):new gzt(t,a,o)}function Tzt(n){for(var e=0,t=Rxe.length;e<t;e++){var r=Rxe[e],i=r[0],a=r[1],o=a.exec(n);if(o)return i}return null}function Czt(){var n=typeof process<"u"&&process.version;return n?new yzt(process.version.slice(1)):null}function Azt(n){for(var e=[],t=0;t<n;t++)e.push("0");return e}function Nxe(n,e){var t=[],r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6],h=n[7],c=n[8],f=e[0],d=e[1],v=e[2],p=e[3],g=e[4],m=e[5],y=e[6],_=e[7],x=e[8];return t[0]=f*r+d*o+v*u,t[1]=f*i+d*s+v*h,t[2]=f*a+d*l+v*c,t[3]=p*r+g*o+m*u,t[4]=p*i+g*s+m*h,t[5]=p*a+g*l+m*c,t[6]=y*r+_*o+x*u,t[7]=y*i+_*s+x*h,t[8]=y*a+_*l+x*c,t}function cE(n,e){var t=[],r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function Rze(n){var e=[],t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=n[6],u=n[7],h=n[8],c=h*o-s*u,f=-h*a+s*l,d=u*a-o*l,v=t*c+r*f+i*d;return v?(v=1/v,e[0]=c*v,e[1]=(-h*r+i*u)*v,e[2]=(s*r-i*o)*v,e[3]=f*v,e[4]=(h*t-i*l)*v,e[5]=(-s*t+i*a)*v,e[6]=d*v,e[7]=(-u*t+r*l)*v,e[8]=(o*t-r*a)*v,e):null}var yP=sg,MX="matrix",Mzt=["zIndex","capture","visible","type"],Izt=["repeat"],Lzt=":",Pzt="*";function Ozt(n){for(var e=[],t=0;t<n.length;t++)vn(n[t])?e.push([].concat(n[t])):e.push(n[t]);return e}function Rzt(n,e){var t={},r=e.attrs;for(var i in n)t[i]=r[i];return t}function Dzt(n,e){var t={},r=e.attr();return At(n,function(i,a){Izt.indexOf(a)===-1&&!HS(r[a],i)&&(t[a]=i)}),t}function Nzt(n,e){if(e.onFrame)return n;var t=e.startTime,r=e.delay,i=e.duration,a=Object.prototype.hasOwnProperty;return At(n,function(o){t+r<o.startTime+o.delay+o.duration&&i>o.delay&&At(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),n}var Dze=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;r.attrs={};var i=r.getDefaultAttrs();return _n(i,t.attrs),r.attrs=i,r.initAttrs(i),r.initAnimate(),r}return e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=r[0],o=r[1];if(!a)return this.attrs;if(Wh(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return r.length===2?(this.setAttr(a,o),this.afterAttrsChange((t={},t[a]=o,t)),this):this.attrs[a]},e.prototype.isClipped=function(t,r){var i=this.getClip();return i&&!i.isHit(t,r)},e.prototype.setAttr=function(t,r){var i=this.attrs[t];i!==r&&(this.attrs[t]=r,this.onAttrChange(t,r,i))},e.prototype.onAttrChange=function(t,r,i){t==="matrix"&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var r=this.cfg.applyTo;r&&r.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var r=this.getParent();return r&&r.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(!!t){var r=t.getChildren();this.get("el");var i=r.indexOf(this);r.splice(i,1),r.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(!!t){var r=t.getChildren();this.get("el");var i=r.indexOf(this);r.splice(i,1),r.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){t===void 0&&(t=!0);var r=this.getParent();r?(Lze(r.getChildren(),this),r.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr(MX,this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr(MX)},e.prototype.setMatrix=function(t){this.attr(MX,t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var r=this.attr("matrix"),i=this.cfg.parentMatrix;i&&r?t=Nxe(i,r):t=r||i,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var r=this.attr("matrix"),i=null;t&&r?i=Nxe(t,r):i=r||t,this.set("totalMatrix",i),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var r=this.attr("matrix");return r?cE(r,t):t},e.prototype.invertFromMatrix=function(t){var r=this.attr("matrix");if(r){var i=Rze(r);if(i)return cE(i,t)}return t},e.prototype.setClip=function(t){var r=this.getCanvas(),i=null;if(t){var a=this.getShapeBase(),o=EM(t.type),s=a[o];s&&(i=new s({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:r}))}return this.set("clipShape",i),this.onCanvasChange("clip"),i},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,r=this.attrs,i={};At(r,function(s,l){vn(r[l])?i[l]=Ozt(r[l]):i[l]=r[l]});var a=this.constructor,o=new a({attrs:i});return At(Mzt,function(s){o.set(s,t.get(s))}),o},e.prototype.destroy=function(){var t=this.destroyed;t||(this.attrs={},n.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var i=this.get("timeline");i||(i=this.get("canvas").get("timeline"),this.set("timeline",i));var a=this.get("animations")||[];i.timer||i.initTimer();var o=t[0],s=t[1],l=t[2],u=l===void 0?"easeLinear":l,h=t[3],c=h===void 0?vO:h,f=t[4],d=f===void 0?0:f,v,p,g,m,y;nl(o)?(v=o,o={}):Wh(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),Wh(s)?(y=s,s=y.duration,u=y.easing||"easeLinear",d=y.delay||0,p=y.repeat||p||!1,c=y.callback||vO,g=y.pauseCallback||vO,m=y.resumeCallback||vO):(on(c)&&(d=c,c=null),nl(u)?(c=u,u="easeLinear"):u=u||"easeLinear");var _=Dzt(o,this),x={fromAttrs:Rzt(_,this),toAttrs:_,duration:s,easing:u,repeat:p,callback:c,pauseCallback:g,resumeCallback:m,delay:d,startTime:i.getTime(),id:vm(),onFrame:v,pathFormatted:!1};a.length>0?a=Nzt(a,x):i.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var r=this;t===void 0&&(t=!0);var i=this.get("animations");At(i,function(a){t&&(a.onFrame?r.attr(a.onFrame(1)):r.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),r=this.get("animations"),i=t.getTime();return At(r,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),r=t.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return At(i,function(o){o.startTime=o.startTime+(r-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},e.prototype.emitDelegation=function(t,r){var i=this,a=r.propagationPath;this.getEvents();var o;t==="mouseenter"?o=r.fromShape:t==="mouseleave"&&(o=r.toShape);for(var s=function(c){var f=a[c],d=f.get("name");if(d){if((f.isGroup()||f.isCanvas&&f.isCanvas())&&o&&Pze(f,o))return"break";vn(d)?At(d,function(v){i.emitDelegateEvent(f,v,r)}):l.emitDelegateEvent(f,d,r)}},l=this,u=0;u<a.length;u++){var h=s(u);if(h==="break")break}},e.prototype.emitDelegateEvent=function(t,r,i){var a=this.getEvents(),o=r+Lzt+i.type;(a[o]||a[Pzt])&&(i.name=o,i.currentTarget=t,i.delegateTarget=this,i.delegateObject=t.get("delegateObject"),this.emit(o,i))},e.prototype.translate=function(t,r){t===void 0&&(t=0),r===void 0&&(r=0);var i=this.getMatrix(),a=yP(i,[["t",t,r]]);return this.setMatrix(a),this},e.prototype.move=function(t,r){var i=this.attr("x")||0,a=this.attr("y")||0;return this.translate(t-i,r-a),this},e.prototype.moveTo=function(t,r){return this.move(t,r)},e.prototype.scale=function(t,r){var i=this.getMatrix(),a=yP(i,[["s",t,r||t]]);return this.setMatrix(a),this},e.prototype.rotate=function(t){var r=this.getMatrix(),i=yP(r,[["r",t]]);return this.setMatrix(i),this},e.prototype.rotateAtStart=function(t){var r=this.attr(),i=r.x,a=r.y,o=this.getMatrix(),s=yP(o,[["t",-i,-a],["r",t],["t",i,a]]);return this.setMatrix(s),this},e.prototype.rotateAtPoint=function(t,r,i){var a=this.getMatrix(),o=yP(a,[["t",-t,-r],["r",i],["t",t,r]]);return this.setMatrix(o),this},e}(pzt),kxe={},jQ="_INDEX";function Nze(n,e){if(n.set("canvas",e),n.isGroup()){var t=n.get("children");t.length&&t.forEach(function(r){Nze(r,e)})}}function kze(n,e){if(n.set("timeline",e),n.isGroup()){var t=n.get("children");t.length&&t.forEach(function(r){kze(r,e)})}}function kzt(n,e,t){t===void 0&&(t=!0),t?e.destroy():(e.set("parent",null),e.set("canvas",null)),Lze(n.getChildren(),e)}function Fzt(n){return function(e,t){var r=n(e,t);return r===0?e[jQ]-t[jQ]:r}}var Fze=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,r=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(l){return l.get("visible")&&(!l.isGroup()||l.isGroup()&&l.getChildren().length>0)});o.length>0?At(o,function(l){var u=l.getBBox(),h=u.minX,c=u.maxX,f=u.minY,d=u.maxY;h<t&&(t=h),c>r&&(r=c),f<i&&(i=f),d>a&&(a=d)}):(t=0,r=0,i=0,a=0);var s={x:t,y:i,minX:t,minY:i,maxX:r,maxY:a,width:r-t,height:a-i};return s},e.prototype.getCanvasBBox=function(){var t=1/0,r=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(l){return l.get("visible")&&(!l.isGroup()||l.isGroup()&&l.getChildren().length>0)});o.length>0?At(o,function(l){var u=l.getCanvasBBox(),h=u.minX,c=u.maxX,f=u.minY,d=u.maxY;h<t&&(t=h),c>r&&(r=c),f<i&&(i=f),d>a&&(a=d)}):(t=0,r=0,i=0,a=0);var s={x:t,y:i,minX:t,minY:i,maxX:r,maxY:a,width:r-t,height:a-i};return s},e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,r,i){if(n.prototype.onAttrChange.call(this,t,r,i),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var r=this.getTotalMatrix();n.prototype.applyMatrix.call(this,t);var i=this.getTotalMatrix();i!==r&&this._applyChildrenMarix(i)},e.prototype._applyChildrenMarix=function(t){var r=this.getChildren();At(r,function(i){i.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t[0],a=t[1];Wh(i)?a=i:a.type=i;var o=kxe[a.type];o||(o=EM(a.type),kxe[a.type]=o);var s=this.getShapeBase(),l=new s[o](a);return this.add(l),l},e.prototype.addGroup=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t[0],a=t[1],o;if(nl(i))a?o=new i(a):o=new i({parent:this});else{var s=i||{},l=this.getGroupBase();o=new l(s)}return this.add(o),o},e.prototype.getCanvas=function(){var t;return this.isCanvas()?t=this:t=this.get("canvas"),t},e.prototype.getShape=function(t,r,i){if(!HQ(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,t,r,i);else{var s=[t,r,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],i))}return o},e.prototype._findShape=function(t,r,i,a){for(var o=null,s=t.length-1;s>=0;s--){var l=t[s];if(HQ(l)&&(l.isGroup()?o=l.getShape(r,i,a):l.isHit(r,i)&&(o=l)),o)break}return o},e.prototype.add=function(t){var r=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&kzt(o,t,!1),t.set("parent",this),r&&Nze(t,r),a&&kze(t,a),i.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var r=this.getTotalMatrix();r&&t.applyMatrix(r)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t=this.getChildren();At(t,function(r,i){return r[jQ]=i,r}),t.sort(Fzt(function(r,i){return r.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),r=t.length-1;r>=0;r--)t[r].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),n.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){var r=this.getChildren();return r[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var r=this.getChildren();return r.indexOf(t)>-1},e.prototype.removeChild=function(t,r){r===void 0&&(r=!0),this.contain(t)&&t.remove(r)},e.prototype.findAll=function(t){var r=[],i=this.getChildren();return At(i,function(a){t(a)&&r.push(a),a.isGroup()&&(r=r.concat(a.findAll(t)))}),r},e.prototype.find=function(t){var r=null,i=this.getChildren();return At(i,function(a){if(t(a)?r=a:a.isGroup()&&(r=a.find(t)),r)return!1}),r},e.prototype.findById=function(t){return this.find(function(r){return r.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(r){return r.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(r){return r.get("name")===t})},e}(Dze),TM=0,gO=0,mP=0,Bze=1e3,y9,yO,m9=0,o2=0,zU=0,VD=typeof performance=="object"&&performance.now?performance:Date,Gze=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function zze(){return o2||(Gze(Bzt),o2=VD.now()+zU)}function Bzt(){o2=0}function XQ(){this._call=this._time=this._next=null}XQ.prototype=hse.prototype={constructor:XQ,restart:function(n,e,t){if(typeof n!="function")throw new TypeError("callback is not a function");t=(t==null?zze():+t)+(e==null?0:+e),!this._next&&yO!==this&&(yO?yO._next=this:y9=this,yO=this),this._call=n,this._time=t,YQ()},stop:function(){this._call&&(this._call=null,this._time=1/0,YQ())}};function hse(n,e,t){var r=new XQ;return r.restart(n,e,t),r}function Gzt(){zze(),++TM;for(var n=y9,e;n;)(e=o2-n._time)>=0&&n._call.call(null,e),n=n._next;--TM}function Fxe(){o2=(m9=VD.now())+zU,TM=gO=0;try{Gzt()}finally{TM=0,Uzt(),o2=0}}function zzt(){var n=VD.now(),e=n-m9;e>Bze&&(zU-=e,m9=n)}function Uzt(){for(var n,e=y9,t,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:y9=t);yO=n,YQ(r)}function YQ(n){if(!TM){gO&&(gO=clearTimeout(gO));var e=n-o2;e>24?(n<1/0&&(gO=setTimeout(Fxe,n-VD.now()-zU)),mP&&(mP=clearInterval(mP))):(mP||(m9=VD.now(),mP=setInterval(zzt,Bze)),TM=1,Gze(Fxe))}}function cse(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Uze(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function V3(){}var $D=.7,_9=1/$D,WA="\\s*([+-]?\\d+)\\s*",WD="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vzt=/^#([0-9a-f]{3,8})$/,$zt=new RegExp(`^rgb\\(${WA},${WA},${WA}\\)$`),Wzt=new RegExp(`^rgb\\(${Jy},${Jy},${Jy}\\)$`),Hzt=new RegExp(`^rgba\\(${WA},${WA},${WA},${WD}\\)$`),jzt=new RegExp(`^rgba\\(${Jy},${Jy},${Jy},${WD}\\)$`),Xzt=new RegExp(`^hsl\\(${WD},${Jy},${Jy}\\)$`),Yzt=new RegExp(`^hsla\\(${WD},${Jy},${Jy},${WD}\\)$`),Bxe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};cse(V3,HD,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Gxe,formatHex:Gxe,formatHex8:qzt,formatHsl:Zzt,formatRgb:zxe,toString:zxe});function Gxe(){return this.rgb().formatHex()}function qzt(){return this.rgb().formatHex8()}function Zzt(){return Vze(this).formatHsl()}function zxe(){return this.rgb().formatRgb()}function HD(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Vzt.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?Uxe(e):t===3?new pd(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?u5(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?u5(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=$zt.exec(n))?new pd(e[1],e[2],e[3],1):(e=Wzt.exec(n))?new pd(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Hzt.exec(n))?u5(e[1],e[2],e[3],e[4]):(e=jzt.exec(n))?u5(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Xzt.exec(n))?Wxe(e[1],e[2]/100,e[3]/100,1):(e=Yzt.exec(n))?Wxe(e[1],e[2]/100,e[3]/100,e[4]):Bxe.hasOwnProperty(n)?Uxe(Bxe[n]):n==="transparent"?new pd(NaN,NaN,NaN,0):null}function Uxe(n){return new pd(n>>16&255,n>>8&255,n&255,1)}function u5(n,e,t,r){return r<=0&&(n=e=t=NaN),new pd(n,e,t,r)}function Kzt(n){return n instanceof V3||(n=HD(n)),n?(n=n.rgb(),new pd(n.r,n.g,n.b,n.opacity)):new pd}function qQ(n,e,t,r){return arguments.length===1?Kzt(n):new pd(n,e,t,r==null?1:r)}function pd(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}cse(pd,qQ,Uze(V3,{brighter(n){return n=n==null?_9:Math.pow(_9,n),new pd(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?$D:Math.pow($D,n),new pd(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new pd(NE(this.r),NE(this.g),NE(this.b),x9(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Vxe,formatHex:Vxe,formatHex8:Jzt,formatRgb:$xe,toString:$xe}));function Vxe(){return`#${fE(this.r)}${fE(this.g)}${fE(this.b)}`}function Jzt(){return`#${fE(this.r)}${fE(this.g)}${fE(this.b)}${fE((isNaN(this.opacity)?1:this.opacity)*255)}`}function $xe(){const n=x9(this.opacity);return`${n===1?"rgb(":"rgba("}${NE(this.r)}, ${NE(this.g)}, ${NE(this.b)}${n===1?")":`, ${n})`}`}function x9(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function NE(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function fE(n){return n=NE(n),(n<16?"0":"")+n.toString(16)}function Wxe(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Zg(n,e,t,r)}function Vze(n){if(n instanceof Zg)return new Zg(n.h,n.s,n.l,n.opacity);if(n instanceof V3||(n=HD(n)),!n)return new Zg;if(n instanceof Zg)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,i=Math.min(e,t,r),a=Math.max(e,t,r),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(t-r)/s+(t<r)*6:t===a?o=(r-e)/s+2:o=(e-t)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Zg(o,s,l,n.opacity)}function Qzt(n,e,t,r){return arguments.length===1?Vze(n):new Zg(n,e,t,r==null?1:r)}function Zg(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}cse(Zg,Qzt,Uze(V3,{brighter(n){return n=n==null?_9:Math.pow(_9,n),new Zg(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?$D:Math.pow($D,n),new Zg(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,i=2*t-r;return new pd(IX(n>=240?n-240:n+120,i,r),IX(n,i,r),IX(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Zg(Hxe(this.h),h5(this.s),h5(this.l),x9(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=x9(this.opacity);return`${n===1?"hsl(":"hsla("}${Hxe(this.h)}, ${h5(this.s)*100}%, ${h5(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Hxe(n){return n=(n||0)%360,n<0?n+360:n}function h5(n){return Math.max(0,Math.min(1,n||0))}function IX(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const fse=n=>()=>n;function eUt(n,e){return function(t){return n+t*e}}function tUt(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function rUt(n){return(n=+n)==1?$ze:function(e,t){return t-e?tUt(e,t,n):fse(isNaN(e)?t:e)}}function $ze(n,e){var t=e-n;return t?eUt(n,t):fse(isNaN(n)?e:n)}const jxe=function n(e){var t=rUt(e);function r(i,a){var o=t((i=qQ(i)).r,(a=qQ(a)).r),s=t(i.g,a.g),l=t(i.b,a.b),u=$ze(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=s(h),i.b=l(h),i.opacity=u(h),i+""}}return r.gamma=n,r}(1);function Wze(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,r=e.slice(),i;return function(a){for(i=0;i<t;++i)r[i]=n[i]*(1-a)+e[i]*a;return r}}function Hze(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function nUt(n,e){return(Hze(e)?Wze:jze)(n,e)}function jze(n,e){var t=e?e.length:0,r=n?Math.min(t,n.length):0,i=new Array(r),a=new Array(t),o;for(o=0;o<r;++o)i[o]=S9(n[o],e[o]);for(;o<t;++o)a[o]=e[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function iUt(n,e){var t=new Date;return n=+n,e=+e,function(r){return t.setTime(n*(1-r)+e*r),t}}function ZQ(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}function aUt(n,e){var t={},r={},i;(n===null||typeof n!="object")&&(n={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in n?t[i]=S9(n[i],e[i]):r[i]=e[i];return function(a){for(i in t)r[i]=t[i](a);return r}}var KQ=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,LX=new RegExp(KQ.source,"g");function oUt(n){return function(){return n}}function sUt(n){return function(e){return n(e)+""}}function lUt(n,e){var t=KQ.lastIndex=LX.lastIndex=0,r,i,a,o=-1,s=[],l=[];for(n=n+"",e=e+"";(r=KQ.exec(n))&&(i=LX.exec(e));)(a=i.index)>t&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:ZQ(r,i)})),t=LX.lastIndex;return t<e.length&&(a=e.slice(t),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?sUt(l[0].x):oUt(e):(e=l.length,function(u){for(var h=0,c;h<e;++h)s[(c=l[h]).i]=c.x(u);return s.join("")})}function S9(n,e){var t=typeof e,r;return e==null||t==="boolean"?fse(e):(t==="number"?ZQ:t==="string"?(r=HD(e))?(e=r,jxe):lUt:e instanceof HD?jxe:e instanceof Date?iUt:Hze(e)?Wze:Array.isArray(e)?jze:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?aUt:ZQ)(n,e)}function uUt(n){return+n}function hUt(n){return n*n}function cUt(n){return n*(2-n)}function Xxe(n){return((n*=2)<=1?n*n:--n*(2-n)+1)/2}function fUt(n){return n*n*n}function dUt(n){return--n*n*n+1}function Yxe(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var dse=3,vUt=function n(e){e=+e;function t(r){return Math.pow(r,e)}return t.exponent=n,t}(dse),pUt=function n(e){e=+e;function t(r){return 1-Math.pow(1-r,e)}return t.exponent=n,t}(dse),qxe=function n(e){e=+e;function t(r){return((r*=2)<=1?Math.pow(r,e):2-Math.pow(2-r,e))/2}return t.exponent=n,t}(dse),Xze=Math.PI,Yze=Xze/2;function gUt(n){return+n==1?1:1-Math.cos(n*Yze)}function yUt(n){return Math.sin(n*Yze)}function Zxe(n){return(1-Math.cos(Xze*n))/2}function jS(n){return(Math.pow(2,-10*n)-.0009765625)*1.0009775171065494}function mUt(n){return jS(1-+n)}function _Ut(n){return 1-jS(n)}function Kxe(n){return((n*=2)<=1?jS(1-n):2-jS(n-1))/2}function xUt(n){return 1-Math.sqrt(1-n*n)}function SUt(n){return Math.sqrt(1- --n*n)}function Jxe(n){return((n*=2)<=1?1-Math.sqrt(1-n*n):Math.sqrt(1-(n-=2)*n)+1)/2}var JQ=4/11,wUt=6/11,bUt=8/11,EUt=3/4,TUt=9/11,CUt=10/11,AUt=15/16,MUt=21/22,IUt=63/64,c5=1/JQ/JQ;function LUt(n){return 1-jD(1-n)}function jD(n){return(n=+n)<JQ?c5*n*n:n<bUt?c5*(n-=wUt)*n+EUt:n<CUt?c5*(n-=TUt)*n+AUt:c5*(n-=MUt)*n+IUt}function PUt(n){return((n*=2)<=1?1-jD(1-n):jD(n-1)+1)/2}var vse=1.70158,OUt=function n(e){e=+e;function t(r){return(r=+r)*r*(e*(r-1)+r)}return t.overshoot=n,t}(vse),RUt=function n(e){e=+e;function t(r){return--r*r*((r+1)*e+r)+1}return t.overshoot=n,t}(vse),Qxe=function n(e){e=+e;function t(r){return((r*=2)<1?r*r*((e+1)*r-e):(r-=2)*r*((e+1)*r+e)+2)/2}return t.overshoot=n,t}(vse),CM=2*Math.PI,pse=1,gse=.3,DUt=function n(e,t){var r=Math.asin(1/(e=Math.max(1,e)))*(t/=CM);function i(a){return e*jS(- --a)*Math.sin((r-a)/t)}return i.amplitude=function(a){return n(a,t*CM)},i.period=function(a){return n(e,a)},i}(pse,gse),eSe=function n(e,t){var r=Math.asin(1/(e=Math.max(1,e)))*(t/=CM);function i(a){return 1-e*jS(a=+a)*Math.sin((a+r)/t)}return i.amplitude=function(a){return n(a,t*CM)},i.period=function(a){return n(e,a)},i}(pse,gse),NUt=function n(e,t){var r=Math.asin(1/(e=Math.max(1,e)))*(t/=CM);function i(a){return((a=a*2-1)<0?e*jS(-a)*Math.sin((r-a)/t):2-e*jS(a)*Math.sin((r+a)/t))/2}return i.amplitude=function(a){return n(a,t*CM)},i.period=function(a){return n(e,a)},i}(pse,gse);const kUt=Object.freeze(Object.defineProperty({__proto__:null,easeLinear:uUt,easeQuad:Xxe,easeQuadIn:hUt,easeQuadOut:cUt,easeQuadInOut:Xxe,easeCubic:Yxe,easeCubicIn:fUt,easeCubicOut:dUt,easeCubicInOut:Yxe,easePoly:qxe,easePolyIn:vUt,easePolyOut:pUt,easePolyInOut:qxe,easeSin:Zxe,easeSinIn:gUt,easeSinOut:yUt,easeSinInOut:Zxe,easeExp:Kxe,easeExpIn:mUt,easeExpOut:_Ut,easeExpInOut:Kxe,easeCircle:Jxe,easeCircleIn:xUt,easeCircleOut:SUt,easeCircleInOut:Jxe,easeBounce:jD,easeBounceIn:LUt,easeBounceOut:jD,easeBounceInOut:PUt,easeBack:Qxe,easeBackIn:OUt,easeBackOut:RUt,easeBackInOut:Qxe,easeElastic:eSe,easeElasticIn:DUt,easeElasticOut:eSe,easeElasticInOut:NUt},Symbol.toStringTag,{value:"Module"}));var FUt={};function BUt(n){return FUt[n.toLowerCase()]||kUt[n]}var GUt=function(n){return["fill","stroke","fillStyle","strokeStyle"].includes(n)},zUt=function(n){return/^[r,R,L,l]{1}[\s]*\(/.test(n)},tSe=[1,0,0,0,1,0,0,0,1];function UUt(n,e,t){var r={},i=e.fromAttrs,a=e.toAttrs;if(!n.destroyed){var o;for(var s in a)if(!HS(i[s],a[s]))if(s==="path"){var l=a[s],u=i[s];l.length>u.length?(l=gA(a[s]),u=gA(i[s]),u=Aze(u,l),u=WQ(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=gA(a[s]),u=gA(i[s]),u=WQ(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),r[s]=[];for(var h=0;h<l.length;h++){for(var c=l[h],f=u[h],d=[],v=0;v<c.length;v++)on(c[v])&&f&&on(f[v])?(o=S9(f[v],c[v]),d.push(o(t))):d.push(c[v]);r[s].push(d)}}else if(s==="matrix"){var p=nUt(i[s]||tSe,a[s]||tSe),g=p(t);r[s]=g}else GUt(s)&&zUt(a[s])?r[s]=a[s]:nl(a[s])||(o=S9(i[s],a[s]),r[s]=o(t));n.attr(r)}}function VUt(n,e,t){var r=e.startTime,i=e.delay;if(t<r+i||e._paused)return!1;var a,o=e.duration,s=e.easing,l=BUt(s);if(t=t-r-e.delay,e.repeat)a=t%o/o,a=l(a);else if(a=t/o,a<1)a=l(a);else return e.onFrame?n.attr(e.onFrame(1)):n.attr(e.toAttrs),!0;if(e.onFrame){var u=e.onFrame(a);n.attr(u)}else UUt(n,e,a);return!1}var $Ut=function(){function n(e){this.animators=[],this.current=0,this.timer=null,this.canvas=e}return n.prototype.initTimer=function(){var e=this,t=!1,r,i,a;this.timer=hse(function(o){if(e.current=o,e.animators.length>0){for(var s=e.animators.length-1;s>=0;s--){if(r=e.animators[s],r.destroyed){e.removeAnimator(s);continue}if(!r.isAnimatePaused()){i=r.get("animations");for(var l=i.length-1;l>=0;l--)a=i[l],t=VUt(r,a,o),t&&(i.splice(l,1),t=!1,a.callback&&a.callback())}i.length===0&&e.removeAnimator(s)}var u=e.canvas.get("autoDraw");u||e.canvas.draw()}})},n.prototype.addAnimator=function(e){this.animators.push(e)},n.prototype.removeAnimator=function(e){this.animators.splice(e,1)},n.prototype.isAnimating=function(){return!!this.animators.length},n.prototype.stop=function(){this.timer&&this.timer.stop()},n.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},n.prototype.getTime=function(){return this.current},n}(),WUt=40,rSe=0,nSe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function iSe(n,e,t){t.name=e,t.target=n,t.currentTarget=n,t.delegateTarget=n,n.emit(e,t)}function HUt(n,e,t){if(t.bubbles){var r=void 0,i=!1;if(e==="mouseenter"?(r=t.fromShape,i=!0):e==="mouseleave"&&(i=!0,r=t.toShape),n.isCanvas()&&i)return;if(r&&Pze(n,r)){t.bubbles=!1;return}t.name=e,t.currentTarget=n,t.delegateTarget=n,n.emit(e,t)}}var jUt=function(){function n(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(r){var i=r.type;t._triggerEvent(i,r)},this._onDocumentMove=function(r){var i=t.canvas,a=i.get("el");if(a!==r.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(r);t.dragging&&t._emitEvent("drag",r,o,t.draggingShape)}},this._onDocumentMouseUp=function(r){var i=t.canvas,a=i.get("el");if(a!==r.target&&t.dragging){var o=t._getPointInfo(r);t.draggingShape&&t._emitEvent("drop",r,o,null),t._emitEvent("dragend",r,o,t.draggingShape),t._afterDrag(t.draggingShape,o,r)}},this.canvas=e.canvas}return n.prototype.init=function(){this._bindEvents()},n.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");At(nSe,function(r){t.addEventListener(r,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},n.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");At(nSe,function(r){t.removeEventListener(r,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},n.prototype._getEventObj=function(e,t,r,i,a,o){var s=new Ize(e,t);return s.fromShape=a,s.toShape=o,s.x=r.x,s.y=r.y,s.clientX=r.clientX,s.clientY=r.clientY,s.propagationPath.push(i),s},n.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},n.prototype._getPointInfo=function(e){var t=this.canvas,r=t.getClientByEvent(e),i=t.getPointByEvent(e);return{x:i.x,y:i.y,clientX:r.x,clientY:r.y}},n.prototype._triggerEvent=function(e,t){var r=this._getPointInfo(t),i=this._getShape(r,t),a=this["_on"+e],o=!1;if(a)a.call(this,r,i,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,r,null,null,i),i&&this._emitEvent(e,t,r,i,null,i),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,r,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,r,s,s,null),this._emitEvent(e,t,r,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,r,null)):this._emitEvent(e,t,r,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var l=this.canvas,u=l.get("el");u.style.cursor=i.attr("cursor")||l.get("cursor")}},n.prototype._onmousedown=function(e,t,r){r.button===rSe&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,e,t,null,null)},n.prototype._emitMouseoverEvents=function(e,t,r,i){var a=this.canvas.get("el");r!==i&&(r&&(this._emitEvent("mouseout",e,t,r,r,i),this._emitEvent("mouseleave",e,t,r,r,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",e,t,i,r,i),this._emitEvent("mouseenter",e,t,i,r,i)))},n.prototype._emitDragoverEvents=function(e,t,r,i,a){i?(i!==r&&(r&&this._emitEvent("dragleave",e,t,r,r,i),this._emitEvent("dragenter",e,t,i,r,i)),a||this._emitEvent("dragover",e,t,i)):r&&this._emitEvent("dragleave",e,t,r,r,i),a&&this._emitEvent("dragover",e,t,i)},n.prototype._afterDrag=function(e,t,r){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(t,r);i!==e&&this._emitMouseoverEvents(r,t,e,i),this.currentShape=i},n.prototype._onmouseup=function(e,t,r){if(r.button===rSe){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",r,e,t),this._emitEvent("dragend",r,e,i),this._afterDrag(i,e,r)):(this._emitEvent("mouseup",r,e,t),t===this.mousedownShape&&this._emitEvent("click",r,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},n.prototype._ondragover=function(e,t,r){r.preventDefault();var i=this.currentShape;this._emitDragoverEvents(r,e,i,t,!0)},n.prototype._onmousemove=function(e,t,r){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,e,a,t,!1),this._emitEvent("drag",r,e,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,u=r.timeStamp,h=u-this.mousedownTimeStamp,c=s.clientX-e.clientX,f=s.clientY-e.clientY,d=c*c+f*f;h>120||d>WUt?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,e,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t)):(this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t))}else this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t)}},n.prototype._emitEvent=function(e,t,r,i,a,o){var s=this._getEventObj(e,t,r,i,a,o);if(i){s.shape=i,iSe(i,e,s);for(var l=i.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||HUt(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;iSe(u,e,s)}},n.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},n}(),aSe="px",oSe=Oze(),XUt=oSe&&oSe.name==="firefox",qze=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");rr(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var r=this.get("container");r.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new jUt({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new $Ut(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,r){var i=this.get("el");Lxe&&(i.style.width=t+aSe,i.style.height=r+aSe)},e.prototype.changeSize=function(t,r){this.setDOMSize(t,r),this.set("width",t),this.set("height",r),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var r=this.get("el");Lxe&&r&&(r.style.cursor=t)},e.prototype.getPointByEvent=function(t){var r=this.get("supportCSSTransform");if(r){if(XUt&&!an(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!an(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var i=this.getClientByEvent(t),a=i.x,o=i.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var r=t;return t.touches&&(t.type==="touchend"?r=t.changedTouches[0]:r=t.touches[0]),{x:r.clientX,y:r.clientY}},e.prototype.getPointByClient=function(t,r){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t-a.left,y:r-a.top}},e.prototype.getClientByPoint=function(t,r){var i=this.get("el"),a=i.getBoundingClientRect();return{x:t+a.left,y:r+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),n.prototype.destroy.call(this))},e}(Fze),Zze=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=n.prototype.clone.call(this),r=this.getChildren(),i=0;i<r.length;i++){var a=r[i];t.add(a.clone())}return t},e}(Fze),Kze=function(n){Kn(e,n);function e(t){return n.call(this,t)||this}return e.prototype._isInBBox=function(t,r){var i=this.getBBox();return i.minX<=t&&i.maxX>=t&&i.minY<=r&&i.maxY>=r},e.prototype.afterAttrsChange=function(t){n.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(t){n.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),r=this.getTotalMatrix(),i=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(r){var l=cE(r,[t.minX,t.minY]),u=cE(r,[t.maxX,t.minY]),h=cE(r,[t.minX,t.maxY]),c=cE(r,[t.maxX,t.maxY]);i=Math.min(l[0],u[0],h[0],c[0]),o=Math.max(l[0],u[0],h[0],c[0]),a=Math.min(l[1],u[1],h[1],c[1]),s=Math.max(l[1],u[1],h[1],c[1])}var f=this.attrs;if(f.shadowColor){var d=f.shadowBlur,v=d===void 0?0:d,p=f.shadowOffsetX,g=p===void 0?0:p,m=f.shadowOffsetY,y=m===void 0?0:m,_=i-v+g,x=o+v+g,S=a-v+y,w=s+v+y;i=Math.min(i,_),o=Math.max(o,x),a=Math.min(a,S),s=Math.max(s,w)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,r){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,r){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,r,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],u=this._isInBBox(s,l);return this.isOnlyHitBox()?u:!!(u&&!this.isClipped(s,l)&&(this.isInShape(s,l)||i&&i.isHit(s,l)||a&&a.isHit(s,l)))},e}(Dze),Jze=new Map;function Rm(n,e){Jze.set(n,e)}function Qze(n){return Jze.get(n)}function eUe(n){var e=n.attr(),t=e.x,r=e.y,i=e.width,a=e.height;return{x:t,y:r,width:i,height:a}}function tUe(n){var e=n.attr(),t=e.x,r=e.y,i=e.r;return{x:t-i,y:r-i,width:i*2,height:i*2}}function Hc(n,e,t,r){var i=n-t,a=e-r;return Math.sqrt(i*i+a*a)}function XB(n,e){return Math.abs(n-e)<.001}function XI(n,e){var t=dm(n),r=dm(e),i=fm(n),a=fm(e);return{x:t,y:r,width:i-t,height:a-r}}function UU(n){return(n+Math.PI*2)%(Math.PI*2)}const Fh={box:function(n,e,t,r){return XI([n,t],[e,r])},length:function(n,e,t,r){return Hc(n,e,t,r)},pointAt:function(n,e,t,r,i){return{x:(1-i)*n+i*t,y:(1-i)*e+i*r}},pointDistance:function(n,e,t,r,i,a){var o=(t-n)*(i-n)+(r-e)*(a-e);if(o<0)return Hc(n,e,i,a);var s=(t-n)*(t-n)+(r-e)*(r-e);return o>s?Hc(t,r,i,a):this.pointToLine(n,e,t,r,i,a)},pointToLine:function(n,e,t,r,i,a){var o=[t-n,r-e];if(Koe(o,[0,0]))return Math.sqrt((i-n)*(i-n)+(a-e)*(a-e));var s=[-o[1],o[0]];SS(s,s);var l=[i-n,a-e];return Math.abs(Zoe(l,s))},tangentAngle:function(n,e,t,r){return Math.atan2(r-e,t-n)}};var YUt=1e-4;function rUe(n,e,t,r,i,a){var o,s=1/0,l=[t,r],u=20;a&&a>200&&(u=a/10);for(var h=1/u,c=h/10,f=0;f<=u;f++){var d=f*h,v=[i.apply(null,n.concat([d])),i.apply(null,e.concat([d]))],p=Hc(l[0],l[1],v[0],v[1]);p<s&&(o=d,s=p)}if(o===0)return{x:n[0],y:e[0]};if(o===1){var g=n.length;return{x:n[g-1],y:e[g-1]}}s=1/0;for(var f=0;f<32&&!(c<YUt);f++){var m=o-c,y=o+c,v=[i.apply(null,n.concat([m])),i.apply(null,e.concat([m]))],p=Hc(l[0],l[1],v[0],v[1]);if(m>=0&&p<s)o=m,s=p;else{var _=[i.apply(null,n.concat([y])),i.apply(null,e.concat([y]))],x=Hc(l[0],l[1],_[0],_[1]);y<=1&&x<s?(o=y,s=x):c*=.5}}return{x:i.apply(null,n.concat([o])),y:i.apply(null,e.concat([o]))}}function qUt(n,e){for(var t=0,r=n.length,i=0;i<r;i++){var a=n[i],o=e[i],s=n[(i+1)%r],l=e[(i+1)%r];t+=Hc(a,o,s,l)}return t/2}function Fx(n,e,t,r){var i=1-r;return i*i*n+2*r*i*e+r*r*t}function sSe(n,e,t){var r=n+t-2*e;if(XB(r,0))return[.5];var i=(n-e)/r;return i<=1&&i>=0?[i]:[]}function lSe(n,e,t,r){return 2*(1-r)*(e-n)+2*r*(t-e)}function nUe(n,e,t,r,i,a,o){var s=Fx(n,t,i,o),l=Fx(e,r,a,o),u=Fh.pointAt(n,e,t,r,o),h=Fh.pointAt(t,r,i,a,o);return[[n,e,u.x,u.y,s,l],[s,l,h.x,h.y,i,a]]}function QQ(n,e,t,r,i,a,o){if(o===0)return(Hc(n,e,t,r)+Hc(t,r,i,a)+Hc(n,e,i,a))/2;var s=nUe(n,e,t,r,i,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),QQ.apply(null,l)+QQ.apply(null,u)}const iUe={box:function(n,e,t,r,i,a){var o=sSe(n,t,i)[0],s=sSe(e,r,a)[0],l=[n,i],u=[e,a];return o!==void 0&&l.push(Fx(n,t,i,o)),s!==void 0&&u.push(Fx(e,r,a,s)),XI(l,u)},length:function(n,e,t,r,i,a){return QQ(n,e,t,r,i,a,3)},nearestPoint:function(n,e,t,r,i,a,o,s){return rUe([n,t,i],[e,r,a],o,s,Fx)},pointDistance:function(n,e,t,r,i,a,o,s){var l=this.nearestPoint(n,e,t,r,i,a,o,s);return Hc(l.x,l.y,o,s)},interpolationAt:Fx,pointAt:function(n,e,t,r,i,a,o){return{x:Fx(n,t,i,o),y:Fx(e,r,a,o)}},divide:function(n,e,t,r,i,a,o){return nUe(n,e,t,r,i,a,o)},tangentAngle:function(n,e,t,r,i,a,o){var s=lSe(n,t,i,o),l=lSe(e,r,a,o),u=Math.atan2(l,s);return UU(u)}};function Bx(n,e,t,r,i){var a=1-i;return a*a*a*n+3*e*i*a*a+3*t*i*i*a+r*i*i*i}function uSe(n,e,t,r,i){var a=1-i;return 3*(a*a*(e-n)+2*a*i*(t-e)+i*i*(r-t))}function PX(n,e,t,r){var i=-3*n+9*e-9*t+3*r,a=6*n-12*e+6*t,o=3*e-3*n,s=[],l,u,h;if(XB(i,0))XB(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var c=a*a-4*i*o;XB(c,0)?s.push(-a/(2*i)):c>0&&(h=Math.sqrt(c),l=(-a+h)/(2*i),u=(-a-h)/(2*i),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function aUe(n,e,t,r,i,a,o,s,l){var u=Bx(n,t,i,o,l),h=Bx(e,r,a,s,l),c=Fh.pointAt(n,e,t,r,l),f=Fh.pointAt(t,r,i,a,l),d=Fh.pointAt(i,a,o,s,l),v=Fh.pointAt(c.x,c.y,f.x,f.y,l),p=Fh.pointAt(f.x,f.y,d.x,d.y,l);return[[n,e,c.x,c.y,v.x,v.y,u,h],[u,h,p.x,p.y,d.x,d.y,o,s]]}function eee(n,e,t,r,i,a,o,s,l){if(l===0)return qUt([n,t,i,o],[e,r,a,s]);var u=aUe(n,e,t,r,i,a,o,s,.5),h=u[0],c=u[1];return h.push(l-1),c.push(l-1),eee.apply(null,h)+eee.apply(null,c)}const pR={extrema:PX,box:function(n,e,t,r,i,a,o,s){for(var l=[n,o],u=[e,s],h=PX(n,t,i,o),c=PX(e,r,a,s),f=0;f<h.length;f++)l.push(Bx(n,t,i,o,h[f]));for(var f=0;f<c.length;f++)u.push(Bx(e,r,a,s,c[f]));return XI(l,u)},length:function(n,e,t,r,i,a,o,s){return eee(n,e,t,r,i,a,o,s,3)},nearestPoint:function(n,e,t,r,i,a,o,s,l,u,h){return rUe([n,t,i,o],[e,r,a,s],l,u,Bx,h)},pointDistance:function(n,e,t,r,i,a,o,s,l,u,h){var c=this.nearestPoint(n,e,t,r,i,a,o,s,l,u,h);return Hc(c.x,c.y,l,u)},interpolationAt:Bx,pointAt:function(n,e,t,r,i,a,o,s,l){return{x:Bx(n,t,i,o,l),y:Bx(e,r,a,s,l)}},divide:function(n,e,t,r,i,a,o,s,l){return aUe(n,e,t,r,i,a,o,s,l)},tangentAngle:function(n,e,t,r,i,a,o,s,l){var u=uSe(n,t,i,o,l),h=uSe(e,r,a,s,l);return UU(Math.atan2(h,u))}};function hSe(n,e){var t=Math.abs(n);return e>0?t:t*-1}const ZUt={box:function(n,e,t,r){return{x:n-t,y:e-r,width:t*2,height:r*2}},length:function(n,e,t,r){return Math.PI*(3*(t+r)-Math.sqrt((3*t+r)*(t+3*r)))},nearestPoint:function(n,e,t,r,i,a){var o=t,s=r;if(o===0||s===0)return{x:n,y:e};for(var l=i-n,u=a-e,h=Math.abs(l),c=Math.abs(u),f=o*o,d=s*s,v=Math.PI/4,p,g,m=0;m<4;m++){p=o*Math.cos(v),g=s*Math.sin(v);var y=(f-d)*Math.pow(Math.cos(v),3)/o,_=(d-f)*Math.pow(Math.sin(v),3)/s,x=p-y,S=g-_,w=h-y,b=c-_,E=Math.hypot(S,x),T=Math.hypot(b,w),C=E*Math.asin((x*b-S*w)/(E*T)),A=C/Math.sqrt(f+d-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:n+hSe(p,l),y:e+hSe(g,u)}},pointDistance:function(n,e,t,r,i,a){var o=this.nearestPoint(n,e,t,r,i,a);return Hc(o.x,o.y,i,a)},pointAt:function(n,e,t,r,i){var a=2*Math.PI*i;return{x:n+t*Math.cos(a),y:e+r*Math.sin(a)}},tangentAngle:function(n,e,t,r,i){var a=2*Math.PI*i,o=Math.atan2(r*Math.cos(a),-t*Math.sin(a));return UU(o)}};function KUt(n,e,t,r,i,a,o,s){return-1*t*Math.cos(i)*Math.sin(s)-r*Math.sin(i)*Math.cos(s)}function JUt(n,e,t,r,i,a,o,s){return-1*t*Math.sin(i)*Math.sin(s)+r*Math.cos(i)*Math.cos(s)}function QUt(n,e,t){return Math.atan(-e/n*Math.tan(t))}function eVt(n,e,t){return Math.atan(e/(n*Math.tan(t)))}function cSe(n,e,t,r,i,a){return t*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+n}function fSe(n,e,t,r,i,a){return t*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function tVt(n,e,t,r){var i=Math.atan2(r*n,t*e);return(i+Math.PI*2)%(Math.PI*2)}function dSe(n,e,t){return{x:n*Math.cos(t),y:e*Math.sin(t)}}function vSe(n,e,t){var r=Math.cos(t),i=Math.sin(t);return[n*r-e*i,n*i+e*r]}const rVt={box:function(n,e,t,r,i,a,o){for(var s=QUt(t,r,i),l=1/0,u=-1/0,h=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var f=s+c;a<o?a<f&&f<o&&h.push(f):o<f&&f<a&&h.push(f)}for(var c=0;c<h.length;c++){var d=cSe(n,e,t,r,i,h[c]);d<l&&(l=d),d>u&&(u=d)}for(var v=eVt(t,r,i),p=1/0,g=-1/0,m=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var y=v+c;a<o?a<y&&y<o&&m.push(y):o<y&&y<a&&m.push(y)}for(var c=0;c<m.length;c++){var _=fSe(n,e,t,r,i,m[c]);_<p&&(p=_),_>g&&(g=_)}return{x:l,y:p,width:u-l,height:g-p}},length:function(n,e,t,r,i,a,o){},nearestPoint:function(n,e,t,r,i,a,o,s,l){var u=vSe(s-n,l-e,-i),h=u[0],c=u[1],f=ZUt.nearestPoint(0,0,t,r,h,c),d=tVt(t,r,f.x,f.y);d<a?f=dSe(t,r,a):d>o&&(f=dSe(t,r,o));var v=vSe(f.x,f.y,i);return{x:v[0]+n,y:v[1]+e}},pointDistance:function(n,e,t,r,i,a,o,s,l){var u=this.nearestPoint(n,e,t,r,s,l);return Hc(u.x,u.y,s,l)},pointAt:function(n,e,t,r,i,a,o,s){var l=(o-a)*s+a;return{x:cSe(n,e,t,r,i,l),y:fSe(n,e,t,r,i,l)}},tangentAngle:function(n,e,t,r,i,a,o,s){var l=(o-a)*s+a,u=KUt(n,e,t,r,i,a,o,l),h=JUt(n,e,t,r,i,a,o,l);return UU(Math.atan2(h,u))}};function oUe(n){for(var e=0,t=[],r=0;r<n.length-1;r++){var i=n[r],a=n[r+1],o=Hc(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:o};t.push(s),e+=o}return{segments:t,totalLength:e}}function nVt(n){if(n.length<2)return 0;for(var e=0,t=0;t<n.length-1;t++){var r=n[t],i=n[t+1];e+=Hc(r[0],r[1],i[0],i[1])}return e}function iVt(n,e){if(e>1||e<0||n.length<2)return null;var t=oUe(n),r=t.segments,i=t.totalLength;if(i===0)return{x:n[0][0],y:n[0][1]};for(var a=0,o=null,s=0;s<r.length;s++){var l=r[s],u=l.from,h=l.to,c=l.length/i;if(e>=a&&e<=a+c){var f=(e-a)/c;o=Fh.pointAt(u[0],u[1],h[0],h[1],f);break}a+=c}return o}function aVt(n,e){if(e>1||e<0||n.length<2)return 0;for(var t=oUe(n),r=t.segments,i=t.totalLength,a=0,o=0,s=0;s<r.length;s++){var l=r[s],u=l.from,h=l.to,c=l.length/i;if(e>=a&&e<=a+c){o=Math.atan2(h[1]-u[1],h[0]-u[0]);break}a+=c}return o}function oVt(n,e,t){for(var r=1/0,i=0;i<n.length-1;i++){var a=n[i],o=n[i+1],s=Fh.pointDistance(a[0],a[1],o[0],o[1],e,t);s<r&&(r=s)}return r}const sUe={box:function(n){for(var e=[],t=[],r=0;r<n.length;r++){var i=n[r];e.push(i[0]),t.push(i[1])}return XI(e,t)},length:function(n){return nVt(n)},pointAt:function(n,e){return iVt(n,e)},pointDistance:function(n,e,t){return oVt(n,e,t)},tangentAngle:function(n,e){return aVt(n,e)}};function pSe(n,e){return!n||!e?n||e:{minX:Math.min(n.minX,e.minX),minY:Math.min(n.minY,e.minY),maxX:Math.max(n.maxX,e.maxX),maxY:Math.max(n.maxY,e.maxY)}}function yse(n,e){var t=n.get("startArrowShape"),r=n.get("endArrowShape"),i=null,a=null;return t&&(i=t.getCanvasBBox(),e=pSe(e,i)),r&&(a=r.getCanvasBBox(),e=pSe(e,a)),e}function sVt(n){for(var e=n.attr(),t=e.points,r=[],i=[],a=0;a<t.length;a++){var o=t[a];r.push(o[0]),i.push(o[1])}var s=XI(r,i),l=s.x,u=s.y,h=s.width,c=s.height,f={minX:l,minY:u,maxX:l+h,maxY:u+c};return f=yse(n,f),{x:f.minX,y:f.minY,width:f.maxX-f.minX,height:f.maxY-f.minY}}function lVt(n){for(var e=n.attr(),t=e.points,r=[],i=[],a=0;a<t.length;a++){var o=t[a];r.push(o[0]),i.push(o[1])}return XI(r,i)}var OX=null;function lUe(){if(!OX){var n=document.createElement("canvas");n.width=1,n.height=1,OX=n.getContext("2d")}return OX}function uUe(n,e,t){var r=1;if(rr(n)&&(r=n.split(`
`).length),r>1){var i=uVt(e,t);return e*r+i*(r-1)}return e}function uVt(n,e){return e?e-n:n*.14}function hVt(n,e){var t=lUe(),r=0;if(an(n)||n==="")return r;if(t.save(),t.font=e,rr(n)&&n.includes(`
`)){var i=n.split(`
`);At(i,function(a){var o=t.measureText(a).width;r<o&&(r=o)})}else r=t.measureText(n).width;return t.restore(),r}function hUe(n){var e=n.fontSize,t=n.fontFamily,r=n.fontWeight,i=n.fontStyle,a=n.fontVariant;return[i,a,r,e+"px",t].join(" ").trim()}function cVt(n){var e=n.attr(),t=e.x,r=e.y,i=e.text,a=e.fontSize,o=e.lineHeight,s=e.font;s||(s=hUe(e));var l=hVt(i,s),u;if(!l)u={x:t,y:r,width:0,height:0};else{var h=e.textAlign,c=e.textBaseline,f=uUe(i,a,o),d={x:t,y:r-f};h&&(h==="end"||h==="right"?d.x-=l:h==="center"&&(d.x-=l/2)),c&&(c==="top"?d.y+=f:c==="middle"&&(d.y+=f/2)),u={x:d.x,y:d.y,width:l,height:f}}return u}var fVt=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,dVt=/[^\s\,]+/ig;function vVt(n){var e=n||[];if(vn(e))return e;if(rr(e))return e=e.match(fVt),At(e,function(t,r){if(t=t.match(dVt),t[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}At(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[r]=t}),e}function pVt(n,e,t,r){var i=[],a=!!r,o,s,l,u,h,c,f;if(a){l=r[0],u=r[1];for(var d=0,v=n.length;d<v;d+=1){var p=n[d];l=Ax([0,0],l,p),u=Mx([0,0],u,p)}}for(var d=0,g=n.length;d<g;d+=1){var p=n[d];if(d===0&&!t)f=p;else if(d===g-1&&!t)c=p,i.push(f),i.push(c);else{var m=[d?d-1:g-1,d-1][t?0:1];o=n[m],s=n[t?(d+1)%g:d+1];var y=[0,0];y=UB(y,s,o),y=Gc(y,y,e);var _=c9(p,o),x=c9(p,s),S=_+x;S!==0&&(_/=S,x/=S);var w=Gc([0,0],y,-_),b=Gc([0,0],y,x);c=Oh([0,0],p,w),h=Oh([0,0],p,b),h=Ax([0,0],h,Mx([0,0],s,p)),h=Mx([0,0],h,Ax([0,0],s,p)),w=UB([0,0],h,p),w=Gc([0,0],w,-_/x),c=Oh([0,0],p,w),c=Ax([0,0],c,Mx([0,0],o,p)),c=Mx([0,0],c,Ax([0,0],o,p)),b=UB([0,0],p,c),b=Gc([0,0],b,x/_),h=Oh([0,0],p,b),a&&(c=Mx([0,0],c,l),c=Ax([0,0],c,u),h=Mx([0,0],h,l),h=Ax([0,0],h,u)),i.push(f),i.push(c),f=h}}return t&&i.push(i.shift()),i}function cUe(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=[[0,0],[1,1]]);for(var r=!!e,i=[],a=0,o=n.length;a<o;a+=2)i.push([n[a],n[a+1]]);for(var s=pVt(i,.4,r,t),l=i.length,u=[],h,c,f,a=0;a<l-1;a+=1)h=s[a*2],c=s[a*2+1],f=i[a+1],u.push(["C",h[0],h[1],c[0],c[1],f[0],f[1]]);return r&&(h=s[l],c=s[l+1],f=i[0],u.push(["C",h[0],h[1],c[0],c[1],f[0],f[1]])),u}var gR=`
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,gVt=new RegExp("([a-z])["+gR+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+gR+"]*,?["+gR+"]*)+)","ig"),yVt=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+gR+"]*,?["+gR+"]*","ig");function tee(n){if(!n)return null;if(vn(n))return n;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(n).replace(gVt,function(r,i,a){var o=[],s=i.toLowerCase();if(a.replace(yVt,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(t.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([i,o[0]]),s==="r")t.push([i].concat(o));else for(;o.length>=e[s]&&(t.push([i].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var mVt=/[a-z]/;function gSe(n,e){return[e[0]+(e[0]-n[0]),e[1]+(e[1]-n[1])]}function fUe(n){var e=tee(n);if(!e||!e.length)return[["M",0,0]];for(var t=!1,r=0;r<e.length;r++){var i=e[r][0];if(mVt.test(i)||["V","H","T","S"].indexOf(i)>=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,l=0,u=0,h=0,c=e[0];(c[0]==="M"||c[0]==="m")&&(o=+c[1],s=+c[2],l=o,u=s,h++,a[0]=["M",o,s]);for(var r=h,f=e.length;r<f;r++){var d=e[r],v=a[r-1],p=[],i=d[0],g=i.toUpperCase();if(i!==g)switch(p[0]=g,g){case"A":p[1]=d[1],p[2]=d[2],p[3]=d[3],p[4]=d[4],p[5]=d[5],p[6]=+d[6]+o,p[7]=+d[7]+s;break;case"V":p[1]=+d[1]+s;break;case"H":p[1]=+d[1]+o;break;case"M":l=+d[1]+o,u=+d[2]+s,p[1]=l,p[2]=u;break;default:for(var m=1,y=d.length;m<y;m++)p[m]=+d[m]+(m%2?o:s)}else p=e[r];switch(g){case"Z":o=+l,s=+u;break;case"H":o=p[1],p=["L",o,s];break;case"V":s=p[1],p=["L",o,s];break;case"T":o=p[1],s=p[2];var _=gSe([v[1],v[2]],[v[3],v[4]]);p=["Q",_[0],_[1],o,s];break;case"S":o=p[p.length-2],s=p[p.length-1];var x=v.length,S=gSe([v[x-4],v[x-3]],[v[x-2],v[x-1]]);p=["C",S[0],S[1],p[1],p[2],o,s];break;case"M":l=p[p.length-2],u=p[p.length-1];break;default:o=p[p.length-2],s=p[p.length-1]}a.push(p)}return a}function f5(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function ree(n,e){return f5(n)*f5(e)?(n[0]*e[0]+n[1]*e[1])/(f5(n)*f5(e)):1}function ySe(n,e){return(n[0]*e[1]<n[1]*e[0]?-1:1)*Math.acos(ree(n,e))}function nee(n,e){return n[0]===e[0]&&n[1]===e[1]}function _Vt(n,e){var t=e[1],r=e[2],i=DU(NU(e[3]),Math.PI*2),a=e[4],o=e[5],s=n[0],l=n[1],u=e[6],h=e[7],c=Math.cos(i)*(s-u)/2+Math.sin(i)*(l-h)/2,f=-1*Math.sin(i)*(s-u)/2+Math.cos(i)*(l-h)/2,d=c*c/(t*t)+f*f/(r*r);d>1&&(t*=Math.sqrt(d),r*=Math.sqrt(d));var v=t*t*(f*f)+r*r*(c*c),p=v?Math.sqrt((t*t*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var g=r?p*t*f/r:0,m=t?p*-r*c/t:0,y=(s+u)/2+Math.cos(i)*g-Math.sin(i)*m,_=(l+h)/2+Math.sin(i)*g+Math.cos(i)*m,x=[(c-g)/t,(f-m)/r],S=[(-1*c-g)/t,(-1*f-m)/r],w=ySe([1,0],x),b=ySe(x,S);return ree(x,S)<=-1&&(b=Math.PI),ree(x,S)>=1&&(b=0),o===0&&b>0&&(b=b-2*Math.PI),o===1&&b<0&&(b=b+2*Math.PI),{cx:y,cy:_,rx:nee(n,[u,h])?0:t,ry:nee(n,[u,h])?0:r,startAngle:w,endAngle:w+b,xRotation:i,arcFlag:a,sweepFlag:o}}function mSe(n,e){return[e[0]+(e[0]-n[0]),e[1]+(e[1]-n[1])]}function dUe(n){n=vVt(n);for(var e=[],t=null,r=null,i=null,a=0,o=n.length,s=0;s<o;s++){var l=n[s];r=n[s+1];var u=l[0],h={command:u,prePoint:t,params:l,startTangent:null,endTangent:null};switch(u){case"M":i=[l[1],l[2]],a=s;break;case"A":var c=_Vt(t,l);h.arcParams=c;break}if(u==="Z")t=i,r=n[a+1];else{var f=l.length;t=[l[f-2],l[f-1]]}r&&r[0]==="Z"&&(r=n[a],e[a]&&(e[a].prePoint=t)),h.currentPoint=t,e[a]&&nee(t,e[a].currentPoint)&&(e[a].prePoint=h.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;h.nextPoint=d;var v=h.prePoint;if(["L","H","V"].includes(u))h.startTangent=[v[0]-t[0],v[1]-t[1]],h.endTangent=[t[0]-v[0],t[1]-v[1]];else if(u==="Q"){var p=[l[1],l[2]];h.startTangent=[v[0]-p[0],v[1]-p[1]],h.endTangent=[t[0]-p[0],t[1]-p[1]]}else if(u==="T"){var g=e[s-1],p=mSe(g.currentPoint,v);g.command==="Q"?(h.command="Q",h.startTangent=[v[0]-p[0],v[1]-p[1]],h.endTangent=[t[0]-p[0],t[1]-p[1]]):(h.command="TL",h.startTangent=[v[0]-t[0],v[1]-t[1]],h.endTangent=[t[0]-v[0],t[1]-v[1]])}else if(u==="C"){var m=[l[1],l[2]],y=[l[3],l[4]];h.startTangent=[v[0]-m[0],v[1]-m[1]],h.endTangent=[t[0]-y[0],t[1]-y[1]],h.startTangent[0]===0&&h.startTangent[1]===0&&(h.startTangent=[m[0]-y[0],m[1]-y[1]]),h.endTangent[0]===0&&h.endTangent[1]===0&&(h.endTangent=[y[0]-m[0],y[1]-m[1]])}else if(u==="S"){var g=e[s-1],m=mSe(g.currentPoint,v),y=[l[1],l[2]];g.command==="C"?(h.command="C",h.startTangent=[v[0]-m[0],v[1]-m[1]],h.endTangent=[t[0]-y[0],t[1]-y[1]]):(h.command="SQ",h.startTangent=[v[0]-y[0],v[1]-y[1]],h.endTangent=[t[0]-y[0],t[1]-y[1]])}else if(u==="A"){var _=.001,x=h.arcParams||{},S=x.cx,w=S===void 0?0:S,b=x.cy,E=b===void 0?0:b,T=x.rx,C=T===void 0?0:T,A=x.ry,M=A===void 0?0:A,I=x.sweepFlag,R=I===void 0?0:I,k=x.startAngle,D=k===void 0?0:k,G=x.endAngle,W=G===void 0?0:G;R===0&&(_*=-1);var z=C*Math.cos(D-_)+w,V=M*Math.sin(D-_)+E;h.startTangent=[z-i[0],V-i[1]];var q=C*Math.cos(D+W+_)+w,Y=M*Math.sin(D+W-_)+E;h.endTangent=[v[0]-q,v[1]-Y]}e.push(h)}return e}function xVt(n,e){for(var t=[],r=[],i=[],a=0;a<n.length;a++){var o=n[a],s=o.currentPoint,l=o.params,u=o.prePoint,h=void 0;switch(o.command){case"Q":h=iUe.box(u[0],u[1],l[1],l[2],l[3],l[4]);break;case"C":h=pR.box(u[0],u[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var c=o.arcParams;h=rVt.box(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:t.push(s[0]),r.push(s[1]);break}h&&(o.box=h,t.push(h.x,h.x+h.width),r.push(h.y,h.y+h.height)),e&&(o.command==="L"||o.command==="M")&&o.prePoint&&o.nextPoint&&i.push(o)}t=t.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0}),r=r.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0});var f=dm(t),d=dm(r),v=fm(t),p=fm(r);if(i.length===0)return{x:f,y:d,width:v-f,height:p-d};for(var a=0;a<i.length;a++){var o=i[a],s=o.currentPoint,g=void 0;s[0]===f?(g=d5(o,e),f=f-g.xExtra):s[0]===v&&(g=d5(o,e),v=v+g.xExtra),s[1]===d?(g=d5(o,e),d=d-g.yExtra):s[1]===p&&(g=d5(o,e),p=p+g.yExtra)}return{x:f,y:d,width:v-f,height:p-d}}function d5(n,e){var t=n.prePoint,r=n.currentPoint,i=n.nextPoint,a=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||Math.sin(l)===0||y9e(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),h=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));u=u>Math.PI/2?Math.PI-u:u,h=h>Math.PI/2?Math.PI-h:h;var c={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(h-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return c}function SVt(n){var e=n.attr(),t=e.path,r=e.stroke,i=r?e.lineWidth:0,a=n.get("segments")||dUe(t),o=xVt(a,i),s=o.x,l=o.y,u=o.width,h=o.height,c={minX:s,minY:l,maxX:s+u,maxY:l+h};return c=yse(n,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function wVt(n){var e=n.attr(),t=e.x1,r=e.y1,i=e.x2,a=e.y2,o=Math.min(t,i),s=Math.max(t,i),l=Math.min(r,a),u=Math.max(r,a),h={minX:o,maxX:s,minY:l,maxY:u};return h=yse(n,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function bVt(n){var e=n.attr(),t=e.x,r=e.y,i=e.rx,a=e.ry;return{x:t-i,y:r-a,width:i*2,height:a*2}}Rm("rect",eUe);Rm("image",eUe);Rm("circle",tUe);Rm("marker",tUe);Rm("polyline",sVt);Rm("polygon",lVt);Rm("text",cVt);Rm("path",SVt);Rm("line",wVt);Rm("ellipse",bVt);var EVt=function(n){Kn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.item=r.item,i.canvasX=r.canvasX,i.canvasY=r.canvasY,i.wheelDelta=r.wheelDelta,i.detail=r.detail,i}return e}(Ize),iee=function(e){return"".concat(e,"-").concat(Math.random()).concat(Date.now())},mse=function(e){if(vn(e))switch(e.length){case 4:return e;case 3:return e.push(e[1]),e;case 2:return e.concat(e);case 1:return[e[0],e[0],e[0],e[0]];default:return[0,0,0,0]}if(on(e))return[e,e,e,e];if(rr(e)){var t=parseInt(e,10);return[t,t,t,t]}return[0,0,0,0]},TVt=function(e){var t=new EVt(e.type,e);return t.clientX=e.clientX,t.clientY=e.clientY,t.x=e.x,t.y=e.y,t.target=e.target,t.currentTarget=e.currentTarget,t.bubbles=!0,t.item=e.item,t},CVt=function(e){if(!e)return!1;for(var t=9,r=[1,0,0,0,1,0,0,0,1],i=0;i<t;i++)if(e[i]!==r[i])return!0;return!1},Py=function(e){return Number.isNaN(Number(e))},vUe=function(e){for(var t=1/0,r=-1/0,i=1/0,a=-1/0,o=0;o<e.length;o++){var s=e[o],l=s.getBBox(),u=l.minX,h=l.minY,c=l.maxX,f=l.maxY;u<t&&(t=u),h<i&&(i=h),c>r&&(r=c),f>a&&(a=f)}var d=Math.floor(t),v=Math.floor(i),p=Math.ceil(r)-Math.floor(t),g=Math.ceil(a)-Math.floor(i);return{x:d,y:v,width:p,height:g,minX:t,minY:i,maxX:r,maxY:a}},AVt=function(e,t,r,i,a){t===void 0&&(t=15),r===void 0&&(r="quadratic"),i===void 0&&(i=void 0),a===void 0&&(a=void 0);for(var o=e.length,s=t*2,l=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},h=[],c={},f=0;f<o;f++){var d=e[f],v=d.source,p=d.target,g="".concat(v,"-").concat(p);if(!h[f]){u[g]||(u[g]=[]),h[f]=!0,u[g].push(d);for(var m=0;m<o;m++)if(f!==m){var y=e[m],_=y.source,x=y.target;h[m]||(v===x&&p===_?(u[g].push(y),h[m]=!0,c["".concat(_,"|").concat(x,"|").concat(u[g].length-1)]=!0):v===_&&p===x&&(u[g].push(y),h[m]=!0))}}}for(var S in u)for(var w=u[S],b=w.length,E=0;E<b;E++){var T=w[E];if(T.source===T.target){a&&(T.type=a),T.loopCfg={position:l[E%8],dist:Math.floor(E/8)*20+50};continue}if(b===1&&i&&T.source!==T.target){T.type=i;continue}T.type=r;var C=(E%2===0?1:-1)*(c["".concat(T.source,"|").concat(T.target,"|").concat(E)]?-1:1);b%2===1?T.curveOffset=C*Math.ceil(E/2)*s:T.curveOffset=C*(Math.floor(E/2)*s+t)}return e};const MVt=Object.freeze(Object.defineProperty({__proto__:null,uniqueId:iee,formatPadding:mse,cloneEvent:TVt,isViewportChanged:CVt,isNaN:Py,calculationItemsBBox:vUe,processParallelEdges:AVt},Symbol.toStringTag,{value:"Module"}));var Ew={};const IVt=Nd(t7t);Object.defineProperty(Ew,"__esModule",{value:!0});var XS=IVt;function pUe(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return XS.mat3.fromTranslation(r,t),XS.mat3.multiply(n,r,e)}Ew.leftTranslate=pUe;function gUe(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return XS.mat3.fromRotation(r,t),XS.mat3.multiply(n,r,e)}Ew.leftRotate=gUe;function yUe(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return XS.mat3.fromScaling(r,t),XS.mat3.multiply(n,r,e)}Ew.leftScale=yUe;function LVt(n,e,t){return XS.mat3.multiply(n,t,e)}function PVt(n,e){for(var t=n?[].concat(n):[1,0,0,0,1,0,0,0,1],r=0,i=e.length;r<i;r++){var a=e[r];switch(a[0]){case"t":pUe(t,t,[a[1],a[2]]);break;case"s":yUe(t,t,[a[1],a[2]]);break;case"r":gUe(t,t,a[1]);break;case"m":LVt(t,t,a[1]);break}}return t}var _Se=Ew.transform=PVt;function mUe(n,e){return n[0]*e[1]-e[0]*n[1]}Ew.direction=mUe;function OVt(n,e,t){var r=XS.vec2.angle(n,e),i=mUe(n,e)>=0;return t?i?Math.PI*2-r:r:i?r:Math.PI*2-r}Ew.angleTo=OVt;function RVt(n,e,t){return t?(n[0]=e[1],n[1]=-1*e[0]):(n[0]=-1*e[1],n[1]=e[0]),n}Ew.vertical=RVt;var DVt=function(){function n(e){this.destroyed=!1,this.graph=e,this.destroyed=!1}return n.prototype.getViewCenter=function(){var e=this.getFormatPadding(),t=this.graph,r=this.graph.get("width"),i=t.get("height");return{x:(r-e[1]-e[3])/2+e[3],y:(i-e[0]-e[2])/2+e[0]}},n.prototype.fitCenter=function(e,t){var r=this.graph,i=r.get("group"),a,o=r.getNodes();if(o.length>r.get("optimizeThreshold")){var s=1/0,l=1/0,u=-1/0,h=-1/0;o.forEach(function(x){var S=x.getModel(),w=S.x,b=S.y;s>w&&(s=w),l>b&&(l=b),u<w&&(u=w),h<b&&(h=b)});var c=i.getMatrix()||[1,0,0,0,1,0,0,0,1],f=$A({x:s,y:l},c),d=f.x,v=f.y,p=$A({x:u,y:h},c),g=p.x,m=p.y;a={minX:d,maxX:g,minY:v,maxY:m,width:g-d,height:m-v,x:d,y:v}}else a=i.getCanvasBBox();if(!(a.width===0||a.height===0)){var y=this.getViewCenter(),_={x:a.x+a.width/2,y:a.y+a.height/2};r.translate(y.x-_.x,y.y-_.y,e,t)}},n.prototype.animatedFitView=function(e,t,r,i,a,o,s,l){var u=this.graph;r=r||{duration:500,easing:"easeCubic"};var h=[1,0,0,0,1,0,0,0,1],c=i.x+a.x-o.x-i.minX,f=i.y+a.y-o.y-i.minY;if(!(Py(c)||Py(f))){var d=_Se(h,[["t",c,f]]);if(!l){var v=UD({animateCfg:r,callback:function(){u.emit("viewportchange",{action:"translate",matrix:d})}});e.animate(function(x){return{matrix:NQ(t,d,x)}},v);return}var p=u.get("minZoom"),g=u.get("maxZoom"),m=s;p&&s<p?(m=p,console.warn("fitview failed, ratio out of range, ratio: %f",s,"graph minzoom has been used instead")):g&&s>g&&(m=g,console.warn("fitview failed, ratio out of range, ratio: %f",s,"graph maxzoom has been used instead"));var y=_Se(d,[["t",-a.x,-a.y],["s",m,m],["t",a.x,a.y]]),_=UD({animateCfg:r,callback:function(){e.setMatrix(y),u.emit("viewportchange",{action:"translate",matrix:d}),u.emit("viewportchange",{action:"zoom",matrix:y})}});e.stopAnimate(),e.setMatrix(t),e.animate(function(x){return{matrix:NQ(t,y,x)}},_)}},n.prototype.fitView=function(e,t){var r=this.graph,i=this.getFormatPadding(),a=r.get("width"),o=r.get("height"),s=r.get("group"),l=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var u,h=r.getNodes();if(h.length>r.get("optimizeThreshold")){var c=1/0,f=1/0,d=-1/0,v=-1/0;h.forEach(function(w){var b=w.getModel(),E=b.x,T=b.y;c>E&&(c=E),f>T&&(f=T),d<E&&(d=E),v<T&&(v=T)}),u={minX:c,maxX:d,minY:f,maxY:v,width:d-c,height:v-f,x:c,y:f}}else u=s.getCanvasBBox();if(!(u.width===0||u.height===0)){var p=this.getViewCenter(),g={x:u.x+u.width/2,y:u.y+u.height/2},m=(a-i[1]-i[3])/u.width,y=(o-i[0]-i[2])/u.height,_=m;if(m>y&&(_=y),e)this.animatedFitView(s,l,t,u,p,g,_,!0);else{var x=p.x-g.x,S=p.y-g.y;if(Py(x)||Py(S))return;r.translate(x,S),r.zoom(_,p)||console.warn("zoom failed, ratio out of range, ratio: %f",_)}}},n.prototype.fitViewByRules=function(e,t,r){var i=e.onlyOutOfViewPort,a=i===void 0?!1:i,o=e.direction,s=o===void 0?"both":o,l=e.ratioRule,u=l===void 0?"min":l,h=this.graph,c=this.getFormatPadding(),f=h.get("width"),d=h.get("height"),v=h.get("group"),p=v.getMatrix()||[1,0,0,0,1,0,0,0,1];v.resetMatrix();var g,m=h.getNodes();if(m.length>h.get("optimizeThreshold")){var y=1/0,_=1/0,x=-1/0,S=-1/0;m.forEach(function(R){var k=R.getModel(),D=k.x,G=k.y;y>D&&(y=D),_>G&&(_=G),x<D&&(x=D),S<G&&(S=G)}),g={minX:y,maxX:x,minY:_,maxY:S,width:x-y,height:S-_,x:y,y:_}}else g=v.getCanvasBBox();if(!(g.width===0||g.height===0)){var w=this.getViewCenter(),b={x:g.x+g.width/2,y:g.y+g.height/2},E=(f-c[1]-c[3])/g.width,T=(d-c[0]-c[2])/g.height,C;if(s==="x"?C=E:s==="y"?C=T:C=u==="max"?Math.max(E,T):Math.min(E,T),a&&(C=C<1?C:1),t)this.animatedFitView(v,p,r,g,w,b,C,!0);else{var A=h.getZoom(),M=A*C,I=h.get("minZoom");M<I&&(M=I,console.warn("fitview failed, ratio out of range, ratio: %f",C,"graph minzoom has been used instead")),h.translate(w.x-b.x,w.y-b.y),h.zoomTo(M,w)}}},n.prototype.getFormatPadding=function(){var e=this.graph.get("fitViewPadding");return mse(e)},n.prototype.focusPoint=function(e,t,r){var i=this,a=this.getViewCenter(),o=this.getPointByCanvas(a.x,a.y),s=this.graph.get("group").getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),t){var l=(o.x-e.x)*s[0],u=(o.y-e.y)*s[4],h=0,c=0,f=0,d=0;this.graph.get("canvas").animate(function(v){f=l*v,d=u*v,i.graph.translate(f-h,d-c),h=f,c=d},ve({},r))}else this.graph.translate((o.x-e.x)*s[0],(o.y-e.y)*s[4])},n.prototype.getPointByCanvas=function(e,t){var r=this.graph.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var i=hze({x:e,y:t},r);return i},n.prototype.getPointByClient=function(e,t){var r=this.graph.get("canvas"),i=r.getPointByClient(e,t);return this.getPointByCanvas(i.x,i.y)},n.prototype.getClientByPoint=function(e,t){var r=this.graph.get("canvas"),i=this.getCanvasByPoint(e,t),a=r.getClientByPoint(i.x,i.y);return{x:a.x,y:a.y}},n.prototype.getCanvasByPoint=function(e,t){var r=this.graph.get("group").getMatrix();return r||(r=[1,0,0,0,1,0,0,0,1]),$A({x:e,y:t},r)},n.prototype.focus=function(e,t,r){if(rr(e)&&(e=this.graph.findById(e)),e){var i=0,a=0;if(e.getType&&e.getType()==="edge"){var o=e.getSource().get("group").getMatrix(),s=e.getTarget().get("group").getMatrix();o&&s?(i=(o[6]+s[6])/2,a=(o[7]+s[7])/2):(o||s)&&(i=o?o[6]:s[6],a=o?o[7]:s[7])}else{var l=e.get("group"),u=l.getMatrix();u||(u=[1,0,0,0,1,0,0,0,1]),i=u[6],a=u[7]}this.focusPoint({x:i,y:a},t,r)}},n.prototype.focusItems=function(e,t,r,i){if(!!e.length){var a=this.graph,o=this.getFormatPadding(),s=a.get("width"),l=a.get("height"),u=a.get("group"),h=u.getMatrix()||[1,0,0,0,1,0,0,0,1];u.resetMatrix();for(var c={x:0,y:0,minX:Number.MAX_SAFE_INTEGER,minY:Number.MAX_SAFE_INTEGER,maxX:Number.MIN_SAFE_INTEGER,maxY:Number.MIN_SAFE_INTEGER,width:0,height:0},f=0,d=e;f<d.length;f++){var v=d[f],p=v.getBBox();p.minX<c.minX&&(c.minX=p.minX),p.minY<c.minY&&(c.minY=p.minY),p.maxX>c.maxX&&(c.maxX=p.maxX),p.maxY>c.maxY&&(c.maxY=p.maxY)}if(c.x=c.minX,c.y=c.minY,c.width=c.maxX-c.minX,c.height=c.maxY-c.minY,!(c.width===0||c.height===0)){var g=this.getViewCenter(),m={x:c.x+c.width/2,y:c.y+c.height/2},y=(s-o[1]-o[3])/c.width,_=(l-o[0]-o[2])/c.height,x=y;y>_&&(x=_),r?this.animatedFitView(u,h,i,c,g,m,x,t):(a.translate(g.x-m.x,g.y-m.y),t&&!a.zoom(x,g)&&console.warn("zoom failed, ratio out of range, ratio: %f",x))}}},n.prototype.changeSize=function(e,t){var r=this.graph;if(!on(e)||!on(t))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:e,height:t});var i=r.get("canvas");i.changeSize(e,t);var a=r.get("plugins");a.forEach(function(o){o.get("gridContainer")&&o.positionInit()})},n.prototype.destroy=function(){this.graph=null,this.destroyed=!1},n}();function aee(n){return aee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aee(n)}function xSe(n){if(typeof n!="string")return n;var e=function(b){if(typeof b!="string")return b;try{return JSON.parse(b.trim())}catch{return b.trim()}},t=e(n);if(typeof t!="string")return t;for(var r=function(b){return b[b.length-1]},i=n.trim(),a=[],o=[],s=function(){for(var b=[],E=0;E<arguments.length;E++)b[E]=arguments[E];return b.some(function(T){return r(o)===T})},l=function(){return r(a)},u=null,h=0,c="";h<i.length;){var f=i[h],d=s('"',"'");if(!d&&!f.trim()){h+=1;continue}var v=i[h-1]==="\\",p=s("}"),g=s("]"),m=s(","),y=l();if(d)if(r(o)===f&&!v){o.pop();var _=e(c);y.push(_),u=_,c=""}else c+=f;else if(g&&f===",")c&&(y.push(e(c)),c="");else if(p&&f===":")o.push(","),c&&(y.push(c),c="");else if(m&&f===",")c&&(y.push(e(c)),c=""),o.pop();else if(f==="}"&&(p||m)){c&&(y.push(e(c)),c=""),m&&o.pop();for(var x={},S=1;S<y.length;S+=2)x[y[S-1]]=y[S];a.pop(),a.length&&r(a).push(x),o.pop(),u=x}else f==="]"&&g?(c&&(y.push(e(c)),c=""),a.pop(),a.length&&r(a).push(y),o.pop(),u=y):f==="{"?(a.push([]),o.push("}")):f==="["?(a.push([]),o.push("]")):f==='"'?o.push('"'):f==="'"?o.push("'"):c+=f;h+=1}return u||c}var NVt=function(e){return e.split("-").reduce(function(t,r){return t+r.charAt(0).toUpperCase()+r.slice(1)})},kVt=function(e){return function(t){for(var r=e.length,i=[],a=0,o="";a<r;)if(e[a]==="{"&&e[a+1]==="{")i.push(o),o="",a+=2;else if(e[a]==="}"&&e[a+1]==="}"){if(i.length){var s=i.pop();o=y1(t,o,s.endsWith("=")?'"{'.concat(o,'}"'):o),i.push(s+o)}a+=2,o=""}else o+=e[a],a+=1;return i.push(o),i.map(function(l,u){return i[u-1]&&i[u-1].endsWith("=")?'"{'.concat(l,'}"'):l}).join("")}};function _Ue(n,e){var t={},r=n.getAttributeNames&&n.getAttributeNames()||[],i=n.children&&Array.from(n.children).map(function(s){return _Ue(s,e)}),a={},o=n.tagName?n.tagName.toLowerCase():"group";return o==="text"&&(t.text=n.innerText),a.type=o,o==="img"&&(a.type="image"),Array.from(r).forEach(function(s){var l=NVt(s),u=n.getAttribute(s);try{if(l==="style"||l==="attrs"){var h=xSe(u);t=ve(ve({},t),h)}else a[l]=xSe(u)}catch(c){if(l==="style")throw c;a[l]=u}}),a.attrs=t,e&&e.style&&a.name&&aee(e.style[a.name])==="object"&&(a.attrs=ve(ve({},a.attrs),e.style[a.name])),e&&e.style&&a.keyshape&&(a.attrs=ve(ve({},a.attrs),e.style)),i.length&&(a.children=i),a}function FVt(n,e,t){var r=n.attrs,i=r===void 0?{}:r,a={x:e.x||0,y:e.y||0,width:t.width||0,height:t.height||0},o,s;switch(n.type){case"maker":case"circle":i.r&&(s=2*i.r,o=2*i.r);break;case"text":i.text&&(s=wze(i.text,i.fontSize||12)[0],o=16,a.y+=o,a.height=o,a.width=s,n.attrs=ve({fontSize:12,fill:"#000"},i));break;default:i.width&&(s=i.width),i.height&&(o=i.height)}return o>=0&&(a.height=o),s>=0&&(a.width=s),i.marginTop&&(a.y+=i.marginTop),i.marginLeft&&(a.x+=i.marginLeft),a}function xUe(n,e){var t;e===void 0&&(e={x:0,y:0});var r=ve({x:0,y:0,width:0,height:0},e);if(!((t=n.children)===null||t===void 0)&&t.length){var i=n.attrs,a=i===void 0?{}:i,o=a.marginTop,s=ve({},e);o&&(s.y+=o);for(var l=0;l<n.children.length;l++){n.children[l].attrs.key="".concat(a.key||"root"," -").concat(l," ");var u=xUe(n.children[l],s);if(u.bbox){var h=u.bbox;u.attrs.next==="inline"?s.x+=u.bbox.width:s.y+=u.bbox.height,h.width+h.x>r.width&&(r.width=h.width+h.x),h.height+h.y>r.height&&(r.height=h.height+h.y)}}}return n.bbox=FVt(n,e,r),n.attrs=ve(ve({},n.attrs),n.bbox),n}function SUe(n,e){var t,r,i,a,o=(n||{}).type,s=((e==null?void 0:e.attrs)||{}).key;if(s&&n&&(n.attrs.key=s),!n&&e)return{action:"delete",val:e,type:o,key:s};if(n&&!e)return{action:"add",val:n,type:o};if(!n&&!e)return{action:"same",type:o};var l=[];if(((t=n.children)===null||t===void 0?void 0:t.length)>0||((r=e.children)===null||r===void 0?void 0:r.length)>0)for(var u=Math.max((i=n.children)===null||i===void 0?void 0:i.length,(a=e.children)===null||a===void 0?void 0:a.length),h=e.children||[],c=n.children||[],f=0;f<u;f+=1)l.push(SUe(c[f],h[f]));var d=Object.keys(e.attrs),v=Object.keys(n.attrs);return e.type!==n.type?{action:"restructure",nowTarget:n,formerTarget:e,key:s,children:l}:d.filter(function(p){return p!=="children"}).some(function(p){return n.attrs[p]!==e.attrs[p]||!v.includes(p)})?{action:"change",val:n,children:l,type:o,key:s}:{action:"same",children:l,type:o,key:s}}function SSe(n){var e={},t=function(i){var a=typeof n=="function"?n(i):n,o=kVt(a)(i),s=document.createElement("div");s.innerHTML=o;var l=s.children[0],u=xUe(_Ue(l,i));return s.remove(),u};return{draw:function(i,a){var o=t(i),s=a,l=function u(h){var c=h.attrs,f=c===void 0?{}:c,d=h.bbox,v=h.type,p=h.children,g=rh(h,["attrs","bbox","type","children"]);if(h.type!=="group"){var m=a.addShape(h.type,ve({attrs:f,origin:{bbox:d,type:v,children:p}},g));h.keyshape&&(s=m)}h.children&&h.children.forEach(function(y){return u(y)})};return l(o),e[i.id]=[o],s},update:function(i,a){e[i.id]||(e[i.id]=[]);var o=a.getContainer(),s=o.get("children"),l=t(i),u=e[i.id].pop(),h=SUe(l,u),c=function v(p){var g;p.type!=="group"&&o.addShape(p.type,{attrs:p.attrs}),!((g=p.children)===null||g===void 0)&&g.length&&p.children.map(function(m){return v(m)})},f=function v(p){var g,m=s.find(function(y){return y.attrs.key===p.attrs.key});m&&o.removeChild(m),!((g=p.children)===null||g===void 0)&&g.length&&p.children.map(function(y){return v(y)})},d=function v(p){var g=p.key;if(p.type!=="group"){var m=s.find(function(_){return _.attrs.key===g});switch(p.action){case"change":if(m){var y=p.val.keyshape?a.getOriginStyle():{};m.attr(ve(ve({},y),p.val.attrs))}break;case"add":c(p.val);break;case"delete":f(p.val);break;case"restructure":f(p.formerTarget),c(p.nowTarget);break}}p.children&&p.children.forEach(function(_){return v(_)})};d(h),e[i.id].push(l)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var RX={};function wSe(n){return RX[n]||(RX[n]=EM(n)),RX[n]}var BVt={defaultShapeType:"defaultType",className:null,getShape:function(e){var t=this,r=t[e]||t[t.defaultShapeType]||t["simple-circle"];return r},draw:function(e,t,r){var i=this.getShape(e);r.shapeMap={};var a=i.draw(t,r);return i.afterDraw&&i.afterDraw(t,r,a),a},baseUpdate:function(e,t,r,i){var a,o,s=this.getShape(e);s.update&&(s.mergeStyle=(a=s.getOptions)===null||a===void 0?void 0:a.call(s,t,i),(o=s.update)===null||o===void 0||o.call(s,t,r,i)),s.afterUpdate&&s.afterUpdate(t,r)},setState:function(e,t,r,i){var a=this.getShape(e);a.setState(t,r,i)},shouldUpdate:function(e){var t=this.getShape(e);return!!t.update},getControlPoints:function(e,t){var r=this.getShape(e);return r.getControlPoints(t)},getAnchorPoints:function(e,t){var r=this.getShape(e);return r.getAnchorPoints(t)}},DX={options:{},draw:function(e,t){return this.drawShape(e,t)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t=this.options.anchorPoints,r=e.anchorPoints||t;return r}},_s=function(){function n(){}return n.registerFactory=function(e,t){var r=wSe(e),i=BVt,a=ve(ve({},i),t);return n[r]=a,a.className=r,a},n.getFactory=function(e){var t=wSe(e);return n[t]},n.registerNode=function(e,t,r){var i=n.Node,a;if(typeof t=="string"||typeof t=="function"){var o=SSe(t);a=ve(ve({},i.getShape("single-node")),o)}else if(t.jsx){var s=t.jsx,o=SSe(s);a=ve(ve(ve({},i.getShape("single-node")),o),t)}else{i.getShape(r);var l=r?i.getShape(r):DX;a=ve(ve({},l),t)}return a.type=e,a.itemType="node",i[e]=a,a},n.registerEdge=function(e,t,r){var i=n.Edge,a=r?i.getShape(r):DX,o=ve(ve({},a),t);return o.type=e,o.itemType="edge",i[e]=o,o},n.registerCombo=function(e,t,r){var i=n.Combo,a=r?i.getShape(r):DX,o=ve(ve({},a),t);return o.type=e,o.itemType="combo",i[e]=o,o},n}();_s.registerFactory("node",{defaultShapeType:"circle"});_s.registerFactory("edge",{defaultShapeType:"line"});_s.registerFactory("combo",{defaultShapeType:"circle"});var NX="bboxCache",kX="bboxCanvasCache",wUe=function(){function n(e){this._cfg={},this.destroyed=!1,this.optimize=!1;var t={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(t,this.getDefaultCfg(),e);var r=this.get("model"),i=r.id,a=this.get("type");typeof i>"u"?i=iee(a):typeof i!="string"&&(i=String(i)),this.get("model").id=i,this.set("id",i);var o=e.group;o&&(o.set("item",this),o.set("id",i)),this.init(),this.draw();var s=r.shape||r.type||(a==="edge"?"line":"circle"),l=this.get("shapeFactory");if(l&&l[s]){var u=l[s].options;if(u&&u.stateStyles){var h=this.get("styles")||r.stateStyles;h=ms({},u.stateStyles,h),this.set("styles",h)}}}return n.prototype.calculateBBox=function(){var e=this.get("keyShape"),t=this.get("group"),r=g9(e,t);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},n.prototype.calculateCanvasBBox=function(){var e=this.get("keyShape"),t=this.get("group"),r=g9(e,t);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},n.prototype.drawInner=function(){var e=this,t=e.get("shapeFactory"),r=e.get("group"),i=e.get("model");r.clear();var a=i.visible;if(a!==void 0&&!a&&e.changeVisibility(a),!!t){e.updatePosition(i);var o=e.getShapeCfg(i),s=o.type,l=t.draw(s,o,r);l&&(e.set("keyShape",l),l.set("isKeyShape",!0),l.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",s),this.restoreStates(t,s)}},n.prototype.setOriginStyle=function(){var e=this.get("group"),t=e.get("children"),r=this.getKeyShape(),i=this,a=r.get("name");if(this.get("originStyle")){var d=this.get("originStyle");a&&!d[a]&&(d[a]={});for(var v=this.getCurrentStatesStyle(),p=function(m){var y=t[m],_=y.get("name"),x=y.attr();if(_&&_!==a){var S=v[_];d[_]||(d[_]={}),S?Object.keys(x).forEach(function(E){var T=x[E];T!==S[E]&&(d[_][E]=T)}):d[_]=y.get("type")!=="image"?Xi(x):i.getShapeStyleByName(_)}else{var w=y.attr(),b={};Object.keys(v).forEach(function(E){var T=v[E];(E===a||!kh(T))&&(b[E]=T)}),Object.keys(w).forEach(function(E){var T=w[E];b[E]!==T&&(a?d[a][E]=T:d[E]=T)})}},s=0;s<t.length;s++)p(s);delete d.path,delete d.matrix,delete d.x,delete d.y,d[a]&&(delete d[a].x,delete d[a].y,delete d[a].matrix,delete d[a].path),i.set("originStyle",d)}else{for(var o={},s=0;s<t.length;s++){var l=t[s],u=l.get("type"),h=l.get("name");if(h&&h!==a)o[h]=u!=="image"?Xi(l.attr()):i.getShapeStyleByName(h),u==="text"&&o[h]&&(delete o[h].x,delete o[h].y,delete o[h].matrix);else{var c=i.getShapeStyleByName();if(delete c.path,delete c.matrix,!a)Object.assign(o,c);else if(h)o[a]=c;else{var f=iee("shape");l.set("name",f),e.shapeMap[f]=l,o[f]=u!=="image"?Xi(l.attr()):i.getShapeStyleByName(h)}}}i.set("originStyle",o)}},n.prototype.restoreStates=function(e,t){var r=this,i=r.get("states");At(i,function(a){e.setState(t,a,!0,r)})},n.prototype.init=function(){var e=_s.getFactory(this.get("type"));this.set("shapeFactory",e)},n.prototype.get=function(e){return this._cfg[e]},n.prototype.set=function(e,t){kh(e)?this._cfg=ve(ve({},this._cfg),e):this._cfg[e]=t},n.prototype.getDefaultCfg=function(){return{}},n.prototype.clearCache=function(){this.set(NX,null),this.set(kX,null)},n.prototype.beforeDraw=function(){},n.prototype.afterDraw=function(){},n.prototype.afterUpdate=function(){},n.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},n.prototype.getShapeStyleByName=function(e){var t=this.get("group"),r;if(e?r=t.shapeMap[e]||t.find(function(a){return a.get("name")===e}):r=this.getKeyShape(),r){var i={};return At(r.attr(),function(a,o){(o!=="img"||rr(a))&&(i[o]=a)}),i}return{}},n.prototype.getShapeCfg=function(e,t){var r=this.get("styles");if(r){var i=e;return i.style=ve(ve({},r),e.style),i}return e},n.prototype.getStateStyle=function(e){var t=this.get("styles"),r=t&&t[e];return r},n.prototype.getOriginStyle=function(){return this.get("originStyle")},n.prototype.getCurrentStatesStyle=function(){var e=this,t={},r=e.getStates();return!r||!r.length?this.get("originStyle"):(At(e.getStates(),function(i){t=Object.assign(t,e.getStateStyle(i))}),t)},n.prototype.setState=function(e,t){var r=this.get("states"),i=this.get("shapeFactory"),a=e,o=e;rr(t)&&(a="".concat(e,":").concat(t),o="".concat(e,":"));var s=r;if(z3(t)){var l=r.indexOf(o);if(t){if(l>-1)return;r.push(a)}else l>-1&&r.splice(l,1)}else if(rr(t)){var u=r.filter(function(f){return f.includes(o)});u.length>0&&this.clearStates(u),s=s.filter(function(f){return!f.includes(o)}),s.push(a),this.set("states",s)}if(i){var h=this.get("model"),c=h.type;i.setState(c,e,t,this)}},n.prototype.clearStates=function(e){var t=this,r=t.getStates(),i=t.get("shapeFactory"),a=t.get("model"),o=a.type;e||(e=r),rr(e)&&(e=[e]);var s=r.filter(function(l){return e.indexOf(l)===-1});t.set("states",s),e.forEach(function(l){i.setState(o,l,!1,t)})},n.prototype.setOptimize=function(e){this.optimize=e},n.prototype.getContainer=function(){return this.get("group")},n.prototype.getKeyShape=function(){return this.get("keyShape")},n.prototype.getModel=function(){return this.get("model")},n.prototype.getType=function(){return this.get("type")},n.prototype.getID=function(){return this.get("id")},n.prototype.isItem=function(){return!0},n.prototype.getStates=function(){return this.get("states")},n.prototype.hasState=function(e){var t=this.getStates();return t.indexOf(e)>=0},n.prototype.refresh=function(e){var t=this.get("model");this.updatePosition(t),this.updateShape(e),this.afterUpdate(),this.clearCache()},n.prototype.getUpdateType=function(e){},n.prototype.update=function(e,t){t===void 0&&(t=void 0);var r=this.get("model");if(t==="move")this.updatePosition(e);else{var i=r.visible,a=e.visible;i!==a&&a!==void 0&&this.changeVisibility(a);var o={x:r.x,y:r.y};e.x=isNaN(+e.x)?r.x:+e.x,e.y=isNaN(+e.y)?r.y:+e.y;var s=this.get("styles");if(e.stateStyles){var l=e.stateStyles;_n(s,l),delete e.stateStyles}Object.assign(r,e),(o.x!==e.x||o.y!==e.y)&&this.updatePosition(e),this.updateShape(t)}this.afterUpdate(),this.clearCache()},n.prototype.updateShape=function(e){var t=this.get("shapeFactory"),r=this.get("model"),i=r.type;if(t.shouldUpdate(i)&&i===this.get("currentShape")){var a=this.getShapeCfg(r,e);t.baseUpdate(i,a,this,e),e!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(t,i)},n.prototype.updatePosition=function(e){var t=this.get("model"),r=isNaN(+e.x)?+t.x:+e.x,i=isNaN(+e.y)?+t.y:+e.y,a=this.get("group");if(isNaN(r)||isNaN(i))return!1;t.x=r,t.y=i;var o=a.getMatrix();return o&&o[6]===r&&o[7]===i?!1:(a.resetMatrix(),cze(a,{x:r,y:i}),this.clearCache(),!0)},n.prototype.getBBox=function(){var e=this.get(NX);return e||(e=this.calculateBBox(),this.set(NX,e)),e},n.prototype.getCanvasBBox=function(){var e=this.get(kX);return e||(e=this.calculateCanvasBBox(),this.set(kX,e)),e},n.prototype.toFront=function(){var e=this.get("group");e.toFront()},n.prototype.toBack=function(){var e=this.get("group");e.toBack()},n.prototype.show=function(){this.changeVisibility(!0)},n.prototype.hide=function(){this.changeVisibility(!1)},n.prototype.changeVisibility=function(e){var t=this.get("group");e?t.show():t.hide(),this.set("visible",e)},n.prototype.isVisible=function(){return this.get("visible")},n.prototype.enableCapture=function(e){var t=this.get("group");t&&t.set("capture",e)},n.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),t=this.get("group");e&&t.stopAnimate(),t.shapeMap={},this.clearCache(),t.remove(),this._cfg=null,this.destroyed=!0}},n}(),v5={source:"start",target:"end"},iy="Node",lC="Point",GVt="Anchor",bUe=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,r){var i=v5[t]+lC,a=t+iy,o=this.get(a);o&&!o.destroyed&&o.removeEdge(this),kh(r)?(this.set(i,r),this.set(a,null)):r&&(r.addEdge(this),this.set(a,r),this.set(i,null))},e.prototype.getLinkPoint=function(t,r,i){var a=v5[t]+lC,o=t+iy,s=this.get(a);if(!s){var l=this.get(o),u=t+GVt,h=this.getPrePoint(t,i),c=r[u];an(c)||(s=l.getLinkPointByAnchor(c)),s=s||l.getLinkPoint(h),an(s.index)||this.set("".concat(t,"AnchorIndex"),s.index)}return s},e.prototype.getPrePoint=function(t,r){if(r&&r.length){var i=t==="source"?0:r.length-1;return r[i]}var a=t==="source"?"target":"source";return this.getEndPoint(a)},e.prototype.getEndPoint=function(t){var r=t+iy,i=v5[t]+lC,a=this.get(r);return a&&!a.destroyed?a.get("model"):this.get(i)},e.prototype.getControlPointsByCenter=function(t){var r=this.getEndPoint("source"),i=this.getEndPoint("target"),a=this.get("shapeFactory"),o=t.type;return a.getControlPoints(o,{startPoint:r,endPoint:i})},e.prototype.getEndCenter=function(t){var r=t+iy,i=v5[t]+lC,a=this.get(r);if(a){var o=a.getBBox();return{x:o.centerX,y:o.centerY}}return this.get(i)},e.prototype.init=function(){n.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(t,r){var i=this,a=i.get("linkCenter"),o=r!=null&&r.includes("move")?t:n.prototype.getShapeCfg.call(this,t);if(a)o.startPoint=i.getEndCenter("source"),o.endPoint=i.getEndCenter("target");else{var s=o.controlPoints||i.getControlPointsByCenter(o);o.startPoint=i.getLinkPoint("source",t,s),o.endPoint=i.getLinkPoint("target",t,s)}return o.sourceNode=i.get("sourceNode"),o.targetNode=i.get("targetNode"),o},e.prototype.getModel=function(){var t=this.get("model"),r=this.get("source".concat(iy)),i=this.get("target".concat(iy));return r?delete t["source".concat(iy)]:t.source=this.get("start".concat(lC)),i?delete t["target".concat(iy)]:t.target=this.get("end".concat(lC)),!rr(t.source)&&!kh(t.source)&&(t.source=t.source.getID()),!rr(t.target)&&!kh(t.target)&&(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,r){r===void 0&&(r=void 0);var i=this.get("model"),a=i.visible,o=t.visible;a!==o&&o!==void 0&&this.changeVisibility(o);var s=this.get("source"),l=this.get("target");if(!(!s||s.destroyed||!l||l.destroyed)){var u=this.get("styles");if(t.stateStyles){var h=t.stateStyles;_n(u,h),delete t.stateStyles}Object.assign(i,t),this.updateShape(r),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var t=this.get("source".concat(iy)),r=this.get("target".concat(iy));t&&!t.destroyed&&t.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),n.prototype.destroy.call(this)},e}(wUe),FX="anchorPointsCache",zVt="bboxCache",_se=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getNearestPoint=function(t,r){for(var i=0,a=t[0],o=v9(t[0],r),s=0;s<t.length;s++){var l=t[s],u=v9(l,r);u<o&&(a=l,o=u,i=s)}return a.anchorIndex=i,a},e.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getInEdges=function(){var t=this;return this.get("edges").filter(function(r){return r.get("target")===t})},e.prototype.getOutEdges=function(){var t=this;return this.get("edges").filter(function(r){return r.get("source")===t})},e.prototype.getNeighbors=function(t){var r=this,i=this.get("edges");if(t==="target"){var a=function(u){return u.getSource()===r};return i.filter(a).map(function(l){return l.getTarget()})}if(t==="source"){var o=function(u){return u.getTarget()===r};return i.filter(o).map(function(l){return l.getSource()})}var s=function(u){return u.getSource()===r?u.getTarget():u.getSource()};return i.map(s)},e.prototype.getLinkPointByAnchor=function(t){var r=this.getAnchorPoints();return r[t]},e.prototype.getLinkPoint=function(t){var r=this.get("keyShape"),i=r.get("type"),a=this.get("type"),o,s,l=this.getBBox();a==="combo"?(o=l.centerX||(l.maxX+l.minX)/2,s=l.centerY||(l.maxY+l.minY)/2):(o=l.centerX,s=l.centerY);var u=this.getAnchorPoints(),h;switch(i){case"circle":h=lze({x:o,y:s,r:l.width/2},t);break;case"ellipse":h=uze({x:o,y:s,rx:l.width/2,ry:l.height/2},t);break;default:h=sze(l,t)}var c=h;return u.length&&(c||(c=t),c=this.getNearestPoint(u,c)),c||(c={x:o,y:s}),c},e.prototype.getAnchorPoints=function(){var t=this.get(FX);if(!t){t=[];var r=this.get("shapeFactory"),i=this.getBBox(),a=this.get("model"),o=this.getShapeCfg(a),s=a.type,l=r.getAnchorPoints(s,o)||[];At(l,function(u,h){var c={x:i.minX+u[0]*i.width,y:i.minY+u[1]*i.height,anchorIndex:h};t.push(c)}),this.set(FX,t)}return t},e.prototype.addEdge=function(t){this.get("edges").push(t)},e.prototype.lock=function(){this.set("locked",!0)},e.prototype.unlock=function(){this.set("locked",!1)},e.prototype.hasLocked=function(){return this.get("locked")},e.prototype.removeEdge=function(t){var r=this.getEdges(),i=r.indexOf(t);i>-1&&r.splice(i,1)},e.prototype.clearCache=function(){this.set(zVt,null),this.set(FX,null)},e.prototype.getUpdateType=function(t){var r,i,a,o,s;if(!!t){var l=!an(t.x),u=!an(t.y),h=Object.keys(t);if(h.length===1&&(l||u)||h.length===2&&l&&u)return"move";if(on(t.x)||on(t.y)||t.type||t.anchorPoints||t.size||(t==null?void 0:t.style)&&(((r=t==null?void 0:t.style)===null||r===void 0?void 0:r.r)||((i=t==null?void 0:t.style)===null||i===void 0?void 0:i.width)||((a=t==null?void 0:t.style)===null||a===void 0?void 0:a.height)||((o=t==null?void 0:t.style)===null||o===void 0?void 0:o.rx)||((s=t==null?void 0:t.style)===null||s===void 0?void 0:s.ry)))return"bbox|label";var c=h.includes("label")||h.includes("labelCfg");return c?"style|label":"style"}},e.prototype.setState=function(t,r){var i=this;if(this.optimize){n.prototype.setState.call(this,t,r);return}this.runWithBBoxAffected(function(){return n.prototype.setState.call(i,t,r)})},e.prototype.clearStates=function(t){var r=this;if(this.optimize){n.prototype.clearStates.call(this,t);return}this.runWithBBoxAffected(function(){return n.prototype.clearStates.call(r,t)})},e.prototype.runWithBBoxAffected=function(t){var r=["r","width","height","rx","ry","lineWidth"],i=this.getKeyShape().attr(),a={};Object.keys(this.getKeyShape().attr()).forEach(function(u){r.includes(u)&&(a[u]=i[u])}),t();for(var o=this.getKeyShape().attr(),s=0;s<r.length;s++){var l=r[s];if(o[l]!==a[l]){this.clearCache(),this.getEdges().forEach(function(u){return u.refresh()});break}}},e}(wUe),bSe="bboxCache",ESe="bboxCanvasCache",p5="sizeCache",TSe="anchorPointsCache",EUe=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var r=this.get("styles"),i=this.get("bbox");if(r&&i){var a=t,o=on(t.size)?[t.size,t.size]:t.size,s=on(t.fixSize)?[t.fixSize,t.fixSize]:t.fixSize,l=o||s||tn.defaultCombo.size,u={r:(Math.max(i.width,i.height)||Math.max(l[0],l[1]))/2,width:i.width||l[0],height:i.height||l[1]};a.style=ve(ve(ve({},r),t.style),u);var h=t.padding||tn.defaultCombo.padding;return on(h)?(u.r+=h,u.width+=h*2,u.height+=h*2):(u.r=u.r+Math.max.apply(Math,h),u.width+=h[1]+h[3]||h[1]*2,u.height+=h[0]+h[2]||h[0]*2),this.set(p5,u),a}return t},e.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var t=this.get("keyShape"),r=this.get("group"),i=this.get(bSe)||{},a=i.x,o=i.x,s=this.get(p5),l=g9(t,r);if(l.centerX=(l.minX+l.maxX)/2,l.centerY=(l.minY+l.maxY)/2,s){s.width=Math.max(s.width,l.width),s.height=Math.max(s.height,l.height),this.set(p5,s);var u=t.get("type");u==="circle"?(l.width=s.r*2,l.height=s.r*2):(l.width=s.width,l.height=s.height),l.minX=l.centerX-l.width/2,l.minY=l.centerY-l.height/2,l.maxX=l.centerX+l.width/2,l.maxY=l.centerY+l.height/2}else l.width=l.maxX-l.minX,l.height=l.maxY-l.minY,l.centerX=(l.minX+l.maxX)/2,l.centerY=(l.minY+l.maxY)/2;return l.x=l.minX,l.y=l.minY,(l.x!==a||l.y!==o)&&this.set(TSe,null),l}},e.prototype.getChildren=function(){var t=this;return{nodes:t.getNodes(),combos:t.getCombos()}},e.prototype.getNodes=function(){var t=this;return t.get("nodes")},e.prototype.getCombos=function(){var t=this;return t.get("combos")},e.prototype.addChild=function(t){var r=this,i=t.getType();switch(i){case"node":r.addNode(t);break;case"combo":r.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){var r=this;return r.get("combos").push(t),!0},e.prototype.addNode=function(t){var r=this;return r.get("nodes").push(t),!0},e.prototype.removeChild=function(t){var r=this,i=t.getType();switch(i){case"node":r.removeNode(t);break;case"combo":r.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(!!t){var r=this.getCombos(),i=r.indexOf(t);return i>-1?(r.splice(i,1),!0):!1}},e.prototype.removeNode=function(t){if(!!t){var r=this.getNodes(),i=r.indexOf(t);return i>-1?(r.splice(i,1),!0):!1}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){this.set(ESe,null);var t=this.calculateCanvasBBox();return t},e.prototype.clearCache=function(){this.set(bSe,null),this.set(ESe,null),this.set(TSe,null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),r=this.get("group");t&&r.stopAnimate(),r.shapeMap={},this.clearCache(),this.set(p5,null),this.set("bbox",null),r.remove(),this._cfg=null,this.destroyed=!0}},e}(_se),g5="node",y5="edge",CSe="vedge",_P="combo",UVt="default",ASe="Mapper",Jm="stateStyles",VVt=function(){function n(e){var t=this;this.edgeToBeUpdateMap={},this.throttleRefresh=FD(function(r){var i=t.graph;if(!(!i||i.get("destroyed"))){var a=t.edgeToBeUpdateMap;if(!!a){var o=Object.values(a);!o.length||(o.forEach(function(s){var l=s.edge;if(!(!l||l.destroyed)){var u=l.getSource(),h=l.getTarget();!u||u.destroyed||!h||h.destroyed||l.refresh(s.updateType)}}),t.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=e,this.destroyed=!1}return n.prototype.addItem=function(e,t){var r=this.graph,i=e===CSe?y5:e,a=r.get("".concat(i,"Group"))||r.get("group"),o=EM(i),s=null,l=r.get(i+EM(Jm))||{},u=r.get(UVt+o);t[Jm]&&(l=t[Jm]),u&&At(u,function(w,b){Wh(w)&&!vn(w)?t[b]=ms({},w,t[b]):vn(w)?t[b]=t[b]||Xi(u[b]):t[b]=t[b]||u[b]});var h=r.get(i+ASe);if(h){var c=h(t);c[Jm]&&(l=c[Jm],delete c[Jm]),At(c,function(w,b){Wh(w)&&!vn(w)?t[b]=ms({},t[b],w):t[b]=c[b]||t[b]})}if(r.emit("beforeadditem",{type:e,model:t}),e===y5||e===CSe){var f=void 0,d=void 0;if(f=t.source,d=t.target,f&&rr(f)&&(f=r.findById(f)),d&&rr(d)&&(d=r.findById(d)),!f||!d){console.warn("The source or target node of edge ".concat(t.id," does not exist!"));return}f.getType&&f.getType()==="combo"&&(t.isComboEdge=!0),d.getType&&d.getType()==="combo"&&(t.isComboEdge=!0),s=new bUe({model:t,source:f,target:d,styles:l,linkCenter:r.get("linkCenter"),group:a.addGroup()})}else if(e===g5)s=new _se({model:t,styles:l,group:a.addGroup()});else if(e===_P){var v=t.children,p=HB(v,r),g=void 0,m=void 0;if(isNaN(p.x)?isNaN(t.x)&&(g=Math.random()*100):g=p.x,isNaN(p.y)?isNaN(t.y)&&(m=Math.random()*100):m=p.y,isNaN(t.x)||isNaN(t.y))t.x=g,t.y=m;else{var y=t.x-g,_=t.y-m;this.updateComboSucceeds(t.id,y,_,v)}var x=a.addGroup();x.setZIndex(t.depth),s=new EUe({model:t,styles:l,animate:r.get("animate"),bbox:t.collapsed?HB([],r):p,group:x}),!t.collapsed&&s.getKeyShape().get("type")==="circle"&&(p.width=Math.hypot(p.height,p.width),p.height=p.width,s.set("bbox",p),s.refresh());var S=s.getModel();(v||[]).forEach(function(w){var b=r.findById(w.id);s.addChild(b),w.depth=S.depth+2})}if(s)return s.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(e,"s")).push(s),r.get("itemMap")[s.get("id")]=s,r.emit("afteradditem",{item:s,model:t}),s},n.prototype.updateItem=function(e,t){var r=this,i,a,o=this.graph;if(rr(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s="";e.getType&&(s=e.getType());var l=o.get(s+ASe),u=e.getModel(),h=u.x,c=u.y,f=e.getUpdateType(t);if(l){var d=ms({},u,t),v=l(d),p=ms({},u,v,t);v[Jm]&&(e.set("styles",p[Jm]),delete p[Jm]),At(p,function(C,A){t[A]=C})}else At(t,function(C,A){u[A]&&Wh(C)&&!vn(C)&&(t[A]=ve(ve({},u[A]),t[A]))});if(o.emit("beforeupdateitem",{item:e,cfg:t}),s===y5){if(t.source){var g=t.source;rr(g)&&(g=o.findById(g)),e.setSource(g)}if(t.target){var m=t.target;rr(m)&&(m=o.findById(m)),e.setTarget(m)}e.update(t)}else if(s===g5){e.update(t,f);var y=e.getEdges();f==="move"?At(y,function(C){r.edgeToBeUpdateMap[C.getID()]={edge:C,updateType:f},r.throttleRefresh()}):f!=null&&f.includes("bbox")&&At(y,function(C){C.refresh(f)})}else if(s===_P){if(e.update(t,f),!isNaN(t.x)||!isNaN(t.y)){var _=t.x-h||0,x=t.y-c||0;this.updateComboSucceeds(u.id,_,x)}var S=e.getEdges(),w=(f==null?void 0:f.includes("bbox"))||f==="move";if(w&&s===_P){var b=e.get("shapeFactory"),E=u.type||"circle",T=u.animate===void 0||t.animate===void 0?(a=(i=b[E])===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.animate:u.animate||t.animate;T?setTimeout(function(){if(!(!e||e.destroyed)){var C=e.getKeyShape();!C||C.destroyed||At(S,function(A){A&&!A.destroyed&&A.refresh()})}},201):At(S,function(C){C.refresh()})}}e.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:e,cfg:t})}},n.prototype.updateCombo=function(e,t,r){var i=this,a,o,s=this.graph;if(rr(e)&&(e=s.findById(e)),!(!e||e.destroyed)){var l=e.getModel(),u=HB(t,s,e),h=u.x,c=u.y;e.set("bbox",u);var f=h,d=c;r?(f=isNaN(l.x)?h:l.x,d=isNaN(l.y)?c:l.y):(f=isNaN(h)?l.x:h,d=isNaN(c)?l.y:c),e.update({x:f,y:d});var v=e.get("shapeFactory"),p=l.type||"circle",g=l.animate===void 0?(o=(a=v[p])===null||a===void 0?void 0:a.options)===null||o===void 0?void 0:o.animate:l.animate;g?setTimeout(function(){if(!(!e||e.destroyed)){var m=e.getKeyShape();!m||m.destroyed||(e.getShapeCfg(l),i.updateComboEdges(e))}},201):this.updateComboEdges(e)}},n.prototype.updateComboEdges=function(e){for(var t,r,i=e.getEdges()||[],a=0;a<i.length;a++){var o=i[a];!(o!=null&&o.destroyed)&&!(!((t=o==null?void 0:o.getSource())===null||t===void 0)&&t.destroyed)&&!(!((r=o==null?void 0:o.getTarget())===null||r===void 0)&&r.destroyed)&&o.refresh()}},n.prototype.collapseCombo=function(e,t){t===void 0&&(t=!0);var r=this.graph;rr(e)&&(e=r.findById(e));var i=e.getChildren();i.nodes.forEach(function(a){r.hideItem(a,t)}),i.combos.forEach(function(a){r.hideItem(a,t)})},n.prototype.updateComboSucceeds=function(e,t,r,i){var a=this;i===void 0&&(i=[]);var o=this.graph;if(!(!t&&!r)){var s=i;if(!(s!=null&&s.length)){var l=o.get("comboTrees");l==null||l.forEach(function(u){Fc(u,function(h){return h.id===e?(s=h.children,!1):!0})})}s==null||s.forEach(function(u){var h=o.findById(u.id);if(h){var c=h.getModel();a.updateItem(u.id,{x:(c.x||0)+t,y:(c.y||0)+r})}})}},n.prototype.expandCombo=function(e,t){t===void 0&&(t=!0);var r=this.graph;rr(e)&&(e=r.findById(e));var i=e.getChildren(),a=new Set;i.nodes.forEach(function(o){r.showItem(o,t),o.getEdges().forEach(function(s){return a.add(s)})}),i.combos.forEach(function(o){o.getModel().collapsed?o.show():r.showItem(o,t),o.getEdges().forEach(function(s){return a.add(s)})}),a.forEach(function(o){return o.refresh()})},n.prototype.removeItem=function(e){var t=this,r=this.graph;if(rr(e)&&(e=r.findById(e)),!(!e||e.destroyed)){var i=Xi(e.getModel()),a="";e.getType&&(a=e.getType()),r.emit("beforeremoveitem",{item:i,type:a});var o=r.get("".concat(a,"s")),s=o.indexOf(e);if(s>-1&&o.splice(s,1),a===y5){var l=r.get("v".concat(a,"s")),u=l.indexOf(e);u>-1&&l.splice(u,1)}var h=e.get("id"),c=r.get("itemMap");delete c[h];var f=r.get("comboTrees"),d=e.get("id");if(a===g5){var v=e.getModel().comboId;if(f&&v){var p=f,g=!1;f.forEach(function(w){g||Fc(w,function(b){if(b.id===d&&p){var E=p.indexOf(b);return p.splice(E,1),g=!0,!1}return p=b.children,!0})})}for(var m=e.getEdges(),y=m.length-1;y>=0;y--)r.removeItem(m[y],!1);v&&r.updateCombo(v)}else if(a===_P){var _=e.getModel().parentId,x,S=!1;(f||[]).forEach(function(b){S||Fc(b,function(E){return E.id===d?(x=E,S=!0,!1):!0})}),x.removed=!0,x&&x.children&&x.children.forEach(function(b){t.removeItem(b.id)});for(var m=e.getEdges(),y=m.length;y>=0;y--)r.removeItem(m[y],!1);_&&r.updateCombo(_)}e.destroy(),r.emit("afterremoveitem",{item:i,type:a})}},n.prototype.setItemState=function(e,t,r){var i=this.graph,a=t;rr(r)&&(a="".concat(t,":").concat(r)),!(e.hasState(a)===r&&r||rr(r)&&e.hasState(a))&&(i.emit("beforeitemstatechange",{item:e,state:a,enabled:r}),e.setState(t,r),i.autoPaint(),i.emit("afteritemstatechange",{item:e,state:a,enabled:r}))},n.prototype.priorityState=function(e,t){var r=this.graph,i=e;rr(e)&&(i=r.findById(e)),this.setItemState(i,t,!1),this.setItemState(i,t,!0)},n.prototype.clearItemStates=function(e,t){var r=this.graph;rr(e)&&(e=r.findById(e)),r.emit("beforeitemstatesclear",{item:e,states:t}),e.clearStates(t),r.emit("afteritemstatesclear",{item:e,states:t})},n.prototype.refreshItem=function(e){var t=this.graph;rr(e)&&(e=t.findById(e)),t.emit("beforeitemrefresh",{item:e}),e.refresh(),t.emit("afteritemrefresh",{item:e})},n.prototype.addCombos=function(e,t){var r=this,i=this.graph;(e||[]).forEach(function(o){xy(o,function(s){var l;return t.forEach(function(u){u.id===s.id&&(u.children=s.children,u.depth=s.depth,l=u)}),l&&r.addItem("combo",l),!0})});var a=i.get("comboGroup");a&&a.sort()},n.prototype.changeItemVisibility=function(e,t){var r=this,i=this.graph;if(rr(e)&&(e=i.findById(e)),!e){console.warn("The item to be shown or hidden does not exist!");return}if(i.emit("beforeitemvisibilitychange",{item:e,visible:t}),e.changeVisibility(t),e.getType&&e.getType()===g5){var a=e.getEdges();At(a,function(h){t&&!(h.get("source").isVisible()&&h.get("target").isVisible())||r.changeItemVisibility(h,t)})}else if(e.getType&&e.getType()===_P){var o=i.get("comboTrees"),s=e.get("id"),l=[],u=!1;(o||[]).forEach(function(c){u||!c.children||c.children.length===0||Fc(c,function(f){return f.id===s?(l=f.children,u=!0,!1):!0})}),l&&(!t||t&&!e.getModel().collapsed)&&l.forEach(function(c){var f=i.findById(c.id);r.changeItemVisibility(f,t)});var a=e.getEdges();At(a,function(c){t&&!(c.get("source").isVisible()&&c.get("target").isVisible())||r.changeItemVisibility(c,t)})}return i.emit("afteritemvisibilitychange",{item:e,visible:t}),e},n.prototype.destroy=function(){this.graph=null,this.destroyed=!0},n}(),$Vt=function(){function n(e){this.graph=e,this.destroyed=!1}return n.prototype.updateState=function(e,t,r){var i=this.graph.get("states"),a=t;rr(r)&&(a="".concat(t,":").concat(r)),i[a]||(i[a]=[]),r?i[a].push(e):i[a]=i[a].filter(function(o){return o!==e}),this.graph.set("states",i),this.graph.emit("graphstatechange",{states:i})},n.prototype.updateStates=function(e,t,r){var i=this.graph.get("states"),a=rr(t)?[t]:t;a.forEach(function(o){var s=o;i[s]||(i[s]=[]),rr(r)&&(s="".concat(o,":").concat(r)),r?i[s].push(e):i[s]=i[s].filter(function(l){return l!==e})}),this.graph.set("states",i),this.graph.emit("graphstatechange",{states:t})},n.prototype.destroy=function(){this.graph=null,this.destroyed=!0},n}(),WVt=function(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(r,i){if(r.charAt(0)==="\\")return r.slice(1);var a=t[i];return a===0&&(a="0"),a||""})},TUe=function(e){var t=[];if(e.length<2)throw new Error("point length must largn than 2, now it's ".concat(e.length));for(var r=0,i=e;r<i.length;r++){var a=i[r],o=a.x,s=a.y;t.push(o),t.push(s)}var l=cUe(t);return l.unshift(["M",e[0].x,e[0].y]),l},w9=function(e,t,r,i){r===void 0&&(r=0),i===void 0&&(i=0);var a={x:(1-r)*e.x+r*t.x,y:(1-r)*e.y+r*t.y},o=[0,0];SS(o,[t.x-e.x,t.y-e.y]),(!o||!o[0]&&!o[1])&&(o=[0,0]);var s=[-o[1]*i,o[0]*i];return a.x+=s[0],a.y+=s[1],a},HVt=function(e,t){var r=e.length;if(!r)return"";for(var i="",a="",o=0;o<r;o++){var s=e[o];o===0?a="M{x} {y}":a="L{x} {y}",i+=WVt(a,s)}return t&&(i+="Z"),i},oee=function(e){var t=[];return e.forEach(function(r){var i=r[0];if(i!=="A")for(var a=1;a<r.length;a=a+2)t.push([r[a],r[a+1]]);else{var o=r.length;t.push([r[o-2],r[o-1]])}}),t},see=function(e){if(e.length<2)throw new Error("point length must larger than 2, now it's ".concat(e.length));var t=e[0],r=e[1],i=e[e.length-1],a=e[e.length-2];e.unshift(i),e.unshift(a),e.push(t),e.push(r);for(var o=[],s=1;s<e.length-2;s+=1){var l=e[s-1].x,u=e[s-1].y,h=e[s].x,c=e[s].y,f=e[s+1].x,d=e[s+1].y,v=s!==e.length-2?e[s+2].x:f,p=s!==e.length-2?e[s+2].y:d,g=h+(f-l)/6,m=c+(d-u)/6,y=f-(v-h)/6,_=d-(p-c)/6;o.push(["C",g,m,y,_,f,d])}return o.unshift(["M",i.x,i.y]),o},MSe=function(e,t){return Gc([0,0],SS([0,0],e),t)},ISe=function(e,t){var r=[e[1]-t[1],t[0]-e[0]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]);if(i===0)throw new Error("p0 should not be equal to p1");return[r[0]/i,r[1]/i]},LSe=function(e,t){return[t[0]-e[0],t[1]-e[1]]};function lee(n,e){var t=function(c){var f=[c[0][0],c[0][1]-e],d=[c[0][0],c[0][1]+e];return"M ".concat(f," A ").concat(e,",").concat(e,",0,0,0,").concat(d," A ").concat(e,",").concat(e,",0,0,0,").concat(f)},r=function(c){var f=Gc([0,0],ISe(c[0],c[1]),e),d=Gc([0,0],f,-1),v=Oh([0,0],c[0],f),p=Oh([0,0],c[1],f),g=Oh([0,0],c[1],d),m=Oh([0,0],c[0],d);return"M ".concat(v," L ").concat(p," A ").concat([e,e,"0,0,0",g].join(",")," L ").concat(m," A ").concat([e,e,"0,0,0",v].join(","))};if(!n||n.length<1)return"";if(n.length===1)return t(n);if(n.length===2)return r(n);for(var i=new Array(n.length),a=0;a<i.length;++a){var o=a===0?n[n.length-1]:n[a-1],s=n[a],l=Gc([0,0],ISe(o,s),e);i[a]=[Oh([0,0],o,l),Oh([0,0],s,l)]}var u="A ".concat([e,e,"0,0,0,"].join(","));return i=i.map(function(h,c){var f="";return c===0&&(f="M ".concat(i[i.length-1][1]," ")),f+="".concat(u+h[0]," L ").concat(h[1]),f}),i.join(" ")}function CUe(n,e){var t=n.length,r=function(h){var c=[h[0][0],h[0][1]-e],f=[h[0][0],h[0][1]+e];return"M ".concat(c," A ").concat([e,e,"0,0,0",f].join(",")," A ").concat([e,e,"0,0,0",c].join(","))},i=function(h){var c=LSe(h[0],h[1]),f=MSe(c,e),d=Oh([0,0],h[0],Gc([0,0],f,-1)),v=Oh([0,0],h[1],f),p=1.2*e,g=MSe(SS([0,0],c),p),m=Gc([0,0],g,-1),y=Oh([0,0],d,m),_=Oh([0,0],v,m),x=Oh([0,0],d,g);return"M ".concat(d," C ").concat([y,_,v].join(",")," S ").concat([x,d].join(",")," Z")};if(!n||t<1)return"";if(t===1)return r(n);if(t===2)return i(n);for(var a=n.map(function(u,h){var c=n[(h+1)%t];return{p:u,v:SS([0,0],LSe(u,c))}}),o=0;o<a.length;++o){var s=o>0?o-1:t-1,l=SS([0,0],Oh([0,0],a[s].v,Gc([0,0],a[o].v,-1)));a[o].p=Oh([0,0],a[o].p,Gc([0,0],l,e))}return a.map(function(u){var h=u.p;return{x:h[0],y:h[1]}})}var jVt=function(e,t){for(var r=[],i=0;i<5;i++){var a=Math.cos((18+72*i)/180*Math.PI)*e,o=Math.sin((18+72*i)/180*Math.PI)*e,s=Math.cos((54+72*i)/180*Math.PI)*t,l=Math.sin((54+72*i)/180*Math.PI)*t;i===0?r.push(["M",a,-o]):r.push(["L",a,-o]),r.push(["L",s,-l])}return r.push(["Z"]),r};const XVt=Object.freeze(Object.defineProperty({__proto__:null,getSpline:TUe,getControlPoint:w9,pointsToPolygon:HVt,pathToPoints:oee,getClosedSpline:see,roundedHull:lee,paddedHull:CUe,getStarPath:jVt},Symbol.toStringTag,{value:"Module"}));var PSe=function(e,t,r){return(e.y-r.y)*(t.x-r.x)-(e.x-r.x)*(t.y-r.y)},OSe=function(e){var t=e.map(function(c){return{x:c.getModel().x,y:c.getModel().y}});t.sort(function(c,f){return c.x===f.x?c.y-f.y:c.x-f.x});for(var r={},i=t.length-1;i>=0;i--){var a=t[i],o=a.x,s=a.y;r["".concat(o,"-").concat(s)]&&t.splice(i,1),r["".concat(o,"-").concat(s)]=!0}if(t.length===1)return t;for(var l=[],i=0;i<t.length;i++){for(;l.length>=2&&PSe(l[l.length-2],l[l.length-1],t[i])<=0;)l.pop();l.push(t[i])}for(var u=[],i=t.length-1;i>=0;i--){for(;u.length>=2&&PSe(u[u.length-2],u[u.length-1],t[i])<=0;)u.pop();u.push(t[i])}u.pop(),l.pop();var h=l.concat(u);return h},YVt={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function qVt(n,e,t){var r=!1,i=function(l,u){return e.cells[l+u*e.width]},a=function(l,u){var h=0;return i(l-1,u-1)>=t&&(h+=1),i(l,u-1)>t&&(h+=2),i(l-1,u)>t&&(h+=4),i(l,u)>t&&(h+=8),h},o=function(l,u){for(var h=l,c=u,f,d,v=0;v<e.width*e.height;v++){if(f=h,d=c,n.findIndex(function(g){return g.x===h&&g.y===c})>-1){if(!(n[0].x!==h||n[0].y!==c))return!0}else n.push({x:h,y:c});var p=a(h,c);switch(p){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:h++;break;case 12:case 14:case 4:h--;break;case 6:f===0&&(d===-1?h-=1:h+=1);break;case 1:case 13:case 5:c--;break;case 9:f===1&&(d===0?c-=1:c+=1);break;case 10:case 8:case 11:c++;break;default:return console.warn("Marching squares invalid state: ".concat(p)),!0}}};this.march=function(){for(var s=0;s<e.width&&!r;s+=1)for(var l=0;l<e.height&&!r;l+=1)i(s,l)>t&&a(s,l)!==15&&(r=o(s,l));return r}}var ZVt=function(e,t,r){var i=Math.ceil(e/r),a=Math.ceil(t/r),o=new Float32Array(Math.max(0,i*a)).fill(0);return{cells:o,width:i,height:a}},KVt=function(e,t,r){var i=null,a=Number.POSITIVE_INFINITY;return t.forEach(function(o){var s={x:e.getModel().x,y:e.getModel().y},l={x:o.getModel().x,y:o.getModel().y},u=p9(s,l),h=new a2(s.x,s.y,l.x,l.y),c=r.reduce(function(f,d){return lse(d,h)>0?f+1:f},0);u*Math.pow(c+1,2)<a&&(i=o,a=u*Math.pow(c+1,2))}),i},AUe=function(e,t){var r=Number.POSITIVE_INFINITY,i=null;return e.forEach(function(a){var o=lse(a,t);o>=0&&o<r&&(i=a,r=o)}),i},JVt=function(e,t,r,i){var a=[],o=[];o.push(e);for(var s=!0,l=0,u=function(d,v){var p=!1;return v.forEach(function(g){p||(DQ(d,{x:g.x1,y:g.y1})||DQ(d,{x:g.x2,y:g.y2}))&&(p=!0)}),p},h=function(d,v){for(var p=0,g=v;p<g.length;p++){var m=g[p],y=m.getBBox(),_=[[y.x,y.y],[y.x+y.width,y.y],[y.x,y.y+y.height],[y.x+y.width,y.y+y.height]];if(zD(_,d.x,d.y))return!0}return!1};s&&l<r;){s=!1;for(var c=function(){var d=o.pop(),v=AUe(t,d);if(v){var p=vze(v,d),g=p[0],m=p[1];if(m===2){var y=function(x){for(var S=i,w=RSe(v,S,g,x),b=u(w,o)||u(w,a),E=h(w,t);!b&&E&&S>=1;)S/=1.5,w=RSe(v,S,g,x),b=u(w,o)||u(w,a),E=h(w,t);w&&!b&&(!x||!E)&&(o.push(new a2(d.x1,d.y1,w.x,w.y)),o.push(new a2(w.x,w.y,d.x2,d.y2)),s=!0)};y(!0),s||y(!1)}}s||a.push(d),l+=1};!s&&o.length;)c()}for(;o.length;)a.push(o.pop());return a};function QVt(n,e,t,r,i){var a=KVt(n,t,e);if(a===null)return[];var o=function(c){for(var f=[];c.length>0;){var d=c.pop();if(c.length===0){f.push(d);break}var v=c.pop(),p=new a2(d.x1,d.y1,v.x2,v.y2),g=AUe(e,p);g?(f.push(d),c.push(v)):c.push(p)}return f},s=new a2(n.getModel().x,n.getModel().y,a.getModel().x,a.getModel().y),l=JVt(s,e,r,i),u=o(l);return u}var e$t=function(e,t,r){var i=Object.assign(YVt,r),a=pze(e.map(function(y){return{x:y.getModel().x,y:y.getModel().y}}));e=e.sort(function(y,_){return p9({x:y.getModel().x,y:y.getModel().y},a)-p9({x:_.getModel().x,y:_.getModel().y},a)});var o=[],s=[];e.forEach(function(y){var _=QVt(y,t,o,i.maxRoutingIterations,i.morphBuffer);_.forEach(function(x){s.push(x)}),o.push(y)});for(var l=t$t(e,s,i.nodeR0),u=ZVt(l.width,l.height,i.pixelGroupSize),h=[],c=[],f=0;f<i.maxMarchingIterations;f++)if(r$t(e,t,s,l,u,i),h=[],c=[],!!new qVt(h,u,i.threshold).march()){var d=h.map(function(y){return{x:Math.round(y.x*i.pixelGroupSize+l.minX),y:Math.round(y.y*i.pixelGroupSize+l.minY)}});if(d){var v=d.length;if(i.skip>1)for(v=Math.floor(d.length/i.skip);v<3&&i.skip>1;)i.skip-=1,v=Math.floor(d.length/i.skip);for(var p=0,g=0;g<v;g+=1,p+=i.skip)c.push({x:d[p].x,y:d[p].y})}var m=function(){for(var _=0,x=e;_<x.length;_++){var S=x[_],w=c.map(function(b){return[b.x,b.y]});if(!zD(w,S.getBBox().centerX,S.getBBox().centerY))return!1}return!0};if(c&&m())return c;if(i.threshold*=.9,f<=i.maxMarchingIterations*.5)i.memberInfluenceFactor*=1.2,i.edgeInfluenceFactor*=1.2;else if(i.nonMemberInfluenceFactor!==0&&t.length>0)i.nonMemberInfluenceFactor*=.8;else break}return c};function t$t(n,e,t){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];n.forEach(function(l){i.push(l.getBBox())}),e.forEach(function(l){i.push(l.getBBox())});for(var a=0,o=i;a<o.length;a++){var s=o[a];r.minX=(s.minX<r.minX?s.minX:r.minX)-t,r.minY=(s.minY<r.minY?s.minY:r.minY)-t,r.maxX=(s.maxX>r.maxX?s.maxX:r.maxX)+t,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+t}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}function r$t(n,e,t,r,i,a){function o(d,v){var p=Math.floor((d-v)/a.pixelGroupSize);return p<0?0:p}function s(d,v){return d*a.pixelGroupSize+v}var l=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),u=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),h=function(v,p){var g=Math.min(o(v.minX,p+r.minX),i.width),m=Math.min(o(v.minY,p+r.minY),i.height),y=Math.min(o(v.maxX,-p+r.minX),i.width),_=Math.min(o(v.maxY,-p+r.minY),i.height);return[g,m,y,_]},c=function(v,p){for(var g=v.getBBox(),m=h(g,a.nodeR1),y=m[0],_=m[1],x=m[2],S=m[3],w=_;w<S;w+=1)for(var b=y;b<x;b+=1)if(!(p<0&&i[b+w*i.width]<=0)){var E=s(b,r.minX),T=s(w,r.minY),C=yze({x:E,y:T},{x:g.minX,y:g.minY,width:g.width,height:g.height});if(C<Math.pow(a.nodeR1,2)){var A=Math.sqrt(C)-a.nodeR1;i.cells[b+w*i.width]+=p*A*A}}},f=function(v,p){for(var g=v.getBBox(),m=h(g,a.edgeR1),y=m[0],_=m[1],x=m[2],S=m[3],w=_;w<S;w+=1)for(var b=y;b<x;b+=1)if(!(p<0&&i.cells[b+w*i.width]<=0)){var E=s(b,r.minX),T=s(w,r.minY),C=gze({x:E,y:T},v);if(C<Math.pow(a.edgeR1,2)){var A=Math.sqrt(C)-a.edgeR1;i.cells[b+w*i.width]+=p*A*A}}};a.nodeInfluenceFactor&&n.forEach(function(d){c(d,a.nodeInfluenceFactor/l)}),a.edgeInfluenceFactor&&t.forEach(function(d){f(d,a.edgeInfluenceFactor/u)}),a.negativeNodeInfluenceFactor&&e.forEach(function(d){c(d,a.negativeNodeInfluenceFactor/l)})}function RSe(n,e,t,r){var i=n.getBBox(),a=t[0],o=t[1],s=t[2],l=t[3],u={topLeft:{x:i.minX-e,y:i.minY-e},topRight:{x:i.maxX+e,y:i.minY-e},bottomLeft:{x:i.minX-e,y:i.maxY+e},bottomRight:{x:i.maxX+e,y:i.maxY+e}},h=i.height*i.width;function c(v,p){return i.width*((v.y-i.minY+(p.y-i.minY))*.5)}if(o){if(a)return r?u.topLeft:u.bottomRight;if(s)return r?u.bottomLeft:u.topRight;var f=c(o,l);return f<h*.5?o.y>l.y?r?u.topLeft:u.bottomRight:r?u.topRight:u.bottomLeft:o.y<l.y?r?u.bottomLeft:u.topRight:r?u.bottomRight:u.topLeft}if(l){if(a)return r?u.topRight:u.bottomLeft;if(s)return r?u.bottomRight:u.topLeft}var d=c(a,s);return d<h*.5?a.x>s.x?r?u.topLeft:u.bottomRight:r?u.bottomLeft:u.topRight:a.x<s.x?r?u.topRight:u.bottomLeft:r?u.bottomRight:u.topLeft}var MUe=function(){function n(e,t){this.cfg=ms(this.getDefaultCfg(),t),this.graph=e,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map(function(r){return rr(r)?e.findById(r):r}),this.nonMembers=this.cfg.nonMembers.map(function(r){return rr(r)?e.findById(r):r}),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return n.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},n.prototype.setPadding=function(){var e=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+e:10+e,this.cfg.bubbleCfg={nodeR0:this.padding-e,nodeR1:this.padding-e,morphBuffer:this.padding-e}},n.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),this.type!=="round-convex"&&this.type!=="smooth-convex"&&this.type!=="bubble"&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},n.prototype.calcPath=function(e,t){var r,i,a;switch(this.type){case"round-convex":r=OSe(e),a=lee(r.map(function(o){return[o.x,o.y]}),this.padding),i=tee(a);break;case"smooth-convex":r=OSe(e),r.length===2?(a=lee(r.map(function(o){return[o.x,o.y]}),this.padding),i=tee(a)):r.length>2&&(a=CUe(r.map(function(o){return[o.x,o.y]}),this.padding),i=see(a));break;case"bubble":r=e$t(e,t,this.cfg.bubbleCfg),i=r.length>=2&&see(r);break}return i},n.prototype.render=function(){this.group.addShape("path",{attrs:ve({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},n.prototype.addMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e)),this.members.push(e);var t=this.nonMembers.indexOf(e);return t>-1&&this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},n.prototype.addNonMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e)),this.nonMembers.push(e);var t=this.members.indexOf(e);return t>-1&&this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},n.prototype.removeMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e));var t=this.members.indexOf(e);return t>-1?(this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},n.prototype.removeNonMember=function(e){if(!!e){rr(e)&&(e=this.graph.findById(e));var t=this.nonMembers.indexOf(e);return t>-1?(this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},n.prototype.updateData=function(e,t){var r=this;this.group.findById(this.id).remove(),e&&(this.members=e.map(function(i){return rr(i)?r.graph.findById(i):i})),t&&(this.nonMembers=t.map(function(i){return rr(i)?r.graph.findById(i):i})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},n.prototype.updateStyle=function(e){var t=this.group.findById(this.id);t.attr(ve({},e))},n.prototype.updateCfg=function(e){var t=this;this.cfg=ms(this.cfg,e),this.id=this.cfg.id,this.group=this.cfg.group,e.members&&(this.members=this.cfg.members.map(function(r){return rr(r)?t.graph.findById(r):r})),e.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(r){return rr(r)?t.graph.findById(r):r})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},n.prototype.contain=function(e){var t=this,r;rr(e)?r=this.graph.findById(e):r=e;var i,a=r.getKeyShape();if(r.get("type")==="path")i=oee(a.attr("path"));else{var o=a.getCanvasBBox();i=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return i=i.map(function(s){var l=t.graph.getPointByCanvas(s[0],s[1]);return[l.x,l.y]}),dze(i,oee(this.path))},n.prototype.destroy=function(){this.group.remove(),this.cfg=null},n}(),xP=sg,n$t="node",IUe=function(n){Kn(e,n);function e(t){var r=n.call(this)||this;return r.sortCombos=U3(function(){var i=r.get("comboSorted");if(!(!r||r.destroyed||i)){r.set("comboSorted",!0);var a=[],o={},s=r.get("comboTrees");(s||[]).forEach(function(u){Fc(u,function(h){return a[h.depth]?a[h.depth].push(h.id):a[h.depth]=[h.id],o[h.id]=h.depth,!0})});var l=r.getEdges().concat(r.get("vedges"));(l||[]).forEach(function(u){var h=u.getModel(),c=o[h.source]||0,f=o[h.target]||0,d=Math.max(c,f);a[d]?a[d].push(h.id):a[d]=[h.id]}),a.forEach(function(u){if(!(!u||!u.length))for(var h=u.length-1;h>=0;h--){var c=r.findById(u[h]);c&&c.toFront()}})}},500,!1),r.cfg=ms(r.getDefaultCfg(),t),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new pA(r.cfg.maxStep),r.redoStack=new pA(r.cfg.maxStep)),r}return e.prototype.init=function(){this.initCanvas();var t=new DVt(this),r=new K7t(this),i=new VVt(this),a=new $Vt(this);this.set({viewController:t,modeController:r,itemController:i,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(!!t){var r=t.get("el"),i=(r||{}).id,a=i===void 0?"g6":i,o=t.addGroup({id:"".concat(a,"-root"),className:tn.rootContainerClassName});if(this.get("groupByTypes")){var s=o.addGroup({id:"".concat(a,"-edge"),className:tn.edgeContainerClassName}),l=o.addGroup({id:"".concat(a,"-node"),className:tn.nodeContainerClassName}),u=o.addGroup({id:"".concat(a,"-combo"),className:tn.comboContainerClassName});u.toBack(),this.set({nodeGroup:l,edgeGroup:s,comboGroup:u})}var h=o.addGroup({id:"".concat(a,"-delegate"),className:tn.delegateContainerClassName});this.set({delegateGroup:h}),this.set("group",o)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},e.prototype.set=function(t,r){return kh(t)?this.cfg=ve(ve({},this.cfg),t):this.cfg[t]=r,t==="enabledStack"&&r&&!this.undoStack&&!this.redoStack&&(this.undoStack=new pA(this.cfg.maxStep),this.redoStack=new pA(this.cfg.maxStep)),this},e.prototype.get=function(t){var r;return(r=this.cfg)===null||r===void 0?void 0:r[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,r){rr(t)&&(t=this.findById(t));var i=this.get("itemController");r||(r=t.get("states")),i.clearItemStates(t,r);var a=this.get("stateController");a.updateStates(t,r,!1)},e.prototype.node=function(t){typeof t=="function"&&this.set("nodeMapper",t)},e.prototype.edge=function(t){typeof t=="function"&&this.set("edgeMapper",t)},e.prototype.combo=function(t){typeof t=="function"&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,r){var i,a=this.get("".concat(t,"s"));return At(a,function(o,s){if(r(o,s))return i=o,i}),i},e.prototype.findAll=function(t,r){var i=[];return At(this.get("".concat(t,"s")),function(a,o){r(a,o)&&i.push(a)}),i},e.prototype.findAllByState=function(t,r,i){return i?this.findAll(t,function(a){return a.hasState(r)&&i(a)}):this.findAll(t,function(a){return a.hasState(r)})},e.prototype.translate=function(t,r,i,a){var o=this,s=this.get("group"),l=Xi(s.getMatrix());if(l||(l=[1,0,0,0,1,0,0,0,1]),i){var u=UD({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"translate",matrix:s.getMatrix()})}});RQ(s,{x:s.getCanvasBBox().x+t,y:s.getCanvasBBox().y+r},i,u||{duration:500,easing:"easeCubic"})}else l=xP(l,[["t",t,r]]),s.setMatrix(l),this.emit("viewportchange",{action:"translate",matrix:l}),this.autoPaint()},e.prototype.moveTo=function(t,r,i,a){var o=this.get("group");RQ(o,{x:t,y:r},i,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:o.getMatrix()})},e.prototype.fitView=function(t,r,i,a){t&&this.set("fitViewPadding",t);var o=this.get("viewController");r?o.fitViewByRules(r,i,a):o.fitView(i,a),this.autoPaint()},e.prototype.fitCenter=function(t,r){var i=this.get("viewController");i.fitCenter(t,r),this.autoPaint()},e.prototype.addBehaviors=function(t,r){var i=this.get("modeController");return i.manipulateBehaviors(t,r,!0),this},e.prototype.removeBehaviors=function(t,r){var i=this.get("modeController");return i.manipulateBehaviors(t,r,!1),this},e.prototype.updateBehavior=function(t,r,i){var a=this.get("modeController");return a.updateBehavior(t,r,i),this},e.prototype.zoom=function(t,r,i,a){var o=this,s=this.get("group"),l=Xi(s.getMatrix())||[1,0,0,0,1,0,0,0,1],u=this.get("minZoom"),h=this.get("maxZoom"),c=this.getZoom()||1,f=c*t,d=t,v=!1;if(u&&f<u?(d=u/c,v=!0):h&&f>h&&(d=h/c,v=!0),r?l=xP(l,[["t",-r.x,-r.y],["s",d,d],["t",r.x,r.y]]):l=xP(l,[["s",d,d]]),i){var p=Xi(s.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var g=p[0],m=g*d,y=UD({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"zoom",matrix:s.getMatrix()})}});s.animate(function(_){if(_===1)p=l;else{var x=use(g,m,_)/p[0];r?p=xP(p,[["t",-r.x,-r.y],["s",x,x],["t",r.x,r.y]]):p=xP(p,[["s",x,x]])}return{matrix:p}},y)}else s.setMatrix(l),this.emit("viewportchange",{action:"zoom",matrix:l}),this.autoPaint();return!v},e.prototype.zoomTo=function(t,r,i,a){var o=t/this.getZoom();return this.zoom(o,r,i,a)},e.prototype.focusItem=function(t,r,i){var a=this.get("viewController"),o=!1;r?o=!0:r===void 0&&(o=this.get("animate"));var s={};i?s=i:i===void 0&&(s=this.get("animateCfg")),a.focus(t,o,s),this.autoPaint()},e.prototype.focusItems=function(t,r,i,a){var o=this.get("viewController");o.focusItems(t,r,i,a)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,r){var i=this.get("viewController");return i.getPointByClient(t,r)},e.prototype.getClientByPoint=function(t,r){var i=this.get("viewController");return i.getClientByPoint(t,r)},e.prototype.getPointByCanvas=function(t,r){var i=this.get("viewController");return i.getPointByCanvas(t,r)},e.prototype.getCanvasByPoint=function(t,r){var i=this.get("viewController");return i.getCanvasByPoint(t,r)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,r){r===void 0&&(r=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!0);if(r&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!1}],u.nodes=[{id:o,visible:!0}];break;case"edge":l.nodes=[{id:o,visible:!1}],u.edges=[{id:o,visible:!0}];break;case"combo":l.nodes=[{id:o,visible:!1}],u.combos=[{id:o,visible:!0}];break}this.pushStack("visible",{before:l,after:u})}},e.prototype.hideItem=function(t,r){r===void 0&&(r=!0);var i=this.get("itemController"),a=i.changeItemVisibility(t,!1);if(r&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),l={},u={};switch(s){case"node":l.nodes=[{id:o,visible:!0}],u.nodes=[{id:o,visible:!1}];break;case"edge":l.nodes=[{id:o,visible:!0}],u.edges=[{id:o,visible:!1}];break;case"combo":l.nodes=[{id:o,visible:!0}],u.combos=[{id:o,visible:!1}];break}this.pushStack("visible",{before:l,after:u})}},e.prototype.refreshItem=function(t){var r=this.get("itemController");r.refreshItem(t)},e.prototype.setAutoPaint=function(t){var r=this;r.set("autoPaint",t);var i=r.get("canvas");i.set("autoDraw",t)},e.prototype.remove=function(t,r){r===void 0&&(r=!0),this.removeItem(t,r)},e.prototype.removeItem=function(t,r){r===void 0&&(r=!0);var i=t;if(rr(t)&&(i=this.findById(t)),!i&&rr(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(i){var a="";if(i.getType&&(a=i.getType()),r&&this.get("enabledStack")){var o=ve(ve({},i.getModel()),{itemType:a}),s={};switch(a){case"node":{s.nodes=[o],s.edges=[];for(var l=i.getEdges(),u=l.length-1;u>=0;u--)s.edges.push(ve(ve({},l[u].getModel()),{itemType:"edge"}));break}case"edge":s.edges=[o];break;case"combo":s.combos=[o];break}this.pushStack("delete",{before:s,after:{}})}if(a==="node"){var h=i.getModel();h.comboId&&this.updateComboTree(i,void 0,!1)}var c=this.get("itemController");if(c.removeItem(i),a==="combo"){var f=GQ(this.get("comboTrees"));this.set("comboTrees",f)}}},e.prototype.innerAddItem=function(t,r,i){if(!Z7t(t,r))return!1;if(r.id&&this.findById(r.id)){console.warn("This item exists already. Be sure the id %c".concat(r.id,"%c is unique."),"font-size: 20px; color: red;","");return}var a,o=this.get("comboTrees")||[];if(t==="combo"){var s=this.get("itemMap"),l=!1;if(o.forEach(function(v){l||xy(v,function(p){if(r.parentId===p.id){l=!0;var g=ve({id:r.id,depth:p.depth+2},r);p.children?p.children.push(g):p.children=[g],r.depth=g.depth,a=i.addItem(t,r)}var m=s[p.id];return l&&m&&m.getType&&m.getType()==="combo"&&i.updateCombo(m,p.children),!0})}),!l){var u=ve({id:r.id,depth:0},r);r.depth=u.depth,o.push(u),a=i.addItem(t,r)}this.set("comboTrees",o),r.collapsed&&(this.collapseCombo(a,!1),this.updateCombo(a))}else if(t==="node"&&rr(r.comboId)&&o){var h=this.findById(r.comboId);h&&h.getType&&h.getType()!=="combo"&&console.warn("'".concat(r.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),a=i.addItem(t,r);var c=this.get("itemMap"),f=!1,d=!1;o.forEach(function(v){d||f||xy(v,function(p){if(p.id===r.id)return d=!0,!1;if(r.comboId===p.id&&!d){f=!0;var g=Xi(r);g.itemType="node",p.children?p.children.push(g):p.children=[g],g.depth=p.depth+1}return f&&c[p.id].getType&&c[p.id].getType()==="combo"&&i.updateCombo(c[p.id],p.children),!0})})}else a=i.addItem(t,r);if(t==="node"&&r.comboId||t==="combo"&&r.parentId){var h=this.findById(r.comboId||r.parentId);h&&h.getType&&h.getType()==="combo"&&h.addChild(a)}return a},e.prototype.addItem=function(t,r,i,a){i===void 0&&(i=!0),a===void 0&&(a=!0);var o=this.get("comboSorted");this.set("comboSorted",o&&!a);var s=this.get("itemController"),l=this.innerAddItem(t,r,s);if(l===!1||l===!0)return l;var u=this.get("combos");if(u&&u.length>0&&this.sortCombos(),this.autoPaint(),i&&this.get("enabledStack")){var h=ve(ve({},l.getModel()),{itemType:t}),c={};switch(t){case"node":c.nodes=[h];break;case"edge":c.edges=[h];break;case"combo":c.combos=[h];break}this.pushStack("add",{before:{},after:c})}return l},e.prototype.addItems=function(t,r,i){t===void 0&&(t=[]),r===void 0&&(r=!0),i===void 0&&(i=!0);var a=this.get("comboSorted");this.set("comboSorted",a&&!i);for(var o=this.get("itemController"),s=[],l=0;l<t.length;l++){var u=t[l];u.type!=="edge"&&u.type!=="vedge"?s.push(this.innerAddItem(u.type,u.model,o)):s.push(void 0)}for(var l=0;l<t.length;l++){var u=t[l];(u.type==="edge"||u.type==="vedge")&&(s[l]=this.innerAddItem(u.type,u.model,o))}if(i){var h=this.get("combos");h&&h.length>0&&this.sortCombos()}if(this.autoPaint(),r&&this.get("enabledStack")){for(var c={nodes:[],edges:[],combos:[]},l=0;l<t.length;l++){var f=t[l].type,d=s[l];if(!!d&&d!==!0){var v=ve(ve({},d.getModel()),{itemType:f});switch(f){case"node":c.nodes.push(v);break;case"edge":c.edges.push(v);break;case"combo":c.combos.push(v);break}}}this.pushStack("addItems",{before:{},after:c})}return s},e.prototype.add=function(t,r,i,a){return i===void 0&&(i=!0),a===void 0&&(a=!0),this.addItem(t,r,i,a)},e.prototype.updateItem=function(t,r,i){var a=this;i===void 0&&(i=!0);var o=this.get("itemController"),s;rr(t)?s=this.findById(t):s=t;var l=i&&this.get("enabledStack"),u;l&&(u=Xi(s.getModel()));var h="";s.getType&&(h=s.getType());var c=_v([],s.getStates(),!0);if(h==="combo"&&At(c,function(p){return a.setItemState(s,p,!1)}),o.updateItem(s,r),h==="combo"&&At(c,function(p){return a.setItemState(s,p,!0)}),l){var f={nodes:[],edges:[],combos:[]},d={nodes:[],edges:[],combos:[]},v=ve({id:u.id},r);switch(h){case"node":f.nodes.push(u),d.nodes.push(v);break;case"edge":f.edges.push(u),d.edges.push(v);break;case"combo":f.combos.push(u),d.combos.push(v);break}this.pushStack("update",{before:f,after:d})}},e.prototype.update=function(t,r,i){i===void 0&&(i=!0),this.updateItem(t,r,i)},e.prototype.setItemState=function(t,r,i){rr(t)&&(t=this.findById(t));var a=this.get("itemController");a.setItemState(t,r,i);var o=this.get("stateController");o.updateState(t,r,i)},e.prototype.priorityState=function(t,r){var i=this.get("itemController");i.priorityState(t,r)},e.prototype.data=function(t){Exe(t),this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var r=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!r)throw new Error("data must be defined first");var i=r.nodes,a=i===void 0?[]:i,o=r.edges,s=o===void 0?[]:o,l=r.combos,u=l===void 0?[]:l;if(this.clear(!0),this.emit("beforerender"),t.addItems(a.map(function(g){return{type:"node",model:g}}),!1,!1),(u==null?void 0:u.length)!==0){var h=BQ(u,a);this.set("comboTrees",h),t.addCombos(u)}t.addItems(s.map(function(g){return{type:"edge",model:g}}),!1,!1);var c=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var f=t.get("layoutController");if(f){if(f.layout(d),this.destroyed)return}else d();function d(){(t.get("comboTrees")||[]).forEach(function(g){xy(g,function(m){var y=t.findById(m.id);return y.getType()==="combo"&&m.collapsed&&(t.collapseCombo(m.id,!1),t.updateCombo(y)),!0})}),t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter(),t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",c),setTimeout(function(){var g;(g=t.getCombos())===null||g===void 0||g.forEach(function(m){m.set("animate",!0)})},0)}if(!this.get("groupByTypes"))if(u&&u.length!==0)this.sortCombos();else if(r.nodes&&r.edges&&r.nodes.length<r.edges.length){var v=this.getNodes();v.forEach(function(g){g.toFront()})}else{var p=this.getEdges();p.forEach(function(g){g.toBack()})}},e.prototype.read=function(t){this.data(t),this.render()},e.prototype.diffItems=function(t,r,i){var a=this,o,s=this.get("itemMap");At(i,function(l){if(o=s[l.id],o){if(a.get("animate")&&t===n$t){var u=o.getContainer().getMatrix();u||(u=[1,0,0,0,1,0,0,0,1]),o.set("originAttrs",{x:u[6],y:u[7]})}a.updateItem(o,l,!1)}else o=a.addItem(t,l,!1);o&&r["".concat(t,"s")].push(o)})},e.prototype.changeData=function(t,r){var i=this,a;r===void 0&&(r=!0);var o=this,s=t||o.get("data");if(!Exe(s))return this;this.emit("beforechangedata"),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:o.save(),after:s}),this.set("comboSorted",!1),this.removeHulls(),this.getNodes().map(function(x){return o.clearItemStates(x)}),this.getEdges().map(function(x){return o.clearItemStates(x)});var l=this.get("canvas"),u=l.get("localRefresh");l.set("localRefresh",!1),o.get("data")||(o.data(s),o.render());var h=this.get("itemMap"),c={nodes:[],edges:[]},f=s.combos;if(f){var d=BQ(f,s.nodes);this.set("comboTrees",d)}else this.set("comboTrees",[]);this.diffItems("node",c,s.nodes),At(h,function(x,S){h[S].getModel().depth=0,!(x.getType&&x.getType()==="edge")&&(x.getType&&x.getType()==="combo"?(delete h[S],x.destroy()):c.nodes.indexOf(x)<0&&(delete h[S],o.remove(x,!1)))});for(var v=this.getCombos(),p=v.length,g=p-1;g>=0;g--)v[g].destroyed&&v.splice(g,1);f&&(o.addCombos(f),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",c,s.edges),At(h,function(x,S){x.getType&&(x.getType()==="node"||x.getType()==="combo")||c.edges.indexOf(x)<0&&(delete h[S],o.remove(x,!1))}),(this.get("comboTrees")||[]).forEach(function(x){xy(x,function(S){var w=i.findById(S.id);return w.getType()==="combo"&&S.collapsed&&i.collapseCombo(S.id,!1),!0})}),this.set({nodes:c.nodes,edges:c.edges});var m=(this.get("layout")||{}).relayoutAtChangeData,y=m===void 0?!0:m,_=this.get("layoutController");return y&&_&&(_.changeData(function(){setTimeout(function(){var x;(x=o.getCombos())===null||x===void 0||x.forEach(function(S){S.set("animate",!0)})},0)}),o.get("animate")&&!_.getLayoutType()?(o.positionsAnimate(),(a=o.getCombos())===null||a===void 0||a.forEach(function(x){return x.set("animate",!0)})):o.autoPaint()),setTimeout(function(){l.set("localRefresh",u)},16),this.set("data",s),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var r=this,i=r.get("comboTrees"),a=this.get("itemController");a.addCombos(i,t)},e.prototype.createCombo=function(t,r,i){var a=this;i===void 0&&(i=!0);var o=this.get("itemController");this.set("comboSorted",!1);var s="",l;if(!!t){if(rr(t))s=t,l={id:t};else{if(s=t.id,!s){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}l=t}var u=i&&this.get("enabledStack"),h={nodes:[],combos:[]};u&&r.forEach(function(m){var y=a.findById(m),_=y.getType();if(!(_!=="node"&&_!=="combo")){var x=y.getModel();h["".concat(_,"s")].push({id:m,parentId:_==="node"?x.comboId:x.parentId})}});var c=this.get("comboTrees"),f=new Set(r),d=new Map;c&&(c.forEach(function(m){xy(m,function(y,_,x){if(f.has(y.id)){if(_){var S=a.findById(_.id),w=a.findById(y.id);_.children.splice(x,1),S.removeChild(w),o.updateCombo(S,_.children)}y.itemType==="combo"&&d.set(y.id,y)}return!0})}),c=c.filter(function(m){return!f.has(m.id)}),this.set("comboTrees",c));var v={nodes:[],combos:[]},p=r.map(function(m){var y=a.findById(m),_=y.getModel(),x="";y.getType&&(x=y.getType());var S=d.get(m)||{id:y.getID(),itemType:x};return x==="combo"?(S.parentId=s,_.parentId=s):x==="node"&&(S.comboId=s,_.comboId=s),u&&v["".concat(x,"s")].push({id:_.id,parentId:s}),S});l.children=p,this.addItem("combo",l,!1),this.set("comboSorted",!1),c&&(c.forEach(function(m){Fc(m,function(y){return y.id===s?(y.itemType="combo",y.children=p,!1):!0})}),this.sortCombos()),u&&(v.combos.push(l),this.pushStack("createCombo",{before:h,after:v}));var g=this.findById(s);!g.getModel().parentId&&g.getChildren().combos.length&&this.updateComboTree(g,void 0,!1),setTimeout(function(){g.set("animate",!0)},0)}},e.prototype.uncombo=function(t,r){var i=this,a,o;r===void 0&&(r=!0);var s=this,l=t;if(rr(t)&&(l=this.findById(t)),!l||l.getType&&l.getType()!=="combo"){console.warn("The item is not a combo!");return}var u=l.getModel(),h=l.getModel().parentId,c=s.get("comboTrees");c||(c=[]);var f=this.get("itemMap"),d=l.get("id"),v,p=[],g=this.get("combos"),m=this.findById(h),y=r&&this.get("enabledStack"),_={};if(y&&(_=Xi(u),_.children=[]),c.forEach(function(b){v||xy(b,function(E){var T;if(E.id===d){v=E;var C=l.getEdges().map(function(I){return I.getID()});C.forEach(function(I){i.removeItem(I,!1)});var A=g.indexOf(l);g.splice(A,1),delete f[d];var M=Xi(l.getModel());l.destroy(),i.emit("afterremoveitem",{item:M,type:"combo"})}if(h&&v&&E.id===h){m.removeCombo(l),p=E.children;var A=p.indexOf(v);return A!==-1&&p.splice(A,1),(T=v.children)===null||T===void 0||T.forEach(function(R){var k=i.findById(R.id),D=k.getModel();k.getType&&k.getType()==="combo"?(R.parentId=h,delete R.comboId,D.parentId=h,delete D.comboId):k.getType&&k.getType()==="node"&&(R.comboId=h,D.comboId=h),m.addChild(k),p.push(R)}),i.updateCombo(m),!1}return!0})}),!h&&v){var x=c.indexOf(v);c.splice(x,1),(a=v.children)===null||a===void 0||a.forEach(function(b){b.parentId=void 0;var E=i.findById(b.id).getModel();delete E.parentId,delete E.comboId,b.itemType!=="node"&&c.push(b)})}if(y){var S={nodes:[],combos:[]},w={nodes:[],combos:[]};(o=v.children)===null||o===void 0||o.forEach(function(b){var E=i.findById(b.id),T=E.getType();T!=="node"&&T!=="combo"||(S["".concat(T,"s")].push({id:b.id,parentId:d}),w["".concat(T,"s")].push({id:b.id,parentId:h}))}),S.combos.push(_),this.pushStack("uncombo",{before:S,after:w})}},e.prototype.updateCombos=function(t){var r=this;t===void 0&&(t=!1);var i=this,a=this.get("comboTrees"),o=i.get("itemController"),s=i.get("itemMap");(a||[]).forEach(function(l){xy(l,function(u){var h;if(!u)return!0;var c=s[u.id];if(((h=c==null?void 0:c.getType)===null||h===void 0?void 0:h.call(c))==="combo"){var f=_v([],c.getStates(),!0);At(f,function(d){return r.setItemState(c,d,!1)}),o.updateCombo(c,u.children,t),At(f,function(d){return r.setItemState(c,d,!0)})}return!0})}),i.sortCombos()},e.prototype.updateCombo=function(t){var r=this,i=this,a=t,o;if(rr(t)&&(a=this.findById(t)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}o=a.get("id");var s=this.get("comboTrees"),l=i.get("itemController"),u=i.get("itemMap");(s||[]).forEach(function(h){xy(h,function(c){if(!c)return!0;var f=u[c.id];if(o===c.id&&f&&f.getType&&f.getType()==="combo"){var d=_v([],f.getStates(),!0);At(d,function(v){f.getStateStyle(v)&&r.setItemState(f,v,!1)}),l.updateCombo(f,c.children),At(d,function(v){f.getStateStyle(v)&&r.setItemState(f,v,!0)}),o&&(o=c.parentId)}return!0})})},e.prototype.updateComboTree=function(t,r,i){i===void 0&&(i=!0);var a=this;this.set("comboSorted",!1);var o;rr(t)?o=a.findById(t):o=t;var s=o.getModel(),l=s.comboId||s.parentId,u="";if(o.getType&&(u=o.getType()),r&&u==="combo"){var h=this.get("comboTrees"),c=!0,f;if((h||[]).forEach(function(y){f||Fc(y,function(_){if(!f)return _.id===o.getID()&&(f=_),!0})}),Fc(f,function(y){return y.id===r?(c=!1,!1):!0}),!c){console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!");return}}if(i&&this.get("enabledStack")){var d={},v={};u==="combo"?(d.combos=[{id:s.id,parentId:s.parentId}],v.combos=[{id:s.id,parentId:r}]):u==="node"&&(d.nodes=[{id:s.id,parentId:s.comboId}],v.nodes=[{id:s.id,parentId:r}]),this.pushStack("updateComboTree",{before:d,after:v})}if(s.parentId||s.comboId){var p=this.findById(s.parentId||s.comboId);p&&p.removeChild(o)}if(u==="combo"?s.parentId=r:u==="node"&&(s.comboId=r),r){var g=this.findById(r);g&&g.addChild(o)}if(l){var g=this.findById(l);g&&g.removeChild(o)}var m=GQ(this.get("comboTrees"),s.id,r);this.set("comboTrees",m),this.updateCombos()},e.prototype.save=function(){var t=[],r=[],i=[];return At(this.get("nodes"),function(a){t.push(a.getModel())}),At(this.get("edges"),function(a){r.push(a.getModel())}),At(this.get("combos"),function(a){i.push(a.getModel())}),{nodes:t,edges:r,combos:i}},e.prototype.changeSize=function(t,r){var i=this.get("viewController");return i.changeSize(t,r),this},e.prototype.refresh=function(){var t=this;if(t.emit("beforegraphrefresh"),t.get("animate"))t.positionsAnimate();else{var r=t.get("nodes"),i=t.get("edges"),a=t.get("edges");At(r,function(o){o.refresh()}),At(i,function(o){o.refresh()}),At(a,function(o){o.refresh()})}t.emit("aftergraphrefresh"),t.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if(rr(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo does not exist!");return}return t.getChildren()},e.prototype.positionsAnimate=function(t){var r=this;r.emit("beforeanimate");var i=r.get("animateCfg"),a=i.onFrame,o=t?r.getNodes().concat(r.getCombos()):r.getNodes(),s=o.map(function(u){var h=u.getModel();return{id:h.id,x:h.x,y:h.y}});r.stopAnimate();var l=r.get("canvas");r.animating=!0,setTimeout(function(){l.animate(function(u){At(s,function(h){var c=r.findById(h.id);if(!(!c||c.destroyed)){var f=c.get("originAttrs"),d=c.get("model"),v=c.getContainer().getMatrix();if(f==null&&(v&&(f={x:v[6],y:v[7]}),c.set("originAttrs",f||0)),a){var p=a(c,u,h,f||{x:0,y:0});c.set("model",Object.assign(d,p))}else f?(d.x=f.x+(h.x-f.x)*u,d.y=f.y+(h.y-f.y)*u):(d.x=h.x,d.y=h.y)}}),r.refreshPositions(t)},{duration:i.duration,easing:i.easing,callback:function(){At(o,function(h){h.set("originAttrs",null)}),i.callback&&i.callback(),r.emit("afteranimate"),r.animating=!1}})},0)},e.prototype.refreshPositions=function(t){var r=this;r.emit("beforegraphrefreshposition");var i=r.get("nodes"),a=r.get("edges"),o=r.get("vedges"),s=r.get("combos"),l,u={},h=function(f){At(f,function(d){l=d.getModel();var v=d.get("originAttrs");if(!(v&&l.x===v.x&&l.y===v.y)){var p=d.updatePosition({x:l.x,y:l.y});u[l.id]=p,l.comboId&&(u[l.comboId]=u[l.comboId]||p),l.parentId&&(u[l.parentId]=u[l.parentId]||p)}})};h(s),h(i),s&&s.length!==0&&(t&&h(s),r.updateCombos()),At(a,function(c){var f=c.getSource().getModel(),d=c.getTarget();if(!kh(d)){var v=d.getModel();(u[f.id]||u[v.id]||c.getModel().isComboEdge)&&c.refresh()}}),At(o,function(c){c.refresh()}),r.emit("aftergraphrefreshposition"),r.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas"),r=t.cfg.timeline;r&&r.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){var t=this.get("modeController");return t.getMode()},e.prototype.setMode=function(t){var r=this.get("modeController");return r.setMode(t),this},e.prototype.clear=function(t){var r;return t===void 0&&(t=!1),(r=this.get("canvas"))===null||r===void 0||r.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,r,i,a){var o=this;t===void 0&&(t={}),a===void 0&&(a=!0);var s=this.get("layoutController");if(rr(t)&&(t={type:t}),r){var l=i;l||(r==="begin"?l={x:0,y:0}:l={x:this.getWidth()/2,y:this.getHeight()/2}),l=this.getPointByCanvas(l.x,l.y);var u=["force","gForce","fruchterman","force2"];u.includes(t.type)||!t.type&&u.includes(s==null?void 0:s.layoutType)?t.center=[l.x,l.y]:this.once("afterlayout",function(f){var d=o.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];l.x=l.x*d[0]+d[6],l.y=l.y*d[0]+d[7];var v=o.getGroup().getCanvasBBox(),p=v.minX,g=v.maxX,m=v.minY,y=v.maxY,_={x:(p+g)/2,y:(m+y)/2};r==="begin"&&(_.x=p,_.y=m),o.translate(l.x-_.x,l.y-_.y)})}var h=ve({},this.get("layout")),c={};Object.assign(c,h,t),t.pipes&&!t.type?delete c.type:!t.pipes&&c.type&&delete c.pipes,this.set("layout",c),s&&(s.isLayoutTypeSame(c)&&c.gpuEnabled===h.gpuEnabled?s.updateLayoutCfg(c):s.changeLayout(c),a&&this.get("enabledStack")&&this.pushStack("layout",{before:h,after:c}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");t==null||t.destroyLayout()},e.prototype.layout=function(){var t,r=this.get("layoutController"),i=this.get("layout");if(!(!i||!r)){if(i.workerEnabled){r.layout();return}!((t=r.layoutMethods)===null||t===void 0)&&t.length?r.relayout(!0):r.layout()}},e.prototype.collapseCombo=function(t,r){var i=this;if(r===void 0&&(r=!0),!this.destroyed){if(rr(t)&&(t=this.findById(t)),!t){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var a=t.getModel(),o=this.get("itemController");o.collapseCombo(t,r),a.collapsed=!0;var s=this.getEdges().concat(this.get("vedges")),l=[],u=this.get("comboTrees"),h=!1;(u||[]).forEach(function(f){h||Fc(f,function(d){if(h&&d.depth<=a.depth)return!1;if(a.id===d.id&&(h=!0),h){var v=i.findById(d.id);v&&v.getType&&v.getType()==="combo"&&(l=l.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={};s.forEach(function(f){var d=f.getModel(),v=d.isVEdge,p=d.size,g=p===void 0?1:p;if(!(f.isVisible()&&!v)){var m=f.getSource(),y=f.getTarget(),_=null,x;if(m.getModel().id===a.id||l.includes(m)&&!l.includes(y)?(_=y,x=!1):(y.getModel().id===a.id||!l.includes(m)&&l.includes(y))&&(_=m,x=!0),_){if(v){i.removeItem(f,!1);return}for(var S=_.getModel();!_.isVisible();){var w=S.parentId,b=S.comboId,E=w||b;if(_=i.findById(E),!_||!E)return;S=_.getModel()}var T=S.id,C=x?{source:T,target:a.id,size:g,isVEdge:!0}:{source:a.id,target:T,size:g,isVEdge:!0},A="".concat(C.source,"-").concat(C.target);if(c[A]){c[A].size+=g;return}c[A]=C}}}),this.addItems(Object.values(c).map(function(f){return{type:"vedge",model:f}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}},e.prototype.expandCombo=function(t,r){var i=this;if(r===void 0&&(r=!0),rr(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var a=t.getModel(),o=this.get("itemController");o.expandCombo(t,r),a.collapsed=!1;var s=this.getEdges().concat(this.get("vedges")),l=[],u=this.get("comboTrees"),h=!1;(u||[]).forEach(function(f){h||Fc(f,function(d){if(h&&d.depth<=a.depth)return!1;if(a.id===d.id&&(h=!0),h){var v=i.findById(d.id);v&&v.getType&&v.getType()==="combo"&&(l=l.concat(v.getNodes()),l=l.concat(v.getCombos()))}return!0})});var c={};s.forEach(function(f){if(!(f.isVisible()&&!f.getModel().isVEdge)){var d=f.getSource(),v=f.getTarget(),p=d.get("id"),g=v.get("id"),m=null,y;if(p===a.id||l.includes(d)&&!l.includes(v)?(m=v,y=!1):g===a.id||!l.includes(d)&&l.includes(v)?(m=d,y=!0):l.includes(d)&&l.includes(v)&&d.isVisible()&&v.isVisible()&&f.show(),m){var _=f.getModel(),x=_.isVEdge,S=_.size,w=S===void 0?1:S;if(x){i.removeItem(f,!1);return}for(var b=m.getModel();!m.isVisible();){var E=b.parentId,T=b.comboId,C=E||T;if(m=i.findById(C),!m||!C)return;b=m.getModel()}for(var A=b.id,M=y?v:d,I=M.getModel();!M.isVisible();){var R=I.parentId,k=I.comboId,D=R||k;if(M=i.findById(D),!M||!D)return;if(I.comboId===a.id||I.parentId===a.id)break;I=M.getModel()}var G=I.id;if(A){var W=y?{source:A,target:G,isVEdge:!0,size:w}:{source:G,target:A,isVEdge:!0,size:w},z="".concat(W.source,"-").concat(W.target);if(c[z]){c[z].size+=w;return}c[z]=W}}}}),this.addItems(Object.values(c).map(function(f){return{type:"vedge",model:f}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})},e.prototype.collapseExpandCombo=function(t,r){if(r===void 0&&(r=!0),rr(t)&&(t=this.findById(t)),!(!t||t.getType&&t.getType()!=="combo")){for(var i=t.getModel(),a=this.findById(i.parentId);a;){var o=a.getModel();if(o.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),a=void 0;return}a=this.findById(o.parentId)}var s=i.collapsed;s?this.expandCombo(t,r):this.collapseCombo(t,r),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,r){var i=t;return rr(t)&&(i=this.findById(t)),i.getNeighbors(r)},e.prototype.getNodeDegree=function(t,r,i){r===void 0&&(r=void 0),i===void 0&&(i=!1);var a=t;rr(t)&&(a=this.findById(t));var o=this.get("degrees");(!o||i)&&(o=g_(this.save()),this.set("degrees",o));var s=o[a.getID()],l=0;if(!s)return 0;switch(r){case"in":l=s.inDegree;break;case"out":l=s.outDegree;break;case"all":l=s;break;default:l=s.degree;break}return l},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,r,i){if(t===void 0&&(t="update"),i===void 0&&(i="undo"),!this.get("enabledStack")){console.warn("\u8BF7\u5148\u542F\u7528 undo & redo \u529F\u80FD\uFF0C\u5728\u5B9E\u4F8B\u5316 Graph \u65F6\u5019\u914D\u7F6E enabledStack: true !");return}var a=r?Xi(r):{before:{},after:Xi(this.save())};i==="redo"?this.redoStack.push({action:t,data:a}):this.undoStack.push({action:t,data:a}),this.emit("stackchange",{action:t,stackType:i,undoStack:this.undoStack,redoStack:this.redoStack})},e.prototype.getAdjMatrix=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=this.get("directed"));var i=this.get("adjMatrix");return(!i||!t)&&(i=i2(this.save(),r),this.set("adjMatrix",i)),i},e.prototype.getShortestPathMatrix=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=this.get("directed"));var i=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!i||!t)&&(i=i2(this.save(),r),this.set("adjMatrix",i)),(!a||!t)&&(a=GD(this.save(),r),this.set("shortestPathMatrix",a)),a},e.prototype.on=function(t,r,i){return n.prototype.on.call(this,t,r,i)},e.prototype.destroy=function(){var t,r,i,a,o;this.emit("beforedestroy"),this.clear(),this.clearStack(),(t=this.get("itemController"))===null||t===void 0||t.destroy(),(r=this.get("modeController"))===null||r===void 0||r.destroy(),(i=this.get("viewController"))===null||i===void 0||i.destroy(),(a=this.get("stateController"))===null||a===void 0||a.destroy(),(o=this.get("canvas"))===null||o===void 0||o.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(!t.members||t.members.length<1){console.warn("Create hull failed! The members is empty.");return}var r=this.get("hullGroup"),i=this.get("hullMap");if(i||(i={},this.set("hullMap",i)),(!r||r.get("destroyed"))&&(r=this.get("group").addGroup({id:"hullGroup"}),r.toBack(),this.set("hullGroup",r)),i[t.id])return console.warn("Existed hull id."),i[t.id];var a=r.addGroup({id:"".concat(t.id,"-container")}),o=new MUe(this,ve(ve({},t),{group:a})),s=o.id;return i[s]=o,o},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var r,i;rr(t)?i=this.getHullById(t):i=t,(r=this.get("hullMap"))===null||r===void 0||delete r[i.id],i.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();!t||!Object.keys(t).length||(Object.keys(t).forEach(function(r){var i=t[r];i.destroy()}),this.set("hullMap",{}))},e}(C9e);function uee(n){return uee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uee(n)}var uC=sg,DSe="-shape",BX="-label",m5=["startArrow","endArrow"],NSe={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},i$t={lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},_5={edge:i$t,node:NSe,combo:NSe},hee="-label-bg",xse={options:{labelCfg:{style:{fontFamily:tn.windowFontFamily}},descriptionCfg:{style:{fontFamily:tn.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(e){return{}},getOptions:function(e,t){return t==="move"||(t==null?void 0:t.includes("bbox"))?e:ms({},this.options,this.getCustomConfig(e)||{},e)},draw:function(e,t){t.shapeMap={},this.mergeStyle=this.getOptions(e);var r=this.drawShape(e,t);if(r.set("className",this.itemType+DSe),t.shapeMap[this.itemType+DSe]=r,e.label){var i=this.drawLabel(e,t);i.set("className",this.itemType+BX),t.shapeMap[this.itemType+BX]=i}return r},afterDraw:function(e,t,r){},drawShape:function(e,t){return null},drawLabel:function(e,t){var r=(this.mergeStyle||this.getOptions(e)||{}).labelCfg,i=r||{},a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""){var l=s.getBBox(),u=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":u=uC(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break;case"lefttop":u=uC(u,[["t",-a.x,-a.y],["r",o],["t",a.x,a.y]]);break;case"leftcenter":u=uC(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);break;default:u=uC(u,[["t",-l.width/2,-l.height/2],["r",o],["t",l.width/2,l.height/2]]);break}else u=uC(u,[["t",-a.x,-a.y-l.height/2],["r",o],["t",a.x,a.y+l.height/2]]);s.setMatrix(u)}if(a.background){var h=this.drawLabelBg(e,t,s),c=this.itemType+hee;h.set("classname",c),t.shapeMap[c]=h,s.toFront()}return s},drawLabelBg:function(e,t,r){var i=this.options.labelCfg,a=_n({},i,e.labelCfg),o=this.getLabelBgStyleByPosition(r,a),s=t.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return t.shapeMap["text-bg-shape"]=s,s},getLabelStyleByPosition:function(e,t,r){return{text:e.label}},getLabelBgStyleByPosition:function(e,t){return{}},getLabelStyle:function(e,t,r){var i=this.getLabelStyleByPosition(e,t,r),a="".concat(this.itemType,"Label"),o=tn[a]?tn[a].style:null;return ve(ve(ve({},o),i),t.style)},getShapeStyle:function(e){return e.style},update:function(e,t,r){this.updateShapeStyle(e,t,r),this.updateLabel(e,t,r)},updateShapeStyle:function(e,t,r){var i,a=t.getContainer(),o=t.getKeyShape(),s=_n({},o.attr(),e.style),l=function(c){var f,d=s[c];if(kh(d)){var v=((i=a.shapeMap)===null||i===void 0?void 0:i[c])||a.find(function(p){return p.get("name")===c});v==null||v.attr(d)}else o.attr((f={},f[c]=d,f))};for(var u in s)l(u)},updateLabel:function(e,t,r){var i,a,o=t.getContainer(),s=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,l=s===void 0?{}:s,u=this.itemType+BX,h=o.shapeMap[u]||o.find(function(x){return x.get("className")===u}),c=this.itemType+hee,f=o.shapeMap[c]||o.find(function(x){return x.get("className")===c});if(h&&e.label===void 0&&(o.removeChild(h),delete o.shapeMap[u],f&&(o.removeChild(f),delete o.shapeMap[c])),e.label||e.label==="")if(h){(!r||r==="bbox|label"||this.itemType==="edge"&&r!=="style")&&(l=ms(l,e.labelCfg));var v=this.getLabelStyleByPosition(e,l,o),p=(i=e.labelCfg)===null||i===void 0?void 0:i.style,g=ve(ve({},v),p),m=g.rotate;if(delete g.rotate,!isNaN(m)&&m!==""){var y=[1,0,0,0,1,0,0,0,1];y=uC(y,[["t",-g.x,-g.y],["r",m],["t",g.x,g.y]]),g.matrix=y,h.attr(g)}else((a=h.getMatrix())===null||a===void 0?void 0:a[4])!==1&&h.resetMatrix(),h.attr(g);if(!f)g.background&&(f=this.drawLabelBg(e,o,h),f.set("classname",c),o.shapeMap[c]=f,h.toFront());else if(g.background){var _=this.getLabelBgStyleByPosition(h,l);f.attr(_)}else o.removeChild(f)}else{var d=this.drawLabel(e,o);d.set("className",u),o.shapeMap[u]=d}},afterUpdate:function(e,t){},setState:function(e,t,r){var i,a,o,s=r.get("keyShape");if(!(!s||s.destroyed)){var l=r.getType(),u=z3(t)?e:"".concat(e,":").concat(t),h=this.getStateStyle(u,r),c=r.getStateStyle(u);if(!(!c&&!h)){var f=_n({},c||h),d=r.getContainer(),v={x:1,y:1,cx:1,cy:1,matrix:1};if(l==="combo"&&(v.r=1,v.width=1,v.height=1),t){var p=function(D){var G,W=f[D];if(kh(W)&&!m5.includes(D)){var z=((o=d.shapeMap)===null||o===void 0?void 0:o[D])||d.find(function(V){return V.get("name")===D});z==null||z.attr(W)}else s.attr((G={},G[D]=W,G))};for(var g in f)p(g)}else{var m=jB(r.getCurrentStatesStyle()),y=r.getModel(),_=_n({},y.style,jB(r.getOriginStyle())),x=s.get("name"),S=s.attr(),w={};Object.keys(S).forEach(function(k){if(k!=="img"){var D=S[k];D&&uee(D)==="object"?w[k]=Xi(D):w[k]=D}});var b={},E=function(D){var G=f[D];if(kh(G)&&!m5.includes(D)){var W=d.shapeMap[D]||d.find(function(q){return q.get("name")===D});if(W){var z=jB(W.attr());At(G,function(q,Y){if(D===x&&w[Y]&&!v[Y]){delete w[Y];var le=_[D][Y]||_5[l][Y];s.attr(Y,le)}else if(z[Y]||z[Y]===0){delete z[Y];var j=_[D][Y]||_5[l][Y];W.attr(Y,j)}}),b[D]=z}}else if(w[D]&&!v[D]){delete w[D];var V=_[D]||(_[x]?_[x][D]:void 0)||_5[l][D];s.attr(D,V)}};for(var T in f)E(T);x?b[x]=w:_n(b,w);for(var g in m)if(!v[g]){var C=m[g];(!kh(C)||m5.includes(g))&&(x?(_n(_[x],(a={},a[g]=C,a)),delete _[g]):_n(_,(i={},i[g]=C,i)),delete m[g])}var A={};ms(A,_,b,m);var M=!1,I=function(D){var G,W,z=A[D];if(kh(z)&&!m5.includes(D)){var V=d.shapeMap[D]||d.find(function(Y){return Y.get("name")===D});V&&((V.get("type")==="text"||V.get("labelRelated"))&&(delete z.x,delete z.y,delete z.matrix),D===x&&(l==="combo"&&(delete z.r,delete z.width,delete z.height),M=!0),V.attr(z))}else if(!M){var q=z||_5[l][D];l==="combo"?x||s.attr((G={},G[D]=q,G)):s.attr((W={},W[D]=q,W))}};for(var R in A)I(R)}}}},getStateStyle:function(e,t){var r=t.getModel(),i=t.getType(),a=this.getOptions(r),o=a.stateStyles,s=a.style,l=s===void 0?{}:s,u=r.stateStyles?r.stateStyles[e]:o&&o[e];return i==="combo"?Xi(u):_n({},l,u)},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t,r,i=(e==null?void 0:e.anchorPoints)||((t=this.getCustomConfig(e))===null||t===void 0?void 0:t.anchorPoints)||((r=this.options)===null||r===void 0?void 0:r.anchorPoints);return i}},a$t={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:tn.nodeLabel.offset,getSize:function(e){var t,r=((t=this.mergeStyle)===null||t===void 0?void 0:t.size)||e.size||this.getOptions({}).size||tn.defaultNode.size;return vn(r)&&r.length===1&&(r=[r[0],r[0]]),vn(r)||(r=[r,r]),r},getLabelStyleByPosition:function(e,t){var r=t.maxLength,i=e.label;r&&(i=bze(i,r));var a=t.position||this.labelPosition;if(a==="center")return{x:0,y:0,text:i,textBaseline:"middle",textAlign:"center"};var o=t.offset;an(o)&&(o=this.offset);var s=this.getSize(e),l;switch(a){case"top":l={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":l={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":l={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:l={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"};break}return l.text=i,l},getLabelBgStyleByPosition:function(e,t){var r;if(!e)return{};var i=(r=t.style)===null||r===void 0?void 0:r.background;if(!i)return{};var a=e.getBBox(),o=mse(i.padding),s=a.width+o[1]+o[3],l=a.height+o[0]+o[2];return ve(ve({x:a.minX-o[3],y:a.minY-o[0]},i),{width:s,height:l})},drawShape:function(e,t){var r=this.shapeType,i=this.getShapeStyle(e),a=t.addShape(r,{attrs:i,draggable:!0,name:"node-shape"});return t.shapeMap["node-shape"]=a,a},updateLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(A){return A.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(A){return A.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(A){return A.get("className")==="link-point-top"}),s=t.shapeMap["link-point-bottom"]||t.find(function(A){return A.get("className")==="link-point-bottom"}),l;i&&(l=i.attr()),a&&!l&&(l=a.attr()),o&&!l&&(l=o.attr()),s&&!l&&(l=s.attr()),l||(l=r);var u=_n({},l,e.linkPoints),h=u.fill,c=u.stroke,f=u.lineWidth,d=u.size/2;d||(d=u.r);var v=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},p=v.left,g=v.right,m=v.top,y=v.bottom,_=this.getSize(e),x=_[0],S=_[1],w={r:d,fill:h,stroke:c,lineWidth:f};if(i)!p&&p!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(ve(ve({},w),{x:-x/2,y:0}));else if(p){var b="link-point-left";t.shapeMap[b]=t.addShape("circle",{attrs:ve(ve({},w),{x:-x/2,y:0}),className:b,name:b,isAnchorPoint:!0})}if(a)!g&&g!==void 0&&(a.remove(),delete t.shapeMap["link-point-right"]),a.attr(ve(ve({},w),{x:x/2,y:0}));else if(g){var E="link-point-right";t.shapeMap[E]=t.addShape("circle",{attrs:ve(ve({},w),{x:x/2,y:0}),className:E,name:E,isAnchorPoint:!0})}if(o)!m&&m!==void 0&&(o.remove(),delete t.shapeMap["link-point-top"]),o.attr(ve(ve({},w),{x:0,y:-S/2}));else if(m){var T="link-point-top";t.shapeMap[T]=t.addShape("circle",{attrs:ve(ve({},w),{x:0,y:-S/2}),className:T,name:T,isAnchorPoint:!0})}if(s)!y&&y!==void 0?(s.remove(),delete t.shapeMap["link-point-bottom"]):s.attr(ve(ve({},w),{x:0,y:S/2}));else if(y){var C="link-point-bottom";t.shapeMap[C]=t.addShape("circle",{attrs:ve(ve({},w),{x:0,y:S/2}),className:C,name:C,isAnchorPoint:!0})}},updateShape:function(e,t,r,i,a){var o=t.get("keyShape");o.attr(ve({},r)),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)},updateIcon:function(e,t){var r=this,i=t.getContainer(),a=(this.mergeStyle||this.getOptions(e)).icon,o=e.icon?e.icon:{show:void 0,text:void 0},s=o.show,l=o.text,u=i.shapeMap["".concat(this.type,"-icon")]||i.find(function(m){return m.get("name")==="".concat(r.type,"-icon")});if(u)if(s||s===void 0){var h=_n({},u.attr(),a),c=h.width,f=c===void 0?20:c,d=h.height,v=d===void 0?20:d;(h.fontFamily==="iconfont"||h.hasOwnProperty("text"))&&(f=0,v=0),u.attr(ve(ve({},h),{x:-f/2,y:-v/2}))}else u.remove(),delete i.shapeMap["".concat(this.type,"-icon")];else if(s){var p="".concat(this.type,"-icon");if(l)i.shapeMap[p]=i.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:p,name:p});else{var f=a.width,v=a.height;i.shapeMap[p]=i.addShape("image",{attrs:ve(ve({},a),{x:-f/2,y:-v/2}),className:p,name:p})}var g=i.shapeMap["node-label"]||i.find(function(m){return m.get("name")==="node-label"});g&&g.toFront()}}},o$t=ve(ve({},xse),a$t);_s.registerNode("single-node",o$t);var x5="edge-shape";function s$t(n){var e=n;return n==="start"?e="end":n==="end"&&(e="start"),e}var l$t={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:tn.defaultEdge.size,style:{x:0,y:0,stroke:tn.defaultEdge.style.stroke,lineAppendWidth:tn.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:tn.edgeLabel.style.fill,fontSize:tn.edgeLabel.style.fontSize,fontFamily:tn.windowFontFamily}},stateStyles:ve({},tn.edgeStateStyles)},getPath:function(e){var t=[];return At(e,function(r,i){i===0?t.push(["M",r.x,r.y]):t.push(["L",r.x,r.y])}),t},getShapeStyle:function(e){var t=this.options.style,r={stroke:e.color},i=_n({},t,r,e.style),a=e.size||tn.defaultEdge.size;e=this.getPathPoints(e);var o=e.startPoint,s=e.endPoint,l=this.getControlPoints(e),u=[o];l&&(u=u.concat(l)),u.push(s);var h=this.getPath(u),c=_n({},tn.defaultEdge.style,{stroke:tn.defaultEdge.color,lineWidth:a,path:h},i);return c},updateShapeStyle:function(e,t,r){var i,a=t.getContainer(),o=((i=t.getKeyShape)===null||i===void 0?void 0:i.call(t))||a.shapeMap["edge-shape"],s=e.size;e=this.getPathPoints(e);var l=e.startPoint,u=e.endPoint,h=this.getControlPoints(e),c=[l];h&&(c=c.concat(h)),c.push(u);var f=o.attr(),d=e.style||{};d.stroke===void 0&&(d.stroke=e.color);var v=e.sourceNode,p=e.targetNode,g={radius:d.radius};h||(g={source:v,target:p,offset:d.offset,radius:d.radius});var m=this.getPath(c,g),y={};r==="move"?y={path:m}:(f.endArrow&&d.endArrow===!1&&(e.style.endArrow={path:""}),f.startArrow&&d.startArrow===!1&&(e.style.startArrow={path:""}),y=ve({},e.style),y.lineWidth===void 0&&(y.lineWidth=(on(s)?s:s==null?void 0:s[0])||f.lineWidth),y.path===void 0&&(y.path=m),y.stroke===void 0&&(y.stroke=f.stroke||e.color)),o&&o.attr(y)},getLabelStyleByPosition:function(e,t,r){var i=t.position||this.labelPosition,a={},o=r==null?void 0:r.shapeMap[x5],s;i==="start"?s=0:i==="end"?s=1:s=.5;var l=t.refX||this.refX,u=t.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return a.x=e.startPoint.x+l,a.y=e.startPoint.y+u,a.text=e.label,a;var h;an(t.autoRotate)?h=this.labelAutoRotate:h=t.autoRotate;var c=xze(o,s,l,u,h);return a.x=c.x,a.y=c.y,a.rotate=c.rotate,a.textAlign=this._getTextAlign(i,c.angle),a.text=e.label,a},getLabelBgStyleByPosition:function(e,t){if(!e)return{};var r=e.getBBox(),i=t.style&&t.style.background;if(!i)return{};var a=i.padding,o=r.width+a[1]+a[3],s=r.height+a[0]+a[2],l=ve(ve({},i),{width:o,height:s,x:r.minX-a[3],y:r.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),u;return an(t.autoRotate)?u=this.labelAutoRotate:u=t.autoRotate,u&&(l.matrix=e.attr("matrix")||[1,0,0,0,1,0,0,0,1]),l},_getTextAlign:function(e,t){var r="center";return t?(t=t%(Math.PI*2),e!=="center"&&(t>=0&&t<=Math.PI/2||t>=3/2*Math.PI&&t<2*Math.PI?r=e:r=s$t(e)),r):e},getControlPoints:function(e){return e.controlPoints},getPathPoints:function(e){return e},drawShape:function(e,t){var r=this.getShapeStyle(e),i=t.addShape("path",{className:x5,name:x5,attrs:r});return t.shapeMap[x5]=i,i},drawLabel:function(e,t){var r=this.options.labelCfg,i=ms({},r,e.labelCfg),a=this.getLabelStyle(e,i,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0,draggable:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""&&s.rotateAtStart(o),a.background){var l=this.drawLabelBg(e,t,s,a,o),u=this.itemType+hee;l.set("classname",u),t.shapeMap[u]=l,s.toFront()}return s},drawLabelBg:function(e,t,r,i,a){var o=this.options.labelCfg,s=ms({},o,e.labelCfg),l=this.getLabelBgStyleByPosition(r,s),u=t.addShape("rect",{name:"text-bg-shape",attrs:l,labelRelated:!0});return t.shapeMap["text-bg-shape"]=u,u}},u$t=ve(ve({},xse),l$t);_s.registerEdge("single-edge",u$t);_s.registerEdge("line",{getControlPoints:function(){}},"single-edge");_s.registerEdge("spline",{getPath:function(e){var t=TUe(e);return t}},"single-edge");_s.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(e){var t=e.startPoint,r=e.endPoint,i={x:(t.x+r.x)/2,y:(t.y+r.y)/2},a,o;if(e.controlPoints!==void 0){if(o=e.controlPoints[0],a=OQ(t,o,r),t.x<=r.x&&t.y>r.y?this.clockwise=a.x>o.x?0:1:t.x<=r.x&&t.y<r.y?this.clockwise=a.x>o.x?1:0:t.x>r.x&&t.y<=r.y?this.clockwise=a.y<o.y?0:1:this.clockwise=a.y<o.y?1:0,(o.x-t.x)/(o.y-t.y)===(r.x-t.x)/(r.y-t.y))return[]}else{e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),vn(e.curveOffset)&&(e.curveOffset=e.curveOffset[0]),e.curveOffset<0?this.clockwise=0:this.clockwise=1;var s={x:r.x-t.x,y:r.y-t.y},l=Math.atan2(s.y,s.x);o={x:e.curveOffset*Math.cos(-Math.PI/2+l)+i.x,y:e.curveOffset*Math.sin(-Math.PI/2+l)+i.y},a=OQ(t,o,r)}var u=v9(t,a),h=[{x:u,y:u}];return h},getPath:function(e){var t=[];return t.push(["M",e[0].x,e[0].y]),e.length===2?t.push(["L",e[1].x,e[1].y]):t.push(["A",e[1].x,e[1].y,0,0,this.clockwise,e[2].x,e[2].y]),t}},"single-edge");_s.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(e){var t=e.controlPoints;if(!t||!t.length){var r=e.startPoint,i=e.endPoint;e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),vn(e.curveOffset)&&(e.curveOffset=e.curveOffset[0]),vn(e.curvePosition)&&(e.curvePosition=e.curveOffset[0]);var a=w9(r,i,e.curvePosition,e.curveOffset);t=[a]}return t},getPath:function(e){var t=[];return t.push(["M",e[0].x,e[0].y]),t.push(["Q",e[1].x,e[1].y,e[2].x,e[2].y]),t}},"single-edge");_s.registerEdge("cubic",{curvePosition:[1/2,1/2],curveOffset:[-20,20],getControlPoints:function(e){var t=e.controlPoints;if(e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),on(e.curveOffset)&&(e.curveOffset=[e.curveOffset,-e.curveOffset]),on(e.curvePosition)&&(e.curvePosition=[e.curvePosition,1-e.curvePosition]),!t||!t.length||t.length<2){var r=e.startPoint,i=e.endPoint,a=w9(r,i,e.curvePosition[0],e.curveOffset[0]),o=w9(r,i,e.curvePosition[1],e.curveOffset[1]);t=[a,o]}return t},getPath:function(e){var t=[];return t.push(["M",e[0].x,e[0].y]),t.push(["C",e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y]),t}},"single-edge");_s.registerEdge("cubic-vertical",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(e){var t=e.startPoint,r=e.endPoint;e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.minCurveOffset===void 0&&(e.minCurveOffset=this.minCurveOffset),on(e.curveOffset)&&(e.curveOffset=[e.curveOffset,-e.curveOffset]),on(e.minCurveOffset)&&(e.minCurveOffset=[e.minCurveOffset,-e.minCurveOffset]),on(e.curvePosition)&&(e.curvePosition=[e.curvePosition,1-e.curvePosition]);var i=r.y-t.y,a=[0,0];e.curveOffset?a=e.curveOffset:Math.abs(i)<Math.abs(e.minCurveOffset[0])&&(a=e.minCurveOffset);var o={x:t.x,y:t.y+i*this.curvePosition[0]+a[0]},s={x:r.x,y:r.y-i*this.curvePosition[1]+a[1]};return[o,s]}},"cubic");_s.registerEdge("cubic-horizontal",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(e){var t=e.startPoint,r=e.endPoint;e.curvePosition===void 0&&(e.curvePosition=this.curvePosition),e.curveOffset===void 0&&(e.curveOffset=this.curveOffset),e.minCurveOffset===void 0&&(e.minCurveOffset=this.minCurveOffset),on(e.curveOffset)&&(e.curveOffset=[e.curveOffset,-e.curveOffset]),on(e.minCurveOffset)&&(e.minCurveOffset=[e.minCurveOffset,-e.minCurveOffset]),on(e.curvePosition)&&(e.curvePosition=[e.curvePosition,1-e.curvePosition]);var i=r.x-t.x,a=[0,0];e.curveOffset?a=e.curveOffset:Math.abs(i)<Math.abs(e.minCurveOffset[0])&&(a=e.minCurveOffset);var o={x:t.x+i*this.curvePosition[0]+a[0],y:t.y},s={x:r.x-i*this.curvePosition[1]+a[1],y:r.y},l=[o,s];return l}},"cubic");_s.registerEdge("loop",{getPathPoints:function(e){return _ze(e)},getControlPoints:function(e){return e.controlPoints},afterDraw:function(e){e.controlPoints=void 0},afterUpdate:function(e){e.controlPoints=void 0}},"cubic");var h$t={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:tn.comboLabel.refX,refY:tn.comboLabel.refY,options:{style:{stroke:tn.defaultCombo.style.stroke,fill:tn.defaultCombo.style.fill,lineWidth:tn.defaultCombo.style.lineWidth},labelCfg:{style:{fill:tn.comboLabel.style.fill,fontSize:tn.comboLabel.style.fontSize,fontFamily:tn.windowFontFamily}},stateStyles:ve({},tn.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},getSize:function(e){var t=Xi(e.size||this.options.size||tn.defaultCombo.size);return vn(t)&&t.length===1&&(t=[t[0],t[0]]),vn(t)||(t=[t,t]),t},getLabelStyleByPosition:function(e,t){var r=t.position||this.labelPosition,i=e.style,a=e.padding||this.options.padding;vn(a)&&(a=Math.max.apply(Math,a));var o=t.refX,s=t.refY;an(o)&&(o=this.refX),an(s)&&(s=this.refY);var l=this.getSize(e),u=Math.max(i.r,l[0]/2)||l[0]/2,h=u+a,c;switch(r){case"top":c={x:0,y:-h-s,textBaseline:"bottom",textAlign:"center"};break;case"bottom":c={x:0,y:h+s,textBaseline:"bottom",textAlign:"center"};break;case"left":c={x:-h+o,y:0,textAlign:"left"};break;case"center":c={x:0,y:0,text:e.label,textAlign:"center"};break;default:c={x:h+o,y:0,textAlign:"right"};break}return c.text=e.label,c},drawShape:function(e,t){var r=this.shapeType,i=this.getShapeStyle(e),a=t.addShape(r,{attrs:i,draggable:!0,name:"combo-shape"});return a},updateCollapsedIcon:function(e,t,r){var i=e.collapsed,a=e.collapsedSubstituteIcon,o=a===void 0?{}:a,s=Object.assign({},this.options.collapsedSubstituteIcon,o),l=s.show,u=s.img,h=s.width,c=s.height,f=t.getContainer(),d=f.find(function(m){return m.get("name")==="combo-collapsed-substitute-icon"}),v=d&&!d.destroyed,p=t.get("keyShape");if(i&&l){if(v)d.show();else{var g={width:h||r.r*2||r.width,height:c||r.r*2||r.height};d=f.addShape("image",{attrs:ve({img:u,x:-g.width/2,y:-g.height/2},g),name:"combo-collapsed-substitute-icon",draggable:!0})}p.hide()}else v&&(d.hide(),p.show())},updateShape:function(e,t,r){var i=this,a=t.get("keyShape"),o=t.get("animate"),s=o&&(e.animate===void 0?this.options.animate:e.animate);s&&a.animate?(e.collapsed||this.updateCollapsedIcon(e,t,r),a.animate(r,{duration:200,easing:"easeLinear",callback:function(){e.collapsed&&i.updateCollapsedIcon(e,t,r)}})):(a.attr(ve({},r)),this.updateCollapsedIcon(e,t,r)),this.updateLabel(e,t)}},c$t=ve(ve({},xse),h$t);_s.registerCombo("single-combo",c$t);_s.registerCombo("circle",{options:{size:[tn.defaultCombo.size[0],tn.defaultCombo.size[0]],padding:Math.max.apply(Math,tn.defaultCombo.padding),animate:!0,style:{stroke:tn.defaultCombo.style.stroke,fill:tn.defaultCombo.style.fill,lineWidth:tn.defaultCombo.style.lineWidth},labelCfg:{style:{fill:tn.comboLabel.style.fill,fontSize:tn.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:ve({},tn.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},shapeType:"circle",labelPosition:"top",drawShape:function(e,t){var r=this.getShapeStyle(e);delete r.height,delete r.width;var i=t.addShape("circle",{attrs:r,className:"circle-combo",name:"circle-combo",draggable:!0});return i},getShapeStyle:function(e){var t=this.options.style,r=e.padding||this.options.padding;vn(r)&&(r=Math.max.apply(Math,r));var i={stroke:e.color},a=_n({},t,i,e.style),o=e.collapsed&&e.fixCollapseSize?e.fixCollapseSize:e.fixSize,s;if(o)s=on(o)?o/2:o[0]/2;else{var l=this.getSize(e);!on(a.r)||isNaN(a.r)?s=l[0]/2||tn.defaultCombo.style.r:s=Math.max(a.r,l[0]/2)||l[0]/2}a.r=s+r;var u=ve({x:0,y:0},a);return e.style?e.style.r=s:e.style={r:s},u},update:function(e,t){var r=this.getSize(e),i=e.padding||this.options.padding;vn(i)&&(i=Math.max.apply(Math,i));var a=Xi(e.style),o=e.collapsed&&e.fixCollapseSize?e.fixCollapseSize:e.fixSize,s;o?s=on(o)?o/2:o[0]/2:s=Math.max(a.r,r[0]/2)||r[0]/2,a.r=s+i;var l=t.get("sizeCache");l&&(l.r=a.r);var u={stroke:e.color},h=t.get("keyShape"),c=_n({},h.attr(),u,a);e.style?e.style.r=s:e.style={r:s},this.updateShape(e,t,c,!0)}},"single-combo");_s.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:tn.defaultCombo.style.stroke,fill:tn.defaultCombo.style.fill,lineWidth:tn.defaultCombo.style.lineWidth},labelCfg:{style:{fill:tn.comboLabel.style.fill,fontSize:tn.comboLabel.style.fontSize,fontFamily:tn.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:ve({},tn.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},shapeType:"rect",labelPosition:"top",drawShape:function(e,t){var r=this.getShapeStyle(e),i=t.addShape("rect",{attrs:r,className:"rect-combo",name:"rect-combo",draggable:!0});return i},getLabelStyleByPosition:function(e,t){var r=t.position||this.labelPosition,i=e.style,a=e.padding||this.options.padding;on(a)&&(a=[a,a,a,a]);var o=t.refX,s=t.refY;an(o)&&(o=this.refX),an(s)&&(s=this.refY);var l=-i.width/2-a[3],u=i.width/2+a[1],h=-i.height/2-a[0],c=i.height/2+a[2],f;switch(r){case"top":f={x:l+o,y:h+s,textBaseline:"top",textAlign:"left"};break;case"bottom":f={x:0,y:c+s,textBaseline:"top",textAlign:"center"};break;case"left":f={x:l+s,y:0,textAlign:"left"};break;case"center":f={x:0,y:0,text:e.label,textAlign:"center"};break;case"top-center":f={x:0,y:h+s,textBaseline:"top",textAlign:"center"};break;default:f={x:u+o,y:0,textAlign:"right"};break}return f.text=e.label,f},getShapeStyle:function(e){var t=this.options.style,r=e.padding||this.options.padding;on(r)&&(r=[r,r,r,r]);var i={stroke:e.color},a=_n({},t,i,e.style),o=this.getSize(e),s,l,u=e.collapsed&&e.fixCollapseSize?e.fixCollapseSize:e.fixSize;u?on(u)?(s=u,l=u):(s=u[0],l=u[1]):(!on(a.width)||isNaN(a.width)?s=o[0]||tn.defaultCombo.style.width:s=Math.max(a.width,o[0])||o[0],!on(a.height)||isNaN(a.height)?l=o[1]||tn.defaultCombo.style.height:l=Math.max(a.height,o[1])||o[1]);var h=-s/2-r[3],c=-l/2-r[0];a.width=s+r[1]+r[3],a.height=l+r[0]+r[2];var f=ve({x:h,y:c},a);return e.style?(e.style.width=s,e.style.height=l):e.style={width:s,height:l},f},update:function(e,t){var r=this.getSize(e),i=e.padding||this.options.padding;on(i)&&(i=[i,i,i,i]);var a=Xi(e.style),o,s,l=e.collapsed&&e.fixCollapseSize?e.fixCollapseSize:e.fixSize;l?on(l)?(o=l,s=l):(o=l[0],s=l[1]):(o=Math.max(a.width,r[0])||r[0],s=Math.max(a.height,r[1])||r[1]),a.width=o+i[1]+i[3],a.height=s+i[0]+i[2];var u=t.get("sizeCache");u&&(u.width=a.width,u.height=a.height),a.x=-o/2-i[3],a.y=-s/2-i[0];var h={stroke:e.color},c=t.get("keyShape"),f=_n({},c.attr(),h,a);e.style?(e.style.width=o,e.style.height=s):e.style={width:o,height:s},this.updateShape(e,t,f,!1)}},"single-combo");_s.registerNode("simple-circle",{options:{size:tn.defaultNode.size,style:{x:0,y:0,stroke:tn.defaultNode.style.stroke,fill:tn.defaultNode.style.fill,lineWidth:tn.defaultNode.style.lineWidth},labelCfg:{style:{fill:tn.nodeLabel.style.fill,fontSize:tn.nodeLabel.style.fontSize,fontFamily:tn.windowFontFamily}},stateStyles:ve({},tn.nodeStateStyles)},shapeType:"simple-circle",labelPosition:"center",shapeMap:{},drawShape:function(e,t){var r=this.getShapeStyle(e),i="".concat(this.type,"-keyShape"),a=t.addShape("circle",{attrs:r,className:"".concat(this.type,"-keyShape"),name:i,draggable:!0});return t.shapeMap[i]=a,a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=ms({},t,r),a=this.getSize(e),o=a[0]/2,s=ve({x:0,y:0,r:o},i);return s},update:function(e,t,r){var i=this.getSize(e),a={stroke:e.color,r:i[0]/2},o=t.get("keyShape"),s=ms({},o.attr(),a,e.style);this.updateShape(e,t,s,!0,r)}},"single-node");_s.registerNode("simple-rect",{options:{size:[100,30],style:{radius:0,stroke:tn.defaultNode.style.stroke,fill:tn.defaultNode.style.fill,lineWidth:tn.defaultNode.style.lineWidth},labelCfg:{style:{fill:tn.nodeLabel.style.fill,fontSize:tn.nodeLabel.style.fontSize,fontFamily:tn.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:ve({},tn.nodeStateStyles)},shapeType:"simple-rect",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e),i=t.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return i},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=ve({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t,r){t.getContainer();var i=(this.mergeStyle||this.getOptions(e)).style,a=this.getSize(e),o=t.get("keyShape");e.size||(a[0]=o.attr("width")||i.width,a[1]=o.attr("height")||i.height);var s={stroke:e.color,x:-a[0]/2,y:-a[1]/2,width:a[0],height:a[1]},l=_n({},i,o.attr(),s);l=_n(l,e.style),this.updateShape(e,t,l,!1,r)}},"single-node");_s.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,labelCfg:{style:{fontFamily:tn.windowFontFamily}},clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(e,t){var r=this.shapeType,i=this.getShapeStyle(e);delete i.fill;var a=t.addShape(r,{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return this.drawClip(e,a),a},drawClip:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).clipCfg;if(!!r.show){var i=r.type,a=r.x,o=r.y,s=r.style;if(i==="circle"){var l=r.r;t.setClip({type:"circle",attrs:ve({r:l,x:a,y:o},s)})}else if(i==="rect"){var u=r.width,h=r.height,c=a-u/2,f=o-h/2;t.setClip({type:"rect",attrs:ve({x:c,y:f,width:u,height:h},s)})}else if(i==="ellipse"){var d=r.rx,v=r.ry;t.setClip({type:"ellipse",attrs:ve({x:a,y:o,rx:d,ry:v},s)})}else if(i==="polygon"){var p=r.points;t.setClip({type:"polygon",attrs:ve({points:p},s)})}else if(i==="path"){var g=r.path;t.setClip({type:"path",attrs:ve({path:g},s)})}}},getShapeStyle:function(e){var t=this.mergeStyle||this.getOptions(e),r=t.style,i=t.img,a=this.getSize(e),o=a[0],s=a[1];r&&(o=r.width||a[0],s=r.height||a[1]);var l=ve({x:-o/2,y:-s/2,width:o,height:s,img:i},r);return l},updateShapeStyle:function(e,t){var r=t.getContainer(),i="".concat(this.itemType,"-shape"),a=r.shapeMap[i]||r.find(function(s){return s.get("className")===i})||t.getKeyShape(),o=this.getShapeStyle(e);a&&!a.destroyed&&a.attr(o)}},"single-node");const LUe={triangle:function(e,t,r){e===void 0&&(e=10),t===void 0&&(t=15),r===void 0&&(r=0);var i=r*2,a="M ".concat(i,",0 L ").concat(i+t,",-").concat(e/2," L ").concat(i+t,",").concat(e/2," Z");return a},vee:function(e,t,r){e===void 0&&(e=15),t===void 0&&(t=20),r===void 0&&(r=0);var i=r*2,a="M ".concat(i,",0 L ").concat(i+t,",-").concat(e/2,`
L `).concat(i+2*t/3,",0 L ").concat(i+t,",").concat(e/2," Z");return a},circle:function(e,t){e===void 0&&(e=5),t===void 0&&(t=0);var r=t*2,i="M ".concat(r,`, 0
a `).concat(e,",").concat(e," 0 1,0 ").concat(e*2,`,0
a `).concat(e,",").concat(e," 0 1,0 ").concat(-e*2,",0");return i},rect:function(e,t,r){e===void 0&&(e=10),t===void 0&&(t=10),r===void 0&&(r=0);var i=r*2,a="M ".concat(i,",").concat(-e/2,`
L `).concat(i+t,",").concat(-e/2,`
L `).concat(i+t,",").concat(e/2,`
L `).concat(i,",").concat(e/2," Z");return a},diamond:function(e,t,r){e===void 0&&(e=15),t===void 0&&(t=15),r===void 0&&(r=0);var i=r*2,a="M ".concat(i,`,0
L `).concat(i+t/2,",").concat(-e/2,`
L `).concat(i+t,`,0
L `).concat(i+t/2,",").concat(e/2," Z");return a},triangleRect:function(e,t,r,i,a,o){e===void 0&&(e=15),t===void 0&&(t=15),r===void 0&&(r=15),i===void 0&&(i=3),a===void 0&&(a=5),o===void 0&&(o=0);var s=o*2,l=s+t+a,u="M ".concat(s,",0 L ").concat(s+t,",-").concat(e/2," L ").concat(s+t,",").concat(e/2,` Z
M `).concat(l,", -").concat(r/2,`
L `).concat(l+i," -").concat(r/2,`
L `).concat(l+i," ").concat(r/2,`
L `).concat(l," ").concat(r/2,`
Z`);return u}},PUe={collapse:function(e,t,r){return[["M",e-r,t],["a",r,r,0,1,0,r*2,0],["a",r,r,0,1,0,-r*2,0],["M",e-r+4,t],["L",e+r-4,t]]},expand:function(e,t,r){return[["M",e-r,t],["a",r,r,0,1,0,r*2,0],["a",r,r,0,1,0,-r*2,0],["M",e-r+4,t],["L",e-r+2*r-4,t],["M",e-r+r,t-r+4],["L",e,t+r-4]]},upTriangle:function(e,t,r){var i=r*Math.cos(Math.PI/6),a=r*Math.sin(Math.PI/6);return[["M",e-i,t+a],["L",e+i,t+a],["L",e,t-r],["Z"]]},downTriangle:function(e,t,r){var i=r*Math.cos(Math.PI/6),a=r*Math.sin(Math.PI/6);return[["M",e-i,t-a],["L",e+i,t-a],["L",e,t+r],["Z"]]}};var f$t=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"];const d$t=Object.freeze(Object.defineProperty({__proto__:null,defaultSubjectColors:f$t},Symbol.toStringTag,{value:"Module"}));var OUe=function(e){return e==="force"||e==="g6force"||e==="gForce"||e==="force2"};const v$t=Object.freeze(Object.defineProperty({__proto__:null,isForce:OUe},Symbol.toStringTag,{value:"Module"}));var p$t=sg,gc=ve(ve(ve(ve(ve(ve(ve({},MVt),q7t),XVt),z7t),d$t),v$t),{transform:p$t,mat3:R9e}),RUe=function(){function n(e){this.graph=e,this.layoutCfg=e.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return n.prototype.initLayout=function(){},n.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},n.prototype.getLayoutCfgType=function(e){var t=e.type;if(t)return t;var r=e.pipes;return Array.isArray(r)?r.map(function(i){return(i==null?void 0:i.type)||""}):null},n.prototype.isLayoutTypeSame=function(e){var t=this.getLayoutCfgType(e),r=Array.isArray(this.layoutType),i=Array.isArray(t);return r&&i?this.layoutType.every(function(a,o){return a===t[o]}):Array.isArray(t)||Array.isArray(this.layoutType)?!1:(e==null?void 0:e.type)===this.layoutType},n.prototype.refreshLayout=function(){var e=this,t=e.graph,r=e.layoutType,i=e.layoutCfg,a=i===void 0?{}:i;if(!!t){var o=a.animate,s=o===void 0&&(r==="force"||r==="force2"),l=OUe(r)&&(o||s);t.get("animate")&&!l?t.positionsAnimate(r==="comboCombined"):t.refreshPositions(r==="comboCombined")}},n.prototype.changeLayout=function(e){var t=e.disableTriggerLayout,r=rh(e,["disableTriggerLayout"]);this.layoutCfg=r,this.layoutType=r.type||this.layoutType,!t&&this.layout()},n.prototype.changeData=function(e){this.layout(e)},n.prototype.destoryLayoutMethods=function(){var e=this.layoutMethods,t=[];return e==null||e.forEach(function(r){var i,a=(i=r.getType)===null||i===void 0?void 0:i.call(r);a&&t.push(a),r.destroy()}),this.layoutMethods=[],t},n.prototype.destroyLayout=function(){this.destoryLayoutMethods();var e=this.graph;e&&!e.get("destroyed")&&e.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},n.prototype.setDataFromGraph=function(){for(var e,t=[],r=[],i=[],a=[],o=[],s=[],l=[],u=this.graph.getNodes(),h=this.graph.getEdges(),c=this.graph.getCombos(),f=u.length,d=0;d<f;d++){var v=u[d];if(!(!v||v.destroyed)){var p=v.getModel();if(!v.isVisible()){r.push(p);continue}t.push(p)}}for(var g=h.length,d=0;d<g;d++){var m=h[d];if(!(!m||m.destroyed)){var p=m.getModel();if(!m.isVisible()){a.push(p);continue}p.isComboEdge?o.push(p):i.push(p)}}for(var y=c.length,d=0;d<y;d++){var _=c[d];if(!_.destroyed){var p=_.getModel();if(!_.isVisible()){l.push(p);continue}s.push(p)}}return{nodes:t,hiddenNodes:r,edges:i,hiddenEdges:a,combos:s,hiddenCombos:l,comboEdges:o,vedges:(e=this.graph.get("vedges"))===null||e===void 0?void 0:e.map(function(x){return x.getModel()})}},n.prototype.relayout=function(e){var t=this,r=this,i=r.graph,a=r.layoutMethods,o=r.layoutCfg;if(!(!i||i.get("destroyed"))){var s=Promise.resolve();if(e){this.data=this.setDataFromGraph();var l=this.data.nodes;if(!l)return!1;s=this.initPositions(o.center,l)}i.emit("beforelayout"),a==null||a.forEach(function(u,h){var c=o[h]||o;s=s.then(function(){var f,d=t.execLayoutMethod(c,h);return h===a.length-1&&((f=o.onAllLayoutEnd)===null||f===void 0||f.call(o)),d})})}},n.prototype.filterLayoutData=function(e,t){var r=e.nodes,i=e.edges,a=rh(e,["nodes","edges"]);if(!r)return e;var o,s;nl(t==null?void 0:t.nodesFilter)?o=t.nodesFilter:o=function(){return!0};var l=r.filter(o);if(nl(t==null?void 0:t.edgesFilter))s=t.edgesFilter;else{var u=l.reduce(function(h,c){return h[c.id]=!0,h},{});s=function(c){return u[c.source]&&u[c.target]}}return ve({nodes:l,edges:i.filter(s)},a)},n.prototype.getLayoutBBox=function(e){var t=this.graph,r=u9(t.getNodes(),function(o){return o.getModel().layoutOrder}),i=Object.values(r).map(function(o){var s=vUe(o);return s.size=[s.width,s.height],s}),a=Object.values(u9(e,"layoutOrder"));return{groupNodes:a,layoutNodes:i}},n.prototype.layoutAnimate=function(){},n.prototype.moveToZero=function(){var e=this.graph,t=e.get("data"),r=t.nodes;if(!(r[0].x===void 0||r[0].x===null||Py(r[0].x))){for(var i=[0,0],a=r.length,o=0;o<a;o++){var s=r[o];i[0]+=s.x,i[1]+=s.y}i[0]/=r.length,i[1]/=r.length;for(var o=0;o<a;o++){var s=r[o];s.x-=i[0],s.y-=i[1]}}},n.prototype.initPositions=function(e,t){var r;return Qd(this,void 0,void 0,function(){var i,a,o;return ev(this,function(s){return i=this.graph,t!=null&&t.length?(a=t.filter(function(l){return Py(l.x)||Py(l.y)}),o=a?a.length:0,o?[2,(r=this.initWithPreset)===null||r===void 0?void 0:r.call(this,function(){},function(){var l=i.get("width")*.85,u=i.get("height")*.85,h=Math.ceil(Math.sqrt(o)*(l/u)),c=Math.ceil(o/h),f=l/(h-1),d=u/(c-1);(!isFinite(f)||!f)&&(f=0),(!isFinite(d)||!f)&&(d=0);for(var v=e[0]-l/2,p=e[1]-u/2,g=0;g<o;g++){var m=a[g];Py(+m.x)&&(m.x=g%h*f+v),Py(+m.y)&&(m.y=Math.floor(g/h)*d+p)}})]:[2]):[2,Promise.resolve()]})})},n.prototype.destroy=function(){this.graph=null,this.destoryLayoutMethods(),this.destroyed=!0},n}(),DUe=function(){function n(e){this.graph=e,this.destroyed=!1,this.initEvents()}return n}(),G_=_s.registerNode,NUe=_s.registerEdge,g$t=_s.registerCombo,kUe=koe.registerBehavior,Rr=tn;tn.version,_s.registerNode,_s.registerEdge,_s.registerCombo,koe.registerBehavior;var Sse={},aa={},VU={},YS={};Object.defineProperty(YS,"__esModule",{value:!0});YS.MESSAGE=YS.ALGORITHM=void 0;var y$t={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};YS.ALGORITHM=y$t;var m$t={SUCCESS:"SUCCESS",FAILURE:"FAILURE"};YS.MESSAGE=m$t;var $U={},FUe={},aT={};Object.defineProperty(aT,"__esModule",{value:!0});aT.default=void 0;var _$t=function(e,t){var r=e.nodes,i=e.edges,a=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(s,l){o[s.id]=l;var u=[];a.push(u)}),i&&i.forEach(function(s){var l=s.source,u=s.target,h=o[l],c=o[u];!h&&h!==0||!c&&c!==0||(a[h][c]=1,t||(a[c][h]=1))}),a},x$t=_$t;aT.default=x$t;var WU={},HU={},AM={};Object.defineProperty(AM,"__esModule",{value:!0});AM.default=AM.LinkedListNode=void 0;var S$t=function(e,t){return e===t},cee=function(){function n(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return n.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},n}();AM.LinkedListNode=cee;var w$t=function(){function n(e){e===void 0&&(e=S$t),this.head=null,this.tail=null,this.compare=e}return n.prototype.prepend=function(e){var t=new cee(e,this.head);return this.head=t,this.tail||(this.tail=t),this},n.prototype.append=function(e){var t=new cee(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},n.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var r=this.head;if(r!==null)for(;r.next;)this.compare(r.next.value,e)?(t=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,e)&&(this.tail=r),t},n.prototype.find=function(e){var t=e.value,r=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||r!==void 0&&this.compare(o.value,r))return o;o=o.next}return null},n.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},n.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},n.prototype.fromArray=function(e){var t=this;return e.forEach(function(r){return t.append(r)}),this},n.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},n.prototype.reverse=function(){for(var e=this.head,t=null,r=null;e;)r=e.next,e.next=t,t=e,e=r;this.tail=this.head,this.head=t},n.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},n}(),b$t=w$t;AM.default=b$t;Object.defineProperty(HU,"__esModule",{value:!0});HU.default=void 0;var E$t=T$t(AM);function T$t(n){return n&&n.__esModule?n:{default:n}}var C$t=function(){function n(){this.linkedList=new E$t.default}return n.prototype.isEmpty=function(){return!this.linkedList.head},n.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},n.prototype.enqueue=function(e){this.linkedList.append(e)},n.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},n.prototype.toString=function(e){return this.linkedList.toString(e)},n}(),A$t=C$t;HU.default=A$t;var Du={};Object.defineProperty(Du,"__esModule",{value:!0});Du.uniqueId=Du.getOutEdgesNodeId=Du.getNeighbors=Du.getEdgesByNodeId=void 0;var M$t=function(e,t,r){t===void 0&&(t=[]);var i=t.filter(function(l){return l.source===e||l.target===e});if(r==="target"){var a=function(u){return u.source===e};return i.filter(a).map(function(l){return l.target})}if(r==="source"){var o=function(u){return u.target===e};return i.filter(o).map(function(l){return l.source})}var s=function(u){return u.source===e?u.target:u.source};return i.map(s)};Du.getNeighbors=M$t;var I$t=function(e,t){return t.filter(function(r){return r.source===e})};Du.getOutEdgesNodeId=I$t;var L$t=function(e,t){return t.filter(function(r){return r.source===e||r.target===e})};Du.getEdgesByNodeId=L$t;var P$t=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),r="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(r)};Du.uniqueId=P$t;Object.defineProperty(WU,"__esModule",{value:!0});WU.default=void 0;var O$t=D$t(HU),R$t=Du;function D$t(n){return n&&n.__esModule?n:{default:n}}function N$t(n){n===void 0&&(n={});var e=n,t=function(){},r=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return e.allowTraversal=n.allowTraversal||r,e.enter=n.enter||t,e.leave=n.leave||t,e}var k$t=function(e,t,r,i){i===void 0&&(i=!0);var a=N$t(r),o=new O$t.default,s=e.edges,l=s===void 0?[]:s;o.enqueue(t);for(var u="",h=function(){var f=o.dequeue();a.enter({current:f,previous:u}),(0,R$t.getNeighbors)(f,l,i?"target":void 0).forEach(function(d){a.allowTraversal({previous:u,current:f,next:d})&&o.enqueue(d)}),a.leave({current:f,previous:u}),u=f};!o.isEmpty();)h()},F$t=k$t;WU.default=F$t;var qS={};Object.defineProperty(qS,"__esModule",{value:!0});qS.default=B$t;qS.detectStrongConnectComponents=qS.detectConnectedComponents=void 0;var BUe=Du,GUe=function(e){for(var t=e.nodes,r=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l=[],u=function d(v){l.push(v),s[v.id]=!0;for(var p=(0,BUe.getNeighbors)(v.id,a),g=function(_){var x=p[_];if(!s[x]){var S=r.filter(function(w){return w.id===x});S.length>0&&d(S[0])}},m=0;m<p.length;++m)g(m)},h=0;h<r.length;h++){var c=r[h];if(!s[c.id]){u(c);for(var f=[];l.length>0;)f.push(l.pop());o.push(f)}}return o};qS.detectConnectedComponents=GUe;var zUe=function(e){for(var t=e.nodes,r=t===void 0?[]:t,i=e.edges,a=i===void 0?[]:i,o=[],s={},l={},u={},h=[],c=0,f=function g(m){l[m.id]=c,u[m.id]=c,c+=1,o.push(m),s[m.id]=!0;for(var y=(0,BUe.getNeighbors)(m.id,a,"target").filter(function(b){return r.map(function(E){return E.id}).indexOf(b)>-1}),_=function(E){var T=y[E];if(!l[T]&&l[T]!==0){var C=r.filter(function(A){return A.id===T});C.length>0&&g(C[0]),u[m.id]=Math.min(u[m.id],u[T])}else s[T]&&(u[m.id]=Math.min(u[m.id],l[T]))},x=0;x<y.length;x++)_(x);if(u[m.id]===l[m.id]){for(var S=[];o.length>0;){var w=o.pop();if(s[w.id]=!1,S.push(w),w===m)break}S.length>0&&h.push(S)}},d=0,v=r;d<v.length;d++){var p=v[d];!l[p.id]&&l[p.id]!==0&&f(p)}return h};qS.detectStrongConnectComponents=zUe;function B$t(n,e){return e?zUe(n):GUe(n)}var q1={};Object.defineProperty(q1,"__esModule",{value:!0});q1.getOutDegree=q1.getInDegree=q1.default=void 0;var XD=function(e){var t={},r=e.nodes,i=r===void 0?[]:r,a=e.edges,o=a===void 0?[]:a;return i.forEach(function(s){t[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){t[s.source].degree++,t[s.source].outDegree++,t[s.target].degree++,t[s.target].inDegree++}),t},G$t=XD;q1.default=G$t;var z$t=function(e,t){var r=XD(e);return r[t]?XD(e)[t].inDegree:0};q1.getInDegree=z$t;var U$t=function(e,t){var r=XD(e);return r[t]?XD(e)[t].outDegree:0};q1.getOutDegree=U$t;var zy={},jU={};Object.defineProperty(jU,"__esModule",{value:!0});jU.default=W$t;var V$t=Du;function $$t(n){n===void 0&&(n={});var e=n,t=function(){},r=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return e.allowTraversal=n.allowTraversal||r,e.enter=n.enter||t,e.leave=n.leave||t,e}function UUe(n,e,t,r,i){i===void 0&&(i=!0),r.enter({current:e,previous:t});var a=n.edges,o=a===void 0?[]:a;(0,V$t.getNeighbors)(e,o,i?"target":void 0).forEach(function(s){r.allowTraversal({previous:t,current:e,next:s})&&UUe(n,s,e,r,i)}),r.leave({current:e,previous:t})}function W$t(n,e,t,r){r===void 0&&(r=!0),UUe(n,e,"",$$t(t),r)}function fee(n){return fee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fee(n)}Object.defineProperty(zy,"__esModule",{value:!0});zy.detectAllUndirectedCycle=zy.detectAllDirectedCycle=zy.detectAllCycles=zy.default=void 0;var H$t=X$t(jU),VUe=j$t(qS),$Ue=Du;function WUe(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(WUe=function(i){return i?t:e})(n)}function j$t(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||fee(n)!=="object"&&typeof n!="function")return{default:n};var t=WUe(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var o=i?Object.getOwnPropertyDescriptor(n,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=n[a]}return r.default=n,t&&t.set(n,r),r}function X$t(n){return n&&n.__esModule?n:{default:n}}var Y$t=function(e){var t=null,r=e.nodes,i=r===void 0?[]:r,a={},o={},s={},l={};i.forEach(function(c){o[c.id]=c});for(var u={enter:function(f){var d=f.current,v=f.previous;if(s[d]){t={};for(var p=d,g=v;g!==d;)t[p]=g,p=g,g=a[g];t[p]=g}else s[d]=d,delete o[d],a[d]=v},leave:function(f){var d=f.current;l[d]=d,delete s[d]},allowTraversal:function(f){var d=f.next;return t?!1:!l[d]}};Object.keys(o).length;){var h=Object.keys(o)[0];(0,H$t.default)(e,h,u)}return t},HUe=function(e,t,r){var i,a;r===void 0&&(r=!0);for(var o=[],s=(0,VUe.default)(e,!1),l=0,u=s;l<u.length;l++){var h=u[l];if(!!h.length)for(var c=h[0],f=c.id,d=[c],v=(i={},i[f]=c,i),p=(a={},a[f]=new Set,a);d.length>0;)for(var g=d.pop(),m=g.id,y=(0,$Ue.getNeighbors)(m,e.edges),_=function(w){var b,E=y[w],T=e.nodes.find(function(k){return k.id===E});if(E===m)o.push((b={},b[E]=g,b));else if(!(E in p))v[E]=g,d.push(T),p[E]=new Set([g]);else if(!p[m].has(T)){for(var C=!0,A=[T,g],M=v[m];p[E].size&&!p[E].has(M)&&(A.push(M),M!==v[M.id]);)M=v[M.id];if(A.push(M),t&&r?(C=!1,A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!0)):t&&!r&&A.findIndex(function(k){return t.indexOf(k.id)>-1})>-1&&(C=!1),C){for(var I={},R=1;R<A.length;R+=1)I[A[R-1].id]=A[R];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[E].add(g)}},x=0;x<y.length;x+=1)_(x)}return o};zy.detectAllUndirectedCycle=HUe;var jUe=function(e,t,r){r===void 0&&(r=!0);for(var i=[],a=new Set,o=[],s=[],l={},u={},h=function(M){for(var I=[M];I.length>0;){var R=I.pop();a.has(R)&&(a.delete(R),o[R.id].forEach(function(k){I.push(k)}),o[R.id].clear())}},c=function A(M,I,R){var k=!1;if(t&&r===!1&&t.indexOf(M.id)>-1)return k;i.push(M),a.add(M);for(var D=R[M.id],G=0;G<D.length;G+=1){var W=l[D[G]];if(W===I){for(var z={},V=1;V<i.length;V+=1)z[i[V-1].id]=i[V];i.length&&(z[i[i.length-1].id]=i[0]),s.push(z),k=!0}else a.has(W)||A(W,I,R)&&(k=!0)}if(k)h(M);else for(var G=0;G<D.length;G+=1){var W=l[D[G]];o[W.id].has(M)||o[W.id].add(M)}return i.pop(),k},f=e.nodes,d=f===void 0?[]:f,v=0;v<d.length;v+=1){var p=d[v],g=p.id;u[g]=v,l[v]=p}if(t&&r)for(var m=function(M){var I=t[M];u[d[M].id]=u[I],u[I]=0,l[0]=d.find(function(R){return R.id===I}),l[u[d[M].id]]=d[M]},v=0;v<t.length;v++)m(v);for(var y=function(M){for(var I,R,k=1/0,D=0;D<M.length;D+=1)for(var G=M[D],W=0;W<G.length;W++){var z=u[G[W].id];z<k&&(k=z,R=D)}for(var V=M[R],q=[],D=0;D<V.length;D+=1){var Y=V[D];q[Y.id]=[];for(var le=0,j=(0,$Ue.getNeighbors)(Y.id,e.edges,"target").filter(function(oe){return V.map(function(se){return se.id}).indexOf(oe)>-1});le<j.length;le++){var Q=j[le];Q===Y.id&&!(r===!1&&t.indexOf(Y.id)>-1)?s.push((I={},I[Y.id]=Y,I)):q[Y.id].push(u[Q])}}return{component:V,adjList:q,minIdx:k}},_=0;_<d.length;){var x=d.filter(function(A){return u[A.id]>=_}),S=(0,VUe.detectStrongConnectComponents)({nodes:x,edges:e.edges}).filter(function(A){return A.length>1});if(S.length===0)break;var w=y(S),b=w.minIdx,E=w.adjList,T=w.component;if(T.length>1){T.forEach(function(A){o[A.id]=new Set});var C=l[b];if(t&&r&&t.indexOf(C.id)===-1)return s;c(C,C,E),_=b+1}else break}return s};zy.detectAllDirectedCycle=jUe;var q$t=function(e,t,r,i){return i===void 0&&(i=!0),t?jUe(e,r,i):HUe(e,r,i)};zy.detectAllCycles=q$t;var Z$t=Y$t;zy.default=Z$t;var YI={};const XUe=Nd($4t),$3=Nd(t6t);Object.defineProperty(YI,"__esModule",{value:!0});YI.default=void 0;var kSe=XUe,K$t=$3,FSe=Du,J$t=function(e,t,r){for(var i=1/0,a,o=0;o<t.length;o++){var s=t[o].id;!r[s]&&e[s]<=i&&(i=e[s],a=t[o])}return a},Q$t=function(e,t,r,i){var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},h={},c={};o.forEach(function(y,_){var x=y.id;h[x]=1/0,x===t&&(h[x]=0)});for(var f=o.length,d=function(_){var x=J$t(h,o,u),S=x.id;if(u[S]=!0,h[S]===1/0)return"continue";var w=[];r?w=(0,FSe.getOutEdgesNodeId)(S,l):w=(0,FSe.getEdgesByNodeId)(S,l),w.forEach(function(b){var E=b.target,T=b.source,C=E===S?T:E,A=i&&b[i]?b[i]:1;h[C]>h[x.id]+A?(h[C]=h[x.id]+A,c[C]=[x.id]):h[C]===h[x.id]+A&&c[C].push(x.id)})},v=0;v<f;v++)d();c[t]=[t];var p={};for(var g in h)h[g]!==1/0&&YUe(t,g,c,p);var m={};for(var g in p)m[g]=p[g][0];return{length:h,path:m,allPath:p}},eWt=Q$t;YI.default=eWt;function YUe(n,e,t,r){if(n===e)return[n];if(r[e])return r[e];for(var i=[],a=0,o=t[e];a<o.length;a++){var s=o[a],l=YUe(n,s,t,r);if(!l)return;for(var u=0,h=l;u<h.length;u++){var c=h[u];(0,K$t.isArray)(c)?i.push((0,kSe.__spreadArray)((0,kSe.__spreadArray)([],c,!0),[e],!1)):i.push([c,e])}}return r[e]=i,r[e]}var MM={};Object.defineProperty(MM,"__esModule",{value:!0});MM.findShortestPath=MM.findAllPath=void 0;var tWt=rWt(YI),S5=Du;function rWt(n){return n&&n.__esModule?n:{default:n}}var nWt=function(e,t,r,i,a){var o=(0,tWt.default)(e,t,i,a),s=o.length,l=o.path,u=o.allPath;return{length:s[r],path:l[r],allPath:u[r]}};MM.findShortestPath=nWt;var iWt=function(e,t,r,i){var a;if(t===r)return[[t]];var o=e.edges,s=o===void 0?[]:o,l=[t],u=(a={},a[t]=!0,a),h=[],c=[],f=i?(0,S5.getNeighbors)(t,s,"target"):(0,S5.getNeighbors)(t,s);for(h.push(f);l.length>0&&h.length>0;){var d=h[h.length-1];if(d.length){var v=d.shift();v&&(l.push(v),u[v]=!0,f=i?(0,S5.getNeighbors)(v,s,"target"):(0,S5.getNeighbors)(v,s),h.push(f.filter(function(m){return!u[m]})))}else{var p=l.pop();u[p]=!1,h.pop();continue}if(l[l.length-1]===r){var g=l.map(function(y){return y});c.push(g);var p=l.pop();u[p]=!1,h.pop()}}return c};MM.findAllPath=iWt;var W3={};Object.defineProperty(W3,"__esModule",{value:!0});W3.default=void 0;var aWt=oWt(aT);function oWt(n){return n&&n.__esModule?n:{default:n}}var sWt=function(e,t){for(var r=(0,aWt.default)(e,t),i=[],a=r.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:r[o][s]===0||!r[o][s]?i[o][s]=1/0:i[o][s]=r[o][s]}for(var l=0;l<a;l+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][l]+i[l][s]&&(i[o][s]=i[o][l]+i[l][s]);return i},lWt=sWt;W3.default=lWt;var XU={};Object.defineProperty(XU,"__esModule",{value:!0});XU.default=void 0;var uWt=cWt(aT),hWt=Du;function cWt(n){return n&&n.__esModule?n:{default:n}}var fWt=function(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,l=s===void 0?[]:s,u={},h={};o.forEach(function(_,x){var S=(0,hWt.uniqueId)();_.clusterId=S,u[S]={id:S,nodes:[_]},h[_.id]={node:_,idx:x}});var c=(0,uWt.default)(e,t),f={};c.forEach(function(_,x){var S=o[x].id;f[S]={},_.forEach(function(w,b){if(!!w){var E=o[b].id;f[S][E]=w}})});for(var d=0,v=function(){var x=!1;if(o.forEach(function(S){var w={};Object.keys(f[S.id]).forEach(function(R){var k=f[S.id][R],D=h[R].node,G=D.clusterId;w[G]||(w[G]=0),w[G]+=k});var b=-1/0,E=[];if(Object.keys(w).forEach(function(R){b<w[R]?(b=w[R],E=[R]):b===w[R]&&E.push(R)}),!(E.length===1&&E[0]===S.clusterId)){var T=E.indexOf(S.clusterId);if(T>=0&&E.splice(T,1),E&&E.length){x=!0;var C=u[S.clusterId],A=C.nodes.indexOf(S);C.nodes.splice(A,1);var M=Math.floor(Math.random()*E.length),I=u[E[M]];I.nodes.push(S),S.clusterId=I.id}}}),!x)return"break";d++};d<i;){var p=v();if(p==="break")break}Object.keys(u).forEach(function(_){var x=u[_];(!x.nodes||!x.nodes.length)&&delete u[_]});var g=[],m={};l.forEach(function(_){var x=_.source,S=_.target,w=_[r]||1,b=h[x].node.clusterId,E=h[S].node.clusterId,T="".concat(b,"---").concat(E);if(m[T])m[T].weight+=w,m[T].count++;else{var C={source:b,target:E,weight:w,count:1};m[T]=C,g.push(C)}});var y=[];return Object.keys(u).forEach(function(_){y.push(u[_])}),{clusters:y,clusterEdges:g}},dWt=fWt;XU.default=dWt;var YU={},H3={};Object.defineProperty(H3,"__esModule",{value:!0});H3.default=void 0;var vWt=$3,pWt=function(){function n(e){this.arr=e}return n.prototype.getArr=function(){return this.arr||[]},n.prototype.add=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new n(r);if(!(r!=null&&r.length))return new n(this.arr);if(this.arr.length===r.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+r[a];return new n(i)}},n.prototype.subtract=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return new n(r);if(!(r!=null&&r.length))return new n(this.arr);if(this.arr.length===r.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-r[a];return new n(i)}},n.prototype.avg=function(e){var t=[];if(e!==0)for(var r in this.arr)t[r]=this.arr[r]/e;return new n(t)},n.prototype.negate=function(){var e=[];for(var t in this.arr)e[t]=-this.arr[t];return new n(e)},n.prototype.squareEuclideanDistance=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return i}},n.prototype.euclideanDistance=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-e.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},n.prototype.normalize=function(){var e=[],t=(0,vWt.clone)(this.arr);t.sort(function(o,s){return o-s});var r=t[t.length-1],i=t[0];for(var a in this.arr)e[a]=(this.arr[a]-i)/(r-i);return new n(e)},n.prototype.norm2=function(){var e;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return 0;var t=0;for(var r in this.arr)t+=Math.pow(this.arr[r],2);return Math.sqrt(t)},n.prototype.dot=function(e){var t,r=e.arr;if(!(!((t=this.arr)===null||t===void 0)&&t.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=this.arr[a]*e.arr[a];return i}else console.error("The two vectors are unequal in length.")},n.prototype.equal=function(e){var t,r=e.arr;if(((t=this.arr)===null||t===void 0?void 0:t.length)!==(r==null?void 0:r.length))return!1;for(var i in this.arr)if(this.arr[i]!==r[i])return!1;return!0},n}(),gWt=pWt;H3.default=gWt;var Uy={},IM={};Object.defineProperty(IM,"__esModule",{value:!0});IM.secondReg=IM.dateReg=void 0;var yWt=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;IM.secondReg=yWt;var mWt=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;IM.dateReg=mWt;Object.defineProperty(Uy,"__esModule",{value:!0});Uy.getPropertyWeight=Uy.getAllSortProperties=Uy.getAllProperties=Uy.default=void 0;var BSe=IM,wse=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=100);var r={};e.forEach(function(a){!a.properties||Object.keys(a.properties).forEach(function(o){if(o==="id"||!"".concat(a.properties[o]).match(BSe.secondReg)&&!"".concat(a.properties[o]).match(BSe.dateReg)&&isNaN(Number(a.properties[o]))){r.hasOwnProperty(o)&&delete r[o];return}r.hasOwnProperty(o)?r[o]+=1:r[o]=1})});var i=Object.keys(r).sort(function(a,o){return r[o]-r[a]});return i.length<t?i:i.slice(0,t)};Uy.getAllSortProperties=wse;var _Wt=function(e,t){return t.map(function(r){return e.hasOwnProperty(r)?e[r]:0})},qUe=function(e){for(var t=wse(e),r=[],i=0;i<e.length;i++)r[i]=_Wt(e[i].properties,t);return r};Uy.getPropertyWeight=qUe;var ZUe=function(e,t){t===void 0&&(t=void 0);var r=[];return e.forEach(function(i){t===void 0&&r.push(i),i[t]!==void 0&&r.push(i[t])}),r};Uy.getAllProperties=ZUe;var xWt={getAllSortProperties:wse,getPropertyWeight:qUe,getAllProperties:ZUe};Uy.default=xWt;var Vy={},j3={};Object.defineProperty(j3,"__esModule",{value:!0});j3.DistanceType=void 0;var dee;j3.DistanceType=dee;(function(n){n.EuclideanDistance="euclideanDistance"})(dee||(j3.DistanceType=dee={}));Object.defineProperty(Vy,"__esModule",{value:!0});Vy.oneHot=Vy.getDistance=Vy.getAllKeyValueMap=Vy.default=void 0;var GSe=$3,zSe=j3,USe=SWt(H3);function SWt(n){return n&&n.__esModule?n:{default:n}}var bse=function(e,t,r){var i=[];t!=null&&t.length?i=t:(e.forEach(function(o){i=i.concat(Object.keys(o))}),i=(0,GSe.uniq)(i));var a={};return i.forEach(function(o){var s=[];e.forEach(function(l){l[o]!==void 0&&l[o]!==""&&s.push(l[o])}),s.length&&!(r!=null&&r.includes(o))&&(a[o]=(0,GSe.uniq)(s))}),a};Vy.getAllKeyValueMap=bse;var KUe=function(e,t,r){var i=bse(e,t,r),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(l){return l.every(function(u){return typeof u=="number"})});return e.forEach(function(l,u){var h=[];Object.keys(i).forEach(function(c){var f=l[c],d=i[c],v=d.findIndex(function(m){return f===m}),p=[];if(s)p.push(f);else for(var g=0;g<d.length;g++)g===v?p.push(1):p.push(0);h=h.concat(p)}),a[u]=h}),a};Vy.oneHot=KUe;var JUe=function(e,t,r,i){r===void 0&&(r=zSe.DistanceType.EuclideanDistance);var a=0;switch(r){case zSe.DistanceType.EuclideanDistance:a=new USe.default(e).euclideanDistance(new USe.default(t));break}return a};Vy.getDistance=JUe;var wWt={getAllKeyValueMap:bse,oneHot:KUe,getDistance:JUe};Vy.default=wWt;Object.defineProperty(YU,"__esModule",{value:!0});YU.default=void 0;var bWt=$3,EWt=QUe(aT),SP=QUe(H3),TWt=Uy,CWt=Vy;function QUe(n){return n&&n.__esModule?n:{default:n}}var VSe=function(e,t,r,i){for(var a=t.length,o=2*i,s=0,l=0;l<a;l++)for(var u=e[l].clusterId,h=0;h<a;h++){var c=e[h].clusterId;if(u===c){var f=t[l][h]||0,d=r[l]||0,v=r[h]||0;s+=f-d*v/o}}return s*=1/o,s},GX=function(e,t){e===void 0&&(e=[]);for(var r=e.length,i=new SP.default([]),a=0;a<r;a++)i=i.add(new SP.default(t[a]));var o=i.avg(r);o.normalize();for(var s=0,a=0;a<r;a++){var l=new SP.default(t[a]),u=l.squareEuclideanDistance(o);s+=u}var h=[];e.forEach(function(){h.push([])});for(var a=0;a<r;a++){var l=new SP.default(t[a]);e[a].clusterInertial=0;for(var c=0;c<r;c++){if(a===c){h[a][c]=0;continue}var f=new SP.default(t[c]);h[a][c]=l.squareEuclideanDistance(f),e[a].clusterInertial+=h[a][c]}}for(var d=0,v=2*r*s,a=0;a<r;a++)for(var p=e[a].clusterId,c=0;c<r;c++){var g=e[c].clusterId;if(!(a===c||p!==g)){var m=e[a].clusterInertial*e[c].clusterInertial/Math.pow(v,2)-h[a][c]/v;d+=m}}return Number(d.toFixed(4))},AWt=function(e,t,r,i,a,o,s,l,u){t===void 0&&(t=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),l===void 0&&(l=["id"]),u===void 0&&(u=1);var h=e.nodes,c=h===void 0?[]:h,f=e.edges,d=f===void 0?[]:f,v=[];if(a){c.forEach(function(z,V){z.properties=z.properties||{},z.originIndex=V});var p=[];c.every(function(z){return z.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(z){return z.nodeType}))),c.forEach(function(z){z.properties.nodeType=p.findIndex(function(V){return V===z.nodeType})}));var g=(0,TWt.getAllProperties)(c,o);v=(0,CWt.oneHot)(g,s,l)}var m=1,y={},_={};c.forEach(function(z,V){var q=String(m++);z.clusterId=q,y[q]={id:q,nodes:[z]},_[z.id]={node:z,idx:V}});var x=(0,EWt.default)(e,t),S=[],w={},b=0;x.forEach(function(z,V){var q=0,Y=c[V].id;w[Y]={},z.forEach(function(le,j){if(!!le){q+=le;var Q=c[j].id;w[Y][Q]=le,b+=le}}),S.push(q)}),b/=2;for(var E=1/0,T=1/0,C=0,A=[],M={};;){a&&c.every(function(z){return z.hasOwnProperty("properties")})?E=VSe(c,x,S,b)+GX(c,v)*u:E=VSe(c,x,S,b),C===0&&(T=E,A=c,M=y);var I=E>0&&E>T&&E-T<i;if(E>T&&(A=c.map(function(z){return{node:z,clusterId:z.clusterId}}),M=(0,bWt.clone)(y),T=E),I||C>100)break;C++,Object.keys(y).forEach(function(z){var V=0;d.forEach(function(q){var Y=q.source,le=q.target,j=_[Y].node.clusterId,Q=_[le].node.clusterId;(j===z&&Q!==z||Q===z&&j!==z)&&(V=V+(q[r]||1))}),y[z].sumTot=V}),c.forEach(function(z,V){var q=y[z.clusterId],Y=0,le,j=S[V]/(2*b),Q=0,ie=q.nodes;ie.forEach(function(st){var Nt=_[st.id].idx;Q+=x[V][Nt]||0});var oe=Q-q.sumTot*j,se=ie.filter(function(st){return st.id!==z.id});se.forEach(function(st,Nt){v[st.originIndex]});var me=GX(se,v)*u,Ce=w[z.id];if(Object.keys(Ce).forEach(function(st){var Nt=_[st].node,Zt=Nt.clusterId;if(Zt!==z.clusterId){var qe=y[Zt],ur=qe.nodes;if(!(!ur||!ur.length)){var Dt=0;ur.forEach(function(Tt){var Qe=_[Tt.id].idx;Dt+=x[V][Qe]||0});var ft=Dt-qe.sumTot*j,Oe=ur.concat([z]);Oe.forEach(function(Tt,Qe){v[Tt.originIndex]});var J=GX(Oe,v)*u,We=ft-oe;a&&(We=ft+J-(oe+me)),We>Y&&(Y=We,le=qe)}}}),Y>0){le.nodes.push(z);var Le=z.clusterId;z.clusterId=le.id;var re=q.nodes.indexOf(z);q.nodes.splice(re,1);var yt=0,je=0;d.forEach(function(st){var Nt=st.source,Zt=st.target,qe=_[Nt].node.clusterId,ur=_[Zt].node.clusterId;(qe===le.id&&ur!==le.id||ur===le.id&&qe!==le.id)&&(yt=yt+(st[r]||1)),(qe===Le&&ur!==Le||ur===Le&&qe!==Le)&&(je=je+(st[r]||1))}),le.sumTot=yt,q.sumTot=je}})}var R={},k=0;Object.keys(M).forEach(function(z){var V=M[z];if(!V.nodes||!V.nodes.length){delete M[z];return}var q=String(k+1);q!==z&&(V.id=q,V.nodes=V.nodes.map(function(Y){return{id:Y.id,clusterId:q}}),M[q]=V,R[z]=q,delete M[z],k++)}),A.forEach(function(z){var V=z.node,q=z.clusterId;!V||(V.clusterId=q,V.clusterId&&R[V.clusterId]&&(V.clusterId=R[V.clusterId]))});var D=[],G={};d.forEach(function(z){var V=z.source,q=z.target,Y=z[r]||1,le=_[V].node.clusterId,j=_[q].node.clusterId;if(!(!le||!j)){var Q="".concat(le,"---").concat(j);if(G[Q])G[Q].weight+=Y,G[Q].count++;else{var ie={source:le,target:j,weight:Y,count:1};G[Q]=ie,D.push(ie)}}});var W=[];return Object.keys(M).forEach(function(z){W.push(M[z])}),{clusters:W,clusterEdges:D}},MWt=AWt;YU.default=MWt;var qU={},ZU={};Object.defineProperty(ZU,"__esModule",{value:!0});ZU.default=void 0;var IWt=function(){function n(e){this.count=e.length,this.parent={};for(var t=0,r=e;t<r.length;t++){var i=r[t];this.parent[i]=i}}return n.prototype.find=function(e){for(;this.parent[e]!==e;)e=this.parent[e];return e},n.prototype.union=function(e,t){var r=this.find(e),i=this.find(t);r!==i&&(r<i?(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]):(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]))},n.prototype.connected=function(e,t){return this.find(e)===this.find(t)},n}(),LWt=IWt;ZU.default=LWt;var KU={};Object.defineProperty(KU,"__esModule",{value:!0});KU.default=void 0;var PWt=function(e,t){return e-t},OWt=function(){function n(e){e===void 0&&(e=PWt),this.compareFn=e,this.list=[]}return n.prototype.getLeft=function(e){return 2*e+1},n.prototype.getRight=function(e){return 2*e+2},n.prototype.getParent=function(e){return e===0?null:Math.floor((e-1)/2)},n.prototype.isEmpty=function(){return this.list.length<=0},n.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},n.prototype.delMin=function(){var e=this.top(),t=this.list.pop();return this.list.length>0&&(this.list[0]=t,this.moveDown(0)),e},n.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},n.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var r=this.list[t];this.list[t]=this.list[e],this.list[e]=r,e=t,t=this.getParent(e)}},n.prototype.moveDown=function(e){var t,r=e,i=this.getLeft(e),a=this.getRight(e),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[r],this.list[i])>0?r=i:a!==null&&a<o&&this.compareFn(this.list[r],this.list[a])>0&&(r=a),e!==r&&(t=[this.list[r],this.list[e]],this.list[e]=t[0],this.list[r]=t[1],this.moveDown(r))},n}(),RWt=OWt;KU.default=RWt;Object.defineProperty(qU,"__esModule",{value:!0});qU.default=void 0;var DWt=eVe(ZU),NWt=eVe(KU),zX=Du;function eVe(n){return n&&n.__esModule?n:{default:n}}var kWt=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=a[0],u=new Set;u.add(l);var h=function(g,m){return t?g.weight-m.weight:0},c=new NWt.default(h);for((0,zX.getEdgesByNodeId)(l.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var f=c.delMin(),d=f.source,v=f.target;u.has(d)&&u.has(v)||(r.push(f),u.has(d)||(u.add(d),(0,zX.getEdgesByNodeId)(d,s).forEach(function(p){c.insert(p)})),u.has(v)||(u.add(v),(0,zX.getEdgesByNodeId)(v,s).forEach(function(p){c.insert(p)})))}return r},$Se=function(e,t){var r=[],i=e.nodes,a=i===void 0?[]:i,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var l=s.map(function(d){return d});t&&l.sort(function(d,v){return d.weight-v.weight});for(var u=new DWt.default(a.map(function(d){return d.id}));l.length>0;){var h=l.shift(),c=h.source,f=h.target;u.connected(c,f)||(r.push(h),u.union(c,f))}return r},FWt=function(e,t,r){var i={prim:kWt,kruskal:$Se};return r?i[r](e,t):$Se(e,t)},BWt=FWt;qU.default=BWt;var JU={};Object.defineProperty(JU,"__esModule",{value:!0});JU.default=void 0;var GWt=UWt(q1),zWt=Du;function UWt(n){return n&&n.__esModule?n:{default:n}}var VWt=function(e,t,r){typeof t!="number"&&(t=1e-6),typeof r!="number"&&(r=.85);for(var i=1,a=0,o=1e3,s=e.nodes,l=s===void 0?[]:s,u=e.edges,h=u===void 0?[]:u,c=l.length,f,d={},v={},p=0;p<c;++p){var g=l[p],m=g.id;d[m]=1/c,v[m]=1/c}for(var y=(0,GWt.default)(e);o>0&&i>t;){a=0;for(var p=0;p<c;++p){var g=l[p],m=g.id;if(f=0,y[g.id].inDegree===0)d[m]=0;else{for(var _=(0,zWt.getNeighbors)(m,h,"source"),x=0;x<_.length;++x){var S=_[x],w=y[S].outDegree;w>0&&(f+=v[S]/w)}d[m]=r*f,a+=d[m]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=l[p],m=g.id;f=d[m]+a,i+=Math.abs(f-v[m]),v[m]=f}o-=1}return v},$Wt=VWt;JU.default=$Wt;var QU={},eV={},Iu={};Object.defineProperty(Iu,"__esModule",{value:!0});Iu.VACANT_NODE_LABEL=Iu.VACANT_NODE_ID=Iu.VACANT_GRAPH_ID=Iu.VACANT_EDGE_LABEL=Iu.VACANT_EDGE_ID=Iu.Node=Iu.Graph=Iu.Edge=Iu.AUTO_EDGE_ID=void 0;var tVe=-1;Iu.VACANT_EDGE_ID=tVe;var YD=-1;Iu.VACANT_NODE_ID=YD;var rVe="-1";Iu.VACANT_EDGE_LABEL=rVe;var nVe="-1";Iu.VACANT_NODE_LABEL=nVe;var WWt=-1;Iu.VACANT_GRAPH_ID=WWt;var HWt="-1";Iu.AUTO_EDGE_ID=HWt;var vee=function(){function n(e,t,r,i){e===void 0&&(e=tVe),t===void 0&&(t=YD),r===void 0&&(r=YD),i===void 0&&(i=rVe),this.id=e,this.from=t,this.to=r,this.label=i}return n}();Iu.Edge=vee;var iVe=function(){function n(e,t){e===void 0&&(e=YD),t===void 0&&(t=nVe),this.id=e,this.label=t,this.edges=[],this.edgeMap={}}return n.prototype.addEdge=function(e){this.edges.push(e),this.edgeMap[e.id]=e},n}();Iu.Node=iVe;var jWt=function(){function n(e,t,r){e===void 0&&(e=YD),t===void 0&&(t=!0),r===void 0&&(r=!1),this.id=e,this.edgeIdAutoIncrease=t,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=r}return n.prototype.getNodeNum=function(){return this.nodes.length},n.prototype.addNode=function(e,t){if(!this.nodeMap[e]){var r=new iVe(e,t);this.nodes.push(r),this.nodeMap[e]=r,this.nodeLabelMap[t]||(this.nodeLabelMap[t]=[]),this.nodeLabelMap[t].push(e)}},n.prototype.addEdge=function(e,t,r,i){if((this.edgeIdAutoIncrease||e===void 0)&&(e=this.counter++),!(this.nodeMap[t]&&this.nodeMap[r]&&this.nodeMap[r].edgeMap[e])){var a=new vee(e,t,r,i);if(this.edges.push(a),this.edgeMap[e]=a,this.nodeMap[t].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new vee(e,r,t,i);this.nodeMap[r].addEdge(o),this.edgeLabelMap[i].push(o)}}},n}();Iu.Graph=jWt;Object.defineProperty(eV,"__esModule",{value:!0});eV.default=void 0;var XWt=$3,fd=Iu,Bb=function(){function n(e,t,r,i,a){this.fromNode=e,this.toNode=t,this.nodeEdgeNodeLabel={nodeLabel1:r||fd.VACANT_NODE_LABEL,edgeLabel:i||fd.VACANT_EDGE_LABEL,nodeLabel2:a||fd.VACANT_NODE_LABEL}}return n.prototype.equalTo=function(e){return this.fromNode===e.formNode&&this.toNode===e.toNode&&this.nodeEdgeNodeLabel===e.nodeEdgeNodeLabel},n.prototype.notEqualTo=function(e){return!this.equalTo(e)},n}(),WSe=function(){function n(){this.rmpath=[],this.dfsEdgeList=[]}return n.prototype.equalTo=function(e){var t=this.dfsEdgeList.length,r=e.length;if(t!==r)return!1;for(var i=0;i<t;i++)if(this.dfsEdgeList[i]!==e[i])return!1;return!0},n.prototype.notEqualTo=function(e){return!this.equalTo(e)},n.prototype.pushBack=function(e,t,r,i,a){return this.dfsEdgeList.push(new Bb(e,t,r,i,a)),this.dfsEdgeList},n.prototype.toGraph=function(e,t){e===void 0&&(e=fd.VACANT_GRAPH_ID),t===void 0&&(t=!1);var r=new fd.Graph(e,!0,t);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,l=s.nodeLabel1,u=s.edgeLabel,h=s.nodeLabel2;l!==fd.VACANT_NODE_LABEL&&r.addNode(a,l),h!==fd.VACANT_NODE_LABEL&&r.addNode(o,h),l!==fd.VACANT_NODE_LABEL&&h!==l&&r.addEdge(void 0,a,o,u)}),r},n.prototype.buildRmpath=function(){this.rmpath=[];for(var e=void 0,t=this.dfsEdgeList.length,r=t-1;r>=0;r--){var i=this.dfsEdgeList[r],a=i.fromNode,o=i.toNode;a<o&&(e===void 0||o===e)&&(this.rmpath.push(r),e=a)}return this.rmpath},n.prototype.getNodeNum=function(){var e={};return this.dfsEdgeList.forEach(function(t){e[t.fromNode]||(e[t.fromNode]=!0),e[t.toNode]||(e[t.toNode]=!0)}),Object.keys(e).length},n}(),w5=function(){function n(e){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!e){for(;e;){var t=e.edge;this.edges.push(t),this.nodesUsed[t.from]=1,this.nodesUsed[t.to]=1,this.edgesUsed[t.id]=1,e=e.preNode}this.edges=this.edges.reverse()}}return n.prototype.hasNode=function(e){return this.nodesUsed[e.id]===1},n.prototype.hasEdge=function(e){return this.edgesUsed[e.id]===1},n}(),YWt=function(){function n(e){var t=e.graphs,r=e.minSupport,i=r===void 0?2:r,a=e.minNodeNum,o=a===void 0?1:a,s=e.maxNodeNum,l=s===void 0?4:s,u=e.top,h=u===void 0?10:u,c=e.directed,f=c===void 0?!1:c,d=e.verbose,v=d===void 0?!1:d;this.graphs=t,this.dfsCode=new WSe,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=h,this.directed=f,this.counter=0,this.maxNodeNum=l,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return n.prototype.findForwardRootEdges=function(e,t){var r=this,i=[],a=e.nodeMap;return t.edges.forEach(function(o){(r.directed||t.label<=a[o.to].label)&&i.push(o)}),i},n.prototype.findBackwardEdge=function(e,t,r,i){if(!this.directed&&t===r)return null;for(var a=e.nodeMap,o=a[r.to],s=o.edges,l=s.length,u=0;u<l;u++){var h=s[u];if(!(i.hasEdge(h)||h.to!==t.from)){if(this.directed){if(a[t.from].label<a[r.to].label||a[t.from].label===a[r.to].label&&t.label<=h.label)return h}else if(t.label<h.label||t.label===h.label&&a[t.to].label<=a[r.to].label)return h}}return null},n.prototype.findForwardPureEdges=function(e,t,r,i){for(var a=[],o=t.to,s=e.nodeMap[o].edges,l=s.length,u=0;u<l;u++){var h=s[u],c=e.nodeMap[h.to];r<=c.label&&!i.hasNode(c)&&a.push(h)}return a},n.prototype.findForwardRmpathEdges=function(e,t,r,i){for(var a=[],o=e.nodeMap,s=o[t.to].label,l=o[t.from],u=l.edges,h=u.length,c=0;c<h;c++){var f=u[c],d=o[f.to].label;t.to===f.to||r>d||i.hasNode(o[f.to])||(t.label<f.label||t.label===f.label&&s<=d)&&a.push(f)}return a},n.prototype.getSupport=function(e){var t={};return e.forEach(function(r){t[r.graphId]||(t[r.graphId]=!0)}),Object.keys(t).length},n.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(r){var i=e[r],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<t.nodeLabel1||a===t.nodeLabel1&&o<t.edgeLabel||a===t.nodeLabel1&&o===t.edgeLabel&&s<t.nodeLabel2)&&(t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),t},n.prototype.isMin=function(){var e=this,t=this.dfsCode;if(this.verbose&&console.log("isMin checking",t),t.dfsEdgeList.length===1)return!0;var r=this.directed,i=t.toGraph(fd.VACANT_GRAPH_ID,r),a=i.nodeMap,o=new WSe,s={};i.nodes.forEach(function(c){var f=e.findForwardRootEdges(i,c);f.forEach(function(d){var v=a[d.to],p="".concat(c.label,"-").concat(d.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:d.label,nodeLabel2:v.label});var g={graphId:i.id,edge:d,preNode:null};s[p].projected.push(g)})});var l=this.findMinLabel(s);if(!!l){o.dfsEdgeList.push(new Bb(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var u=function c(f){for(var d=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[d[0]].toNode,g={},m=!1,y=0,_=r?-1:0,x=function(G){if(m)return"break";f.forEach(function(W){var z=new w5(W),V=e.findBackwardEdge(i,z.edges[d[G]],z.edges[d[0]],z);V&&(g[V.label]||(g[V.label]={projected:[],edgeLabel:V.label}),g[V.label].projected.push({graphId:i.id,edge:g,preNode:W}),y=o.dfsEdgeList[d[G]].fromNode,m=!0)})},S=d.length-1;S>_;S--){var w=x(S);if(w==="break")break}if(m){var b=e.findMinLabel(g);o.dfsEdgeList.push(new Bb(p,y,fd.VACANT_NODE_LABEL,b.edgeLabel,fd.VACANT_NODE_LABEL));var E=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[E]!==o.dfsEdgeList[E]?!1:c(g[b.edgeLabel].projected)}var T={};m=!1;var C=0;f.forEach(function(D){var G=new w5(D),W=e.findForwardPureEdges(i,G.edges[d[0]],v,G);W.length>0&&(m=!0,C=p,W.forEach(function(z){var V="".concat(z.label,"-").concat(a[z.to].label);T[V]||(T[V]={projected:[],edgeLabel:z.label,nodeLabel2:a[z.to].label}),T[V].projected.push({graphId:i.id,edge:z,preNode:D})}))});for(var A=d.length,M=function(G){if(m)return"break";var W=d[G];f.forEach(function(z){var V=new w5(z),q=e.findForwardRmpathEdges(i,V.edges[W],v,V);q.length>0&&(m=!0,C=o.dfsEdgeList[W].fromNode,q.forEach(function(Y){var le="".concat(Y.label,"-").concat(a[Y.to].label);T[le]||(T[le]={projected:[],edgeLabel:Y.label,nodeLabel2:a[Y.to].label}),T[le].projected.push({graphId:i.id,edge:Y,preNode:z})}))})},S=0;S<A;S++){var I=M(S);if(I==="break")break}if(!m)return!0;var R=e.findMinLabel(T);o.dfsEdgeList.push(new Bb(C,p+1,fd.VACANT_NODE_LABEL,R.edgeLabel,R.nodeLabel2));var k=o.dfsEdgeList.length-1;return t.dfsEdgeList[k]!==o.dfsEdgeList[k]?!1:c(T["".concat(R.edgeLabel,"-").concat(R.nodeLabel2)].projected)},h="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return u(s[h].projected)}},n.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var e=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,XWt.clone)(e))}},n.prototype.subGraphMining=function(e){var t=this,r=this.getSupport(e);if(!(r<this.minSupport)&&!!this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},u={};e.forEach(function(h){for(var c=t.graphs[h.graphId],f=c.nodeMap,d=new w5(h),v=a.length-1;v>=0;v--){var p=t.findBackwardEdge(c,d.edges[a[v]],d.edges[a[0]],d);if(p){var g="".concat(t.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);u[g]||(u[g]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),u[g].projected.push({graphId:h.graphId,edge:p,preNode:h})}}if(!(i>=t.maxNodeNum)){var m=t.findForwardPureEdges(c,d.edges[a[0]],s,d);m.forEach(function(_){var x="".concat(o,"-").concat(_.label,"-").concat(f[_.to].label);l[x]||(l[x]={projected:[],fromNodeId:o,edgeLabel:_.label,nodeLabel2:f[_.to].label}),l[x].projected.push({graphId:h.graphId,edge:_,preNode:h})});for(var y=function(x){var S=t.findForwardRmpathEdges(c,d.edges[a[x]],s,d);S.forEach(function(w){var b="".concat(t.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(w.label,"-").concat(f[w.to].label);l[b]||(l[b]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:w.label,nodeLabel2:f[w.to].label}),l[b].projected.push({graphId:h.graphId,edge:w,preNode:h})})},v=0;v<a.length;v++)y(v)}}),Object.keys(u).forEach(function(h){var c=u[h],f=c.toNodeId,d=c.edgeLabel;t.dfsCode.dfsEdgeList.push(new Bb(o,f,"-1",d,"-1")),t.subGraphMining(u[h].projected),t.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(h){var c=l[h],f=c.fromNodeId,d=c.edgeLabel,v=c.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Bb(f,o+1,fd.VACANT_NODE_LABEL,d,v)),t.subGraphMining(l[h].projected),t.dfsCode.dfsEdgeList.pop()})}},n.prototype.generate1EdgeFrequentSubGraphs=function(){var e=this.graphs,t=this.directed,r=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(e).forEach(function(l){var u=e[l],h=u.nodeMap;u.nodes.forEach(function(c,f){var d=c.label,v="".concat(l,"-").concat(d);if(!s[v]){var p=a[d]||0;p++,a[d]=p}s[v]={graphKey:l,label:d},c.edges.forEach(function(g){var m=d,y=h[g.to].label;if(!t&&m>y){var _=y;y=m,m=_}var x=g.label,S="".concat(m,"-").concat(x,"-").concat(y);if(!o[S]){var w=o[S]||0;w++,o[S]=w}})})}),Object.keys(a).forEach(function(l){var u=a[l];if(!(u<r)){var h={nodes:[],edges:[]};h.nodes.push({id:"0",label:l}),i.push(h)}}),i},n.prototype.run=function(){var e=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var t=this.graphs;this.directed;var r={};Object.keys(t).forEach(function(i){var a=t[i],o=a.nodeMap;a.nodes.forEach(function(s){var l=e.findForwardRootEdges(a,s);l.forEach(function(u){var h=o[u.to],c="".concat(s.label,"-").concat(u.label,"-").concat(h.label);r[c]||(r[c]={projected:[],nodeLabel1:s.label,edgeLabel:u.label,nodeLabel2:h.label});var f={graphId:i,edge:u,preNode:null};r[c].projected.push(f)})})}),Object.keys(r).forEach(function(i){var a=r[i],o=a.projected,s=a.nodeLabel1,l=a.edgeLabel,u=a.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Bb(0,1,s,l,u)),e.subGraphMining(o),e.dfsCode.dfsEdgeList.pop()})}},n}(),qWt=function(e,t,r,i){var a={};return Object.keys(e).forEach(function(o,s){var l=e[o],u=new fd.Graph(s,!0,t),h={};l.nodes.forEach(function(c,f){u.addNode(f,c[r]),h[c.id]=f}),l.edges.forEach(function(c,f){var d=h[c.source],v=h[c.target];u.addEdge(-1,d,v,c[i])}),u&&u.getNodeNum()&&(a[u.id]=u)}),a},ZWt=function(e,t,r){var i=[];return e.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var l;o.nodes.push((l={id:"".concat(s.id)},l[t]=s.label,l))}),a.edges.forEach(function(s){var l;o.edges.push((l={source:"".concat(s.from),target:"".concat(s.to)},l[r]=s.label,l))}),i.push(o)}),i},HSe="cluster",KWt=function(e){var t=e.graphs,r=e.directed,i=r===void 0?!1:r,a=e.nodeLabelProp,o=a===void 0?HSe:a,s=e.edgeLabelProp,l=s===void 0?HSe:s,u=qWt(t,i,o,l),h=e.minSupport,c=e.maxNodeNum,f=e.minNodeNum,d=e.verbose,v=e.top,p={graphs:u,minSupport:h,maxNodeNum:c,minNodeNum:f,top:v,verbose:d,directed:i},g=new YWt(p);g.run();var m=ZWt(g.frequentSubgraphs,o,l);return m},JWt=KWt;eV.default=JWt;Object.defineProperty(QU,"__esModule",{value:!0});QU.default=void 0;var jSe=XUe,XSe=Ese(W3),QWt=Ese(eV),YSe=Ese(YI),eHt=Du;function Ese(n){return n&&n.__esModule?n:{default:n}}var qSe=function(e,t,r,i){r===void 0&&(r="cluster"),i===void 0&&(i=2);var a=[],o=e.nodes;return t.forEach(function(s,l){a.push(aVe(o,s,l,r,i))}),a},aVe=function(e,t,r,i,a){var o=[r],s=[],l={};return t.forEach(function(u,h){if(u<=a&&r!==h){o.push(h),s.push(e[h]);var c=e[h][i];l[c]?(l[c].count++,l[c].dists.push(u)):l[c]={count:1,dists:[u]}}}),Object.keys(l).forEach(function(u){l[u].dists=l[u].dists.sort(function(h,c){return h-c})}),{nodeIdx:r,nodeId:e[r].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:l}},tHt=function(e,t,r,i,a){var o=Math.ceil(r/t),s={},l=0;return i.forEach(function(u,h){for(var c=0,f=0,d=u.nodeIdxs,v=u.neighborNum-1;c<o;){for(var p=d[1+Math.floor(Math.random()*v)],g=0;(s["".concat(h,"-").concat(p)]||s["".concat(p,"-").concat(h)])&&(p=Math.floor(Math.random()*t),g++,!(g>2*t)););if(g<2*t&&(s["".concat(h,"-").concat(p)]={start:h,end:p,distance:a[h][p]},c++,l++,l>=r))return s;if(f++,f>2*t)break}if(c<o){var m=o-c;o=(o+m)/(t-h-1)}}),s},YB=function(e,t,r,i){var a=r.nodes;return i||(i={}),Object.keys(e).forEach(function(o){var s,l;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var u=e[o],h=(s=t[u.start])===null||s===void 0?void 0:s.nodeIdxs,c=(l=t[u.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!h||!c)){var f=new Set(c),d=h.filter(function(y){return f.has(y)});if(!(!d||!d.length)){for(var v={},p=d.length,g=0;g<p;g++){var m=a[d[g]];i[o].nodes.push(m),v[m.id]=!0}r.edges.forEach(function(y){v[y.source]&&v[y.target]&&i[o].edges.push(y)})}}}}),i},qB=function(e,t,r,i){var a,o,s={};e.nodes.forEach(function(u){s[u.id]=u});var l=0;return!(!((a=t==null?void 0:t.edges)===null||a===void 0)&&a.length)||((o=t==null?void 0:t.nodes)===null||o===void 0?void 0:o.length)<2?0:(e.edges.forEach(function(u){var h=s[u.source][r],c=s[u.target][r],f=t==null?void 0:t.nodes[0][r],d=t==null?void 0:t.nodes[1][r],v=t==null?void 0:t.edges[0][i];u[i]===v&&(h===f&&c===d||h===d&&c===f)&&l++}),l)},rHt=function(e,t,r){for(var i=1/0,a=0,o=function(u){var h=e[u],c=Object.keys(h).sort(function(y,_){return h[y]-h[_]}),f=10,d=[];c.forEach(function(y,_){d[_%f]||(d[_%f]={graphs:[],totalCount:0,aveCount:0}),d[_%f].graphs.push(y),d[_%f].totalCount+=h[y]});var v=0,p=[];d.forEach(function(y){var _=y.totalCount/y.graphs.length;y.aveCount=_,p.push(_);var x=0,S=y.length;y.graphs.forEach(function(w,b){var E=h[w];y.graphs.forEach(function(T,C){b!==C&&(x+=Math.abs(E-h[T]))})}),x/=S*(S-1)/2,v+=x}),v/=d.length;var g=0;p.forEach(function(y,_){p.forEach(function(x,S){_!==S&&(g+=Math.abs(y-x))}),g/=p.length*(p.length-1)/2});var m=g-v;i<m&&(i=m,a=u)},s=0;s<t;s++)o(s);return{structure:r[a],structureCountMap:e[a]}},ZSe=function(e,t){var r={},i={};return e.forEach(function(a,o){r[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[t];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:r,nodeLabelMap:i}},KSe=function(e,t,r){var i={},a={};return e.forEach(function(o,s){i["".concat(eHt.uniqueId)]={idx:s,edge:o};var l=o[t];a[l]||(a[l]=[]),a[l].push(o);var u=r[o.source];u&&(u.degree++,u.outDegree++);var h=r[o.target];h&&(h.degree++,h.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},JSe=function(e,t,r){var i=t.length,a={};return t.forEach(function(o,s){for(var l=r?0:s+1,u=e[s].id,h=l;h<i;h++)if(s!==h){var c=e[h].id,f=o[h];a["".concat(u,"-").concat(c)]=f,r||(a["".concat(c,"-").concat(u)]=f)}}),a},nHt=function(e,t,r,i,a,o,s,l,u,h,c){var f,d="".concat(t.id,"-").concat(r.id);if(h&&h[d])return h[d];var v=c?c[d]:void 0;if(!v){var p=(f={},f[d]={start:i[t.id].idx,end:i[r.id].idx,distance:a},f);c=YB(p,o,e,c),v=c[d]}return qB(v,s,l,u)},QSe=function(e,t,r,i){var a,o,s,l=(a=e[t])===null||a===void 0?void 0:a.degree,u=(o=e[t])===null||o===void 0?void 0:o.inDegree,h=(s=e[t])===null||s===void 0?void 0:s.outDegree;return e[t]===void 0&&(l=1/0,u=1/0,h=1/0,i[t].forEach(function(c){var f=r[c.id].degree;l>f&&(l=f);var d=r[c.id].inDegree;u>d&&(u=d);var v=r[c.id].outDegree;h>v&&(h=v)}),e[t]={degree:l,inDegree:u,outDegree:h}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:h}},iHt=function(e,t,r,i,a,o,s){var l;if(r===void 0&&(r=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var u=e.nodes.length;if(!!u){var h=(0,XSe.default)(e,r),c=(0,XSe.default)(t,r),f=JSe(e.nodes,h,r),d=JSe(t.nodes,c,r),v=ZSe(e.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,m=ZSe(t.nodes,o),y=m.nodeMap,_=m.nodeLabelMap;KSe(e.edges,s,p);var x=KSe(t.edges,s,y).edgeLabelMap,S=[];c==null||c.forEach(function(ft){S=S.concat(ft)}),a||(a=Math.max.apply(Math,(0,jSe.__spreadArray)((0,jSe.__spreadArray)([],S,!1),[2],!1))),i||(i=a);var w=qSe(e,h,o,i),b=qSe(t,c,o,i),E=Math.min(100,u*(u-1)/2),T=tHt(i,u,E,w,h),C=YB(T,w,e),A=10,M=1,I=1,R=4,k={graphs:C,nodeLabelProp:o,edgeLabelProp:s,minSupport:M,minNodeNum:I,maxNodeNum:R,directed:r},D=(0,QWt.default)(k).slice(0,A),G=D.length,W=[];D.forEach(function(ft,Oe){W[Oe]={},Object.keys(C).forEach(function(J){var We=C[J],Tt=qB(We,ft,o,s);W[Oe][J]=Tt})});var z=rHt(W,G,D),V=z.structure,q=z.structureCountMap,Y=t.nodes[0],le=[],j=(l=t.nodes[0])===null||l===void 0?void 0:l[o],Q=-1/0;t.nodes.forEach(function(ft){var Oe=ft[o],J=g[Oe];(J==null?void 0:J.length)>Q&&(Q=J.length,le=J,j=Oe,Y=ft)});var ie={},oe={},se={},me={},Ce={},Le={};Object.keys(_).forEach(function(ft,Oe){Ce[ft]=[],r&&(Le[ft]=[]);var J=_[ft],We={};J.forEach(function(wt){var pt=d["".concat(Y.id,"-").concat(wt.id)];if(pt&&Ce[ft].push(pt),We["".concat(Y.id,"-").concat(wt.id)]={start:0,end:y[wt.id].idx,distance:pt},r){var ar=d["".concat(wt.id,"-").concat(Y.id)];ar&&Le[ft].push(ar)}}),Ce[ft]=Ce[ft].sort(function(wt,pt){return wt-pt}),r&&(Le[ft]=Le[ft].sort(function(wt,pt){return wt-pt})),oe=YB(We,b,t,oe);var Tt=[];if(Object.keys(We).forEach(function(wt){if(se[wt]){Tt.push(se[wt]);return}var pt=oe[wt];se[wt]=qB(pt,V,o,s),Tt.push(se[wt])}),Tt=Tt.sort(function(wt,pt){return pt-wt}),me["".concat(Y.id,"-").concat(ft)]=Tt,ft!==j)for(var Qe=(le==null?void 0:le.length)||0,zt=function(pt){var ar=le[pt],kt=w[p[ar.id].idx],Dr=kt.nodeLabelCountMap[ft],Sr=_[ft].length;if(!Dr||Dr.count<Sr)return le.splice(pt,1),"continue";for(var jr=!1,pn=0;pn<Sr;pn++)if(Dr.dists[pn]>Ce[ft][pn]){jr=!0;break}if(jr)return le.splice(pt,1),"continue";var Jn={};kt.neighbors.forEach(function(yn){var Oi=f["".concat(ar.id,"-").concat(yn.id)];Jn["".concat(ar.id,"-").concat(yn.id)]={start:p[ar.id].idx,end:p[yn.id].idx,distance:Oi}}),C=YB(Jn,w,e,C);var Rn=[];Object.keys(Jn).forEach(function(yn){if(q[yn]){Rn.push(q[yn]);return}var Oi=C[yn];q[yn]=qB(Oi,V,o,s),Rn.push(q[yn])}),Rn=Rn.sort(function(yn,Oi){return Oi-yn});for(var hi=!1,pn=0;pn<Sr;pn++)if(Rn[pn]<Tt[pn]){hi=!0;break}if(hi)return le.splice(pt,1),"continue"},mt=Qe-1;mt>=0;mt--)zt(mt)});var re=[];le==null||le.forEach(function(ft){for(var Oe=p[ft.id].idx,J=aVe(e.nodes,h[Oe],Oe,o,a),We=J.neighbors,Tt=We.length,Qe=!1,zt=Tt-1;zt>=0;zt--){if(We.length+1<t.nodes.length){Qe=!0;return}var mt=We[zt],wt=mt[o];if(!_[wt]||!_[wt].length){We.splice(zt,1);continue}if(!Ce[wt]||!Ce[wt].length){We.splice(zt,1);continue}var pt="".concat(ft.id,"-").concat(mt.id),ar=f[pt],kt=Ce[wt].length-1,Dr=Ce[wt][kt];if(ar>Dr){We.splice(zt,1);continue}if(r){var Sr="".concat(mt.id,"-").concat(ft.id),jr=f[Sr];kt=Le[wt].length-1;var pn=Le[wt][kt];if(jr>pn){We.splice(zt,1);continue}}var Jn=q[pt]?q[pt]:nHt(e,ft,mt,p,ar,w,V,o,s,q,C),Rn="".concat(Y.id,"-").concat(wt),hi=me[Rn][me[Rn].length-1];if(Jn<hi){We.splice(zt,1);continue}var yn=QSe(ie,wt,y,_),Oi=yn.minPatternNodeLabelDegree;if(yn.minPatternNodeLabelInDegree,yn.minPatternNodeLabelOutDegree,p[mt.id].degree<Oi){We.splice(zt,1);continue}}Qe||re.push({nodes:[ft].concat(We)})});var yt=(0,YSe.default)(t,Y.id,!1).length,je={};r?(Object.keys(yt).forEach(function(ft){var Oe=y[ft].node[o];je[Oe]?je[Oe].push(yt[ft]):je[Oe]=[yt[ft]]}),Object.keys(je).forEach(function(ft){je[ft].sort(function(Oe,J){return Oe-J})})):je=Ce;for(var st=re.length,Nt=function(Oe){var J=re[Oe],We=J.nodes[0],Tt={},Qe={};J.nodes.forEach(function(ue,xe){Qe[ue.id]={idx:xe,node:ue,degree:0,inDegree:0,outDegree:0};var ce=ue[o];Tt[ce]?Tt[ce]++:Tt[ce]=1});var zt=[],mt={};e.edges.forEach(function(ue){Qe[ue.source]&&Qe[ue.target]&&(zt.push(ue),mt[ue[s]]?mt[ue[s]]++:mt[ue[s]]=1,Qe[ue.source].degree++,Qe[ue.target].degree++,Qe[ue.source].outDegree++,Qe[ue.target].inDegree++)});for(var wt=Object.keys(x).length,pt=!1,ar=0;ar<wt;ar++){var kt=Object.keys(x)[ar];if(!mt[kt]||mt[kt]<x[kt].length){pt=!0;break}}if(pt)return re.splice(Oe,1),"continue";var Dr=zt.length;if(Dr<t.edges.length)return re.splice(Oe,1),"break";for(var Sr=!1,jr=function(xe){var ce=zt[xe],pe=ce[s],we=x[pe];if(!we||!we.length)return mt[pe]--,we&&mt[pe]<we.length?(Sr=!0,"break"):(zt.splice(xe,1),Qe[ce.source].degree--,Qe[ce.target].degree--,Qe[ce.source].outDegree--,Qe[ce.target].inDegree--,"continue");var Me=Qe[ce.source].node[o],nt=Qe[ce.target].node[o],It=!1;if(we.forEach(function(ot){var ht=y[ot.source].node,ut=y[ot.target].node;ht[o]===Me&&ut[o]===nt&&(It=!0),!r&&ht[o]===nt&&ut[o]===Me&&(It=!0)}),!It)return mt[pe]--,we&&mt[pe]<we.length?(Sr=!0,"break"):(zt.splice(xe,1),Qe[ce.source].degree--,Qe[ce.target].degree--,Qe[ce.source].outDegree--,Qe[ce.target].inDegree--,"continue")},ar=Dr-1;ar>=0;ar--){var pn=jr(ar);if(pn==="break")break}if(Sr)return re.splice(Oe,1),"continue";J.edges=zt;var Jn=(0,YSe.default)(J,J.nodes[0].id,!1).length;if(Object.keys(Jn).reverse().forEach(function(ue){if(!(ue===J.nodes[0].id||Sr)){if(Jn[ue]===1/0){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0;return}var pe=p[ue].node[o];if(!je[pe]||!je[pe].length||Jn[ue]>je[pe][je[pe].length-1]){var xe=Qe[ue].node[o];if(Tt[xe]--,Tt[xe]<_[xe].length){Sr=!0;return}var ce=J.nodes.indexOf(Qe[ue].node);J.nodes.splice(ce,1),Qe[ue]=void 0}}}),Sr)return re.splice(Oe,1),"continue";for(var Rn=!0,hi=0;Rn&&!Sr;){Rn=!1;var yn=r?Qe[We.id].degree<y[Y.id].degree||Qe[We.id].inDegree<y[Y.id].inDegree||Qe[We.id].outDegree<y[Y.id].outDegree:Qe[We.id].degree<y[Y.id].degree;if(yn){Sr=!0;break}if(Tt[We[o]]<_[We[o]].length){Sr=!0;break}for(var Oi=J.nodes.length,oi=Oi-1;oi>=0;oi--){var Gi=J.nodes[oi],ws=Qe[Gi.id].degree,Sl=Qe[Gi.id].inDegree,Os=Qe[Gi.id].outDegree,no=Gi[o],vo=QSe(ie,no,y,_),No=vo.minPatternNodeLabelDegree,Jo=vo.minPatternNodeLabelInDegree,Lo=vo.minPatternNodeLabelOutDegree,hs=r?ws<No||Sl<Jo||Os<Lo:ws<No;if(hs){if(Tt[Gi[o]]--,Tt[Gi[o]]<_[Gi[o]].length){Sr=!0;break}J.nodes.splice(oi,1),Qe[Gi.id]=void 0,Rn=!0}}if(Sr||!Rn&&hi!==0)break;Dr=zt.length;for(var Rs=Dr-1;Rs>=0;Rs--){var Pn=zt[Rs];if(!Qe[Pn.source]||!Qe[Pn.target]){zt.splice(Rs,1);var mo=Pn[s];if(mt[mo]--,Qe[Pn.source]&&(Qe[Pn.source].degree--,Qe[Pn.source].outDegree--),Qe[Pn.target]&&(Qe[Pn.target].degree--,Qe[Pn.target].inDegree--),x[mo]&&mt[mo]<x[mo].length){Sr=!0;break}Rn=!0}}hi++}if(Sr||Sr||J.nodes.length<t.nodes.length||zt.length<t.edges.length)return re.splice(Oe,1),"continue"},Zt=st-1;Zt>=0;Zt--){var qe=Nt(Zt);if(qe==="break")break}for(var ur=re.length,Dt=function(Oe){var J=re[Oe],We={};J.edges.forEach(function(zt){var mt="".concat(zt.source,"-").concat(zt.target,"-").concat(zt.label);We[mt]?We[mt]++:We[mt]=1});for(var Tt=function(mt){var wt=re[mt],pt={};wt.edges.forEach(function(kt){var Dr="".concat(kt.source,"-").concat(kt.target,"-").concat(kt.label);pt[Dr]?pt[Dr]++:pt[Dr]=1});var ar=!0;Object.keys(pt).length!==Object.keys(We).length?ar=!1:Object.keys(We).forEach(function(kt){pt[kt]!==We[kt]&&(ar=!1)}),ar&&re.splice(mt,1)},Qe=ur-1;Qe>Oe;Qe--)Tt(Qe);ur=re.length},Zt=0;Zt<=ur-1;Zt++)Dt(Zt);return re}}},aHt=iHt;QU.default=aHt;(function(n){function e(x){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},e(x)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GADDI",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(n,"breadthFirstSearch",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"connectedComponent",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"depthFirstSearch",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"detectCycle",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"dijkstra",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"findAllPath",{enumerable:!0,get:function(){return u.findAllPath}}),Object.defineProperty(n,"findShortestPath",{enumerable:!0,get:function(){return u.findShortestPath}}),Object.defineProperty(n,"floydWarshall",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(n,"getAdjMatrix",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"getDegree",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"getInDegree",{enumerable:!0,get:function(){return a.getInDegree}}),Object.defineProperty(n,"getNeighbors",{enumerable:!0,get:function(){return g.getNeighbors}}),Object.defineProperty(n,"getOutDegree",{enumerable:!0,get:function(){return a.getOutDegree}}),Object.defineProperty(n,"labelPropagation",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"louvain",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(n,"minimumSpanningTree",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(n,"pageRank",{enumerable:!0,get:function(){return v.default}});var t=_(aT),r=_(WU),i=_(qS),a=y(q1),o=_(zy),s=_(jU),l=_(YI),u=MM,h=_(W3),c=_(XU),f=_(YU),d=_(qU),v=_(JU),p=_(QU),g=Du;function m(x){if(typeof WeakMap!="function")return null;var S=new WeakMap,w=new WeakMap;return(m=function(E){return E?w:S})(x)}function y(x,S){if(!S&&x&&x.__esModule)return x;if(x===null||e(x)!=="object"&&typeof x!="function")return{default:x};var w=m(S);if(w&&w.has(x))return w.get(x);var b={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in x)if(T!=="default"&&Object.prototype.hasOwnProperty.call(x,T)){var C=E?Object.getOwnPropertyDescriptor(x,T):null;C&&(C.get||C.set)?Object.defineProperty(b,T,C):b[T]=x[T]}return b.default=x,w&&w.set(x,b),b}function _(x){return x&&x.__esModule?x:{default:x}}})(FUe);function pee(n){return pee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pee(n)}Object.defineProperty($U,"__esModule",{value:!0});$U.default=void 0;var UX=oHt(FUe),ewe=YS;function oVe(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(oVe=function(i){return i?t:e})(n)}function oHt(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||pee(n)!=="object"&&typeof n!="function")return{default:n};var t=oVe(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var o=i?Object.getOwnPropertyDescriptor(n,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=n[a]}return r.default=n,t&&t.set(n,r),r}var VX=typeof self<"u"?self:{};VX.onmessage=function(n){var e=n.data,t=e._algorithmType,r=e.data;if(!!t){if(typeof UX[t]=="function"){var i=UX[t].apply(UX,r);VX.postMessage({_algorithmType:ewe.MESSAGE.SUCCESS,data:i});return}VX.postMessage({_algorithmType:ewe.MESSAGE.FAILURE})}};var sHt=null;$U.default=sHt;Object.defineProperty(VU,"__esModule",{value:!0});VU.default=void 0;var lHt=YS,uHt=hHt($U);function hHt(n){return n&&n.__esModule?n:{default:n}}var cHt=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new Promise(function(i,a){var o=new uHt.default;o.postMessage({_algorithmType:e,data:t}),o.onmessage=function(s){var l=s.data,u=l.data,h=l._algorithmType;lHt.MESSAGE.SUCCESS===h?i(u):a(),o.terminate()}})}},fHt=cHt;VU.default=fHt;Object.defineProperty(aa,"__esModule",{value:!0});aa.pageRankAsync=aa.minimumSpanningTreeAsync=aa.louvainAsync=aa.labelPropagationAsync=aa.getOutDegreeAsync=aa.getNeighborsAsync=aa.getInDegreeAsync=aa.getDegreeAsync=aa.getAdjMatrixAsync=aa.floydWarshallAsync=aa.findShortestPathAsync=aa.findAllPathAsync=aa.dijkstraAsync=aa.detectCycleAsync=aa.detectAllUndirectedCycleAsync=aa.detectAllDirectedCycleAsync=aa.detectAllCyclesAsync=aa.connectedComponentAsync=aa.GADDIAsync=void 0;var gh=dHt(VU),yh=YS;function dHt(n){return n&&n.__esModule?n:{default:n}}var vHt=function(e,t){return(0,gh.default)(yh.ALGORITHM.getAdjMatrix).apply(void 0,[e,t])};aa.getAdjMatrixAsync=vHt;var pHt=function(e,t){return(0,gh.default)(yh.ALGORITHM.connectedComponent).apply(void 0,[e,t])};aa.connectedComponentAsync=pHt;var gHt=function(e){return(0,gh.default)(yh.ALGORITHM.getDegree)(e)};aa.getDegreeAsync=gHt;var yHt=function(e,t){return(0,gh.default)(yh.ALGORITHM.getInDegree)(e,t)};aa.getInDegreeAsync=yHt;var mHt=function(e,t){return(0,gh.default)(yh.ALGORITHM.getOutDegree)(e,t)};aa.getOutDegreeAsync=mHt;var _Ht=function(e){return(0,gh.default)(yh.ALGORITHM.detectCycle)(e)};aa.detectCycleAsync=_Ht;var xHt=function(e){return(0,gh.default)(yh.ALGORITHM.detectAllCycles)(e)};aa.detectAllCyclesAsync=xHt;var SHt=function(e){return(0,gh.default)(yh.ALGORITHM.detectAllDirectedCycle)(e)};aa.detectAllDirectedCycleAsync=SHt;var wHt=function(e){return(0,gh.default)(yh.ALGORITHM.detectAllUndirectedCycle)(e)};aa.detectAllUndirectedCycleAsync=wHt;var bHt=function(e,t,r,i){return(0,gh.default)(yh.ALGORITHM.dijkstra).apply(void 0,[e,t,r,i])};aa.dijkstraAsync=bHt;var EHt=function(e,t,r,i){return(0,gh.default)(yh.ALGORITHM.findAllPath).apply(void 0,[e,t,r,i])};aa.findAllPathAsync=EHt;var THt=function(e,t,r,i,a){return(0,gh.default)(yh.ALGORITHM.findShortestPath).apply(void 0,[e,t,r,i,a])};aa.findShortestPathAsync=THt;var CHt=function(e,t){return(0,gh.default)(yh.ALGORITHM.floydWarshall).apply(void 0,[e,t])};aa.floydWarshallAsync=CHt;var AHt=function(e,t,r,i){return i===void 0&&(i=1e3),(0,gh.default)(yh.ALGORITHM.labelPropagation)(e,t,r,i)};aa.labelPropagationAsync=AHt;var MHt=function(e,t,r,i){return(0,gh.default)(yh.ALGORITHM.louvain)(e,t,r,i)};aa.louvainAsync=MHt;var IHt=function(e,t,r){return(0,gh.default)(yh.ALGORITHM.minimumSpanningTree).apply(void 0,[e,t,r])};aa.minimumSpanningTreeAsync=IHt;var LHt=function(e,t,r){return(0,gh.default)(yh.ALGORITHM.pageRank).apply(void 0,[e,t,r])};aa.pageRankAsync=LHt;var PHt=function(e,t,r){return(0,gh.default)(yh.ALGORITHM.getNeighbors).apply(void 0,[e,t,r])};aa.getNeighborsAsync=PHt;var OHt=function(e,t,r,i,a,o,s){return r===void 0&&(r=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),(0,gh.default)(yh.ALGORITHM.GADDI).apply(void 0,[e,t,r,i,a,o,s])};aa.GADDIAsync=OHt;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GADDIAsync",{enumerable:!0,get:function(){return e.GADDIAsync}}),Object.defineProperty(n,"connectedComponentAsync",{enumerable:!0,get:function(){return e.connectedComponentAsync}}),n.default=void 0,Object.defineProperty(n,"detectAllCyclesAsync",{enumerable:!0,get:function(){return e.detectAllCyclesAsync}}),Object.defineProperty(n,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return e.detectAllDirectedCycleAsync}}),Object.defineProperty(n,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return e.detectAllUndirectedCycleAsync}}),Object.defineProperty(n,"detectCycleAsync",{enumerable:!0,get:function(){return e.detectCycleAsync}}),n.detectDirectedCycleAsync=void 0,Object.defineProperty(n,"dijkstraAsync",{enumerable:!0,get:function(){return e.dijkstraAsync}}),Object.defineProperty(n,"findAllPathAsync",{enumerable:!0,get:function(){return e.findAllPathAsync}}),Object.defineProperty(n,"findShortestPathAsync",{enumerable:!0,get:function(){return e.findShortestPathAsync}}),Object.defineProperty(n,"floydWarshallAsync",{enumerable:!0,get:function(){return e.floydWarshallAsync}}),Object.defineProperty(n,"getAdjMatrixAsync",{enumerable:!0,get:function(){return e.getAdjMatrixAsync}}),Object.defineProperty(n,"getDegreeAsync",{enumerable:!0,get:function(){return e.getDegreeAsync}}),Object.defineProperty(n,"getInDegreeAsync",{enumerable:!0,get:function(){return e.getInDegreeAsync}}),Object.defineProperty(n,"getNeighborsAsync",{enumerable:!0,get:function(){return e.getNeighborsAsync}}),Object.defineProperty(n,"getOutDegreeAsync",{enumerable:!0,get:function(){return e.getOutDegreeAsync}}),Object.defineProperty(n,"labelPropagationAsync",{enumerable:!0,get:function(){return e.labelPropagationAsync}}),Object.defineProperty(n,"louvainAsync",{enumerable:!0,get:function(){return e.louvainAsync}}),Object.defineProperty(n,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return e.minimumSpanningTreeAsync}}),Object.defineProperty(n,"pageRankAsync",{enumerable:!0,get:function(){return e.pageRankAsync}});var e=aa,t=e.detectCycleAsync;n.detectDirectedCycleAsync=t;var r={getAdjMatrixAsync:e.getAdjMatrixAsync,connectedComponentAsync:e.connectedComponentAsync,getDegreeAsync:e.getDegreeAsync,getInDegreeAsync:e.getInDegreeAsync,getOutDegreeAsync:e.getOutDegreeAsync,detectCycleAsync:e.detectCycleAsync,detectDirectedCycleAsync:t,detectAllCyclesAsync:e.detectAllCyclesAsync,detectAllDirectedCycleAsync:e.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:e.detectAllUndirectedCycleAsync,dijkstraAsync:e.dijkstraAsync,findAllPathAsync:e.findAllPathAsync,findShortestPathAsync:e.findShortestPathAsync,floydWarshallAsync:e.floydWarshallAsync,labelPropagationAsync:e.labelPropagationAsync,louvainAsync:e.louvainAsync,minimumSpanningTreeAsync:e.minimumSpanningTreeAsync,pageRankAsync:e.pageRankAsync,getNeighborsAsync:e.getNeighborsAsync,GADDIAsync:e.GADDIAsync};n.default=r})(Sse);const RHt=Mrt(Sse),DHt=Grt({__proto__:null,default:RHt},[Sse]);function NHt(){return window?window.devicePixelRatio:1}function sVe(n,e,t,r){var i=n-t,a=e-r;return Math.sqrt(i*i+a*a)}function dE(n,e,t,r,i,a){return i>=n&&i<=n+t&&a>=e&&a<=e+r}function qD(n,e){return!(e.minX>n.maxX||e.maxX<n.minX||e.minY>n.maxY||e.maxY<n.minY)}function kHt(n,e){return!n||!e?n||e:{minX:Math.min(n.minX,e.minX),minY:Math.min(n.minY,e.minY),maxX:Math.max(n.maxX,e.maxX),maxY:Math.max(n.maxY,e.maxY)}}function twe(n,e){return n[0]===e[0]&&n[1]===e[1]}var FHt=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,BHt=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,GHt=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,lVe=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function uVe(n,e){var t=n.match(lVe);At(t,function(r){var i=r.split(":");e.addColorStop(i[0],i[1])})}function zHt(n,e,t){var r=FHt.exec(t),i=parseFloat(r[1])%360*(Math.PI/180),a=r[2],o=e.getBBox(),s,l;i>=0&&i<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=i&&i<Math.PI?(s={x:o.maxX,y:o.minY},l={x:o.minX,y:o.maxY}):Math.PI<=i&&i<3/2*Math.PI?(s={x:o.maxX,y:o.maxY},l={x:o.minX,y:o.minY}):(s={x:o.minX,y:o.maxY},l={x:o.maxX,y:o.minY});var u=Math.tan(i),h=u*u,c=(l.x-s.x+u*(l.y-s.y))/(h+1)+s.x,f=u*(l.x-s.x+u*(l.y-s.y))/(h+1)+s.y,d=n.createLinearGradient(s.x,s.y,c,f);return uVe(a,d),d}function UHt(n,e,t){var r=BHt.exec(t),i=parseFloat(r[1]),a=parseFloat(r[2]),o=parseFloat(r[3]),s=r[4];if(o===0){var l=s.match(lVe);return l[l.length-1].split(":")[1]}var u=e.getBBox(),h=u.maxX-u.minX,c=u.maxY-u.minY,f=Math.sqrt(h*h+c*c)/2,d=n.createRadialGradient(u.minX+h*i,u.minY+c*a,0,u.minX+h/2,u.minY+c/2,o*f);return uVe(s,d),d}function VHt(n,e,t){if(e.get("patternSource")&&e.get("patternSource")===t)return e.get("pattern");var r,i,a=GHt.exec(t),o=a[1],s=a[2];function l(){r=n.createPattern(i,o),e.set("pattern",r),e.set("patternSource",t)}switch(o){case"a":o="repeat";break;case"x":o="repeat-x";break;case"y":o="repeat-y";break;case"n":o="no-repeat";break;default:o="no-repeat"}return i=new Image,s.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=s,i.complete?l():(i.onload=l,i.src=i.src),r}function $Ht(n,e,t){var r=e.getBBox();if(isNaN(r.x)||isNaN(r.y)||isNaN(r.width)||isNaN(r.height))return t;if(rr(t)){if(t[1]==="("||t[2]==="("){if(t[0]==="l")return zHt(n,e,t);if(t[0]==="r")return UHt(n,e,t);if(t[0]==="p")return VHt(n,e,t)}return t}if(t instanceof CanvasPattern)return t}function WHt(n){var e=0,t=0,r=0,i=0;return vn(n)?n.length===1?e=t=r=i=n[0]:n.length===2?(e=r=n[0],t=i=n[1]):n.length===3?(e=n[0],t=i=n[1],r=n[2]):(e=n[0],t=n[1],r=n[2],i=n[3]):e=t=r=i=n,[e,t,r,i]}function b5(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function gee(n,e){return b5(n)*b5(e)?(n[0]*e[0]+n[1]*e[1])/(b5(n)*b5(e)):1}function rwe(n,e){return(n[0]*e[1]<n[1]*e[0]?-1:1)*Math.acos(gee(n,e))}function nwe(n,e){var t=e[1],r=e[2],i=DU(NU(e[3]),Math.PI*2),a=e[4],o=e[5],s=n[0],l=n[1],u=e[6],h=e[7],c=Math.cos(i)*(s-u)/2+Math.sin(i)*(l-h)/2,f=-1*Math.sin(i)*(s-u)/2+Math.cos(i)*(l-h)/2,d=c*c/(t*t)+f*f/(r*r);d>1&&(t*=Math.sqrt(d),r*=Math.sqrt(d));var v=t*t*(f*f)+r*r*(c*c),p=v?Math.sqrt((t*t*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var g=r?p*t*f/r:0,m=t?p*-r*c/t:0,y=(s+u)/2+Math.cos(i)*g-Math.sin(i)*m,_=(l+h)/2+Math.sin(i)*g+Math.cos(i)*m,x=[(c-g)/t,(f-m)/r],S=[(-1*c-g)/t,(-1*f-m)/r],w=rwe([1,0],x),b=rwe(x,S);return gee(x,S)<=-1&&(b=Math.PI),gee(x,S)>=1&&(b=0),o===0&&b>0&&(b=b-2*Math.PI),o===1&&b<0&&(b=b+2*Math.PI),{cx:y,cy:_,rx:twe(n,[u,h])?0:t,ry:twe(n,[u,h])?0:r,startAngle:w,endAngle:w+b,xRotation:i,arcFlag:a,sweepFlag:o}}var b9=Math.sin,E9=Math.cos,Tse=Math.atan2,E5=Math.PI;function hVe(n,e,t,r,i,a,o){var s=e.stroke,l=e.lineWidth,u=t-i,h=r-a,c=Tse(h,u),f=new Ise({type:"path",canvas:n.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*E9(E5/6)+","+10*b9(E5/6)+" L0,0 L"+10*E9(E5/6)+",-"+10*b9(E5/6),stroke:s,lineWidth:l}});f.translate(i,a),f.rotateAtPoint(i,a,c),n.set(o?"startArrowShape":"endArrowShape",f)}function cVe(n,e,t,r,i,a,o){var s=e.startArrow,l=e.endArrow,u=e.stroke,h=e.lineWidth,c=o?s:l,f=c.d,d=c.fill,v=c.stroke,p=c.lineWidth,g=rh(c,["d","fill","stroke","lineWidth"]),m=t-i,y=r-a,_=Tse(y,m);f&&(i=i-E9(_)*f,a=a-b9(_)*f);var x=new Ise({type:"path",canvas:n.get("canvas"),isArrowShape:!0,attrs:ve(ve({},g),{stroke:v||u,lineWidth:p||h,fill:d})});x.translate(i,a),x.rotateAtPoint(i,a,_),n.set(o?"startArrowShape":"endArrowShape",x)}function kE(n,e,t,r,i){var a=Tse(r-e,t-n);return{dx:E9(a)*i,dy:b9(a)*i}}function Cse(n,e,t,r,i,a){typeof e.startArrow=="object"?cVe(n,e,t,r,i,a,!0):e.startArrow?hVe(n,e,t,r,i,a,!0):n.set("startArrowShape",null)}function Ase(n,e,t,r,i,a){typeof e.endArrow=="object"?cVe(n,e,t,r,i,a,!1):e.endArrow?hVe(n,e,t,r,i,a,!1):n.set("startArrowShape",null)}var iwe={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function LM(n,e){var t=e.attr();for(var r in t){var i=t[r],a=iwe[r]?iwe[r]:r;a==="matrix"&&i?n.transform(i[0],i[1],i[3],i[4],i[6],i[7]):a==="lineDash"&&n.setLineDash?vn(i)&&n.setLineDash(i):(a==="strokeStyle"||a==="fillStyle"?i=$Ht(n,e,i):a==="globalAlpha"&&(i=i*n.globalAlpha),n[a]=i)}}function yee(n,e,t){for(var r=0;r<e.length;r++){var i=e[r];i.cfg.visible?i.draw(n,t):i.skipDraw()}}function HHt(n,e,t){var r=n.get("refreshElements");At(r,function(i){if(i!==n)for(var a=i.cfg.parent;a&&a!==n&&!a.cfg.refresh;)a.cfg.refresh=!0,a=a.cfg.parent}),r[0]===n?Mse(e):mee(e,t)}function mee(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.cfg.visible)if(r.cfg.hasChanged)r.cfg.refresh=!0,r.isGroup()&&Mse(r.cfg.children);else if(r.cfg.refresh)r.isGroup()&&mee(r.cfg.children,e);else{var i=jHt(r,e);r.cfg.refresh=i,i&&r.isGroup()&&mee(r.cfg.children,e)}}}function fVe(n){for(var e=0;e<n.length;e++){var t=n[e];t.cfg.hasChanged=!1,t.isGroup()&&!t.destroyed&&fVe(t.cfg.children)}}function Mse(n,e){for(var t=0;t<n.length;t++){var r=n[t];!r.cfg.visible||(r.cfg.refresh=!0,r.isGroup()&&Mse(r.get("children")))}}function jHt(n,e){var t=n.cfg.cacheCanvasBBox,r=n.cfg.isInView&&t&&qD(t,e);return r}function dVe(n,e,t,r){var i=t.path,a=t.startArrow,o=t.endArrow;if(!!i){var s=[0,0],l=[0,0],u={dx:0,dy:0};e.beginPath();for(var h=0;h<i.length;h++){var c=i[h],f=c[0];if(h===0&&a&&a.d){var d=n.getStartTangent();u=kE(d[0][0],d[0][1],d[1][0],d[1][1],a.d)}else if(h===i.length-2&&i[h+1][0]==="Z"&&o&&o.d){var v=i[h+1];if(v[0]==="Z"){var d=n.getEndTangent();u=kE(d[0][0],d[0][1],d[1][0],d[1][1],o.d)}}else if(h===i.length-1&&o&&o.d&&i[0]!=="Z"){var d=n.getEndTangent();u=kE(d[0][0],d[0][1],d[1][0],d[1][1],o.d)}var p=u.dx,g=u.dy;switch(f){case"M":e.moveTo(c[1]-p,c[2]-g),l=[c[1],c[2]];break;case"L":e.lineTo(c[1]-p,c[2]-g);break;case"Q":e.quadraticCurveTo(c[1],c[2],c[3]-p,c[4]-g);break;case"C":e.bezierCurveTo(c[1],c[2],c[3],c[4],c[5]-p,c[6]-g);break;case"A":{var m=void 0;r?(m=r[h],m||(m=nwe(s,c),r[h]=m)):m=nwe(s,c);var y=m.cx,_=m.cy,x=m.rx,S=m.ry,w=m.startAngle,b=m.endAngle,E=m.xRotation,T=m.sweepFlag;if(e.ellipse)e.ellipse(y,_,x,S,E,w,b,1-T);else{var C=x>S?x:S,A=x>S?1:x/S,M=x>S?S/x:1;e.translate(y,_),e.rotate(E),e.scale(A,M),e.arc(0,0,C,w,b,1-T),e.scale(1/A,1/M),e.rotate(-E),e.translate(-y,-_)}break}case"Z":e.closePath();break}if(f==="Z")s=l;else{var I=c.length;s=[c[I-2],c[I-1]]}}}}function vVe(n,e){var t=n.get("canvas");t&&(e==="remove"&&(n._cacheCanvasBBox=n.get("cacheCanvasBBox")),n.get("hasChanged")||(n.set("hasChanged",!0),n.cfg.parent&&n.cfg.parent.get("hasChanged")||(t.refreshElement(n,e,t),t.get("autoDraw")&&t.draw())))}function XHt(n){var e;if(n.destroyed)e=n._cacheCanvasBBox;else{var t=n.get("cacheCanvasBBox"),r=t&&!!(t.width&&t.height),i=n.getCanvasBBox(),a=i&&!!(i.width&&i.height);r&&a?e=kHt(t,i):r?e=t:a&&(e=i)}return e}function YHt(n){if(!n.length)return null;var e=[],t=[],r=[],i=[];return At(n,function(a){var o=XHt(a);o&&(e.push(o.minX),t.push(o.minY),r.push(o.maxX),i.push(o.maxY))}),{minX:dm(e),minY:dm(t),maxX:fm(r),maxY:fm(i)}}function qHt(n,e){return!n||!e||!qD(n,e)?null:{minX:Math.max(n.minX,e.minX),minY:Math.max(n.minY,e.minY),maxX:Math.min(n.maxX,e.maxX),maxY:Math.min(n.maxY,e.maxY)}}var pVe=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){vVe(this,t)},e.prototype.getShapeBase=function(){return pne},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,r){r&&(t.save(),LM(t,r),r.createPath(t),t.restore(),t.clip(),r._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,r=[],i=[];At(t,function(f){var d=f.cfg.cacheCanvasBBox;d&&f.cfg.isInView&&(r.push(d.minX,d.maxX),i.push(d.minY,d.maxY))});var a=null;if(r.length){var o=dm(r),s=fm(r),l=dm(i),u=fm(i);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:u,width:s-o,height:u-l};var h=this.cfg.canvas;if(h){var c=h.getViewRange();this.set("isInView",qD(a,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,r){var i=this.cfg.children,a=r?this.cfg.refresh:!0;i.length&&a&&(t.save(),LM(t,this),this._applyClip(t,this.getClip()),yee(t,i,r),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(Zze),ZHt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return pne},e.prototype.getGroupBase=function(){return pVe},e.prototype.onCanvasChange=function(t){vVe(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),r=this.getHitLineWidth(),i=Qze(t),a=i(this),o=r/2,s=a.x-o,l=a.y-o,u=a.x+a.width+o,h=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+r,height:a.height+r,maxX:u,maxY:h}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,r){r&&(t.save(),LM(t,r),r.createPath(t),t.restore(),t.clip(),r._afterDraw())},e.prototype.draw=function(t,r){var i=this.cfg.clipShape;if(r){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!qD(r,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),LM(t,this),this._applyClip(t,i),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var r=this.getCanvasBBox(),i=qD(r,t);this.set("isInView",i),i?this.set("cacheCanvasBBox",r):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var r=this.attrs,i=r.lineWidth,a=r.opacity,o=r.strokeOpacity,s=r.fillOpacity;this.isFill()&&(!an(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&i>0&&(!an(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,r){var i=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,r,i,a,o)},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(Kze);const F0=ZHt;var KHt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr(),l=s.x,u=s.y,h=s.r,c=o/2,f=sVe(l,u,t,r);return a&&i?f<=h+c:a?f<=h:i?f>=h-c&&f<=h+c:!1},e.prototype.createPath=function(t){var r=this.attr(),i=r.x,a=r.y,o=r.r;t.beginPath(),t.arc(i,a,o,0,Math.PI*2,!1),t.closePath()},e}(F0);const JHt=KHt;function T5(n,e,t,r){return n/(t*t)+e/(r*r)}var QHt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr(),l=o/2,u=s.x,h=s.y,c=s.rx,f=s.ry,d=(t-u)*(t-u),v=(r-h)*(r-h);return a&&i?T5(d,v,c+l,f+l)<=1:a?T5(d,v,c,f)<=1:i?T5(d,v,c-l,f-l)>=1&&T5(d,v,c+l,f+l)<=1:!1},e.prototype.createPath=function(t){var r=this.attr(),i=r.x,a=r.y,o=r.rx,s=r.ry;if(t.beginPath(),t.ellipse)t.ellipse(i,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,u=o>s?1:o/s,h=o>s?s/o:1;t.save(),t.translate(i,a),t.scale(u,h),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},e}(F0);const ejt=QHt;function awe(n){return n instanceof HTMLElement&&rr(n.nodeName)&&n.nodeName.toUpperCase()==="CANVAS"}var tjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var r=this,i=this.attrs;if(rr(t)){var a=new Image;a.onload=function(){if(r.destroyed)return!1;r.attr("img",a),r.set("loading",!1),r._afterLoading();var o=r.get("callback");o&&o.call(r)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(i.width||(i.width=t.width),i.height||(i.height=t.height)):awe(t)&&(i.width||(i.width=Number(t.getAttribute("width"))),i.height||(i.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),t==="img"&&this._setImage(r)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var r=this.attr(),i=r.x,a=r.y,o=r.width,s=r.height,l=r.sx,u=r.sy,h=r.swidth,c=r.sheight,f=r.img;(f instanceof Image||awe(f))&&(!an(l)&&!an(u)&&!an(h)&&!an(c)?t.drawImage(f,l,u,h,c,i,a,o,s):t.drawImage(f,i,a,o,s))},e}(F0);const rjt=tjt;function oS(n,e,t,r,i,a,o){var s=Math.min(n,t),l=Math.max(n,t),u=Math.min(e,r),h=Math.max(e,r),c=i/2;return a>=s-c&&a<=l+c&&o>=u-c&&o<=h+c?Fh.pointToLine(n,e,t,r,a,o)<=i/2:!1}var njt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&Cse(this,t,a,o,r,i),l&&Ase(this,t,r,i,a,o)},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){if(!i||!o)return!1;var s=this.attr(),l=s.x1,u=s.y1,h=s.x2,c=s.y2;return oS(l,u,h,c,o,t,r)},e.prototype.createPath=function(t){var r=this.attr(),i=r.x1,a=r.y1,o=r.x2,s=r.y2,l=r.startArrow,u=r.endArrow,h={dx:0,dy:0},c={dx:0,dy:0};l&&l.d&&(h=kE(i,a,o,s,r.startArrow.d)),u&&u.d&&(c=kE(i,a,o,s,r.endArrow.d)),t.beginPath(),t.moveTo(i+h.dx,a+h.dy),t.lineTo(o-c.dx,s-c.dy)},e.prototype.afterDrawPath=function(t){var r=this.get("startArrowShape"),i=this.get("endArrowShape");r&&r.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),r=t.x1,i=t.y1,a=t.x2,o=t.y2;return Fh.length(r,i,a,o)},e.prototype.getPoint=function(t){var r=this.attr(),i=r.x1,a=r.y1,o=r.x2,s=r.y2;return Fh.pointAt(i,a,o,s,t)},e}(F0);const ijt=njt;var ajt={circle:function(n,e,t){return[["M",n-t,e],["A",t,t,0,1,0,n+t,e],["A",t,t,0,1,0,n-t,e]]},square:function(n,e,t){return[["M",n-t,e-t],["L",n+t,e-t],["L",n+t,e+t],["L",n-t,e+t],["Z"]]},diamond:function(n,e,t){return[["M",n-t,e],["L",n,e-t],["L",n+t,e],["L",n,e+t],["Z"]]},triangle:function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e+r],["L",n,e-r],["L",n+t,e+r],["Z"]]},"triangle-down":function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e-r],["L",n+t,e-r],["L",n,e+r],["Z"]]}},ojt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return an(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t=this.attr(),r=t.x,i=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if(nl(a))s=a,l=s(r,i,o),l=fUe(l);else{if(s=e.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(r,i,o)}return l},e.prototype.createPath=function(t){var r=this._getPath(),i=this.get("paramsCache");dVe(this,t,{path:r},i)},e.Symbols=ajt,e}(F0);const sjt=ojt;function gVe(n,e,t){var r=lUe();return n.createPath(r),r.isPointInPath(e,t)}var ljt=1e-6;function $X(n){return Math.abs(n)<ljt?0:n<0?-1:1}function ujt(n,e,t){return(t[0]-n[0])*(e[1]-n[1])===(e[0]-n[0])*(t[1]-n[1])&&Math.min(n[0],e[0])<=t[0]&&t[0]<=Math.max(n[0],e[0])&&Math.min(n[1],e[1])<=t[1]&&t[1]<=Math.max(n[1],e[1])}function yVe(n,e,t){var r=!1,i=n.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=n[a],s=n[(a+1)%i];if(ujt(o,s,[e,t]))return!0;$X(o[1]-t)>0!=$X(s[1]-t)>0&&$X(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function mO(n,e,t,r,i,a,o,s){var l=(Math.atan2(s-e,o-n)+Math.PI*2)%(Math.PI*2);if(l<r||l>i)return!1;var u={x:n+t*Math.cos(l),y:e+t*Math.sin(l)};return sVe(u.x,u.y,o,s)<=a/2}var hjt=sg;function cjt(n){for(var e=!1,t=n.length,r=0;r<t;r++){var i=n[r],a=i[0];if(a==="C"||a==="A"||a==="Q"){e=!0;break}}return e}function fjt(n,e,t,r,i){for(var a=!1,o=e/2,s=0;s<n.length;s++){var l=n[s],u=l.currentPoint,h=l.params,c=l.prePoint,f=l.box;if(!(f&&!dE(f.x-o,f.y-o,f.width+e,f.height+e,t,r))){switch(l.command){case"L":case"Z":a=oS(c[0],c[1],u[0],u[1],e,t,r);break;case"Q":var d=iUe.pointDistance(c[0],c[1],h[1],h[2],h[3],h[4],t,r);a=d<=e/2;break;case"C":var v=pR.pointDistance(c[0],c[1],h[1],h[2],h[3],h[4],h[5],h[6],t,r,i);a=v<=e/2;break;case"A":var p=l.arcParams,g=p.cx,m=p.cy,y=p.rx,_=p.ry,x=p.startAngle,S=p.endAngle,w=p.xRotation,b=[t,r,1],E=y>_?y:_,T=y>_?1:y/_,C=y>_?_/y:1,A=hjt(null,[["t",-g,-m],["r",-w],["s",1/T,1/C]]);FU(b,b,A),a=mO(0,0,E,x,S,e,b[0],b[1]);break}if(a)break}}return a}function djt(n){for(var e=n.length,t=[],r=[],i=[],a=0;a<e;a++){var o=n[a],s=o[0];s==="M"?(i.length&&(r.push(i),i=[]),i.push([o[1],o[2]])):s==="Z"?i.length&&(t.push(i),i=[]):i.push([o[1],o[2]])}return i.length>0&&r.push(i),{polygons:t,polylines:r}}const C5=ve({hasArc:cjt,extractPolygons:djt,isPointInStroke:fjt},vzt);function owe(n,e,t){for(var r=!1,i=0;i<n.length;i++){var a=n[i];if(r=yVe(a,e,t),r)break}return r}var vjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),t==="path"&&this._setPathArr(r),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=fUe(t);var r=C5.hasArc(t);this.set("hasArc",r),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=dUe(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t=this.attr(),r=t.startArrow,i=t.endArrow;if(r){var a=this.getStartTangent();Cse(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}if(i){var a=this.getEndTangent();Ase(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.getSegments(),l=this.get("hasArc"),u=!1;if(i){var h=this.getTotalLength();u=C5.isPointInStroke(s,o,t,r,h)}if(!u&&a)if(l)u=gVe(this,t,r);else{var c=this.attr("path"),f=C5.extractPolygons(c);u=owe(f.polygons,t,r)||owe(f.polylines,t,r)}return u},e.prototype.createPath=function(t){var r=this.attr(),i=this.get("paramsCache");dVe(this,t,r,i)},e.prototype.afterDrawPath=function(t){var r=this.get("startArrowShape"),i=this.get("endArrowShape");r&&r.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.get("totalLength");return an(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var r=this.get("tCache");r||(this._calculateCurve(),this._setTcache(),r=this.get("tCache"));var i,a,o=this.get("curve");if(!r||r.length===0)return o?{x:o[0][1],y:o[0][2]}:null;At(r,function(h,c){t>=h[0]&&t<=h[1]&&(i=(t-h[0])/(h[1]-h[0]),a=c)});var s=o[a];if(an(s)||an(a))return null;var l=s.length,u=o[a+1];return pR.pointAt(s[l-2],s[l-1],u[1],u[2],u[3],u[4],u[5],u[6],i)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",C5.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,r=0,i=[],a,o,s,l,u=this.get("curve");if(!!u){if(At(u,function(h,c){s=u[c+1],l=h.length,s&&(t+=pR.length(h[l-2],h[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}At(u,function(h,c){s=u[c+1],l=h.length,s&&(a=[],a[0]=r/t,o=pR.length(h[l-2],h[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),r+=o||0,a[1]=r/t,i.push(a))}),this.set("tCache",i)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),r;if(t.length>1){var i=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;r=[],o?(r.push([i[0]-o[0],i[1]-o[1]]),r.push([i[0],i[1]])):(r.push([a[0],a[1]]),r.push([i[0],i[1]]))}return r},e.prototype.getEndTangent=function(){var t=this.getSegments(),r=t.length,i;if(r>1){var a=t[r-2].currentPoint,o=t[r-1].currentPoint,s=t[r-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},e}(F0);const Ise=vjt;function mVe(n,e,t,r,i){var a=n.length;if(a<2)return!1;for(var o=0;o<a-1;o++){var s=n[o][0],l=n[o][1],u=n[o+1][0],h=n[o+1][1];if(oS(s,l,u,h,e,t,r))return!0}if(i){var c=n[0],f=n[a-1];if(oS(c[0],c[1],f[0],f[1],e,t,r))return!0}return!1}var pjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr().points,l=!1;return i&&(l=mVe(s,o,t,r,!0)),!l&&a&&(l=yVe(s,t,r)),l},e.prototype.createPath=function(t){var r=this.attr(),i=r.points;if(!(i.length<2)){t.beginPath();for(var a=0;a<i.length;a++){var o=i[a];a===0?t.moveTo(o[0],o[1]):t.lineTo(o[0],o[1])}t.closePath()}},e}(F0);const gjt=pjt;var yjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),this.setArrow(),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),r=this.attrs,i=r.points,a=r.startArrow,o=r.endArrow,s=i.length,l=i[0][0],u=i[0][1],h=i[s-1][0],c=i[s-1][1];a&&Cse(this,t,i[1][0],i[1][1],l,u),o&&Ase(this,t,i[s-2][0],i[s-2][1],h,c)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){if(!i||!o)return!1;var s=this.attr().points;return mVe(s,o,t,r,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var r=this.attr(),i=r.points,a=r.startArrow,o=r.endArrow,s=i.length;if(!(i.length<2)){var l=i[0][0],u=i[0][1],h=i[s-1][0],c=i[s-1][1];if(a&&a.d){var f=kE(l,u,i[1][0],i[1][1],a.d);l+=f.dx,u+=f.dy}if(o&&o.d){var f=kE(i[s-2][0],i[s-2][1],h,c,o.d);h-=f.dx,c-=f.dy}t.beginPath(),t.moveTo(l,u);for(var d=0;d<s-1;d++){var v=i[d];t.lineTo(v[0],v[1])}t.lineTo(h,c)}},e.prototype.afterDrawPath=function(t){var r=this.get("startArrowShape"),i=this.get("endArrowShape");r&&r.draw(t),i&&i.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr().points,r=this.get("totalLength");return an(r)?(this.set("totalLength",sUe.length(t)),this.get("totalLength")):r},e.prototype.getPoint=function(t){var r=this.attr().points,i=this.get("tCache");i||(this._setTcache(),i=this.get("tCache"));var a,o;return At(i,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Fh.pointAt(r[o][0],r[o][1],r[o+1][0],r[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var r=this.getTotalLength();if(!(r<=0)){var i=0,a=[],o,s;At(t,function(l,u){t[u+1]&&(o=[],o[0]=i/r,s=Fh.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/r,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,r=[];return r.push([t[1][0],t[1][1]]),r.push([t[0][0],t[0][1]]),r},e.prototype.getEndTangent=function(){var t=this.attr().points,r=t.length-1,i=[];return i.push([t[r-1][0],t[r-1][1]]),i.push([t[r][0],t[r][1]]),i},e}(F0);const mjt=yjt;function _jt(n,e,t,r,i,a,o){var s=i/2;return dE(n-s,e-s,t,i,a,o)||dE(n+t-s,e-s,i,r,a,o)||dE(n+s,e+r-s,t,i,a,o)||dE(n-s,e+s,i,r,a,o)}function xjt(n,e,t,r,i,a,o,s){return oS(n+i,e,n+t-i,e,a,o,s)||oS(n+t,e+i,n+t,e+r-i,a,o,s)||oS(n+t-i,e+r,n+i,e+r,a,o,s)||oS(n,e+r-i,n,e+i,a,o,s)||mO(n+t-i,e+i,i,1.5*Math.PI,2*Math.PI,a,o,s)||mO(n+t-i,e+r-i,i,0,.5*Math.PI,a,o,s)||mO(n+i,e+r-i,i,.5*Math.PI,Math.PI,a,o,s)||mO(n+i,e+i,i,Math.PI,1.5*Math.PI,a,o,s)}var Sjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,r,i,a,o){var s=this.attr(),l=s.x,u=s.y,h=s.width,c=s.height,f=s.radius;if(f){var v=!1;return i&&(v=xjt(l,u,h,c,f,o,t,r)),!v&&a&&(v=gVe(this,t,r)),v}else{var d=o/2;if(a&&i)return dE(l-d,u-d,h+d,c+d,t,r);if(a)return dE(l,u,h,c,t,r);if(i)return _jt(l,u,h,c,o,t,r)}},e.prototype.createPath=function(t){var r=this.attr(),i=r.x,a=r.y,o=r.width,s=r.height,l=r.radius;if(t.beginPath(),l===0)t.rect(i,a,o,s);else{var u=WHt(l),h=u[0],c=u[1],f=u[2],d=u[3];t.moveTo(i+h,a),t.lineTo(i+o-c,a),c!==0&&t.arc(i+o-c,a+c,c,-Math.PI/2,0),t.lineTo(i+o,a+s-f),f!==0&&t.arc(i+o-f,a+s-f,f,0,Math.PI/2),t.lineTo(i+d,a+s),d!==0&&t.arc(i+d,a+s-d,d,Math.PI/2,Math.PI),t.lineTo(i,a+h),h!==0&&t.arc(i+h,a+h,h,Math.PI,Math.PI*1.5),t.closePath()}},e}(F0);const wjt=Sjt;var bjt=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=hUe(t)},e.prototype._setText=function(t){var r=null;rr(t)&&t.indexOf(`
`)!==-1&&(r=t.split(`
`)),this.set("textArr",r)},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(r)},e.prototype._getSpaceingY=function(){var t=this.attrs,r=t.lineHeight,i=t.fontSize*1;return r?r-i:i*.14},e.prototype._drawTextArr=function(t,r,i){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,u=a.fontSize*1,h=this._getSpaceingY(),c=uUe(a.text,a.fontSize,a.lineHeight),f;At(r,function(d,v){f=l+v*(h+u)-c+u,o==="middle"&&(f+=c-u-(c-u)/2),o==="top"&&(f+=c-u),an(d)||(i?t.fillText(d,s,f):t.strokeText(d,s,f))})},e.prototype._drawText=function(t,r){var i=this.attr(),a=i.x,o=i.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,r);else{var l=i.text;an(l)||(r?t.fillText(l,a,o):t.strokeText(l,a,o))}},e.prototype.strokeAndFill=function(t){var r=this.attrs,i=r.lineWidth,a=r.opacity,o=r.strokeOpacity,s=r.fillOpacity;this.isStroke()&&i>0&&(!an(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!an(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(F0);const Ejt=bjt;function Tjt(n,e){if(e){var t=Rze(e);return cE(t,n)}return n}function _Ve(n,e,t){var r=n.getTotalMatrix();if(r){var i=Tjt([e,t,1],r),a=i[0],o=i[1];return[a,o]}return[e,t]}function swe(n,e,t){if(n.isCanvas&&n.isCanvas())return!0;if(!HQ(n)||n.cfg.isInView===!1)return!1;if(n.cfg.clipShape){var r=_Ve(n,e,t),i=r[0],a=r[1];if(n.isClipped(i,a))return!1}var o=n.cfg.cacheCanvasBBox||n.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function xVe(n,e,t){if(!swe(n,e,t))return null;for(var r=null,i=n.getChildren(),a=i.length,o=a-1;o>=0;o--){var s=i[o];if(s.isGroup())r=xVe(s,e,t);else if(swe(s,e,t)){var l=s,u=_Ve(s,e,t),h=u[0],c=u[1];l.isInShape(h,c)&&(r=s)}if(r)break}return r}var M1=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return pne},e.prototype.getGroupBase=function(){return pVe},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||NHt();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),r=t.getContext("2d");return this.set("context",r),t},e.prototype.setDOMSize=function(t,r){n.prototype.setDOMSize.call(this,t,r);var i=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*r,o>1&&i.scale(o,o)},e.prototype.clear=function(){n.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),r=this.get("el");t.clearRect(0,0,r.width,r.height)},e.prototype.getShape=function(t,r){var i;return this.get("quickHit")?i=xVe(this,t,r):i=n.prototype.getShape.call(this,t,r,null),i},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),r=this.getViewRange(),i;if(t.length&&t[0]===this)i=r;else if(i=YHt(t),i){i.minX=Math.floor(i.minX),i.minY=Math.floor(i.minY),i.maxX=Math.ceil(i.maxX),i.maxY=Math.ceil(i.maxY),i.maxY+=1;var a=this.get("clipView");a&&(i=qHt(i,r))}return i},e.prototype.refreshElement=function(t){var r=this.get("refreshElements");r.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(S9e(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),r=this.get("el"),i=this.getChildren();t.clearRect(0,0,r.width,r.height),LM(t,this),yee(t,i),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),r=this.get("refreshElements"),i=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),LM(t,this),HHt(this,i,a),yee(t,i,a),t.restore()):r.length&&fVe(r),At(r,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,r=this.get("drawFrame"),i=this.get("drawFrameCallback");r||(r=x9e(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null),i&&i()}),this.set("drawFrame",r))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(qze),_ee={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},Qa={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function $p(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function SVe(n){var e=_ee[n.type],t=n.getParent();if(!e)throw new Error("the type "+n.type+" is not supported by svg");var r=$p(e);if(n.get("id")&&(r.id=n.get("id")),n.set("el",r),n.set("attrs",{}),t){var i=t.get("el");i||(i=t.createDom(),t.set("el",i)),i.appendChild(r)}return r}function wVe(n,e){var t=n.get("el"),r=T9e(t.children).sort(e),i=document.createDocumentFragment();r.forEach(function(a){i.appendChild(a)}),t.appendChild(i)}function Cjt(n,e){var t=n.parentNode,r=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),i=r[e],a=r.indexOf(n);if(i){if(a>e)t.insertBefore(n,i);else if(a<e){var o=r[e+1];o?t.insertBefore(n,o):t.appendChild(n)}}else t.appendChild(n)}function Ajt(n,e){var t=n.cfg.el,r=n.attr(),i={dx:r.shadowOffsetX,dy:r.shadowOffsetY,blur:r.shadowBlur,color:r.shadowColor};if(!i.dx&&!i.dy&&!i.blur&&!i.color)t.removeAttribute("filter");else{var a=e.find("filter",i);a||(a=e.addShadow(i)),t.setAttribute("filter","url(#"+a+")")}}function X3(n){var e=n.attr().matrix;if(e){for(var t=n.cfg.el,r=[],i=0;i<9;i+=3)r.push(e[i]+","+e[i+1]);r=r.join(","),r.indexOf("NaN")===-1?t.setAttribute("transform","matrix("+r+")"):console.warn("invalid matrix:",e)}}function ZD(n,e){var t=n.getClip(),r=n.get("el");if(!t)r.removeAttribute("clip-path");else if(t&&!r.hasAttribute("clip-path")){SVe(t),t.createPath(e);var i=e.addClip(t);r.setAttribute("clip-path","url(#"+i+")")}}function bVe(n,e){e.forEach(function(t){t.draw(n)})}function EVe(n,e){var t=n.get("canvas");if(t&&t.get("autoDraw")){var r=t.get("context"),i=n.getParent(),a=i?i.getChildren():[t],o=n.get("el");if(e==="remove"){var s=n.get("isClipShape");if(s){var l=o&&o.parentNode,u=l&&l.parentNode;l&&u&&u.removeChild(l)}else o&&o.parentNode&&o.parentNode.removeChild(o)}else if(e==="show")o.setAttribute("visibility","visible");else if(e==="hide")o.setAttribute("visibility","hidden");else if(e==="zIndex")Cjt(o,a.indexOf(n));else if(e==="sort"){var h=n.get("children");h&&h.length&&wVe(n,function(c,f){return h.indexOf(c)-h.indexOf(f)?1:0})}else e==="clear"?o&&(o.innerHTML=""):e==="matrix"?X3(n):e==="clip"?ZD(n,r):e==="attr"||e==="add"&&n.draw(r)}}var TVe=function(n){Kn(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.isEntityGroup=function(){return!0},e.prototype.createDom=function(){var t=$p("g");this.set("el",t);var r=this.getParent();if(r){var i=r.get("el");i||(i=r.createDom(),r.set("el",i)),i.appendChild(t)}return t},e.prototype.afterAttrsChange=function(t){n.prototype.afterAttrsChange.call(this,t);var r=this.get("canvas");if(r&&r.get("autoDraw")){var i=r.get("context");this.createPath(i,t)}},e.prototype.onCanvasChange=function(t){EVe(this,t)},e.prototype.getShapeBase=function(){return gne},e.prototype.getGroupBase=function(){return e},e.prototype.draw=function(t){var r=this.getChildren(),i=this.get("el");this.get("destroyed")?i&&i.parentNode.removeChild(i):(i||this.createDom(),ZD(this,t),this.createPath(t),r.length&&bVe(t,r))},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){Qa[s]&&a.setAttribute(Qa[s],o)}),X3(this)},e}(Zze),Mjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="svg",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.afterAttrsChange=function(t){n.prototype.afterAttrsChange.call(this,t);var r=this.get("canvas");if(r&&r.get("autoDraw")){var i=r.get("context");this.draw(i,t)}},e.prototype.getShapeBase=function(){return gne},e.prototype.getGroupBase=function(){return TVe},e.prototype.onCanvasChange=function(t){EVe(this,t)},e.prototype.calculateBBox=function(){var t=this.get("el"),r=null;if(t)r=t.getBBox();else{var i=Qze(this.get("type"));i&&(r=i(this))}if(r){var a=r.x,o=r.y,s=r.width,l=r.height,u=this.getHitLineWidth(),h=u/2,c=a-h,f=o-h,d=a+s+h,v=o+l+h;return{x:c,y:f,minX:c,minY:f,maxX:d,maxY:v,width:s+u,height:l+u}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},e.prototype.isFill=function(){var t=this.attr(),r=t.fill,i=t.fillStyle;return(r||i||this.isClipShape())&&this.canFill},e.prototype.isStroke=function(){var t=this.attr(),r=t.stroke,i=t.strokeStyle;return(r||i)&&this.canStroke},e.prototype.draw=function(t,r){var i=this.get("el");this.get("destroyed")?i&&i.parentNode.removeChild(i):(i||SVe(this),ZD(this,t),this.createPath(t,r),this.shadow(t,r),this.strokeAndFill(t,r),this.transform(r))},e.prototype.createPath=function(t,r){},e.prototype.strokeAndFill=function(t,r){var i=r||this.attr(),a=i.fill,o=i.fillStyle,s=i.stroke,l=i.strokeStyle,u=i.fillOpacity,h=i.strokeOpacity,c=i.lineWidth,f=this.get("el");this.canFill&&(r?"fill"in i?this._setColor(t,"fill",a):"fillStyle"in i&&this._setColor(t,"fill",o):this._setColor(t,"fill",a||o),u&&f.setAttribute(Qa.fillOpacity,u)),this.canStroke&&c>0&&(r?"stroke"in i?this._setColor(t,"stroke",s):"strokeStyle"in i&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),h&&f.setAttribute(Qa.strokeOpacity,h),c&&f.setAttribute(Qa.lineWidth,c))},e.prototype._setColor=function(t,r,i){var a=this.get("el");if(!i){a.setAttribute(Qa[r],"none");return}if(i=i.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(i)){var o=t.find("gradient",i);o||(o=t.addGradient(i)),a.setAttribute(Qa[r],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(i)){var o=t.find("pattern",i);o||(o=t.addPattern(i)),a.setAttribute(Qa[r],"url(#"+o+")")}else a.setAttribute(Qa[r],i)},e.prototype.shadow=function(t,r){var i=this.attr(),a=r||i,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,u=a.shadowColor;(o||s||l||u)&&Ajt(this,t)},e.prototype.transform=function(t){var r=this.attr(),i=(t||r).matrix;i&&X3(this)},e.prototype.isInShape=function(t,r){return this.isPointInPath(t,r)},e.prototype.isPointInPath=function(t,r){var i=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=r+o.top,u=document.elementFromPoint(s,l);return!!(u&&u.isEqualNode(i))},e.prototype.getHitLineWidth=function(){var t=this.attrs,r=t.lineWidth,i=t.lineAppendWidth;return this.isStroke()?r+i:0},e}(Kze);const lg=Mjt;var Ijt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):Qa[s]&&a.setAttribute(Qa[s],o)})},e}(lg);const Ljt=Ijt;var Pjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");if(At(r||i,function(u,h){Qa[h]&&a.setAttribute(Qa[h],u)}),typeof i.html=="function"){var o=i.html.call(this,i);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=i.html},e}(lg);const Ojt=Pjt;var Rjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):Qa[s]&&a.setAttribute(Qa[s],o)})},e}(lg);const Djt=Rjt;var Njt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el");At(r||a,function(s,l){l==="img"?i._setImage(a.img):Qa[l]&&o.setAttribute(Qa[l],s)})},e.prototype.setAttr=function(t,r){this.attrs[t]=r,t==="img"&&this._setImage(r)},e.prototype._setImage=function(t){var r=this.attr(),i=this.get("el");if(rr(t))i.setAttribute("href",t);else if(t instanceof window.Image)r.width||(i.setAttribute("width",t.width),this.attr("width",t.width)),r.height||(i.setAttribute("height",t.height),this.attr("height",t.height)),i.setAttribute("href",t.src);else if(t instanceof HTMLElement&&rr(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")i.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),r.width||(i.setAttribute("width",""+t.width),this.attr("width",t.width)),r.height||(i.setAttribute("height",""+t.height),this.attr("height",t.height)),i.setAttribute("href",a.toDataURL())}},e}(lg);const kjt=Njt;var Fjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=Wh(o)?t.addArrow(i,Qa[s]):t.getDefaultArrow(i,Qa[s]);a.setAttribute(Qa[s],"url(#"+l+")")}else a.removeAttribute(Qa[s]);else Qa[s]&&a.setAttribute(Qa[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),r=t.x1,i=t.y1,a=t.x2,o=t.y2;return Fh.length(r,i,a,o)},e.prototype.getPoint=function(t){var r=this.attr(),i=r.x1,a=r.y1,o=r.x2,s=r.y2;return Fh.pointAt(i,a,o,s,t)},e}(lg);const Bjt=Fjt;var A5={circle:function(n,e,t){return[["M",n,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(n,e,t){return[["M",n-t,e-t],["L",n+t,e-t],["L",n+t,e+t],["L",n-t,e+t],["Z"]]},diamond:function(n,e,t){return[["M",n-t,e],["L",n,e-t],["L",n+t,e],["L",n,e+t],["Z"]]},triangle:function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e+r],["L",n,e-r],["L",n+t,e+r],["z"]]},triangleDown:function(n,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",n-t,e-r],["L",n+t,e-r],["L",n,e+r],["Z"]]}};const lwe={get:function(n){return A5[n]},register:function(n,e){A5[n]=e},remove:function(n){delete A5[n]},getAll:function(){return A5}};var Gjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var r=this.get("el");r.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return vn(t)?t.map(function(r){return r.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),r=t.x,i=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return nl(o)?s=o:s=lwe.get(o),s?s(r,i,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=lwe,e}(lg);const zjt=Gjt;var Ujt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el");At(r||a,function(s,l){if(l==="path"&&vn(s))o.setAttribute("d",i._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=Wh(s)?t.addArrow(a,Qa[l]):t.getDefaultArrow(a,Qa[l]);o.setAttribute(Qa[l],"url(#"+u+")")}else o.removeAttribute(Qa[l]);else Qa[l]&&o.setAttribute(Qa[l],s)})},e.prototype._formatPath=function(t){var r=t.map(function(i){return i.join(" ")}).join("");return~r.indexOf("NaN")?"":r},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var r=this.get("el"),i=this.getTotalLength();if(i===0)return null;var a=r?r.getPointAtLength(t*i):null;return a?{x:a.x,y:a.y}:null},e}(lg);const Vjt=Ujt;var $jt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="points"&&vn(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):Qa[s]&&a.setAttribute(Qa[s],o)})},e}(lg);const Wjt=$jt;var Hjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,r,i){n.prototype.onAttrChange.call(this,t,r,i),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,r){var i=this.attr(),a=this.get("el");At(r||i,function(o,s){s==="points"&&vn(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):Qa[s]&&a.setAttribute(Qa[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,r=this.get("totalLength");return an(r)?(this.set("totalLength",sUe.length(t)),this.get("totalLength")):r},e.prototype.getPoint=function(t){var r=this.attr().points,i=this.get("tCache");i||(this._setTcache(),i=this.get("tCache"));var a,o;return At(i,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Fh.pointAt(r[o][0],r[o][1],r[o+1][0],r[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var r=this.getTotalLength();if(!(r<=0)){var i=0,a=[],o,s;At(t,function(l,u){t[u+1]&&(o=[],o[0]=i/r,s=Fh.length(l[0],l[1],t[u+1][0],t[u+1][1]),i+=s,o[1]=i/r,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,r=[];return r.push([t[1][0],t[1][1]]),r.push([t[0][0],t[0][1]]),r},e.prototype.getEndTangent=function(){var t=this.attr().points,r=t.length-1,i=[];return i.push([t[r-1][0],t[r-1][1]]),i.push([t[r][0],t[r][1]]),i},e}(lg);const jjt=Hjt;function Xjt(n){var e=0,t=0,r=0,i=0;return vn(n)?n.length===1?e=t=r=i=n[0]:n.length===2?(e=r=n[0],t=i=n[1]):n.length===3?(e=n[0],t=i=n[1],r=n[2]):(e=n[0],t=n[1],r=n[2],i=n[3]):e=t=r=i=n,{r1:e,r2:t,r3:r,r4:i}}var Yjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];At(r||a,function(u,h){l.indexOf(h)!==-1&&!s?(o.setAttribute("d",i._assembleRect(a)),s=!0):l.indexOf(h)===-1&&Qa[h]&&o.setAttribute(Qa[h],u)})},e.prototype._assembleRect=function(t){var r=t.x,i=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+r+","+i+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=Xjt(s);vn(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var u=[["M "+(r+l.r1)+","+i],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return u.join(" ")},e}(lg);const qjt=Yjt;var uwe=.3,Zjt={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},Kjt={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},Jjt={left:"left",start:"left",center:"middle",right:"end",end:"end"},Qjt=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=n.prototype.getDefaultAttrs.call(this);return ve(ve({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,r){var i=this,a=this.attr(),o=this.get("el");this._setFont(),At(r||a,function(s,l){l==="text"?i._setText(""+s):l==="matrix"&&s?X3(i):Qa[l]&&o.setAttribute(Qa[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),r=this.attr(),i=r.textBaseline,a=r.textAlign,o=Oze();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",Kjt[i]||"alphabetic"):t.setAttribute("alignment-baseline",Zjt[i]||"baseline"),t.setAttribute("text-anchor",Jjt[a]||"left")},e.prototype._setText=function(t){var r=this.get("el"),i=this.attr(),a=i.x,o=i.textBaseline,s=o===void 0?"bottom":o;if(!t)r.innerHTML="";else if(~t.indexOf(`
`)){var l=t.split(`
`),u=l.length-1,h="";At(l,function(c,f){f===0?s==="alphabetic"?h+='<tspan x="'+a+'" dy="'+-u+'em">'+c+"</tspan>":s==="top"?h+='<tspan x="'+a+'" dy="0.9em">'+c+"</tspan>":s==="middle"?h+='<tspan x="'+a+'" dy="'+-(u-1)/2+'em">'+c+"</tspan>":s==="bottom"?h+='<tspan x="'+a+'" dy="-'+(u+uwe)+'em">'+c+"</tspan>":s==="hanging"&&(h+='<tspan x="'+a+'" dy="'+(-(u-1)-uwe)+'em">'+c+"</tspan>"):h+='<tspan x="'+a+'" dy="1em">'+c+"</tspan>"}),r.innerHTML=h}else r.innerHTML=t},e}(lg);const eXt=Qjt;var tXt=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,rXt=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,nXt=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function CVe(n){var e=n.match(nXt);if(!e)return"";var t="";return e.sort(function(r,i){return r=r.split(":"),i=i.split(":"),Number(r[0])-Number(i[0])}),At(e,function(r){r=r.split(":"),t+='<stop offset="'+r[0]+'" stop-color="'+r[1]+'"></stop>'}),t}function iXt(n,e){var t=tXt.exec(n),r=DU(NU(parseFloat(t[1])),Math.PI*2),i=t[2],a,o;r>=0&&r<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=r&&r<Math.PI?(a={x:1,y:0},o={x:0,y:1}):Math.PI<=r&&r<1.5*Math.PI?(a={x:1,y:1},o={x:0,y:0}):(a={x:0,y:1},o={x:1,y:0});var s=Math.tan(r),l=s*s,u=(o.x-a.x+s*(o.y-a.y))/(l+1)+a.x,h=s*(o.x-a.x+s*(o.y-a.y))/(l+1)+a.y;e.setAttribute("x1",a.x),e.setAttribute("y1",a.y),e.setAttribute("x2",u),e.setAttribute("y2",h),e.innerHTML=CVe(i)}function aXt(n,e){var t=rXt.exec(n),r=parseFloat(t[1]),i=parseFloat(t[2]),a=parseFloat(t[3]),o=t[4];e.setAttribute("cx",r),e.setAttribute("cy",i),e.setAttribute("r",a),e.innerHTML=CVe(o)}var oXt=function(){function n(e){this.cfg={};var t=null,r=vm("gradient_");return e.toLowerCase()[0]==="l"?(t=$p("linearGradient"),iXt(e,t)):(t=$p("radialGradient"),aXt(e,t)),t.setAttribute("id",r),this.el=t,this.id=r,this.cfg=e,this}return n.prototype.match=function(e,t){return this.cfg===t},n}(),sXt={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},lXt={x:"-40%",y:"-40%",width:"200%",height:"200%"},uXt=function(){function n(e){this.type="filter",this.cfg={},this.type="filter";var t=$p("filter");return At(lXt,function(r,i){t.setAttribute(i,r)}),this.el=t,this.id=vm("filter_"),this.el.id=this.id,this.cfg=e,this._parseShadow(e,t),this}return n.prototype.match=function(e,t){if(this.type!==e)return!1;var r=!0,i=this.cfg;return At(Object.keys(i),function(a){if(i[a]!==t[a])return r=!1,!1}),r},n.prototype.update=function(e,t){var r=this.cfg;return r[sXt[e]]=t,this._parseShadow(r,this.el),this},n.prototype._parseShadow=function(e,t){var r=`<feDropShadow
dx="`+(e.dx||0)+`"
dy="`+(e.dy||0)+`"
stdDeviation="`+(e.blur?e.blur/10:0)+`"
flood-color="`+(e.color?e.color:"#000")+`"
flood-opacity="`+(e.opacity?e.opacity:1)+`"
/>`;t.innerHTML=r},n}(),hwe=function(){function n(e,t){this.cfg={};var r=$p("marker"),i=vm("marker_");r.setAttribute("id",i);var a=$p("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),r.appendChild(a),r.setAttribute("overflow","visible"),r.setAttribute("orient","auto-start-reverse"),this.el=r,this.child=a,this.id=i;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return n.prototype.match=function(){return!1},n.prototype._setDefaultPath=function(e,t){var r=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),r.setAttribute("refX",""+10*Math.cos(Math.PI/6)),r.setAttribute("refY",""+5)},n.prototype._setMarker=function(e,t){var r=this.el,i=this.cfg.path,a=this.cfg.d;vn(i)&&(i=i.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",i),r.appendChild(t),a&&r.setAttribute("refX",""+a/e)},n.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},n}(),hXt=function(){function n(e){this.type="clip",this.cfg={};var t=$p("clipPath");this.el=t,this.id=vm("clip_"),t.id=this.id;var r=e.cfg.el;return t.appendChild(r),this.cfg=e,this}return n.prototype.match=function(){return!1},n.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},n}(),cXt=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,fXt=function(){function n(e){this.cfg={};var t=$p("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var r=$p("image");t.appendChild(r);var i=vm("pattern_");t.id=i,this.el=t,this.id=i,this.cfg=e;var a=cXt.exec(e),o=a[2];r.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return n.prototype.match=function(e,t){return this.cfg===t},n}(),dXt=function(){function n(e){var t=$p("defs"),r=vm("defs_");t.id=r,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return n.prototype.find=function(e,t){for(var r=this.children,i=null,a=0;a<r.length;a++)if(r[a].match(e,t)){i=r[a].id;break}return i},n.prototype.findById=function(e){for(var t=this.children,r=null,i=0;i<t.length;i++)if(t[i].id===e){r=t[i];break}return r},n.prototype.add=function(e){this.children.push(e),e.canvas=this.canvas,e.parent=this},n.prototype.getDefaultArrow=function(e,t){var r=e.stroke||e.strokeStyle;if(this.defaultArrow[r])return this.defaultArrow[r].id;var i=new hwe(e,t);return this.defaultArrow[r]=i,this.el.appendChild(i.el),this.add(i),i.id},n.prototype.addGradient=function(e){var t=new oXt(e);return this.el.appendChild(t.el),this.add(t),t.id},n.prototype.addArrow=function(e,t){var r=new hwe(e,t);return this.el.appendChild(r.el),this.add(r),r.id},n.prototype.addShadow=function(e){var t=new uXt(e);return this.el.appendChild(t.el),this.add(t),t.id},n.prototype.addPattern=function(e){var t=new fXt(e);return this.el.appendChild(t.el),this.add(t),t.id},n.prototype.addClip=function(e){var t=new hXt(e);return this.el.appendChild(t.el),this.add(t),t.id},n}(),yR=function(n){Kn(e,n);function e(t){return n.call(this,ve(ve({},t),{autoDraw:!0,renderer:"svg"}))||this}return e.prototype.getShapeBase=function(){return gne},e.prototype.getGroupBase=function(){return TVe},e.prototype.getShape=function(t,r,i){var a=i.target||i.srcElement;if(!_ee[a.tagName]){for(var o=a.parentNode;o&&!_ee[o.tagName];)o=o.parentNode;a=o}return this.find(function(s){return s.get("el")===a})},e.prototype.createDom=function(){var t=$p("svg"),r=new dXt(t);return t.setAttribute("width",""+this.get("width")),t.setAttribute("height",""+this.get("height")),this.set("context",r),t},e.prototype.onCanvasChange=function(t){var r=this.get("context"),i=this.get("el");if(t==="sort"){var a=this.get("children");a&&a.length&&wVe(this,function(s,l){return a.indexOf(s)-a.indexOf(l)?1:0})}else if(t==="clear"){if(i){i.innerHTML="";var o=r.el;o.innerHTML="",i.appendChild(o)}}else t==="matrix"?X3(this):t==="clip"?ZD(this,r):t==="changeSize"&&(i.setAttribute("width",""+this.get("width")),i.setAttribute("height",""+this.get("height")))},e.prototype.draw=function(){var t=this.get("context"),r=this.getChildren();ZD(this,t),r.length&&bVe(t,r)},e}(qze);function M5(n,e,t){if(n){if(typeof n.addEventListener=="function")return n.addEventListener(e,t,!1),{remove:function(){n.removeEventListener(e,t,!1)}};if(typeof n.attachEvent=="function")return n.attachEvent("on"+e,t),{remove:function(){n.detachEvent("on"+e,t)}}}}var _O,WX,AVe,xee;function vXt(){_O=document.createElement("table"),WX=document.createElement("tr"),AVe=/^\s*<(\w+|!)[^>]*>/,xee={tr:document.createElement("tbody"),tbody:_O,thead:_O,tfoot:_O,td:WX,th:WX,"*":document.createElement("div")}}function zs(n){_O||vXt();var e=AVe.test(n)&&RegExp.$1;(!e||!(e in xee))&&(e="*");var t=xee[e];n=typeof n=="string"?n.replace(/(^\s*)|(\s*$)/g,""):n,t.innerHTML=""+n;var r=t.childNodes[0];return r&&t.contains(r)&&t.removeChild(r),r}function Di(n,e){if(n)for(var t in e)e.hasOwnProperty(t)&&(n.style[t]=e[t]);return n}var MVe={exports:{}},IVe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},LVe={exports:{}},pXt=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},gXt=pXt,yXt=Array.prototype.concat,mXt=Array.prototype.slice,cwe=LVe.exports=function(e){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];gXt(a)?t=yXt.call(t,mXt.call(a)):t.push(a)}return t};cwe.wrap=function(n){return function(){return n(cwe(arguments))}};var mR=IVe,Y3=LVe.exports,PVe=Object.hasOwnProperty,OVe=Object.create(null);for(var HX in mR)PVe.call(mR,HX)&&(OVe[mR[HX]]=HX);var fv=MVe.exports={to:{},get:{}};fv.get=function(n){var e=n.substring(0,3).toLowerCase(),t,r;switch(e){case"hsl":t=fv.get.hsl(n),r="hsl";break;case"hwb":t=fv.get.hwb(n),r="hwb";break;default:t=fv.get.rgb(n),r="rgb";break}return t?{model:r,value:t}:null};fv.get.rgb=function(n){if(!n)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,l,u;if(s=n.match(t)){for(u=s[2],s=s[1],l=0;l<3;l++){var h=l*2;o[l]=parseInt(s.slice(h,h+2),16)}u&&(o[3]=parseInt(u,16)/255)}else if(s=n.match(e)){for(s=s[1],u=s[3],l=0;l<3;l++)o[l]=parseInt(s[l]+s[l],16);u&&(o[3]=parseInt(u+u,16)/255)}else if(s=n.match(r)){for(l=0;l<3;l++)o[l]=parseInt(s[l+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=n.match(i)){for(l=0;l<3;l++)o[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=n.match(a))?s[1]==="transparent"?[0,0,0,0]:PVe.call(mR,s[1])?(o=mR[s[1]],o[3]=1,o):null:null;for(l=0;l<3;l++)o[l]=wS(o[l],0,255);return o[3]=wS(o[3],0,1),o};fv.get.hsl=function(n){if(!n)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=n.match(e);if(t){var r=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=wS(parseFloat(t[2]),0,100),o=wS(parseFloat(t[3]),0,100),s=wS(isNaN(r)?1:r,0,1);return[i,a,o,s]}return null};fv.get.hwb=function(n){if(!n)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=n.match(e);if(t){var r=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=wS(parseFloat(t[2]),0,100),o=wS(parseFloat(t[3]),0,100),s=wS(isNaN(r)?1:r,0,1);return[i,a,o,s]}return null};fv.to.hex=function(){var n=Y3(arguments);return"#"+I5(n[0])+I5(n[1])+I5(n[2])+(n[3]<1?I5(Math.round(n[3]*255)):"")};fv.to.rgb=function(){var n=Y3(arguments);return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};fv.to.rgb.percent=function(){var n=Y3(arguments),e=Math.round(n[0]/255*100),t=Math.round(n[1]/255*100),r=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+e+"%, "+t+"%, "+r+"%)":"rgba("+e+"%, "+t+"%, "+r+"%, "+n[3]+")"};fv.to.hsl=function(){var n=Y3(arguments);return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};fv.to.hwb=function(){var n=Y3(arguments),e="";return n.length>=4&&n[3]!==1&&(e=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+e+")"};fv.to.keyword=function(n){return OVe[n.slice(0,3)]};function wS(n,e,t){return Math.min(Math.max(e,n),t)}function I5(n){var e=Math.round(n).toString(16).toUpperCase();return e.length<2?"0"+e:e}var Lse={exports:{}},FE=IVe,RVe={};for(var jX in FE)FE.hasOwnProperty(jX)&&(RVe[FE[jX]]=jX);var Ln=Lse.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var rd in Ln)if(Ln.hasOwnProperty(rd)){if(!("channels"in Ln[rd]))throw new Error("missing channels property: "+rd);if(!("labels"in Ln[rd]))throw new Error("missing channel labels property: "+rd);if(Ln[rd].labels.length!==Ln[rd].channels)throw new Error("channel and label counts mismatch: "+rd);var _Xt=Ln[rd].channels,xXt=Ln[rd].labels;delete Ln[rd].channels,delete Ln[rd].labels,Object.defineProperty(Ln[rd],"channels",{value:_Xt}),Object.defineProperty(Ln[rd],"labels",{value:xXt})}Ln.rgb.hsl=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.min(e,t,r),a=Math.max(e,t,r),o=a-i,s,l,u;return a===i?s=0:e===a?s=(t-r)/o:t===a?s=2+(r-e)/o:r===a&&(s=4+(e-t)/o),s=Math.min(s*60,360),s<0&&(s+=360),u=(i+a)/2,a===i?l=0:u<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,u*100]};Ln.rgb.hsv=function(n){var e,t,r,i,a,o=n[0]/255,s=n[1]/255,l=n[2]/255,u=Math.max(o,s,l),h=u-Math.min(o,s,l),c=function(f){return(u-f)/6/h+1/2};return h===0?i=a=0:(a=h/u,e=c(o),t=c(s),r=c(l),o===u?i=r-t:s===u?i=1/3+e-r:l===u&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,u*100]};Ln.rgb.hwb=function(n){var e=n[0],t=n[1],r=n[2],i=Ln.rgb.hsl(n)[0],a=1/255*Math.min(e,Math.min(t,r));return r=1-1/255*Math.max(e,Math.max(t,r)),[i,a*100,r*100]};Ln.rgb.cmyk=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i,a,o,s;return s=Math.min(1-e,1-t,1-r),i=(1-e-s)/(1-s)||0,a=(1-t-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function SXt(n,e){return Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2)}Ln.rgb.keyword=function(n){var e=RVe[n];if(e)return e;var t=1/0,r;for(var i in FE)if(FE.hasOwnProperty(i)){var a=FE[i],o=SXt(n,a);o<t&&(t=o,r=i)}return r};Ln.keyword.rgb=function(n){return FE[n]};Ln.rgb.xyz=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+t*.3576+r*.1805,a=e*.2126+t*.7152+r*.0722,o=e*.0193+t*.1192+r*.9505;return[i*100,a*100,o*100]};Ln.rgb.lab=function(n){var e=Ln.rgb.xyz(n),t=e[0],r=e[1],i=e[2],a,o,s;return t/=95.047,r/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(t-r),s=200*(r-i),[a,o,s]};Ln.hsl.rgb=function(n){var e=n[0]/360,t=n[1]/100,r=n[2]/100,i,a,o,s,l;if(t===0)return l=r*255,[l,l,l];r<.5?a=r*(1+t):a=r+t-r*t,i=2*r-a,s=[0,0,0];for(var u=0;u<3;u++)o=e+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[u]=l*255;return s};Ln.hsl.hsv=function(n){var e=n[0],t=n[1]/100,r=n[2]/100,i=t,a=Math.max(r,.01),o,s;return r*=2,t*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+t)/2,o=r===0?2*i/(a+i):2*t/(r+t),[e,o*100,s*100]};Ln.hsv.rgb=function(n){var e=n[0]/60,t=n[1]/100,r=n[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-t),s=255*r*(1-t*a),l=255*r*(1-t*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};Ln.hsv.hsl=function(n){var e=n[0],t=n[1]/100,r=n[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-t)*r,a=(2-t)*i,o=t*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};Ln.hwb.rgb=function(n){var e=n[0]/360,t=n[1]/100,r=n[2]/100,i=t+r,a,o,s,l;i>1&&(t/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,(a&1)!==0&&(s=1-s),l=t+s*(o-t);var u,h,c;switch(a){default:case 6:case 0:u=o,h=l,c=t;break;case 1:u=l,h=o,c=t;break;case 2:u=t,h=o,c=l;break;case 3:u=t,h=l,c=o;break;case 4:u=l,h=t,c=o;break;case 5:u=o,h=t,c=l;break}return[u*255,h*255,c*255]};Ln.cmyk.rgb=function(n){var e=n[0]/100,t=n[1]/100,r=n[2]/100,i=n[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};Ln.xyz.rgb=function(n){var e=n[0]/100,t=n[1]/100,r=n[2]/100,i,a,o;return i=e*3.2406+t*-1.5372+r*-.4986,a=e*-.9689+t*1.8758+r*.0415,o=e*.0557+t*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};Ln.xyz.lab=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;return e/=95.047,t/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*t-16,a=500*(e-t),o=200*(t-r),[i,a,o]};Ln.lab.xyz=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;a=(e+16)/116,i=t/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),u=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};Ln.lab.lch=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;return i=Math.atan2(r,t),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(t*t+r*r),[e,o,a]};Ln.lch.lab=function(n){var e=n[0],t=n[1],r=n[2],i,a,o;return o=r/360*2*Math.PI,i=t*Math.cos(o),a=t*Math.sin(o),[e,i,a]};Ln.rgb.ansi16=function(n){var e=n[0],t=n[1],r=n[2],i=1 in arguments?arguments[1]:Ln.rgb.hsv(n)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};Ln.hsv.ansi16=function(n){return Ln.rgb.ansi16(Ln.hsv.rgb(n),n[2])};Ln.rgb.ansi256=function(n){var e=n[0],t=n[1],r=n[2];if(e===t&&t===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5);return i};Ln.ansi16.rgb=function(n){var e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(n>50)+1)*.5,r=(e&1)*t*255,i=(e>>1&1)*t*255,a=(e>>2&1)*t*255;return[r,i,a]};Ln.ansi256.rgb=function(n){if(n>=232){var e=(n-232)*10+8;return[e,e,e]}n-=16;var t,r=Math.floor(n/36)/5*255,i=Math.floor((t=n%36)/6)/5*255,a=t%6/5*255;return[r,i,a]};Ln.rgb.hex=function(n){var e=((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};Ln.hex.rgb=function(n){var e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(s){return s+s}).join(""));var r=parseInt(t,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};Ln.rgb.hcg=function(n){var e=n[0]/255,t=n[1]/255,r=n[2]/255,i=Math.max(Math.max(e,t),r),a=Math.min(Math.min(e,t),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(t-r)/o%6:i===t?l=2+(r-e)/o:l=4+(e-t)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};Ln.hsl.hcg=function(n){var e=n[1]/100,t=n[2]/100,r=1,i=0;return t<.5?r=2*e*t:r=2*e*(1-t),r<1&&(i=(t-.5*r)/(1-r)),[n[0],r*100,i*100]};Ln.hsv.hcg=function(n){var e=n[1]/100,t=n[2]/100,r=e*t,i=0;return r<1&&(i=(t-r)/(1-r)),[n[0],r*100,i*100]};Ln.hcg.rgb=function(n){var e=n[0]/360,t=n[1]/100,r=n[2]/100;if(t===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-t)*r,[(t*i[0]+l)*255,(t*i[1]+l)*255,(t*i[2]+l)*255]};Ln.hcg.hsv=function(n){var e=n[1]/100,t=n[2]/100,r=e+t*(1-e),i=0;return r>0&&(i=e/r),[n[0],i*100,r*100]};Ln.hcg.hsl=function(n){var e=n[1]/100,t=n[2]/100,r=t*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[n[0],i*100,r*100]};Ln.hcg.hwb=function(n){var e=n[1]/100,t=n[2]/100,r=e+t*(1-e);return[n[0],(r-e)*100,(1-r)*100]};Ln.hwb.hcg=function(n){var e=n[1]/100,t=n[2]/100,r=1-t,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[n[0],i*100,a*100]};Ln.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};Ln.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};Ln.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};Ln.gray.hsl=Ln.gray.hsv=function(n){return[0,0,n[0]]};Ln.gray.hwb=function(n){return[0,100,n[0]]};Ln.gray.cmyk=function(n){return[0,0,0,n[0]]};Ln.gray.lab=function(n){return[n[0],0,0]};Ln.gray.hex=function(n){var e=Math.round(n[0]/100*255)&255,t=(e<<16)+(e<<8)+e,r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};Ln.rgb.gray=function(n){var e=(n[0]+n[1]+n[2])/3;return[e/255*100]};var T9=Lse.exports;function wXt(){for(var n={},e=Object.keys(T9),t=e.length,r=0;r<t;r++)n[e[r]]={distance:-1,parent:null};return n}function bXt(n){var e=wXt(),t=[n];for(e[n].distance=0;t.length;)for(var r=t.pop(),i=Object.keys(T9[r]),a=i.length,o=0;o<a;o++){var s=i[o],l=e[s];l.distance===-1&&(l.distance=e[r].distance+1,l.parent=r,t.unshift(s))}return e}function EXt(n,e){return function(t){return e(n(t))}}function TXt(n,e){for(var t=[e[n].parent,n],r=T9[e[n].parent][n],i=e[n].parent;e[i].parent;)t.unshift(e[i].parent),r=EXt(T9[e[i].parent][i],r),i=e[i].parent;return r.conversion=t,r}var CXt=function(n){for(var e=bXt(n),t={},r=Object.keys(e),i=r.length,a=0;a<i;a++){var o=r[a],s=e[o];s.parent!==null&&(t[o]=TXt(o,e))}return t},See=Lse.exports,AXt=CXt,HC={},MXt=Object.keys(See);function IXt(n){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),n(t))};return"conversion"in n&&(e.conversion=n.conversion),e}function LXt(n){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=n(t);if(typeof r=="object")for(var i=r.length,a=0;a<i;a++)r[a]=Math.round(r[a]);return r};return"conversion"in n&&(e.conversion=n.conversion),e}MXt.forEach(function(n){HC[n]={},Object.defineProperty(HC[n],"channels",{value:See[n].channels}),Object.defineProperty(HC[n],"labels",{value:See[n].labels});var e=AXt(n),t=Object.keys(e);t.forEach(function(r){var i=e[r];HC[n][r]=LXt(i),HC[n][r].raw=IXt(i)})});var PXt=HC,xO=MVe.exports,sv=PXt,Pse=[].slice,DVe=["keyword","gray","hex"],wee={};Object.keys(sv).forEach(function(n){wee[Pse.call(sv[n].labels).sort().join("")]=n});var C9={};function oc(n,e){if(!(this instanceof oc))return new oc(n,e);if(e&&e in DVe&&(e=null),e&&!(e in sv))throw new Error("Unknown model: "+e);var t,r;if(n==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(n instanceof oc)this.model=n.model,this.color=n.color.slice(),this.valpha=n.valpha;else if(typeof n=="string"){var i=xO.get(n);if(i===null)throw new Error("Unable to parse color from string: "+n);this.model=i.model,r=sv[this.model].channels,this.color=i.value.slice(0,r),this.valpha=typeof i.value[r]=="number"?i.value[r]:1}else if(n.length){this.model=e||"rgb",r=sv[this.model].channels;var a=Pse.call(n,0,r);this.color=bee(a,r),this.valpha=typeof n[r]=="number"?n[r]:1}else if(typeof n=="number")n&=16777215,this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(n);"alpha"in n&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);var s=o.sort().join("");if(!(s in wee))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=wee[s];var l=sv[this.model].labels,u=[];for(t=0;t<l.length;t++)u.push(n[l[t]]);this.color=bee(u)}if(C9[this.model])for(r=sv[this.model].channels,t=0;t<r;t++){var h=C9[this.model][t];h&&(this.color[t]=h(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}oc.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(n){var e=this.model in xO.to?this:this.rgb();e=e.round(typeof n=="number"?n:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return xO.to[e.model](t)},percentString:function(n){var e=this.rgb().round(typeof n=="number"?n:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return xO.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var n={},e=sv[this.model].channels,t=sv[this.model].labels,r=0;r<e;r++)n[t[r]]=this.color[r];return this.valpha!==1&&(n.alpha=this.valpha),n},unitArray:function(){var n=this.rgb().color;return n[0]/=255,n[1]/=255,n[2]/=255,this.valpha!==1&&n.push(this.valpha),n},unitObject:function(){var n=this.rgb().object();return n.r/=255,n.g/=255,n.b/=255,this.valpha!==1&&(n.alpha=this.valpha),n},round:function(n){return n=Math.max(n||0,0),new oc(this.color.map(RXt(n)).concat(this.valpha),this.model)},alpha:function(n){return arguments.length?new oc(this.color.concat(Math.max(0,Math.min(1,n))),this.model):this.valpha},red:Gl("rgb",0,Yu(255)),green:Gl("rgb",1,Yu(255)),blue:Gl("rgb",2,Yu(255)),hue:Gl(["hsl","hsv","hsl","hwb","hcg"],0,function(n){return(n%360+360)%360}),saturationl:Gl("hsl",1,Yu(100)),lightness:Gl("hsl",2,Yu(100)),saturationv:Gl("hsv",1,Yu(100)),value:Gl("hsv",2,Yu(100)),chroma:Gl("hcg",1,Yu(100)),gray:Gl("hcg",2,Yu(100)),white:Gl("hwb",1,Yu(100)),wblack:Gl("hwb",2,Yu(100)),cyan:Gl("cmyk",0,Yu(100)),magenta:Gl("cmyk",1,Yu(100)),yellow:Gl("cmyk",2,Yu(100)),black:Gl("cmyk",3,Yu(100)),x:Gl("xyz",0,Yu(100)),y:Gl("xyz",1,Yu(100)),z:Gl("xyz",2,Yu(100)),l:Gl("lab",0,Yu(100)),a:Gl("lab",1),b:Gl("lab",2),keyword:function(n){return arguments.length?new oc(n):sv[this.model].keyword(this.color)},hex:function(n){return arguments.length?new oc(n):xO.to.hex(this.rgb().round().color)},rgbNumber:function(){var n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity:function(){for(var n=this.rgb().color,e=[],t=0;t<n.length;t++){var r=n[t]/255;e[t]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(n){var e=this.luminosity(),t=n.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(n){var e=this.contrast(n);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var n=this.rgb().color,e=(n[0]*299+n[1]*587+n[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var n=this.rgb(),e=0;e<3;e++)n.color[e]=255-n.color[e];return n},lighten:function(n){var e=this.hsl();return e.color[2]+=e.color[2]*n,e},darken:function(n){var e=this.hsl();return e.color[2]-=e.color[2]*n,e},saturate:function(n){var e=this.hsl();return e.color[1]+=e.color[1]*n,e},desaturate:function(n){var e=this.hsl();return e.color[1]-=e.color[1]*n,e},whiten:function(n){var e=this.hwb();return e.color[1]+=e.color[1]*n,e},blacken:function(n){var e=this.hwb();return e.color[2]+=e.color[2]*n,e},grayscale:function(){var n=this.rgb().color,e=n[0]*.3+n[1]*.59+n[2]*.11;return oc.rgb(e,e,e)},fade:function(n){return this.alpha(this.valpha-this.valpha*n)},opaquer:function(n){return this.alpha(this.valpha+this.valpha*n)},rotate:function(n){var e=this.hsl(),t=e.color[0];return t=(t+n)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(n,e){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);var t=n.rgb(),r=this.rgb(),i=e===void 0?.5:e,a=2*i-1,o=t.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return oc.rgb(s*t.red()+l*r.red(),s*t.green()+l*r.green(),s*t.blue()+l*r.blue(),t.alpha()*i+r.alpha()*(1-i))}};Object.keys(sv).forEach(function(n){if(DVe.indexOf(n)===-1){var e=sv[n].channels;oc.prototype[n]=function(){if(this.model===n)return new oc(this);if(arguments.length)return new oc(arguments,n);var t=typeof arguments[e]=="number"?e:this.valpha;return new oc(DXt(sv[this.model][n].raw(this.color)).concat(t),n)},oc[n]=function(t){return typeof t=="number"&&(t=bee(Pse.call(arguments),e)),new oc(t,n)}}});function OXt(n,e){return Number(n.toFixed(e))}function RXt(n){return function(e){return OXt(e,n)}}function Gl(n,e,t){return n=Array.isArray(n)?n:[n],n.forEach(function(r){(C9[r]||(C9[r]=[]))[e]=t}),n=n[0],function(r){var i;return arguments.length?(t&&(r=t(r)),i=this[n](),i.color[e]=r,i):(i=this[n]().color[e],t&&(i=t(i)),i)}}function Yu(n){return function(e){return Math.max(0,Math.min(n,e))}}function DXt(n){return Array.isArray(n)?n:[n]}function bee(n,e){for(var t=0;t<e;t++)typeof n[t]!="number"&&(n[t]=0);return n}var _R=oc;function A9(n){return A9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A9(n)}var NXt=/^\s+/,kXt=/\s+$/;function On(n,e){if(n=n||"",e=e||{},n instanceof On)return n;if(!(this instanceof On))return new On(n,e);var t=FXt(n);this._originalInput=n,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}On.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t,r,i,a,o,s;return t=e.r/255,r=e.g/255,i=e.b/255,t<=.03928?a=t/12.92:a=Math.pow((t+.055)/1.055,2.4),r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(e){return this._a=NVe(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=dwe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=dwe(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+i+"%)":"hsva("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=fwe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=fwe(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+i+"%)":"hsla("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return vwe(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return UXt(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(hl(this._r,255)*100)+"%",g:Math.round(hl(this._g,255)*100)+"%",b:Math.round(hl(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(hl(this._r,255)*100)+"%, "+Math.round(hl(this._g,255)*100)+"%, "+Math.round(hl(this._b,255)*100)+"%)":"rgba("+Math.round(hl(this._r,255)*100)+"%, "+Math.round(hl(this._g,255)*100)+"%, "+Math.round(hl(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:QXt[vwe(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+pwe(this._r,this._g,this._b,this._a),r=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var a=On(e);r="#"+pwe(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,a=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return On(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(HXt,arguments)},brighten:function(){return this._applyModification(jXt,arguments)},darken:function(){return this._applyModification(XXt,arguments)},desaturate:function(){return this._applyModification(VXt,arguments)},saturate:function(){return this._applyModification($Xt,arguments)},greyscale:function(){return this._applyModification(WXt,arguments)},spin:function(){return this._applyModification(YXt,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(KXt,arguments)},complement:function(){return this._applyCombination(qXt,arguments)},monochromatic:function(){return this._applyCombination(JXt,arguments)},splitcomplement:function(){return this._applyCombination(ZXt,arguments)},triad:function(){return this._applyCombination(gwe,[3])},tetrad:function(){return this._applyCombination(gwe,[4])}};On.fromRatio=function(n,e){if(A9(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=SO(n[r]));n=t}return On(n,e)};function FXt(n){var e={r:0,g:0,b:0},t=1,r=null,i=null,a=null,o=!1,s=!1;return typeof n=="string"&&(n=nYt(n)),A9(n)=="object"&&(Qm(n.r)&&Qm(n.g)&&Qm(n.b)?(e=BXt(n.r,n.g,n.b),o=!0,s=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Qm(n.h)&&Qm(n.s)&&Qm(n.v)?(r=SO(n.s),i=SO(n.v),e=zXt(n.h,r,i),o=!0,s="hsv"):Qm(n.h)&&Qm(n.s)&&Qm(n.l)&&(r=SO(n.s),a=SO(n.l),e=GXt(n.h,r,a),o=!0,s="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=NVe(t),{ok:o,format:n.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function BXt(n,e,t){return{r:hl(n,255)*255,g:hl(e,255)*255,b:hl(t,255)*255}}function fwe(n,e,t){n=hl(n,255),e=hl(e,255),t=hl(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case n:a=(e-t)/l+(e<t?6:0);break;case e:a=(t-n)/l+2;break;case t:a=(n-e)/l+4;break}a/=6}return{h:a,s:o,l:s}}function GXt(n,e,t){var r,i,a;n=hl(n,360),e=hl(e,100),t=hl(t,100);function o(u,h,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?u+(h-u)*6*c:c<1/2?h:c<2/3?u+(h-u)*(2/3-c)*6:u}if(e===0)r=i=a=t;else{var s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=o(l,s,n+1/3),i=o(l,s,n),a=o(l,s,n-1/3)}return{r:r*255,g:i*255,b:a*255}}function dwe(n,e,t){n=hl(n,255),e=hl(e,255),t=hl(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),a,o,s=r,l=r-i;if(o=r===0?0:l/r,r==i)a=0;else{switch(r){case n:a=(e-t)/l+(e<t?6:0);break;case e:a=(t-n)/l+2;break;case t:a=(n-e)/l+4;break}a/=6}return{h:a,s:o,v:s}}function zXt(n,e,t){n=hl(n,360)*6,e=hl(e,100),t=hl(t,100);var r=Math.floor(n),i=n-r,a=t*(1-e),o=t*(1-i*e),s=t*(1-(1-i)*e),l=r%6,u=[t,o,a,a,s,t][l],h=[s,t,t,o,a,a][l],c=[a,a,s,t,t,o][l];return{r:u*255,g:h*255,b:c*255}}function vwe(n,e,t,r){var i=[a0(Math.round(n).toString(16)),a0(Math.round(e).toString(16)),a0(Math.round(t).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function UXt(n,e,t,r,i){var a=[a0(Math.round(n).toString(16)),a0(Math.round(e).toString(16)),a0(Math.round(t).toString(16)),a0(kVe(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function pwe(n,e,t,r){var i=[a0(kVe(r)),a0(Math.round(n).toString(16)),a0(Math.round(e).toString(16)),a0(Math.round(t).toString(16))];return i.join("")}On.equals=function(n,e){return!n||!e?!1:On(n).toRgbString()==On(e).toRgbString()};On.random=function(){return On.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function VXt(n,e){e=e===0?0:e||10;var t=On(n).toHsl();return t.s-=e/100,t.s=tV(t.s),On(t)}function $Xt(n,e){e=e===0?0:e||10;var t=On(n).toHsl();return t.s+=e/100,t.s=tV(t.s),On(t)}function WXt(n){return On(n).desaturate(100)}function HXt(n,e){e=e===0?0:e||10;var t=On(n).toHsl();return t.l+=e/100,t.l=tV(t.l),On(t)}function jXt(n,e){e=e===0?0:e||10;var t=On(n).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),On(t)}function XXt(n,e){e=e===0?0:e||10;var t=On(n).toHsl();return t.l-=e/100,t.l=tV(t.l),On(t)}function YXt(n,e){var t=On(n).toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,On(t)}function qXt(n){var e=On(n).toHsl();return e.h=(e.h+180)%360,On(e)}function gwe(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=On(n).toHsl(),r=[On(n)],i=360/e,a=1;a<e;a++)r.push(On({h:(t.h+a*i)%360,s:t.s,l:t.l}));return r}function ZXt(n){var e=On(n).toHsl(),t=e.h;return[On(n),On({h:(t+72)%360,s:e.s,l:e.l}),On({h:(t+216)%360,s:e.s,l:e.l})]}function KXt(n,e,t){e=e||6,t=t||30;var r=On(n).toHsl(),i=360/t,a=[On(n)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(On(r));return a}function JXt(n,e){e=e||6;for(var t=On(n).toHsv(),r=t.h,i=t.s,a=t.v,o=[],s=1/e;e--;)o.push(On({h:r,s:i,v:a})),a=(a+s)%1;return o}On.mix=function(n,e,t){t=t===0?0:t||50;var r=On(n).toRgb(),i=On(e).toRgb(),a=t/100,o={r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a};return On(o)};On.readability=function(n,e){var t=On(n),r=On(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};On.isReadable=function(n,e,t){var r=On.readability(n,e),i,a;switch(a=!1,i=iYt(t),i.level+i.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a};On.mostReadable=function(n,e,t){var r=null,i=0,a,o,s,l;t=t||{},o=t.includeFallbackColors,s=t.level,l=t.size;for(var u=0;u<e.length;u++)a=On.readability(n,e[u]),a>i&&(i=a,r=On(e[u]));return On.isReadable(n,r,{level:s,size:l})||!o?r:(t.includeFallbackColors=!1,On.mostReadable(n,["#fff","#000"],t))};var Eee=On.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},QXt=On.hexNames=eYt(Eee);function eYt(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function NVe(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function hl(n,e){tYt(n)&&(n="100%");var t=rYt(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function tV(n){return Math.min(1,Math.max(0,n))}function Kd(n){return parseInt(n,16)}function tYt(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function rYt(n){return typeof n=="string"&&n.indexOf("%")!=-1}function a0(n){return n.length==1?"0"+n:""+n}function SO(n){return n<=1&&(n=n*100+"%"),n}function kVe(n){return Math.round(parseFloat(n)*255).toString(16)}function ywe(n){return Kd(n)/255}var Og=function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Qm(n){return!!Og.CSS_UNIT.exec(n)}function nYt(n){n=n.replace(NXt,"").replace(kXt,"").toLowerCase();var e=!1;if(Eee[n])n=Eee[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Og.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=Og.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Og.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=Og.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Og.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=Og.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Og.hex8.exec(n))?{r:Kd(t[1]),g:Kd(t[2]),b:Kd(t[3]),a:ywe(t[4]),format:e?"name":"hex8"}:(t=Og.hex6.exec(n))?{r:Kd(t[1]),g:Kd(t[2]),b:Kd(t[3]),format:e?"name":"hex"}:(t=Og.hex4.exec(n))?{r:Kd(t[1]+""+t[1]),g:Kd(t[2]+""+t[2]),b:Kd(t[3]+""+t[3]),a:ywe(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Og.hex3.exec(n))?{r:Kd(t[1]+""+t[1]),g:Kd(t[2]+""+t[2]),b:Kd(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function iYt(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var L5=2,mwe=.16,aYt=.05,oYt=.05,sYt=.15,FVe=5,BVe=4,lYt=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function _we(n,e,t){var r;return Math.round(n.h)>=60&&Math.round(n.h)<=240?r=t?Math.round(n.h)-L5*e:Math.round(n.h)+L5*e:r=t?Math.round(n.h)+L5*e:Math.round(n.h)-L5*e,r<0?r+=360:r>=360&&(r-=360),r}function xwe(n,e,t){if(n.h===0&&n.s===0)return n.s;var r;return t?r=n.s-mwe*e:e===BVe?r=n.s+mwe:r=n.s+aYt*e,r>1&&(r=1),t&&e===FVe&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function Swe(n,e,t){var r;return t?r=n.v+oYt*e:r=n.v-sYt*e,r>1&&(r=1),Number(r.toFixed(2))}function M9(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],r=On(n),i=FVe;i>0;i-=1){var a=r.toHsv(),o=On({h:_we(a,i,!0),s:xwe(a,i,!0),v:Swe(a,i,!0)}).toHexString();t.push(o)}t.push(r.toHexString());for(var s=1;s<=BVe;s+=1){var l=r.toHsv(),u=On({h:_we(l,s),s:xwe(l,s),v:Swe(l,s)}).toHexString();t.push(u)}return e.theme==="dark"?lYt.map(function(h){var c=h.index,f=h.opacity,d=On.mix(e.backgroundColor||"#141414",t[c],f*100).toHexString();return d}):t}var XX={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},YX={},qX={};Object.keys(XX).forEach(function(n){YX[n]=M9(XX[n]),YX[n].primary=YX[n][5],qX[n]=M9(XX[n],{theme:"dark",backgroundColor:"#141414"}),qX[n].primary=qX[n][5]});var Ju=function(e,t,r){var i=_R(e),a=_R(t);return _R([(1-r)*i.red()+r*a.red(),(1-r)*i.green()+r*a.green(),(1-r)*i.blue()+r*a.blue()]).rgb()},uYt=function(e,t,r){t===void 0&&(t="#fff"),r===void 0&&(r="rgb(150, 150, 150)");var i=Ju(t,e,.05).rgb().toString(),a=Ju(t,e,.1).rgb().toString(),o=Ju(t,e,.2).rgb().toString(),s=Ju(t,e,.4).rgb().toString(),l=Ju(t,r,.02).rgb().toString(),u=Ju(t,r,.05).rgb().toString(),h=Ju(t,r,.1).rgb().toString(),c=Ju(t,r,.2).rgb().toString(),f=Ju(t,r,.3).rgb().toString(),d=M9(e,{theme:"default",backgroundColor:t}),v=_R(e).hex().toLowerCase(),p=d.indexOf(v),g=e;return p!==-1&&(g=d[p+1]),{mainStroke:e,mainFill:a,activeStroke:e,activeFill:i,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:t,highlightStroke:g,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:f,edgeActiveStroke:e,edgeInactiveStroke:c,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:h,comboMainStroke:f,comboMainFill:l,comboActiveStroke:e,comboActiveFill:i,comboInactiveStroke:f,comboInactiveFill:l,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:g,comboHighlightFill:l,comboDisableStroke:c,comboDisableFill:u}},hYt=function(e,t,r){t===void 0&&(t="#fff"),r===void 0&&(r="#777");var i=Ju(t,e,.2).rgb().toString(),a=Ju(t,e,.3).rgb().toString(),o=Ju(t,e,.6).rgb().toString(),s=Ju(t,e,.8).rgb().toString(),l=Ju(t,r,.2).rgb().toString(),u=Ju(t,r,.25).rgb().toString(),h=Ju(t,r,.3).rgb().toString(),c=Ju(t,r,.4).rgb().toString(),f=Ju(t,r,.5).rgb().toString(),d=M9(e,{theme:"dark",backgroundColor:t}),v=_R(e).hex().toLowerCase(),p=d.indexOf(v),g=e;return p!==-1&&(g=d[p+1]),{mainStroke:s,mainFill:i,activeStroke:e,activeFill:a,inactiveStroke:s,inactiveFill:i,selectedStroke:e,selectedFill:i,highlightStroke:e,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:r,edgeActiveStroke:e,edgeInactiveStroke:r,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:h,comboMainStroke:c,comboMainFill:u,comboActiveStroke:e,comboActiveFill:l,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:e,comboSelectedFill:l,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:l}},Ose=function(e,t,r,i){return t===void 0&&(t="#fff"),r===void 0&&(r="default"),r==="default"?uYt(e,t,"rgb(150, 150, 150)"):hYt(e,t,"#777")},cYt=function(e,t,r,i){t===void 0&&(t="#fff"),r===void 0&&(r="default");var a=[];return e.forEach(function(o){a.push(Ose(o,t,r))}),a};const fYt=Object.freeze(Object.defineProperty({__proto__:null,mixColor:Ju,getColorsWithSubjectColor:Ose,getColorSetsBySubjectColors:cYt},Symbol.toStringTag,{value:"Module"}));var dYt="rgb(95, 149, 255)",vYt="rgb(255, 255, 255)",wwe="rgb(0, 0, 0)",da=Ose(dYt,vYt);const BE={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:da.mainStroke,fill:da.mainFill},size:20,color:da.mainStroke,linkPoints:{size:8,lineWidth:1,fill:da.activeFill,stroke:da.activeStroke}},nodeStateStyles:{active:{fill:da.activeFill,stroke:da.activeStroke,lineWidth:2,shadowColor:da.mainStroke,shadowBlur:10},selected:{fill:da.selectedFill,stroke:da.selectedStroke,lineWidth:4,shadowColor:da.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:da.highlightFill,stroke:da.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:da.inactiveFill,stroke:da.inactiveStroke,lineWidth:1},disable:{fill:da.disableFill,stroke:da.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:wwe,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:da.edgeMainStroke,lineAppendWidth:2},color:da.edgeMainStroke},edgeStateStyles:{active:{stroke:da.edgeActiveStroke,lineWidth:1},selected:{stroke:da.edgeSelectedStroke,lineWidth:2,shadowColor:da.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:da.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:da.edgeInactiveStroke,lineWidth:1},disable:{stroke:da.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:wwe,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:da.comboMainFill,lineWidth:1,stroke:da.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:da.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:da.comboActiveStroke,lineWidth:1,fill:da.comboActiveFill},selected:{stroke:da.comboSelectedStroke,lineWidth:2,fill:da.comboSelectedFill,shadowColor:da.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:da.comboHighlightStroke,lineWidth:2,fill:da.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:da.comboInactiveStroke,fill:da.comboInactiveFill,lineWidth:1},disable:{stroke:da.comboDisableStroke,fill:da.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"};var pYt=function(e){var t=e.clone();return GVe(e,t),t},GVe=function(e,t){var r;e.isGroup()&&t.isGroup()&&((r=e.get("children"))===null||r===void 0||r.forEach(function(s,l){var u=t.get("children")[l];GVe(s,u)}));var i=e.get("type"),a=t.get("type");if(!(i!=="image"||a!=="image")){var o=e.get("clipShape");o&&t.setClip({type:o.get("type"),attrs:o.attr()})}},gYt=gc.cloneEvent,yYt=gc.isViewportChanged,mYt=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=t,r.destroyed=!1,r.initEvents(),r}return e.prototype.initEvents=function(){var t=this,r=t.graph,i=t.extendEvents,a=i===void 0?[]:i,o=r.get("canvas"),s=o.get("el"),l=hE(this,"onCanvasEvents"),u=hE(this,"onExtendEvents"),h=hE(this,"onWheelEvent");o.off("*").on("*",l),this.canvasHandler=l,a.push(M5(s,"wheel",h)),typeof window<"u"&&(a.push(M5(window,"keydown",u)),a.push(M5(window,"keyup",u)),a.push(M5(window,"focus",u))),this.resetHandler&&r.off("afterchangedata",this.resetHandler),this.resetHandler=hE(this,"resetStatus"),r.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var r=this,i=this.graph,a=i.get("canvas"),o=t.target,s=t.type;switch(s){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return;break}t.canvasX=t.x,t.canvasY=t.y;var l={x:t.canvasX,y:t.canvasY},u=i.get("group"),h=u.getMatrix();if(h||(h=[1,0,0,0,1,0,0,0,1]),yYt(h)&&(l=i.getPointByClient(t.clientX,t.clientY)),t.x=l.x,t.y=l.y,t.currentTarget=i,o===a){(s==="mousemove"||s==="mouseleave")&&this.handleMouseMove(t,"canvas"),t.target=a,t.item=null,i.emit(s,t),i.emit("canvas:".concat(s),t);return}var c=e.getItemRoot(o);if(!c){i.emit(s,t);return}var f=c.get("item");if(!f.destroyed){var d=f.getType();if(t.target=o,t.item=f,t.canvasX===t.x&&t.canvasY===t.y){var v=i.getCanvasByPoint(t.x,t.y);t.canvasX=v.x,t.canvasY=v.y}t.name&&!t.name.includes(":")?(i.emit("".concat(d,":").concat(s),t),i.emit(s,t)):t.name&&i.emit(t.name,t),s==="dragstart"&&(this.dragging=!0),s==="dragend"&&(this.dragging=!1),s==="mousemove"&&this.handleMouseMove(t,d)}},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){an(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,r){var i=this,a=i.graph,o=i.preItem,s=a.get("canvas"),l=t.target===s?null:t.item;t=gYt(t),o&&o!==l&&!o.destroyed&&(t.item=o,this.emitCustomEvent(o.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",t)),l&&o!==l&&(t.item=l,this.emitCustomEvent(r,"mouseenter",t),this.dragging&&this.emitCustomEvent(r,"dragenter",t)),this.preItem=l},e.prototype.emitCustomEvent=function(t,r,i){i.type=r,this.graph.emit("".concat(t,":").concat(r),i)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this,r=t.graph,i=t.canvasHandler,a=t.extendEvents,o=r.get("canvas");o.off("*",i),At(a,function(s){s.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(DUe),Yi={},Z1={},Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Base=void 0;var _Yt=function(){function n(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return n.prototype.layout=function(e){return this.init(e),this.execute(!0)},n.prototype.init=function(e){this.nodes=e.nodes||[],this.edges=e.edges||[],this.combos=e.combos||[],this.comboEdges=e.comboEdges||[],this.hiddenNodes=e.hiddenNodes||[],this.hiddenEdges=e.hiddenEdges||[],this.hiddenCombos=e.hiddenCombos||[],this.vedges=e.vedges||[]},n.prototype.execute=function(e){},n.prototype.executeWithWorker=function(){},n.prototype.getDefaultCfg=function(){return{}},n.prototype.updateCfg=function(e){e&&Object.assign(this,e)},n.prototype.getType=function(){return"base"},n.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},n}();Xl.Base=_Yt;var ZX={},PM={};Object.defineProperty(PM,"__esModule",{value:!0});PM.camelize=PM.isString=void 0;var xYt=function(n){return typeof n=="string"};PM.isString=xYt;var SYt=function(n){var e=Object.create(null);return function(t){var r=e[t];return r||(e[t]=n(t))}},wYt=/-(\w)/g;PM.camelize=SYt(function(n){return n.replace(wYt,function(e,t){return t?t.toUpperCase():""})});var q3={};Object.defineProperty(q3,"__esModule",{value:!0});q3.isArray=void 0;q3.isArray=Array.isArray;var rV={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.toNumber=n.isNaN=n.isNumber=void 0;var e=function(i){return typeof i=="number"};n.isNumber=e;var t=function(i){return Number.isNaN(Number(i))};n.isNaN=t;var r=function(i){var a=parseFloat(i);return(0,n.isNaN)(a)?i:a};n.toNumber=r})(rV);var nV={},Rse={};(function(n){var e=at&&at.__assign||function(){return e=Object.assign||function(i){for(var a,o=1,s=arguments.length;o<s;o++){a=arguments[o];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(i[l]=a[l])}return i},e.apply(this,arguments)};Object.defineProperty(n,"__esModule",{value:!0}),n.clone=n.isObject=void 0;var t=function(i){return i!==null&&typeof i=="object"};n.isObject=t;var r=function(i){if(i===null)return i;if(i instanceof Date)return new Date(i.getTime());if(i instanceof Array){var a=[];return i.forEach(function(s){a.push(s)}),a.map(function(s){return(0,n.clone)(s)})}if(typeof i=="object"&&Object.keys(i).length){var o=e({},i);return Object.keys(o).forEach(function(s){o[s]=(0,n.clone)(o[s])}),o}return i};n.clone=r})(Rse);(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getCoreNodeAndRelativeLeafNodes=n.getAvgNodePosition=n.getLayoutBBox=n.traverseTreeUp=n.scaleMatrix=n.getAdjMatrix=n.floydWarshall=n.getDegreeMap=n.getDegree=n.getEdgeTerminal=void 0;var e=q3,t=rV,r=Rse,i=function(y,_){var x=y[_];return(0,r.isObject)(x)?x.cell:x};n.getEdgeTerminal=i;var a=function(y,_,x){for(var S=[],w=0;w<y;w++)S[w]={in:0,out:0,all:0};return x&&x.forEach(function(b){var E=(0,n.getEdgeTerminal)(b,"source"),T=(0,n.getEdgeTerminal)(b,"target");E&&S[_[E]]&&(S[_[E]].out+=1,S[_[E]].all+=1),T&&S[_[T]]&&(S[_[T]].in+=1,S[_[T]].all+=1)}),S};n.getDegree=a;var o=function(y,_){var x={};return y.forEach(function(S){x[S.id]={in:0,out:0,all:0}}),_&&_.forEach(function(S){var w=(0,n.getEdgeTerminal)(S,"source"),b=(0,n.getEdgeTerminal)(S,"target");w&&(x[w].out+=1,x[w].all+=1),b&&(x[b].in+=1,x[b].all+=1)}),x};n.getDegreeMap=o;var s=function(y){for(var _=[],x=y.length,S=0;S<x;S+=1){_[S]=[];for(var w=0;w<x;w+=1)S===w?_[S][w]=0:y[S][w]===0||!y[S][w]?_[S][w]=1/0:_[S][w]=y[S][w]}for(var b=0;b<x;b+=1)for(var S=0;S<x;S+=1)for(var w=0;w<x;w+=1)_[S][w]>_[S][b]+_[b][w]&&(_[S][w]=_[S][b]+_[b][w]);return _};n.floydWarshall=s;var l=function(y,_){var x=y.nodes,S=y.edges,w=[],b={};if(!x)throw new Error("invalid nodes data!");return x&&x.forEach(function(E,T){b[E.id]=T;var C=[];w.push(C)}),S==null||S.forEach(function(E){var T=(0,n.getEdgeTerminal)(E,"source"),C=(0,n.getEdgeTerminal)(E,"target"),A=b[T],M=b[C];A===void 0||M===void 0||(w[A][M]=1,_||(w[M][A]=1))}),w};n.getAdjMatrix=l;var u=function(y,_){var x=[];return y.forEach(function(S){var w=[];S.forEach(function(b){w.push(b*_)}),x.push(w)}),x};n.scaleMatrix=u;var h=function(y,_){if(y&&y.children){for(var x=y.children.length-1;x>=0;x--)if(!h(y.children[x],_))return}return!!_(y)},c=function(y,_){typeof _=="function"&&h(y,_)};n.traverseTreeUp=c;var f=function(y){var _=1/0,x=1/0,S=-1/0,w=-1/0;return y.forEach(function(b){var E=b.size;(0,e.isArray)(E)?E.length===1&&(E=[E[0],E[0]]):(0,t.isNumber)(E)?E=[E,E]:(E===void 0||isNaN(E))&&(E=[30,30]);var T=[E[0]/2,E[1]/2],C=b.x-T[0],A=b.x+T[0],M=b.y-T[1],I=b.y+T[1];_>C&&(_=C),x>M&&(x=M),S<A&&(S=A),w<I&&(w=I)}),{minX:_,minY:x,maxX:S,maxY:w}};n.getLayoutBBox=f;var d=function(y){var _={x:0,y:0};y.forEach(function(S){_.x+=S.x||0,_.y+=S.y||0});var x=y.length||1;return{x:_.x/x,y:_.y/x}};n.getAvgNodePosition=d;var v=function(y,_,x){var S,w;return y==="source"?((S=x==null?void 0:x.find(function(b){return b.target===_.id}))===null||S===void 0?void 0:S.source)||{}:((w=x==null?void 0:x.find(function(b){return b.source===_.id}))===null||w===void 0?void 0:w.target)||{}},p=function(y,_,x){var S=[];switch(y){case"source":S=x==null?void 0:x.filter(function(b){return b.source===_.id}).map(function(b){return b.target});break;case"target":S=x==null?void 0:x.filter(function(b){return b.target===_.id}).map(function(b){return b.source});break;case"both":S=x==null?void 0:x.filter(function(b){return b.source===_.id}).map(function(b){return b.target}).concat(x==null?void 0:x.filter(function(b){return b.target===_.id}).map(function(b){return b.source}));break}var w=new Set(S);return Array.from(w)},g=function(y,_,x,S,w){var b=x[_]||"",E=(S==null?void 0:S.filter(function(T){return T[_]===b}))||[];return y==="leaf"&&(E=E.filter(function(T){var C,A;return((C=w[T.id])===null||C===void 0?void 0:C.in)===0||((A=w[T.id])===null||A===void 0?void 0:A.out)===0})),E},m=function(y,_,x,S,w,b){var E=w[_.id],T=E.in,C=E.out,A=_,M=[];T===0?(A=v("source",_,x),M=p("both",A,x).map(function(R){return b[R]})):C===0&&(A=v("target",_,x),M=p("both",A,x).map(function(R){return b[R]})),M=M.filter(function(R){return w[R.id]&&(w[R.id].in===0||w[R.id].out===0)});var I=g(y,S,_,M,w);return{coreNode:A,relativeLeafNodes:M,sameTypeLeafNodes:I}};n.getCoreNodeAndRelativeLeafNodes=m})(nV);var KX={},bwe;function bYt(){return bwe||(bwe=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getFuncByUnknownType=n.getFunc=n.isFunction=void 0;var e=Dl(),t=rV,r=function(o){return typeof o=="function"};n.isFunction=r;var i=function(o,s,l){var u;return l?u=l:(0,t.isNumber)(o)?u=function(){return o}:u=function(){return s},u};n.getFunc=i;var a=function(o,s,l){return l===void 0&&(l=!0),!s&&s!==0?function(u){return u.size?(0,e.isArray)(u.size)?u.size[0]>u.size[1]?u.size[0]:u.size[1]:(0,e.isObject)(u.size)?u.size.width>u.size.height?u.size.width:u.size.height:u.size:o}:(0,n.isFunction)(s)?s:(0,t.isNumber)(s)?function(){return s}:(0,e.isArray)(s)?function(){if(l){var u=Math.max.apply(Math,s);return isNaN(u)?o:u}return s}:(0,e.isObject)(s)?function(){if(l){var u=Math.max(s.width,s.height);return isNaN(u)?o:u}return[s.width,s.height]}:function(){return o}};n.getFuncByUnknownType=a}(KX)),KX}var Ewe;function Dl(){return Ewe||(Ewe=1,function(n){var e=at&&at.__createBinding||(Object.create?function(r,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,o,s)}:function(r,i,a,o){o===void 0&&(o=a),r[o]=i[a]}),t=at&&at.__exportStar||function(r,i){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),t(PM,n),t(q3,n),t(rV,n),t(nV,n),t(Rse,n),t(bYt(),n)}(ZX)),ZX}var EYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(Z1,"__esModule",{value:!0});Z1.getLayoutByName=Z1.unRegisterLayout=Z1.registerLayout=void 0;var TYt=Xl,CYt=Dl(),sS=new Map,AYt=function(n,e){if(sS.get(n)&&console.warn("The layout with the name ".concat(n," exists already, it will be overridden")),(0,CYt.isObject)(e)){var t=function(r){EYt(i,r);function i(a){var o=this,s;o=r.call(this)||this;var l=o,u={},h=Object.assign({},l.getDefaultCfg(),((s=e.getDefaultCfg)===null||s===void 0?void 0:s.call(e))||{});return Object.assign(u,h,e,a),Object.keys(u).forEach(function(c){var f=u[c];l[c]=f}),o}return i}(TYt.Base);sS.set(n,t)}else sS.set(n,e);return sS.get(n)};Z1.registerLayout=AYt;var MYt=function(n){sS.has(n)&&sS.delete(n)};Z1.unRegisterLayout=MYt;var IYt=function(n){return sS.has(n)?sS.get(n):null};Z1.getLayoutByName=IYt;var JX={},Z3={},LYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(Z3,"__esModule",{value:!0});Z3.GridLayout=void 0;var hC=Dl(),PYt=Xl,OYt=function(n){LYt(e,n);function e(t){var r=n.call(this)||this;return r.begin=[0,0],r.preventOverlap=!0,r.preventOverlapPadding=10,r.condense=!1,r.sortBy="degree",r.nodes=[],r.edges=[],r.width=300,r.height=300,r.row=0,r.col=0,r.cellWidth=0,r.cellHeight=0,r.cellUsed={},r.id2manPos={},r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges,a=t.begin,o=r.length;if(o===0)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i};if(o===1)return r[0].x=a[0],r[0].y=a[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i};var s=t.sortBy,l=t.width,u=t.height,h=t.condense,c=t.preventOverlapPadding,f=t.preventOverlap,d=t.nodeSpacing,v=t.nodeSize,p=[];r.forEach(function(M){p.push(M)});var g={};if(p.forEach(function(M,I){g[M.id]=I}),(s==="degree"||!(0,hC.isString)(s)||p[0][s]===void 0)&&(s="degree",(0,hC.isNaN)(r[0].degree))){var m=(0,hC.getDegree)(p.length,g,i);p.forEach(function(M,I){M.degree=m[I].all})}p.sort(function(M,I){return I[s]-M[s]}),!l&&typeof window<"u"&&(l=window.innerWidth),!u&&typeof window<"u"&&(u=window.innerHeight);var y=t.rows,_=t.cols!=null?t.cols:t.columns;if(t.cells=o,y!=null&&_!=null?(t.rows=y,t.cols=_):y!=null&&_==null?(t.rows=y,t.cols=Math.ceil(t.cells/t.rows)):y==null&&_!=null?(t.cols=_,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells){var x=t.small(),S=t.large();(x-1)*S>=t.cells?t.small(x-1):(S-1)*x>=t.cells&&t.large(S-1)}else for(;t.cols*t.rows<t.cells;){var x=t.small(),S=t.large();(S+1)*x>=t.cells?t.large(S+1):t.small(x+1)}if(t.cellWidth=l/t.cols,t.cellHeight=u/t.rows,h&&(t.cellWidth=0,t.cellHeight=0),f||d){var w=(0,hC.getFuncByUnknownType)(10,d),b=(0,hC.getFuncByUnknownType)(30,v,!1);p.forEach(function(M){(!M.x||!M.y)&&(M.x=0,M.y=0);var I=b(M)||30,R,k;(0,hC.isArray)(I)?(R=I[0],k=I[1]):(R=I,k=I);var D=w!==void 0?w(M):c,G=R+D,W=k+D;t.cellWidth=Math.max(t.cellWidth,G),t.cellHeight=Math.max(t.cellHeight,W)})}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var E=0;E<p.length;E++){var T=p[E],C=void 0;if(t.position&&(C=t.position(T)),C&&(C.row!==void 0||C.col!==void 0)){var A={row:C.row,col:C.col};if(A.col===void 0)for(A.col=0;t.used(A.row,A.col);)A.col++;else if(A.row===void 0)for(A.row=0;t.used(A.row,A.col);)A.row++;t.id2manPos[T.id]=A,t.use(A.row,A.col)}t.getPos(T)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:i,nodes:p}},e.prototype.small=function(t){var r=this,i,a=r.rows||5,o=r.cols||5;if(t==null)i=Math.min(a,o);else{var s=Math.min(a,o);s===r.rows?r.rows=t:r.cols=t}return i},e.prototype.large=function(t){var r=this,i,a=r.rows||5,o=r.cols||5;if(t==null)i=Math.max(a,o);else{var s=Math.max(a,o);s===r.rows?r.rows=t:r.cols=t}return i},e.prototype.used=function(t,r){var i=this;return i.cellUsed["c-".concat(t,"-").concat(r)]||!1},e.prototype.use=function(t,r){var i=this;i.cellUsed["c-".concat(t,"-").concat(r)]=!0},e.prototype.moveToNextCell=function(){var t=this,r=t.cols||5;t.col++,t.col>=r&&(t.col=0,t.row++)},e.prototype.getPos=function(t){var r=this,i=r.begin,a=r.cellWidth,o=r.cellHeight,s,l,u=r.id2manPos[t.id];if(u)s=u.col*a+a/2+i[0],l=u.row*o+o/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();s=r.col*a+a/2+i[0],l=r.row*o+o/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=s,t.y=l},e.prototype.getType=function(){return"grid"},e}(PYt.Base);Z3.GridLayout=OYt;var K3={},RYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(K3,"__esModule",{value:!0});K3.RandomLayout=void 0;var DYt=Xl,NYt=function(n){RYt(e,n);function e(t){var r=n.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,r=t.nodes,i=.9,a=t.center;return!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),r&&r.forEach(function(o){o.x=(Math.random()-.5)*i*t.width+a[0],o.y=(Math.random()-.5)*i*t.height+a[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(DYt.Base);K3.RandomLayout=NYt;var J3={},kYt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(J3,"__esModule",{value:!0});J3.GForceLayout=void 0;var FYt=Xl,Ic=Dl(),QX=function(n,e){var t;return n?(0,Ic.isNumber)(n)?t=function(r){return n}:t=n:t=function(r){return e||1},t},BYt=function(n){kYt(e,n);function e(t){var r=n.call(this)||this;return r.maxIteration=500,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.preventOverlap=!0,r.collideStrength=1,r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.animate=!0,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,r,i=this,a=i.nodes;if(i.timeInterval!==void 0&&typeof window<"u"&&window.clearInterval(i.timeInterval),!a||a.length===0){(t=i.onLayoutEnd)===null||t===void 0||t.call(i);return}!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),i.center||(i.center=[i.width/2,i.height/2]);var o=i.center;if(a.length===1){a[0].x=o[0],a[0].y=o[1],(r=i.onLayoutEnd)===null||r===void 0||r.call(i);return}var s={},l={};a.forEach(function(v,p){(0,Ic.isNumber)(v.x)||(v.x=Math.random()*i.width),(0,Ic.isNumber)(v.y)||(v.y=Math.random()*i.height),s[v.id]=v,l[v.id]=p}),i.nodeMap=s,i.nodeIdxMap=l,i.linkDistance=QX(i.linkDistance,1),i.nodeStrength=QX(i.nodeStrength,1),i.edgeStrength=QX(i.edgeStrength,1);var u=i.nodeSize,h;if(i.preventOverlap){var c=i.nodeSpacing,f;(0,Ic.isNumber)(c)?f=function(){return c}:(0,Ic.isFunction)(c)?f=c:f=function(){return 0},u?(0,Ic.isArray)(u)?h=function(v){return Math.max(u[0],u[1])+f(v)}:h=function(v){return u+f(v)}:h=function(v){return v.size?(0,Ic.isArray)(v.size)?Math.max(v.size[0],v.size[1])+f(v):(0,Ic.isObject)(v.size)?Math.max(v.size.width,v.size.height)+f(v):v.size+f(v):10+f(v)}}i.nodeSize=h;var d=i.edges;i.degrees=(0,Ic.getDegree)(a.length,i.nodeIdxMap,d),i.getMass||(i.getMass=function(v){var p=v.mass||i.degrees[i.nodeIdxMap[v.id]].all||1;return p}),i.run()},e.prototype.run=function(){var t,r=this,i=r.maxIteration,a=r.nodes,o=r.workerEnabled,s=r.minMovement,l=r.animate;if(!!a)if(o||!l){for(var u=0;u<i;u++){var h=r.runOneStep(u);if(r.reachMoveThreshold(a,h,s))break}(t=r.onLayoutEnd)===null||t===void 0||t.call(r)}else{if(typeof window>"u")return;var c=0;this.timeInterval=window.setInterval(function(){var f,d;if(!!a){var v=r.runOneStep(c)||[];r.reachMoveThreshold(a,v,s)&&((f=r.onLayoutEnd)===null||f===void 0||f.call(r),window.clearInterval(r.timeInterval)),c++,c>=i&&((d=r.onLayoutEnd)===null||d===void 0||d.call(r),window.clearInterval(r.timeInterval))}},0)}},e.prototype.reachMoveThreshold=function(t,r,i){var a=0;return t.forEach(function(o,s){var l=o.x-r[s].x,u=o.y-r[s].y;a+=Math.sqrt(l*l+u*u)}),a/=t.length,a<i},e.prototype.runOneStep=function(t){var r,i=this,a=i.nodes,o=i.edges,s=[],l=[];if(!!a){a.forEach(function(c,f){s[2*f]=0,s[2*f+1]=0,l[2*f]=0,l[2*f+1]=0}),i.calRepulsive(s,a),o&&i.calAttractive(s,o),i.calGravity(s,a);var u=Math.max(.02,i.interval-t*.002);i.updateVelocity(s,l,u,a);var h=[];return a.forEach(function(c){h.push({x:c.x,y:c.y})}),i.updatePosition(l,u,a),(r=i.tick)===null||r===void 0||r.call(i),h}},e.prototype.calRepulsive=function(t,r){var i=this,a=i.getMass,o=i.factor,s=i.coulombDisScale,l=i.preventOverlap,u=i.collideStrength,h=u===void 0?1:u,c=i.nodeStrength,f=i.nodeSize;r.forEach(function(d,v){var p=a?a(d):1;r.forEach(function(g,m){if(!(v>=m)){var y=d.x-g.x,_=d.y-g.y;y===0&&_===0&&(y=Math.random()*.01,_=Math.random()*.01);var x=y*y+_*_,S=Math.sqrt(x),w=(S+.1)*s,b=y/S,E=_/S,T=(c(d)+c(g))*.5*o/(w*w),C=a?a(g):1;if(t[2*v]+=b*T,t[2*v+1]+=E*T,t[2*m]-=b*T,t[2*m+1]-=E*T,l&&(f(d)+f(g))/2>S){var A=h*(c(d)+c(g))*.5/x;t[2*v]+=b*A/p,t[2*v+1]+=E*A/p,t[2*m]-=b*A/C,t[2*m+1]-=E*A/C}}})})},e.prototype.calAttractive=function(t,r){var i=this,a=i.nodeMap,o=i.nodeIdxMap,s=i.linkDistance,l=i.edgeStrength,u=i.nodeSize,h=i.getMass;r.forEach(function(c,f){var d=(0,Ic.getEdgeTerminal)(c,"source"),v=(0,Ic.getEdgeTerminal)(c,"target"),p=a[d],g=a[v],m=g.x-p.x,y=g.y-p.y;m===0&&y===0&&(m=Math.random()*.01,y=Math.random()*.01);var _=Math.sqrt(m*m+y*y),x=m/_,S=y/_,w=s(c,p,g)||1+(u(p)+u(g)||0)/2,b=w-_,E=b*l(c),T=o[d],C=o[v],A=h?h(p):1,M=h?h(g):1;t[2*T]-=x*E/A,t[2*T+1]-=S*E/A,t[2*C]+=x*E/M,t[2*C+1]+=S*E/M})},e.prototype.calGravity=function(t,r){for(var i=this,a=i.center,o=i.gravity,s=i.degrees,l=r.length,u=0;u<l;u++){var h=r[u],c=h.x-a[0],f=h.y-a[1],d=o;if(i.getCenter){var v=i.getCenter(h,s[u].all);v&&(0,Ic.isNumber)(v[0])&&(0,Ic.isNumber)(v[1])&&(0,Ic.isNumber)(v[2])&&(c=h.x-v[0],f=h.y-v[1],d=v[2])}!d||(t[2*u]-=d*c,t[2*u+1]-=d*f)}},e.prototype.updateVelocity=function(t,r,i,a){var o=this,s=i*o.damping;a.forEach(function(l,u){var h=t[2*u]*s||.01,c=t[2*u+1]*s||.01,f=Math.sqrt(h*h+c*c);if(f>o.maxSpeed){var d=o.maxSpeed/f;h=d*h,c=d*c}r[2*u]=h,r[2*u+1]=c})},e.prototype.updatePosition=function(t,r,i){i.forEach(function(a,o){if((0,Ic.isNumber)(a.fx)&&(0,Ic.isNumber)(a.fy)){a.x=a.fx,a.y=a.fy;return}var s=t[2*o]*r,l=t[2*o+1]*r;a.x+=s,a.y+=l})},e.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(FYt.Base);J3.GForceLayout=BYt;var Q3={},iV={};function GYt(n){const e=+this._x.call(null,n),t=+this._y.call(null,n);return zVe(this.cover(e,t),e,t,n)}function zVe(n,e,t,r){if(isNaN(e)||isNaN(t))return n;var i,a=n._root,o={data:r},s=n._x0,l=n._y0,u=n._x1,h=n._y1,c,f,d,v,p,g,m,y;if(!a)return n._root=o,n;for(;a.length;)if((p=e>=(c=(s+u)/2))?s=c:u=c,(g=t>=(f=(l+h)/2))?l=f:h=f,i=a,!(a=a[m=g<<1|p]))return i[m]=o,n;if(d=+n._x.call(null,a.data),v=+n._y.call(null,a.data),e===d&&t===v)return o.next=a,i?i[m]=o:n._root=o,n;do i=i?i[m]=new Array(4):n._root=new Array(4),(p=e>=(c=(s+u)/2))?s=c:u=c,(g=t>=(f=(l+h)/2))?l=f:h=f;while((m=g<<1|p)===(y=(v>=f)<<1|d>=c));return i[y]=a,i[m]=o,n}function zYt(n){var e,t,r=n.length,i,a,o=new Array(r),s=new Array(r),l=1/0,u=1/0,h=-1/0,c=-1/0;for(t=0;t<r;++t)isNaN(i=+this._x.call(null,e=n[t]))||isNaN(a=+this._y.call(null,e))||(o[t]=i,s[t]=a,i<l&&(l=i),i>h&&(h=i),a<u&&(u=a),a>c&&(c=a));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),t=0;t<r;++t)zVe(this,o[t],s[t],n[t]);return this}function UYt(n,e){if(isNaN(n=+n)||isNaN(e=+e))return this;var t=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(t))i=(t=Math.floor(n))+1,a=(r=Math.floor(e))+1;else{for(var o=i-t||1,s=this._root,l,u;t>n||n>=i||r>e||e>=a;)switch(u=(e<r)<<1|n<t,l=new Array(4),l[u]=s,s=l,o*=2,u){case 0:i=t+o,a=r+o;break;case 1:t=i-o,a=r+o;break;case 2:i=t+o,r=a-o;break;case 3:t=i-o,r=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=t,this._y0=r,this._x1=i,this._y1=a,this}function VYt(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function $Yt(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function If(n,e,t,r,i){this.node=n,this.x0=e,this.y0=t,this.x1=r,this.y1=i}function WYt(n,e,t){var r,i=this._x0,a=this._y0,o,s,l,u,h=this._x1,c=this._y1,f=[],d=this._root,v,p;for(d&&f.push(new If(d,i,a,h,c)),t==null?t=1/0:(i=n-t,a=e-t,h=n+t,c=e+t,t*=t);v=f.pop();)if(!(!(d=v.node)||(o=v.x0)>h||(s=v.y0)>c||(l=v.x1)<i||(u=v.y1)<a))if(d.length){var g=(o+l)/2,m=(s+u)/2;f.push(new If(d[3],g,m,l,u),new If(d[2],o,m,g,u),new If(d[1],g,s,l,m),new If(d[0],o,s,g,m)),(p=(e>=m)<<1|n>=g)&&(v=f[f.length-1],f[f.length-1]=f[f.length-1-p],f[f.length-1-p]=v)}else{var y=n-+this._x.call(null,d.data),_=e-+this._y.call(null,d.data),x=y*y+_*_;if(x<t){var S=Math.sqrt(t=x);i=n-S,a=e-S,h=n+S,c=e+S,r=d.data}}return r}function HYt(n){if(isNaN(h=+this._x.call(null,n))||isNaN(c=+this._y.call(null,n)))return this;var e,t=this._root,r,i,a,o=this._x0,s=this._y0,l=this._x1,u=this._y1,h,c,f,d,v,p,g,m;if(!t)return this;if(t.length)for(;;){if((v=h>=(f=(o+l)/2))?o=f:l=f,(p=c>=(d=(s+u)/2))?s=d:u=d,e=t,!(t=t[g=p<<1|v]))return this;if(!t.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(r=e,m=g)}for(;t.data!==n;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[g]=a:delete e[g],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[m]=t:this._root=t),this):(this._root=a,this)}function jYt(n){for(var e=0,t=n.length;e<t;++e)this.remove(n[e]);return this}function XYt(){return this._root}function YYt(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function qYt(n){var e=[],t,r=this._root,i,a,o,s,l;for(r&&e.push(new If(r,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!n(r=t.node,a=t.x0,o=t.y0,s=t.x1,l=t.y1)&&r.length){var u=(a+s)/2,h=(o+l)/2;(i=r[3])&&e.push(new If(i,u,h,s,l)),(i=r[2])&&e.push(new If(i,a,h,u,l)),(i=r[1])&&e.push(new If(i,u,o,s,h)),(i=r[0])&&e.push(new If(i,a,o,u,h))}return this}function ZYt(n){var e=[],t=[],r;for(this._root&&e.push(new If(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var a,o=r.x0,s=r.y0,l=r.x1,u=r.y1,h=(o+l)/2,c=(s+u)/2;(a=i[0])&&e.push(new If(a,o,s,h,c)),(a=i[1])&&e.push(new If(a,h,s,l,c)),(a=i[2])&&e.push(new If(a,o,c,h,u)),(a=i[3])&&e.push(new If(a,h,c,l,u))}t.push(r)}for(;r=t.pop();)n(r.node,r.x0,r.y0,r.x1,r.y1);return this}function KYt(n){return n[0]}function JYt(n){return arguments.length?(this._x=n,this):this._x}function QYt(n){return n[1]}function eqt(n){return arguments.length?(this._y=n,this):this._y}function aV(n,e,t){var r=new Dse(e==null?KYt:e,t==null?QYt:t,NaN,NaN,NaN,NaN);return n==null?r:r.addAll(n)}function Dse(n,e,t,r,i,a){this._x=n,this._y=e,this._x0=t,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Twe(n){for(var e={data:n.data},t=e;n=n.next;)t=t.next={data:n.data};return e}var jf=aV.prototype=Dse.prototype;jf.copy=function(){var n=new Dse(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,r;if(!e)return n;if(!e.length)return n._root=Twe(e),n;for(t=[{source:e,target:n._root=new Array(4)}];e=t.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?t.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=Twe(r));return n};jf.add=GYt;jf.addAll=zYt;jf.cover=UYt;jf.data=VYt;jf.extent=$Yt;jf.find=WYt;jf.remove=HYt;jf.removeAll=jYt;jf.root=XYt;jf.size=YYt;jf.visit=qYt;jf.visitAfter=ZYt;jf.x=JYt;jf.y=eqt;const tqt=Object.freeze(Object.defineProperty({__proto__:null,quadtree:aV},Symbol.toStringTag,{value:"Module"})),rqt=Nd(tqt);Object.defineProperty(iV,"__esModule",{value:!0});iV.forceNBody=void 0;var nqt=rqt,iqt=.81,Cwe=.1;function aqt(n,e,t,r,i){var a=t/r,o=n.map(function(l,u){var h=e[l.id],c=h.data,f=h.x,d=h.y,v=h.size,p=c.layout.force.nodeStrength;return{x:f,y:d,size:v,index:u,vx:0,vy:0,weight:a*p}}),s=(0,nqt.quadtree)(o,function(l){return l.x},function(l){return l.y}).visitAfter(oqt);return o.forEach(function(l){lqt(l,s)}),o.map(function(l,u){var h=e[n[u].id],c=h.data.layout.force.mass,f=c===void 0?1:c;i[2*u]=l.vx/f,i[2*u+1]=l.vy/f}),i}iV.forceNBody=aqt;function oqt(n){var e=0,t=0,r=0;if(n.length){for(var i=0;i<4;i++){var a=n[i];a&&a.weight&&(e+=a.weight,t+=a.x*a.weight,r+=a.y*a.weight)}n.x=t/e,n.y=r/e,n.weight=e}else{var a=n;n.x=a.data.x,n.y=a.data.y,n.weight=a.data.weight}}var sqt=function(n,e,t,r,i,a){var o=a.x-n.x||Cwe,s=a.y-n.y||Cwe,l=r-e,u=o*o+s*s,h=Math.sqrt(u)*u;if(l*l*iqt<u){var c=n.weight/h;return a.vx+=o*c,a.vy+=s*c,!0}if(n.length)return!1;if(n.data!==a){var c=n.data.weight/h;a.vx+=o*c,a.vy+=s*c}};function lqt(n,e){e.visit(function(t,r,i,a,o){return sqt(t,r,i,a,o,n)})}var uqt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kg=at&&at.__assign||function(){return kg=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},kg.apply(this,arguments)};Object.defineProperty(Q3,"__esModule",{value:!0});Q3.Force2Layout=void 0;var hqt=Xl,qu=Dl(),cqt=iV,eY=function(n,e){var t;return n?(0,qu.isNumber)(n)?t=function(r){return n}:t=n:t=function(r){return e||1},t},fqt=function(n){uqt(e,n);function e(t){var r=n.call(this)||this;r.maxIteration=1e3,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=500,r.minMovement=.4,r.interval=.02,r.factor=1,r.linkDistance=200,r.gravity=0,r.clusterNodeStrength=20,r.preventOverlap=!0,r.distanceThresholdMode="mean",r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.judgingDistance=0,r.centripetalOptions={leaf:2,single:2,others:1,center:function(a){return{x:r.width/2,y:r.height/2}}};var i=t.getMass;return r.propsGetMass=i,r.updateCfg(t),r}return e.prototype.getCentripetalOptions=function(){var t=this,r=t.leafCluster,i=t.clustering,a=t.nodeClusterBy,o=t.nodes,s=t.nodeMap,l=t.clusterNodeStrength,u=function(_){return typeof l=="function"?l(_):l},h={},c;if(r){c=this.getSameTypeLeafMap()||{};var f=Array.from(new Set(o==null?void 0:o.map(function(_){return _[a]})))||[];h={single:100,leaf:function(_,x,S){var w=c[_.id]||{},b=w.relativeLeafNodes,E=w.sameTypeLeafNodes;return(E==null?void 0:E.length)===(b==null?void 0:b.length)||(f==null?void 0:f.length)===1?1:u(_)},others:1,center:function(_,x,S){var w,b=(((w=_.data)===null||w===void 0?void 0:w.layout)||{}).degree;if(!b)return{x:100,y:100};var E;if(b===1){var T=(c[_.id]||{}).sameTypeLeafNodes,C=T===void 0?[]:T;C.length===1?E=void 0:C.length>1&&(E=(0,qu.getAvgNodePosition)(C))}else E=void 0;return{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}}}if(i){c||(c=this.getSameTypeLeafMap());var d=Array.from(new Set(o.map(function(_,x){return _[a]}))).filter(function(_){return _!==void 0}),v={};d.forEach(function(_){var x=o.filter(function(S){return S[a]===_}).map(function(S){return s[S.id]});v[_]=(0,qu.getAvgNodePosition)(x)}),h={single:function(_){return u(_)},leaf:function(_){return u(_)},others:function(_){return u(_)},center:function(_,x,S){var w=v[_[a]];return{x:w==null?void 0:w.x,y:w==null?void 0:w.y}}}}this.centripetalOptions=kg(kg({},this.centripetalOptions),h);var p=this.centripetalOptions,g=p.leaf,m=p.single,y=p.others;g&&typeof g!="function"&&(this.centripetalOptions.leaf=function(){return g}),m&&typeof m!="function"&&(this.centripetalOptions.single=function(){return m}),y&&typeof y!="function"&&(this.centripetalOptions.others=function(){return y})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var r=t.nodes,i=t.edges,a=t.defSpringLen;if(t.judgingDistance=0,!r||r.length===0){t.onLayoutEnd([]);return}!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var o=t.center;if(r.length===1){r[0].x=o[0],r[0].y=o[1],t.onLayoutEnd([kg({},r[0])]);return}t.degreesMap=(0,qu.getDegreeMap)(r,i),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(d){var v=1;(0,qu.isNumber)(d.mass)&&(v=d.mass);var p=t.degreesMap[d.id].all;return!p||p<5?v:p*5*v};var s=t.nodeSize,l;if(t.preventOverlap){var u=t.nodeSpacing,h;(0,qu.isNumber)(u)?h=function(){return u}:(0,qu.isFunction)(u)?h=u:h=function(){return 0},s?(0,qu.isArray)(s)?l=function(d){return Math.max(s[0],s[1])+h(d)}:l=function(d){return s+h(d)}:l=function(d){return d.size?(0,qu.isArray)(d.size)?Math.max(d.size[0],d.size[1])+h(d):(0,qu.isObject)(d.size)?Math.max(d.size.width,d.size.height)+h(d):d.size+h(d):10+h(d)}}t.nodeSize=l,t.linkDistance=eY(t.linkDistance,1),t.nodeStrength=eY(t.nodeStrength,1),t.edgeStrength=eY(t.edgeStrength,1);var c={},f={};r.forEach(function(d,v){(0,qu.isNumber)(d.x)||(d.x=Math.random()*t.width),(0,qu.isNumber)(d.y)||(d.y=Math.random()*t.height);var p=t.degreesMap[d.id];c[d.id]=kg(kg({},d),{data:kg(kg({},d.data),{size:t.nodeSize(d)||30,layout:{inDegree:p.in,outDegree:p.out,degree:p.all,tDegree:p.in,sDegree:p.out,force:{mass:t.getMass(d),nodeStrength:t.nodeStrength(d,i)}}})}),f[d.id]=v}),t.nodeMap=c,t.nodeIdxMap=f,t.edgeInfos=[],i==null||i.forEach(function(d){var v=c[d.source],p=c[d.target];!v||!p?elf.edgeInfos.push({}):t.edgeInfos.push({edgeStrength:t.edgeStrength(d),linkDistance:a?a(kg(kg({},d),{source:v,target:p}),v,p):t.linkDistance(d,v,p)||1+(s(v)+s(v)||0)/2})}),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()},e.prototype.run=function(){var t=this,r=t.maxIteration,i=t.nodes,a=t.edges,o=t.workerEnabled,s=t.minMovement,l=t.animate,u=t.nodeMap,h=t.height;if(t.currentMinY=0,t.currentMaxY=h,!!i){var c=[];if(i.forEach(function(m,y){c[2*y]=0,c[2*y+1]=0}),this.defSideCoe&&typeof this.defSideCoe=="function"){var f={};a.forEach(function(m){var y=m.source,_=m.target;f[y]=f[y]||[],f[y].push(m),f[_]=f[_]||[],f[_].push(m)}),this.relatedEdges=f}var d=r,v=!l;if(o||v){for(var p=0;(t.judgingDistance>s||p<1)&&p<d;p++)t.runOneStep(p,c);t.onLayoutEnd(Object.values(u))}else{if(typeof window>"u")return;var g=0;this.timeInterval=window.setInterval(function(){!i||(t.runOneStep(g,c),g++,(g>=d||t.judgingDistance<s)&&(t.onLayoutEnd(Object.values(u)),window.clearInterval(t.timeInterval)))},0)}}},e.prototype.runOneStep=function(t,r){var i,a=this,o=a.nodes,s=a.edges;a.nodeMap;var l=a.monitor,u=[];if(!!(o!=null&&o.length)){a.calRepulsive(u),s&&a.calAttractive(u),a.calGravity(u),a.attractToSide(u);var h=a.interval;if(a.updateVelocity(u,r,h),a.updatePosition(r,h),(i=a.tick)===null||i===void 0||i.call(a),l){var c=this.calTotalEnergy(u);l({energy:c,nodes:o,edges:s,iterations:t})}}},e.prototype.calTotalEnergy=function(t){var r=this,i=r.nodes,a=r.nodeMap;if(!(i!=null&&i.length))return 0;var o=0;return i.forEach(function(s,l){var u=t[2*l],h=t[2*l+1],c=u*u+h*h,f=a[s.id].data.layout.force.mass,d=f===void 0?1:f;o+=d*c*.5}),o},e.prototype.calRepulsive=function(t){var r=this,i=r.nodes,a=r.nodeMap,o=r.factor,s=r.coulombDisScale;r.nodeSize,(0,cqt.forceNBody)(i,a,o,s*s,t)},e.prototype.calAttractive=function(t){var r=this,i=r.edges,a=r.nodeMap,o=r.nodeIdxMap,s=r.edgeInfos;r.nodeSize,i.forEach(function(l,u){var h=(0,qu.getEdgeTerminal)(l,"source"),c=(0,qu.getEdgeTerminal)(l,"target"),f=a[h],d=a[c];if(!(!f||!d)){var v=d.x-f.x,p=d.y-f.y;!v&&!p&&(v=Math.random()*.01,p=Math.random()*.01);var g=Math.sqrt(v*v+p*p),m=v/g,y=p/g,_=s[u]||{},x=_.linkDistance,S=x===void 0?200:x,w=_.edgeStrength,b=w===void 0?200:w,E=S-g,T=E*b,C=f.data.layout.force.mass||1,A=d.data.layout.force.mass||1,M=1/C,I=1/A,R=m*T,k=y*T,D=2*o[h],G=2*o[c];t[D]-=R*M,t[D+1]-=k*M,t[G]+=R*I,t[G+1]+=k*I}})},e.prototype.calGravity=function(t){var r,i=this,a=i.nodes,o=i.edges,s=o===void 0?[]:o,l=i.nodeMap,u=i.width,h=i.height,c=i.center,f=i.gravity,d=i.degreesMap,v=i.centripetalOptions;if(!!a)for(var p=a.length,g=0;g<p;g++){var m=2*g,y=l[a[g].id],_=y.data.layout.force.mass,x=_===void 0?1:_,S=0,w=0,b=f,E=d[y.id],T=E.in,C=E.out,A=E.all,M=(r=i.getCenter)===null||r===void 0?void 0:r.call(i,y,A);if(M){var I=M[0],R=M[1],k=M[2];S=y.x-I,w=y.y-R,b=k}else S=y.x-c[0],w=y.y-c[1];if(b&&(t[m]-=b*S/x,t[m+1]-=b*w/x),v){var D=v.leaf,G=v.single,W=v.others,z=v.center,V=(z==null?void 0:z(y,a,s,u,h))||{x:0,y:0,centerStrength:0},q=V.x,Y=V.y,le=V.centerStrength;if(!(0,qu.isNumber)(q)||!(0,qu.isNumber)(Y))continue;var j=(y.x-q)/x,Q=(y.y-Y)/x;if(le&&(t[m]-=le*j,t[m+1]-=le*Q),A===0){var ie=G(y);if(!ie)continue;t[m]-=ie*j,t[m+1]-=ie*Q;continue}if(T===0||C===0){var oe=D(y,a,s);if(!oe)continue;t[m]-=oe*j,t[m+1]-=oe*Q;continue}var se=W(y);if(!se)continue;t[m]-=se*j,t[m+1]-=se*Q}}},e.prototype.attractToSide=function(t){var r=this,i=r.defSideCoe;r.height;var a=r.nodes,o=r.relatedEdges,s=r.currentMinY,l=s===void 0?0:s,u=r.currentMaxY,h=u===void 0?this.height:u;!i||typeof i!="function"||!(a!=null&&a.length)||a.forEach(function(c,f){var d=i(c,o[c.id]||[]);if(d!==0){var v=d<0?l:h,p=Math.abs(d);t[2*f+1]-=p*(c.y-v)}})},e.prototype.updateVelocity=function(t,r,i){var a=this,o=a.nodes,s=a.damping,l=a.maxSpeed;!(o!=null&&o.length)||o.forEach(function(u,h){var c=(r[2*h]+t[2*h]*i)*s||.01,f=(r[2*h+1]+t[2*h+1]*i)*s||.01,d=Math.sqrt(c*c+f*f);if(d>l){var v=l/d;c=v*c,f=v*f}r[2*h]=c,r[2*h+1]=f})},e.prototype.updatePosition=function(t,r){var i=this,a=i.nodes,o=i.distanceThresholdMode,s=i.nodeMap;if(!(a!=null&&a.length)){this.judgingDistance=0;return}var l=0;o==="max"?i.judgingDistance=-1/0:o==="min"&&(i.judgingDistance=1/0);var u=1/0,h=-1/0;a.forEach(function(c,f){var d=s[c.id];if((0,qu.isNumber)(c.fx)&&(0,qu.isNumber)(c.fy)){c.x=c.fx,c.y=c.fy,d.x=c.x,d.y=c.y;return}var v=t[2*f]*r,p=t[2*f+1]*r;c.x+=v,c.y+=p,d.x=c.x,d.y=c.y,c.y<u&&(u=c.y),c.y>h&&(h=c.y);var g=Math.sqrt(v*v+p*p);switch(o){case"max":i.judgingDistance<g&&(i.judgingDistance=g);break;case"min":i.judgingDistance>g&&(i.judgingDistance=g);break;default:l=l+g;break}}),this.currentMinY=u,this.currentMaxY=h,(!o||o==="mean")&&(i.judgingDistance=l/a.length)},e.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,r=t.nodeClusterBy,i=t.nodes,a=t.edges,o=t.nodeMap,s=t.degreesMap;if(!!(i!=null&&i.length)){var l={};return i.forEach(function(u,h){var c=s[u.id].all;c===1&&(l[u.id]=(0,qu.getCoreNodeAndRelativeLeafNodes)("leaf",u,a,r,s,o))}),l}},e}(hqt.Base);Q3.Force2Layout=fqt;var Nse={},oV={};function dqt(n,e){var t,r=1;n==null&&(n=0),e==null&&(e=0);function i(){var a,o=t.length,s,l=0,u=0;for(a=0;a<o;++a)s=t[a],l+=s.x,u+=s.y;for(l=(l/o-n)*r,u=(u/o-e)*r,a=0;a<o;++a)s=t[a],s.x-=l,s.y-=u}return i.initialize=function(a){t=a},i.x=function(a){return arguments.length?(n=+a,i):n},i.y=function(a){return arguments.length?(e=+a,i):e},i.strength=function(a){return arguments.length?(r=+a,i):r},i}function ah(n){return function(){return n}}function lS(n){return(n()-.5)*1e-6}function vqt(n){return n.x+n.vx}function pqt(n){return n.y+n.vy}function gqt(n){var e,t,r,i=1,a=1;typeof n!="function"&&(n=ah(n==null?1:+n));function o(){for(var u,h=e.length,c,f,d,v,p,g,m=0;m<a;++m)for(c=aV(e,vqt,pqt).visitAfter(s),u=0;u<h;++u)f=e[u],p=t[f.index],g=p*p,d=f.x+f.vx,v=f.y+f.vy,c.visit(y);function y(_,x,S,w,b){var E=_.data,T=_.r,C=p+T;if(E){if(E.index>f.index){var A=d-E.x-E.vx,M=v-E.y-E.vy,I=A*A+M*M;I<C*C&&(A===0&&(A=lS(r),I+=A*A),M===0&&(M=lS(r),I+=M*M),I=(C-(I=Math.sqrt(I)))/I*i,f.vx+=(A*=I)*(C=(T*=T)/(g+T)),f.vy+=(M*=I)*C,E.vx-=A*(C=1-C),E.vy-=M*C)}return}return x>d+C||w<d-C||S>v+C||b<v-C}}function s(u){if(u.data)return u.r=t[u.data.index];for(var h=u.r=0;h<4;++h)u[h]&&u[h].r>u.r&&(u.r=u[h].r)}function l(){if(!!e){var u,h=e.length,c;for(t=new Array(h),u=0;u<h;++u)c=e[u],t[c.index]=+n(c,u,e)}}return o.initialize=function(u,h){e=u,r=h,l()},o.iterations=function(u){return arguments.length?(a=+u,o):a},o.strength=function(u){return arguments.length?(i=+u,o):i},o.radius=function(u){return arguments.length?(n=typeof u=="function"?u:ah(+u),l(),o):n},o}function yqt(n){return n.index}function Awe(n,e){var t=n.get(e);if(!t)throw new Error("node not found: "+e);return t}function mqt(n){var e=yqt,t=c,r,i=ah(30),a,o,s,l,u,h=1;n==null&&(n=[]);function c(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function f(g){for(var m=0,y=n.length;m<h;++m)for(var _=0,x,S,w,b,E,T,C;_<y;++_)x=n[_],S=x.source,w=x.target,b=w.x+w.vx-S.x-S.vx||lS(u),E=w.y+w.vy-S.y-S.vy||lS(u),T=Math.sqrt(b*b+E*E),T=(T-a[_])/T*g*r[_],b*=T,E*=T,w.vx-=b*(C=l[_]),w.vy-=E*C,S.vx+=b*(C=1-C),S.vy+=E*C}function d(){if(!!o){var g,m=o.length,y=n.length,_=new Map(o.map((S,w)=>[e(S,w,o),S])),x;for(g=0,s=new Array(m);g<y;++g)x=n[g],x.index=g,typeof x.source!="object"&&(x.source=Awe(_,x.source)),typeof x.target!="object"&&(x.target=Awe(_,x.target)),s[x.source.index]=(s[x.source.index]||0)+1,s[x.target.index]=(s[x.target.index]||0)+1;for(g=0,l=new Array(y);g<y;++g)x=n[g],l[g]=s[x.source.index]/(s[x.source.index]+s[x.target.index]);r=new Array(y),v(),a=new Array(y),p()}}function v(){if(!!o)for(var g=0,m=n.length;g<m;++g)r[g]=+t(n[g],g,n)}function p(){if(!!o)for(var g=0,m=n.length;g<m;++g)a[g]=+i(n[g],g,n)}return f.initialize=function(g,m){o=g,u=m,d()},f.links=function(g){return arguments.length?(n=g,d(),f):n},f.id=function(g){return arguments.length?(e=g,f):e},f.iterations=function(g){return arguments.length?(h=+g,f):h},f.strength=function(g){return arguments.length?(t=typeof g=="function"?g:ah(+g),v(),f):t},f.distance=function(g){return arguments.length?(i=typeof g=="function"?g:ah(+g),p(),f):i},f}var _qt={value:()=>{}};function UVe(){for(var n=0,e=arguments.length,t={},r;n<e;++n){if(!(r=arguments[n]+"")||r in t||/[\s.]/.test(r))throw new Error("illegal type: "+r);t[r]=[]}return new ZB(t)}function ZB(n){this._=n}function xqt(n,e){return n.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");if(i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}ZB.prototype=UVe.prototype={constructor:ZB,on:function(n,e){var t=this._,r=xqt(n+"",t),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(n=r[a]).type)&&(i=Sqt(t[i],n.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(n=r[a]).type)t[i]=Mwe(t[i],n.name,e);else if(e==null)for(i in t)t[i]=Mwe(t[i],n.name,null);return this},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new ZB(n)},call:function(n,e){if((i=arguments.length-2)>0)for(var t=new Array(i),r=0,i,a;r<i;++r)t[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(a=this._[n],r=0,i=a.length;r<i;++r)a[r].value.apply(e,t)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,a=r.length;i<a;++i)r[i].value.apply(e,t)}};function Sqt(n,e){for(var t=0,r=n.length,i;t<r;++t)if((i=n[t]).name===e)return i.value}function Mwe(n,e,t){for(var r=0,i=n.length;r<i;++r)if(n[r].name===e){n[r]=_qt,n=n.slice(0,r).concat(n.slice(r+1));break}return t!=null&&n.push({name:e,value:t}),n}const wqt=1664525,bqt=1013904223,Iwe=4294967296;function Eqt(){let n=1;return()=>(n=(wqt*n+bqt)%Iwe)/Iwe}function Tqt(n){return n.x}function Cqt(n){return n.y}var Aqt=10,Mqt=Math.PI*(3-Math.sqrt(5));function Iqt(n){var e,t=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,l=hse(c),u=UVe("tick","end"),h=Eqt();n==null&&(n=[]);function c(){f(),u.call("tick",e),t<r&&(l.stop(),u.call("end",e))}function f(p){var g,m=n.length,y;p===void 0&&(p=1);for(var _=0;_<p;++_)for(t+=(a-t)*i,s.forEach(function(x){x(t)}),g=0;g<m;++g)y=n[g],y.fx==null?y.x+=y.vx*=o:(y.x=y.fx,y.vx=0),y.fy==null?y.y+=y.vy*=o:(y.y=y.fy,y.vy=0);return e}function d(){for(var p=0,g=n.length,m;p<g;++p){if(m=n[p],m.index=p,m.fx!=null&&(m.x=m.fx),m.fy!=null&&(m.y=m.fy),isNaN(m.x)||isNaN(m.y)){var y=Aqt*Math.sqrt(.5+p),_=p*Mqt;m.x=y*Math.cos(_),m.y=y*Math.sin(_)}(isNaN(m.vx)||isNaN(m.vy))&&(m.vx=m.vy=0)}}function v(p){return p.initialize&&p.initialize(n,h),p}return d(),e={tick:f,restart:function(){return l.restart(c),e},stop:function(){return l.stop(),e},nodes:function(p){return arguments.length?(n=p,d(),s.forEach(v),e):n},alpha:function(p){return arguments.length?(t=+p,e):t},alphaMin:function(p){return arguments.length?(r=+p,e):r},alphaDecay:function(p){return arguments.length?(i=+p,e):+i},alphaTarget:function(p){return arguments.length?(a=+p,e):a},velocityDecay:function(p){return arguments.length?(o=1-p,e):1-o},randomSource:function(p){return arguments.length?(h=p,s.forEach(v),e):h},force:function(p,g){return arguments.length>1?(g==null?s.delete(p):s.set(p,v(g)),e):s.get(p)},find:function(p,g,m){var y=0,_=n.length,x,S,w,b,E;for(m==null?m=1/0:m*=m,y=0;y<_;++y)b=n[y],x=p-b.x,S=g-b.y,w=x*x+S*S,w<m&&(E=b,m=w);return E},on:function(p,g){return arguments.length>1?(u.on(p,g),e):u.on(p)}}}function Lqt(){var n,e,t,r,i=ah(-30),a,o=1,s=1/0,l=.81;function u(d){var v,p=n.length,g=aV(n,Tqt,Cqt).visitAfter(c);for(r=d,v=0;v<p;++v)e=n[v],g.visit(f)}function h(){if(!!n){var d,v=n.length,p;for(a=new Array(v),d=0;d<v;++d)p=n[d],a[p.index]=+i(p,d,n)}}function c(d){var v=0,p,g,m=0,y,_,x;if(d.length){for(y=_=x=0;x<4;++x)(p=d[x])&&(g=Math.abs(p.value))&&(v+=p.value,m+=g,y+=g*p.x,_+=g*p.y);d.x=y/m,d.y=_/m}else{p=d,p.x=p.data.x,p.y=p.data.y;do v+=a[p.data.index];while(p=p.next)}d.value=v}function f(d,v,p,g){if(!d.value)return!0;var m=d.x-e.x,y=d.y-e.y,_=g-v,x=m*m+y*y;if(_*_/l<x)return x<s&&(m===0&&(m=lS(t),x+=m*m),y===0&&(y=lS(t),x+=y*y),x<o&&(x=Math.sqrt(o*x)),e.vx+=m*d.value*r/x,e.vy+=y*d.value*r/x),!0;if(d.length||x>=s)return;(d.data!==e||d.next)&&(m===0&&(m=lS(t),x+=m*m),y===0&&(y=lS(t),x+=y*y),x<o&&(x=Math.sqrt(o*x)));do d.data!==e&&(_=a[d.data.index]*r/x,e.vx+=m*_,e.vy+=y*_);while(d=d.next)}return u.initialize=function(d,v){n=d,t=v,h()},u.strength=function(d){return arguments.length?(i=typeof d=="function"?d:ah(+d),h(),u):i},u.distanceMin=function(d){return arguments.length?(o=d*d,u):Math.sqrt(o)},u.distanceMax=function(d){return arguments.length?(s=d*d,u):Math.sqrt(s)},u.theta=function(d){return arguments.length?(l=d*d,u):Math.sqrt(l)},u}function Pqt(n,e,t){var r,i=ah(.1),a,o;typeof n!="function"&&(n=ah(+n)),e==null&&(e=0),t==null&&(t=0);function s(u){for(var h=0,c=r.length;h<c;++h){var f=r[h],d=f.x-e||1e-6,v=f.y-t||1e-6,p=Math.sqrt(d*d+v*v),g=(o[h]-p)*a[h]*u/p;f.vx+=d*g,f.vy+=v*g}}function l(){if(!!r){var u,h=r.length;for(a=new Array(h),o=new Array(h),u=0;u<h;++u)o[u]=+n(r[u],u,r),a[u]=isNaN(o[u])?0:+i(r[u],u,r)}}return s.initialize=function(u){r=u,l()},s.strength=function(u){return arguments.length?(i=typeof u=="function"?u:ah(+u),l(),s):i},s.radius=function(u){return arguments.length?(n=typeof u=="function"?u:ah(+u),l(),s):n},s.x=function(u){return arguments.length?(e=+u,s):e},s.y=function(u){return arguments.length?(t=+u,s):t},s}function Oqt(n){var e=ah(.1),t,r,i;typeof n!="function"&&(n=ah(n==null?0:+n));function a(s){for(var l=0,u=t.length,h;l<u;++l)h=t[l],h.vx+=(i[l]-h.x)*r[l]*s}function o(){if(!!t){var s,l=t.length;for(r=new Array(l),i=new Array(l),s=0;s<l;++s)r[s]=isNaN(i[s]=+n(t[s],s,t))?0:+e(t[s],s,t)}}return a.initialize=function(s){t=s,o()},a.strength=function(s){return arguments.length?(e=typeof s=="function"?s:ah(+s),o(),a):e},a.x=function(s){return arguments.length?(n=typeof s=="function"?s:ah(+s),o(),a):n},a}function Rqt(n){var e=ah(.1),t,r,i;typeof n!="function"&&(n=ah(n==null?0:+n));function a(s){for(var l=0,u=t.length,h;l<u;++l)h=t[l],h.vy+=(i[l]-h.y)*r[l]*s}function o(){if(!!t){var s,l=t.length;for(r=new Array(l),i=new Array(l),s=0;s<l;++s)r[s]=isNaN(i[s]=+n(t[s],s,t))?0:+e(t[s],s,t)}}return a.initialize=function(s){t=s,o()},a.strength=function(s){return arguments.length?(e=typeof s=="function"?s:ah(+s),o(),a):e},a.y=function(s){return arguments.length?(n=typeof s=="function"?s:ah(+s),o(),a):n},a}const Dqt=Object.freeze(Object.defineProperty({__proto__:null,forceCenter:dqt,forceCollide:gqt,forceLink:mqt,forceManyBody:Lqt,forceRadial:Pqt,forceSimulation:Iqt,forceX:Oqt,forceY:Rqt},Symbol.toStringTag,{value:"Module"})),kse=Nd(Dqt);var Fse={},Nqt=at&&at.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),kqt=at&&at.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Fqt=at&&at.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&Nqt(e,n,t);return kqt(e,n),e};Object.defineProperty(Fse,"__esModule",{value:!0});var cC=Fqt(kse),P5=Dl();function Bqt(){function n(j){return function(){return j}}var e=function(j){return j.cluster},t=n(1),r=n(-1),i=n(100),a=n(.1),o=[0,0],s=[],l={},u=[],h=100,c=100,f={none:{x:0,y:0}},d=[],v,p="force",g=!0,m=.1;function y(j){if(!g)return y;v.tick(),E();for(var Q=0,ie=s.length,oe=void 0,se=j*m;Q<ie;++Q)oe=s[Q],oe.vx+=(f[e(oe)].x-oe.x)*se,oe.vy+=(f[e(oe)].y-oe.y)*se}function _(){!s||x()}function x(){if(!(!s||!s.length)){if(e(s[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var j=S();v=cC.forceSimulation(j.nodes).force("x",cC.forceX(h).strength(.1)).force("y",cC.forceY(c).strength(.1)).force("collide",cC.forceCollide(function(Q){return Q.r}).iterations(4)).force("charge",cC.forceManyBody().strength(r)).force("links",cC.forceLink(j.nodes.length?j.links:[]).distance(i).strength(a)),d=v.nodes(),E()}}function S(){var j=[],Q=[],ie={},oe=[],se={},me=[];return se=w(s),me=b(u),oe=Object.keys(se),oe.forEach(function(Ce,Le){var re=se[Ce];j.push({id:Ce,size:re.count,r:Math.sqrt(re.sumforceNodeSize/Math.PI)}),ie[Ce]=Le}),me.forEach(function(Ce){var Le=(0,P5.getEdgeTerminal)(Ce,"source"),re=(0,P5.getEdgeTerminal)(Ce,"target"),yt=ie[Le],je=ie[re];yt!==void 0&&je!==void 0&&Q.push({source:yt,target:je,count:Ce.count})}),{nodes:j,links:Q}}function w(j){var Q={};return j.forEach(function(ie){var oe=e(ie);Q[oe]||(Q[oe]={count:0,sumforceNodeSize:0})}),j.forEach(function(ie){var oe=e(ie),se=t(ie),me=Q[oe];me.count=me.count+1,me.sumforceNodeSize=me.sumforceNodeSize+Math.PI*(se*se)*1.3,Q[oe]=me}),Q}function b(j){var Q={},ie=[];j.forEach(function(se){var me=T(se),Ce=0;Q[me]!==void 0&&(Ce=Q[me]),Ce+=1,Q[me]=Ce});var oe=Object.entries(Q);return oe.forEach(function(se){var me=se[0],Ce=se[1],Le=me.split("~")[0],re=me.split("~")[1];Le!==void 0&&re!==void 0&&ie.push({source:Le,target:re,count:Ce})}),ie}function E(){return f={none:{x:0,y:0}},d.forEach(function(j){f[j.id]={x:j.x-o[0],y:j.y-o[1]}}),f}function T(j){var Q=(0,P5.getEdgeTerminal)(j,"source"),ie=(0,P5.getEdgeTerminal)(j,"target"),oe=e(l[Q]),se=e(l[ie]);return oe<=se?"".concat(oe,"~").concat(se):"".concat(se,"~").concat(oe)}function C(j){l={},j.forEach(function(Q){l[Q.id]=Q})}function A(j){return arguments.length?(p=j,_(),y):p}function M(j){return arguments.length?typeof j=="string"?(e=function(Q){return Q[j]},y):(e=j,y):e}function I(j){return arguments.length?(g=j,y):g}function R(j){return arguments.length?(m=j,y):m}function k(j){return arguments.length?(h=j,y):h}function D(j){return arguments.length?(c=j,y):c}function G(j){return arguments.length?(C(j||[]),s=j||[],y):s}function W(j){return arguments.length?(u=j||[],_(),y):u}function z(j){return arguments.length?(typeof j=="function"?t=j:t=n(+j),_(),y):t}function V(j){return arguments.length?(typeof j=="function"?r=j:r=n(+j),_(),y):r}function q(j){return arguments.length?(typeof j=="function"?i=j:i=n(+j),_(),y):i}function Y(j){return arguments.length?(typeof j=="function"?a=j:a=n(+j),_(),y):a}function le(j){return arguments.length?(o=j,y):o}return y.initialize=function(j){s=j,_()},y.template=A,y.groupBy=M,y.enableGrouping=I,y.strength=R,y.centerX=k,y.centerY=D,y.nodes=G,y.links=W,y.forceNodeSize=z,y.nodeSize=y.forceNodeSize,y.forceCharge=V,y.forceLinkDistance=q,y.forceLinkStrength=Y,y.offset=le,y.getFocis=E,y}Fse.default=Bqt;var y_={};Object.defineProperty(y_,"__esModule",{value:!0});y_.FORCE_LAYOUT_TYPE_MAP=y_.LAYOUT_MESSAGE=void 0;y_.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};y_.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0};var Gqt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),zqt=at&&at.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Uqt=at&&at.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Vqt=at&&at.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&zqt(e,n,t);return Uqt(e,n),e},$qt=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(oV,"__esModule",{value:!0});oV.ForceLayout=void 0;var fC=Vqt(kse),Wqt=$qt(Fse),vb=Dl(),Hqt=Xl,jqt=y_,Xqt=function(n){Gqt(e,n);function e(t){var r=n.call(this)||this;return r.center=[0,0],r.nodeStrength=null,r.edgeStrength=null,r.preventOverlap=!1,r.clusterNodeStrength=null,r.clusterEdgeStrength=null,r.clusterEdgeDistance=null,r.clusterNodeSize=null,r.clusterFociStrength=null,r.linkDistance=50,r.alphaDecay=.028,r.alphaMin=.001,r.alpha=.3,r.collideStrength=1,r.workerEnabled=!1,r.tick=function(){},r.onLayoutEnd=function(){},r.ticking=void 0,t&&r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var r=this;r.nodes=t.nodes||[];var i=t.edges||[];r.edges=i.map(function(a){var o={},s=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(a).forEach(function(l){s.indexOf(l)>-1||(o[l]=a[l])}),o}),r.ticking=!1},e.prototype.execute=function(t){var r=this,i=r.nodes,a=r.edges;if(!r.ticking){var o=r.forceSimulation,s=r.alphaMin,l=r.alphaDecay,u=r.alpha;if(o){if(t){if(r.clustering&&r.clusterForce&&(r.clusterForce.nodes(i),r.clusterForce.links(a)),o.nodes(i),a&&r.edgeForce)r.edgeForce.links(a);else if(a&&!r.edgeForce){var f=fC.forceLink().id(function(g){return g.id}).links(a);r.edgeStrength&&f.strength(r.edgeStrength),r.linkDistance&&f.distance(r.linkDistance),r.edgeForce=f,o.force("link",f)}}r.preventOverlap&&r.overlapProcess(o),o.alpha(u).restart(),this.ticking=!0}else try{var h=fC.forceManyBody();if(r.nodeStrength&&h.strength(r.nodeStrength),o=fC.forceSimulation().nodes(i),r.clustering){var c=(0,Wqt.default)();c.centerX(r.center[0]).centerY(r.center[1]).template("force").strength(r.clusterFociStrength),a&&c.links(a),i&&c.nodes(i),c.forceLinkDistance(r.clusterEdgeDistance).forceLinkStrength(r.clusterEdgeStrength).forceCharge(r.clusterNodeStrength).forceNodeSize(r.clusterNodeSize),r.clusterForce=c,o.force("group",c)}if(o.force("center",fC.forceCenter(r.center[0],r.center[1])).force("charge",h).alpha(u).alphaDecay(l).alphaMin(s),r.preventOverlap&&r.overlapProcess(o),a){var f=fC.forceLink().id(function(p){return p.id}).links(a);r.edgeStrength&&f.strength(r.edgeStrength),r.linkDistance&&f.distance(r.linkDistance),r.edgeForce=f,o.force("link",f)}if(r.workerEnabled&&!qqt()&&(r.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!r.workerEnabled)o.on("tick",function(){r.tick()}).on("end",function(){r.ticking=!1,r.onLayoutEnd&&r.onLayoutEnd()}),r.ticking=!0;else{o.stop();for(var d=Yqt(o),v=1;v<=d;v++)o.tick(),postMessage({nodes:i,currentTick:v,totalTicks:d,type:jqt.LAYOUT_MESSAGE.TICK},void 0);r.ticking=!1}r.forceSimulation=o,r.ticking=!0}catch(p){r.ticking=!1,console.warn(p)}}},e.prototype.overlapProcess=function(t){var r=this,i=r.nodeSize,a=r.nodeSpacing,o,s,l=r.collideStrength;if((0,vb.isNumber)(a)?s=function(){return a}:(0,vb.isFunction)(a)?s=a:s=function(){return 0},!i)o=function(f){if(f.size){if((0,vb.isArray)(f.size)){var d=f.size[0]>f.size[1]?f.size[0]:f.size[1];return d/2+s(f)}if((0,vb.isObject)(f.size)){var d=f.size.width>f.size.height?f.size.width:f.size.height;return d/2+s(f)}return f.size/2+s(f)}return 10+s(f)};else if((0,vb.isFunction)(i))o=function(f){var d=i(f);return d+s(f)};else if((0,vb.isArray)(i)){var u=i[0]>i[1]?i[0]:i[1],h=u/2;o=function(f){return h+s(f)}}else if((0,vb.isNumber)(i)){var c=i/2;o=function(f){return c+s(f)}}else o=function(){return 10};t.force("collisionForce",fC.forceCollide(o).strength(l))},e.prototype.updateCfg=function(t){var r=this;r.ticking&&(r.forceSimulation.stop(),r.ticking=!1),r.forceSimulation=null,Object.assign(r,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(Hqt.Base);oV.ForceLayout=Xqt;function Yqt(n){var e=n.alphaMin(),t=n.alphaTarget(),r=n.alpha(),i=Math.log((e-t)/(r-t))/Math.log(1-n.alphaDecay()),a=Math.ceil(i);return a}function qqt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}(function(n){var e=at&&at.__createBinding||(Object.create?function(r,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,o,s)}:function(r,i,a,o){o===void 0&&(o=a),r[o]=i[a]}),t=at&&at.__exportStar||function(r,i){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),t(oV,n)})(Nse);var ek={},Zqt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(ek,"__esModule",{value:!0});ek.CircularLayout=void 0;var Kqt=Xl,$y=Dl();function Jqt(n,e,t,r){n.forEach(function(i,a){n[a].children=[],n[a].parent=[]}),r?e.forEach(function(i){var a=(0,$y.getEdgeTerminal)(i,"source"),o=(0,$y.getEdgeTerminal)(i,"target"),s=0;a&&(s=t[a]);var l=0;o&&(l=t[o]);var u=n[s].children,h=n[l].parent;u.push(n[l].id),h.push(n[s].id)}):e.forEach(function(i){var a=(0,$y.getEdgeTerminal)(i,"source"),o=(0,$y.getEdgeTerminal)(i,"target"),s=0;a&&(s=t[a]);var l=0;o&&(l=t[o]);var u=n[s].children,h=n[l].children;u.push(n[l].id),h.push(n[s].id)})}function Qqt(n,e,t){for(var r=t.length,i=0;i<r;i++){var a=(0,$y.getEdgeTerminal)(t[i],"source"),o=(0,$y.getEdgeTerminal)(t[i],"target");if(n.id===a&&e.id===o||e.id===a&&n.id===o)return!0}return!1}function eZt(n,e){var t=n.degree,r=e.degree;return t<r?-1:t>r?1:0}var tZt=function(n){Zqt(e,n);function e(t){var r=n.call(this)||this;return r.radius=null,r.nodeSize=void 0,r.startRadius=null,r.endRadius=null,r.startAngle=0,r.endAngle=2*Math.PI,r.clockwise=!0,r.divisions=1,r.ordering=null,r.angleRatio=1,r.nodes=[],r.edges=[],r.nodeMap={},r.degrees=[],r.width=300,r.height=300,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,r=this,i=r.nodes,a=r.edges,o=i.length;if(o===0){r.onLayoutEnd&&r.onLayoutEnd();return}!r.width&&typeof window<"u"&&(r.width=window.innerWidth),!r.height&&typeof window<"u"&&(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var s=r.center;if(o===1){i[0].x=s[0],i[0].y=s[1],r.onLayoutEnd&&r.onLayoutEnd();return}var l=r.radius,u=r.startRadius,h=r.endRadius,c=r.divisions,f=r.startAngle,d=r.endAngle,v=r.angleRatio,p=r.ordering,g=r.clockwise,m=r.nodeSpacing,y=r.nodeSize,_=(d-f)/o,x={};i.forEach(function(D,G){x[D.id]=G}),r.nodeMap=x;var S=(0,$y.getDegree)(i.length,x,a);if(r.degrees=S,m){var w=(0,$y.getFuncByUnknownType)(10,m),b=(0,$y.getFuncByUnknownType)(10,y),E=-1/0;i.forEach(function(D){var G=b(D);E<G&&(E=G)});var T=0;i.forEach(function(D,G){G===0?T+=E||10:T+=(w(D)||0)+(E||10)}),l=T/(2*Math.PI)}else!l&&!u&&!h?l=r.height>r.width?r.width/2:r.height/2:!u&&h?u=h:u&&!h&&(h=u);var C=_*v,A=[];p==="topology"?A=r.topologyOrdering():p==="topology-directed"?A=r.topologyOrdering(!0):p==="degree"?A=r.degreeOrdering():A=i;for(var M=Math.ceil(o/c),I=0;I<o;++I){var R=l;!R&&u!==null&&h!==null&&(R=u+I*(h-u)/(o-1)),R||(R=10+I*100/(o-1));var k=f+I%M*C+2*Math.PI/c*Math.floor(I/M);g||(k=d-I%M*C-2*Math.PI/c*Math.floor(I/M)),A[I].x=s[0]+Math.cos(k)*R,A[I].y=s[1]+Math.sin(k)*R,A[I].weight=S[I].all}return(t=r.onLayoutEnd)===null||t===void 0||t.call(r),{nodes:A,edges:this.edges}},e.prototype.topologyOrdering=function(t){t===void 0&&(t=!1);var r=this,i=r.degrees,a=r.edges,o=r.nodes,s=(0,$y.clone)(o),l=r.nodeMap,u=[s[0]],h=[o[0]],c=[],f=o.length;c[0]=!0,Jqt(s,a,l,t);var d=0;return s.forEach(function(v,p){if(p!==0)if((p===f-1||i[p].all!==i[p+1].all||Qqt(u[d],v,a))&&!c[p])u.push(v),h.push(o[l[v.id]]),c[p]=!0,d++;else{for(var g=u[d].children,m=!1,y=0;y<g.length;y++){var _=l[g[y]];if(i[_].all===i[p].all&&!c[_]){u.push(s[_]),h.push(o[l[s[_].id]]),c[_]=!0,m=!0;break}}for(var x=0;!m&&(c[x]||(u.push(s[x]),h.push(o[l[s[x].id]]),c[x]=!0,m=!0),x++,x!==f););}}),h},e.prototype.degreeOrdering=function(){var t=this,r=t.nodes,i=[],a=t.degrees;return r.forEach(function(o,s){o.degree=a[s].all,i.push(o)}),i.sort(eZt),i},e.prototype.getType=function(){return"circular"},e}(Kqt.Base);ek.CircularLayout=tZt;var qI={},Bse={},Gse={},zse={},Use={},Vse={};Object.defineProperty(Vse,"__esModule",{value:!0});var rZt=function(n,e){if(n!=="next"&&n!=="prev")return e},Lwe=function(n){n.prev.next=n.next,n.next.prev=n.prev,delete n.next,delete n.prev},nZt=function(){function n(){var e={};e.prev=e,e.next=e.prev,this.shortcut=e}return n.prototype.dequeue=function(){var e=this.shortcut,t=e.prev;if(t&&t!==e)return Lwe(t),t},n.prototype.enqueue=function(e){var t=this.shortcut;e.prev&&e.next&&Lwe(e),e.next=t.next,t.next.prev=e,t.next=e,e.prev=t},n.prototype.toString=function(){for(var e=[],t=this.shortcut,r=t.prev;r!==t;)e.push(JSON.stringify(r,rZt)),r=r==null?void 0:r.prev;return"[".concat(e.join(", "),"]")},n}();Vse.default=nZt;var HA;(function(n){n.DEFAULT_EDGE_NAME="\0",n.GRAPH_NODE="\0",n.EDGE_KEY_DELIM=""})(HA||(HA={}));function Pwe(n,e){var t=n.get(e)||0;n.set(e,t+1)}function Owe(n,e){var t=n.get(e);t!==void 0&&(t=t-1,t>0?n.set(e,t):n.delete(e))}function VVe(n,e,t,r){var i=String(e),a=String(t);if(!n&&i>a){var o=i;i=a,a=o}return i+HA.EDGE_KEY_DELIM+a+HA.EDGE_KEY_DELIM+(r===void 0?HA.DEFAULT_EDGE_NAME:r)}function Rwe(n,e,t,r){var i=String(e),a=String(t),o={v:e,w:t};if(!n&&i>a){var s=o.v;o.v=o.w,o.w=s}return r!==void 0&&(o.name=r),o}function tY(n,e){return VVe(n,e.v,e.w,e.name)}function Dwe(n){return typeof n=="function"}var iZt=function(e){return e.nodes().map(function(t){var r=e.node(t),i=e.parent(t),a={id:t,value:r,parent:i};return a.value===void 0&&delete a.value,a.parent===void 0&&delete a.parent,a})},aZt=function(e){return e.edges().map(function(t){var r=e.edge(t),i={v:t.v,w:t.w,value:r,name:t.name};return i.name===void 0&&delete i.name,i.value===void 0&&delete i.value,i})},oZt=function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:iZt(e),edges:aZt(e),value:e.graph()};return t.value===void 0&&delete t.value,t},sZt=function(e){var t=new oT(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(function(r){t.setNode(r.id,r.value),r.parent&&t.setParent(r.id,r.parent)}),e.edges.forEach(function(r){t.setEdge(r.v,r.w,r.value,r.name)}),t};function Nwe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kwe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nwe(Object(t),!0).forEach(function(r){lZt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nwe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lZt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uZt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Fwe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function hZt(n,e,t){return e&&Fwe(n.prototype,e),t&&Fwe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}var cZt={compound:!1,multigraph:!1,directed:!0},oT=function(){function n(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uZt(this,n),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=HA.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(i){return e.label=i,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(i){return Dwe(i)?e.defaultNodeLabelFn=i:e.defaultNodeLabelFn=function(){return i},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(i){return e.nodesLabelMap.get(i)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(i){var a;return!(!((a=e.inEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.sinks=function(){return e.nodes().filter(function(i){var a;return!(!((a=e.outEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.setNodes=function(i,a){return i.map(function(o){return e.setNode(o,a)}),e},this.hasNode=function(i){return e.nodesLabelMap.has(i)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(i){if(e.isCompound()){var a,o=(a=e.parentMap)===null||a===void 0?void 0:a.get(i);if(o!==e.GRAPH_NODE)return o}},this.removeFromParentsChildList=function(i){var a=e.parentMap.get(i);e.childrenMap.get(a).delete(i)},this.setParent=function(i,a){var o,s;e.checkCompound();for(var l=a===void 0?e.GRAPH_NODE:a,u=e.parent(l);u;){if(i===u)throw new Error("Setting "+a+" as parent of "+i+" would create a cycle");u=e.parent(u)}a&&e.setNode(a),e.setNode(i),e.removeFromParentsChildList(i),(o=e.parentMap)===null||o===void 0||o.set(i,l);var h=e.childrenMap.get(l);return h.set(i,!0),(s=e.childrenMap)===null||s===void 0||s.set(l,h),e},this.children=function(i){var a=i===void 0?e.GRAPH_NODE:i;if(e.isCompound()){var o,s=(o=e.childrenMap)===null||o===void 0?void 0:o.get(a);return s?Array.from(s.keys()):void 0}if(a===e.GRAPH_NODE)return e.nodes();if(i&&e.hasNode(i))return[]},this.predecessors=function(i){var a=e.predecessorsMap.get(i);return a?Array.from(a.keys()):void 0},this.successors=function(i){var a=e.successorsMap.get(i);return a?Array.from(a.keys()):void 0},this.neighbors=function(i){var a;if(!!e.hasNode(i))return Array.from(new Set((a=e.predecessors(i))===null||a===void 0?void 0:a.concat(e.successors(i))))},this.isLeaf=function(i){var a;if(e.isDirected()){var o;return!(!((o=e.successors(i))===null||o===void 0)&&o.length)}return!(!((a=e.neighbors(i))===null||a===void 0)&&a.length)},this.filterNodes=function(i){var a=e.directed,o=e.multigraph,s=e.compound,l=new n({directed:a,multigraph:o,compound:s});if(l.setGraph(e.graph()),e.nodes().forEach(function(h){i(h)&&l.setNode(h,e.node(h))}),e.edges().forEach(function(h){l.hasNode(h.v)&&l.hasNode(h.w)&&l.setEdgeObj(h,e.edge(h))}),s){var u=function(c){for(var f=e.parent(c);f!==void 0&&!l.hasNode(f);)f=e.parent(f);return f};l.nodes().forEach(function(h){l.setParent(h,u(h))})}return l},this.setDefaultEdgeLabel=function(i){return Dwe(i)?e.defaultEdgeLabelFn=i:e.defaultEdgeLabelFn=function(){return i},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(i,a){return e.setEdge(i.v,i.w,a,i.name)},this.setPath=function(i,a){return i.reduce(function(o,s){return e.setEdge(o,s,a),s}),e},this.edgeFromArgs=function(i,a,o){return e.edge({v:i,w:a,name:o})},this.edge=function(i){return e.edgesLabelsMap.get(tY(e.isDirected(),i))},this.hasEdge=function(i,a,o){return e.edgesLabelsMap.has(tY(e.isDirected(),{v:i,w:a,name:o}))},this.removeEdgeObj=function(i){var a=i.v,o=i.w,s=i.name;return e.removeEdge(a,o,s)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(i,a){var o=e.inEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.v===a})},this.outEdges=function(i,a){var o=e.outEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.w===a})},this.nodeEdges=function(i,a){var o;if(!!e.hasNode(i))return(o=e.inEdges(i,a))===null||o===void 0?void 0:o.concat(e.outEdges(i,a))},this.toJSON=function(){return oZt(e)},this.nodeInDegree=function(i){var a=e.inEdgesMap.get(i);return a?a.size:0},this.nodeOutDegree=function(i){var a=e.outEdgesMap.get(i);return a?a.size:0},this.nodeDegree=function(i){return e.nodeInDegree(i)+e.nodeOutDegree(i)},this.source=function(i){return i.v},this.target=function(i){return i.w};var r=kwe(kwe({},cZt),t);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return hZt(n,[{key:"setNode",value:function(t,r){var i=this.nodesLabelMap,a=this.defaultNodeLabelFn,o=this.isCompound,s=this.parentMap,l=this.childrenMap,u=this.inEdgesMap,h=this.outEdgesMap,c=this.predecessorsMap,f=this.successorsMap;if(i.has(t))return r!==void 0&&i.set(t,r),this;if(i.set(t,r||a(t)),o()){var d;s==null||s.set(t,this.GRAPH_NODE),l==null||l.set(t,new Map),l!=null&&l.has(this.GRAPH_NODE)||l==null||l.set(this.GRAPH_NODE,new Map),l==null||(d=l.get(this.GRAPH_NODE))===null||d===void 0||d.set(t,!0)}return[u,h,c,f].forEach(function(v){return v.set(t,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(t){var r=this;if(this.hasNode(t)){var i=function(g){r.removeEdge(g.v,g.w,g.name)},a=this.inEdgesMap,o=this.outEdgesMap,s=this.predecessorsMap,l=this.successorsMap,u=this.nodesLabelMap;if(this.isCompound()){var h,c,f;this.removeFromParentsChildList(t),(h=this.parentMap)===null||h===void 0||h.delete(t),(c=this.children(t))===null||c===void 0||c.forEach(function(p){return r.setParent(p)}),(f=this.childrenMap)===null||f===void 0||f.delete(t)}var d=a.get(t),v=o.get(t);Array.from(d.values()).forEach(function(p){return i(p)}),Array.from(v.values()).forEach(function(p){return i(p)}),u.delete(t),a.delete(t),o.delete(t),s.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,r,i,a){var o,s,l=Rwe(this.isDirected(),t,r,a),u=tY(this.isDirected(),l),h=l.v,c=l.w;if(this.edgesLabelsMap.has(u))return this.edgesLabelsMap.set(u,i),this;if(a!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(c),this.edgesLabelsMap.set(u,i||this.defaultEdgeLabelFn(h,c,a)),Object.freeze(l),this.edgesMap.set(u,l);var f=this.predecessorsMap.get(c),d=this.successorsMap.get(h);return Pwe(f,h),Pwe(d,c),(o=this.inEdgesMap.get(c))===null||o===void 0||o.set(u,l),(s=this.outEdgesMap.get(h))===null||s===void 0||s.set(u,l),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,r,i){var a=VVe(this.isDirected(),t,r,i),o=this.edgesMap.get(a);if(o){var s=Rwe(this.isDirected(),t,r,i),l=s.v,u=s.w;this.edgesLabelsMap.delete(a),this.edgesMap.delete(a);var h=this.predecessorsMap.get(u),c=this.successorsMap.get(l);Owe(h,l),Owe(c,u),this.inEdgesMap.get(u).delete(a),this.outEdgesMap.get(l).delete(a),this.edgeCountNum-=1}return this}}]),n}();oT.fromJSON=sZt;function Tee(n){return Tee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tee(n)}function fZt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Bwe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function dZt(n,e,t){return e&&Bwe(n.prototype,e),t&&Bwe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function vE(){return typeof Reflect<"u"&&Reflect.get?vE=Reflect.get:vE=function(e,t,r){var i=vZt(e,t);if(!!i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:r):a.value}},vE.apply(this,arguments)}function vZt(n,e){for(;!Object.prototype.hasOwnProperty.call(n,e)&&(n=D1(n),n!==null););return n}function pZt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Cee(n,e)}function Cee(n,e){return Cee=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Cee(n,e)}function gZt(n){var e=_Zt();return function(){var r=D1(n),i;if(e){var a=D1(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return yZt(this,i)}}function yZt(n,e){if(e&&(Tee(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mZt(n)}function mZt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function _Zt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D1(n){return D1=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},D1(n)}var xZt=function(n){pZt(t,n);var e=gZt(t);function t(){var r;fZt(this,t);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r=e.call.apply(e,[this].concat(a)),r.eventPool={},r}return dZt(t,[{key:"appendEvent",value:function(i,a){this.eventPool[i]||(this.eventPool[i]=[]),this.eventPool[i].push(a)}},{key:"removeEvent",value:function(i,a){if(!!this.eventPool[i]){var o=this.eventPool[i].indexOf(a);o>-1&&this.eventPool[i].splice(o,1)}}},{key:"emitEvent",value:function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];!this.eventPool[i]||this.eventPool[i].forEach(function(l){l.apply(void 0,o)})}},{key:"setNode",value:function(i,a){return vE(D1(t.prototype),"setNode",this).call(this,i,a),this.emitEvent("nodeAdd",i,a),this}},{key:"removeNode",value:function(i){return vE(D1(t.prototype),"removeNode",this).call(this,i),this.emitEvent("nodeRemove",i),this}},{key:"setEdge",value:function(i,a,o,s){return vE(D1(t.prototype),"setEdge",this).call(this,i,a,o,s),this.emitEvent("edgeAdd",i,a,o,s),this}},{key:"removeEdge",value:function(i,a,o){return vE(D1(t.prototype),"removeEdge",this).call(this,i,a,o),this.emitEvent("edgeRemove",i,a,o),this}}]),t}(oT);function Gwe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function SZt(n,e,t){return e&&Gwe(n.prototype,e),t&&Gwe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function wZt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var $Ve=SZt(function n(){var e=this;wZt(this,n),this.arr=[],this.keyIndice=new Map,this.size=function(){return e.arr.length},this.keys=function(){return e.arr.map(function(t){return t.key})},this.has=function(t){return e.keyIndice.has(t)},this.priority=function(t){var r=e.keyIndice.get(t);if(r!==void 0)return e.arr[r].priority},this.swap=function(t,r){var i=e.arr,a=e.keyIndice,o=[i[t],i[r]],s=o[0],l=o[1];i[t]=l,i[r]=s,a.set(s.key,r),a.set(l.key,t)},this.innerDecrease=function(t){for(var r=e.arr,i=r[t].priority,a,o=t;o!==0;){var s;if(a=o>>1,((s=r[a])===null||s===void 0?void 0:s.priority)<i)break;e.swap(o,a),o=a}},this.heapify=function(t){var r=e.arr,i=t<<1,a=i+1,o=t;i<r.length&&(o=r[i].priority<r[o].priority?i:o,a<r.length&&(o=r[a].priority<r[o].priority?a:o),o!==t&&(e.swap(t,o),e.heapify(o)))},this.min=function(){if(e.size()===0)throw new Error("Queue underflow");return e.arr[0].key},this.add=function(t,r){var i=e.keyIndice,a=e.arr;if(!i.has(t)){var o=a.length;return i.set(t,o),a.push({key:t,priority:r}),e.innerDecrease(o),!0}return!1},this.removeMin=function(){e.swap(0,e.arr.length-1);var t=e.arr.pop();return e.keyIndice.delete(t.key),e.heapify(0),t.key},this.decrease=function(t,r){if(!e.has(t))throw new Error("There's no key named ".concat(t));var i=e.keyIndice.get(t);if(r>e.arr[i].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[i].priority," New: ").concat(r));e.arr[i].priority=r,e.innerDecrease(i)}}),bZt=function(e,t){var r=new oT,i=new Map,a=new $Ve,o;function s(h){var c=h.v===o?h.w:h.v,f=a.priority(c);if(f!==void 0){var d=t(h);d<f&&(i.set(c,o),a.decrease(c,d))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(h){a.add(h,Number.POSITIVE_INFINITY),r.setNode(h)}),a.decrease(e.nodes()[0],0);for(var l=!1;a.size()>0;){var u;if(o=a.removeMin(),i.has(o))r.setEdge(o,i.get(o));else{if(l)throw new Error("Input graph is not connected: "+e.graph());l=!0}(u=e.nodeEdges(o))===null||u===void 0||u.forEach(s)}return r},EZt=function(e){var t=new Set,r=[],i=e.nodes();return i.forEach(function(a){for(var o=[],s=[a];s.length>0;){var l=s.pop();if(!t.has(l)){var u,h;t.add(l),o.push(l),(u=e.successors(l))===null||u===void 0||u.forEach(function(c){return s.push(c)}),(h=e.predecessors(l))===null||h===void 0||h.forEach(function(c){return s.push(c)})}}o.length&&r.push(o)}),r},TZt=function n(e,t,r,i,a,o){i.includes(t)||(i.push(t),r||o.push(t),a(t).forEach(function(s){return n(e,s,r,i,a,o)}),r&&o.push(t))},$se=function(e,t,r){var i=Array.isArray(t)?t:[t],a=function(u){return e.isDirected()?e.successors(u):e.neighbors(u)},o=[],s=[];return i.forEach(function(l){if(e.hasNode(l))TZt(e,l,r==="post",s,a,o);else throw new Error("Graph does not have node: "+l)}),o};function CZt(n,e){return LZt(n)||IZt(n,e)||MZt(n,e)||AZt()}function AZt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MZt(n,e){if(!!n){if(typeof n=="string")return zwe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zwe(n,e)}}function zwe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function IZt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r=[],i=!0,a=!1,o,s;try{for(t=t.call(n);!(i=(o=t.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return r}}function LZt(n){if(Array.isArray(n))return n}var PZt=function(){return 1},WVe=function(e,t,r,i){return OZt(e,t,r||PZt,i||function(a){return e.outEdges(a)})},OZt=function(e,t,r,i){var a=new Map,o=new $Ve,s,l,u=function(f){var d=f.v!==s?f.v:f.w,v=a.get(d),p=r(f),g=l.distance+p;if(p<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+f+" Weight: "+p);g<v.distance&&(v.distance=g,v.predecessor=s,o.decrease(d,g))};for(e.nodes().forEach(function(c){var f=c===t?0:Number.POSITIVE_INFINITY;a.set(c,{distance:f}),o.add(c,f)});o.size()>0&&(s=o.removeMin(),l=a.get(s),!(l&&l.distance===Number.POSITIVE_INFINITY));)i(s).forEach(u);var h={};return Array.from(a.entries()).forEach(function(c){var f=CZt(c,2),d=f[0],v=f[1];return h[String(d)]=v,h}),h},RZt=function(e,t,r){var i={};return e.nodes().forEach(function(a){return i[String(a)]=WVe(e,a,t,r),i}),i},HVe=function(e){var t=0,r=[],i=new Map,a=[];function o(s){var l,u={onStack:!0,lowlink:t,index:t};if(i.set(s,u),t+=1,r.push(s),(l=e.successors(s))===null||l===void 0||l.forEach(function(d){var v;if(i.has(d)){if(!((v=i.get(d))===null||v===void 0)&&v.onStack){var g=i.get(d);u.lowlink=Math.min(u.lowlink,g.index)}}else{o(d);var p=i.get(d);u.lowlink=Math.min(u.lowlink,p.lowlink)}}),u.lowlink===u.index){var h=[],c;do{c=r.pop();var f=i.get(c);f.onStack=!1,h.push(c)}while(s!==c);a.push(h)}}return e.nodes().forEach(function(s){i.has(s)||o(s)}),a},DZt=function(e){return HVe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})};function Aee(n){return Aee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Aee(n)}function Uwe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function NZt(n,e,t){return e&&Uwe(n.prototype,e),t&&Uwe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function kZt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function FZt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&KD(n,e)}function BZt(n){var e=jVe();return function(){var r=JD(n),i;if(e){var a=JD(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return GZt(this,i)}}function GZt(n,e){if(e&&(Aee(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zZt(n)}function zZt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Mee(n){var e=typeof Map=="function"?new Map:void 0;return Mee=function(r){if(r===null||!UZt(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return KB(r,arguments,JD(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),KD(i,r)},Mee(n)}function KB(n,e,t){return jVe()?KB=Reflect.construct:KB=function(i,a,o){var s=[null];s.push.apply(s,a);var l=Function.bind.apply(i,s),u=new l;return o&&KD(u,o.prototype),u},KB.apply(null,arguments)}function jVe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function UZt(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function KD(n,e){return KD=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},KD(n,e)}function JD(n){return JD=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},JD(n)}var Iee=function(n){FZt(t,n);var e=BZt(t);function t(){return kZt(this,t),e.apply(this,arguments)}return NZt(t)}(Mee(Error));function XVe(n){var e=new Set,t=new Set,r=[];function i(a){if(t.has(a))throw new Iee;if(!e.has(a)){var o;t.add(a),e.add(a),(o=n.predecessors(a))===null||o===void 0||o.forEach(i),t.delete(a),r.push(a)}}if(n.sinks().forEach(i),e.size!==n.nodeCount())throw new Iee;return r}var VZt=function(e){try{XVe(e)}catch(t){if(t instanceof Iee)return!1;throw t}return!0},$Zt=function(e,t){return $se(e,t,"post")},WZt=function(e,t){return $se(e,t,"pre")},HZt=function(){return 1};function jZt(n,e,t){return XZt(n,e||HZt,t||function(r){return n.outEdges(r)})}function XZt(n,e,t){var r={},i=n.nodes();return i.forEach(function(a){var o=String(a);r[o]={},r[o][o]={distance:0},i.forEach(function(s){a!==s&&(r[o][String(s)]={distance:Number.POSITIVE_INFINITY})}),t(a).forEach(function(s){var l=s.v===a?s.w:s.v,u=e(s);r[o][String(l)]={distance:u,predecessor:a}})}),i.forEach(function(a){var o=String(a),s=r[o];i.forEach(function(l){var u=String(l),h=r[u];i.forEach(function(c){var f=String(c),d=h[o],v=s[f],p=h[f],g=d.distance+v.distance;g<p.distance&&(p.distance=g,p.predecessor=v.predecessor)})})}),r}const YZt=Object.freeze(Object.defineProperty({__proto__:null,components:EZt,dfs:$se,dijkstra:WVe,dijkstraAll:RZt,findCycles:DZt,tarjan:HVe,isAcyclic:VZt,postorder:$Zt,preorder:WZt,prim:bZt,topsort:XVe,floydWarshall:jZt},Symbol.toStringTag,{value:"Module"}));var qZt=function(e,t){for(var r=e.nodes(),i=0;i<r.length;i++){var a=r[i];if(t.hasNode(a))return!0}return!1},YVe=function(e,t){for(var r=e.edges(),i=0;i<r.length;i++){var a=r[i];if(t.hasEdge(a.v,a.w,a.name))return!0}return!1},qVe=function(e,t){var r=e.nodes(),i=r.filter(function(a){return t.hasNode(a)});return i},ZVe=function(e,t){var r=e.edges(),i=r.filter(function(a){return t.hasEdge(a.v,a.w,a.name)});return i},KVe=function(e,t){return e.isCompound()===t.isCompound()&&e.isDirected()===t.isDirected()&&e.isMultigraph()===t.isMultigraph()},sV=function(e,t){var r=qVe(e,t);return r.length===e.nodes().length},Wse=function(e,t){var r=ZVe(e,t);return r.length===e.edges().length},ZZt=function(e,t){return KVe(e,t)&&e.nodeCount()===t.nodeCount()&&sV(e,t)&&e.edgeCount()===t.edgeCount()&&Wse(e,t)},KZt=function(e,t){return sV(e,t)&&Wse(e,t)};function JZt(n,e){return rKt(n)||tKt(n,e)||eKt(n,e)||QZt()}function QZt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eKt(n,e){if(!!n){if(typeof n=="string")return Vwe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Vwe(n,e)}}function Vwe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function tKt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r=[],i=!0,a=!1,o,s;try{for(t=t.call(n);!(i=(o=t.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw s}}return r}}function rKt(n){if(Array.isArray(n))return n}function nKt(n){return n instanceof oT}function I9(n){if(n.isMultigraph())return!1;for(var e=n.edges(),t=new Map,r=0;r<e.length;r++){var i=e[r];if(i.v===i.w)return!1;var a=[i.v,i.w].sort(),o=JZt(a,2),s=o[0],l=o[1],u="".concat(s,"-").concat(l);if(t.has(u))return!1;t.set(u,!0)}return!0}function iKt(n){return n.nodes().length===0}function aKt(n){for(var e=n.edges(),t=0;t<e.length;t++){var r=e[t];if(r.v===r.w)return!0}return!1}const oKt=Object.freeze(Object.defineProperty({__proto__:null,isGraph:nKt,isSimpleGraph:I9,isNullGraph:iKt,hasSelfLoop:aKt},Symbol.toStringTag,{value:"Module"}));var sKt=function(e,t){if(!I9(e)||!I9(t)||!sV(e,t)||YVe(e,t))return!1;var r=e.nodeCount();return e.edgeCount()+t.edgeCount()===r*(r-1)/2};const lKt=Object.freeze(Object.defineProperty({__proto__:null,containAllSameEdges:Wse,containAllSameNodes:sV,containSameEdges:YVe,containSameNodes:qZt,isGraphComplement:sKt,isGraphOptionSame:KVe,getSameEdges:ZVe,getSameNodes:qVe,isGraphSame:ZZt,isGraphContainsAnother:KZt},Symbol.toStringTag,{value:"Module"}));var uKt=function(e){if(!I9(e))return null;for(var t=e.nodeCount(),r=new oT({compound:e.isCompound(),directed:e.isDirected(),multigraph:e.isMultigraph()}),i=e.nodes(),a=0;a<t;a++){var o=i[a];r.setNode(o,e.node(o));for(var s=a+1;s<t;s++){var l=i[s];e.hasEdge(o,l)||r.setEdge(o,l)}}return r};const hKt=Object.freeze(Object.defineProperty({__proto__:null,getGraphComplement:uKt},Symbol.toStringTag,{value:"Module"})),cKt=Object.freeze(Object.defineProperty({__proto__:null,Graph:oT,GraphWithEvent:xZt,algorithm:YZt,comparision:lKt,essence:oKt,generate:hKt},Symbol.toStringTag,{value:"Module"})),lV=Nd(cKt);var JVe=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),fKt=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Use,"__esModule",{value:!0});var dKt=fKt(Vse),vKt=lV,pKt=function(n){JVe(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(dKt.default),gKt=function(n){JVe(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(vKt.Graph),yKt=function(){return 1},mKt=function(n,e){var t;if(n.nodeCount()<=1)return[];var r=xKt(n,e||yKt),i=_Kt(r.graph,r.buckets,r.zeroIdx);return(t=i.map(function(a){return n.outEdges(a.v,a.w)}))===null||t===void 0?void 0:t.flat()},_Kt=function(n,e,t){for(var r=[],i=e[e.length-1],a=e[0],o;n.nodeCount();){for(;o=a.dequeue();)rY(n,e,t,o);for(;o=i.dequeue();)rY(n,e,t,o);if(n.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){r=r.concat(rY(n,e,t,o,!0));break}}}return r},rY=function(n,e,t,r,i){var a,o,s=[];return(a=n.inEdges(r.v))===null||a===void 0||a.forEach(function(l){var u=n.edge(l),h=n.node(l.v);i&&s.push({v:l.v,w:l.w,in:0,out:0}),h.out===void 0&&(h.out=0),h.out-=u,Lee(e,t,h)}),(o=n.outEdges(r.v))===null||o===void 0||o.forEach(function(l){var u=n.edge(l),h=l.w,c=n.node(h);c.in===void 0&&(c.in=0),c.in-=u,Lee(e,t,c)}),n.removeNode(r.v),i?s:void 0},xKt=function(n,e){var t=new gKt,r=0,i=0;n.nodes().forEach(function(u){t.setNode(u,{v:u,in:0,out:0})}),n.edges().forEach(function(u){var h=t.edge(u)||0,c=(e==null?void 0:e(u))||1,f=h+c;t.setEdge(u.v,u.w,f),i=Math.max(i,t.node(u.v).out+=c),r=Math.max(r,t.node(u.w).in+=c)});for(var a=[],o=i+r+3,s=0;s<o;s++)a.push(new pKt);var l=r+1;return t.nodes().forEach(function(u){Lee(a,l,t.node(u))}),{buckets:a,zeroIdx:l,graph:t}},Lee=function(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)};Use.default=mKt;var SKt=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(zse,"__esModule",{value:!0});var wKt=SKt(Use),bKt=function(n){var e=function(r){return function(i){var a;return((a=r.edge(i))===null||a===void 0?void 0:a.weight)||1}},t=n.graph().acyclicer==="greedy"?(0,wKt.default)(n,e(n)):EKt(n);t==null||t.forEach(function(r){var i=n.edge(r);n.removeEdgeObj(r),i.forwardName=r.name,i.reversed=!0,n.setEdge(r.w,r.v,i,"rev-".concat(Math.random()))})},EKt=function(n){var e=[],t={},r={},i=function(a){var o;r[a]||(r[a]=!0,t[a]=!0,(o=n.outEdges(a))===null||o===void 0||o.forEach(function(s){t[s.w]?e.push(s):i(s.w)}),delete t[a])};return n.nodes().forEach(i),e},TKt=function(n){n.edges().forEach(function(e){var t=n.edge(e);if(t.reversed){n.removeEdgeObj(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})};zse.default={run:bKt,undo:TKt};var Hse={},Nv={},z_={},CKt=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(z_,"__esModule",{value:!0});z_.Graph=void 0;var AKt=lV,MKt=function(n){CKt(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(AKt.Graph);z_.Graph=MKt;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.minBy=n.notime=n.time=n.partition=n.maxRank=n.addBorderNode=n.removeEmptyRanks=n.normalizeRanks=n.buildLayerMatrix=n.intersectRect=n.predecessorWeights=n.successorWeights=n.zipObject=n.asNonCompoundGraph=n.simplify=n.addDummyNode=void 0;var e=Dl(),t=z_,r=function(x,S){return Number(x)-Number(S)},i=function(x,S,w,b){var E;do E="".concat(b).concat(Math.random());while(x.hasNode(E));return w.dummy=S,x.setNode(E,w),E};n.addDummyNode=i;var a=function(x){var S=new t.Graph().setGraph(x.graph());return x.nodes().forEach(function(w){S.setNode(w,x.node(w))}),x.edges().forEach(function(w){var b=S.edgeFromArgs(w.v,w.w)||{weight:0,minlen:1},E=x.edge(w);S.setEdge(w.v,w.w,{weight:b.weight+E.weight,minlen:Math.max(b.minlen,E.minlen)})}),S};n.simplify=a;var o=function(x){var S=new t.Graph({multigraph:x.isMultigraph()}).setGraph(x.graph());return x.nodes().forEach(function(w){var b;!((b=x.children(w))===null||b===void 0)&&b.length||S.setNode(w,x.node(w))}),x.edges().forEach(function(w){S.setEdgeObj(w,x.edge(w))}),S};n.asNonCompoundGraph=o;var s=function(x,S){return x==null?void 0:x.reduce(function(w,b,E){return w[b]=S[E],w},{})};n.zipObject=s;var l=function(x){var S={};return x.nodes().forEach(function(w){var b,E={};(b=x.outEdges(w))===null||b===void 0||b.forEach(function(T){var C;E[T.w]=(E[T.w]||0)+(((C=x.edge(T))===null||C===void 0?void 0:C.weight)||0)}),S[w]=E}),S};n.successorWeights=l;var u=function(x){var S=x.nodes(),w=S.map(function(b){var E,T={};return(E=x.inEdges(b))===null||E===void 0||E.forEach(function(C){T[C.v]=(T[C.v]||0)+x.edge(C).weight}),T});return(0,n.zipObject)(S,w)};n.predecessorWeights=u;var h=function(x,S){var w=Number(x.x),b=Number(x.y),E=Number(S.x)-w,T=Number(S.y)-b,C=Number(x.width)/2,A=Number(x.height)/2;if(!E&&!T)return{x:0,y:0};var M,I;return Math.abs(T)*C>Math.abs(E)*A?(T<0&&(A=-A),M=A*E/T,I=A):(E<0&&(C=-C),M=C,I=C*T/E),{x:w+M,y:b+I}};n.intersectRect=h;var c=function(x){for(var S=[],w=(0,n.maxRank)(x)+1,b=0;b<w;b++)S.push([]);x.nodes().forEach(function(E){var T=x.node(E);if(!!T){var C=T.rank;C!==void 0&&S[C]&&S[C].push(E)}});for(var b=0;b<w;b++)S[b]=S[b].sort(function(T,C){var A,M;return r((A=x.node(T))===null||A===void 0?void 0:A.order,(M=x.node(C))===null||M===void 0?void 0:M.order)});return S};n.buildLayerMatrix=c;var f=function(x){var S=x.nodes().filter(function(b){var E;return((E=x.node(b))===null||E===void 0?void 0:E.rank)!==void 0}).map(function(b){return x.node(b).rank}),w=Math.min.apply(Math,S);x.nodes().forEach(function(b){var E=x.node(b);E.hasOwnProperty("rank")&&w!==1/0&&(E.rank-=w)})};n.normalizeRanks=f;var d=function(x){var S=x.nodes(),w=S.filter(function(I){var R;return((R=x.node(I))===null||R===void 0?void 0:R.rank)!==void 0}).map(function(I){return x.node(I).rank}),b=Math.min.apply(Math,w),E=[];S.forEach(function(I){var R,k=(((R=x.node(I))===null||R===void 0?void 0:R.rank)||0)-b;E[k]||(E[k]=[]),E[k].push(I)});for(var T=0,C=x.graph().nodeRankFactor||0,A=0;A<E.length;A++){var M=E[A];M===void 0?A%C!==0&&(T-=1):T&&(M==null||M.forEach(function(I){var R=x.node(I);R&&(R.rank=R.rank||0,R.rank+=T)}))}};n.removeEmptyRanks=d;var v=function(x,S,w,b){var E={width:0,height:0};return(0,e.isNumber)(w)&&(0,e.isNumber)(b)&&(E.rank=w,E.order=b),(0,n.addDummyNode)(x,"border",E,S)};n.addBorderNode=v;var p=function(x){var S;return x.nodes().forEach(function(w){var b,E=(b=x.node(w))===null||b===void 0?void 0:b.rank;E!==void 0&&(S===void 0||E>S)&&(S=E)}),S||(S=0),S};n.maxRank=p;var g=function(x,S){var w={lhs:[],rhs:[]};return x==null||x.forEach(function(b){S(b)?w.lhs.push(b):w.rhs.push(b)}),w};n.partition=g;var m=function(x,S){var w=Date.now();try{return S()}finally{console.log("".concat(x," time: ").concat(Date.now()-w,"ms"))}};n.time=m;var y=function(x,S){return S()};n.notime=y;var _=function(x,S){return x.reduce(function(w,b){var E=S(w),T=S(b);return E>T?b:w})};n.minBy=_})(Nv);Object.defineProperty(Hse,"__esModule",{value:!0});var IKt=Nv,LKt=function(n){n.graph().dummyChains=[],n.edges().forEach(function(e){return PKt(n,e)})},PKt=function(n,e){var t=e.v,r=n.node(t).rank,i=e.w,a=n.node(i).rank,o=e.name,s=n.edge(e),l=s.labelRank;if(a!==r+1){n.removeEdgeObj(e);var u=n.graph(),h,c,f;for(f=0,++r;r<a;++f,++r)s.points=[],c={edgeLabel:s,width:0,height:0,edgeObj:e,rank:r},h=(0,IKt.addDummyNode)(n,"edge",c,"_d"),r===l&&(c.width=s.width,c.height=s.height,c.dummy="edge-label",c.labelpos=s.labelpos),n.setEdge(t,h,{weight:s.weight},o),f===0&&(u.dummyChains||(u.dummyChains=[]),u.dummyChains.push(h)),t=h;n.setEdge(t,i,{weight:s.weight},o)}},OKt=function(n){var e;(e=n.graph().dummyChains)===null||e===void 0||e.forEach(function(t){var r=n.node(t),i=r.edgeLabel,a;r.edgeObj&&n.setEdgeObj(r.edgeObj,i);for(var o=t;r.dummy;)a=n.successors(o)[0],n.removeNode(o),i.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),o=a,r=n.node(o)})};Hse.default={run:LKt,undo:OKt};var jse={},c0={};Object.defineProperty(c0,"__esModule",{value:!0});c0.slack=c0.longestPathWithLayer=c0.longestPath=void 0;var QVe=function(n){var e,t={},r=function(i){var a,o=n.node(i);if(!o)return 0;if(t[i])return o.rank;t[i]=!0;var s;return(a=n.outEdges(i))===null||a===void 0||a.forEach(function(l){var u=r(l.w),h=n.edge(l).minlen,c=u-h;c&&(s===void 0||c<s)&&(s=c)}),s||(s=0),o.rank=s,s};(e=n.sources())===null||e===void 0||e.forEach(function(i){return r(i)})};c0.longestPath=QVe;var e$e=function(n){var e,t={},r,i=function(s){var l,u=n.node(s);if(!u)return 0;if(t[s])return u.rank;t[s]=!0;var h;return(l=n.outEdges(s))===null||l===void 0||l.forEach(function(c){var f=i(c.w),d=n.edge(c).minlen,v=f-d;v&&(h===void 0||v<h)&&(h=v)}),h||(h=0),(r===void 0||h<r)&&(r=h),u.rank=h,h};(e=n.sources())===null||e===void 0||e.forEach(function(s){n.node(s)&&i(s)}),r===void 0&&(r=0);var a={},o=function(s,l){var u,h=n.node(s),c=isNaN(h.layer)?l:h.layer;(h.rank===void 0||h.rank<c)&&(h.rank=c),!a[s]&&(a[s]=!0,(u=n.outEdges(s))===null||u===void 0||u.map(function(f){o(f.w,c+n.edge(f).minlen)}))};n.nodes().forEach(function(s){var l=n.node(s);!l||(isNaN(l.layer)?l.rank-=r:o(s,l.layer))})};c0.longestPathWithLayer=e$e;var t$e=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen};c0.slack=t$e;c0.default={longestPath:QVe,longestPathWithLayer:e$e,slack:t$e};var ZS={};Object.defineProperty(ZS,"__esModule",{value:!0});ZS.feasibleTreeWithLayer=ZS.feasibleTree=void 0;var s2=c0,RKt=Nv,r$e=z_,n$e=function(n){var e=new r$e.Graph({directed:!1}),t=n.nodes()[0],r=n.nodeCount();e.setNode(t,{});for(var i,a;DKt(e,n)<r;)i=a$e(e,n),a=e.hasNode(i.v)?(0,s2.slack)(n,i):-(0,s2.slack)(n,i),o$e(e,n,a);return e};ZS.feasibleTree=n$e;var DKt=function(n,e){var t=function(r){e.nodeEdges(r).forEach(function(i){var a=i.v,o=r===a?i.w:a;!n.hasNode(o)&&!(0,s2.slack)(e,i)&&(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})};return n.nodes().forEach(t),n.nodeCount()},i$e=function(n){var e=new r$e.Graph({directed:!1}),t=n.nodes()[0],r=n.nodes().filter(function(o){return!!n.node(o)}).length;e.setNode(t,{});for(var i,a;NKt(e,n)<r;)i=a$e(e,n),a=e.hasNode(i.v)?(0,s2.slack)(n,i):-(0,s2.slack)(n,i),o$e(e,n,a);return e};ZS.feasibleTreeWithLayer=i$e;var NKt=function(n,e){var t=function(r){var i;(i=e.nodeEdges(r))===null||i===void 0||i.forEach(function(a){var o=a.v,s=r===o?a.w:o;!n.hasNode(s)&&(e.node(s).layer!==void 0||!(0,s2.slack)(e,a))&&(n.setNode(s,{}),n.setEdge(r,s,{}),t(s))})};return n.nodes().forEach(t),n.nodeCount()},a$e=function(n,e){return(0,RKt.minBy)(e.edges(),function(t){return n.hasNode(t.v)!==n.hasNode(t.w)?(0,s2.slack)(e,t):1/0})},o$e=function(n,e,t){n.nodes().forEach(function(r){e.node(r).rank||(e.node(r).rank=0),e.node(r).rank+=t})};ZS.default={feasibleTree:n$e,feasibleTreeWithLayer:i$e};var s$e={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.exchangeEdges=n.enterEdge=n.leaveEdge=n.initLowLimValues=n.calcCutValue=n.initCutValues=void 0;var e=ZS,t=c0,r=Nv,i=lV,a=i.algorithm.preorder,o=i.algorithm.postorder,s=function(_){var x=(0,r.simplify)(_);(0,t.longestPath)(x);var S=(0,e.feasibleTree)(x);(0,n.initLowLimValues)(S),(0,n.initCutValues)(S,x);for(var w,b;w=(0,n.leaveEdge)(S);)b=(0,n.enterEdge)(S,x,w),(0,n.exchangeEdges)(S,x,w,b)},l=function(_,x){var S=o(_,_.nodes());S=S==null?void 0:S.slice(0,(S==null?void 0:S.length)-1),S==null||S.forEach(function(w){u(_,x,w)})};n.initCutValues=l;var u=function(_,x,S){var w=_.node(S),b=w.parent;_.edgeFromArgs(S,b).cutvalue=(0,n.calcCutValue)(_,x,S)},h=function(_,x,S){var w,b=_.node(S),E=b.parent,T=!0,C=x.edgeFromArgs(S,E),A=0;return C||(T=!1,C=x.edgeFromArgs(E,S)),A=C.weight,(w=x.nodeEdges(S))===null||w===void 0||w.forEach(function(M){var I=M.v===S,R=I?M.w:M.v;if(R!==E){var k=I===T,D=x.edge(M).weight;if(A+=k?D:-D,m(_,S,R)){var G=_.edgeFromArgs(S,R).cutvalue;A+=k?-G:G}}}),A};n.calcCutValue=h;var c=function(_,x){x===void 0&&(x=_.nodes()[0]),f(_,{},1,x)};n.initLowLimValues=c;var f=function(_,x,S,w,b){var E,T=S,C=S,A=_.node(w);return x[w]=!0,(E=_.neighbors(w))===null||E===void 0||E.forEach(function(M){x[M]||(C=f(_,x,C,M,w))}),A.low=T,A.lim=C++,b?A.parent=b:delete A.parent,C},d=function(_){return _.edges().find(function(x){return _.edge(x).cutvalue<0})};n.leaveEdge=d;var v=function(_,x,S){var w=S.v,b=S.w;x.hasEdge(w,b)||(w=S.w,b=S.v);var E=_.node(w),T=_.node(b),C=E,A=!1;E.lim>T.lim&&(C=T,A=!0);var M=x.edges().filter(function(I){return A===y(_,_.node(I.v),C)&&A!==y(_,_.node(I.w),C)});return(0,r.minBy)(M,function(I){return(0,t.slack)(x,I)})};n.enterEdge=v;var p=function(_,x,S,w){var b=S.v,E=S.w;_.removeEdge(b,E),_.setEdge(w.v,w.w,{}),(0,n.initLowLimValues)(_),(0,n.initCutValues)(_,x),g(_,x)};n.exchangeEdges=p;var g=function(_,x){var S=_.nodes().find(function(b){var E;return!(!((E=x.node(b))===null||E===void 0)&&E.parent)}),w=a(_,S);w=w==null?void 0:w.slice(1),w==null||w.forEach(function(b){var E=_.node(b).parent,T=x.edgeFromArgs(b,E),C=!1;T||(T=x.edgeFromArgs(E,b),C=!0),x.node(b).rank=x.node(E).rank+(C?T.minlen:-T.minlen)})},m=function(_,x,S){return _.hasEdge(x,S)},y=function(_,x,S){return S.low<=x.lim&&x.lim<=S.lim};n.default=s})(s$e);var kKt=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(jse,"__esModule",{value:!0});var l$e=c0,FKt=ZS,BKt=kKt(s$e),GKt=function(n){switch(n.graph().ranker){case"network-simplex":UKt(n);break;case"tight-tree":$we(n);break;case"longest-path":zKt(n);break;default:$we(n)}},zKt=l$e.longestPath,$we=function(n){(0,l$e.longestPathWithLayer)(n),(0,FKt.feasibleTreeWithLayer)(n)},UKt=function(n){(0,BKt.default)(n)};jse.default=GKt;var Xse={};Object.defineProperty(Xse,"__esModule",{value:!0});var VKt=function(n){var e,t={},r=0,i=function(a){var o,s=r;(o=n.children(a))===null||o===void 0||o.forEach(i),t[a]={low:s,lim:r++}};return(e=n.children())===null||e===void 0||e.forEach(i),t},$Kt=function(n,e,t,r){var i=[],a=[],o=Math.min(e[t].low,e[r].low),s=Math.max(e[t].lim,e[r].lim),l,u;l=t;do l=n.parent(l),i.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=r;l&&l!==u;)a.push(l),l=n.parent(l);return{lca:u,path:i.concat(a.reverse())}},WKt=function(n){var e,t=VKt(n);(e=n.graph().dummyChains)===null||e===void 0||e.forEach(function(r){var i,a,o=r,s=n.node(o),l=s.edgeObj;if(!!l)for(var u=$Kt(n,t,l.v,l.w),h=u.path,c=u.lca,f=0,d=h[f],v=!0;o!==l.w;){if(s=n.node(o),v){for(;d!==c&&((i=n.node(d))===null||i===void 0?void 0:i.maxRank)<s.rank;)f++,d=h[f];d===c&&(v=!1)}if(!v){for(;f<h.length-1&&((a=n.node(h[f+1]))===null||a===void 0?void 0:a.minRank)<=s.rank;)f++;d=h[f]}n.setParent(o,d),o=n.successors(o)[0]}})};Xse.default=WKt;var Yse={};Object.defineProperty(Yse,"__esModule",{value:!0});var Pee=Nv,HKt=function(n){var e,t=(0,Pee.addDummyNode)(n,"root",{},"_root"),r=jKt(n),i=Math.max.apply(Math,Object.values(r));Math.abs(i)===1/0&&(i=1);var a=i-1,o=2*a+1;n.graph().nestingRoot=t,n.edges().forEach(function(l){n.edge(l).minlen*=o});var s=XKt(n)+1;(e=n.children())===null||e===void 0||e.forEach(function(l){u$e(n,t,o,s,a,r,l)}),n.graph().nodeRankFactor=o},u$e=function(n,e,t,r,i,a,o){var s=n.children(o);if(!(s!=null&&s.length)){o!==e&&n.setEdge(e,o,{weight:0,minlen:t});return}var l=(0,Pee.addBorderNode)(n,"_bt"),u=(0,Pee.addBorderNode)(n,"_bb"),h=n.node(o);n.setParent(l,o),h.borderTop=l,n.setParent(u,o),h.borderBottom=u,s==null||s.forEach(function(c){u$e(n,e,t,r,i,a,c);var f=n.node(c),d=f.borderTop?f.borderTop:c,v=f.borderBottom?f.borderBottom:c,p=f.borderTop?r:2*r,g=d!==v?1:i-a[o]+1;n.setEdge(l,d,{minlen:g,weight:p,nestingEdge:!0}),n.setEdge(v,u,{minlen:g,weight:p,nestingEdge:!0})}),n.parent(o)||n.setEdge(e,l,{weight:0,minlen:i+a[o]})},jKt=function(n){var e,t={},r=function(i,a){var o=n.children(i);o==null||o.forEach(function(s){return r(s,a+1)}),t[i]=a};return(e=n.children())===null||e===void 0||e.forEach(function(i){return r(i,1)}),t},XKt=function(n){var e=0;return n.edges().forEach(function(t){e+=n.edge(t).weight}),e},YKt=function(n){var e=n.graph();e.nestingRoot&&n.removeNode(e.nestingRoot),delete e.nestingRoot,n.edges().forEach(function(t){var r=n.edge(t);r.nestingEdge&&n.removeEdgeObj(t)})};Yse.default={run:HKt,cleanup:YKt};var qse={};Object.defineProperty(qse,"__esModule",{value:!0});var qKt=Nv,ZKt=function(n){var e,t=function(r){var i=n.children(r),a=n.node(r);if(i!=null&&i.length&&i.forEach(function(l){return t(l)}),a.hasOwnProperty("minRank")){a.borderLeft=[],a.borderRight=[];for(var o=a.minRank,s=a.maxRank+1;o<s;o+=1)Wwe(n,"borderLeft","_bl",r,a,o),Wwe(n,"borderRight","_br",r,a,o)}};(e=n.children())===null||e===void 0||e.forEach(function(r){return t(r)})},Wwe=function(n,e,t,r,i,a){var o={rank:a,borderType:e,width:0,height:0},s=i[e][a-1],l=(0,qKt.addDummyNode)(n,"border",o,t);i[e][a]=l,n.setParent(l,r),s&&n.setEdge(s,l,{weight:1})};qse.default=ZKt;var Zse={};Object.defineProperty(Zse,"__esModule",{value:!0});var KKt=function(n){var e,t=(e=n.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(t==="lr"||t==="rl")&&h$e(n)},JKt=function(n){var e,t=(e=n.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(t==="bt"||t==="rl")&&QKt(n),(t==="lr"||t==="rl")&&(eJt(n),h$e(n))},h$e=function(n){n.nodes().forEach(function(e){Hwe(n.node(e))}),n.edges().forEach(function(e){Hwe(n.edge(e))})},Hwe=function(n){var e=n.width;n.width=n.height,n.height=e},QKt=function(n){n.nodes().forEach(function(e){nY(n.node(e))}),n.edges().forEach(function(e){var t,r=n.edge(e);(t=r.points)===null||t===void 0||t.forEach(function(i){return nY(i)}),r.hasOwnProperty("y")&&nY(r)})},nY=function(n){n!=null&&n.y&&(n.y=-n.y)},eJt=function(n){n.nodes().forEach(function(e){iY(n.node(e))}),n.edges().forEach(function(e){var t,r=n.edge(e);(t=r.points)===null||t===void 0||t.forEach(function(i){return iY(i)}),r.hasOwnProperty("x")&&iY(r)})},iY=function(n){var e=n.x;n.x=n.y,n.y=e};Zse.default={adjust:KKt,undo:JKt};var Kse={},Jse={};function c$e(n){return[parseInt(n.substr(1,2),16),parseInt(n.substr(3,2),16),parseInt(n.substr(5,2),16)]}function aY(n){var e=Math.round(n).toString(16);return e.length===1?"0".concat(e):e}function f$e(n){return"#".concat(aY(n[0])).concat(aY(n[1])).concat(aY(n[2]))}var tJt=function(n){return n!==null&&typeof n!="function"&&isFinite(n.length)};const Td=tJt;var rJt=function(n,e){return Td(n)?n.indexOf(e)>-1:!1};const L9=rJt;var nJt=function(n,e){if(!Td(n))return n;for(var t=[],r=0;r<n.length;r++){var i=n[r];e(i,r)&&t.push(i)}return t};const d$e=nJt;var iJt=function(n,e){return e===void 0&&(e=[]),d$e(n,function(t){return!L9(e,t)})};const aJt=iJt;function ug(n){return typeof n=="function"}function Tw(n){return n==null}function ju(n){return Array.isArray(n)}const uV=function(n){var e=typeof n;return n!==null&&e==="object"||e==="function"};function OM(n,e){if(!!n){var t;if(ju(n))for(var r=0,i=n.length;r<i&&(t=e(n[r],r),t!==!1);r++);else if(uV(n)){for(var a in n)if(n.hasOwnProperty(a)&&(t=e(n[a],a),t===!1))break}}}var oJt=Object.keys?function(n){return Object.keys(n)}:function(n){var e=[];return OM(n,function(t,r){ug(n)&&r==="prototype"||e.push(r)}),e};const v$e=oJt;function p$e(n,e){var t=v$e(e),r=t.length;if(Tw(n))return!r;for(var i=0;i<r;i+=1){var a=t[i];if(e[a]!==n[a]||!(a in n))return!1}return!0}var sJt=function(n){return typeof n=="object"&&n!==null};const P9=sJt;var lJt={}.toString,uJt=function(n,e){return lJt.call(n)==="[object "+e+"]"};const ZI=uJt;var hJt=function(n){if(!P9(n)||!ZI(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e};const RM=hJt;function cJt(n,e){if(!ju(n))return null;var t;if(ug(e)&&(t=e),RM(e)&&(t=function(i){return p$e(i,e)}),t){for(var r=0;r<n.length;r+=1)if(t(n[r]))return n[r]}return null}function fJt(n,e,t){t===void 0&&(t=0);for(var r=t;r<n.length;r++)if(e(n[r],r))return r;return-1}var dJt=function(n,e){for(var t=null,r=0;r<n.length;r++){var i=n[r],a=i[e];if(!Tw(a)){ju(a)?t=a[0]:t=a;break}}return t};const vJt=dJt;var pJt=function(n){if(!ju(n))return[];for(var e=[],t=0;t<n.length;t++)e=e.concat(n[t]);return e};const gJt=pJt;var g$e=function(n,e){if(e===void 0&&(e=[]),!ju(n))e.push(n);else for(var t=0;t<n.length;t+=1)g$e(n[t],e);return e};const yJt=g$e;function y$e(n){if(!Array.isArray(n))return-1/0;var e=n.length;if(!e)return-1/0;for(var t=n[0],r=1;r<e;r++)t=Math.max(t,n[r]);return t}const m$e=function(n){if(!!ju(n))return n.reduce(function(e,t){return Math.min(e,t)},n[0])};var mJt=function(n){var e=n.filter(function(o){return!isNaN(o)});if(!e.length)return{min:0,max:0};if(ju(n[0])){for(var t=[],r=0;r<n.length;r++)t=t.concat(n[r]);e=t}var i=y$e(e),a=m$e(e);return{min:a,max:i}};const _Jt=mJt;var _$e=Array.prototype,xJt=_$e.splice,SJt=_$e.indexOf,wJt=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r++)for(var i=e[r],a=-1;(a=SJt.call(n,i))>-1;)xJt.call(n,a,1);return n};const bJt=wJt;var EJt=Array.prototype.splice,TJt=function(e,t){if(!Td(e))return[];for(var r=e?t.length:0,i=r-1;r--;){var a=void 0,o=t[r];(r===i||o!==a)&&(a=o,EJt.call(e,o,1))}return e};const x$e=TJt;var CJt=function(n,e,t){if(!ju(n)&&!RM(n))return n;var r=t;return OM(n,function(i,a){r=e(r,i,a)}),r};const S$e=CJt;var AJt=function(n,e){var t=[];if(!Td(n))return t;for(var r=-1,i=[],a=n.length;++r<a;){var o=n[r];e(o,r,n)&&(t.push(o),i.push(r))}return x$e(n,i),t};const MJt=AJt;function KS(n){return typeof n=="string"}function IJt(n,e){var t;if(ug(e))t=function(i,a){return e(i)-e(a)};else{var r=[];KS(e)?r.push(e):ju(e)&&(r=e),t=function(i,a){for(var o=0;o<r.length;o+=1){var s=r[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return n.sort(t),n}function w$e(n,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++){var a=n[r];e.has(a)||(t.push(a),e.set(a,!0))}return t}var LJt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return w$e([].concat.apply([],n))};const PJt=LJt,OJt=function(n,e){for(var t=[],r={},i=0;i<n.length;i++){var a=n[i],o=a[e];if(!Tw(o)){ju(o)||(o=[o]);for(var s=0;s<o.length;s++){var l=o[s];r[l]||(t.push(l),r[l]=!0)}}}return t};function RJt(n){if(Td(n))return n[0]}function DJt(n){if(Td(n)){var e=n;return e[e.length-1]}}function NJt(n,e){return ju(n)||KS(n)?n[0]===e:!1}function kJt(n,e){return ju(n)||KS(n)?n[n.length-1]===e:!1}var FJt=function(n,e){for(var t=0;t<n.length;t++)if(!e(n[t],t))return!1;return!0};const BJt=FJt;var GJt=function(n,e){for(var t=0;t<n.length;t++)if(e(n[t],t))return!0;return!1};const zJt=GJt;var UJt=Object.prototype.hasOwnProperty;function b$e(n,e){if(!e||!ju(n))return{};for(var t={},r=ug(e)?e:function(s){return s[e]},i,a=0;a<n.length;a++){var o=n[a];i=r(o),UJt.call(t,i)?t[i].push(o):t[i]=[o]}return t}function E$e(n,e){if(!e)return{0:n};if(!ug(e)){var t=ju(e)?e:e.replace(/\s+/g,"").split("*");e=function(r){for(var i="_",a=0,o=t.length;a<o;a++)i+=r[t[a]]&&r[t[a]].toString();return i}}return b$e(n,e)}const VJt=function(n,e){if(!e)return[n];var t=E$e(n,e),r=[];for(var i in t)r.push(t[i]);return r};function $Jt(n,e){return n["_wrap_"+e]}function WJt(n,e){if(n["_wrap_"+e])return n["_wrap_"+e];var t=function(r){n[e](r)};return n["_wrap_"+e]=t,t}var jwe={};function HJt(n){var e=jwe[n];if(!e){for(var t=n.toString(16),r=t.length;r<6;r++)t="0"+t;e="#"+t,jwe[n]=e}return e}function jJt(n){var e=0,t=0,r=0,i=0;return ju(n)?n.length===1?e=t=r=i=n[0]:n.length===2?(e=r=n[0],t=i=n[1]):n.length===3?(e=n[0],t=i=n[1],r=n[2]):(e=n[0],t=n[1],r=n[2],i=n[3]):e=t=r=i=n,{r1:e,r2:t,r3:r,r4:i}}var XJt=function(n,e,t){return n<e?e:n>t?t:n};const YJt=XJt;var qJt=function(n,e){var t=e.toString(),r=t.indexOf(".");if(r===-1)return Math.round(n);var i=t.substr(r+1).length;return i>20&&(i=20),parseFloat(n.toFixed(i))};const ZJt=qJt;function U_(n){return typeof n=="number"}function KJt(n){return U_(n)&&n%1!==0}function JJt(n){return U_(n)&&n%2===0}function QJt(n){return U_(n)&&n%1===0}function eQt(n){return U_(n)&&n<0}var tQt=1e-5;function rQt(n,e,t){return t===void 0&&(t=tQt),n===e||Math.abs(n-e)<t}function nQt(n){return U_(n)&&n%2!==0}var iQt=function(n){return U_(n)&&n>0};const aQt=iQt,oQt=function(n,e){if(!!ju(n)){for(var t,r=-1/0,i=0;i<n.length;i++){var a=n[i],o=ug(e)?e(a):a[e];o>r&&(t=a,r=o)}return t}},sQt=function(n,e){if(!!ju(n)){for(var t,r=1/0,i=0;i<n.length;i++){var a=n[i],o=ug(e)?e(a):a[e];o<r&&(t=a,r=o)}return t}};var lQt=function(n,e){return(n%e+e)%e};const uQt=lQt;var hQt=180/Math.PI,cQt=function(n){return hQt*n};const fQt=cQt,dQt=parseInt;var vQt=Math.PI/180,pQt=function(n){return vQt*n};const gQt=pQt,Xwe=function(n,e){return n.hasOwnProperty(e)};var yQt=Object.values?function(n){return Object.values(n)}:function(n){var e=[];return OM(n,function(t,r){ug(n)&&r==="prototype"||e.push(t)}),e};const T$e=yQt,mQt=function(n,e){return L9(T$e(n),e)},tk=function(n){return Tw(n)?"":n.toString()};var _Qt=function(n){return tk(n).toLowerCase()};const xQt=_Qt;var SQt=function(n){var e=tk(n);return e.charAt(0).toLowerCase()+e.substring(1)};const wQt=SQt;function bQt(n,e){return!n||!e?n:n.replace(/\\?\{([^{}]+)\}/g,function(t,r){return t.charAt(0)==="\\"?t.slice(1):e[r]===void 0?"":e[r]})}var EQt=function(n){return tk(n).toUpperCase()};const TQt=EQt;var CQt=function(n){var e=tk(n);return e.charAt(0).toUpperCase()+e.substring(1)};const AQt=CQt;var MQt={}.toString,IQt=function(n){return MQt.call(n).replace(/^\[object /,"").replace(/]$/,"")};const C$e=IQt;var LQt=function(n){return ZI(n,"Arguments")};const PQt=LQt;var OQt=function(n){return ZI(n,"Boolean")};const RQt=OQt;function DQt(n){return n instanceof Date}var NQt=function(n){return ZI(n,"Error")};const kQt=NQt;function FQt(n){return U_(n)&&isFinite(n)}function BQt(n){return n===null}var GQt=Object.prototype,zQt=function(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||GQt;return n===t};const A$e=zQt;var UQt=function(n){return ZI(n,"RegExp")};const VQt=UQt;var $Qt=function(n){return n===void 0};const WQt=$Qt;function HQt(n){return n instanceof Element||n instanceof Document}function jQt(n){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return e(n)}function XQt(n){var e=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;e(n)}function oY(n,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(n[t]=e[t])}function jA(n,e,t,r){return e&&oY(n,e),t&&oY(n,t),r&&oY(n,r),n}var YQt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=n[0],r=1;r<n.length;r++){var i=n[r];ug(i)&&(i=i.prototype),jA(t.prototype,i)}};const qQt=YQt;var Oee=function(n){if(typeof n!="object"||n===null)return n;var e;if(ju(n)){e=[];for(var t=0,r=n.length;t<r;t++)typeof n[t]=="object"&&n[t]!=null?e[t]=Oee(n[t]):e[t]=n[t]}else{e={};for(var i in n)typeof n[i]=="object"&&n[i]!=null?e[i]=Oee(n[i]):e[i]=n[i]}return e};const ZQt=Oee;function KQt(n,e,t){var r;return function(){var i=this,a=arguments,o=function(){r=null,t||n.apply(i,a)},s=t&&!r;clearTimeout(r),r=setTimeout(o,e),s&&n.apply(i,a)}}function JQt(n){var e,t,r,i=n||1;function a(s,l){++e>i&&(r=t,o(1),++e),t[s]=l}function o(s){e=0,t=Object.create(null),s||(r=Object.create(null))}return o(),{clear:o,has:function(s){return t[s]!==void 0||r[s]!==void 0},get:function(s){var l=t[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return a(s,l),l},set:function(s,l){t[s]!==void 0?t[s]=l:a(s,l)}}}var sY=new Map;function M$e(n,e,t){t===void 0&&(t=128);var r=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0];sY.has(n)||sY.set(n,JQt(t));var s=sY.get(n);if(s.has(o))return s.get(o);var l=n.apply(this,i);return s.set(o,l),l};return r}var QQt=5;function eer(n,e){if(Object.hasOwn)return Object.hasOwn(n,e);if(n==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(n),e)}function I$e(n,e,t,r){t=t||0,r=r||QQt;for(var i in e)if(eer(e,i)){var a=e[i];a!==null&&RM(a)?(RM(n[i])||(n[i]={}),t<r?I$e(n[i],a,t+1,r):n[i]=e[i]):ju(a)?(n[i]=[],n[i]=n[i].concat(a)):a!==void 0&&(n[i]=a)}}var ter=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0;r<e.length;r+=1)I$e(n,e[r]);return n};const rer=ter;var ner=function(n,e,t,r){ug(e)||(t=e,e=n,n=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function l(){}l.prototype=o;var u=new l;return u.constructor=s,u},a=i(e.prototype,n);return n.prototype=jA(a,n.prototype),n.superclass=i(e.prototype,e),jA(a,t),jA(n,r),n};const ier=ner;var aer=function(n,e){if(!Td(n))return-1;var t=Array.prototype.indexOf;if(t)return t.call(n,e);for(var r=-1,i=0;i<n.length;i++)if(n[i]===e){r=i;break}return r};const oer=aer;var ser=Object.prototype.hasOwnProperty;function ler(n){if(Tw(n))return!0;if(Td(n))return!n.length;var e=C$e(n);if(e==="Map"||e==="Set")return!n.size;if(A$e(n))return!Object.keys(n).length;for(var t in n)if(ser.call(n,t))return!1;return!0}var Ree=function(n,e){if(n===e)return!0;if(!n||!e||KS(n)||KS(e))return!1;if(Td(n)||Td(e)){if(n.length!==e.length)return!1;for(var t=!0,r=0;r<n.length&&(t=Ree(n[r],e[r]),!!t);r++);return t}if(P9(n)||P9(e)){var i=Object.keys(n),a=Object.keys(e);if(i.length!==a.length)return!1;for(var t=!0,r=0;r<i.length&&(t=Ree(n[i[r]],e[i[r]]),!!t);r++);return t}return!1};const L$e=Ree,uer=function(n,e,t){return ug(t)?!!t(n,e):L$e(n,e)};var her=function(n,e){if(!Td(n))return n;for(var t=[],r=0;r<n.length;r++){var i=n[r];t.push(e(i,r))}return t};const cer=her;var fer=function(n){return n};const der=function(n,e){e===void 0&&(e=fer);var t={};return uV(n)&&!Tw(n)&&Object.keys(n).forEach(function(r){t[r]=e(n[r],r)}),t},ver=function(n,e,t){for(var r=0,i=KS(e)?e.split("."):e;n&&r<i.length;)n=n[i[r++]];return n===void 0||r<i.length?t:n},per=function(n,e,t){var r=n,i=KS(e)?e.split("."):e;return i.forEach(function(a,o){o<i.length-1?(uV(r[a])||(r[a]=U_(i[o+1])?[]:{}),r=r[a]):r[a]=t}),n};var ger=Object.prototype.hasOwnProperty;const yer=function(n,e){if(n===null||!RM(n))return{};var t={};return OM(e,function(r){ger.call(n,r)&&(t[r]=n[r])}),t},mer=function(n,e){return S$e(n,function(t,r,i){return e.includes(i)||(t[i]=r),t},{})},_er=function(n,e,t){var r,i,a,o,s=0;t||(t={});var l=function(){s=t.leading===!1?0:Date.now(),r=null,o=n.apply(i,a),r||(i=a=null)},u=function(){var h=Date.now();!s&&t.leading===!1&&(s=h);var c=e-(h-s);return i=this,a=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=h,o=n.apply(i,a),r||(i=a=null)):!r&&t.trailing!==!1&&(r=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(r),s=0,r=i=a=null},u},xer=function(n){return Td(n)?Array.prototype.slice.call(n):[]};var O5={};const Ser=function(n){return n=n||"g",O5[n]?O5[n]+=1:O5[n]=1,n+O5[n]},wer=function(){},ber=function(n){return n};function Eer(n){return Tw(n)?0:Td(n)?n.length:Object.keys(n).length}var Ter=function(){function n(){this.map={}}return n.prototype.has=function(e){return this.map[e]!==void 0},n.prototype.get=function(e,t){var r=this.map[e];return r===void 0?t:r},n.prototype.set=function(e,t){this.map[e]=t},n.prototype.clear=function(){this.map={}},n.prototype.delete=function(e){delete this.map[e]},n.prototype.size=function(){return Object.keys(this.map).length},n}();const Cer=Ter;var Aer=/rgba?\(([\s.,0-9]+)\)/;function Mer(){var n=document.getElementById("antv-web-colour-picker");return n||(n=document.createElement("i"),n.id="antv-web-colour-picker",n.title="Web Colour Picker",n.style.display="none",document.body.appendChild(n),n)}function Ier(n){if(n[0]==="#"&&n.length===7)return n;var e=Mer();e.style.color=n;var t=document.defaultView.getComputedStyle(e,"").getPropertyValue("color"),r=Aer.exec(t),i=r[1].split(/\s*,\s*/).map(function(a){return Number(a)});return t=f$e(i),t}var P$e=M$e(Ier,function(n){return n},256);function lY(n,e,t,r){return n[r]+(e[r]-n[r])*t}function Ler(n,e){var t=isNaN(Number(e))||e<0?0:e>1?1:Number(e),r=n.length-1,i=Math.floor(r*t),a=r*t-i,o=n[i],s=i===r?o:n[i+1];return f$e([lY(o,s,a,0),lY(o,s,a,1),lY(o,s,a,2)])}function Per(n){var e=typeof n=="string"?n.split("-"):n,t=e.map(function(r){return c$e(r.indexOf("#")===-1?P$e(r):r)});return function(r){return Ler(t,r)}}var Oer=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Rer=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Der=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Ner(n){return/^[r,R,L,l]{1}[\s]*\(/.test(n)}function ker(n){if(Ner(n)){var e,t=void 0;if(n[0]==="l"){var r=Oer.exec(n),i=+r[1]+90;t=r[2],e="linear-gradient(".concat(i,"deg, ")}else if(n[0]==="r"){e="radial-gradient(";var r=Rer.exec(n);t=r[4]}var a=t.match(Der);return a.forEach(function(o,s){var l=o.split(":");e+="".concat(l[1]," ").concat(Number(l[0])*100,"%"),s!==a.length-1&&(e+=", ")}),e+=")",e}return n}function Fer(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return Boe(r,t),Om(n,r,e)}function Ber(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return Goe(r,t),Om(n,r,e)}function Ger(n,e,t){var r=[0,0,0,0,0,0,0,0,0];return zoe(r,t),Om(n,r,e)}function zer(n,e,t){return Om(n,t,e)}function Uer(n,e){for(var t=n?[].concat(n):[1,0,0,0,1,0,0,0,1],r=0,i=e.length;r<i;r++){var a=e[r];switch(a[0]){case"t":Fer(t,t,[a[1],a[2]]);break;case"s":Ger(t,t,[a[1],a[2]]);break;case"r":Ber(t,t,a[1]);break;case"m":zer(t,t,a[1]);break}}return t}function O$e(n,e){return n[0]*e[1]-e[0]*n[1]}function Ver(n,e,t){var r=k7e(n,e),i=O$e(n,e)>=0;return t?i?Math.PI*2-r:r:i?r:Math.PI*2-r}function $er(n,e,t){return t?(n[0]=e[1],n[1]=-1*e[0]):(n[0]=-1*e[1],n[1]=e[0]),n}function Wer(n,e){if(e==="off")return[].concat(n);var t=typeof e=="number"&&e>=1?Math.pow(10,e):1;return n.map(function(r){var i=r.slice(1).map(Number).map(function(a){return e?Math.round(a*t)/t:Math.round(a)});return[r[0]].concat(i)})}function Her(n,e){return e===void 0&&(e="off"),Wer(n,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")}var R$e={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function jer(n,e,t){if(n[t].length>7){n[t].shift();for(var r=n[t],i=t;r.length;)e[t]="A",n.splice(i+=1,0,["C"].concat(r.splice(0,6)));n.splice(t,1)}}var xR={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function D$e(n){return Array.isArray(n)&&n.every(function(e){var t=e[0].toLowerCase();return xR[t]===e.length-1&&"achlmqstvz".includes(t)})}function N$e(n){return D$e(n)&&n.every(function(e){var t=e[0];return t===t.toUpperCase()})}function k$e(n){return N$e(n)&&n.every(function(e){var t=e[0];return"ACLMQZ".includes(t)})}function Ywe(n){for(var e=n.pathValue[n.segmentStart],t=e.toLowerCase(),r=n.data;r.length>=xR[t]&&(t==="m"&&r.length>2?(n.segments.push([e].concat(r.splice(0,2))),t="l",e=e==="m"?"l":"L"):n.segments.push([e].concat(r.splice(0,xR[t]))),!!xR[t]););}function Xer(n){var e=n.index,t=n.pathValue,r=t.charCodeAt(e);if(r===48){n.param=0,n.index+=1;return}if(r===49){n.param=1,n.index+=1;return}n.err='[path-util]: invalid Arc flag "'.concat(t[e],'", expecting 0 or 1 at index ').concat(e)}function Yer(n){return n>=48&&n<=57||n===43||n===45||n===46}function dC(n){return n>=48&&n<=57}function qer(n){var e=n.max,t=n.pathValue,r=n.index,i=r,a=!1,o=!1,s=!1,l=!1,u;if(i>=e){n.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(u=t.charCodeAt(i),(u===43||u===45)&&(i+=1,u=t.charCodeAt(i)),!dC(u)&&u!==46){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" is not a number');return}if(u!==46){if(a=u===48,i+=1,u=t.charCodeAt(i),a&&i<e&&u&&dC(u)){n.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(t[r],'" illegal number');return}for(;i<e&&dC(t.charCodeAt(i));)i+=1,o=!0;u=t.charCodeAt(i)}if(u===46){for(l=!0,i+=1;dC(t.charCodeAt(i));)i+=1,s=!0;u=t.charCodeAt(i)}if(u===101||u===69){if(l&&!o&&!s){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" invalid float exponent');return}if(i+=1,u=t.charCodeAt(i),(u===43||u===45)&&(i+=1),i<e&&dC(t.charCodeAt(i)))for(;i<e&&dC(t.charCodeAt(i));)i+=1;else{n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" invalid integer exponent');return}}n.index=i,n.param=+n.pathValue.slice(r,i)}function Zer(n){var e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return n===10||n===13||n===8232||n===8233||n===32||n===9||n===11||n===12||n===160||n>=5760&&e.includes(n)}function JB(n){for(var e=n.pathValue,t=n.max;n.index<t&&Zer(e.charCodeAt(n.index));)n.index+=1}function Ker(n){switch(n|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function Jer(n){return(n|32)===97}function Qer(n){var e=n.max,t=n.pathValue,r=n.index,i=t.charCodeAt(r),a=xR[t[r].toLowerCase()];if(n.segmentStart=r,!Ker(i)){n.err='[path-util]: Invalid path value "'.concat(t[r],'" is not a path command');return}if(n.index+=1,JB(n),n.data=[],!a){Ywe(n);return}for(;;){for(var o=a;o>0;o-=1){if(Jer(i)&&(o===3||o===4)?Xer(n):qer(n),n.err.length)return;n.data.push(n.param),JB(n),n.index<e&&t.charCodeAt(n.index)===44&&(n.index+=1,JB(n))}if(n.index>=n.max||!Yer(t.charCodeAt(n.index)))break}Ywe(n)}var etr=function(){function n(e){this.pathValue=e,this.segments=[],this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return n}();function hV(n){if(D$e(n))return[].concat(n);var e=new etr(n);for(JB(e);e.index<e.max&&!e.err.length;)Qer(e);return e.err?e.err:e.segments}function F$e(n){if(N$e(n))return[].concat(n);var e=hV(n),t=0,r=0,i=0,a=0;return e.map(function(o){var s=o.slice(1).map(Number),l=o[0],u=l.toUpperCase();if(l==="M")return t=s[0],r=s[1],i=t,a=r,["M",t,r];var h;if(l!==u)switch(u){case"A":h=[u,s[0],s[1],s[2],s[3],s[4],s[5]+t,s[6]+r];break;case"V":h=[u,s[0]+r];break;case"H":h=[u,s[0]+t];break;default:{var c=s.map(function(d,v){return d+(v%2?r:t)});h=[u].concat(c)}}else h=[u].concat(s);var f=h.length;switch(u){case"Z":t=i,r=a;break;case"H":t=h[1];break;case"V":r=h[1];break;default:t=h[f-2],r=h[f-1],u==="M"&&(i=t,a=r)}return h})}function ttr(n,e){var t=n[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=n.slice(1).map(Number),l=n;if("TQ".includes(t)||(e.qx=null,e.qy=null),t==="H")l=["L",n[1],i];else if(t==="V")l=["L",r,n[1]];else if(t==="S"){var u=r*2-a,h=i*2-o;e.x1=u,e.y1=h,l=["C",u,h].concat(s)}else if(t==="T"){var c=r*2-e.qx,f=i*2-e.qy;e.qx=c,e.qy=f,l=["Q",c,f].concat(s)}else if(t==="Q"){var d=s[0],v=s[1];e.qx=d,e.qy=v}return l}function cV(n){if(k$e(n))return[].concat(n);for(var e=F$e(n),t=ve({},R$e),r=0;r<e.length;r+=1){e[r]=ttr(e[r],t);var i=e[r],a=i.length;t.x1=+i[a-2],t.y1=+i[a-1],t.x2=+i[a-4]||t.x1,t.y2=+i[a-3]||t.y1}return e}function rtr(n){return k$e(n)&&n.every(function(e){var t=e[0];return"MC".includes(t)})}function R5(n,e,t){var r=n*Math.cos(t)-e*Math.sin(t),i=n*Math.sin(t)+e*Math.cos(t);return{x:r,y:i}}function Qse(n,e,t,r,i,a,o,s,l,u){var h=n,c=e,f=t,d=r,v=s,p=l,g=Math.PI*120/180,m=Math.PI/180*(+i||0),y=[],_,x,S,w,b;if(u)x=u[0],S=u[1],w=u[2],b=u[3];else{_=R5(h,c,-m),h=_.x,c=_.y,_=R5(v,p,-m),v=_.x,p=_.y;var E=(h-v)/2,T=(c-p)/2,C=E*E/(f*f)+T*T/(d*d);C>1&&(C=Math.sqrt(C),f*=C,d*=C);var A=f*f,M=d*d,I=(a===o?-1:1)*Math.sqrt(Math.abs((A*M-A*T*T-M*E*E)/(A*T*T+M*E*E)));w=I*f*T/d+(h+v)/2,b=I*-d*E/f+(c+p)/2,x=Math.asin(((c-b)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),S=Math.asin(((p-b)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),x=h<w?Math.PI-x:x,S=v<w?Math.PI-S:S,x<0&&(x=Math.PI*2+x),S<0&&(S=Math.PI*2+S),o&&x>S&&(x-=Math.PI*2),!o&&S>x&&(S-=Math.PI*2)}var R=S-x;if(Math.abs(R)>g){var k=S,D=v,G=p;S=x+g*(o&&S>x?1:-1),v=w+f*Math.cos(S),p=b+d*Math.sin(S),y=Qse(v,p,f,d,i,0,o,D,G,[S,k,w,b])}R=S-x;var W=Math.cos(x),z=Math.sin(x),V=Math.cos(S),q=Math.sin(S),Y=Math.tan(R/4),le=4/3*f*Y,j=4/3*d*Y,Q=[h,c],ie=[h+le*z,c-j*W],oe=[v+le*q,p-j*V],se=[v,p];if(ie[0]=2*Q[0]-ie[0],ie[1]=2*Q[1]-ie[1],u)return ie.concat(oe,se,y);y=ie.concat(oe,se,y);for(var me=[],Ce=0,Le=y.length;Ce<Le;Ce+=1)me[Ce]=Ce%2?R5(y[Ce-1],y[Ce],m).y:R5(y[Ce],y[Ce+1],m).x;return me}function ntr(n,e,t,r,i,a){var o=.3333333333333333,s=2/3;return[o*n+s*t,o*e+s*r,o*i+s*t,o*a+s*r,i,a]}function Gx(n,e,t){var r=n[0],i=n[1],a=e[0],o=e[1];return[r+(a-r)*t,i+(o-i)*t]}var qwe=function(n,e,t,r){var i=.5,a=Gx([n,e],[t,r],i);return _v(_v([],a,!0),[t,r,t,r],!1)};function itr(n,e){var t=n[0],r=n.slice(1).map(Number),i=r[0],a=r[1],o,s=e.x1,l=e.y1,u=e.x,h=e.y;switch("TQ".includes(t)||(e.qx=null,e.qy=null),t){case"M":return e.x=i,e.y=a,n;case"A":return o=[s,l].concat(r),["C"].concat(Qse(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],o[8],o[9]));case"Q":return e.qx=i,e.qy=a,o=[s,l].concat(r),["C"].concat(ntr(o[0],o[1],o[2],o[3],o[4],o[5]));case"L":return["C"].concat(qwe(s,l,i,a));case"Z":return s===u&&l===h?["C",s,l,u,h,u,h]:["C"].concat(qwe(s,l,u,h))}return n}function B$e(n,e){if(e===void 0&&(e=!1),rtr(n)){var t=[].concat(n);return e?[t,[]]:t}for(var r=cV(n),i=ve({},R$e),a=[],o="",s=r.length,l,u,h=[],c=0;c<s;c+=1){r[c]&&(o=r[c][0]),a[c]=o;var f=itr(r[c],i);r[c]=f,jer(r,a,c),s=r.length,o==="Z"&&h.push(c),l=r[c],u=l.length,i.x1=+l[u-2],i.y1=+l[u-1],i.x2=+l[u-4]||i.x1,i.y2=+l[u-3]||i.y1}return e?[r,h]:r}function atr(n){return hV(n)}function otr(n){return n.map(function(e){return Array.isArray(e)?[].concat(e):e})}function str(n){var e=n.slice(1).map(function(t,r,i){return r?i[r-1].slice(-2).concat(t.slice(1)):n[0].slice(1).concat(t.slice(1))}).map(function(t){return t.map(function(r,i){return t[t.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))}function KI(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}function Dee(n,e,t,r,i){var a=KI([n,e],[t,r]),o={x:0,y:0};if(typeof i=="number")if(i<=0)o={x:n,y:e};else if(i>=a)o={x:t,y:r};else{var s=Gx([n,e],[t,r],i/a),l=s[0],u=s[1];o={x:l,y:u}}return{length:a,point:o,min:{x:Math.min(n,t),y:Math.min(e,r)},max:{x:Math.max(n,t),y:Math.max(e,r)}}}function Zwe(n,e){var t=n.x,r=n.y,i=e.x,a=e.y,o=t*i+r*a,s=Math.sqrt((Math.pow(t,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),l=t*a-r*i<0?-1:1,u=l*Math.acos(o/s);return u}function ltr(n,e,t,r,i,a,o,s,l,u){var h=Math.abs,c=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=h(t),g=h(r),m=(i%360+360)%360,y=m*(v/180);if(n===s&&e===l)return{x:n,y:e};if(p===0||g===0)return Dee(n,e,s,l,u).point;var _=(n-s)/2,x=(e-l)/2,S={x:f(y)*_+c(y)*x,y:-c(y)*_+f(y)*x},w=Math.pow(S.x,2)/Math.pow(p,2)+Math.pow(S.y,2)/Math.pow(g,2);w>1&&(p*=d(w),g*=d(w));var b=Math.pow(p,2)*Math.pow(g,2)-Math.pow(p,2)*Math.pow(S.y,2)-Math.pow(g,2)*Math.pow(S.x,2),E=Math.pow(p,2)*Math.pow(S.y,2)+Math.pow(g,2)*Math.pow(S.x,2),T=b/E;T=T<0?0:T;var C=(a!==o?1:-1)*d(T),A={x:C*(p*S.y/g),y:C*(-(g*S.x)/p)},M={x:f(y)*A.x-c(y)*A.y+(n+s)/2,y:c(y)*A.x+f(y)*A.y+(e+l)/2},I={x:(S.x-A.x)/p,y:(S.y-A.y)/g},R=Zwe({x:1,y:0},I),k={x:(-S.x-A.x)/p,y:(-S.y-A.y)/g},D=Zwe(I,k);!o&&D>0?D-=2*v:o&&D<0&&(D+=2*v),D%=2*v;var G=R+D*u,W=p*f(G),z=g*c(G),V={x:f(y)*W-c(y)*z+M.x,y:c(y)*W+f(y)*z+M.y};return V}function utr(n,e,t,r,i,a,o,s,l,u,h){var c,f=h.bbox,d=f===void 0?!0:f,v=h.length,p=v===void 0?!0:v,g=h.sampleSize,m=g===void 0?30:g,y=typeof u=="number",_=n,x=e,S=0,w=[_,x,S],b=[_,x],E=0,T={x:0,y:0},C=[{x:_,y:x}];y&&u<=0&&(T={x:_,y:x});for(var A=0;A<=m;A+=1){if(E=A/m,c=ltr(n,e,t,r,i,a,o,s,l,E),_=c.x,x=c.y,d&&C.push({x:_,y:x}),p&&(S+=KI(b,[_,x])),b=[_,x],y&&S>=u&&u>w[2]){var M=(S-u)/(S-w[2]);T={x:b[0]*(1-M)+w[0]*M,y:b[1]*(1-M)+w[1]*M}}w=[_,x,S]}return y&&u>=S&&(T={x:s,y:l}),{length:S,point:T,min:{x:Math.min.apply(null,C.map(function(I){return I.x})),y:Math.min.apply(null,C.map(function(I){return I.y}))},max:{x:Math.max.apply(null,C.map(function(I){return I.x})),y:Math.max.apply(null,C.map(function(I){return I.y}))}}}function htr(n,e,t,r,i,a,o,s,l){var u=1-l;return{x:Math.pow(u,3)*n+3*Math.pow(u,2)*l*t+3*u*Math.pow(l,2)*i+Math.pow(l,3)*o,y:Math.pow(u,3)*e+3*Math.pow(u,2)*l*r+3*u*Math.pow(l,2)*a+Math.pow(l,3)*s}}function G$e(n,e,t,r,i,a,o,s,l,u){var h,c=u.bbox,f=c===void 0?!0:c,d=u.length,v=d===void 0?!0:d,p=u.sampleSize,g=p===void 0?10:p,m=typeof l=="number",y=n,_=e,x=0,S=[y,_,x],w=[y,_],b=0,E={x:0,y:0},T=[{x:y,y:_}];m&&l<=0&&(E={x:y,y:_});for(var C=0;C<=g;C+=1){if(b=C/g,h=htr(n,e,t,r,i,a,o,s,b),y=h.x,_=h.y,f&&T.push({x:y,y:_}),v&&(x+=KI(w,[y,_])),w=[y,_],m&&x>=l&&l>S[2]){var A=(x-l)/(x-S[2]);E={x:w[0]*(1-A)+S[0]*A,y:w[1]*(1-A)+S[1]*A}}S=[y,_,x]}return m&&l>=x&&(E={x:o,y:s}),{length:x,point:E,min:{x:Math.min.apply(null,T.map(function(M){return M.x})),y:Math.min.apply(null,T.map(function(M){return M.y}))},max:{x:Math.max.apply(null,T.map(function(M){return M.x})),y:Math.max.apply(null,T.map(function(M){return M.y}))}}}function ctr(n,e,t,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*n+2*s*o*t+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function ftr(n,e,t,r,i,a,o,s){var l,u=s.bbox,h=u===void 0?!0:u,c=s.length,f=c===void 0?!0:c,d=s.sampleSize,v=d===void 0?10:d,p=typeof o=="number",g=n,m=e,y=0,_=[g,m,y],x=[g,m],S=0,w={x:0,y:0},b=[{x:g,y:m}];p&&o<=0&&(w={x:g,y:m});for(var E=0;E<=v;E+=1){if(S=E/v,l=ctr(n,e,t,r,i,a,S),g=l.x,m=l.y,h&&b.push({x:g,y:m}),f&&(y+=KI(x,[g,m])),x=[g,m],p&&y>=o&&o>_[2]){var T=(y-o)/(y-_[2]);w={x:x[0]*(1-T)+_[0]*T,y:x[1]*(1-T)+_[1]*T}}_=[g,m,y]}return p&&o>=y&&(w={x:i,y:a}),{length:y,point:w,min:{x:Math.min.apply(null,b.map(function(C){return C.x})),y:Math.min.apply(null,b.map(function(C){return C.y}))},max:{x:Math.max.apply(null,b.map(function(C){return C.x})),y:Math.max.apply(null,b.map(function(C){return C.y}))}}}function fV(n,e,t){for(var r,i,a,o,s,l,u=cV(n),h=typeof e=="number",c,f=[],d,v=0,p=0,g=0,m=0,y,_=[],x=[],S=0,w={x:0,y:0},b=w,E=w,T=w,C=0,A=0,M=u.length;A<M;A+=1)y=u[A],d=y[0],c=d==="M",f=c?f:[v,p].concat(y.slice(1)),c?(g=y[1],m=y[2],w={x:g,y:m},b=w,S=0,h&&e<.001&&(T=w)):d==="L"?(r=Dee(f[0],f[1],f[2],f[3],(e||0)-C),S=r.length,w=r.min,b=r.max,E=r.point):d==="A"?(i=utr(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],(e||0)-C,t||{}),S=i.length,w=i.min,b=i.max,E=i.point):d==="C"?(a=G$e(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],(e||0)-C,t||{}),S=a.length,w=a.min,b=a.max,E=a.point):d==="Q"?(o=ftr(f[0],f[1],f[2],f[3],f[4],f[5],(e||0)-C,t||{}),S=o.length,w=o.min,b=o.max,E=o.point):d==="Z"&&(f=[v,p,g,m],s=Dee(f[0],f[1],f[2],f[3],(e||0)-C),S=s.length,w=s.min,b=s.max,E=s.point),h&&C<e&&C+S>=e&&(T=E),x.push(b),_.push(w),C+=S,l=d!=="Z"?y.slice(-2):[g,m],v=l[0],p=l[1];return h&&e>=C&&(T={x:v,y:p}),{length:C,point:T,min:{x:Math.min.apply(null,_.map(function(I){return I.x})),y:Math.min.apply(null,_.map(function(I){return I.y}))},max:{x:Math.max.apply(null,x.map(function(I){return I.x})),y:Math.max.apply(null,x.map(function(I){return I.y}))}}}function dtr(n,e){if(!n)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var t=fV(n,void 0,ve(ve({},e),{length:!1})),r=t.min,i=r.x,a=r.y,o=t.max,s=o.x,l=o.y,u=s-i,h=l-a;return{width:u,height:h,x:i,y:a,x2:s,y2:l,cx:i+u/2,cy:a+h/2,cz:Math.max(u,h)+Math.min(u,h)/2}}function SR(n,e){return fV(n,void 0,ve(ve({},e),{bbox:!1,length:!0})).length}function vtr(n,e){if(!n)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var t=fV(n,void 0,ve(ve({},e),{bbox:!0,length:!0})),r=t.length,i=t.min,a=i.x,o=i.y,s=t.max,l=s.x,u=s.y,h=l-a,c=u-o;return{length:r,width:h,height:c,x:a,y:o,x2:l,y2:u,cx:a+h/2,cy:o+c/2,cz:Math.max(h,c)+Math.min(h,c)/2}}function ptr(n){var e=n.length,t=e-1;return n.map(function(r,i){return n.map(function(a,o){var s=i+o,l;return o===0||n[s]&&n[s][0]==="M"?(l=n[s],["M"].concat(l.slice(-2))):(s>=e&&(s-=t),n[s])})})}function gtr(n,e){var t=n.length-1,r=[],i=0,a=0,o=ptr(n);return o.forEach(function(s,l){n.slice(1).forEach(function(u,h){a+=KI(n[(l+h)%t].slice(-2),e[h%t].slice(-2))}),r[l]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),o[i]}function ytr(n,e,t,r,i,a,o,s){return 3*((s-e)*(t+i)-(o-n)*(r+a)+r*(n-i)-t*(e-a)+s*(i+n/3)-o*(a+e/3))/20}function z$e(n){var e=0,t=0,r=0;return B$e(n).map(function(i){var a;switch(i[0]){case"M":return e=i[1],t=i[2],0;default:var o=i.slice(1),s=o[0],l=o[1],u=o[2],h=o[3],c=o[4],f=o[5];return r=ytr(e,t,s,l,u,h,c,f),a=i.slice(-2),e=a[0],t=a[1],r}}).reduce(function(i,a){return i+a},0)}function mtr(n){return z$e(n)>=0}function QB(n,e,t){return fV(n,e,ve(ve({},t),{bbox:!1,length:!0})).point}function _tr(n,e){var t=hV(n);if(typeof t=="string")throw TypeError(t);var r=t.slice(),i=SR(r),a=r.length-1,o=0,s=0,l=t[0],u=l.slice(-2),h=u[0],c=u[1],f={x:h,y:c};if(a<=0||!e||!Number.isFinite(e))return{segment:l,index:0,length:s,point:f,lengthAtSegment:o};if(e>=i)return r=t.slice(0,-1),o=SR(r),s=i-o,{segment:t[a],index:a,length:s,lengthAtSegment:o};for(var d=[];a>0;)l=r[a],r=r.slice(0,-1),o=SR(r),s=i-o,i=o,d.push({segment:l,index:a,length:s,lengthAtSegment:o}),a-=1;return d.find(function(v){var p=v.lengthAtSegment;return p<=e})}function xtr(n,e){for(var t=hV(n),r=cV(t),i=SR(t),a=function(S){var w=S.x-e.x,b=S.y-e.y;return w*w+b*b},o=8,s,l=0,u,h=0,c=1/0,f=0;f<=i;f+=o)s=QB(r,f),l=a(s),l<c&&(u=s,h=f,c=l);o/=2;for(var d,v,p=0,g=0,m=0,y=0;o>.5;)p=h-o,d=QB(r,p),m=a(d),g=h+o,v=QB(r,g),y=a(v),p>=0&&m<c?(u=d,h=p,c=m):g<=i&&y<c?(u=v,h=g,c=y):o/=2;var _=_tr(t,h),x=Math.sqrt(c);return{closest:u,distance:x,segment:_}}function Str(n,e){var t=xtr(n,e).distance;return Math.abs(t)<.001}function wtr(n,e){e===void 0&&(e=.5);var t=n.slice(0,2),r=n.slice(2,4),i=n.slice(4,6),a=n.slice(6,8),o=Gx(t,r,e),s=Gx(r,i,e),l=Gx(i,a,e),u=Gx(o,s,e),h=Gx(s,l,e),c=Gx(u,h,e);return[["C"].concat(o,u,c),["C"].concat(h,l,a)]}function Kwe(n){return n.map(function(e,t,r){var i=t&&r[t-1].slice(-2).concat(e.slice(1)),a=t?G$e(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,o;return t?o=a?wtr(i):[e,e]:o=[e],{s:e,ss:o,l:a}})}function U$e(n,e,t){var r=Kwe(n),i=Kwe(e),a=r.length,o=i.length,s=r.filter(function(g){return g.l}).length,l=i.filter(function(g){return g.l}).length,u=r.filter(function(g){return g.l}).reduce(function(g,m){var y=m.l;return g+y},0)/s||0,h=i.filter(function(g){return g.l}).reduce(function(g,m){var y=m.l;return g+y},0)/l||0,c=t||Math.max(a,o),f=[u,h],d=[c-a,c-o],v=0,p=[r,i].map(function(g,m){return g.l===c?g.map(function(y){return y.s}):g.map(function(y,_){return v=_&&d[m]&&y.l>=f[m],d[m]-=v?1:0,v?y.ss:[y.s]}).flat()});return p[0].length===p[1].length?p:U$e(p[0],p[1],c)}var btr=1e-6;function uY(n){return Math.abs(n)<btr?0:n<0?-1:1}function Etr(n,e,t){return(t[0]-n[0])*(e[1]-n[1])===(e[0]-n[0])*(t[1]-n[1])&&Math.min(n[0],e[0])<=t[0]&&t[0]<=Math.max(n[0],e[0])&&Math.min(n[1],e[1])<=t[1]&&t[1]<=Math.max(n[1],e[1])}function Nee(n,e,t){var r=!1,i=n.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=n[a],s=n[(a+1)%i];if(Etr(o,s,[e,t]))return!0;uY(o[1]-t)>0!=uY(s[1]-t)>0&&uY(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}var Jwe=function(n,e,t){return n>=e&&n<=t};function Ttr(n,e,t,r){var i=.001,a={x:t.x-n.x,y:t.y-n.y},o={x:e.x-n.x,y:e.y-n.y},s={x:r.x-t.x,y:r.y-t.y},l=o.x*s.y-o.y*s.x,u=l*l,h=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,f=null;if(u>i*h*c){var d=(a.x*s.y-a.y*s.x)/l,v=(a.x*o.y-a.y*o.x)/l;Jwe(d,0,1)&&Jwe(v,0,1)&&(f={x:n.x+d*o.x,y:n.y+d*o.y})}return f}function Qwe(n){for(var e=[],t=n.length,r=0;r<t-1;r++){var i=n[r],a=n[r+1];e.push({from:{x:i[0],y:i[1]},to:{x:a[0],y:a[1]}})}if(e.length>1){var o=n[0],s=n[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function Ctr(n,e){var t=!1;return n.forEach(function(r){if(Ttr(r.from,r.to,e.from,e.to))return t=!0,!1}),t}function ebe(n){var e=n.map(function(r){return r[0]}),t=n.map(function(r){return r[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function Atr(n,e){return!(e.minX>n.maxX||e.maxX<n.minX||e.minY>n.maxY||e.maxY<n.minY)}function Mtr(n,e){if(n.length<2||e.length<2)return!1;var t=ebe(n),r=ebe(e);if(!Atr(t,r))return!1;var i=!1;if(e.forEach(function(l){if(Nee(n,l[0],l[1]))return i=!0,!1}),i||(n.forEach(function(l){if(Nee(e,l[0],l[1]))return i=!0,!1}),i))return!0;var a=Qwe(n),o=Qwe(e),s=!1;return o.forEach(function(l){if(Ctr(a,l))return s=!0,!1}),s}function Itr(n){var e=document.createElement("div");e.innerHTML=n;var t=e.childNodes[0];return t&&e.contains(t)&&e.removeChild(t),t}function Ltr(n,e){if(!!n)return Object.keys(e).forEach(function(t){n.style[t]=e[t]}),n}const Ptr=Object.freeze(Object.defineProperty({__proto__:null,rgb2arr:c$e,gradient:Per,toRGB:P$e,toCSSGradient:ker,transform:Uer,angleTo:Ver,direction:O$e,vertical:$er,path2String:Her,path2Curve:B$e,path2Absolute:F$e,path2Array:atr,clonePath:otr,normalizePath:cV,reverseCurve:str,arcToCubic:Qse,getPathBBox:dtr,getTotalLength:SR,getPathBBoxTotalLength:vtr,getRotatedCurve:gtr,getPathArea:z$e,getDrawDirection:mtr,getPointAtLength:QB,isPointInStroke:Str,distanceSquareRoot:KI,equalizeSegments:U$e,contains:L9,includes:L9,difference:aJt,find:cJt,findIndex:fJt,firstValue:vJt,flatten:gJt,flattenDeep:yJt,getRange:_Jt,pull:bJt,pullAt:x$e,reduce:S$e,remove:MJt,sortBy:IJt,union:PJt,uniq:w$e,valuesOfKey:OJt,head:RJt,last:DJt,startsWith:NJt,endsWith:kJt,filter:d$e,every:BJt,some:zJt,group:VJt,groupBy:b$e,groupToMap:E$e,getWrapBehavior:$Jt,wrapBehavior:WJt,number2color:HJt,parseRadius:jJt,clamp:YJt,fixedBase:ZJt,isDecimal:KJt,isEven:JJt,isInteger:QJt,isNegative:eQt,isNumberEqual:rQt,isOdd:nQt,isPositive:aQt,max:y$e,maxBy:oQt,min:m$e,minBy:sQt,mod:uQt,toDegree:fQt,toInteger:dQt,toRadian:gQt,forIn:OM,has:Xwe,hasKey:Xwe,hasValue:mQt,keys:v$e,isMatch:p$e,values:T$e,lowerCase:xQt,lowerFirst:wQt,substitute:bQt,upperCase:TQt,upperFirst:AQt,getType:C$e,isArguments:PQt,isArray:ju,isArrayLike:Td,isBoolean:RQt,isDate:DQt,isError:kQt,isFunction:ug,isFinite:FQt,isNil:Tw,isNull:BQt,isNumber:U_,isObject:uV,isObjectLike:P9,isPlainObject:RM,isPrototype:A$e,isRegExp:VQt,isString:KS,isType:ZI,isUndefined:WQt,isElement:HQt,requestAnimationFrame:jQt,clearAnimationFrame:XQt,augment:qQt,clone:ZQt,debounce:KQt,memoize:M$e,deepMix:rer,each:OM,extend:ier,indexOf:oer,isEmpty:ler,isEqual:L$e,isEqualWith:uer,map:cer,mapValues:der,mix:jA,assign:jA,get:ver,set:per,pick:yer,omit:mer,throttle:_er,toArray:xer,toString:tk,uniqueId:Ser,noop:wer,identity:ber,size:Eer,Cache:Cer,isPointInPolygon:Nee,isPolygonsIntersect:Mtr,createDOM:Itr,modifyCSS:Ltr},Symbol.toStringTag,{value:"Module"})),V$e=Nd(Ptr);Object.defineProperty(Jse,"__esModule",{value:!0});var Otr=V$e,Rtr=function(n){for(var e={},t=n.nodes().filter(function(c){var f;return!(!((f=n.children(c))===null||f===void 0)&&f.length)}),r=t.map(function(c){return n.node(c).rank}),i=(0,Otr.max)(r),a=[],o=0;o<i+1;o++)a.push([]);var s=function(c){var f;if(!e.hasOwnProperty(c)){e[c]=!0;var d=n.node(c);isNaN(d.rank)||a[d.rank].push(c),(f=n.successors(c))===null||f===void 0||f.forEach(function(v){return s(v)})}},l=t.sort(function(c,f){return n.node(c).rank-n.node(f).rank}),u=l.filter(function(c){return n.node(c).fixorder!==void 0}),h=u.sort(function(c,f){return n.node(c).fixorder-n.node(f).fixorder});return h==null||h.forEach(function(c){isNaN(n.node(c).rank)||a[n.node(c).rank].push(c),e[c]=!0}),l==null||l.forEach(s),a};Jse.default=Rtr;var ele={};Object.defineProperty(ele,"__esModule",{value:!0});var Dtr=Nv,Ntr=function(n,e,t){for(var r=(0,Dtr.zipObject)(t,t.map(function(h,c){return c})),i=e.map(function(h){var c,f=(c=n.outEdges(h))===null||c===void 0?void 0:c.map(function(d){return{pos:r[d.w]||0,weight:n.edge(d).weight}});return f==null?void 0:f.sort(function(d,v){return d.pos-v.pos})}),a=i.flat().filter(function(h){return h!==void 0}),o=1;o<t.length;)o<<=1;var s=2*o-1;o-=1;var l=Array(s).fill(0,0,s),u=0;return a==null||a.forEach(function(h){if(h){var c=h.pos+o;l[c]+=h.weight;for(var f=0;c>0;)c%2&&(f+=l[c+1]),c=c-1>>1,l[c]+=h.weight;u+=h.weight*f}}),u},ktr=function(n,e){for(var t=0,r=1;r<(e==null?void 0:e.length);r+=1)t+=Ntr(n,e[r-1],e[r]);return t};ele.default=ktr;var tle={};Object.defineProperty(tle,"__esModule",{value:!0});var Ftr=z_,Btr=function(n,e,t){var r=Gtr(n),i=new Ftr.Graph({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(a){return n.node(a)});return n.nodes().forEach(function(a){var o,s=n.node(a),l=n.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,l||r),(o=n[t](a))===null||o===void 0||o.forEach(function(u){var h=u.v===a?u.w:u.v,c=i.edgeFromArgs(h,a),f=c!==void 0?c.weight:0;i.setEdge(h,a,{weight:n.edge(u).weight+f})}),s.hasOwnProperty("minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i},Gtr=function(n){for(var e;n.hasNode(e="_root".concat(Math.random())););return e};tle.default=Btr;var rle={};Object.defineProperty(rle,"__esModule",{value:!0});var ztr=function(n,e,t){var r={},i;t==null||t.forEach(function(a){for(var o=n.parent(a),s,l;o;){if(s=n.parent(o),s?(l=r[s],r[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})};rle.default=ztr;var nle={},ile={};Object.defineProperty(ile,"__esModule",{value:!0});var Utr=function(n,e){return e.map(function(t){var r=n.inEdges(t);if(!(r!=null&&r.length))return{v:t};{var i={sum:0,weight:0};return r==null||r.forEach(function(a){var o=n.edge(a),s=n.node(a.v);i.sum+=o.weight*s.order,i.weight+=o.weight}),{v:t,barycenter:i.sum/i.weight,weight:i.weight}}})};ile.default=Utr;var ale={};Object.defineProperty(ale,"__esModule",{value:!0});var Vtr=function(n,e){var t,r,i,a={};n==null||n.forEach(function(s,l){a[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};var u=a[s.v];s.barycenter!==void 0&&(u.barycenter=s.barycenter,u.weight=s.weight)}),(t=e.edges())===null||t===void 0||t.forEach(function(s){var l=a[s.v],u=a[s.w];l!==void 0&&u!==void 0&&(u.indegree++,l.out.push(a[s.w]))});var o=(i=(r=Object.values(a)).filter)===null||i===void 0?void 0:i.call(r,function(s){return!s.indegree});return $tr(o)},$tr=function(n){for(var e,t,r=[],i=function(u){return function(h){h.merged||(h.barycenter===void 0||u.barycenter===void 0||h.barycenter>=u.barycenter)&&Wtr(u,h)}},a=function(u){return function(h){h.in.push(u),--h.indegree===0&&n.push(h)}},o=function(){var u=n.pop();r.push(u),(e=u.in.reverse())===null||e===void 0||e.forEach(function(h){return i(u)(h)}),(t=u.out)===null||t===void 0||t.forEach(function(h){return a(u)(h)})};n!=null&&n.length;)o();var s=r.filter(function(u){return!u.merged}),l=["vs","i","barycenter","weight"];return s.map(function(u){var h={};return l==null||l.forEach(function(c){u[c]!==void 0&&(h[c]=u[c])}),h})},Wtr=function(n,e){var t,r=0,i=0;n.weight&&(r+=n.barycenter*n.weight,i+=n.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),n.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(n.vs),n.barycenter=r/i,n.weight=i,n.i=Math.min(e.i,n.i),e.merged=!0};ale.default=Vtr;var ole={};Object.defineProperty(ole,"__esModule",{value:!0});var Htr=Nv,jtr=function(n,e,t,r){var i=(0,Htr.partition)(n,function(f){var d=f.hasOwnProperty("fixorder")&&!isNaN(f.fixorder);return r?!d&&f.hasOwnProperty("barycenter"):d||f.hasOwnProperty("barycenter")}),a=i.lhs,o=i.rhs.sort(function(f,d){return-f.i- -d.i}),s=[],l=0,u=0,h=0;a==null||a.sort(Xtr(!!e,!!t)),h=tbe(s,o,h),a==null||a.forEach(function(f){var d;h+=(d=f.vs)===null||d===void 0?void 0:d.length,s.push(f.vs),l+=f.barycenter*f.weight,u+=f.weight,h=tbe(s,o,h)});var c={vs:s.flat()};return u&&(c.barycenter=l/u,c.weight=u),c},tbe=function(n,e,t){for(var r=t,i;e.length&&(i=e[e.length-1]).i<=r;)e.pop(),n==null||n.push(i.vs),r++;return r},Xtr=function(n,e){return function(t,r){if(t.fixorder!==void 0&&r.fixorder!==void 0)return t.fixorder-r.fixorder;if(t.barycenter<r.barycenter)return-1;if(t.barycenter>r.barycenter)return 1;if(e&&t.order!==void 0&&r.order!==void 0){if(t.order<r.order)return-1;if(t.order>r.order)return 1}return n?r.i-t.i:t.i-r.i}};ole.default=jtr;var sle=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(nle,"__esModule",{value:!0});var Ytr=sle(ile),qtr=sle(ale),Ztr=sle(ole),$$e=function(n,e,t,r,i,a){var o,s,l,u,h=n.children(e),c=n.node(e),f=c?c.borderLeft:void 0,d=c?c.borderRight:void 0,v={};f&&(h=h==null?void 0:h.filter(function(x){return x!==f&&x!==d}));var p=(0,Ytr.default)(n,h||[]);p==null||p.forEach(function(x){var S;if(!((S=n.children(x.v))===null||S===void 0)&&S.length){var w=$$e(n,x.v,t,r,a);v[x.v]=w,w.hasOwnProperty("barycenter")&&Jtr(x,w)}});var g=(0,qtr.default)(p,t);Ktr(g,v),(o=g.filter(function(x){return x.vs.length>0}))===null||o===void 0||o.forEach(function(x){var S=n.node(x.vs[0]);S&&(x.fixorder=S.fixorder,x.order=S.order)});var m=(0,Ztr.default)(g,r,i,a);if(f&&(m.vs=[f,m.vs,d].flat(),!((s=n.predecessors(f))===null||s===void 0)&&s.length)){var y=n.node(((l=n.predecessors(f))===null||l===void 0?void 0:l[0])||""),_=n.node(((u=n.predecessors(d))===null||u===void 0?void 0:u[0])||"");m.hasOwnProperty("barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+y.order+_.order)/(m.weight+2),m.weight+=2}return m},Ktr=function(n,e){n==null||n.forEach(function(t){var r,i=(r=t.vs)===null||r===void 0?void 0:r.map(function(a){return e[a]?e[a].vs:a});t.vs=i.flat()})},Jtr=function(n,e){n.barycenter!==void 0?(n.barycenter=(n.barycenter*n.weight+e.barycenter*e.weight)/(n.weight+e.weight),n.weight+=e.weight):(n.barycenter=e.barycenter,n.weight=e.weight)};nle.default=$$e;var rk=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kse,"__esModule",{value:!0});var rbe=rk(Jse),nbe=rk(ele),Qtr=rk(tle),err=rk(rle),trr=rk(nle),ibe=Dl(),rrr=z_,hY=Nv,nrr=function(n,e){for(var t=(0,hY.maxRank)(n),r=[],i=[],a=1;a<t+1;a++)r.push(a);for(var a=t-1;a>-1;a--)i.push(a);var o=abe(n,r,"inEdges"),s=abe(n,i,"outEdges"),l=(0,rbe.default)(n);cY(n,l);for(var u=Number.POSITIVE_INFINITY,h,a=0,c=0;c<4;++a,++c){obe(a%2?o:s,a%4>=2,!1,e),l=(0,hY.buildLayerMatrix)(n);var f=(0,nbe.default)(n,l);f<u&&(c=0,h=(0,ibe.clone)(l),u=f)}l=(0,rbe.default)(n),cY(n,l);for(var a=0,c=0;c<4;++a,++c){obe(a%2?o:s,a%4>=2,!0,e),l=(0,hY.buildLayerMatrix)(n);var f=(0,nbe.default)(n,l);f<u&&(c=0,h=(0,ibe.clone)(l),u=f)}cY(n,h)},abe=function(n,e,t){return e.map(function(r){return(0,Qtr.default)(n,r,t)})},obe=function(n,e,t,r){var i=new rrr.Graph;n==null||n.forEach(function(a){for(var o,s=a.graph().root,l=(0,trr.default)(a,s,i,e,t,r),u=0;u<((o=l.vs)===null||o===void 0?void 0:o.length);u++){var h=a.node(l.vs[u]);h&&(h.order=u)}(0,err.default)(a,i,l.vs)})},cY=function(n,e){e==null||e.forEach(function(t){t==null||t.forEach(function(r,i){n.node(r).order=i})})};Kse.default=nrr;var lle={},W$e={};(function(n){var e=at&&at.__extends||function(){var x=function(S,w){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(b[T]=E[T])},x(S,w)};return function(S,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");x(S,w);function b(){this.constructor=S}S.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0}),n.width=n.sep=n.positionX=n.balance=n.alignCoordinates=n.findSmallestWidthAlignment=n.buildBlockGraph=n.horizontalCompaction=n.verticalAlignment=n.hasConflict=n.addConflict=n.findOtherInnerSegmentNode=n.findType2Conflicts=n.findType1Conflicts=void 0;var t=lV,r=V$e,i=Nv,a=function(x){e(S,x);function S(){return x!==null&&x.apply(this,arguments)||this}return S}(t.Graph),o=function(x,S){var w={},b=function(E,T){var C=0,A=0,M=E.length,I=T==null?void 0:T[(T==null?void 0:T.length)-1];return T==null||T.forEach(function(R,k){var D,G=(0,n.findOtherInnerSegmentNode)(x,R),W=G?x.node(G).order:M;(G||R===I)&&((D=T.slice(A,k+1))===null||D===void 0||D.forEach(function(z){var V;(V=x.predecessors(z))===null||V===void 0||V.forEach(function(q){var Y,le=x.node(q),j=le.order;(j<C||W<j)&&!(le.dummy&&((Y=x.node(z))===null||Y===void 0?void 0:Y.dummy))&&(0,n.addConflict)(w,q,z)})}),A=k+1,C=W)}),T};return S!=null&&S.length&&S.reduce(b),w};n.findType1Conflicts=o;var s=function(x,S){var w={};function b(A,M,I,R,k){for(var D,G,W,z=M;z<I;z++)W=A[z],!((D=x.node(W))===null||D===void 0)&&D.dummy&&((G=x.predecessors(W))===null||G===void 0||G.forEach(function(V){var q=x.node(V);q.dummy&&(q.order<R||q.order>k)&&(0,n.addConflict)(w,V,W)}))}function E(A){return JSON.stringify(A.slice(1))}function T(A,M){var I=E(A);M.get(I)||(b.apply(void 0,A),M.set(I,!0))}var C=function(A,M){var I=-1,R,k=0,D=new Map;return M==null||M.forEach(function(G,W){var z;if(((z=x.node(G))===null||z===void 0?void 0:z.dummy)==="border"){var V=x.predecessors(G)||[];V.length&&(R=x.node(V[0]).order,T([M,k,W,I,R],D),k=W,I=R)}T([M,k,M.length,R,A.length],D)}),M};return S!=null&&S.length&&S.reduce(C),w};n.findType2Conflicts=s;var l=function(x,S){var w,b;if(!((w=x.node(S))===null||w===void 0)&&w.dummy)return(b=x.predecessors(S))===null||b===void 0?void 0:b.find(function(E){return x.node(E).dummy})};n.findOtherInnerSegmentNode=l;var u=function(x,S,w){var b=S,E=w;if(b>E){var T=b;b=E,E=T}var C=x[b];C||(x[b]=C={}),C[E]=!0};n.addConflict=u;var h=function(x,S,w){var b=S,E=w;if(b>E){var T=S;b=E,E=T}return!!x[b]};n.hasConflict=h;var c=function(x,S,w,b){var E={},T={},C={};return S==null||S.forEach(function(A){A==null||A.forEach(function(M,I){E[M]=M,T[M]=M,C[M]=I})}),S==null||S.forEach(function(A){var M=-1;A==null||A.forEach(function(I){var R=b(I);if(R.length){R=R.sort(function(z,V){return C[z]-C[V]});for(var k=(R.length-1)/2,D=Math.floor(k),G=Math.ceil(k);D<=G;++D){var W=R[D];T[I]===I&&M<C[W]&&!(0,n.hasConflict)(w,I,W)&&(T[W]=I,T[I]=E[I]=E[W],M=C[W])}}})}),{root:E,align:T}};n.verticalAlignment=c;var f=function(x,S,w,b,E){var T,C={},A=(0,n.buildBlockGraph)(x,S,w,E),M=E?"borderLeft":"borderRight",I=function(D,G){for(var W=A.nodes(),z=W.pop(),V={};z;)V[z]?D(z):(V[z]=!0,W.push(z),W=W.concat(G(z))),z=W.pop()},R=function(D){C[D]=(A.inEdges(D)||[]).reduce(function(G,W){return Math.max(G,(C[W.v]||0)+A.edge(W))},0)},k=function(D){var G=(A.outEdges(D)||[]).reduce(function(z,V){return Math.min(z,(C[V.w]||0)-A.edge(V))},Number.POSITIVE_INFINITY),W=x.node(D);G!==Number.POSITIVE_INFINITY&&W.borderType!==M&&(C[D]=Math.max(C[D],G))};return I(R,A.predecessors.bind(A)),I(k,A.successors.bind(A)),(T=Object.values(b))===null||T===void 0||T.forEach(function(D){C[D]=C[w[D]]}),C};n.horizontalCompaction=f;var d=function(x,S,w,b){var E=new a,T=x.graph(),C=(0,n.sep)(T.nodesep,T.edgesep,b);return S==null||S.forEach(function(A){var M;A==null||A.forEach(function(I){var R=w[I];if(E.setNode(R),M){var k=w[M],D=E.edgeFromArgs(k,R);E.setEdge(k,R,Math.max(C(x,I,M),D||0))}M=I})}),E};n.buildBlockGraph=d;var v=function(x,S){return(0,i.minBy)(Object.values(S),function(w){var b,E=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return(b=Object.keys(w))===null||b===void 0||b.forEach(function(C){var A=w[C],M=(0,n.width)(x,C)/2;E=Math.max(A+M,E),T=Math.min(A-M,T)}),E-T})};n.findSmallestWidthAlignment=v;function p(x,S){var w=Object.values(S),b=(0,r.min)(w),E=(0,r.max)(w);["u","d"].forEach(function(T){["l","r"].forEach(function(C){var A=T+C,M=x[A],I;if(M!==S){var R=Object.values(M);I=C==="l"?b-(0,r.min)(R):E-(0,r.max)(R),I&&(x[A]={},Object.keys(M).forEach(function(k){x[A][k]=M[k]+I}))}})})}n.alignCoordinates=p;var g=function(x,S){var w={};return Object.keys(x.ul).forEach(function(b){if(S)w[b]=x[S.toLowerCase()][b];else{var E=Object.values(x).map(function(T){return T[b]});w[b]=(E[0]+E[1])/2}}),w};n.balance=g;var m=function(x){var S=(0,i.buildLayerMatrix)(x),w=Object.assign((0,n.findType1Conflicts)(x,S),(0,n.findType2Conflicts)(x,S)),b={},E;["u","d"].forEach(function(C){E=C==="u"?S:Object.values(S).reverse(),["l","r"].forEach(function(A){A==="r"&&(E=E.map(function(k){return Object.values(k).reverse()}));var M=(C==="u"?x.predecessors:x.successors).bind(x),I=(0,n.verticalAlignment)(x,E,w,M),R=(0,n.horizontalCompaction)(x,E,I.root,I.align,A==="r");A==="r"&&Object.keys(R).forEach(function(k){R[k]=-R[k]}),b[C+A]=R})});var T=(0,n.findSmallestWidthAlignment)(x,b);return p(b,T),(0,n.balance)(b,x.graph().align)};n.positionX=m;var y=function(x,S,w){return function(b,E,T){var C=b.node(E),A=b.node(T),M=0,I;if(M+=C.width/2,C.hasOwnProperty("labelpos"))switch((C.labelpos||"").toLowerCase()){case"l":I=-C.width/2;break;case"r":I=C.width/2;break}if(I&&(M+=w?I:-I),I=0,M+=(C.dummy?S:x)/2,M+=(A.dummy?S:x)/2,M+=A.width/2,A.labelpos)switch((A.labelpos||"").toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(M+=w?I:-I),I=0,M}};n.sep=y;var _=function(x,S){return x.node(S).width||0};n.width=_})(W$e);var sbe=at&&at.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))};Object.defineProperty(lle,"__esModule",{value:!0});var ule=Nv,pb=W$e,irr=function(n){var e=(0,ule.buildLayerMatrix)(n),t=n.graph().ranksep,r=0;e==null||e.forEach(function(i){var a=i.map(function(s){return n.node(s).height}),o=Math.max.apply(Math,sbe(sbe([],a,!1),[0],!1));i==null||i.forEach(function(s){n.node(s).y=r+o/2}),r+=o+t})},arr=function(n){var e=(0,ule.buildLayerMatrix)(n),t=Object.assign((0,pb.findType1Conflicts)(n,e),(0,pb.findType2Conflicts)(n,e)),r={},i=[];["u","d"].forEach(function(o){i=o==="u"?e:Object.values(e).reverse(),["l","r"].forEach(function(s){s==="r"&&(i=i.map(function(c){return Object.values(c).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),u=(0,pb.verticalAlignment)(n,i,t,l),h=(0,pb.horizontalCompaction)(n,i,u.root,u.align,s==="r");s==="r"&&Object.keys(h).forEach(function(c){return h[c]=-h[c]}),r[o+s]=h})});var a=(0,pb.findSmallestWidthAlignment)(n,r);return a&&(0,pb.alignCoordinates)(r,a),(0,pb.balance)(r,n.graph().align)},orr=function(n){var e,t=(0,ule.asNonCompoundGraph)(n);irr(t);var r=arr(t);(e=Object.keys(r))===null||e===void 0||e.forEach(function(i){t.node(i).x=r[i]})};lle.default=orr;var hle={};Object.defineProperty(hle,"__esModule",{value:!0});var srr=function(n,e){for(var t=n.nodes().filter(function(s){var l;return!(!((l=n.children(s))===null||l===void 0)&&l.length)}),r=t.map(function(s){return n.node(s).rank}),i=Math.max.apply(Math,r),a=[],o=0;o<i+1;o++)a[o]=[];e==null||e.forEach(function(s){var l=n.node(s);!l||(l==null?void 0:l.dummy)||isNaN(l.rank)||(l.fixorder=a[l.rank].length,a[l.rank].push(s))})};hle.default=srr;var O9=at&&at.__assign||function(){return O9=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},O9.apply(this,arguments)},Dm=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Gse,"__esModule",{value:!0});var lbe=Dm(zse),ube=Dm(Hse),lrr=Dm(jse),Qy=Nv,urr=Dm(Xse),hbe=Dm(Yse),hrr=Dm(qse),cbe=Dm(Zse),crr=Dm(Kse),frr=Dm(lle),drr=Dm(hle),vrr=z_,prr=function(n,e){var t=e&&e.debugTiming?Qy.time:Qy.notime;t("layout",function(){e&&!e.keepNodeOrder&&e.prevGraph&&t(" inheritOrder",function(){yrr(n,e.prevGraph)});var r=t(" buildLayoutGraph",function(){return Trr(n)});e&&e.edgeLabelSpace===!1||t(" makeSpaceForEdgeLabels",function(){Crr(r)});try{t(" runLayout",function(){grr(r,t,e)})}catch(i){if(i.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
`,i);return}throw i}t(" updateInputGraph",function(){mrr(n,r)})})},grr=function(n,e,t){e(" removeSelfEdges",function(){Nrr(n)}),e(" acyclic",function(){lbe.default.run(n)}),e(" nestingGraph.run",function(){hbe.default.run(n)}),e(" rank",function(){(0,lrr.default)((0,Qy.asNonCompoundGraph)(n))}),e(" injectEdgeLabelProxies",function(){Arr(n)}),e(" removeEmptyRanks",function(){(0,Qy.removeEmptyRanks)(n)}),e(" nestingGraph.cleanup",function(){hbe.default.cleanup(n)}),e(" normalizeRanks",function(){(0,Qy.normalizeRanks)(n)}),e(" assignRankMinMax",function(){Mrr(n)}),e(" removeEdgeLabelProxies",function(){Irr(n)}),e(" normalize.run",function(){ube.default.run(n)}),e(" parentDummyChains",function(){(0,urr.default)(n)}),e(" addBorderSegments",function(){(0,hrr.default)(n)}),t&&t.keepNodeOrder&&e(" initDataOrder",function(){(0,drr.default)(n,t.nodeOrder)}),e(" order",function(){(0,crr.default)(n,t==null?void 0:t.keepNodeOrder)}),e(" insertSelfEdges",function(){krr(n)}),e(" adjustCoordinateSystem",function(){cbe.default.adjust(n)}),e(" position",function(){(0,frr.default)(n)}),e(" positionSelfEdges",function(){Frr(n)}),e(" removeBorderNodes",function(){Drr(n)}),e(" normalize.undo",function(){ube.default.undo(n)}),e(" fixupEdgeLabelCoords",function(){Orr(n)}),e(" undoCoordinateSystem",function(){cbe.default.undo(n)}),e(" translateGraph",function(){Lrr(n)}),e(" assignNodeIntersects",function(){Prr(n)}),e(" reversePoints",function(){Rrr(n)}),e(" acyclic.undo",function(){lbe.default.undo(n)})},yrr=function(n,e){n.nodes().forEach(function(t){var r=n.node(t),i=e.node(t);i!==void 0?(r.fixorder=i._order,delete i._order):delete r.fixorder})},mrr=function(n,e){n.nodes().forEach(function(t){var r,i=n.node(t);if(i){var a=e.node(t);i.x=a.x,i.y=a.y,i._order=a.order,i._rank=a.rank,!((r=e.children(t))===null||r===void 0)&&r.length&&(i.width=a.width,i.height=a.height)}}),n.edges().forEach(function(t){var r=n.edge(t),i=e.edge(t);r.points=i?i.points:[],i&&i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height},_rr=["nodesep","edgesep","ranksep","marginx","marginy"],xrr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},fY=["acyclicer","ranker","rankdir","align"],Srr=["width","height","layer","fixorder"],wrr={width:0,height:0},brr=["minlen","weight","width","height","labeloffset"],Err={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},dY=["labelpos"],Trr=function(n){var e=new vrr.Graph({multigraph:!0,compound:!0}),t=pY(n.graph()),r={};return fY==null||fY.forEach(function(i){t[i]!==void 0&&(r[i]=t[i])}),e.setGraph(Object.assign({},xrr,vY(t,_rr),r)),n.nodes().forEach(function(i){var a=pY(n.node(i)),o=O9(O9({},wrr),a),s=vY(o,Srr);e.setNode(i,s),e.setParent(i,n.parent(i))}),n.edges().forEach(function(i){var a=pY(n.edge(i)),o={};dY==null||dY.forEach(function(s){a[s]!==void 0&&(o[s]=a[s])}),e.setEdgeObj(i,Object.assign({},Err,vY(a,brr),o))}),e},Crr=function(n){var e=n.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,n.nodes().forEach(function(t){var r=n.node(t);isNaN(r.layer)||r.layer||(r.layer=0)}),n.edges().forEach(function(t){var r,i=n.edge(t);i.minlen*=2,((r=i.labelpos)===null||r===void 0?void 0:r.toLowerCase())!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})},Arr=function(n){n.edges().forEach(function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),i=n.node(e.w),a={e,rank:(i.rank-r.rank)/2+r.rank};(0,Qy.addDummyNode)(n,"edge-proxy",a,"_ep")}})},Mrr=function(n){var e=0;n.nodes().forEach(function(t){var r,i,a=n.node(t);a.borderTop&&(a.minRank=(r=n.node(a.borderTop))===null||r===void 0?void 0:r.rank,a.maxRank=(i=n.node(a.borderBottom))===null||i===void 0?void 0:i.rank,e=Math.max(e,a.maxRank||-1/0))}),n.graph().maxRank=e},Irr=function(n){n.nodes().forEach(function(e){var t=n.node(e);t.dummy==="edge-proxy"&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))})},Lrr=function(n){var e,t=0,r,i=0,a=n.graph(),o=a.marginx||0,s=a.marginy||0,l=function(u){if(!!u){var h=u.x,c=u.y,f=u.width,d=u.height;!isNaN(h)&&!isNaN(f)&&(e===void 0&&(e=h-f/2),e=Math.min(e,h-f/2),t=Math.max(t,h+f/2)),!isNaN(c)&&!isNaN(d)&&(r===void 0&&(r=c-d/2),r=Math.min(r,c-d/2),i=Math.max(i,c+d/2))}};n.nodes().forEach(function(u){l(n.node(u))}),n.edges().forEach(function(u){var h=n.edge(u);h!=null&&h.hasOwnProperty("x")&&l(h)}),e-=o,r-=s,n.nodes().forEach(function(u){var h=n.node(u);h&&(h.x-=e,h.y-=r)}),n.edges().forEach(function(u){var h,c=n.edge(u);(h=c.points)===null||h===void 0||h.forEach(function(f){f.x-=e,f.y-=r}),c.hasOwnProperty("x")&&(c.x-=e),c.hasOwnProperty("y")&&(c.y-=r)}),a.width=t-e+o,a.height=i-r+s},Prr=function(n){n.edges().forEach(function(e){var t=n.edge(e),r=n.node(e.v),i=n.node(e.w),a,o;t.points?(a=t.points[0],o=t.points[t.points.length-1]):(t.points=[],a=i,o=r),t.points.unshift((0,Qy.intersectRect)(r,a)),t.points.push((0,Qy.intersectRect)(i,o))})},Orr=function(n){n.edges().forEach(function(e){var t=n.edge(e);if(t!=null&&t.hasOwnProperty("x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})},Rrr=function(n){n.edges().forEach(function(e){var t,r=n.edge(e);r.reversed&&((t=r.points)===null||t===void 0||t.reverse())})},Drr=function(n){n.nodes().forEach(function(e){var t,r,i;if(!((t=n.children(e))===null||t===void 0)&&t.length){var a=n.node(e),o=n.node(a.borderTop),s=n.node(a.borderBottom),l=n.node(a.borderLeft[((r=a.borderLeft)===null||r===void 0?void 0:r.length)-1]),u=n.node(a.borderRight[((i=a.borderRight)===null||i===void 0?void 0:i.length)-1]);a.width=Math.abs((u==null?void 0:u.x)-(l==null?void 0:l.x))||10,a.height=Math.abs((s==null?void 0:s.y)-(o==null?void 0:o.y))||10,a.x=((l==null?void 0:l.x)||0)+a.width/2,a.y=((o==null?void 0:o.y)||0)+a.height/2}}),n.nodes().forEach(function(e){var t;((t=n.node(e))===null||t===void 0?void 0:t.dummy)==="border"&&n.removeNode(e)})},Nrr=function(n){n.edges().forEach(function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e,label:n.edge(e)}),n.removeEdgeObj(e)}})},krr=function(n){var e=(0,Qy.buildLayerMatrix)(n);e==null||e.forEach(function(t){var r=0;t==null||t.forEach(function(i,a){var o,s=n.node(i);s.order=a+r,(o=s.selfEdges)===null||o===void 0||o.forEach(function(l){(0,Qy.addDummyNode)(n,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:a+ ++r,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})},Frr=function(n){n.nodes().forEach(function(e){var t=n.node(e);if(t.dummy==="selfedge"){var r=n.node(t.e.v),i=r.x+r.width/2,a=r.y,o=t.x-i,s=r.height/2;n.setEdgeObj(t.e,t.label),n.removeNode(e),t.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{y:a,x:i+o},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],t.label.x=t.x,t.label.y=t.y}})},vY=function(n,e){var t={};return e==null||e.forEach(function(r){n[r]!==void 0&&(t[r]=+n[r])}),t},pY=function(n){n===void 0&&(n={});var e={};return Object.keys(n).forEach(function(t){e[t.toLowerCase()]=n[t]}),e};Gse.default=prr;var Brr=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Bse,"__esModule",{value:!0});var Grr=Brr(Gse),fbe=Nv;Bse.default={layout:Grr.default,util:{time:fbe.time,notime:fbe.notime}};var zrr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Urr=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(qI,"__esModule",{value:!0});qI.DagreLayout=void 0;var Vrr=Urr(Bse),Zd=Dl(),$rr=Xl,dbe=z_,Wrr=function(n){zrr(e,n);function e(t){var r=n.call(this)||this;return r.rankdir="TB",r.nodesep=50,r.ranksep=50,r.controlPoints=!1,r.sortByCombo=!1,r.edgeLabelSpace=!0,r.radial=!1,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.layoutNode=function(i){var a=r,o=a.nodes,s=o.find(function(u){return u.id===i});if(s){var l=s.layout!==!1;return l}return!0},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},e.prototype.execute=function(){var t=this,r,i,a,o,s=this,l=s.nodes,u=s.nodeSize,h=s.rankdir,c=s.combos,f=s.begin,d=s.radial,v=s.comboEdges,p=v===void 0?[]:v,g=s.vedges,m=g===void 0?[]:g;if(!!l){var y=s.edges||[],_=new dbe.Graph({multigraph:!0,compound:!0});s.nodeMap={};var x={};l.forEach(function(Oe){s.nodeMap[Oe.id]=Oe,Oe.comboId&&(x[Oe.comboId]=x[Oe.comboId]||[],x[Oe.comboId].push(Oe.id))});var S=[],w={};!((r=s.nodeOrder)===null||r===void 0)&&r.length?(s.nodeOrder.forEach(function(Oe){w[Oe]=!0,S.push(s.nodeMap[Oe])}),l.forEach(function(Oe){w[Oe.id]||S.push(Oe)})):S=l;var b;u?(0,Zd.isArray)(u)?b=function(){return u}:b=function(){return[u,u]}:b=function(Oe){return Oe.size?(0,Zd.isArray)(Oe.size)?Oe.size:(0,Zd.isObject)(Oe.size)?[Oe.size.width||40,Oe.size.height||40]:[Oe.size,Oe.size]:[40,40]};var E=(0,Zd.getFunc)(s.ranksep,50,s.ranksepFunc),T=(0,Zd.getFunc)(s.nodesep,50,s.nodesepFunc),C=T,A=E;(h==="LR"||h==="RL")&&(C=E,A=T),_.setDefaultEdgeLabel(function(){return{}}),_.setGraph(s);var M={};this.sortByCombo&&c&&c.forEach(function(Oe){if(M[Oe.id]=Oe,Oe.collapsed){var J=b(Oe),We=A(Oe),Tt=C(Oe),Qe=J[0]+2*Tt,zt=J[1]+2*We;_.setNode(Oe.id,{width:Qe,height:zt})}!Oe.parentId||(M[Oe.parentId]||_.setNode(Oe.parentId,{}),_.setParent(Oe.id,Oe.parentId))}),S.filter(function(Oe){return Oe.layout!==!1}).forEach(function(Oe){var J=b(Oe),We=A(Oe),Tt=C(Oe),Qe=J[0]+2*Tt,zt=J[1]+2*We,mt=Oe.layer;(0,Zd.isNumber)(mt)?_.setNode(Oe.id,{width:Qe,height:zt,layer:mt}):_.setNode(Oe.id,{width:Qe,height:zt}),t.sortByCombo&&Oe.comboId&&(M[Oe.comboId]||(M[Oe.comboId]={id:Oe.comboId},_.setNode(Oe.comboId,{})),_.setParent(Oe.id,Oe.comboId))}),y.forEach(function(Oe){var J=(0,Zd.getEdgeTerminal)(Oe,"source"),We=(0,Zd.getEdgeTerminal)(Oe,"target");t.layoutNode(J)&&t.layoutNode(We)&&_.setEdge(J,We,{weight:Oe.weight||1})}),(i=p==null?void 0:p.concat(m||[]))===null||i===void 0||i.forEach(function(Oe){var J,We,Tt=Oe.source,Qe=Oe.target,zt=!((J=M[Tt])===null||J===void 0)&&J.collapsed?[Tt]:x[Tt]||[Tt],mt=!((We=M[Qe])===null||We===void 0)&&We.collapsed?[Qe]:x[Qe]||[Qe];zt.forEach(function(wt){mt.forEach(function(pt){_.setEdge(wt,pt,{weight:Oe.weight||1})})})});var I=void 0;!((a=s.preset)===null||a===void 0)&&a.nodes&&(I=new dbe.Graph({multigraph:!0,compound:!0}),s.preset.nodes.forEach(function(Oe){I==null||I.setNode(Oe.id,Oe)})),Vrr.default.layout(_,{prevGraph:I,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:Boolean(!!s.nodeOrder),nodeOrder:s.nodeOrder});var R=[0,0];if(f){var k=1/0,D=1/0;_.nodes().forEach(function(Oe){var J=_.node(Oe);k>J.x&&(k=J.x),D>J.y&&(D=J.y)}),_.edges().forEach(function(Oe){var J,We=_.edge(Oe);(J=We.points)===null||J===void 0||J.forEach(function(Tt){k>Tt.x&&(k=Tt.x),D>Tt.y&&(D=Tt.y)})}),R[0]=f[0]-k,R[1]=f[1]-D}var G=h==="LR"||h==="RL";if(d){var W=this,z=W.focusNode,V=W.ranksep,q=W.getRadialPos,Y=(0,Zd.isString)(z)?z:z==null?void 0:z.id,le=Y?(o=_.node(Y))===null||o===void 0?void 0:o._rank:0,j=[],Q=G?"y":"x",ie=G?"height":"width",oe=1/0,se=-1/0;_.nodes().forEach(function(Oe){var J=_.node(Oe);if(!!s.nodeMap[Oe]){var We=T(s.nodeMap[Oe]);if(le===0)j[J._rank]||(j[J._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),j[J._rank].nodes.push(Oe),j[J._rank].totalWidth+=We*2+J[ie],j[J._rank].maxSize<Math.max(J.width,J.height)&&(j[J._rank].maxSize=Math.max(J.width,J.height));else{var Tt=J._rank-le;if(Tt===0)j[Tt]||(j[Tt]={nodes:[],totalWidth:0,maxSize:-1/0}),j[Tt].nodes.push(Oe),j[Tt].totalWidth+=We*2+J[ie],j[Tt].maxSize<Math.max(J.width,J.height)&&(j[Tt].maxSize=Math.max(J.width,J.height));else{var Qe=Math.abs(Tt);j[Qe]||(j[Qe]={left:[],right:[],totalWidth:0,maxSize:-1/0}),j[Qe].totalWidth+=We*2+J[ie],j[Qe].maxSize<Math.max(J.width,J.height)&&(j[Qe].maxSize=Math.max(J.width,J.height)),Tt<0?j[Qe].left.push(Oe):j[Qe].right.push(Oe)}}var zt=J[Q]-J[ie]/2-We,mt=J[Q]+J[ie]/2+We;zt<oe&&(oe=zt),mt>se&&(se=mt)}});var me=V||50,Ce={},Le=(se-oe)/.9,re=[(oe+se-Le)*.5,(oe+se+Le)*.5],yt=function(Oe,J,We,Tt){We===void 0&&(We=-1/0),Tt===void 0&&(Tt=[0,1]);var Qe=We;return Oe.forEach(function(zt){var mt=_.node(zt);Ce[zt]=J;var wt=q(mt[Q],re,Le,J,Tt),pt=wt.x,ar=wt.y;if(!!s.nodeMap[zt]){s.nodeMap[zt].x=pt+R[0],s.nodeMap[zt].y=ar+R[1],s.nodeMap[zt]._order=mt._order;var kt=E(s.nodeMap[zt]);Qe<kt&&(Qe=kt)}}),Qe},je=!0,st=0;j.forEach(function(Oe){var J,We,Tt,Qe,zt,mt,wt;if(!(!(!((J=Oe==null?void 0:Oe.nodes)===null||J===void 0)&&J.length)&&!(!((We=Oe==null?void 0:Oe.left)===null||We===void 0)&&We.length)&&!(!((Tt=Oe==null?void 0:Oe.right)===null||Tt===void 0)&&Tt.length))){if(je&&Oe.nodes.length===1){var pt=Oe.nodes[0];if(!s.nodeMap[pt])return;s.nodeMap[pt].x=R[0],s.nodeMap[pt].y=R[1],Ce[Oe.nodes[0]]=0,me=E(s.nodeMap[pt]),je=!1;return}me=Math.max(me,Oe.totalWidth/(2*Math.PI));var ar=-1/0;if(le===0||((Qe=Oe.nodes)===null||Qe===void 0?void 0:Qe.length))ar=yt(Oe.nodes,me,ar,[0,1]);else{var kt=((zt=Oe.left)===null||zt===void 0?void 0:zt.length)/(((mt=Oe.left)===null||mt===void 0?void 0:mt.length)+((wt=Oe.right)===null||wt===void 0?void 0:wt.length));ar=yt(Oe.left,me,ar,[0,kt]),ar=yt(Oe.right,me,ar,[kt+.05,1])}me+=ar,je=!1,st-Oe.maxSize}}),_.edges().forEach(function(Oe){var J,We,Tt,Qe=_.edge(Oe),zt=y.findIndex(function(jr){var pn=(0,Zd.getEdgeTerminal)(jr,"source"),Jn=(0,Zd.getEdgeTerminal)(jr,"target");return pn===Oe.v&&Jn===Oe.w});if(!(zt<=-1)&&s.edgeLabelSpace&&s.controlPoints&&y[zt].type!=="loop"){var mt=Q==="x"?"y":"x",wt=(J=Qe==null?void 0:Qe.points)===null||J===void 0?void 0:J.slice(1,Qe.points.length-1),pt=[],ar=(We=_.node(Oe.v))===null||We===void 0?void 0:We[mt],kt=ar-((Tt=_.node(Oe.w))===null||Tt===void 0?void 0:Tt[mt]),Dr=Ce[Oe.v],Sr=Dr-Ce[Oe.w];wt==null||wt.forEach(function(jr){var pn=(jr[mt]-ar)/kt*Sr+Dr,Jn=q(jr[Q],re,Le,pn);pt.push({x:Jn.x+R[0],y:Jn.y+R[1]})}),y[zt].controlPoints=pt}})}else{var Nt=new Set,Zt=h==="BT"||h==="RL",qe=Zt?function(Oe,J){return J-Oe}:function(Oe,J){return Oe-J};_.nodes().forEach(function(Oe){var J=_.node(Oe);if(!!J){var We=t.nodeMap[Oe];We||(We=c==null?void 0:c.find(function(Tt){return Tt.id===Oe})),We&&(We.x=J.x+R[0],We.y=J.y+R[1],We._order=J._order,Nt.add(G?We.x:We.y))}});var ur=Array.from(Nt).sort(qe),Dt=G?function(Oe,J){return Oe.x!==J.x}:function(Oe,J){return Oe.y!==J.y},ft=G?function(Oe,J,We){var Tt=Math.max(J.y,We.y),Qe=Math.min(J.y,We.y);return Oe.filter(function(zt){return zt.y<=Tt&&zt.y>=Qe})}:function(Oe,J,We){var Tt=Math.max(J.x,We.x),Qe=Math.min(J.x,We.x);return Oe.filter(function(zt){return zt.x<=Tt&&zt.x>=Qe})};_.edges().forEach(function(Oe){var J,We=_.edge(Oe),Tt=y.findIndex(function(mt){var wt=(0,Zd.getEdgeTerminal)(mt,"source"),pt=(0,Zd.getEdgeTerminal)(mt,"target");return wt===Oe.v&&pt===Oe.w});if(!(Tt<=-1)&&s.edgeLabelSpace&&s.controlPoints&&y[Tt].type!=="loop"){(J=We==null?void 0:We.points)===null||J===void 0||J.forEach(function(mt){mt.x+=R[0],mt.y+=R[1]});var Qe=s.nodeMap[Oe.v],zt=s.nodeMap[Oe.w];y[Tt].controlPoints=Hrr(We==null?void 0:We.points,Qe,zt,ur,G,Dt,ft)}})}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:l,edges:y}}},e.prototype.getRadialPos=function(t,r,i,a,o){o===void 0&&(o=[0,1]);var s=(t-r[0])/i;s=s*(o[1]-o[0])+o[0];var l=s*2*Math.PI;return{x:Math.cos(l)*a,y:Math.sin(l)*a}},e.prototype.getType=function(){return"dagre"},e}($rr.Base);qI.DagreLayout=Wrr;var Hrr=function(n,e,t,r,i,a,o){var s=(n==null?void 0:n.slice(1,n.length-1))||[];if(e&&t){var l=e.x,u=e.y,h=t.x,c=t.y;if(i&&(l=e.y,u=e.x,h=t.y,c=t.x),c!==u&&l!==h){var f=r.indexOf(u),d=r[f+1];if(d){var v=s[0],p=i?{x:(u+d)/2,y:(v==null?void 0:v.y)||h}:{x:(v==null?void 0:v.x)||h,y:(u+d)/2};(!v||a(v,p))&&s.unshift(p)}var g=r.indexOf(c),m=Math.abs(g-f);if(m===1)s=o(s,e,t),s.length||s.push(i?{x:(u+c)/2,y:l}:{x:l,y:(u+c)/2});else if(m>1){var y=r[g-1];if(y){var _=s[s.length-1],x=i?{x:(c+y)/2,y:(_==null?void 0:_.y)||h}:{x:(_==null?void 0:_.x)||l,y:(c+y)/2};(!_||a(_,x))&&s.push(x)}}}}return s},nk={};const R9={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function kee(n={},e=R9){var t,r,i,a;const o=JSON.parse(JSON.stringify(e)),s=((t=n==null?void 0:n.graph)===null||t===void 0?void 0:t.meta)||{},l=((r=n==null?void 0:n.subScene)===null||r===void 0?void 0:r.meta)||{},u=((i=n==null?void 0:n.nodeSize)===null||i===void 0?void 0:i.meta)||{},h=((a=n==null?void 0:n.nodeSize)===null||a===void 0?void 0:a.node)||{},c=o.nodeSize.bridge;return{graph:{meta:Object.assign(o.graph.meta,s)},subScene:{meta:Object.assign(o.subScene.meta,l)},nodeSize:{meta:Object.assign(o.nodeSize.meta,u),node:Object.assign(o.nodeSize.node,h),bridge:c}}}function H$e(n){return`\u25EC${n}\u25EC`}const DM=H$e("ROOT"),j$e=H$e("BRIDGE_GRAPH");var dd,l2,NM,Fee;(function(n){n[n.META=0]="META",n[n.NODE=1]="NODE",n[n.BRIDGE=2]="BRIDGE"})(dd||(dd={})),function(n){n[n.INCLUDE=0]="INCLUDE",n[n.EXCLUDE=1]="EXCLUDE",n[n.UNSPECIFIED=2]="UNSPECIFIED"}(l2||(l2={})),function(n){n[n.META=0]="META",n[n.CORE=1]="CORE",n[n.BRIDGE=2]="BRIDGE"}(NM||(NM={})),function(n){n[n.META=0]="META",n[n.OP=1]="OP",n[n.SERIES=2]="SERIES"}(Fee||(Fee={}));var D5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cle(n,e){return n(e={exports:{}},e.exports),e.exports}var jrr=function(){this.__data__=[],this.size=0},JI=function(n,e){return n===e||n!=n&&e!=e},dV=function(n,e){for(var t=n.length;t--;)if(JI(n[t][0],e))return t;return-1},Xrr=Array.prototype.splice,Yrr=function(n){var e=this.__data__,t=dV(e,n);return!(t<0)&&(t==e.length-1?e.pop():Xrr.call(e,t,1),--this.size,!0)},qrr=function(n){var e=this.__data__,t=dV(e,n);return t<0?void 0:e[t][1]},Zrr=function(n){return dV(this.__data__,n)>-1},Krr=function(n,e){var t=this.__data__,r=dV(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this};function jC(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}jC.prototype.clear=jrr,jC.prototype.delete=Yrr,jC.prototype.get=qrr,jC.prototype.has=Zrr,jC.prototype.set=Krr;var vV=jC,Jrr=function(){this.__data__=new vV,this.size=0},Qrr=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t},enr=function(n){return this.__data__.get(n)},tnr=function(n){return this.__data__.has(n)},X$e=typeof D5=="object"&&D5&&D5.Object===Object&&D5,rnr=typeof self=="object"&&self&&self.Object===Object&&self,B0=X$e||rnr||Function("return this")(),Wp=B0.Symbol,Y$e=Object.prototype,nnr=Y$e.hasOwnProperty,inr=Y$e.toString,wP=Wp?Wp.toStringTag:void 0,anr=function(n){var e=nnr.call(n,wP),t=n[wP];try{n[wP]=void 0;var r=!0}catch{}var i=inr.call(n);return r&&(e?n[wP]=t:delete n[wP]),i},onr=Object.prototype.toString,snr=function(n){return onr.call(n)},vbe=Wp?Wp.toStringTag:void 0,Cw=function(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":vbe&&vbe in Object(n)?anr(n):snr(n)},Cd=function(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")},pbe,ik=function(n){if(!Cd(n))return!1;var e=Cw(n);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},gY=B0["__core-js_shared__"],gbe=(pbe=/[^.]+$/.exec(gY&&gY.keys&&gY.keys.IE_PROTO||""))?"Symbol(src)_1."+pbe:"",lnr=function(n){return!!gbe&&gbe in n},unr=Function.prototype.toString,sT=function(n){if(n!=null){try{return unr.call(n)}catch{}try{return n+""}catch{}}return""},hnr=/^\[object .+?Constructor\]$/,cnr=Function.prototype,fnr=Object.prototype,dnr=cnr.toString,vnr=fnr.hasOwnProperty,pnr=RegExp("^"+dnr.call(vnr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gnr=function(n){return!(!Cd(n)||lnr(n))&&(ik(n)?pnr:hnr).test(sT(n))},ynr=function(n,e){return n==null?void 0:n[e]},lT=function(n,e){var t=ynr(n,e);return gnr(t)?t:void 0},QD=lT(B0,"Map"),eN=lT(Object,"create"),mnr=function(){this.__data__=eN?eN(null):{},this.size=0},_nr=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e},xnr=Object.prototype.hasOwnProperty,Snr=function(n){var e=this.__data__;if(eN){var t=e[n];return t==="__lodash_hash_undefined__"?void 0:t}return xnr.call(e,n)?e[n]:void 0},wnr=Object.prototype.hasOwnProperty,bnr=function(n){var e=this.__data__;return eN?e[n]!==void 0:wnr.call(e,n)},Enr=function(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=eN&&e===void 0?"__lodash_hash_undefined__":e,this};function XC(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}XC.prototype.clear=mnr,XC.prototype.delete=_nr,XC.prototype.get=Snr,XC.prototype.has=bnr,XC.prototype.set=Enr;var ybe=XC,Tnr=function(){this.size=0,this.__data__={hash:new ybe,map:new(QD||vV),string:new ybe}},Cnr=function(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null},pV=function(n,e){var t=n.__data__;return Cnr(e)?t[typeof e=="string"?"string":"hash"]:t.map},Anr=function(n){var e=pV(this,n).delete(n);return this.size-=e?1:0,e},Mnr=function(n){return pV(this,n).get(n)},Inr=function(n){return pV(this,n).has(n)},Lnr=function(n,e){var t=pV(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this};function YC(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}YC.prototype.clear=Tnr,YC.prototype.delete=Anr,YC.prototype.get=Mnr,YC.prototype.has=Inr,YC.prototype.set=Lnr;var gV=YC,Pnr=function(n,e){var t=this.__data__;if(t instanceof vV){var r=t.__data__;if(!QD||r.length<199)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new gV(r)}return t.set(n,e),this.size=t.size,this};function qC(n){var e=this.__data__=new vV(n);this.size=e.size}qC.prototype.clear=Jrr,qC.prototype.delete=Qrr,qC.prototype.get=enr,qC.prototype.has=tnr,qC.prototype.set=Pnr;var XA=qC,fle=function(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n},D9=function(){try{var n=lT(Object,"defineProperty");return n({},"",{}),n}catch{}}(),yV=function(n,e,t){e=="__proto__"&&D9?D9(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t},Onr=Object.prototype.hasOwnProperty,mV=function(n,e,t){var r=n[e];Onr.call(n,e)&&JI(r,t)&&(t!==void 0||e in n)||yV(n,e,t)},ak=function(n,e,t,r){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],l=r?r(t[s],n[s],s,t,n):void 0;l===void 0&&(l=n[s]),i?yV(t,s,l):mV(t,s,l)}return t},Rnr=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r},S0=function(n){return n!=null&&typeof n=="object"},mbe=function(n){return S0(n)&&Cw(n)=="[object Arguments]"},q$e=Object.prototype,Dnr=q$e.hasOwnProperty,Nnr=q$e.propertyIsEnumerable,kM=mbe(function(){return arguments}())?mbe:function(n){return S0(n)&&Dnr.call(n,"callee")&&!Nnr.call(n,"callee")},jl=Array.isArray,knr=function(){return!1},u2=cle(function(n,e){var t=e&&!e.nodeType&&e,r=t&&n&&!n.nodeType&&n,i=r&&r.exports===t?B0.Buffer:void 0,a=(i?i.isBuffer:void 0)||knr;n.exports=a}),Fnr=/^(?:0|[1-9]\d*)$/,_V=function(n,e){var t=typeof n;return!!(e=e==null?9007199254740991:e)&&(t=="number"||t!="symbol"&&Fnr.test(n))&&n>-1&&n%1==0&&n<e},dle=function(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=9007199254740991},Ys={};Ys["[object Float32Array]"]=Ys["[object Float64Array]"]=Ys["[object Int8Array]"]=Ys["[object Int16Array]"]=Ys["[object Int32Array]"]=Ys["[object Uint8Array]"]=Ys["[object Uint8ClampedArray]"]=Ys["[object Uint16Array]"]=Ys["[object Uint32Array]"]=!0,Ys["[object Arguments]"]=Ys["[object Array]"]=Ys["[object ArrayBuffer]"]=Ys["[object Boolean]"]=Ys["[object DataView]"]=Ys["[object Date]"]=Ys["[object Error]"]=Ys["[object Function]"]=Ys["[object Map]"]=Ys["[object Number]"]=Ys["[object Object]"]=Ys["[object RegExp]"]=Ys["[object Set]"]=Ys["[object String]"]=Ys["[object WeakMap]"]=!1;var Bnr=function(n){return S0(n)&&dle(n.length)&&!!Ys[Cw(n)]},xV=function(n){return function(e){return n(e)}},FM=cle(function(n,e){var t=e&&!e.nodeType&&e,r=t&&n&&!n.nodeType&&n,i=r&&r.exports===t&&X$e.process,a=function(){try{var o=r&&r.require&&r.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}}();n.exports=a}),_be=FM&&FM.isTypedArray,ok=_be?xV(_be):Bnr,Gnr=Object.prototype.hasOwnProperty,Z$e=function(n,e){var t=jl(n),r=!t&&kM(n),i=!t&&!r&&u2(n),a=!t&&!r&&!i&&ok(n),o=t||r||i||a,s=o?Rnr(n.length,String):[],l=s.length;for(var u in n)!e&&!Gnr.call(n,u)||o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_V(u,l))||s.push(u);return s},znr=Object.prototype,SV=function(n){var e=n&&n.constructor;return n===(typeof e=="function"&&e.prototype||znr)},K$e=function(n,e){return function(t){return n(e(t))}},Unr=K$e(Object.keys,Object),Vnr=Object.prototype.hasOwnProperty,vle=function(n){if(!SV(n))return Unr(n);var e=[];for(var t in Object(n))Vnr.call(n,t)&&t!="constructor"&&e.push(t);return e},V_=function(n){return n!=null&&dle(n.length)&&!ik(n)},Aw=function(n){return V_(n)?Z$e(n):vle(n)},$nr=function(n,e){return n&&ak(e,Aw(e),n)},Wnr=function(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e},Hnr=Object.prototype.hasOwnProperty,jnr=function(n){if(!Cd(n))return Wnr(n);var e=SV(n),t=[];for(var r in n)(r!="constructor"||!e&&Hnr.call(n,r))&&t.push(r);return t},uT=function(n){return V_(n)?Z$e(n,!0):jnr(n)},Xnr=function(n,e){return n&&ak(e,uT(e),n)},J$e=cle(function(n,e){var t=e&&!e.nodeType&&e,r=t&&n&&!n.nodeType&&n,i=r&&r.exports===t?B0.Buffer:void 0,a=i?i.allocUnsafe:void 0;n.exports=function(o,s){if(s)return o.slice();var l=o.length,u=a?a(l):new o.constructor(l);return o.copy(u),u}}),Q$e=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e},eWe=function(n,e){for(var t=-1,r=n==null?0:n.length,i=0,a=[];++t<r;){var o=n[t];e(o,t,n)&&(a[i++]=o)}return a},tWe=function(){return[]},Ynr=Object.prototype.propertyIsEnumerable,xbe=Object.getOwnPropertySymbols,ple=xbe?function(n){return n==null?[]:(n=Object(n),eWe(xbe(n),function(e){return Ynr.call(n,e)}))}:tWe,qnr=function(n,e){return ak(n,ple(n),e)},gle=function(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n},wV=K$e(Object.getPrototypeOf,Object),rWe=Object.getOwnPropertySymbols?function(n){for(var e=[];n;)gle(e,ple(n)),n=wV(n);return e}:tWe,Znr=function(n,e){return ak(n,rWe(n),e)},nWe=function(n,e,t){var r=e(n);return jl(n)?r:gle(r,t(n))},Bee=function(n){return nWe(n,Aw,ple)},Knr=function(n){return nWe(n,uT,rWe)},Gee=lT(B0,"DataView"),zee=lT(B0,"Promise"),YA=lT(B0,"Set"),Uee=lT(B0,"WeakMap"),Jnr=sT(Gee),Qnr=sT(QD),eir=sT(zee),tir=sT(YA),rir=sT(Uee),Gb=Cw;(Gee&&Gb(new Gee(new ArrayBuffer(1)))!="[object DataView]"||QD&&Gb(new QD)!="[object Map]"||zee&&Gb(zee.resolve())!="[object Promise]"||YA&&Gb(new YA)!="[object Set]"||Uee&&Gb(new Uee)!="[object WeakMap]")&&(Gb=function(n){var e=Cw(n),t=e=="[object Object]"?n.constructor:void 0,r=t?sT(t):"";if(r)switch(r){case Jnr:return"[object DataView]";case Qnr:return"[object Map]";case eir:return"[object Promise]";case tir:return"[object Set]";case rir:return"[object WeakMap]"}return e});var h2=Gb,nir=Object.prototype.hasOwnProperty,iir=function(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&nir.call(n,"index")&&(t.index=n.index,t.input=n.input),t},N9=B0.Uint8Array,yle=function(n){var e=new n.constructor(n.byteLength);return new N9(e).set(new N9(n)),e},air=function(n,e){var t=e?yle(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)},oir=/\w*$/,sir=function(n){var e=new n.constructor(n.source,oir.exec(n));return e.lastIndex=n.lastIndex,e},Sbe=Wp?Wp.prototype:void 0,wbe=Sbe?Sbe.valueOf:void 0,lir=function(n){return wbe?Object(wbe.call(n)):{}},iWe=function(n,e){var t=e?yle(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)},uir=function(n,e,t){var r=n.constructor;switch(e){case"[object ArrayBuffer]":return yle(n);case"[object Boolean]":case"[object Date]":return new r(+n);case"[object DataView]":return air(n,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return iWe(n,t);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(n);case"[object RegExp]":return sir(n);case"[object Set]":return new r;case"[object Symbol]":return lir(n)}},bbe=Object.create,aWe=function(){function n(){}return function(e){if(!Cd(e))return{};if(bbe)return bbe(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}(),oWe=function(n){return typeof n.constructor!="function"||SV(n)?{}:aWe(wV(n))},hir=function(n){return S0(n)&&h2(n)=="[object Map]"},Ebe=FM&&FM.isMap,cir=Ebe?xV(Ebe):hir,fir=function(n){return S0(n)&&h2(n)=="[object Set]"},Tbe=FM&&FM.isSet,dir=Tbe?xV(Tbe):fir,Ns={};Ns["[object Arguments]"]=Ns["[object Array]"]=Ns["[object ArrayBuffer]"]=Ns["[object DataView]"]=Ns["[object Boolean]"]=Ns["[object Date]"]=Ns["[object Float32Array]"]=Ns["[object Float64Array]"]=Ns["[object Int8Array]"]=Ns["[object Int16Array]"]=Ns["[object Int32Array]"]=Ns["[object Map]"]=Ns["[object Number]"]=Ns["[object Object]"]=Ns["[object RegExp]"]=Ns["[object Set]"]=Ns["[object String]"]=Ns["[object Symbol]"]=Ns["[object Uint8Array]"]=Ns["[object Uint8ClampedArray]"]=Ns["[object Uint16Array]"]=Ns["[object Uint32Array]"]=!0,Ns["[object Error]"]=Ns["[object Function]"]=Ns["[object WeakMap]"]=!1;var sWe=function n(e,t,r,i,a,o){var s,l=1&t,u=2&t,h=4&t;if(r&&(s=a?r(e,i,a,o):r(e)),s!==void 0)return s;if(!Cd(e))return e;var c=jl(e);if(c){if(s=iir(e),!l)return Q$e(e,s)}else{var f=h2(e),d=f=="[object Function]"||f=="[object GeneratorFunction]";if(u2(e))return J$e(e,l);if(f=="[object Object]"||f=="[object Arguments]"||d&&!a){if(s=u||d?{}:oWe(e),!l)return u?Znr(e,Xnr(s,e)):qnr(e,$nr(s,e))}else{if(!Ns[f])return a?e:{};s=uir(e,f,l)}}o||(o=new XA);var v=o.get(e);if(v)return v;o.set(e,s),dir(e)?e.forEach(function(g){s.add(n(g,t,r,g,e,o))}):cir(e)&&e.forEach(function(g,m){s.set(m,n(g,t,r,m,e,o))});var p=c?void 0:(h?u?Knr:Bee:u?uT:Aw)(e);return fle(p||e,function(g,m){p&&(g=e[m=g]),mV(s,m,n(g,t,r,m,e,o))}),s},vir=function(n){return sWe(n,4)},mle=function(n){return function(){return n}},_le=function(n){return function(e,t,r){for(var i=-1,a=Object(e),o=r(e),s=o.length;s--;){var l=o[n?s:++i];if(t(a[l],l,a)===!1)break}return e}}(),xle=function(n,e){return n&&_le(n,e,Aw)},bV=function(n,e){return function(t,r){if(t==null)return t;if(!V_(t))return n(t,r);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&r(o[a],a,o)!==!1;);return t}}(xle),hT=function(n){return n},lWe=function(n){return typeof n=="function"?n:hT},uWe=function(n,e){return(jl(n)?fle:bV)(n,lWe(e))},hWe=uWe,pir=function(n,e){var t=[];return bV(n,function(r,i,a){e(r,i,a)&&t.push(r)}),t},gir=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},yir=function(n){return this.__data__.has(n)};function e8(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new gV;++e<t;)this.add(n[e])}e8.prototype.add=e8.prototype.push=gir,e8.prototype.has=yir;var cWe=e8,mir=function(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1},fWe=function(n,e){return n.has(e)},dWe=function(n,e,t,r,i,a){var o=1&t,s=n.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(n),h=a.get(e);if(u&&h)return u==e&&h==n;var c=-1,f=!0,d=2&t?new cWe:void 0;for(a.set(n,e),a.set(e,n);++c<s;){var v=n[c],p=e[c];if(r)var g=o?r(p,v,c,e,n,a):r(v,p,c,n,e,a);if(g!==void 0){if(g)continue;f=!1;break}if(d){if(!mir(e,function(m,y){if(!fWe(d,y)&&(v===m||i(v,m,t,r,a)))return d.push(y)})){f=!1;break}}else if(v!==p&&!i(v,p,t,r,a)){f=!1;break}}return a.delete(n),a.delete(e),f},_ir=function(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t},Sle=function(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t},Cbe=Wp?Wp.prototype:void 0,yY=Cbe?Cbe.valueOf:void 0,xir=function(n,e,t,r,i,a,o){switch(t){case"[object DataView]":if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=e.byteLength||!a(new N9(n),new N9(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return JI(+n,+e);case"[object Error]":return n.name==e.name&&n.message==e.message;case"[object RegExp]":case"[object String]":return n==e+"";case"[object Map]":var s=_ir;case"[object Set]":var l=1&r;if(s||(s=Sle),n.size!=e.size&&!l)return!1;var u=o.get(n);if(u)return u==e;r|=2,o.set(n,e);var h=dWe(s(n),s(e),r,i,a,o);return o.delete(n),h;case"[object Symbol]":if(yY)return yY.call(n)==yY.call(e)}return!1},Sir=Object.prototype.hasOwnProperty,wir=function(n,e,t,r,i,a){var o=1&t,s=Bee(n),l=s.length;if(l!=Bee(e).length&&!o)return!1;for(var u=l;u--;){var h=s[u];if(!(o?h in e:Sir.call(e,h)))return!1}var c=a.get(n),f=a.get(e);if(c&&f)return c==e&&f==n;var d=!0;a.set(n,e),a.set(e,n);for(var v=o;++u<l;){var p=n[h=s[u]],g=e[h];if(r)var m=o?r(g,p,h,e,n,a):r(p,g,h,n,e,a);if(!(m===void 0?p===g||i(p,g,t,r,a):m)){d=!1;break}v||(v=h=="constructor")}if(d&&!v){var y=n.constructor,_=e.constructor;y==_||!("constructor"in n)||!("constructor"in e)||typeof y=="function"&&y instanceof y&&typeof _=="function"&&_ instanceof _||(d=!1)}return a.delete(n),a.delete(e),d},Abe=Object.prototype.hasOwnProperty,bir=function(n,e,t,r,i,a){var o=jl(n),s=jl(e),l=o?"[object Array]":h2(n),u=s?"[object Array]":h2(e),h=(l=l=="[object Arguments]"?"[object Object]":l)=="[object Object]",c=(u=u=="[object Arguments]"?"[object Object]":u)=="[object Object]",f=l==u;if(f&&u2(n)){if(!u2(e))return!1;o=!0,h=!1}if(f&&!h)return a||(a=new XA),o||ok(n)?dWe(n,e,t,r,i,a):xir(n,e,l,t,r,i,a);if(!(1&t)){var d=h&&Abe.call(n,"__wrapped__"),v=c&&Abe.call(e,"__wrapped__");if(d||v){var p=d?n.value():n,g=v?e.value():e;return a||(a=new XA),i(p,g,t,r,a)}}return!!f&&(a||(a=new XA),wir(n,e,t,r,i,a))},vWe=function n(e,t,r,i,a){return e===t||(e==null||t==null||!S0(e)&&!S0(t)?e!=e&&t!=t:bir(e,t,r,i,n,a))},Eir=function(n,e,t,r){var i=t.length,a=i,o=!r;if(n==null)return!a;for(n=Object(n);i--;){var s=t[i];if(o&&s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++i<a;){var l=(s=t[i])[0],u=n[l],h=s[1];if(o&&s[2]){if(u===void 0&&!(l in n))return!1}else{var c=new XA;if(r)var f=r(u,h,l,n,e,c);if(!(f===void 0?vWe(h,u,3,r,c):f))return!1}}return!0},pWe=function(n){return n==n&&!Cd(n)},Tir=function(n){for(var e=Aw(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,pWe(i)]}return e},gWe=function(n,e){return function(t){return t!=null&&t[n]===e&&(e!==void 0||n in Object(t))}},Cir=function(n){var e=Tir(n);return e.length==1&&e[0][2]?gWe(e[0][0],e[0][1]):function(t){return t===n||Eir(t,n,e)}},c2=function(n){return typeof n=="symbol"||S0(n)&&Cw(n)=="[object Symbol]"},Air=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mir=/^\w*$/,wle=function(n,e){if(jl(n))return!1;var t=typeof n;return!(t!="number"&&t!="symbol"&&t!="boolean"&&n!=null&&!c2(n))||Mir.test(n)||!Air.test(n)||e!=null&&n in Object(e)};function ble(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=t.cache;if(a.has(i))return a.get(i);var o=n.apply(this,r);return t.cache=a.set(i,o)||a,o};return t.cache=new(ble.Cache||gV),t}ble.Cache=gV;var Iir=ble,Lir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pir=/\\(\\)?/g,Oir=function(n){var e=Iir(n,function(r){return t.size===500&&t.clear(),r}),t=e.cache;return e}(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(Lir,function(t,r,i,a){e.push(i?a.replace(Pir,"$1"):r||t)}),e}),qA=function(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i},Mbe=Wp?Wp.prototype:void 0,Ibe=Mbe?Mbe.toString:void 0,Rir=function n(e){if(typeof e=="string")return e;if(jl(e))return qA(e,n)+"";if(c2(e))return Ibe?Ibe.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},yWe=function(n){return n==null?"":Rir(n)},EV=function(n,e){return jl(n)?n:wle(n,e)?[n]:Oir(yWe(n))},sk=function(n){if(typeof n=="string"||c2(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e},TV=function(n,e){for(var t=0,r=(e=EV(e,n)).length;n!=null&&t<r;)n=n[sk(e[t++])];return t&&t==r?n:void 0},Dir=function(n,e,t){var r=n==null?void 0:TV(n,e);return r===void 0?t:r},Nir=function(n,e){return n!=null&&e in Object(n)},mWe=function(n,e,t){for(var r=-1,i=(e=EV(e,n)).length,a=!1;++r<i;){var o=sk(e[r]);if(!(a=n!=null&&t(n,o)))break;n=n[o]}return a||++r!=i?a:!!(i=n==null?0:n.length)&&dle(i)&&_V(o,i)&&(jl(n)||kM(n))},_We=function(n,e){return n!=null&&mWe(n,e,Nir)},kir=function(n,e){return wle(n)&&pWe(e)?gWe(sk(n),e):function(t){var r=Dir(t,n);return r===void 0&&r===e?_We(t,n):vWe(e,r,3)}},xWe=function(n){return function(e){return e==null?void 0:e[n]}},Fir=function(n){return function(e){return TV(e,n)}},Bir=function(n){return wle(n)?xWe(sk(n)):Fir(n)},$_=function(n){return typeof n=="function"?n:n==null?hT:typeof n=="object"?jl(n)?kir(n[0],n[1]):Cir(n):Bir(n)},SWe=function(n,e){return(jl(n)?eWe:pir)(n,$_(e))},Gir=Object.prototype.hasOwnProperty,zir=function(n,e){return n!=null&&Gir.call(n,e)},wWe=function(n,e){return n!=null&&mWe(n,e,zir)},Uir=Object.prototype.hasOwnProperty,Vir=function(n){if(n==null)return!0;if(V_(n)&&(jl(n)||typeof n=="string"||typeof n.splice=="function"||u2(n)||ok(n)||kM(n)))return!n.length;var e=h2(n);if(e=="[object Map]"||e=="[object Set]")return!n.size;if(SV(n))return!vle(n).length;for(var t in n)if(Uir.call(n,t))return!1;return!0},bWe=function(n){return n===void 0},EWe=function(n,e){var t=-1,r=V_(n)?Array(n.length):[];return bV(n,function(i,a,o){r[++t]=e(i,a,o)}),r},TWe=function(n,e){return(jl(n)?qA:EWe)(n,$_(e))},$ir=function(n,e,t,r){var i=-1,a=n==null?0:n.length;for(r&&a&&(t=n[++i]);++i<a;)t=e(t,n[i],i,n);return t},Wir=function(n,e,t,r,i){return i(n,function(a,o,s){t=r?(r=!1,a):e(t,a,o,s)}),t},CWe=function(n,e,t){var r=jl(n)?$ir:Wir,i=arguments.length<3;return r(n,$_(e),t,i,bV)},Hir=function(n){return typeof n=="string"||!jl(n)&&S0(n)&&Cw(n)=="[object String]"},jir=xWe("length"),Xir=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Yir=function(n){return Xir.test(n)},qir="[\\ud800-\\udfff]",Vee="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",$ee="\\ud83c[\\udffb-\\udfff]",AWe="[^\\ud800-\\udfff]",MWe="(?:\\ud83c[\\udde6-\\uddff]){2}",IWe="[\\ud800-\\udbff][\\udc00-\\udfff]",Lbe="(?:"+Vee+"|"+$ee+")?",Zir="[\\ufe0e\\ufe0f]?"+Lbe+("(?:\\u200d(?:"+[AWe,MWe,IWe].join("|")+")[\\ufe0e\\ufe0f]?"+Lbe+")*"),Kir="(?:"+[AWe+Vee+"?",Vee,MWe,IWe,qir].join("|")+")",Pbe=RegExp($ee+"(?="+$ee+")|"+Kir+Zir,"g"),Jir=function(n){for(var e=Pbe.lastIndex=0;Pbe.test(n);)++e;return e},Qir=function(n){return Yir(n)?Jir(n):jir(n)},ear=function(n){if(n==null)return 0;if(V_(n))return Hir(n)?Qir(n):n.length;var e=h2(n);return e=="[object Map]"||e=="[object Set]"?n.size:vle(n).length},tar=function(n,e,t){var r=jl(n),i=r||u2(n)||ok(n);if(e=$_(e),t==null){var a=n&&n.constructor;t=i?r?new a:[]:Cd(n)&&ik(a)?aWe(wV(n)):{}}return(i?fle:xle)(n,function(o,s,l){return e(t,o,s,l)}),t},Obe=Wp?Wp.isConcatSpreadable:void 0,rar=function(n){return jl(n)||kM(n)||!!(Obe&&n&&n[Obe])},Ele=function n(e,t,r,i,a){var o=-1,s=e.length;for(r||(r=rar),a||(a=[]);++o<s;){var l=e[o];t>0&&r(l)?t>1?n(l,t-1,r,i,a):gle(a,l):i||(a[a.length]=l)}return a},nar=function(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)},Rbe=Math.max,LWe=function(n,e,t){return e=Rbe(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,a=Rbe(r.length-e,0),o=Array(a);++i<a;)o[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=t(o),nar(n,this,s)}},iar=D9?function(n,e){return D9(n,"toString",{configurable:!0,enumerable:!1,value:mle(e),writable:!0})}:hT,aar=Date.now,PWe=function(n){var e=0,t=0;return function(){var r=aar(),i=16-(r-t);if(t=r,i>0){if(++e>=800)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}(iar),CV=function(n,e){return PWe(LWe(n,e,hT),n+"")},OWe=function(n,e,t,r){for(var i=n.length,a=t+(r?1:-1);r?a--:++a<i;)if(e(n[a],a,n))return a;return-1},oar=function(n){return n!=n},sar=function(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1},lar=function(n,e,t){return e==e?sar(n,e,t):OWe(n,oar,t)},uar=function(n,e){return!!(n!=null&&n.length)&&lar(n,e,0)>-1},har=function(n,e,t){for(var r=-1,i=n==null?0:n.length;++r<i;)if(t(e,n[r]))return!0;return!1},car=function(){},far=YA&&1/Sle(new YA([,-0]))[1]==1/0?function(n){return new YA(n)}:car,dar=function(n,e,t){var r=-1,i=uar,a=n.length,o=!0,s=[],l=s;if(t)o=!1,i=har;else if(a>=200){var u=e?null:far(n);if(u)return Sle(u);o=!1,i=fWe,l=new cWe}else l=e?[]:s;e:for(;++r<a;){var h=n[r],c=e?e(h):h;if(h=t||h!==0?h:0,o&&c==c){for(var f=l.length;f--;)if(l[f]===c)continue e;e&&l.push(c),s.push(h)}else i(l,c,t)||(l!==s&&l.push(c),s.push(h))}return s},RWe=function(n){return S0(n)&&V_(n)},par=CV(function(n){return dar(Ele(n,1,RWe,!0))}),gar=function(n,e){return qA(e,function(t){return n[t]})},k9,DWe=function(n){return n==null?[]:gar(n,Aw(n))};try{k9={clone:vir,constant:mle,each:hWe,filter:SWe,has:wWe,isArray:jl,isEmpty:Vir,isFunction:ik,isUndefined:bWe,keys:Aw,map:TWe,reduce:CWe,size:ear,transform:tar,union:par,values:DWe}}catch{}k9||(k9=window._);var Hr=k9,Tle=Xa;function Xa(n){this._isDirected=!Hr.has(n,"directed")||n.directed,this._isMultigraph=!!Hr.has(n,"multigraph")&&n.multigraph,this._isCompound=!!Hr.has(n,"compound")&&n.compound,this._label=void 0,this._defaultNodeLabelFn=Hr.constant(void 0),this._defaultEdgeLabelFn=Hr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Dbe(n,e){n[e]?n[e]++:n[e]=1}function Nbe(n,e){--n[e]||delete n[e]}function wO(n,e,t,r){var i=""+e,a=""+t;if(!n&&i>a){var o=i;i=a,a=o}return i+""+a+""+(Hr.isUndefined(r)?"\0":r)}function yar(n,e,t,r){var i=""+e,a=""+t;if(!n&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function mY(n,e){return wO(n,e.v,e.w,e.name)}Xa.prototype._nodeCount=0,Xa.prototype._edgeCount=0,Xa.prototype.isDirected=function(){return this._isDirected},Xa.prototype.isMultigraph=function(){return this._isMultigraph},Xa.prototype.isCompound=function(){return this._isCompound},Xa.prototype.setGraph=function(n){return this._label=n,this},Xa.prototype.graph=function(){return this._label},Xa.prototype.setDefaultNodeLabel=function(n){return Hr.isFunction(n)||(n=Hr.constant(n)),this._defaultNodeLabelFn=n,this},Xa.prototype.nodeCount=function(){return this._nodeCount},Xa.prototype.nodes=function(){return Hr.keys(this._nodes)},Xa.prototype.sources=function(){var n=this;return Hr.filter(this.nodes(),function(e){return Hr.isEmpty(n._in[e])})},Xa.prototype.sinks=function(){var n=this;return Hr.filter(this.nodes(),function(e){return Hr.isEmpty(n._out[e])})},Xa.prototype.setNodes=function(n,e){var t=arguments,r=this;return Hr.each(n,function(i){t.length>1?r.setNode(i,e):r.setNode(i)}),this},Xa.prototype.setNode=function(n,e){return Hr.has(this._nodes,n)?(arguments.length>1&&(this._nodes[n]=e),this):(this._nodes[n]=arguments.length>1?e:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]="\0",this._children[n]={},this._children["\0"][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)},Xa.prototype.node=function(n){return this._nodes[n]},Xa.prototype.hasNode=function(n){return Hr.has(this._nodes,n)},Xa.prototype.removeNode=function(n){var e=this;if(Hr.has(this._nodes,n)){var t=function(r){e.removeEdge(e._edgeObjs[r])};delete this._nodes[n],this._isCompound&&(this._removeFromParentsChildList(n),delete this._parent[n],Hr.each(this.children(n),function(r){e.setParent(r)}),delete this._children[n]),Hr.each(Hr.keys(this._in[n]),t),delete this._in[n],delete this._preds[n],Hr.each(Hr.keys(this._out[n]),t),delete this._out[n],delete this._sucs[n],--this._nodeCount}return this},Xa.prototype.setParent=function(n,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Hr.isUndefined(e))e="\0";else{for(var t=e+="";!Hr.isUndefined(t);t=this.parent(t))if(t===n)throw new Error("Setting "+e+" as parent of "+n+" would create a cycle");this.setNode(e)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=e,this._children[e][n]=!0,this},Xa.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},Xa.prototype.parent=function(n){if(this._isCompound){var e=this._parent[n];if(e!=="\0")return e}},Xa.prototype.children=function(n){if(Hr.isUndefined(n)&&(n="\0"),this._isCompound){var e=this._children[n];if(e)return Hr.keys(e)}else{if(n==="\0")return this.nodes();if(this.hasNode(n))return[]}},Xa.prototype.predecessors=function(n){var e=this._preds[n];if(e)return Hr.keys(e)},Xa.prototype.successors=function(n){var e=this._sucs[n];if(e)return Hr.keys(e)},Xa.prototype.neighbors=function(n){var e=this.predecessors(n);if(e)return Hr.union(e,this.successors(n))},Xa.prototype.isLeaf=function(n){return(this.isDirected()?this.successors(n):this.neighbors(n)).length===0},Xa.prototype.filterNodes=function(n){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var t=this;Hr.each(this._nodes,function(a,o){n(o)&&e.setNode(o,a)}),Hr.each(this._edgeObjs,function(a){e.hasNode(a.v)&&e.hasNode(a.w)&&e.setEdge(a,t.edge(a))});var r={};function i(a){var o=t.parent(a);return o===void 0||e.hasNode(o)?(r[a]=o,o):o in r?r[o]:i(o)}return this._isCompound&&Hr.each(e.nodes(),function(a){e.setParent(a,i(a))}),e},Xa.prototype.setDefaultEdgeLabel=function(n){return Hr.isFunction(n)||(n=Hr.constant(n)),this._defaultEdgeLabelFn=n,this},Xa.prototype.edgeCount=function(){return this._edgeCount},Xa.prototype.edges=function(){return Hr.values(this._edgeObjs)},Xa.prototype.setPath=function(n,e){var t=this,r=arguments;return Hr.reduce(n,function(i,a){return r.length>1?t.setEdge(i,a,e):t.setEdge(i,a),a}),this},Xa.prototype.setEdge=function(){var n,e,t,r,i=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(n=a.v,e=a.w,t=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(n=a,e=arguments[1],t=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),n=""+n,e=""+e,Hr.isUndefined(t)||(t=""+t);var o=wO(this._isDirected,n,e,t);if(Hr.has(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!Hr.isUndefined(t)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(n),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(n,e,t);var s=yar(this._isDirected,n,e,t);return n=s.v,e=s.w,Object.freeze(s),this._edgeObjs[o]=s,Dbe(this._preds[e],n),Dbe(this._sucs[n],e),this._in[e][o]=s,this._out[n][o]=s,this._edgeCount++,this},Xa.prototype.edge=function(n,e,t){var r=arguments.length===1?mY(this._isDirected,arguments[0]):wO(this._isDirected,n,e,t);return this._edgeLabels[r]},Xa.prototype.hasEdge=function(n,e,t){var r=arguments.length===1?mY(this._isDirected,arguments[0]):wO(this._isDirected,n,e,t);return Hr.has(this._edgeLabels,r)},Xa.prototype.removeEdge=function(n,e,t){var r=arguments.length===1?mY(this._isDirected,arguments[0]):wO(this._isDirected,n,e,t),i=this._edgeObjs[r];return i&&(n=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],Nbe(this._preds[e],n),Nbe(this._sucs[n],e),delete this._in[e][r],delete this._out[n][r],this._edgeCount--),this},Xa.prototype.inEdges=function(n,e){var t=this._in[n];if(t){var r=Hr.values(t);return e?Hr.filter(r,function(i){return i.v===e}):r}},Xa.prototype.outEdges=function(n,e){var t=this._out[n];if(t){var r=Hr.values(t);return e?Hr.filter(r,function(i){return i.w===e}):r}},Xa.prototype.nodeEdges=function(n,e){var t=this.inEdges(n,e);if(t)return t.concat(this.outEdges(n,e))};var kbe={Graph:Tle,version:"2.1.8"},mar={write:function(n){var e={options:{directed:n.isDirected(),multigraph:n.isMultigraph(),compound:n.isCompound()},nodes:_ar(n),edges:xar(n)};return Hr.isUndefined(n.graph())||(e.value=Hr.clone(n.graph())),e},read:function(n){var e=new Tle(n.options).setGraph(n.value);return Hr.each(n.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),Hr.each(n.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}};function _ar(n){return Hr.map(n.nodes(),function(e){var t=n.node(e),r=n.parent(e),i={v:e};return Hr.isUndefined(t)||(i.value=t),Hr.isUndefined(r)||(i.parent=r),i})}function xar(n){return Hr.map(n.edges(),function(e){var t=n.edge(e),r={v:e.v,w:e.w};return Hr.isUndefined(e.name)||(r.name=e.name),Hr.isUndefined(t)||(r.value=t),r})}var Sar=function(n){var e,t={},r=[];function i(a){Hr.has(t,a)||(t[a]=!0,e.push(a),Hr.each(n.successors(a),i),Hr.each(n.predecessors(a),i))}return Hr.each(n.nodes(),function(a){e=[],i(a),e.length&&r.push(e)}),r},NWe=np;function np(){this._arr=[],this._keyIndices={}}np.prototype.size=function(){return this._arr.length},np.prototype.keys=function(){return this._arr.map(function(n){return n.key})},np.prototype.has=function(n){return Hr.has(this._keyIndices,n)},np.prototype.priority=function(n){var e=this._keyIndices[n];if(e!==void 0)return this._arr[e].priority},np.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},np.prototype.add=function(n,e){var t=this._keyIndices;if(n=String(n),!Hr.has(t,n)){var r=this._arr,i=r.length;return t[n]=i,r.push({key:n,priority:e}),this._decrease(i),!0}return!1},np.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},np.prototype.decrease=function(n,e){var t=this._keyIndices[n];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)},np.prototype._heapify=function(n){var e=this._arr,t=2*n,r=t+1,i=n;t<e.length&&(i=e[t].priority<e[i].priority?t:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==n&&(this._swap(n,i),this._heapify(i)))},np.prototype._decrease=function(n){for(var e,t=this._arr,r=t[n].priority;n!==0&&!(t[e=n>>1].priority<r);)this._swap(n,e),n=e},np.prototype._swap=function(n,e){var t=this._arr,r=this._keyIndices,i=t[n],a=t[e];t[n]=a,t[e]=i,r[a.key]=n,r[i.key]=e};var kWe=function(n,e,t,r){return function(i,a,o,s){var l,u,h={},c=new NWe,f=function(d){var v=d.v!==l?d.v:d.w,p=h[v],g=o(d),m=u.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+g);m<p.distance&&(p.distance=m,p.predecessor=l,c.decrease(v,m))};for(i.nodes().forEach(function(d){var v=d===a?0:Number.POSITIVE_INFINITY;h[d]={distance:v},c.add(d,v)});c.size()>0&&(l=c.removeMin(),(u=h[l]).distance!==Number.POSITIVE_INFINITY);)s(l).forEach(f);return h}(n,String(e),t||war,r||function(i){return n.outEdges(i)})},war=Hr.constant(1),bar=function(n,e,t){return Hr.transform(n.nodes(),function(r,i){r[i]=kWe(n,i,e,t)},{})},FWe=function(n){var e=0,t=[],r={},i=[];function a(o){var s=r[o]={onStack:!0,lowlink:e,index:e++};if(t.push(o),n.successors(o).forEach(function(h){Hr.has(r,h)?r[h].onStack&&(s.lowlink=Math.min(s.lowlink,r[h].index)):(a(h),s.lowlink=Math.min(s.lowlink,r[h].lowlink))}),s.lowlink===s.index){var l,u=[];do l=t.pop(),r[l].onStack=!1,u.push(l);while(o!==l);i.push(u)}}return n.nodes().forEach(function(o){Hr.has(r,o)||a(o)}),i},Ear=function(n){return Hr.filter(FWe(n),function(e){return e.length>1||e.length===1&&n.hasEdge(e[0],e[0])})},Tar=function(n,e,t){return function(r,i,a){var o={},s=r.nodes();return s.forEach(function(l){o[l]={},o[l][l]={distance:0},s.forEach(function(u){l!==u&&(o[l][u]={distance:Number.POSITIVE_INFINITY})}),a(l).forEach(function(u){var h=u.v===l?u.w:u.v,c=i(u);o[l][h]={distance:c,predecessor:l}})}),s.forEach(function(l){var u=o[l];s.forEach(function(h){var c=o[h];s.forEach(function(f){var d=c[l],v=u[f],p=c[f],g=d.distance+v.distance;g<p.distance&&(p.distance=g,p.predecessor=v.predecessor)})})}),o}(n,e||Car,t||function(r){return n.outEdges(r)})},Car=Hr.constant(1),_Y=BWe;function BWe(n){var e={},t={},r=[];if(Hr.each(n.sinks(),function i(a){if(Hr.has(t,a))throw new F9;Hr.has(e,a)||(t[a]=!0,e[a]=!0,Hr.each(n.predecessors(a),i),delete t[a],r.push(a))}),Hr.size(e)!==n.nodeCount())throw new F9;return r}function F9(){}BWe.CycleException=F9,F9.prototype=new Error;var Fbe=function(n,e,t){Hr.isArray(e)||(e=[e]);var r=(n.isDirected()?n.successors:n.neighbors).bind(n),i=[],a={};return Hr.each(e,function(o){if(!n.hasNode(o))throw new Error("Graph does not have node: "+o);GWe(n,o,t==="post",a,r,i)}),i};function GWe(n,e,t,r,i,a){Hr.has(r,e)||(r[e]=!0,t||a.push(e),Hr.each(i(e),function(o){GWe(n,o,t,r,i,a)}),t&&a.push(e))}var B9,Aar={Graph:kbe.Graph,json:mar,alg:{components:Sar,dijkstra:kWe,dijkstraAll:bar,findCycles:Ear,floydWarshall:Tar,isAcyclic:function(n){try{_Y(n)}catch(e){if(e instanceof _Y.CycleException)return!1;throw e}return!0},postorder:function(n,e){return Fbe(n,e,"post")},preorder:function(n,e){return Fbe(n,e,"pre")},prim:function(n,e){var t,r=new Tle,i={},a=new NWe;function o(l){var u=l.v===t?l.w:l.v,h=a.priority(u);if(h!==void 0){var c=e(l);c<h&&(i[u]=t,a.decrease(u,c))}}if(n.nodeCount()===0)return r;Hr.each(n.nodes(),function(l){a.add(l,Number.POSITIVE_INFINITY),r.setNode(l)}),a.decrease(n.nodes()[0],0);for(var s=!1;a.size()>0;){if(t=a.removeMin(),Hr.has(i,t))r.setEdge(t,i[t]);else{if(s)throw new Error("Input graph is not connected: "+n);s=!0}n.nodeEdges(t).forEach(o)}return r},tarjan:FWe,topsort:_Y},version:kbe.version};try{B9=Aar}catch{}B9||(B9=window.graphlib);var G0=B9,Mar=function(n){return sWe(n,5)},tN=function(n,e,t){if(!Cd(t))return!1;var r=typeof e;return!!(r=="number"?V_(t)&&_V(e,t.length):r=="string"&&e in t)&&JI(t[e],n)},zWe=Object.prototype,Iar=zWe.hasOwnProperty,Lar=CV(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&tN(e[0],e[1],i)&&(r=1);++t<r;)for(var a=e[t],o=uT(a),s=-1,l=o.length;++s<l;){var u=o[s],h=n[u];(h===void 0||JI(h,zWe[u])&&!Iar.call(n,u))&&(n[u]=a[u])}return n}),Par=function(n){return function(e,t,r){var i=Object(e);if(!V_(e)){var a=$_(t);e=Aw(e),t=function(s){return a(i[s],s,i)}}var o=n(e,t,r);return o>-1?i[a?e[o]:o]:void 0}},Oar=/^\s+|\s+$/g,Rar=/^[-+]0x[0-9a-f]+$/i,Dar=/^0b[01]+$/i,Nar=/^0o[0-7]+$/i,kar=parseInt,Far=function(n){if(typeof n=="number")return n;if(c2(n))return NaN;if(Cd(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Cd(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(Oar,"");var t=Dar.test(n);return t||Nar.test(n)?kar(n.slice(2),t?2:8):Rar.test(n)?NaN:+n},t8=function(n){return n?(n=Far(n))===1/0||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:n===0?n:0},Bar=function(n){var e=t8(n),t=e%1;return e==e?t?e-t:e:0},Gar=Math.max,zar=Par(function(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=t==null?0:Bar(t);return i<0&&(i=Gar(r+i,0)),OWe(n,$_(e),i)}),UWe=function(n){return n!=null&&n.length?Ele(n,1):[]},Uar=function(n,e){return n==null?n:_le(n,lWe(e),uT)},Var=function(n){var e=n==null?0:n.length;return e?n[e-1]:void 0},$ar=function(n,e){var t={};return e=$_(e),xle(n,function(r,i,a){yV(t,i,e(r,i,a))}),t},Cle=function(n,e,t){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=e(a);if(o!=null&&(s===void 0?o==o&&!c2(o):t(o,s)))var s=o,l=a}return l},War=function(n,e){return n>e},Har=function(n){return n&&n.length?Cle(n,hT,War):void 0},Wee=function(n,e,t){(t!==void 0&&!JI(n[e],t)||t===void 0&&!(e in n))&&yV(n,e,t)},jar=Function.prototype,Xar=Object.prototype,VWe=jar.toString,Yar=Xar.hasOwnProperty,qar=VWe.call(Object),Zar=function(n){if(!S0(n)||Cw(n)!="[object Object]")return!1;var e=wV(n);if(e===null)return!0;var t=Yar.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&VWe.call(t)==qar},Hee=function(n,e){if((e!=="constructor"||typeof n[e]!="function")&&e!="__proto__")return n[e]},Kar=function(n){return ak(n,uT(n))},Jar=function(n,e,t,r,i,a,o){var s=Hee(n,t),l=Hee(e,t),u=o.get(l);if(u)Wee(n,t,u);else{var h=a?a(s,l,t+"",n,e,o):void 0,c=h===void 0;if(c){var f=jl(l),d=!f&&u2(l),v=!f&&!d&&ok(l);h=l,f||d||v?jl(s)?h=s:RWe(s)?h=Q$e(s):d?(c=!1,h=J$e(l,!0)):v?(c=!1,h=iWe(l,!0)):h=[]:Zar(l)||kM(l)?(h=s,kM(s)?h=Kar(s):Cd(s)&&!ik(s)||(h=oWe(l))):c=!1}c&&(o.set(l,h),i(h,l,r,a,o),o.delete(l)),Wee(n,t,h)}},Qar=function n(e,t,r,i,a){e!==t&&_le(t,function(o,s){if(a||(a=new XA),Cd(o))Jar(e,t,s,r,n,i,a);else{var l=i?i(Hee(e,s),o,s+"",e,t,a):void 0;l===void 0&&(l=o),Wee(e,s,l)}},uT)},eor=function(n){return CV(function(e,t){var r=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=n.length>3&&typeof a=="function"?(i--,a):void 0,o&&tN(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var s=t[r];s&&n(e,s,r,a)}return e})}(function(n,e,t){Qar(n,e,t)}),$We=function(n,e){return n<e},tor=function(n){return n&&n.length?Cle(n,hT,$We):void 0},ror=function(n,e){return n&&n.length?Cle(n,$_(e),$We):void 0},nor=function(){return B0.Date.now()},ior=function(n,e,t,r){if(!Cd(n))return n;for(var i=-1,a=(e=EV(e,n)).length,o=a-1,s=n;s!=null&&++i<a;){var l=sk(e[i]),u=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return n;if(i!=o){var h=s[l];(u=r?r(h,l,s):void 0)===void 0&&(u=Cd(h)?h:_V(e[i+1])?[]:{})}mV(s,l,u),s=s[l]}return n},aor=function(n,e,t){for(var r=-1,i=e.length,a={};++r<i;){var o=e[r],s=TV(n,o);t(s,o)&&ior(a,EV(o,n),s)}return a},oor=function(n,e){return aor(n,e,function(t,r){return _We(n,r)})},sor=function(n){return PWe(LWe(n,void 0,UWe),n+"")}(function(n,e){return n==null?{}:oor(n,e)}),lor=Math.ceil,uor=Math.max,hor=function(n,e,t,r){for(var i=-1,a=uor(lor((e-n)/(t||1)),0),o=Array(a);a--;)o[r?a:++i]=n,n+=t;return o},cor=function(n){return function(e,t,r){return r&&typeof r!="number"&&tN(e,t,r)&&(t=r=void 0),e=t8(e),t===void 0?(t=e,e=0):t=t8(t),r=r===void 0?e<t?1:-1:t8(r),hor(e,t,r,n)}}(),dor=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n},vor=function(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n==n,a=c2(n),o=e!==void 0,s=e===null,l=e==e,u=c2(e);if(!s&&!u&&!a&&n>e||a&&o&&l&&!s&&!u||r&&o&&l||!t&&l||!i)return 1;if(!r&&!a&&!u&&n<e||u&&t&&i&&!r&&!a||s&&t&&i||!o&&i||!l)return-1}return 0},por=function(n,e,t){for(var r=-1,i=n.criteria,a=e.criteria,o=i.length,s=t.length;++r<o;){var l=vor(i[r],a[r]);if(l)return r>=s?l:l*(t[r]=="desc"?-1:1)}return n.index-e.index},gor=function(n,e,t){e=e.length?qA(e,function(a){return jl(a)?function(o){return TV(o,a.length===1?a[0]:a)}:a}):[hT];var r=-1;e=qA(e,xV($_));var i=EWe(n,function(a,o,s){return{criteria:qA(e,function(l){return l(a)}),index:++r,value:a}});return dor(i,function(a,o){return por(a,o,t)})},yor=CV(function(n,e){if(n==null)return[];var t=e.length;return t>1&&tN(n,e[0],e[1])?e=[]:t>2&&tN(e[0],e[1],e[2])&&(e=[e[0]]),gor(n,Ele(e,1),[])}),mor=0,_or=function(n){var e=++mor;return yWe(n)+e},xor=function(n,e,t){for(var r=-1,i=n.length,a=e.length,o={};++r<i;){var s=r<a?e[r]:void 0;t(o,n[r],s)}return o},G9,Sor=function(n,e){return xor(n||[],e||[],mV)};try{G9={cloneDeep:Mar,constant:mle,defaults:Lar,each:hWe,filter:SWe,find:zar,flatten:UWe,forEach:uWe,forIn:Uar,has:wWe,isUndefined:bWe,last:Var,map:TWe,mapValues:$ar,max:Har,merge:eor,min:tor,minBy:ror,now:nor,pick:sor,range:cor,reduce:CWe,sortBy:yor,uniqueId:_or,values:DWe,zipObject:Sor}}catch{}G9||(G9=window._);var ke=G9,wor=r8;function r8(){var n={};n._next=n._prev=n,this._sentinel=n}function Bbe(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function bor(n,e){if(n!=="_next"&&n!=="_prev")return e}r8.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return Bbe(e),e},r8.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&Bbe(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},r8.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,bor)),t=t._prev;return"["+n.join(", ")+"]"};var Eor=G0.Graph,Tor=function(n,e){if(n.nodeCount()<=1)return[];var t=function(i,a){var o=new Eor,s=0,l=0;ke.forEach(i.nodes(),function(c){o.setNode(c,{v:c,in:0,out:0})}),ke.forEach(i.edges(),function(c){var f=o.edge(c.v,c.w)||0,d=a(c),v=f+d;o.setEdge(c.v,c.w,v),l=Math.max(l,o.node(c.v).out+=d),s=Math.max(s,o.node(c.w).in+=d)});var u=ke.range(l+s+3).map(function(){return new wor}),h=s+1;return ke.forEach(o.nodes(),function(c){jee(u,h,o.node(c))}),{graph:o,buckets:u,zeroIdx:h}}(n,e||Cor),r=function(i,a,o){for(var s,l=[],u=a[a.length-1],h=a[0];i.nodeCount();){for(;s=h.dequeue();)xY(i,a,o,s);for(;s=u.dequeue();)xY(i,a,o,s);if(i.nodeCount()){for(var c=a.length-2;c>0;--c)if(s=a[c].dequeue()){l=l.concat(xY(i,a,o,s,!0));break}}}return l}(t.graph,t.buckets,t.zeroIdx);return ke.flatten(ke.map(r,function(i){return n.outEdges(i.v,i.w)}),!0)},Cor=ke.constant(1);function xY(n,e,t,r,i){var a=i?[]:void 0;return ke.forEach(n.inEdges(r.v),function(o){var s=n.edge(o),l=n.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,jee(e,t,l)}),ke.forEach(n.outEdges(r.v),function(o){var s=n.edge(o),l=o.w,u=n.node(l);u.in-=s,jee(e,t,u)}),n.removeNode(r.v),a}function jee(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var Gbe={run:function(n){var e=n.graph().acyclicer==="greedy"?Tor(n,function(t){return function(r){return t.edge(r).weight}}(n)):function(t){var r=[],i={},a={};function o(s){ke.has(a,s)||(a[s]=!0,i[s]=!0,ke.forEach(t.outEdges(s),function(l){ke.has(i,l.w)?r.push(l):o(l.w)}),delete i[s])}return ke.forEach(t.nodes(),o),r}(n);ke.forEach(e,function(t){var r=n.edge(t);n.removeEdge(t),r.forwardName=t.name,r.reversed=!0,n.setEdge(t.w,t.v,r,ke.uniqueId("rev"))})},undo:function(n){ke.forEach(n.edges(),function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}})}},zbe=G0.Graph,Hh={addDummyNode:Ube,simplify:function(n){var e=new zbe().setGraph(n.graph());return ke.forEach(n.nodes(),function(t){e.setNode(t,n.node(t))}),ke.forEach(n.edges(),function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},i=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),e},asNonCompoundGraph:function(n){var e=new zbe({multigraph:n.isMultigraph()}).setGraph(n.graph());return ke.forEach(n.nodes(),function(t){n.children(t).length||e.setNode(t,n.node(t))}),ke.forEach(n.edges(),function(t){e.setEdge(t,n.edge(t))}),e},successorWeights:function(n){var e=ke.map(n.nodes(),function(t){var r={};return ke.forEach(n.outEdges(t),function(i){r[i.w]=(r[i.w]||0)+n.edge(i).weight}),r});return ke.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=ke.map(n.nodes(),function(t){var r={};return ke.forEach(n.inEdges(t),function(i){r[i.v]=(r[i.v]||0)+n.edge(i).weight}),r});return ke.zipObject(n.nodes(),e)},intersectRect:function(n,e){var t,r,i=n.x,a=n.y,o=e.x-i,s=e.y-a,l=n.width/2,u=n.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(o)*u?(s<0&&(u=-u),t=u*o/s,r=u):(o<0&&(l=-l),t=l,r=l*s/o),{x:i+t,y:a+r}},buildLayerMatrix:function(n){var e=ke.map(ke.range(Vbe(n)+1),function(){return[]});return ke.forEach(n.nodes(),function(t){var r=n.node(t),i=r.rank;ke.isUndefined(i)||(e[i][r.order]=t)}),e},normalizeRanks:function(n){var e=ke.min(ke.map(n.nodes(),function(t){return n.node(t).rank}));ke.forEach(n.nodes(),function(t){var r=n.node(t);ke.has(r,"rank")&&(r.rank-=e)})},removeEmptyRanks:function(n){var e=ke.min(ke.map(n.nodes(),function(a){return n.node(a).rank})),t=[];ke.forEach(n.nodes(),function(a){var o=n.node(a).rank-e;t[o]||(t[o]=[]),t[o].push(a)});var r=0,i=n.graph().nodeRankFactor;ke.forEach(t,function(a,o){ke.isUndefined(a)&&o%i!=0?--r:r&&ke.forEach(a,function(s){n.node(s).rank+=r})})},addBorderNode:function(n,e,t,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=r),Ube(n,"border",i,e)},maxRank:Vbe,partition:function(n,e){var t={lhs:[],rhs:[]};return ke.forEach(n,function(r){e(r)?t.lhs.push(r):t.rhs.push(r)}),t},time:function(n,e){var t=ke.now();try{return e()}finally{console.log(n+" time: "+(ke.now()-t)+"ms")}},notime:function(n,e){return e()}};function Ube(n,e,t,r){var i;do i=ke.uniqueId(r);while(n.hasNode(i));return t.dummy=e,n.setNode(i,t),i}function Vbe(n){return ke.max(ke.map(n.nodes(),function(e){var t=n.node(e).rank;if(!ke.isUndefined(t))return t}))}var $be={run:function(n){n.graph().dummyChains=[],ke.forEach(n.edges(),function(e){(function(t,r){var i,a,o,s=r.v,l=t.node(s).rank,u=r.w,h=t.node(u).rank,c=r.name,f=t.edge(r),d=f.labelRank;if(h!==l+1){for(t.removeEdge(r),o=0,++l;l<h;++o,++l)f.points=[],a={width:0,height:0,edgeLabel:f,edgeObj:r,rank:l},i=Hh.addDummyNode(t,"edge",a,"_d"),l===d&&(a.width=f.width,a.height=f.height,a.dummy="edge-label",a.labelpos=f.labelpos),t.setEdge(s,i,{weight:f.weight},c),o===0&&t.graph().dummyChains.push(i),s=i;t.setEdge(s,u,{weight:f.weight},c)}})(n,e)})},undo:function(n){ke.forEach(n.graph().dummyChains,function(e){var t,r=n.node(e),i=r.edgeLabel;for(n.setEdge(r.edgeObj,i);r.dummy;)t=n.successors(e)[0],n.removeNode(e),i.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=t,r=n.node(e)})}},WWe=function(n){var e={};ke.forEach(n.sources(),function t(r){var i=n.node(r);if(ke.has(e,r))return i.rank;e[r]=!0;var a=ke.min(ke.map(n.outEdges(r),function(o){return t(o.w)-n.edge(o).minlen}));return a!==Number.POSITIVE_INFINITY&&a!=null||(a=0),i.rank=a})},HWe=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},Aor=G0.Graph,z9=HWe,jWe=function(n){var e,t,r=new Aor({directed:!1}),i=n.nodes()[0],a=n.nodeCount();for(r.setNode(i,{});Mor(r,n)<a;)e=Ior(r,n),t=r.hasNode(e.v)?z9(n,e):-z9(n,e),Lor(r,n,t);return r};function Mor(n,e){return ke.forEach(n.nodes(),function t(r){ke.forEach(e.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;n.hasNode(o)||z9(e,i)||(n.setNode(o,{}),n.setEdge(r,o,{}),t(o))})}),n.nodeCount()}function Ior(n,e){return ke.minBy(e.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return z9(e,t)})}function Lor(n,e,t){ke.forEach(n.nodes(),function(r){e.node(r).rank+=t})}var Por=HWe,Oor=WWe,Ror=G0.alg.preorder,Dor=G0.alg.postorder,Nor=Hh.simplify,kor=zb;function zb(n){n=Nor(n),Oor(n);var e,t=jWe(n);for(Mle(t),Ale(t,n);e=qWe(t);)KWe(t,n,e,ZWe(t,n,e))}function Ale(n,e){var t=Dor(n,n.nodes());t=t.slice(0,t.length-1),ke.forEach(t,function(r){(function(i,a,o){var s=i.node(o).parent;i.edge(o,s).cutvalue=XWe(i,a,o)})(n,e,r)})}function XWe(n,e,t){var r=n.node(t).parent,i=!0,a=e.edge(t,r),o=0;return a||(i=!1,a=e.edge(r,t)),o=a.weight,ke.forEach(e.nodeEdges(t),function(s){var l,u,h=s.v===t,c=h?s.w:s.v;if(c!==r){var f=h===i,d=e.edge(s).weight;if(o+=f?d:-d,l=t,u=c,n.hasEdge(l,u)){var v=n.edge(t,c).cutvalue;o+=f?-v:v}}}),o}function Mle(n,e){arguments.length<2&&(e=n.nodes()[0]),YWe(n,{},1,e)}function YWe(n,e,t,r,i){var a=t,o=n.node(r);return e[r]=!0,ke.forEach(n.neighbors(r),function(s){ke.has(e,s)||(t=YWe(n,e,t,s,r))}),o.low=a,o.lim=t++,i?o.parent=i:delete o.parent,t}function qWe(n){return ke.find(n.edges(),function(e){return n.edge(e).cutvalue<0})}function ZWe(n,e,t){var r=t.v,i=t.w;e.hasEdge(r,i)||(r=t.w,i=t.v);var a=n.node(r),o=n.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=ke.filter(e.edges(),function(h){return l===Wbe(n,n.node(h.v),s)&&l!==Wbe(n,n.node(h.w),s)});return ke.minBy(u,function(h){return Por(e,h)})}function KWe(n,e,t,r){var i=t.v,a=t.w;n.removeEdge(i,a),n.setEdge(r.v,r.w,{}),Mle(n),Ale(n,e),function(o,s){var l=ke.find(o.nodes(),function(h){return!s.node(h).parent}),u=Ror(o,l);u=u.slice(1),ke.forEach(u,function(h){var c=o.node(h).parent,f=s.edge(h,c),d=!1;f||(f=s.edge(c,h),d=!0),s.node(h).rank=s.node(c).rank+(d?f.minlen:-f.minlen)})}(n,e)}function Wbe(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}zb.initLowLimValues=Mle,zb.initCutValues=Ale,zb.calcCutValue=XWe,zb.leaveEdge=qWe,zb.enterEdge=ZWe,zb.exchangeEdges=KWe;var JWe=WWe,For=function(n){switch(n.graph().ranker){case"network-simplex":Hbe(n);break;case"tight-tree":(function(e){JWe(e),jWe(e)})(n);break;case"longest-path":Bor(n);break;default:Hbe(n)}},Bor=JWe;function Hbe(n){kor(n)}var Gor=function(n){var e=function(t){var r={},i=0;function a(o){var s=i;ke.forEach(t.children(o),a),r[o]={low:s,lim:i++}}return ke.forEach(t.children(),a),r}(n);ke.forEach(n.graph().dummyChains,function(t){for(var r=n.node(t),i=r.edgeObj,a=function(c,f,d,v){var p,g,m=[],y=[],_=Math.min(f[d].low,f[v].low),x=Math.max(f[d].lim,f[v].lim);p=d;do p=c.parent(p),m.push(p);while(p&&(f[p].low>_||x>f[p].lim));for(g=p,p=v;(p=c.parent(p))!==g;)y.push(p);return{path:m.concat(y.reverse()),lca:g}}(n,e,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],h=!0;t!==i.w;){if(r=n.node(t),h){for(;(u=o[l])!==s&&n.node(u).maxRank<r.rank;)l++;u===s&&(h=!1)}if(!h){for(;l<o.length-1&&n.node(u=o[l+1]).minRank<=r.rank;)l++;u=o[l]}n.setParent(t,u),t=n.successors(t)[0]}})},jbe={run:function(n){var e=Hh.addDummyNode(n,"root",{},"_root"),t=function(o){var s={};function l(u,h){var c=o.children(u);c&&c.length&&ke.forEach(c,function(f){l(f,h+1)}),s[u]=h}return ke.forEach(o.children(),function(u){l(u,1)}),s}(n),r=ke.max(ke.values(t))-1,i=2*r+1;n.graph().nestingRoot=e,ke.forEach(n.edges(),function(o){n.edge(o).minlen*=i});var a=function(o){return ke.reduce(o.edges(),function(s,l){return s+o.edge(l).weight},0)}(n)+1;ke.forEach(n.children(),function(o){QWe(n,e,i,a,r,t,o)}),n.graph().nodeRankFactor=i},cleanup:function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,ke.forEach(n.edges(),function(t){n.edge(t).nestingEdge&&n.removeEdge(t)})}};function QWe(n,e,t,r,i,a,o){var s=n.children(o);if(s.length){var l=Hh.addBorderNode(n,"_bt"),u=Hh.addBorderNode(n,"_bb"),h=n.node(o);n.setParent(l,o),h.borderTop=l,n.setParent(u,o),h.borderBottom=u,ke.forEach(s,function(c){QWe(n,e,t,r,i,a,c);var f=n.node(c),d=f.borderTop?f.borderTop:c,v=f.borderBottom?f.borderBottom:c,p=f.borderTop?r:2*r,g=d!==v?1:i-a[o]+1;n.setEdge(l,d,{weight:p,minlen:g,nestingEdge:!0}),n.setEdge(v,u,{weight:p,minlen:g,nestingEdge:!0})}),n.parent(o)||n.setEdge(e,l,{weight:0,minlen:i+a[o]})}else o!==e&&n.setEdge(e,o,{weight:0,minlen:t})}var zor=function(n){ke.forEach(n.children(),function e(t){var r=n.children(t),i=n.node(t);if(r.length&&ke.forEach(r,e),ke.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Xbe(n,"borderLeft","_bl",t,i,a),Xbe(n,"borderRight","_br",t,i,a)}})};function Xbe(n,e,t,r,i,a){var o={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],l=Hh.addDummyNode(n,"border",o,t);i[e][a]=l,n.setParent(l,r),s&&n.setEdge(s,l,{weight:1})}var Ybe={adjust:function(n){var e=n.graph().rankdir.toLowerCase();e!=="lr"&&e!=="rl"||qbe(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();e!=="bt"&&e!=="rl"||function(t){ke.forEach(t.nodes(),function(r){SY(t.node(r))}),ke.forEach(t.edges(),function(r){var i=t.edge(r);ke.forEach(i.points,SY),ke.has(i,"y")&&SY(i)})}(n),e!=="lr"&&e!=="rl"||(function(t){ke.forEach(t.nodes(),function(r){wY(t.node(r))}),ke.forEach(t.edges(),function(r){var i=t.edge(r);ke.forEach(i.points,wY),ke.has(i,"x")&&wY(i)})}(n),qbe(n))}};function qbe(n){ke.forEach(n.nodes(),function(e){Zbe(n.node(e))}),ke.forEach(n.edges(),function(e){Zbe(n.edge(e))})}function Zbe(n){var e=n.width;n.width=n.height,n.height=e}function SY(n){n.y=-n.y}function wY(n){var e=n.x;n.x=n.y,n.y=e}var Uor=function(n){var e={},t=ke.filter(n.nodes(),function(s){return!n.children(s).length}),r=ke.max(ke.map(t,function(s){return n.node(s).rank})),i=ke.map(ke.range(r+1),function(){return[]});function a(s){if(!ke.has(e,s)){e[s]=!0;var l=n.node(s);i[l.rank].push(s),ke.forEach(n.successors(s),a)}}var o=ke.sortBy(t,function(s){return n.node(s).rank});return ke.forEach(o,a),i},Vor=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=$or(n,e[r-1],e[r]);return t};function $or(n,e,t){for(var r=ke.zipObject(t,ke.map(t,function(u,h){return h})),i=ke.flatten(ke.map(e,function(u){return ke.sortBy(ke.map(n.outEdges(u),function(h){return{pos:r[h.w],weight:n.edge(h).weight}}),"pos")}),!0),a=1;a<t.length;)a<<=1;var o=2*a-1;a-=1;var s=ke.map(new Array(o),function(){return 0}),l=0;return ke.forEach(i.forEach(function(u){var h=u.pos+a;s[h]+=u.weight;for(var c=0;h>0;)h%2&&(c+=s[h+1]),s[h=h-1>>1]+=u.weight;l+=u.weight*c})),l}var Wor=function(n,e){return ke.map(e,function(t){var r=n.inEdges(t);if(r.length){var i=ke.reduce(r,function(a,o){var s=n.edge(o),l=n.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}})},Hor=function(n,e){var t={};return ke.forEach(n,function(r,i){var a=t[r.v]={indegree:0,in:[],out:[],vs:[r.v],i};ke.isUndefined(r.barycenter)||(a.barycenter=r.barycenter,a.weight=r.weight)}),ke.forEach(e.edges(),function(r){var i=t[r.v],a=t[r.w];ke.isUndefined(i)||ke.isUndefined(a)||(a.indegree++,i.out.push(t[r.w]))}),function(r){var i=[];function a(l){return function(u){u.merged||(ke.isUndefined(u.barycenter)||ke.isUndefined(l.barycenter)||u.barycenter>=l.barycenter)&&function(h,c){var f=0,d=0;h.weight&&(f+=h.barycenter*h.weight,d+=h.weight),c.weight&&(f+=c.barycenter*c.weight,d+=c.weight),h.vs=c.vs.concat(h.vs),h.barycenter=f/d,h.weight=d,h.i=Math.min(c.i,h.i),c.merged=!0}(l,u)}}function o(l){return function(u){u.in.push(l),--u.indegree==0&&r.push(u)}}for(;r.length;){var s=r.pop();i.push(s),ke.forEach(s.in.reverse(),a(s)),ke.forEach(s.out,o(s))}return ke.map(ke.filter(i,function(l){return!l.merged}),function(l){return ke.pick(l,["vs","i","barycenter","weight"])})}(ke.filter(t,function(r){return!r.indegree}))},jor=function(n,e){var t=Hh.partition(n,function(c){return ke.has(c,"barycenter")}),r=t.lhs,i=ke.sortBy(t.rhs,function(c){return-c.i}),a=[],o=0,s=0,l=0;r.sort((u=!!e,function(c,f){return c.barycenter<f.barycenter?-1:c.barycenter>f.barycenter?1:u?f.i-c.i:c.i-f.i})),l=Kbe(a,i,l),ke.forEach(r,function(c){l+=c.vs.length,a.push(c.vs),o+=c.barycenter*c.weight,s+=c.weight,l=Kbe(a,i,l)});var u,h={vs:ke.flatten(a,!0)};return s&&(h.barycenter=o/s,h.weight=s),h};function Kbe(n,e,t){for(var r;e.length&&(r=ke.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var Xor=function n(e,t,r,i){var a=e.children(t),o=e.node(t),s=o?o.borderLeft:void 0,l=o?o.borderRight:void 0,u={};s&&(a=ke.filter(a,function(p){return p!==s&&p!==l}));var h=Wor(e,a);ke.forEach(h,function(p){if(e.children(p.v).length){var g=n(e,p.v,r,i);u[p.v]=g,ke.has(g,"barycenter")&&(m=p,y=g,ke.isUndefined(m.barycenter)?(m.barycenter=y.barycenter,m.weight=y.weight):(m.barycenter=(m.barycenter*m.weight+y.barycenter*y.weight)/(m.weight+y.weight),m.weight+=y.weight))}var m,y});var c=Hor(h,r);(function(p,g){ke.forEach(p,function(m){m.vs=ke.flatten(m.vs.map(function(y){return g[y]?g[y].vs:y}),!0)})})(c,u);var f=jor(c,i);if(s&&(f.vs=ke.flatten([s,f.vs,l],!0),e.predecessors(s).length)){var d=e.node(e.predecessors(s)[0]),v=e.node(e.predecessors(l)[0]);ke.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+v.order)/(f.weight+2),f.weight+=2}return f},Yor=G0.Graph,qor=function(n,e,t){var r=function(a){for(var o;a.hasNode(o=ke.uniqueId("_root")););return o}(n),i=new Yor({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(a){return n.node(a)});return ke.forEach(n.nodes(),function(a){var o=n.node(a),s=n.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),ke.forEach(n[t](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),c=ke.isUndefined(h)?0:h.weight;i.setEdge(u,a,{weight:n.edge(l).weight+c})}),ke.has(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i},Zor=function(n,e,t){var r,i={};ke.forEach(t,function(a){for(var o,s,l=n.parent(a);l;){if((o=n.parent(l))?(s=i[o],i[o]=l):(s=r,r=l),s&&s!==l)return void e.setEdge(s,l);l=o}})},Kor=G0.Graph,Jor=function(n){var e=Hh.maxRank(n),t=Jbe(n,ke.range(1,e+1),"inEdges"),r=Jbe(n,ke.range(e-1,-1,-1),"outEdges"),i=Uor(n);Qbe(n,i);for(var a,o=Number.POSITIVE_INFINITY,s=0,l=0;l<4;++s,++l){Qor(s%2?t:r,s%4>=2),i=Hh.buildLayerMatrix(n);var u=Vor(n,i);u<o&&(l=0,a=ke.cloneDeep(i),o=u)}Qbe(n,a)};function Jbe(n,e,t){return ke.map(e,function(r){return qor(n,r,t)})}function Qor(n,e){var t=new Kor;ke.forEach(n,function(r){var i=r.graph().root,a=Xor(r,i,t,e);ke.forEach(a.vs,function(o,s){r.node(o).order=s}),Zor(r,t,a.vs)})}function Qbe(n,e){ke.forEach(e,function(t){ke.forEach(t,function(r,i){n.node(r).order=i})})}var esr=G0.Graph,tsr=function(n){var e,t=Hh.buildLayerMatrix(n),r=ke.merge(rsr(n,t),nsr(n,t)),i={};ke.forEach(["u","d"],function(o){e=o==="u"?t:ke.values(t).reverse(),ke.forEach(["l","r"],function(s){s==="r"&&(e=ke.map(e,function(c){return ke.values(c).reverse()}));var l=(o==="u"?n.predecessors:n.successors).bind(n),u=asr(n,e,r,l),h=osr(n,e,u.root,u.align,s==="r");s==="r"&&(h=ke.mapValues(h,function(c){return-c})),i[o+s]=h})});var a=ssr(n,i);return lsr(i,a),usr(i,n.graph().align)};function rsr(n,e){var t={};return ke.reduce(e,function(r,i){var a=0,o=0,s=r.length,l=ke.last(i);return ke.forEach(i,function(u,h){var c=function(d,v){if(d.node(v).dummy)return ke.find(d.predecessors(v),function(p){return d.node(p).dummy})}(n,u),f=c?n.node(c).order:s;(c||u===l)&&(ke.forEach(i.slice(o,h+1),function(d){ke.forEach(n.predecessors(d),function(v){var p=n.node(v),g=p.order;!(g<a||f<g)||p.dummy&&n.node(d).dummy||eHe(t,v,d)})}),o=h+1,a=f)}),i}),t}function nsr(n,e){var t={};function r(i,a,o,s,l){var u;ke.forEach(ke.range(a,o),function(h){u=i[h],n.node(u).dummy&&ke.forEach(n.predecessors(u),function(c){var f=n.node(c);f.dummy&&(f.order<s||f.order>l)&&eHe(t,c,u)})})}return ke.reduce(e,function(i,a){var o,s=-1,l=0;return ke.forEach(a,function(u,h){if(n.node(u).dummy==="border"){var c=n.predecessors(u);c.length&&(o=n.node(c[0]).order,r(a,l,h,s,o),l=h,s=o)}r(a,l,a.length,o,i.length)}),a}),t}function eHe(n,e,t){if(e>t){var r=e;e=t,t=r}var i=n[e];i||(n[e]=i={}),i[t]=!0}function isr(n,e,t){if(e>t){var r=e;e=t,t=r}return ke.has(n[e],t)}function asr(n,e,t,r){var i={},a={},o={};return ke.forEach(e,function(s){ke.forEach(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),ke.forEach(e,function(s){var l=-1;ke.forEach(s,function(u){var h=r(u);if(h.length)for(var c=((h=ke.sortBy(h,function(p){return o[p]})).length-1)/2,f=Math.floor(c),d=Math.ceil(c);f<=d;++f){var v=h[f];a[u]===u&&l<o[v]&&!isr(t,u,v)&&(a[v]=u,a[u]=i[u]=i[v],l=o[v])}})}),{root:i,align:a}}function osr(n,e,t,r,i){var a={},o=function(u,h,c,f){var d=new esr,v=u.graph(),p=function(g,m,y){return function(_,x,S){var w,b=_.node(x),E=_.node(S),T=0;if(T+=b.width/2,ke.has(b,"labelpos"))switch(b.labelpos.toLowerCase()){case"l":w=-b.width/2;break;case"r":w=b.width/2}if(w&&(T+=y?w:-w),w=0,T+=(b.dummy?m:g)/2,T+=(E.dummy?m:g)/2,T+=E.width/2,ke.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":w=E.width/2;break;case"r":w=-E.width/2}return w&&(T+=y?w:-w),w=0,T}}(v.nodesep,v.edgesep,f);return ke.forEach(h,function(g){var m;ke.forEach(g,function(y){var _=c[y];if(d.setNode(_),m){var x=c[m],S=d.edge(x,_);d.setEdge(x,_,Math.max(p(u,y,m),S||0))}m=y})}),d}(n,e,t,i),s=i?"borderLeft":"borderRight";function l(u,h){for(var c=o.nodes(),f=c.pop(),d={};f;)d[f]?u(f):(d[f]=!0,c.push(f),c=c.concat(h(f))),f=c.pop()}return l(function(u){a[u]=o.inEdges(u).reduce(function(h,c){return Math.max(h,a[c.v]+o.edge(c))},0)},o.predecessors.bind(o)),l(function(u){var h=o.outEdges(u).reduce(function(f,d){return Math.min(f,a[d.w]-o.edge(d))},Number.POSITIVE_INFINITY),c=n.node(u);h!==Number.POSITIVE_INFINITY&&c.borderType!==s&&(a[u]=Math.max(a[u],h))},o.successors.bind(o)),ke.forEach(r,function(u){a[u]=a[t[u]]}),a}function ssr(n,e){return ke.minBy(ke.values(e),function(t){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return ke.forIn(t,function(a,o){var s=function(l,u){return l.node(u).width}(n,o)/2;r=Math.max(a+s,r),i=Math.min(a-s,i)}),r-i})}function lsr(n,e){var t=ke.values(e),r=ke.min(t),i=ke.max(t);ke.forEach(["u","d"],function(a){ke.forEach(["l","r"],function(o){var s,l=a+o,u=n[l];if(u!==e){var h=ke.values(u);(s=o==="l"?r-ke.min(h):i-ke.max(h))&&(n[l]=ke.mapValues(u,function(c){return c+s}))}})})}function usr(n,e){return ke.mapValues(n.ul,function(t,r){if(e)return n[e.toLowerCase()][r];var i=ke.sortBy(ke.map(n,r));return(i[1]+i[2])/2})}var hsr=tsr,csr=function(n){(function(e){var t=Hh.buildLayerMatrix(e),r=e.graph().ranksep,i=0;ke.forEach(t,function(a){var o=ke.max(ke.map(a,function(s){return e.node(s).height}));ke.forEach(a,function(s){e.node(s).y=i+o/2}),i+=o+r})})(n=Hh.asNonCompoundGraph(n)),ke.forEach(hsr(n),function(e,t){n.node(t).x=e})},fsr=Hh.normalizeRanks,dsr=Hh.removeEmptyRanks,vx=Hh,vsr=G0.Graph,psr=function(n,e){var t=e&&e.debugTiming?vx.time:vx.notime;t("layout",function(){var r=t(" buildLayoutGraph",function(){return function(i){var a=new vsr({multigraph:!0,compound:!0}),o=EY(i.graph());return a.setGraph(ke.merge({},ysr,bY(o,gsr),ke.pick(o,msr))),ke.forEach(i.nodes(),function(s){var l=EY(i.node(s));a.setNode(s,ke.defaults(bY(l,_sr),xsr)),a.setParent(s,i.parent(s))}),ke.forEach(i.edges(),function(s){var l=EY(i.edge(s));a.setEdge(s,ke.merge({},wsr,bY(l,Ssr),ke.pick(l,bsr)))}),a}(n)});t(" runLayout",function(){(function(i,a){a(" makeSpaceForEdgeLabels",function(){(function(o){var s=o.graph();s.ranksep/=2,ke.forEach(o.edges(),function(l){var u=o.edge(l);u.minlen*=2,u.labelpos.toLowerCase()!=="c"&&(s.rankdir==="TB"||s.rankdir==="BT"?u.width+=u.labeloffset:u.height+=u.labeloffset)})})(i)}),a(" removeSelfEdges",function(){(function(o){ke.forEach(o.edges(),function(s){if(s.v===s.w){var l=o.node(s.v);l.selfEdges||(l.selfEdges=[]),l.selfEdges.push({e:s,label:o.edge(s)}),o.removeEdge(s)}})})(i)}),a(" acyclic",function(){Gbe.run(i)}),a(" nestingGraph.run",function(){jbe.run(i)}),a(" rank",function(){For(vx.asNonCompoundGraph(i))}),a(" injectEdgeLabelProxies",function(){(function(o){ke.forEach(o.edges(),function(s){var l=o.edge(s);if(l.width&&l.height){var u=o.node(s.v),h={rank:(o.node(s.w).rank-u.rank)/2+u.rank,e:s};vx.addDummyNode(o,"edge-proxy",h,"_ep")}})})(i)}),a(" removeEmptyRanks",function(){dsr(i)}),a(" nestingGraph.cleanup",function(){jbe.cleanup(i)}),a(" normalizeRanks",function(){fsr(i)}),a(" assignRankMinMax",function(){(function(o){var s=0;ke.forEach(o.nodes(),function(l){var u=o.node(l);u.borderTop&&(u.minRank=o.node(u.borderTop).rank,u.maxRank=o.node(u.borderBottom).rank,s=ke.max(s,u.maxRank))}),o.graph().maxRank=s})(i)}),a(" removeEdgeLabelProxies",function(){(function(o){ke.forEach(o.nodes(),function(s){var l=o.node(s);l.dummy==="edge-proxy"&&(o.edge(l.e).labelRank=l.rank,o.removeNode(s))})})(i)}),a(" normalize.run",function(){$be.run(i)}),a(" parentDummyChains",function(){Gor(i)}),a(" addBorderSegments",function(){zor(i)}),a(" order",function(){Jor(i)}),a(" insertSelfEdges",function(){(function(o){var s=vx.buildLayerMatrix(o);ke.forEach(s,function(l){var u=0;ke.forEach(l,function(h,c){var f=o.node(h);f.order=c+u,ke.forEach(f.selfEdges,function(d){vx.addDummyNode(o,"selfedge",{width:d.label.width,height:d.label.height,rank:f.rank,order:c+ ++u,e:d.e,label:d.label},"_se")}),delete f.selfEdges})})})(i)}),a(" adjustCoordinateSystem",function(){Ybe.adjust(i)}),a(" position",function(){csr(i)}),a(" positionSelfEdges",function(){(function(o){ke.forEach(o.nodes(),function(s){var l=o.node(s);if(l.dummy==="selfedge"){var u=o.node(l.e.v),h=u.x+u.width/2,c=u.y,f=l.x-h,d=u.height/2;o.setEdge(l.e,l.label),o.removeNode(s),l.label.points=[{x:h+2*f/3,y:c-d},{x:h+5*f/6,y:c-d},{x:h+f,y:c},{x:h+5*f/6,y:c+d},{x:h+2*f/3,y:c+d}],l.label.x=l.x,l.label.y=l.y}})})(i)}),a(" removeBorderNodes",function(){(function(o){ke.forEach(o.nodes(),function(s){if(o.children(s).length){var l=o.node(s),u=o.node(l.borderTop),h=o.node(l.borderBottom),c=o.node(ke.last(l.borderLeft)),f=o.node(ke.last(l.borderRight));l.width=Math.abs(f.x-c.x),l.height=Math.abs(h.y-u.y),l.x=c.x+l.width/2,l.y=u.y+l.height/2}}),ke.forEach(o.nodes(),function(s){o.node(s).dummy==="border"&&o.removeNode(s)})})(i)}),a(" normalize.undo",function(){$be.undo(i)}),a(" fixupEdgeLabelCoords",function(){(function(o){ke.forEach(o.edges(),function(s){var l=o.edge(s);if(ke.has(l,"x"))switch(l.labelpos!=="l"&&l.labelpos!=="r"||(l.width-=l.labeloffset),l.labelpos){case"l":l.x-=l.width/2+l.labeloffset;break;case"r":l.x+=l.width/2+l.labeloffset}})})(i)}),a(" undoCoordinateSystem",function(){Ybe.undo(i)}),a(" translateGraph",function(){(function(o){var s=Number.POSITIVE_INFINITY,l=0,u=Number.POSITIVE_INFINITY,h=0,c=o.graph(),f=c.marginx||0,d=c.marginy||0;function v(p){var g=p.x,m=p.y,y=p.width,_=p.height;s=Math.min(s,g-y/2),l=Math.max(l,g+y/2),u=Math.min(u,m-_/2),h=Math.max(h,m+_/2)}ke.forEach(o.nodes(),function(p){v(o.node(p))}),ke.forEach(o.edges(),function(p){var g=o.edge(p);ke.has(g,"x")&&v(g)}),s-=f,u-=d,ke.forEach(o.nodes(),function(p){var g=o.node(p);g.x-=s,g.y-=u}),ke.forEach(o.edges(),function(p){var g=o.edge(p);ke.forEach(g.points,function(m){m.x-=s,m.y-=u}),ke.has(g,"x")&&(g.x-=s),ke.has(g,"y")&&(g.y-=u)}),c.width=l-s+f,c.height=h-u+d})(i)}),a(" assignNodeIntersects",function(){(function(o){ke.forEach(o.edges(),function(s){var l,u,h=o.edge(s),c=o.node(s.v),f=o.node(s.w);h.points?(l=h.points[0],u=h.points[h.points.length-1]):(h.points=[],l=f,u=c),h.points.unshift(vx.intersectRect(c,l)),h.points.push(vx.intersectRect(f,u))})})(i)}),a(" reversePoints",function(){(function(o){ke.forEach(o.edges(),function(s){var l=o.edge(s);l.reversed&&l.points.reverse()})})(i)}),a(" acyclic.undo",function(){Gbe.undo(i)})})(r,t)}),t(" updateInputGraph",function(){(function(i,a){ke.forEach(i.nodes(),function(o){var s=i.node(o),l=a.node(o);s&&(s.x=l.x,s.y=l.y,a.children(o).length&&(s.width=l.width,s.height=l.height))}),ke.forEach(i.edges(),function(o){var s=i.edge(o),l=a.edge(o);s.points=l.points,ke.has(l,"x")&&(s.x=l.x,s.y=l.y)}),i.graph().width=a.graph().width,i.graph().height=a.graph().height})(n,r)})})},gsr=["nodesep","edgesep","ranksep","marginx","marginy"],ysr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},msr=["acyclicer","ranker","rankdir","align"],_sr=["width","height"],xsr={width:0,height:0},Ssr=["minlen","weight","width","height","labeloffset"],wsr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},bsr=["labelpos"];function bY(n,e){return ke.mapValues(ke.pick(n,e),Number)}function EY(n){var e={};return ke.forEach(n,function(t,r){e[r.toLowerCase()]=t}),e}var Esr=G0.Graph,tHe={graphlib:G0,layout:psr,debug:{debugOrdering:function(n){var e=Hh.buildLayerMatrix(n),t=new Esr({compound:!0,multigraph:!0}).setGraph({});return ke.forEach(n.nodes(),function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)}),ke.forEach(n.edges(),function(r){t.setEdge(r.v,r.w,{},r.name)}),ke.forEach(e,function(r,i){var a="layer"+i;t.setNode(a,{rank:"same"}),ke.reduce(r,function(o,s){return t.setEdge(o,s,{style:"invis"}),s})}),t}},util:{time:Hh.time,notime:Hh.notime},version:"0.8.5"},Tsr=tHe.graphlib,Csr=tHe.layout;class Asr{constructor(e){this.cardinality=1,this.include=l2.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=dd.NODE,this.name=e.name,this.attr=e.attr||{},this.inputs=e.inputs,this.path=e.path||[],this.width=e.width,this.height=e.height}}class Msr{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}function Isr(n){const e=new Msr;return n.nodes.map(t=>new Asr(t)).forEach(t=>{e.nodes[t.name]=t,t.inputs.forEach(r=>{(function(i,a,o){o.name!==a.name&&i.edges.push(Object.assign(Object.assign({},o.attr),{v:o.name,w:a.name}))})(e,t,r)})}),e}class Lsr{constructor(e,t={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=l2.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=dd.META,this.path=[],this.name=e,this.metaGraph=Ile(e,NM.META,t)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(e=>this.metaGraph.node(e))}leaves(){let e,t=[],r=[this];for(;r.length;){let i=r.shift();i.isGroupNode?(e=i.metaGraph,e.nodes().forEach(a=>r.push(e.node(a)))):t.push(i.name)}return t}}class Psr{constructor(e,t){this.v=e,this.w=t,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(e,t){this.baseEdgeList.push(e)}}function rHe(n,e={}){return new Lsr(n,e)}function nHe(n,e){return new Psr(n,e)}function Ile(n,e,t){const r=t||{},i=new Tsr.Graph(r);return i.setGraph({name:n,rankdir:r.rankdir,type:e,align:r.align}),i}class Osr{constructor(e={}){this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=rHe(DM,this.graphOptions),this.index[DM]=this.root}getNodeMap(){return this.index}node(e){return this.index[e]}setNode(e,t){this.index[e]=t}getBridgeGraph(e){const t=this.index[e];if(!t)throw Error("Could not find node in hierarchy: "+e);if(!("metaGraph"in t))return null;const r=t;if(r.bridgeGraph)return r.bridgeGraph;const i=Ile(j$e,NM.BRIDGE,this.graphOptions);if(r.bridgeGraph=i,!t.parentNode||!("metaGraph"in t.parentNode))return i;const a=t.parentNode;return[a.metaGraph,this.getBridgeGraph(a.name)].forEach(o=>{o.edges().filter(s=>s.v===e||s.w===e).forEach(s=>{const l=s.w===e;o.edge(s).baseEdgeList.forEach(u=>{const[h,c]=l?[u.w,s.v]:[u.v,s.w],f=this.getChildName(e,h),d={v:l?c:f,w:l?f:c};let v=i.edge(d);v||(v=nHe(d.v,d.w),v.inbound=l,i.setEdge(d.v,d.w,v)),v.addBaseEdge(u,this)})})}),i}getChildName(e,t){let r=this.index[t];for(;r;){if(r.parentNode&&r.parentNode.name===e)return r.name;r=r.parentNode}throw Error("Could not find immediate child for descendant: "+t)}getPredecessors(e){const t=this.index[e];if(!t)throw Error("Could not find node with name: "+e);return this.getOneWayEdges(t,!0)}getSuccessors(e){const t=this.index[e];if(!t)throw Error("Could not find node with name: "+e);return this.getOneWayEdges(t,!1)}getOneWayEdges(e,t){const r=[];if(!e.parentNode||!e.parentNode.isGroupNode)return r;const i=e.parentNode,a=i.metaGraph,o=this.getBridgeGraph(i.name);return eEe(a,e,t,r),eEe(o,e,t,r),r}}function Rsr(n,e){const{rankDirection:t,align:r}=e,i=new Osr({rankdir:t,align:r});return function(a,o){Object.keys(o.nodes).forEach(s=>{const l=o.nodes[s],u=l.path;let h=a.root;h.depth=Math.max(u.length,h.depth);for(let c=0;c<u.length&&(h.depth=Math.max(h.depth,u.length-c),h.cardinality+=l.cardinality,c!==u.length-1);c++){const f=u[c];let d=a.node(f);d||(d=rHe(f,a.graphOptions),d.path=l.path.slice(0,c+1),d.parentNode=h,a.setNode(f,d),h.metaGraph.setNode(f,d)),h=d}a.setNode(l.name,l),l.parentNode=h,h.metaGraph.setNode(l.name,l)})}(i,n),function(a,o){const s=a.getNodeMap();let l=[],u=[];const h=(c,f)=>{let d=0;for(;c;)f[d++]=c.name,c=c.parentNode;return d-1};o.edges.forEach(c=>{l=[],u=[];let f=h(o.nodes[c.v],l),d=h(o.nodes[c.w],u);for(;l[f]===u[d];)if(f--,d--,f<0||d<0)throw Error("No difference found between ancestor paths.");const v=s[l[f+1]],p=l[f],g=u[d];let m=v.metaGraph.edge(p,g);m||(m=nHe(p,g),v.metaGraph.setEdge(p,g,m)),m.addBaseEdge(c,a)})}(i,n),i}function eEe(n,e,t,r){(t?n.inEdges(e.name):n.outEdges(e.name)).forEach(i=>{const a=n.edge(i);r.push(a)})}class Dsr{constructor(e){this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new rEe(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(e){if(e in this.hasSubHierarchy)return;this.hasSubHierarchy[e]=!0;const t=this.index[e];if(t.node.type!==dd.META)return;const r=t,i=r.node.metaGraph,a=r.coreGraph;i.nodes().forEach(h=>{const c=this.getOrCreateRenderNodeByName(h);a.setNode(h,c)}),i.edges().forEach(h=>{const c=i.edge(h),f=new tEe(c);a.setEdge(h.v,h.w,f)});const o=r.node.parentNode;if(!o)return;const s=this.getRenderNodeByName(o.name),l=(h,...c)=>c.concat([h?"IN":"OUT"]).join("~~"),u=this.hierarchy.getBridgeGraph(e);u.edges().forEach(h=>{const c=u.edge(h),f=!!i.node(h.w),[d,v]=f?[h.w,h.v]:[h.v,h.w],p=S=>{const w=f?{v:S,w:e}:{v:e,w:S};return s.coreGraph.edge(w)};let g=p(v);g||(g=p(l(f,v,o.name)));const m=l(f,e),y=l(f,v,e);let _=a.node(y);if(!_){let S=a.node(m);if(!S){const b={name:m,type:dd.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:l2.UNSPECIFIED,inbound:f,attr:{}};S=new n8(b),this.index[m]=S,a.setNode(m,S)}const w={name:y,type:dd.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:l2.UNSPECIFIED,inbound:f,attr:{}};_=new n8(w),this.index[y]=_,a.setNode(y,_),a.setParent(y,m),S.node.cardinality++}const x=new tEe(c);x.adjoiningMetaEdge=g,f?a.setEdge(y,d,x):a.setEdge(d,y,x)})}getOrCreateRenderNodeByName(e){if(!e)return null;if(e in this.index)return this.index[e];const t=this.getNodeByName(e);return t?(this.index[e]=t.isGroupNode?new rEe(t,this.hierarchy.graphOptions):new n8(t),this.index[e]):null}getRenderNodeByName(e){return this.index[e]}getNodeByName(e){return this.hierarchy.node(e)}}class n8{constructor(e){this.node=e,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=e.width||0,this.height=e.height||0,this.displayName=e.name,this.attr=e.attr}}class tEe{constructor(e){this.metaEdge=e,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class rEe extends n8{constructor(e,t){super(e);const r=e.metaGraph.graph();t.compound=!0,this.coreGraph=Ile(r.name,NM.CORE,t)}}function iHe(n,e){n.node.isGroupNode&&function(t,r){const i=kee(r);t.coreGraph.nodes().map(a=>t.coreGraph.node(a)).forEach(a=>{var o,s,l,u,h,c;const{height:f,width:d}=a;switch(a.node.type){case dd.NODE:Object.assign(a,i.nodeSize.node),a.height=f||i.nodeSize.node.height,a.width=d||i.nodeSize.node.width;break;case dd.BRIDGE:Object.assign(a,i.nodeSize.bridge);break;case dd.META:a.expanded?iHe(a,r):(Object.assign(a,i.nodeSize.meta),a.height=i.nodeSize.meta.height,a.width=i.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+a.node.type)}if(!a.expanded){const v=a.attr;(function(p,g=!1){if(p.coreBox.width=p.width,p.coreBox.height=p.height,!g){const m=`${p.displayName}`.length,y=3;p.width=Math.max(p.coreBox.width,m*y)}})(a,r&&(a.node.type===0&&!!(!((s=(o=r==null?void 0:r.nodeSize)===null||o===void 0?void 0:o.meta)===null||s===void 0)&&s.width)||a.node.type===1&&(!!(!((u=(l=r==null?void 0:r.nodeSize)===null||l===void 0?void 0:l.node)===null||u===void 0)&&u.width)||!!v.width)||a.node.type===2&&!!(!((c=(h=r==null?void 0:r.nodeSize)===null||h===void 0?void 0:h.bridge)===null||c===void 0)&&c.width)))}})}(n,e),n.node.type===dd.META&&function(t,r){const i=kee(r),a=i.subScene.meta;Object.assign(t,a);const{nodeSep:o,rankSep:s,edgeSep:l,align:u}=i.graph.meta,h={nodesep:o,ranksep:s,edgesep:l,align:u};Object.assign(t.coreBox,function(d,v){const{ranksep:p,nodesep:g,edgesep:m,align:y}=v;Object.assign(d.graph(),{ranksep:p,nodesep:g,edgesep:m,align:y});const _=[];if(d.nodes().forEach(E=>{d.node(E).node.type!==dd.BRIDGE&&_.push(E)}),!_.length)return{width:0,height:0};Csr(d);let x=1/0,S=1/0,w=-1/0,b=-1/0;return _.forEach(E=>{const T=d.node(E),C=.5*T.width,A=T.x-C,M=T.x+C;x=A<x?A:x,w=M>w?M:w;const I=.5*T.height,R=T.y-I,k=T.y+I;S=R<S?R:S,b=k>b?k:b}),d.edges().forEach(E=>{const T=d.edge(E),C=d.node(T.metaEdge.v),A=d.node(T.metaEdge.w);if(T.points.length===3&&function(R){let k=nEe(R[0],R[1]);for(let D=1;D<R.length-1;D++){const G=nEe(R[D],R[D+1]);if(Math.abs(G-k)>1)return!1;k=G}return!0}(T.points)){if(C!=null){const R=C.expanded?C.x:Xee(C);T.points[0].x=R}if(A!=null){const R=A.expanded?A.x:Xee(A);T.points[2].x=R}T.points=[T.points[0],T.points[1]]}const M=T.points[T.points.length-2];A!=null&&(T.points[T.points.length-1]=iEe(M,A));const I=T.points[1];C!=null&&(T.points[0]=iEe(I,C)),T.points.forEach(R=>{x=R.x<x?R.x:x,w=R.x>w?R.x:w,S=R.y<S?R.y:S,b=R.y>b?R.y:b})}),d.nodes().forEach(E=>{const T=d.node(E);T.x-=x,T.y-=S}),d.edges().forEach(E=>{d.edge(E).points.forEach(T=>{T.x-=x,T.y-=S})}),{width:w-x,height:b-S}}(t.coreGraph,h));let c=0;t.coreGraph.nodeCount()>0&&c++;const f=c<=1?0:c;t.coreBox.width+=f+f,t.coreBox.height=a.labelHeight+t.coreBox.height,t.width=t.coreBox.width+a.paddingLeft+a.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(n,e)}function nEe(n,e){const t=e.x-n.x,r=e.y-n.y;return 180*Math.atan(r/t)/Math.PI}function Xee(n){return n.expanded?n.x:n.x-n.width/2+0+n.coreBox.width/2}function iEe(n,e){const t=e.expanded?e.x:Xee(e),r=e.y,i=n.x-t,a=n.y-r;let o,s,l=e.expanded?e.width:e.coreBox.width,u=e.expanded?e.height:e.coreBox.height;return Math.abs(a)*l/2>Math.abs(i)*u/2?(a<0&&(u=-u),o=a===0?0:u/2*i/a,s=u/2):(i<0&&(l=-l),o=l/2,s=i===0?0:l/2*a/i),{x:t+o,y:r+s}}function Nsr(n,e,t){var r,i,a,o;const s=n.nodes.filter((c,f,d)=>d.findIndex(v=>v.id===c.id)!==f).map(c=>c.id);if(s.length)throw new Error(`Duplicated ids found: ${s.join(", ")}`);const l=function(c){const f={nodes:[]},d=c.compound,v=Object.keys(d||{}),p=new Map,g=(y,_=[])=>{if(p.has(y))return p.get(y);for(let x=0;x<v.length;x++){let S=v[x];if(d&&d[S].indexOf(y)!==-1)return _.unshift(S),g(S,_)}return _.length===0&&p.set(y,_),_},m=y=>c.edges.filter(_=>_.w===y).map(_=>({name:_.v}));return c.nodes.forEach(y=>{const _=y.id,x=[...g(_),_];let S=m(_);f.nodes.push({name:_,path:x,inputs:S,width:y.width,height:y.height,attr:Object.assign({},y)})}),f}(n),u=function(c,f){const d=(p,g)=>{for(let m of g.values())if(m.includes(p))return!0;return!1},v=(p,g=[])=>{if(Object.keys(p).length===0)return[...new Set(g)];const m=new Map(Object.keys(p).map(_=>[_,p[_]])),y={};for(let[_,x]of m)d(_,m)?y[_]=x:g=g.concat(_,x);return v(y,g)};return v(c).filter(p=>f.includes(p))}(n.compound||{},(e==null?void 0:e.expanded)||[]),h=function(c,f){return function(d){return new Dsr(d)}(Rsr(Isr(c),f))}(l,{rankDirection:((i=(r=t==null?void 0:t.graph)===null||r===void 0?void 0:r.meta)===null||i===void 0?void 0:i.rankDir)||(e==null?void 0:e.rankDirection)||R9.graph.meta.rankDir,align:((o=(a=t==null?void 0:t.graph)===null||a===void 0?void 0:a.meta)===null||o===void 0?void 0:o.align)||R9.graph.meta.align});return function(c,f){f.forEach(d=>{const v=c.getRenderInfoNodes().find(m=>m.displayName===d);let p=v&&v.node&&v.node.name||"";const g=c.getRenderNodeByName(p);if(!g)throw new Error(`No nodes found: ${p}`);g.expanded=!0,c.buildSubHierarchy(p)})}(h,u),iHe(h.root,t),aHe(h.root)}function ksr(n,e=!1){const t=JSON.parse(JSON.stringify(n)),r={nodes:[t],edges:[...t.edges]};return t.nodes.forEach(function i(a){(a.type===0||a.type===1)&&r.nodes.push(a),a.type===0&&(r.edges=r.edges.concat(a.edges)),Array.isArray(a.nodes)&&a.nodes.forEach(i)}),e&&r.nodes.forEach(i=>{const a=r.nodes.find(o=>o.id===i.parentNodeName);if(a){const o=a.x-a.width/2+a.paddingLeft,s=a.y-a.height/2+a.labelHeight+a.paddingTop;a.id!==DM&&(i.x+=o,i.y+=s),i.type===0&&i.edges.forEach(l=>{l.points.forEach(u=>{u.x+=i.x-i.width/2+i.paddingLeft,u.y+=i.y-i.height/2+i.labelHeight+i.paddingTop})})}}),r}function Fsr(n,e,t,r){var i,a;let o=[];const s=((i=t.find(c=>c.id===n))===null||i===void 0?void 0:i.path)||[],l=((a=t.find(c=>c.id===e))===null||a===void 0?void 0:a.path)||[],u=[DM,...s].slice(0,s.length).reverse(),h=[DM,...l].slice(0,l.length);return u.forEach(c=>{const f=t.find(d=>d.id===c);o=o.concat(f.edges.filter(d=>d.baseEdgeList.some(v=>v.v===((r==null?void 0:r.v)||n)&&v.w===((r==null?void 0:r.w)||e))))}),h.filter(c=>!u.includes(c)).forEach(c=>{const f=t.find(d=>d.id===c);o=o.concat(f.edges.filter(d=>d.baseEdgeList.some(v=>v.v===((r==null?void 0:r.v)||n)&&v.w===((r==null?void 0:r.w)||e))))}),o}function aHe(n){const e=n.coreGraph.nodes().map(r=>n.coreGraph.node(r));return Object.assign(Object.assign({},aEe(n)),{expanded:n.expanded,nodes:n.expanded?(t=e,t.map(r=>r.node.type===dd.META?aHe(r):aEe(r))):[],edges:n.expanded?Bsr(n):[]});var t}function aEe(n){return{id:n.node.name,name:n.node.name,type:n.node.type,cardinality:n.node.cardinality,attr:n.attr,parentNodeName:n.node.parentNode?n.node.parentNode.name:null,coreBox:Object.assign({},n.coreBox),x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius,labelHeight:n.labelHeight,labelOffset:n.labelOffset,outboxWidth:n.outboxWidth,paddingLeft:n.paddingLeft,paddingTop:n.paddingTop,paddingRight:n.paddingRight,paddingBottom:n.paddingBottom,path:n.node.path}}function Bsr(n){return n.coreGraph.edges().map(e=>({renderInfoEdge:n.coreGraph.edge(e),edge:e})).filter(({renderInfoEdge:e})=>e.metaEdge).map(({edge:e,renderInfoEdge:t})=>{const r=function(i,a){const o=a.points.map(s=>Object.assign({},s));if(a.adjoiningMetaEdge){const s=a.adjoiningMetaEdge.points,l=a.metaEdge.inbound,u=l?s[s.length-1]:s[0],h=o[l?0:o.length-1],c=i.x-i.width/2,f=i.y-i.height/2,d=u.x-c,v=u.y-f,p=-i.paddingLeft,g=-(i.paddingTop+i.labelHeight);h.x=d+p,h.y=v+g}return o}(n,t);return{adjoiningEdge:t.adjoiningMetaEdge?{w:t.adjoiningMetaEdge.metaEdge.w,v:t.adjoiningMetaEdge.metaEdge.v}:null,inbound:t.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:t.weight,baseEdgeList:t.metaEdge.baseEdgeList,parentNodeName:n.node.name}})}const Gsr=Object.freeze(Object.defineProperty({__proto__:null,BRIDGE_GRAPH_NAME:j$e,get GraphType(){return NM},get HierarchyNodeType(){return Fee},get InclusionType(){return l2},LAYOUT_CONFIG:R9,get NodeType(){return dd},ROOT_NAME:DM,buildGraph:Nsr,flatGraph:ksr,getEdges:Fsr,mergeConfig:kee},Symbol.toStringTag,{value:"Module"})),zsr=Nd(Gsr);var Usr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Fg=at&&at.__assign||function(){return Fg=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Fg.apply(this,arguments)},vC=at&&at.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))};Object.defineProperty(nk,"__esModule",{value:!0});nk.DagreCompoundLayout=void 0;var Vsr=Xl,Kv=zsr,N5=Dl(),$sr=function(n){Usr(e,n);function e(t){var r=n.call(this)||this;return r.rankdir="TB",r.nodesep=50,r.edgesep=5,r.ranksep=50,r.controlPoints=!0,r.anchorPoint=!0,r.nodes=[],r.edges=[],r.combos=[],r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},e.prototype.init=function(t){var r=t.hiddenNodes||[],i=t.hiddenEdges||[],a=t.hiddenCombos||[];this.nodes=this.getDataByOrder((t.nodes||[]).concat(r)),this.edges=this.getDataByOrder((t.edges||[]).concat(i)),this.combos=(t.combos||[]).concat(a.map(function(o){return Fg(Fg({},o),{collapsed:!0})}))},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges;if(!!r){var a=t.getLayoutConfig(),o=a.graphDef,s=a.graphOption,l=a.graphSettings,u=(0,Kv.buildGraph)(o,s,l),h=(0,Kv.flatGraph)(u,!0);return this.updatePosition(h),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i}}},e.prototype.getNodePath=function(t){var r=this,i=r.nodes,a=r.combos,o=i.find(function(l){return l.id===t}),s=function(l,u){u===void 0&&(u=[]);var h=a.find(function(c){return c.id===l});return h?(u.unshift(l),h.parentId?s(h.parentId,u):u):u};return o&&o.comboId?s(o.comboId,[t]):[t]},e.prototype.getLayoutConfig=function(){var t,r,i,a=this,o=a.nodes,s=a.edges,l=a.combos,u=a.nodeSize,h=a.rankdir,c=a.align,f=a.edgesep,d=a.nodesep,v=a.ranksep,p=a.settings,g=(l||[]).reduce(function(D,G){var W=o.filter(function(V){return V.comboId===G.id}).map(function(V){return V.id}),z=(l||[]).filter(function(V){return V.parentId===G.id}).map(function(V){return V.id});return(W.length||z.length)&&(D[G.id]=vC(vC([],W,!0),z,!0)),D},{}),m;u?(0,N5.isArray)(u)?m=function(){return u}:m=function(){return[u,u]}:m=function(D){return D&&D.size?(0,N5.isArray)(D.size)?D.size:(0,N5.isObject)(D.size)?[D.size.width||40,D.size.height||40]:[D.size,D.size]:[40,40]};var y=function(D){return D&&D.size?(0,N5.isArray)(D.size)?D.size:[D.size,D.size]:[80,40]},_=y(l==null?void 0:l[0]),x=_[0],S=_[1],w=(r=(t=a.graphSettings)===null||t===void 0?void 0:t.subScene)===null||r===void 0?void 0:r.meta,b=((i=l.find(function(D){return!D.collapsed}))===null||i===void 0?void 0:i.padding)||[20,20,20,20],E=b[0],T=b[1],C=b[2],A=b[3],M={compound:g,nodes:vC([],(o||[]).map(function(D){var G=m(D),W=G[0],z=G[1];return Fg(Fg({},D),{width:W,height:z})}),!0),edges:vC([],(s||[]).map(function(D){return Fg(Fg({},D),{v:D.source,w:D.target})}),!0)},I={expanded:(l||[]).filter(function(D){return!D.collapsed}).map(function(D){return D.id})},R={graph:{meta:{align:c,rankDir:h,nodeSep:d,edgeSep:f,rankSep:v}},subScene:{meta:{paddingTop:E||(w==null?void 0:w.paddingTop)||20,paddingRight:T||(w==null?void 0:w.paddingRight)||20,paddingBottom:C||(w==null?void 0:w.paddingBottom)||20,paddingLeft:A||(w==null?void 0:w.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:x,height:S}}},k=(0,Kv.mergeConfig)(p,Fg({},(0,Kv.mergeConfig)(R,Kv.LAYOUT_CONFIG)));return a.graphSettings=k,{graphDef:M,graphOption:I,graphSettings:k}},e.prototype.updatePosition=function(t){var r=t.nodes,i=t.edges;this.updateNodePosition(r,i),this.updateEdgePosition(r,i)},e.prototype.getBegin=function(t,r){var i=this,a=i.begin,o=[0,0];if(a){var s=1/0,l=1/0;t.forEach(function(u){s>u.x&&(s=u.x),l>u.y&&(l=u.y)}),r.forEach(function(u){u.points.forEach(function(h){s>h.x&&(s=h.x),l>h.y&&(l=h.y)})}),o[0]=a[0]-s,o[1]=a[1]-l}return o},e.prototype.updateNodePosition=function(t,r){var i=this,a=i.combos,o=i.nodes,s=i.edges,l=i.anchorPoint,u=i.graphSettings,h=this.getBegin(t,r);t.forEach(function(c){var f,d=c.x,v=c.y,p=c.id,g=c.type,m=c.coreBox;if(g===Kv.HierarchyNodeType.META&&p!==Kv.ROOT_NAME){var y=a.findIndex(function(b){return b.id===p}),_=(f=u==null?void 0:u.subScene)===null||f===void 0?void 0:f.meta;a[y].offsetX=d+h[0],a[y].offsetY=v+h[1],a[y].fixSize=[m.width,m.height],a[y].fixCollapseSize=[m.width,m.height],c.expanded?a[y].padding=[_==null?void 0:_.paddingTop,_==null?void 0:_.paddingRight,_==null?void 0:_.paddingBottom,_==null?void 0:_.paddingLeft]:a[y].padding=[0,0,0,0]}else if(g===Kv.HierarchyNodeType.OP){var y=o.findIndex(function(E){return E.id===p});if(o[y].x=d+h[0],o[y].y=v+h[1],l){var x=[],S=r.filter(function(E){return E.v===p}),w=r.filter(function(E){return E.w===p});S.length>0&&S.forEach(function(E){var T=E.points[0],C=(T.x-d)/c.width+.5,A=(T.y-v)/c.height+.5;x.push([C,A]),E.baseEdgeList.forEach(function(M){var I=s.find(function(R){return R.source===M.v&&R.target===M.w});I&&(I.sourceAnchor=x.length-1)})}),w.length>0&&w.forEach(function(E){var T=E.points[E.points.length-1],C=(T.x-d)/c.width+.5,A=(T.y-v)/c.height+.5;x.push([C,A]),E.baseEdgeList.forEach(function(M){var I=s.find(function(R){return R.source===M.v&&R.target===M.w});I&&(I.targetAnchor=x.length-1)})}),o[y].anchorPoints=x.length>0?x:o[y].anchorPoints||[]}}})},e.prototype.updateEdgePosition=function(t,r){var i=this,a=i.combos,o=i.edges,s=i.controlPoints,l=this.getBegin(t,r);s&&(a.forEach(function(u){u.inEdges=[],u.outEdges=[]}),o.forEach(function(u){var h,c,f,d,v=t.find(function(b){return b.id===u.source}),p=t.find(function(b){return b.id===u.target}),g=[],m=[];if(v&&p)m=(0,Kv.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,t);else if(!v||!p){var y=i.getNodePath(u.source),_=i.getNodePath(u.target),x=y.reverse().slice(v?0:1).find(function(b){return t.find(function(E){return E.id===b})}),S=_.reverse().slice(p?0:1).find(function(b){return t.find(function(E){return E.id===b})});v=t.find(function(b){return b.id===x}),p=t.find(function(b){return b.id===S}),m=(0,Kv.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,t,{v:u.source,w:u.target})}if(g=m.reduce(function(b,E){return vC(vC([],b,!0),E.points.map(function(T){return Fg(Fg({},T),{x:T.x+l[0],y:T.y+l[1]})}),!0)},[]),g=g.slice(1,-1),u.controlPoints=g,(p==null?void 0:p.type)===Kv.NodeType.META){var w=a.findIndex(function(b){return b.id===(p==null?void 0:p.id)});if(!a[w]||((h=a[w].inEdges)===null||h===void 0?void 0:h.some(function(b){return b.source===v.id&&b.target===p.id})))return;(c=a[w].inEdges)===null||c===void 0||c.push({source:v.id,target:p.id,controlPoints:g})}if((v==null?void 0:v.type)===Kv.NodeType.META){var w=a.findIndex(function(E){return E.id===(v==null?void 0:v.id)});if(!a[w]||((f=a[w].outEdges)===null||f===void 0?void 0:f.some(function(E){return E.source===v.id&&E.target===p.id})))return;(d=a[w].outEdges)===null||d===void 0||d.push({source:v.id,target:p.id,controlPoints:g})}}))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every(function(r){return r.layoutOrder!==void 0})||t.forEach(function(r,i){r.layoutOrder=i}),t.sort(function(r,i){return r.layoutOrder-i.layoutOrder})},e}(Vsr.Base);nk.DagreCompoundLayout=$sr;var Lle={},AV={},Ple={};const Wsr=Object.prototype.toString;function U9(n){const e=Wsr.call(n);return e.endsWith("Array]")&&!e.includes("Big")}function Hsr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!U9(n))throw new TypeError("input must be an array");if(n.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,i=e.toIndex,a=i===void 0?n.length:i;if(r<0||r>=n.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>n.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=n[r],s=r+1;s<a;s++)n[s]>o&&(o=n[s]);return o}function jsr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!U9(n))throw new TypeError("input must be an array");if(n.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,r=t===void 0?0:t,i=e.toIndex,a=i===void 0?n.length:i;if(r<0||r>=n.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=r||a>n.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=n[r],s=r+1;s<a;s++)n[s]<o&&(o=n[s]);return o}function oEe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(U9(n)){if(n.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!U9(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(n.length);var r=jsr(n),i=Hsr(n);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=e.min,o=a===void 0?e.autoMinMax?r:0:a,s=e.max,l=s===void 0?e.autoMinMax?i:1:s;if(o>=l)throw new RangeError("min option must be smaller than max option");for(var u=(l-o)/(i-r),h=0;h<n.length;h++)t[h]=(n[h]-r)*u+o;return t}const k5=" ".repeat(2),oHe=" ".repeat(4);function Xsr(){return sHe(this)}function sHe(n,e={}){const{maxRows:t=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${n.constructor.name} {
${k5}[
${oHe}${Ysr(n,t,r,i)}
${k5}]
${k5}rows: ${n.rows}
${k5}columns: ${n.columns}
}`}function Ysr(n,e,t,r){const{rows:i,columns:a}=n,o=Math.min(i,e),s=Math.min(a,t),l=[];for(let u=0;u<o;u++){let h=[];for(let c=0;c<s;c++)h.push(qsr(n.get(u,c),r));l.push(`${h.join(" ")}`)}return s!==a&&(l[l.length-1]+=` ... ${a-t} more columns`),o!==i&&l.push(`... ${i-e} more rows`),l.join(`
${oHe}`)}function qsr(n,e){const t=String(n);if(t.length<=e)return t.padEnd(e," ");const r=n.toPrecision(e-2);if(r.length<=e)return r;const i=n.toExponential(e-2),a=i.indexOf("e"),o=i.slice(a);return i.slice(0,e-o.length)+o}function Zsr(n,e){n.prototype.add=function(r){return typeof r=="number"?this.addS(r):this.addM(r)},n.prototype.addS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)+r);return this},n.prototype.addM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)+r.get(i,a));return this},n.add=function(r,i){return new e(r).add(i)},n.prototype.sub=function(r){return typeof r=="number"?this.subS(r):this.subM(r)},n.prototype.subS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)-r);return this},n.prototype.subM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)-r.get(i,a));return this},n.sub=function(r,i){return new e(r).sub(i)},n.prototype.subtract=n.prototype.sub,n.prototype.subtractS=n.prototype.subS,n.prototype.subtractM=n.prototype.subM,n.subtract=n.sub,n.prototype.mul=function(r){return typeof r=="number"?this.mulS(r):this.mulM(r)},n.prototype.mulS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)*r);return this},n.prototype.mulM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)*r.get(i,a));return this},n.mul=function(r,i){return new e(r).mul(i)},n.prototype.multiply=n.prototype.mul,n.prototype.multiplyS=n.prototype.mulS,n.prototype.multiplyM=n.prototype.mulM,n.multiply=n.mul,n.prototype.div=function(r){return typeof r=="number"?this.divS(r):this.divM(r)},n.prototype.divS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)/r);return this},n.prototype.divM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)/r.get(i,a));return this},n.div=function(r,i){return new e(r).div(i)},n.prototype.divide=n.prototype.div,n.prototype.divideS=n.prototype.divS,n.prototype.divideM=n.prototype.divM,n.divide=n.div,n.prototype.mod=function(r){return typeof r=="number"?this.modS(r):this.modM(r)},n.prototype.modS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)%r);return this},n.prototype.modM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)%r.get(i,a));return this},n.mod=function(r,i){return new e(r).mod(i)},n.prototype.modulus=n.prototype.mod,n.prototype.modulusS=n.prototype.modS,n.prototype.modulusM=n.prototype.modM,n.modulus=n.mod,n.prototype.and=function(r){return typeof r=="number"?this.andS(r):this.andM(r)},n.prototype.andS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)&r);return this},n.prototype.andM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)&r.get(i,a));return this},n.and=function(r,i){return new e(r).and(i)},n.prototype.or=function(r){return typeof r=="number"?this.orS(r):this.orM(r)},n.prototype.orS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)|r);return this},n.prototype.orM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)|r.get(i,a));return this},n.or=function(r,i){return new e(r).or(i)},n.prototype.xor=function(r){return typeof r=="number"?this.xorS(r):this.xorM(r)},n.prototype.xorS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)^r);return this},n.prototype.xorM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)^r.get(i,a));return this},n.xor=function(r,i){return new e(r).xor(i)},n.prototype.leftShift=function(r){return typeof r=="number"?this.leftShiftS(r):this.leftShiftM(r)},n.prototype.leftShiftS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)<<r);return this},n.prototype.leftShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)<<r.get(i,a));return this},n.leftShift=function(r,i){return new e(r).leftShift(i)},n.prototype.signPropagatingRightShift=function(r){return typeof r=="number"?this.signPropagatingRightShiftS(r):this.signPropagatingRightShiftM(r)},n.prototype.signPropagatingRightShiftS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>r);return this},n.prototype.signPropagatingRightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>r.get(i,a));return this},n.signPropagatingRightShift=function(r,i){return new e(r).signPropagatingRightShift(i)},n.prototype.rightShift=function(r){return typeof r=="number"?this.rightShiftS(r):this.rightShiftM(r)},n.prototype.rightShiftS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>>r);return this},n.prototype.rightShiftM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,this.get(i,a)>>>r.get(i,a));return this},n.rightShift=function(r,i){return new e(r).rightShift(i)},n.prototype.zeroFillRightShift=n.prototype.rightShift,n.prototype.zeroFillRightShiftS=n.prototype.rightShiftS,n.prototype.zeroFillRightShiftM=n.prototype.rightShiftM,n.zeroFillRightShift=n.rightShift,n.prototype.not=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,~this.get(r,i));return this},n.not=function(r){return new e(r).not()},n.prototype.abs=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.abs(this.get(r,i)));return this},n.abs=function(r){return new e(r).abs()},n.prototype.acos=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.acos(this.get(r,i)));return this},n.acos=function(r){return new e(r).acos()},n.prototype.acosh=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.acosh(this.get(r,i)));return this},n.acosh=function(r){return new e(r).acosh()},n.prototype.asin=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.asin(this.get(r,i)));return this},n.asin=function(r){return new e(r).asin()},n.prototype.asinh=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.asinh(this.get(r,i)));return this},n.asinh=function(r){return new e(r).asinh()},n.prototype.atan=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.atan(this.get(r,i)));return this},n.atan=function(r){return new e(r).atan()},n.prototype.atanh=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.atanh(this.get(r,i)));return this},n.atanh=function(r){return new e(r).atanh()},n.prototype.cbrt=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.cbrt(this.get(r,i)));return this},n.cbrt=function(r){return new e(r).cbrt()},n.prototype.ceil=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.ceil(this.get(r,i)));return this},n.ceil=function(r){return new e(r).ceil()},n.prototype.clz32=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.clz32(this.get(r,i)));return this},n.clz32=function(r){return new e(r).clz32()},n.prototype.cos=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.cos(this.get(r,i)));return this},n.cos=function(r){return new e(r).cos()},n.prototype.cosh=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.cosh(this.get(r,i)));return this},n.cosh=function(r){return new e(r).cosh()},n.prototype.exp=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.exp(this.get(r,i)));return this},n.exp=function(r){return new e(r).exp()},n.prototype.expm1=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.expm1(this.get(r,i)));return this},n.expm1=function(r){return new e(r).expm1()},n.prototype.floor=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.floor(this.get(r,i)));return this},n.floor=function(r){return new e(r).floor()},n.prototype.fround=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.fround(this.get(r,i)));return this},n.fround=function(r){return new e(r).fround()},n.prototype.log=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.log(this.get(r,i)));return this},n.log=function(r){return new e(r).log()},n.prototype.log1p=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.log1p(this.get(r,i)));return this},n.log1p=function(r){return new e(r).log1p()},n.prototype.log10=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.log10(this.get(r,i)));return this},n.log10=function(r){return new e(r).log10()},n.prototype.log2=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.log2(this.get(r,i)));return this},n.log2=function(r){return new e(r).log2()},n.prototype.round=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.round(this.get(r,i)));return this},n.round=function(r){return new e(r).round()},n.prototype.sign=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.sign(this.get(r,i)));return this},n.sign=function(r){return new e(r).sign()},n.prototype.sin=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.sin(this.get(r,i)));return this},n.sin=function(r){return new e(r).sin()},n.prototype.sinh=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.sinh(this.get(r,i)));return this},n.sinh=function(r){return new e(r).sinh()},n.prototype.sqrt=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.sqrt(this.get(r,i)));return this},n.sqrt=function(r){return new e(r).sqrt()},n.prototype.tan=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.tan(this.get(r,i)));return this},n.tan=function(r){return new e(r).tan()},n.prototype.tanh=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.tanh(this.get(r,i)));return this},n.tanh=function(r){return new e(r).tanh()},n.prototype.trunc=function(){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.set(r,i,Math.trunc(this.get(r,i)));return this},n.trunc=function(r){return new e(r).trunc()},n.pow=function(r,i){return new e(r).pow(i)},n.prototype.pow=function(r){return typeof r=="number"?this.powS(r):this.powM(r)},n.prototype.powS=function(r){for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,Math.pow(this.get(i,a),r));return this},n.prototype.powM=function(r){if(r=e.checkMatrix(r),this.rows!==r.rows||this.columns!==r.columns)throw new RangeError("Matrices dimensions must be equal");for(let i=0;i<this.rows;i++)for(let a=0;a<this.columns;a++)this.set(i,a,Math.pow(this.get(i,a),r.get(i,a)));return this}}function cp(n,e,t){let r=t?n.rows:n.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function fp(n,e,t){let r=t?n.columns:n.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function ZC(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function KC(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function lHe(n,e,t){return{row:uHe(n,e),column:hHe(n,t)}}function uHe(n,e){if(typeof e!="object")throw new TypeError("unexpected type for row indices");if(e.some(r=>r<0||r>=n.rows))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function hHe(n,e){if(typeof e!="object")throw new TypeError("unexpected type for column indices");if(e.some(r=>r<0||r>=n.columns))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Yee(n,e,t,r,i){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(F5("startRow",e),F5("endRow",t),F5("startColumn",r),F5("endColumn",i),e>t||r>i||e<0||e>=n.rows||t<0||t>=n.rows||r<0||r>=n.columns||i<0||i>=n.columns)throw new RangeError("Submatrix indices are out of range")}function MV(n,e=0){let t=[];for(let r=0;r<n;r++)t.push(e);return t}function F5(n,e){if(typeof e!="number")throw new TypeError(`${n} must be a number`)}function Ksr(n){let e=MV(n.rows);for(let t=0;t<n.rows;++t)for(let r=0;r<n.columns;++r)e[t]+=n.get(t,r);return e}function Jsr(n){let e=MV(n.columns);for(let t=0;t<n.rows;++t)for(let r=0;r<n.columns;++r)e[r]+=n.get(t,r);return e}function Qsr(n){let e=0;for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)e+=n.get(t,r);return e}function elr(n){let e=MV(n.rows,1);for(let t=0;t<n.rows;++t)for(let r=0;r<n.columns;++r)e[t]*=n.get(t,r);return e}function tlr(n){let e=MV(n.columns,1);for(let t=0;t<n.rows;++t)for(let r=0;r<n.columns;++r)e[r]*=n.get(t,r);return e}function rlr(n){let e=1;for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)e*=n.get(t,r);return e}function nlr(n,e,t){const r=n.rows,i=n.columns,a=[];for(let o=0;o<r;o++){let s=0,l=0,u=0;for(let h=0;h<i;h++)u=n.get(o,h)-t[o],s+=u,l+=u*u;e?a.push((l-s*s/i)/(i-1)):a.push((l-s*s/i)/i)}return a}function ilr(n,e,t){const r=n.rows,i=n.columns,a=[];for(let o=0;o<i;o++){let s=0,l=0,u=0;for(let h=0;h<r;h++)u=n.get(h,o)-t[o],s+=u,l+=u*u;e?a.push((l-s*s/r)/(r-1)):a.push((l-s*s/r)/r)}return a}function alr(n,e,t){const r=n.rows,i=n.columns,a=r*i;let o=0,s=0,l=0;for(let u=0;u<r;u++)for(let h=0;h<i;h++)l=n.get(u,h)-t,o+=l,s+=l*l;return e?(s-o*o/a)/(a-1):(s-o*o/a)/a}function olr(n,e){for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)n.set(t,r,n.get(t,r)-e[t])}function slr(n,e){for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)n.set(t,r,n.get(t,r)-e[r])}function llr(n,e){for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)n.set(t,r,n.get(t,r)-e)}function ulr(n){const e=[];for(let t=0;t<n.rows;t++){let r=0;for(let i=0;i<n.columns;i++)r+=Math.pow(n.get(t,i),2)/(n.columns-1);e.push(Math.sqrt(r))}return e}function hlr(n,e){for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)n.set(t,r,n.get(t,r)/e[t])}function clr(n){const e=[];for(let t=0;t<n.columns;t++){let r=0;for(let i=0;i<n.rows;i++)r+=Math.pow(n.get(i,t),2)/(n.rows-1);e.push(Math.sqrt(r))}return e}function flr(n,e){for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)n.set(t,r,n.get(t,r)/e[r])}function dlr(n){const e=n.size-1;let t=0;for(let r=0;r<n.columns;r++)for(let i=0;i<n.rows;i++)t+=Math.pow(n.get(i,r),2)/e;return Math.sqrt(t)}function vlr(n,e){for(let t=0;t<n.rows;t++)for(let r=0;r<n.columns;r++)n.set(t,r,n.get(t,r)/e)}class Ji{static from1DArray(e,t,r){if(e*t!==r.length)throw new RangeError("data length does not match given dimensions");let a=new ln(e,t);for(let o=0;o<e;o++)for(let s=0;s<t;s++)a.set(o,s,r[o*t+s]);return a}static rowVector(e){let t=new ln(1,e.length);for(let r=0;r<e.length;r++)t.set(0,r,e[r]);return t}static columnVector(e){let t=new ln(e.length,1);for(let r=0;r<e.length;r++)t.set(r,0,e[r]);return t}static zeros(e,t){return new ln(e,t)}static ones(e,t){return new ln(e,t).fill(1)}static rand(e,t,r={}){if(typeof r!="object")throw new TypeError("options must be an object");const{random:i=Math.random}=r;let a=new ln(e,t);for(let o=0;o<e;o++)for(let s=0;s<t;s++)a.set(o,s,i());return a}static randInt(e,t,r={}){if(typeof r!="object")throw new TypeError("options must be an object");const{min:i=0,max:a=1e3,random:o=Math.random}=r;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");let s=a-i,l=new ln(e,t);for(let u=0;u<e;u++)for(let h=0;h<t;h++){let c=i+Math.round(o()*s);l.set(u,h,c)}return l}static eye(e,t,r){t===void 0&&(t=e),r===void 0&&(r=1);let i=Math.min(e,t),a=this.zeros(e,t);for(let o=0;o<i;o++)a.set(o,o,r);return a}static diag(e,t,r){let i=e.length;t===void 0&&(t=i),r===void 0&&(r=t);let a=Math.min(i,t,r),o=this.zeros(t,r);for(let s=0;s<a;s++)o.set(s,s,e[s]);return o}static min(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let r=e.rows,i=e.columns,a=new ln(r,i);for(let o=0;o<r;o++)for(let s=0;s<i;s++)a.set(o,s,Math.min(e.get(o,s),t.get(o,s)));return a}static max(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let r=e.rows,i=e.columns,a=new this(r,i);for(let o=0;o<r;o++)for(let s=0;s<i;s++)a.set(o,s,Math.max(e.get(o,s),t.get(o,s)));return a}static checkMatrix(e){return Ji.isMatrix(e)?e:new ln(e)}static isMatrix(e){return e!=null&&e.klass==="Matrix"}get size(){return this.rows*this.columns}apply(e){if(typeof e!="function")throw new TypeError("callback must be a function");for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.call(this,t,r);return this}to1DArray(){let e=[];for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.push(this.get(t,r));return e}to2DArray(){let e=[];for(let t=0;t<this.rows;t++){e.push([]);for(let r=0;r<this.columns;r++)e[t].push(this.get(t,r))}return e}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isSymmetric(){if(this.isSquare()){for(let e=0;e<this.rows;e++)for(let t=0;t<=e;t++)if(this.get(e,t)!==this.get(t,e))return!1;return!0}return!1}isEchelonForm(){let e=0,t=0,r=-1,i=!0,a=!1;for(;e<this.rows&&i;){for(t=0,a=!1;t<this.columns&&a===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>r?(a=!0,r=t):(i=!1,a=!0);e++}return i}isReducedEchelonForm(){let e=0,t=0,r=-1,i=!0,a=!1;for(;e<this.rows&&i;){for(t=0,a=!1;t<this.columns&&a===!1;)this.get(e,t)===0?t++:this.get(e,t)===1&&t>r?(a=!0,r=t):(i=!1,a=!0);for(let o=t+1;o<this.rows;o++)this.get(e,o)!==0&&(i=!1);e++}return i}echelonForm(){let e=this.clone(),t=0,r=0;for(;t<e.rows&&r<e.columns;){let i=t;for(let a=t;a<e.rows;a++)e.get(a,r)>e.get(i,r)&&(i=a);if(e.get(i,r)===0)r++;else{e.swapRows(t,i);let a=e.get(t,r);for(let o=r;o<e.columns;o++)e.set(t,o,e.get(t,o)/a);for(let o=t+1;o<e.rows;o++){let s=e.get(o,r)/e.get(t,r);e.set(o,r,0);for(let l=r+1;l<e.columns;l++)e.set(o,l,e.get(o,l)-e.get(t,l)*s)}t++,r++}}return e}reducedEchelonForm(){let e=this.echelonForm(),t=e.columns,r=e.rows,i=r-1;for(;i>=0;)if(e.maxRow(i)===0)i--;else{let a=0,o=!1;for(;a<r&&o===!1;)e.get(i,a)===1?o=!0:a++;for(let s=0;s<i;s++){let l=e.get(s,a);for(let u=a;u<t;u++){let h=e.get(s,u)-l*e.get(i,u);e.set(s,u,h)}}i--}return e}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{rows:t=1,columns:r=1}=e;if(!Number.isInteger(t)||t<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(r)||r<=0)throw new TypeError("columns must be a positive integer");let i=new ln(this.rows*t,this.columns*r);for(let a=0;a<t;a++)for(let o=0;o<r;o++)i.setSubMatrix(this,this.rows*a,this.columns*o);return i}fill(e){for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,e);return this}neg(){return this.mulS(-1)}getRow(e){cp(this,e);let t=[];for(let r=0;r<this.columns;r++)t.push(this.get(e,r));return t}getRowVector(e){return ln.rowVector(this.getRow(e))}setRow(e,t){cp(this,e),t=ZC(this,t);for(let r=0;r<this.columns;r++)this.set(e,r,t[r]);return this}swapRows(e,t){cp(this,e),cp(this,t);for(let r=0;r<this.columns;r++){let i=this.get(e,r);this.set(e,r,this.get(t,r)),this.set(t,r,i)}return this}getColumn(e){fp(this,e);let t=[];for(let r=0;r<this.rows;r++)t.push(this.get(r,e));return t}getColumnVector(e){return ln.columnVector(this.getColumn(e))}setColumn(e,t){fp(this,e),t=KC(this,t);for(let r=0;r<this.rows;r++)this.set(r,e,t[r]);return this}swapColumns(e,t){fp(this,e),fp(this,t);for(let r=0;r<this.rows;r++){let i=this.get(r,e);this.set(r,e,this.get(r,t)),this.set(r,t,i)}return this}addRowVector(e){e=ZC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)+e[r]);return this}subRowVector(e){e=ZC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)-e[r]);return this}mulRowVector(e){e=ZC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e[r]);return this}divRowVector(e){e=ZC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)/e[r]);return this}addColumnVector(e){e=KC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)+e[t]);return this}subColumnVector(e){e=KC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)-e[t]);return this}mulColumnVector(e){e=KC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)*e[t]);return this}divColumnVector(e){e=KC(this,e);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.set(t,r,this.get(t,r)/e[t]);return this}mulRow(e,t){cp(this,e);for(let r=0;r<this.columns;r++)this.set(e,r,this.get(e,r)*t);return this}mulColumn(e,t){fp(this,e);for(let r=0;r<this.rows;r++)this.set(r,e,this.get(r,e)*t);return this}max(){let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r));return e}maxIndex(){let e=this.get(0,0),t=[0,0];for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.get(r,i)>e&&(e=this.get(r,i),t[0]=r,t[1]=i);return t}min(){let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r));return e}minIndex(){let e=this.get(0,0),t=[0,0];for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)this.get(r,i)<e&&(e=this.get(r,i),t[0]=r,t[1]=i);return t}maxRow(e){cp(this,e);let t=this.get(e,0);for(let r=1;r<this.columns;r++)this.get(e,r)>t&&(t=this.get(e,r));return t}maxRowIndex(e){cp(this,e);let t=this.get(e,0),r=[e,0];for(let i=1;i<this.columns;i++)this.get(e,i)>t&&(t=this.get(e,i),r[1]=i);return r}minRow(e){cp(this,e);let t=this.get(e,0);for(let r=1;r<this.columns;r++)this.get(e,r)<t&&(t=this.get(e,r));return t}minRowIndex(e){cp(this,e);let t=this.get(e,0),r=[e,0];for(let i=1;i<this.columns;i++)this.get(e,i)<t&&(t=this.get(e,i),r[1]=i);return r}maxColumn(e){fp(this,e);let t=this.get(0,e);for(let r=1;r<this.rows;r++)this.get(r,e)>t&&(t=this.get(r,e));return t}maxColumnIndex(e){fp(this,e);let t=this.get(0,e),r=[0,e];for(let i=1;i<this.rows;i++)this.get(i,e)>t&&(t=this.get(i,e),r[0]=i);return r}minColumn(e){fp(this,e);let t=this.get(0,e);for(let r=1;r<this.rows;r++)this.get(r,e)<t&&(t=this.get(r,e));return t}minColumnIndex(e){fp(this,e);let t=this.get(0,e),r=[0,e];for(let i=1;i<this.rows;i++)this.get(i,e)<t&&(t=this.get(i,e),r[0]=i);return r}diag(){let e=Math.min(this.rows,this.columns),t=[];for(let r=0;r<e;r++)t.push(this.get(r,r));return t}norm(e="frobenius"){let t=0;if(e==="max")return this.max();if(e==="frobenius"){for(let r=0;r<this.rows;r++)for(let i=0;i<this.columns;i++)t=t+this.get(r,i)*this.get(r,i);return Math.sqrt(t)}else throw new RangeError(`unknown norm type: ${e}`)}cumulativeSum(){let e=0;for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e+=this.get(t,r),this.set(t,r,e);return this}dot(e){Ji.isMatrix(e)&&(e=e.to1DArray());let t=this.to1DArray();if(t.length!==e.length)throw new RangeError("vectors do not have the same size");let r=0;for(let i=0;i<t.length;i++)r+=t[i]*e[i];return r}mmul(e){e=ln.checkMatrix(e);let t=this.rows,r=this.columns,i=e.columns,a=new ln(t,i),o=new Float64Array(r);for(let s=0;s<i;s++){for(let l=0;l<r;l++)o[l]=e.get(l,s);for(let l=0;l<t;l++){let u=0;for(let h=0;h<r;h++)u+=this.get(l,h)*o[h];a.set(l,s,u)}}return a}strassen2x2(e){e=ln.checkMatrix(e);let t=new ln(2,2);const r=this.get(0,0),i=e.get(0,0),a=this.get(0,1),o=e.get(0,1),s=this.get(1,0),l=e.get(1,0),u=this.get(1,1),h=e.get(1,1),c=(r+u)*(i+h),f=(s+u)*i,d=r*(o-h),v=u*(l-i),p=(r+a)*h,g=(s-r)*(i+o),m=(a-u)*(l+h),y=c+v-p+m,_=d+p,x=f+v,S=c-f+d+g;return t.set(0,0,y),t.set(0,1,_),t.set(1,0,x),t.set(1,1,S),t}strassen3x3(e){e=ln.checkMatrix(e);let t=new ln(3,3);const r=this.get(0,0),i=this.get(0,1),a=this.get(0,2),o=this.get(1,0),s=this.get(1,1),l=this.get(1,2),u=this.get(2,0),h=this.get(2,1),c=this.get(2,2),f=e.get(0,0),d=e.get(0,1),v=e.get(0,2),p=e.get(1,0),g=e.get(1,1),m=e.get(1,2),y=e.get(2,0),_=e.get(2,1),x=e.get(2,2),S=(r+i+a-o-s-h-c)*g,w=(r-o)*(-d+g),b=s*(-f+d+p-g-m-y+x),E=(-r+o+s)*(f-d+g),T=(o+s)*(-f+d),C=r*f,A=(-r+u+h)*(f-v+m),M=(-r+u)*(v-m),I=(u+h)*(-f+v),R=(r+i+a-s-l-u-h)*m,k=h*(-f+v+p-g-m-y+_),D=(-a+h+c)*(g+y-_),G=(a-c)*(g-_),W=a*y,z=(h+c)*(-y+_),V=(-a+s+l)*(m+y-x),q=(a-l)*(m-x),Y=(s+l)*(-y+x),le=i*p,j=l*_,Q=o*v,ie=u*d,oe=c*x,se=C+W+le,me=S+E+T+C+D+W+z,Ce=C+A+I+R+W+V+Y,Le=w+b+E+C+W+V+q,re=w+E+T+C+j,yt=W+V+q+Y+Q,je=C+A+M+k+D+G+W,st=D+G+W+z+ie,Nt=C+A+M+I+oe;return t.set(0,0,se),t.set(0,1,me),t.set(0,2,Ce),t.set(1,0,Le),t.set(1,1,re),t.set(1,2,yt),t.set(2,0,je),t.set(2,1,st),t.set(2,2,Nt),t}mmulStrassen(e){e=ln.checkMatrix(e);let t=this.clone(),r=t.rows,i=t.columns,a=e.rows,o=e.columns;i!==a&&console.warn(`Multiplying ${r} x ${i} and ${a} x ${o} matrix: dimensions do not match.`);function s(c,f,d){let v=c.rows,p=c.columns;if(v===f&&p===d)return c;{let g=Ji.zeros(f,d);return g=g.setSubMatrix(c,0,0),g}}let l=Math.max(r,a),u=Math.max(i,o);t=s(t,l,u),e=s(e,l,u);function h(c,f,d,v){if(d<=512||v<=512)return c.mmul(f);d%2===1&&v%2===1?(c=s(c,d+1,v+1),f=s(f,d+1,v+1)):d%2===1?(c=s(c,d+1,v),f=s(f,d+1,v)):v%2===1&&(c=s(c,d,v+1),f=s(f,d,v+1));let p=parseInt(c.rows/2,10),g=parseInt(c.columns/2,10),m=c.subMatrix(0,p-1,0,g-1),y=f.subMatrix(0,p-1,0,g-1),_=c.subMatrix(0,p-1,g,c.columns-1),x=f.subMatrix(0,p-1,g,f.columns-1),S=c.subMatrix(p,c.rows-1,0,g-1),w=f.subMatrix(p,f.rows-1,0,g-1),b=c.subMatrix(p,c.rows-1,g,c.columns-1),E=f.subMatrix(p,f.rows-1,g,f.columns-1),T=h(Ji.add(m,b),Ji.add(y,E),p,g),C=h(Ji.add(S,b),y,p,g),A=h(m,Ji.sub(x,E),p,g),M=h(b,Ji.sub(w,y),p,g),I=h(Ji.add(m,_),E,p,g),R=h(Ji.sub(S,m),Ji.add(y,x),p,g),k=h(Ji.sub(_,b),Ji.add(w,E),p,g),D=Ji.add(T,M);D.sub(I),D.add(k);let G=Ji.add(A,I),W=Ji.add(C,M),z=Ji.sub(T,C);z.add(A),z.add(R);let V=Ji.zeros(2*D.rows,2*D.columns);return V=V.setSubMatrix(D,0,0),V=V.setSubMatrix(G,D.rows,0),V=V.setSubMatrix(W,0,D.columns),V=V.setSubMatrix(z,D.rows,D.columns),V.subMatrix(0,d-1,0,v-1)}return h(t,e,l,u)}scaleRows(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:r=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(t>=r)throw new RangeError("min must be smaller than max");let i=new ln(this.rows,this.columns);for(let a=0;a<this.rows;a++){const o=this.getRow(a);oEe(o,{min:t,max:r,output:o}),i.setRow(a,o)}return i}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:r=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(r))throw new TypeError("max must be a number");if(t>=r)throw new RangeError("min must be smaller than max");let i=new ln(this.rows,this.columns);for(let a=0;a<this.columns;a++){const o=this.getColumn(a);oEe(o,{min:t,max:r,output:o}),i.setColumn(a,o)}return i}flipRows(){const e=Math.ceil(this.columns/2);for(let t=0;t<this.rows;t++)for(let r=0;r<e;r++){let i=this.get(t,r),a=this.get(t,this.columns-1-r);this.set(t,r,a),this.set(t,this.columns-1-r,i)}return this}flipColumns(){const e=Math.ceil(this.rows/2);for(let t=0;t<this.columns;t++)for(let r=0;r<e;r++){let i=this.get(r,t),a=this.get(this.rows-1-r,t);this.set(r,t,a),this.set(this.rows-1-r,t,i)}return this}kroneckerProduct(e){e=ln.checkMatrix(e);let t=this.rows,r=this.columns,i=e.rows,a=e.columns,o=new ln(t*i,r*a);for(let s=0;s<t;s++)for(let l=0;l<r;l++)for(let u=0;u<i;u++)for(let h=0;h<a;h++)o.set(i*s+u,a*l+h,this.get(s,l)*e.get(u,h));return o}transpose(){let e=new ln(this.columns,this.rows);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.set(r,t,this.get(t,r));return e}sortRows(e=sEe){for(let t=0;t<this.rows;t++)this.setRow(t,this.getRow(t).sort(e));return this}sortColumns(e=sEe){for(let t=0;t<this.columns;t++)this.setColumn(t,this.getColumn(t).sort(e));return this}subMatrix(e,t,r,i){Yee(this,e,t,r,i);let a=new ln(t-e+1,i-r+1);for(let o=e;o<=t;o++)for(let s=r;s<=i;s++)a.set(o-e,s-r,this.get(o,s));return a}subMatrixRow(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.columns-1),t>r||t<0||t>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");let i=new ln(e.length,r-t+1);for(let a=0;a<e.length;a++)for(let o=t;o<=r;o++){if(e[a]<0||e[a]>=this.rows)throw new RangeError(`Row index out of range: ${e[a]}`);i.set(a,o-t,this.get(e[a],o))}return i}subMatrixColumn(e,t,r){if(t===void 0&&(t=0),r===void 0&&(r=this.rows-1),t>r||t<0||t>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");let i=new ln(r-t+1,e.length);for(let a=0;a<e.length;a++)for(let o=t;o<=r;o++){if(e[a]<0||e[a]>=this.columns)throw new RangeError(`Column index out of range: ${e[a]}`);i.set(o-t,a,this.get(o,e[a]))}return i}setSubMatrix(e,t,r){e=ln.checkMatrix(e);let i=t+e.rows-1,a=r+e.columns-1;Yee(this,t,i,r,a);for(let o=0;o<e.rows;o++)for(let s=0;s<e.columns;s++)this.set(t+o,r+s,e.get(o,s));return this}selection(e,t){let r=lHe(this,e,t),i=new ln(e.length,t.length);for(let a=0;a<r.row.length;a++){let o=r.row[a];for(let s=0;s<r.column.length;s++){let l=r.column[s];i.set(a,s,this.get(o,l))}}return i}trace(){let e=Math.min(this.rows,this.columns),t=0;for(let r=0;r<e;r++)t+=this.get(r,r);return t}clone(){let e=new ln(this.rows,this.columns);for(let t=0;t<this.rows;t++)for(let r=0;r<this.columns;r++)e.set(t,r,this.get(t,r));return e}sum(e){switch(e){case"row":return Ksr(this);case"column":return Jsr(this);case void 0:return Qsr(this);default:throw new Error(`invalid option: ${e}`)}}product(e){switch(e){case"row":return elr(this);case"column":return tlr(this);case void 0:return rlr(this);default:throw new Error(`invalid option: ${e}`)}}mean(e){const t=this.sum(e);switch(e){case"row":{for(let r=0;r<this.rows;r++)t[r]/=this.columns;return t}case"column":{for(let r=0;r<this.columns;r++)t[r]/=this.rows;return t}case void 0:return t/this.size;default:throw new Error(`invalid option: ${e}`)}}variance(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");const{unbiased:r=!0,mean:i=this.mean(e)}=t;if(typeof r!="boolean")throw new TypeError("unbiased must be a boolean");switch(e){case"row":{if(!Array.isArray(i))throw new TypeError("mean must be an array");return nlr(this,r,i)}case"column":{if(!Array.isArray(i))throw new TypeError("mean must be an array");return ilr(this,r,i)}case void 0:{if(typeof i!="number")throw new TypeError("mean must be a number");return alr(this,r,i)}default:throw new Error(`invalid option: ${e}`)}}standardDeviation(e,t){typeof e=="object"&&(t=e,e=void 0);const r=this.variance(e,t);if(e===void 0)return Math.sqrt(r);for(let i=0;i<r.length;i++)r[i]=Math.sqrt(r[i]);return r}center(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");const{center:r=this.mean(e)}=t;switch(e){case"row":{if(!Array.isArray(r))throw new TypeError("center must be an array");return olr(this,r),this}case"column":{if(!Array.isArray(r))throw new TypeError("center must be an array");return slr(this,r),this}case void 0:{if(typeof r!="number")throw new TypeError("center must be a number");return llr(this,r),this}default:throw new Error(`invalid option: ${e}`)}}scale(e,t={}){if(typeof e=="object"&&(t=e,e=void 0),typeof t!="object")throw new TypeError("options must be an object");let r=t.scale;switch(e){case"row":{if(r===void 0)r=ulr(this);else if(!Array.isArray(r))throw new TypeError("scale must be an array");return hlr(this,r),this}case"column":{if(r===void 0)r=clr(this);else if(!Array.isArray(r))throw new TypeError("scale must be an array");return flr(this,r),this}case void 0:{if(r===void 0)r=dlr(this);else if(typeof r!="number")throw new TypeError("scale must be a number");return vlr(this,r),this}default:throw new Error(`invalid option: ${e}`)}}toString(e){return sHe(this,e)}}Ji.prototype.klass="Matrix";typeof Symbol<"u"&&(Ji.prototype[Symbol.for("nodejs.util.inspect.custom")]=Xsr);function sEe(n,e){return n-e}Ji.random=Ji.rand;Ji.randomInt=Ji.randInt;Ji.diagonal=Ji.diag;Ji.prototype.diagonal=Ji.prototype.diag;Ji.identity=Ji.eye;Ji.prototype.negate=Ji.prototype.neg;Ji.prototype.tensorProduct=Ji.prototype.kroneckerProduct;class ln extends Ji{constructor(e,t){if(super(),ln.isMatrix(e))return e.clone();if(Number.isInteger(e)&&e>0)if(this.data=[],Number.isInteger(t)&&t>0)for(let r=0;r<e;r++)this.data.push(new Float64Array(t));else throw new TypeError("nColumns must be a positive integer");else if(Array.isArray(e)){const r=e;if(e=r.length,t=r[0].length,typeof t!="number"||t===0)throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let i=0;i<e;i++){if(r[i].length!==t)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(r[i]))}}else throw new TypeError("First argument must be a positive number or an array");return this.rows=e,this.columns=t,this}set(e,t,r){return this.data[e][t]=r,this}get(e,t){return this.data[e][t]}removeRow(e){if(cp(this,e),this.rows===1)throw new RangeError("A matrix cannot have less than one row");return this.data.splice(e,1),this.rows-=1,this}addRow(e,t){return t===void 0&&(t=e,e=this.rows),cp(this,e,!0),t=Float64Array.from(ZC(this,t)),this.data.splice(e,0,t),this.rows+=1,this}removeColumn(e){if(fp(this,e),this.columns===1)throw new RangeError("A matrix cannot have less than one column");for(let t=0;t<this.rows;t++){const r=new Float64Array(this.columns-1);for(let i=0;i<e;i++)r[i]=this.data[t][i];for(let i=e+1;i<this.columns;i++)r[i-1]=this.data[t][i];this.data[t]=r}return this.columns-=1,this}addColumn(e,t){typeof t>"u"&&(t=e,e=this.columns),fp(this,e,!0),t=KC(this,t);for(let r=0;r<this.rows;r++){const i=new Float64Array(this.columns+1);let a=0;for(;a<e;a++)i[a]=this.data[r][a];for(i[a++]=t[r];a<this.columns+1;a++)i[a]=this.data[r][a-1];this.data[r]=i}return this.columns+=1,this}}Zsr(Ji,ln);class W_ extends Ji{constructor(e,t,r){super(),this.matrix=e,this.rows=t,this.columns=r}}class plr extends W_{constructor(e,t){fp(e,t),super(e,e.rows,1),this.column=t}set(e,t,r){return this.matrix.set(e,this.column,r),this}get(e){return this.matrix.get(e,this.column)}}class glr extends W_{constructor(e,t){t=hHe(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,r){return this.matrix.set(e,this.columnIndices[t],r),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}}class ylr extends W_{constructor(e){super(e,e.rows,e.columns)}set(e,t,r){return this.matrix.set(e,this.columns-t-1,r),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}}class mlr extends W_{constructor(e){super(e,e.rows,e.columns)}set(e,t,r){return this.matrix.set(this.rows-e-1,t,r),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}}class _lr extends W_{constructor(e,t){cp(e,t),super(e,1,e.columns),this.row=t}set(e,t,r){return this.matrix.set(this.row,t,r),this}get(e,t){return this.matrix.get(this.row,t)}}class xlr extends W_{constructor(e,t){t=uHe(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,r){return this.matrix.set(this.rowIndices[e],t,r),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}}class i8 extends W_{constructor(e,t,r){let i=lHe(e,t,r);super(e,i.row.length,i.column.length),this.rowIndices=i.row,this.columnIndices=i.column}set(e,t,r){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],r),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class Slr extends W_{constructor(e,t,r,i,a){Yee(e,t,r,i,a),super(e,r-t+1,a-i+1),this.startRow=t,this.startColumn=i}set(e,t,r){return this.matrix.set(this.startRow+e,this.startColumn+t,r),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}}class wlr extends W_{constructor(e){super(e,e.columns,e.rows)}set(e,t,r){return this.matrix.set(t,e,r),this}get(e,t){return this.matrix.get(t,e)}}class cHe extends Ji{constructor(e,t={}){const{rows:r=1}=t;if(e.length%r!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=r,this.columns=e.length/r,this.data=e}set(e,t,r){let i=this._calculateIndex(e,t);return this.data[i]=r,this}get(e,t){let r=this._calculateIndex(e,t);return this.data[r]}_calculateIndex(e,t){return e*this.columns+t}}class Av extends Ji{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,r){return this.data[e][t]=r,this}get(e,t){return this.data[e][t]}}function blr(n,e){if(Array.isArray(n))return n[0]&&Array.isArray(n[0])?new Av(n):new cHe(n,e);throw new Error("the argument is not an array")}class V9{constructor(e){e=Av.checkMatrix(e);let t=e.clone(),r=t.rows,i=t.columns,a=new Float64Array(r),o=1,s,l,u,h,c,f,d,v,p;for(s=0;s<r;s++)a[s]=s;for(v=new Float64Array(r),l=0;l<i;l++){for(s=0;s<r;s++)v[s]=t.get(s,l);for(s=0;s<r;s++){for(p=Math.min(s,l),c=0,u=0;u<p;u++)c+=t.get(s,u)*v[u];v[s]-=c,t.set(s,l,v[s])}for(h=l,s=l+1;s<r;s++)Math.abs(v[s])>Math.abs(v[h])&&(h=s);if(h!==l){for(u=0;u<i;u++)f=t.get(h,u),t.set(h,u,t.get(l,u)),t.set(l,u,f);d=a[h],a[h]=a[l],a[l]=d,o=-o}if(l<r&&t.get(l,l)!==0)for(s=l+1;s<r;s++)t.set(s,l,t.get(s,l)/t.get(l,l))}this.LU=t,this.pivotVector=a,this.pivotSign=o}isSingular(){let e=this.LU,t=e.columns;for(let r=0;r<t;r++)if(e.get(r,r)===0)return!0;return!1}solve(e){e=ln.checkMatrix(e);let t=this.LU;if(t.rows!==e.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let i=e.columns,a=e.subMatrixRow(this.pivotVector,0,i-1),o=t.columns,s,l,u;for(u=0;u<o;u++)for(s=u+1;s<o;s++)for(l=0;l<i;l++)a.set(s,l,a.get(s,l)-a.get(u,l)*t.get(s,u));for(u=o-1;u>=0;u--){for(l=0;l<i;l++)a.set(u,l,a.get(u,l)/t.get(u,u));for(s=0;s<u;s++)for(l=0;l<i;l++)a.set(s,l,a.get(s,l)-a.get(u,l)*t.get(s,u))}return a}get determinant(){let e=this.LU;if(!e.isSquare())throw new Error("Matrix must be square");let t=this.pivotSign,r=e.columns;for(let i=0;i<r;i++)t*=e.get(i,i);return t}get lowerTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,i=new ln(t,r);for(let a=0;a<t;a++)for(let o=0;o<r;o++)a>o?i.set(a,o,e.get(a,o)):a===o?i.set(a,o,1):i.set(a,o,0);return i}get upperTriangularMatrix(){let e=this.LU,t=e.rows,r=e.columns,i=new ln(t,r);for(let a=0;a<t;a++)for(let o=0;o<r;o++)a<=o?i.set(a,o,e.get(a,o)):i.set(a,o,0);return i}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function x1(n,e){let t=0;return Math.abs(n)>Math.abs(e)?(t=e/n,Math.abs(n)*Math.sqrt(1+t*t)):e!==0?(t=n/e,Math.abs(e)*Math.sqrt(1+t*t)):0}class qee{constructor(e){e=Av.checkMatrix(e);let t=e.clone(),r=e.rows,i=e.columns,a=new Float64Array(i),o,s,l,u;for(l=0;l<i;l++){let h=0;for(o=l;o<r;o++)h=x1(h,t.get(o,l));if(h!==0){for(t.get(l,l)<0&&(h=-h),o=l;o<r;o++)t.set(o,l,t.get(o,l)/h);for(t.set(l,l,t.get(l,l)+1),s=l+1;s<i;s++){for(u=0,o=l;o<r;o++)u+=t.get(o,l)*t.get(o,s);for(u=-u/t.get(l,l),o=l;o<r;o++)t.set(o,s,t.get(o,s)+u*t.get(o,l))}}a[l]=-h}this.QR=t,this.Rdiag=a}solve(e){e=ln.checkMatrix(e);let t=this.QR,r=t.rows;if(e.rows!==r)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let i=e.columns,a=e.clone(),o=t.columns,s,l,u,h;for(u=0;u<o;u++)for(l=0;l<i;l++){for(h=0,s=u;s<r;s++)h+=t.get(s,u)*a.get(s,l);for(h=-h/t.get(u,u),s=u;s<r;s++)a.set(s,l,a.get(s,l)+h*t.get(s,u))}for(u=o-1;u>=0;u--){for(l=0;l<i;l++)a.set(u,l,a.get(u,l)/this.Rdiag[u]);for(s=0;s<u;s++)for(l=0;l<i;l++)a.set(s,l,a.get(s,l)-a.get(u,l)*t.get(s,u))}return a.subMatrix(0,o-1,0,i-1)}isFullRank(){let e=this.QR.columns;for(let t=0;t<e;t++)if(this.Rdiag[t]===0)return!1;return!0}get upperTriangularMatrix(){let e=this.QR,t=e.columns,r=new ln(t,t),i,a;for(i=0;i<t;i++)for(a=0;a<t;a++)i<a?r.set(i,a,e.get(i,a)):i===a?r.set(i,a,this.Rdiag[i]):r.set(i,a,0);return r}get orthogonalMatrix(){let e=this.QR,t=e.rows,r=e.columns,i=new ln(t,r),a,o,s,l;for(s=r-1;s>=0;s--){for(a=0;a<t;a++)i.set(a,s,0);for(i.set(s,s,1),o=s;o<r;o++)if(e.get(s,s)!==0){for(l=0,a=s;a<t;a++)l+=e.get(a,s)*i.get(a,o);for(l=-l/e.get(s,s),a=s;a<t;a++)i.set(a,o,i.get(a,o)+l*e.get(a,s))}}return i}}class BM{constructor(e,t={}){e=Av.checkMatrix(e);let r=e.rows,i=e.columns;const{computeLeftSingularVectors:a=!0,computeRightSingularVectors:o=!0,autoTranspose:s=!1}=t;let l=Boolean(a),u=Boolean(o),h=!1,c;if(r<i)if(!s)c=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{c=e.transpose(),r=c.rows,i=c.columns,h=!0;let C=l;l=u,u=C}else c=e.clone();let f=Math.min(r,i),d=Math.min(r+1,i),v=new Float64Array(d),p=new ln(r,f),g=new ln(i,i),m=new Float64Array(i),y=new Float64Array(r),_=new Float64Array(d);for(let C=0;C<d;C++)_[C]=C;let x=Math.min(r-1,i),S=Math.max(0,Math.min(i-2,r)),w=Math.max(x,S);for(let C=0;C<w;C++){if(C<x){v[C]=0;for(let A=C;A<r;A++)v[C]=x1(v[C],c.get(A,C));if(v[C]!==0){c.get(C,C)<0&&(v[C]=-v[C]);for(let A=C;A<r;A++)c.set(A,C,c.get(A,C)/v[C]);c.set(C,C,c.get(C,C)+1)}v[C]=-v[C]}for(let A=C+1;A<i;A++){if(C<x&&v[C]!==0){let M=0;for(let I=C;I<r;I++)M+=c.get(I,C)*c.get(I,A);M=-M/c.get(C,C);for(let I=C;I<r;I++)c.set(I,A,c.get(I,A)+M*c.get(I,C))}m[A]=c.get(C,A)}if(l&&C<x)for(let A=C;A<r;A++)p.set(A,C,c.get(A,C));if(C<S){m[C]=0;for(let A=C+1;A<i;A++)m[C]=x1(m[C],m[A]);if(m[C]!==0){m[C+1]<0&&(m[C]=0-m[C]);for(let A=C+1;A<i;A++)m[A]/=m[C];m[C+1]+=1}if(m[C]=-m[C],C+1<r&&m[C]!==0){for(let A=C+1;A<r;A++)y[A]=0;for(let A=C+1;A<r;A++)for(let M=C+1;M<i;M++)y[A]+=m[M]*c.get(A,M);for(let A=C+1;A<i;A++){let M=-m[A]/m[C+1];for(let I=C+1;I<r;I++)c.set(I,A,c.get(I,A)+M*y[I])}}if(u)for(let A=C+1;A<i;A++)g.set(A,C,m[A])}}let b=Math.min(i,r+1);if(x<i&&(v[x]=c.get(x,x)),r<b&&(v[b-1]=0),S+1<b&&(m[S]=c.get(S,b-1)),m[b-1]=0,l){for(let C=x;C<f;C++){for(let A=0;A<r;A++)p.set(A,C,0);p.set(C,C,1)}for(let C=x-1;C>=0;C--)if(v[C]!==0){for(let A=C+1;A<f;A++){let M=0;for(let I=C;I<r;I++)M+=p.get(I,C)*p.get(I,A);M=-M/p.get(C,C);for(let I=C;I<r;I++)p.set(I,A,p.get(I,A)+M*p.get(I,C))}for(let A=C;A<r;A++)p.set(A,C,-p.get(A,C));p.set(C,C,1+p.get(C,C));for(let A=0;A<C-1;A++)p.set(A,C,0)}else{for(let A=0;A<r;A++)p.set(A,C,0);p.set(C,C,1)}}if(u)for(let C=i-1;C>=0;C--){if(C<S&&m[C]!==0)for(let A=C+1;A<i;A++){let M=0;for(let I=C+1;I<i;I++)M+=g.get(I,C)*g.get(I,A);M=-M/g.get(C+1,C);for(let I=C+1;I<i;I++)g.set(I,A,g.get(I,A)+M*g.get(I,C))}for(let A=0;A<i;A++)g.set(A,C,0);g.set(C,C,1)}let E=b-1,T=Number.EPSILON;for(;b>0;){let C,A;for(C=b-2;C>=-1&&C!==-1;C--){const M=Number.MIN_VALUE+T*Math.abs(v[C]+Math.abs(v[C+1]));if(Math.abs(m[C])<=M||Number.isNaN(m[C])){m[C]=0;break}}if(C===b-2)A=4;else{let M;for(M=b-1;M>=C&&M!==C;M--){let I=(M!==b?Math.abs(m[M]):0)+(M!==C+1?Math.abs(m[M-1]):0);if(Math.abs(v[M])<=T*I){v[M]=0;break}}M===C?A=3:M===b-1?A=1:(A=2,C=M)}switch(C++,A){case 1:{let M=m[b-2];m[b-2]=0;for(let I=b-2;I>=C;I--){let R=x1(v[I],M),k=v[I]/R,D=M/R;if(v[I]=R,I!==C&&(M=-D*m[I-1],m[I-1]=k*m[I-1]),u)for(let G=0;G<i;G++)R=k*g.get(G,I)+D*g.get(G,b-1),g.set(G,b-1,-D*g.get(G,I)+k*g.get(G,b-1)),g.set(G,I,R)}break}case 2:{let M=m[C-1];m[C-1]=0;for(let I=C;I<b;I++){let R=x1(v[I],M),k=v[I]/R,D=M/R;if(v[I]=R,M=-D*m[I],m[I]=k*m[I],l)for(let G=0;G<r;G++)R=k*p.get(G,I)+D*p.get(G,C-1),p.set(G,C-1,-D*p.get(G,I)+k*p.get(G,C-1)),p.set(G,I,R)}break}case 3:{const M=Math.max(Math.abs(v[b-1]),Math.abs(v[b-2]),Math.abs(m[b-2]),Math.abs(v[C]),Math.abs(m[C])),I=v[b-1]/M,R=v[b-2]/M,k=m[b-2]/M,D=v[C]/M,G=m[C]/M,W=((R+I)*(R-I)+k*k)/2,z=I*k*(I*k);let V=0;(W!==0||z!==0)&&(W<0?V=0-Math.sqrt(W*W+z):V=Math.sqrt(W*W+z),V=z/(W+V));let q=(D+I)*(D-I)+V,Y=D*G;for(let le=C;le<b-1;le++){let j=x1(q,Y);j===0&&(j=Number.MIN_VALUE);let Q=q/j,ie=Y/j;if(le!==C&&(m[le-1]=j),q=Q*v[le]+ie*m[le],m[le]=Q*m[le]-ie*v[le],Y=ie*v[le+1],v[le+1]=Q*v[le+1],u)for(let oe=0;oe<i;oe++)j=Q*g.get(oe,le)+ie*g.get(oe,le+1),g.set(oe,le+1,-ie*g.get(oe,le)+Q*g.get(oe,le+1)),g.set(oe,le,j);if(j=x1(q,Y),j===0&&(j=Number.MIN_VALUE),Q=q/j,ie=Y/j,v[le]=j,q=Q*m[le]+ie*v[le+1],v[le+1]=-ie*m[le]+Q*v[le+1],Y=ie*m[le+1],m[le+1]=Q*m[le+1],l&&le<r-1)for(let oe=0;oe<r;oe++)j=Q*p.get(oe,le)+ie*p.get(oe,le+1),p.set(oe,le+1,-ie*p.get(oe,le)+Q*p.get(oe,le+1)),p.set(oe,le,j)}m[b-2]=q;break}case 4:{if(v[C]<=0&&(v[C]=v[C]<0?-v[C]:0,u))for(let M=0;M<=E;M++)g.set(M,C,-g.get(M,C));for(;C<E&&!(v[C]>=v[C+1]);){let M=v[C];if(v[C]=v[C+1],v[C+1]=M,u&&C<i-1)for(let I=0;I<i;I++)M=g.get(I,C+1),g.set(I,C+1,g.get(I,C)),g.set(I,C,M);if(l&&C<r-1)for(let I=0;I<r;I++)M=p.get(I,C+1),p.set(I,C+1,p.get(I,C)),p.set(I,C,M);C++}b--;break}}}if(h){let C=g;g=p,p=C}this.m=r,this.n=i,this.s=v,this.U=p,this.V=g}solve(e){let t=e,r=this.threshold,i=this.s.length,a=ln.zeros(i,i);for(let f=0;f<i;f++)Math.abs(this.s[f])<=r?a.set(f,f,0):a.set(f,f,1/this.s[f]);let o=this.U,s=this.rightSingularVectors,l=s.mmul(a),u=s.rows,h=o.rows,c=ln.zeros(u,h);for(let f=0;f<u;f++)for(let d=0;d<h;d++){let v=0;for(let p=0;p<i;p++)v+=l.get(f,p)*o.get(d,p);c.set(f,d,v)}return c.mmul(t)}solveForDiagonal(e){return this.solve(ln.diag(e))}inverse(){let e=this.V,t=this.threshold,r=e.rows,i=e.columns,a=new ln(r,this.s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++)Math.abs(this.s[c])>t&&a.set(h,c,e.get(h,c)/this.s[c]);let o=this.U,s=o.rows,l=o.columns,u=new ln(r,s);for(let h=0;h<r;h++)for(let c=0;c<s;c++){let f=0;for(let d=0;d<l;d++)f+=a.get(h,d)*o.get(c,d);u.set(h,c,f)}return u}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let e=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,t=0,r=this.s;for(let i=0,a=r.length;i<a;i++)r[i]>e&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ln.diag(this.s)}}function Elr(n,e=!1){return n=Av.checkMatrix(n),e?new BM(n).inverse():fHe(n,ln.eye(n.rows))}function fHe(n,e,t=!1){return n=Av.checkMatrix(n),e=Av.checkMatrix(e),t?new BM(n).solve(e):n.isSquare()?new V9(n).solve(e):new qee(n).solve(e)}function a8(n){if(n=ln.checkMatrix(n),n.isSquare()){let e,t,r,i;if(n.columns===2)return e=n.get(0,0),t=n.get(0,1),r=n.get(1,0),i=n.get(1,1),e*i-t*r;if(n.columns===3){let a,o,s;return a=new i8(n,[1,2],[1,2]),o=new i8(n,[1,2],[0,2]),s=new i8(n,[1,2],[0,1]),e=n.get(0,0),t=n.get(0,1),r=n.get(0,2),e*a8(a)-t*a8(o)+r*a8(s)}else return new V9(n).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Tlr(n,e){let t=[];for(let r=0;r<n;r++)r!==e&&t.push(r);return t}function Clr(n,e,t,r=1e-9,i=1e-9){if(n>i)return new Array(e.rows+1).fill(0);{let a=e.addRow(t,[0]);for(let o=0;o<a.rows;o++)Math.abs(a.get(o,0))<r&&a.set(o,0,0);return a.to1DArray()}}function Alr(n,e={}){const{thresholdValue:t=1e-9,thresholdError:r=1e-9}=e;n=ln.checkMatrix(n);let i=n.rows,a=new ln(i,i);for(let o=0;o<i;o++){let s=ln.columnVector(n.getRow(o)),l=n.subMatrixRow(Tlr(i,o)).transpose(),h=new BM(l).solve(s),c=ln.sub(s,l.mmul(h)).abs().max();a.setRow(o,Clr(c,h,o,t,r))}return a}function Mlr(n,e=Number.EPSILON){n=ln.checkMatrix(n);let t=new BM(n,{autoTranspose:!0}),r=t.leftSingularVectors,i=t.rightSingularVectors,a=t.diagonal;for(let o=0;o<a.length;o++)Math.abs(a[o])>e?a[o]=1/a[o]:a[o]=0;return i.mmul(ln.diag(a).mmul(r.transpose()))}function Ilr(n,e=n,t={}){n=new ln(n);let r=!1;if(typeof e=="object"&&!ln.isMatrix(e)&&!Array.isArray(e)?(t=e,e=n,r=!0):e=new ln(e),n.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0}=t;i&&(n=n.center("column"),r||(e=e.center("column")));const a=n.transpose().mmul(e);for(let o=0;o<a.rows;o++)for(let s=0;s<a.columns;s++)a.set(o,s,a.get(o,s)*(1/(n.rows-1)));return a}function Llr(n,e=n,t={}){n=new ln(n);let r=!1;if(typeof e=="object"&&!ln.isMatrix(e)&&!Array.isArray(e)?(t=e,e=n,r=!0):e=new ln(e),n.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:i=!0,scale:a=!0}=t;i&&(n.center("column"),r||e.center("column")),a&&(n.scale("column"),r||e.scale("column"));const o=n.standardDeviation("column",{unbiased:!0}),s=r?o:e.standardDeviation("column",{unbiased:!0}),l=n.transpose().mmul(e);for(let u=0;u<l.rows;u++)for(let h=0;h<l.columns;h++)l.set(u,h,l.get(u,h)*(1/(o[u]*s[h]))*(1/(n.rows-1)));return l}class lEe{constructor(e,t={}){const{assumeSymmetric:r=!1}=t;if(e=Av.checkMatrix(e),!e.isSquare())throw new Error("Matrix is not a square matrix");let i=e.columns,a=new ln(i,i),o=new Float64Array(i),s=new Float64Array(i),l=e,u,h,c=!1;if(r?c=!0:c=e.isSymmetric(),c){for(u=0;u<i;u++)for(h=0;h<i;h++)a.set(u,h,l.get(u,h));Plr(i,s,o,a),Olr(i,s,o,a)}else{let f=new ln(i,i),d=new Float64Array(i);for(h=0;h<i;h++)for(u=0;u<i;u++)f.set(u,h,l.get(u,h));Rlr(i,f,d,a),Dlr(i,s,o,a,f)}this.n=i,this.e=s,this.d=o,this.V=a}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let e=this.n,t=this.e,r=this.d,i=new ln(e,e),a,o;for(a=0;a<e;a++){for(o=0;o<e;o++)i.set(a,o,0);i.set(a,a,r[a]),t[a]>0?i.set(a,a+1,t[a]):t[a]<0&&i.set(a,a-1,t[a])}return i}}function Plr(n,e,t,r){let i,a,o,s,l,u,h,c;for(l=0;l<n;l++)t[l]=r.get(n-1,l);for(s=n-1;s>0;s--){for(c=0,o=0,u=0;u<s;u++)c=c+Math.abs(t[u]);if(c===0)for(e[s]=t[s-1],l=0;l<s;l++)t[l]=r.get(s-1,l),r.set(s,l,0),r.set(l,s,0);else{for(u=0;u<s;u++)t[u]/=c,o+=t[u]*t[u];for(i=t[s-1],a=Math.sqrt(o),i>0&&(a=-a),e[s]=c*a,o=o-i*a,t[s-1]=i-a,l=0;l<s;l++)e[l]=0;for(l=0;l<s;l++){for(i=t[l],r.set(l,s,i),a=e[l]+r.get(l,l)*i,u=l+1;u<=s-1;u++)a+=r.get(u,l)*t[u],e[u]+=r.get(u,l)*i;e[l]=a}for(i=0,l=0;l<s;l++)e[l]/=o,i+=e[l]*t[l];for(h=i/(o+o),l=0;l<s;l++)e[l]-=h*t[l];for(l=0;l<s;l++){for(i=t[l],a=e[l],u=l;u<=s-1;u++)r.set(u,l,r.get(u,l)-(i*e[u]+a*t[u]));t[l]=r.get(s-1,l),r.set(s,l,0)}}t[s]=o}for(s=0;s<n-1;s++){if(r.set(n-1,s,r.get(s,s)),r.set(s,s,1),o=t[s+1],o!==0){for(u=0;u<=s;u++)t[u]=r.get(u,s+1)/o;for(l=0;l<=s;l++){for(a=0,u=0;u<=s;u++)a+=r.get(u,s+1)*r.get(u,l);for(u=0;u<=s;u++)r.set(u,l,r.get(u,l)-a*t[u])}}for(u=0;u<=s;u++)r.set(u,s+1,0)}for(l=0;l<n;l++)t[l]=r.get(n-1,l),r.set(n-1,l,0);r.set(n-1,n-1,1),e[0]=0}function Olr(n,e,t,r){let i,a,o,s,l,u,h,c,f,d,v,p,g,m,y,_;for(o=1;o<n;o++)e[o-1]=e[o];e[n-1]=0;let x=0,S=0,w=Number.EPSILON;for(u=0;u<n;u++){for(S=Math.max(S,Math.abs(t[u])+Math.abs(e[u])),h=u;h<n&&!(Math.abs(e[h])<=w*S);)h++;if(h>u)do{for(i=t[u],c=(t[u+1]-i)/(2*e[u]),f=x1(c,1),c<0&&(f=-f),t[u]=e[u]/(c+f),t[u+1]=e[u]*(c+f),d=t[u+1],a=i-t[u],o=u+2;o<n;o++)t[o]-=a;for(x=x+a,c=t[h],v=1,p=v,g=v,m=e[u+1],y=0,_=0,o=h-1;o>=u;o--)for(g=p,p=v,_=y,i=v*e[o],a=v*c,f=x1(c,e[o]),e[o+1]=y*f,y=e[o]/f,v=c/f,c=v*t[o]-y*i,t[o+1]=a+y*(v*i+y*t[o]),l=0;l<n;l++)a=r.get(l,o+1),r.set(l,o+1,y*r.get(l,o)+v*a),r.set(l,o,v*r.get(l,o)-y*a);c=-y*_*g*m*e[u]/d,e[u]=y*c,t[u]=v*c}while(Math.abs(e[u])>w*S);t[u]=t[u]+x,e[u]=0}for(o=0;o<n-1;o++){for(l=o,c=t[o],s=o+1;s<n;s++)t[s]<c&&(l=s,c=t[s]);if(l!==o)for(t[l]=t[o],t[o]=c,s=0;s<n;s++)c=r.get(s,o),r.set(s,o,r.get(s,l)),r.set(s,l,c)}}function Rlr(n,e,t,r){let i=0,a=n-1,o,s,l,u,h,c,f;for(c=i+1;c<=a-1;c++){for(f=0,u=c;u<=a;u++)f=f+Math.abs(e.get(u,c-1));if(f!==0){for(l=0,u=a;u>=c;u--)t[u]=e.get(u,c-1)/f,l+=t[u]*t[u];for(s=Math.sqrt(l),t[c]>0&&(s=-s),l=l-t[c]*s,t[c]=t[c]-s,h=c;h<n;h++){for(o=0,u=a;u>=c;u--)o+=t[u]*e.get(u,h);for(o=o/l,u=c;u<=a;u++)e.set(u,h,e.get(u,h)-o*t[u])}for(u=0;u<=a;u++){for(o=0,h=a;h>=c;h--)o+=t[h]*e.get(u,h);for(o=o/l,h=c;h<=a;h++)e.set(u,h,e.get(u,h)-o*t[h])}t[c]=f*t[c],e.set(c,c-1,f*s)}}for(u=0;u<n;u++)for(h=0;h<n;h++)r.set(u,h,u===h?1:0);for(c=a-1;c>=i+1;c--)if(e.get(c,c-1)!==0){for(u=c+1;u<=a;u++)t[u]=e.get(u,c-1);for(h=c;h<=a;h++){for(s=0,u=c;u<=a;u++)s+=t[u]*r.get(u,h);for(s=s/t[c]/e.get(c,c-1),u=c;u<=a;u++)r.set(u,h,r.get(u,h)+s*t[u])}}}function Dlr(n,e,t,r,i){let a=n-1,o=0,s=n-1,l=Number.EPSILON,u=0,h=0,c=0,f=0,d=0,v=0,p=0,g=0,m,y,_,x,S,w,b,E,T,C,A,M,I,R,k;for(m=0;m<n;m++)for((m<o||m>s)&&(t[m]=i.get(m,m),e[m]=0),y=Math.max(m-1,0);y<n;y++)h=h+Math.abs(i.get(m,y));for(;a>=o;){for(x=a;x>o&&(v=Math.abs(i.get(x-1,x-1))+Math.abs(i.get(x,x)),v===0&&(v=h),!(Math.abs(i.get(x,x-1))<l*v));)x--;if(x===a)i.set(a,a,i.get(a,a)+u),t[a]=i.get(a,a),e[a]=0,a--,g=0;else if(x===a-1){if(b=i.get(a,a-1)*i.get(a-1,a),c=(i.get(a-1,a-1)-i.get(a,a))/2,f=c*c+b,p=Math.sqrt(Math.abs(f)),i.set(a,a,i.get(a,a)+u),i.set(a-1,a-1,i.get(a-1,a-1)+u),E=i.get(a,a),f>=0){for(p=c>=0?c+p:c-p,t[a-1]=E+p,t[a]=t[a-1],p!==0&&(t[a]=E-b/p),e[a-1]=0,e[a]=0,E=i.get(a,a-1),v=Math.abs(E)+Math.abs(p),c=E/v,f=p/v,d=Math.sqrt(c*c+f*f),c=c/d,f=f/d,y=a-1;y<n;y++)p=i.get(a-1,y),i.set(a-1,y,f*p+c*i.get(a,y)),i.set(a,y,f*i.get(a,y)-c*p);for(m=0;m<=a;m++)p=i.get(m,a-1),i.set(m,a-1,f*p+c*i.get(m,a)),i.set(m,a,f*i.get(m,a)-c*p);for(m=o;m<=s;m++)p=r.get(m,a-1),r.set(m,a-1,f*p+c*r.get(m,a)),r.set(m,a,f*r.get(m,a)-c*p)}else t[a-1]=E+c,t[a]=E+c,e[a-1]=p,e[a]=-p;a=a-2,g=0}else{if(E=i.get(a,a),T=0,b=0,x<a&&(T=i.get(a-1,a-1),b=i.get(a,a-1)*i.get(a-1,a)),g===10){for(u+=E,m=o;m<=a;m++)i.set(m,m,i.get(m,m)-E);v=Math.abs(i.get(a,a-1))+Math.abs(i.get(a-1,a-2)),E=T=.75*v,b=-.4375*v*v}if(g===30&&(v=(T-E)/2,v=v*v+b,v>0)){for(v=Math.sqrt(v),T<E&&(v=-v),v=E-b/((T-E)/2+v),m=o;m<=a;m++)i.set(m,m,i.get(m,m)-v);u+=v,E=T=b=.964}for(g=g+1,S=a-2;S>=x&&(p=i.get(S,S),d=E-p,v=T-p,c=(d*v-b)/i.get(S+1,S)+i.get(S,S+1),f=i.get(S+1,S+1)-p-d-v,d=i.get(S+2,S+1),v=Math.abs(c)+Math.abs(f)+Math.abs(d),c=c/v,f=f/v,d=d/v,!(S===x||Math.abs(i.get(S,S-1))*(Math.abs(f)+Math.abs(d))<l*(Math.abs(c)*(Math.abs(i.get(S-1,S-1))+Math.abs(p)+Math.abs(i.get(S+1,S+1))))));)S--;for(m=S+2;m<=a;m++)i.set(m,m-2,0),m>S+2&&i.set(m,m-3,0);for(_=S;_<=a-1&&(R=_!==a-1,_!==S&&(c=i.get(_,_-1),f=i.get(_+1,_-1),d=R?i.get(_+2,_-1):0,E=Math.abs(c)+Math.abs(f)+Math.abs(d),E!==0&&(c=c/E,f=f/E,d=d/E)),E!==0);_++)if(v=Math.sqrt(c*c+f*f+d*d),c<0&&(v=-v),v!==0){for(_!==S?i.set(_,_-1,-v*E):x!==S&&i.set(_,_-1,-i.get(_,_-1)),c=c+v,E=c/v,T=f/v,p=d/v,f=f/c,d=d/c,y=_;y<n;y++)c=i.get(_,y)+f*i.get(_+1,y),R&&(c=c+d*i.get(_+2,y),i.set(_+2,y,i.get(_+2,y)-c*p)),i.set(_,y,i.get(_,y)-c*E),i.set(_+1,y,i.get(_+1,y)-c*T);for(m=0;m<=Math.min(a,_+3);m++)c=E*i.get(m,_)+T*i.get(m,_+1),R&&(c=c+p*i.get(m,_+2),i.set(m,_+2,i.get(m,_+2)-c*d)),i.set(m,_,i.get(m,_)-c),i.set(m,_+1,i.get(m,_+1)-c*f);for(m=o;m<=s;m++)c=E*r.get(m,_)+T*r.get(m,_+1),R&&(c=c+p*r.get(m,_+2),r.set(m,_+2,r.get(m,_+2)-c*d)),r.set(m,_,r.get(m,_)-c),r.set(m,_+1,r.get(m,_+1)-c*f)}}}if(h!==0){for(a=n-1;a>=0;a--)if(c=t[a],f=e[a],f===0)for(x=a,i.set(a,a,1),m=a-1;m>=0;m--){for(b=i.get(m,m)-c,d=0,y=x;y<=a;y++)d=d+i.get(m,y)*i.get(y,a);if(e[m]<0)p=b,v=d;else if(x=m,e[m]===0?i.set(m,a,b!==0?-d/b:-d/(l*h)):(E=i.get(m,m+1),T=i.get(m+1,m),f=(t[m]-c)*(t[m]-c)+e[m]*e[m],w=(E*v-p*d)/f,i.set(m,a,w),i.set(m+1,a,Math.abs(E)>Math.abs(p)?(-d-b*w)/E:(-v-T*w)/p)),w=Math.abs(i.get(m,a)),l*w*w>1)for(y=m;y<=a;y++)i.set(y,a,i.get(y,a)/w)}else if(f<0)for(x=a-1,Math.abs(i.get(a,a-1))>Math.abs(i.get(a-1,a))?(i.set(a-1,a-1,f/i.get(a,a-1)),i.set(a-1,a,-(i.get(a,a)-c)/i.get(a,a-1))):(k=B5(0,-i.get(a-1,a),i.get(a-1,a-1)-c,f),i.set(a-1,a-1,k[0]),i.set(a-1,a,k[1])),i.set(a,a-1,0),i.set(a,a,1),m=a-2;m>=0;m--){for(C=0,A=0,y=x;y<=a;y++)C=C+i.get(m,y)*i.get(y,a-1),A=A+i.get(m,y)*i.get(y,a);if(b=i.get(m,m)-c,e[m]<0)p=b,d=C,v=A;else if(x=m,e[m]===0?(k=B5(-C,-A,b,f),i.set(m,a-1,k[0]),i.set(m,a,k[1])):(E=i.get(m,m+1),T=i.get(m+1,m),M=(t[m]-c)*(t[m]-c)+e[m]*e[m]-f*f,I=(t[m]-c)*2*f,M===0&&I===0&&(M=l*h*(Math.abs(b)+Math.abs(f)+Math.abs(E)+Math.abs(T)+Math.abs(p))),k=B5(E*d-p*C+f*A,E*v-p*A-f*C,M,I),i.set(m,a-1,k[0]),i.set(m,a,k[1]),Math.abs(E)>Math.abs(p)+Math.abs(f)?(i.set(m+1,a-1,(-C-b*i.get(m,a-1)+f*i.get(m,a))/E),i.set(m+1,a,(-A-b*i.get(m,a)-f*i.get(m,a-1))/E)):(k=B5(-d-T*i.get(m,a-1),-v-T*i.get(m,a),p,f),i.set(m+1,a-1,k[0]),i.set(m+1,a,k[1]))),w=Math.max(Math.abs(i.get(m,a-1)),Math.abs(i.get(m,a))),l*w*w>1)for(y=m;y<=a;y++)i.set(y,a-1,i.get(y,a-1)/w),i.set(y,a,i.get(y,a)/w)}for(m=0;m<n;m++)if(m<o||m>s)for(y=m;y<n;y++)r.set(m,y,i.get(m,y));for(y=n-1;y>=o;y--)for(m=o;m<=s;m++){for(p=0,_=o;_<=Math.min(y,s);_++)p=p+r.get(m,_)*i.get(_,y);r.set(m,y,p)}}}function B5(n,e,t,r){let i,a;return Math.abs(t)>Math.abs(r)?(i=r/t,a=t+i*r,[(n+i*e)/a,(e-i*n)/a]):(i=t/r,a=r+i*t,[(i*n+e)/a,(i*e-n)/a])}class uEe{constructor(e){if(e=Av.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let t=e,r=t.rows,i=new ln(r,r),a=!0,o,s,l;for(s=0;s<r;s++){let u=0;for(l=0;l<s;l++){let h=0;for(o=0;o<l;o++)h+=i.get(l,o)*i.get(s,o);h=(t.get(s,l)-h)/i.get(l,l),i.set(s,l,h),u=u+h*h}for(u=t.get(s,s)-u,a&=u>0,i.set(s,s,Math.sqrt(Math.max(u,0))),l=s+1;l<r;l++)i.set(s,l,0)}this.L=i,this.positiveDefinite=Boolean(a)}isPositiveDefinite(){return this.positiveDefinite}solve(e){e=Av.checkMatrix(e);let t=this.L,r=t.rows;if(e.rows!==r)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let i=e.columns,a=e.clone(),o,s,l;for(l=0;l<r;l++)for(s=0;s<i;s++){for(o=0;o<l;o++)a.set(l,s,a.get(l,s)-a.get(o,s)*t.get(l,o));a.set(l,s,a.get(l,s)/t.get(l,l))}for(l=r-1;l>=0;l--)for(s=0;s<i;s++){for(o=l+1;o<r;o++)a.set(l,s,a.get(l,s)-a.get(o,s)*t.get(o,l));a.set(l,s,a.get(l,s)/t.get(l,l))}return a}get lowerTriangularMatrix(){return this.L}}class hEe{constructor(e,t={}){e=Av.checkMatrix(e);let{Y:r}=t;const{scaleScores:i=!1,maxIterations:a=1e3,terminationCriteria:o=1e-10}=t;let s;if(r){if(Array.isArray(r)&&typeof r[0]=="number"?r=ln.columnVector(r):r=Av.checkMatrix(r),!r.isColumnVector()||r.rows!==e.rows)throw new Error("Y must be a column vector of length X.rows");s=r}else s=e.getColumnVector(0);let l=1,u,h,c,f;for(let d=0;d<a&&l>o;d++)c=e.transpose().mmul(s).div(s.transpose().mmul(s).get(0,0)),c=c.div(c.norm()),u=e.mmul(c).div(c.transpose().mmul(c).get(0,0)),d>0&&(l=u.clone().sub(f).pow(2).sum()),f=u.clone(),r?(h=r.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),h=h.div(h.norm()),s=r.mmul(h).div(h.transpose().mmul(h).get(0,0))):s=u;if(r){let d=e.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0));d=d.div(d.norm());let v=e.clone().sub(u.clone().mmul(d.transpose())),p=s.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),g=r.clone().sub(u.clone().mulS(p.get(0,0)).mmul(h.transpose()));this.t=u,this.p=d.transpose(),this.w=c.transpose(),this.q=h,this.u=s,this.s=u.transpose().mmul(u),this.xResidual=v,this.yResidual=g,this.betas=p}else this.w=c.transpose(),this.s=u.transpose().mmul(u).sqrt(),i?this.t=u.clone().div(this.s.get(0,0)):this.t=u,this.xResidual=e.sub(u.mmul(c.transpose()))}}const Nlr=Object.freeze(Object.defineProperty({__proto__:null,AbstractMatrix:Ji,default:ln,Matrix:ln,wrap:blr,WrapperMatrix1D:cHe,WrapperMatrix2D:Av,solve:fHe,inverse:Elr,determinant:a8,linearDependencies:Alr,pseudoInverse:Mlr,covariance:Ilr,correlation:Llr,SingularValueDecomposition:BM,SVD:BM,EigenvalueDecomposition:lEe,EVD:lEe,CholeskyDecomposition:uEe,CHO:uEe,LuDecomposition:V9,LU:V9,QrDecomposition:qee,QR:qee,Nipals:hEe,NIPALS:hEe,MatrixColumnView:plr,MatrixColumnSelectionView:glr,MatrixFlipColumnView:ylr,MatrixFlipRowView:mlr,MatrixRowView:_lr,MatrixRowSelectionView:xlr,MatrixSelectionView:i8,MatrixSubView:Slr,MatrixTransposeView:wlr},Symbol.toStringTag,{value:"Module"})),dHe=Nd(Nlr);Object.defineProperty(Ple,"__esModule",{value:!0});var bP=dHe,klr=function(){function n(e){this.distances=e.distances,this.dimension=e.dimension||2,this.linkDistance=e.linkDistance}return n.prototype.layout=function(){var e=this,t=e.dimension,r=e.distances,i=e.linkDistance;try{var a=bP.Matrix.mul(bP.Matrix.pow(r,2),-.5),o=a.mean("row"),s=a.mean("column"),l=a.mean();a.add(l).subRowVector(o).subColumnVector(s);var u=new bP.SingularValueDecomposition(a),h=bP.Matrix.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map(function(p){return bP.Matrix.mul([p],[h]).toJSON()[0].splice(0,t)})}catch{for(var c=[],f=0;f<r.length;f++){var d=Math.random()*i,v=Math.random()*i;c.push([d,v])}return c}},n}();Ple.default=klr;var Ole={};Object.defineProperty(Ole,"__esModule",{value:!0});var Flr=800,Blr=function(){function n(e){this.disp=[],this.positions=e.positions,this.adjMatrix=e.adjMatrix,this.focusID=e.focusID,this.radii=e.radii,this.iterations=e.iterations||10,this.height=e.height||10,this.width=e.width||10,this.speed=e.speed||100,this.gravity=e.gravity||10,this.nodeSizeFunc=e.nodeSizeFunc,this.k=e.k||5,this.strictRadial=e.strictRadial,this.nodes=e.nodes}return n.prototype.layout=function(){var e=this,t=e.positions,r=[],i=e.iterations,a=e.width/10;e.maxDisplace=a,e.disp=r;for(var o=0;o<i;o++)t.forEach(function(s,l){r[l]={x:0,y:0}}),e.getRepulsion(),e.updatePositions();return t},n.prototype.getRepulsion=function(){var e=this,t=e.positions,r=e.nodes,i=e.disp,a=e.k,o=e.radii||[];t.forEach(function(s,l){i[l]={x:0,y:0},t.forEach(function(u,h){if(l!==h&&o[l]===o[h]){var c=s[0]-u[0],f=s[1]-u[1],d=Math.sqrt(c*c+f*f);if(d===0){d=1;var v=l>h?1:-1;c=.01*v,f=.01*v}if(d<e.nodeSizeFunc(r[l])/2+e.nodeSizeFunc(r[h])/2){var p=a*a/d;i[l].x+=c/d*p,i[l].y+=f/d*p}}})})},n.prototype.updatePositions=function(){var e=this,t=e.positions,r=e.disp,i=e.speed,a=e.strictRadial,o=e.focusID,s=e.maxDisplace||e.width/10;a&&r.forEach(function(u,h){var c=t[h][0]-t[o][0],f=t[h][1]-t[o][1],d=Math.sqrt(c*c+f*f),v=f/d,p=-c/d,g=Math.sqrt(u.x*u.x+u.y*u.y),m=Math.acos((v*u.x+p*u.y)/g);m>Math.PI/2&&(m-=Math.PI/2,v*=-1,p*=-1);var y=Math.cos(m)*g;u.x=v*y,u.y=p*y});var l=e.radii;t.forEach(function(u,h){if(h!==o){var c=Math.sqrt(r[h].x*r[h].x+r[h].y*r[h].y);if(c>0&&h!==o){var f=Math.min(s*(i/Flr),c);if(u[0]+=r[h].x/c*f,u[1]+=r[h].y/c*f,a){var d=u[0]-t[o][0],v=u[1]-t[o][1],p=Math.sqrt(d*d+v*v);d=d/p*l[h],v=v/p*l[h],u[0]=t[o][0]+d,u[1]=t[o][1]+v}}}})},n}();Ole.default=Blr;var Glr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),vHe=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(AV,"__esModule",{value:!0});AV.RadialLayout=void 0;var Jv=Dl(),zlr=Xl,Ulr=vHe(Ple),Vlr=vHe(Ole);function $lr(n){for(var e=n.length,t=n[0].length,r=[],i=0;i<e;i++){for(var a=[],o=0;o<t;o++)n[i][o]!==0?a.push(1/(n[i][o]*n[i][o])):a.push(0);r.push(a)}return r}function Wlr(n,e){var t=-1;return n.forEach(function(r,i){r.id===e&&(t=i)}),t}function cEe(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}var Hlr=function(n){Glr(e,n);function e(t){var r=n.call(this)||this;return r.maxIteration=1e3,r.focusNode=null,r.unitRadius=null,r.linkDistance=50,r.preventOverlap=!1,r.strictRadial=!0,r.maxPreventOverlapIteration=200,r.sortStrength=10,r.nodes=[],r.edges=[],r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges||[];if(!r||r.length===0){t.onLayoutEnd&&t.onLayoutEnd();return}!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var a=t.center;if(r.length===1){r[0].x=a[0],r[0].y=a[1],t.onLayoutEnd&&t.onLayoutEnd();return}var o=t.linkDistance,s=null;if((0,Jv.isString)(t.focusNode)){for(var l=!1,u=0;u<r.length;u++)r[u].id===t.focusNode&&(s=r[u],t.focusNode=s,l=!0,u=r.length);l||(s=null)}else s=t.focusNode;s||(s=r[0],t.focusNode=s);var h=Wlr(r,s.id);h<0&&(h=0),t.focusIndex=h;var c=(0,Jv.getAdjMatrix)({nodes:r,edges:i},!1),f=(0,Jv.floydWarshall)(c),d=t.maxToFocus(f,h);t.handleInfinity(f,h,d+1),t.distances=f;var v=f[h],p=t.width||500,g=t.height||500,m=p-a[0]>a[0]?a[0]:p-a[0],y=g-a[1]>a[1]?a[1]:g-a[1];m===0&&(m=p/2),y===0&&(y=g/2);var _=y>m?m:y,x=Math.max.apply(Math,v),S=[];v.forEach(function(W,z){t.unitRadius||(t.unitRadius=_/x),S[z]=W*t.unitRadius}),t.radii=S;var w=t.eIdealDisMatrix();t.eIdealDistances=w;var b=$lr(w);t.weights=b;var E=new Ulr.default({linkDistance:o,distances:w}),T=E.layout();T.forEach(function(W){(0,Jv.isNaN)(W[0])&&(W[0]=Math.random()*o),(0,Jv.isNaN)(W[1])&&(W[1]=Math.random()*o)}),t.positions=T,T.forEach(function(W,z){r[z].x=W[0]+a[0],r[z].y=W[1]+a[1]}),T.forEach(function(W){W[0]-=T[h][0],W[1]-=T[h][1]}),t.run();var C=t.preventOverlap,A=t.nodeSize,M,I=t.strictRadial;if(C){var R=t.nodeSpacing,k;(0,Jv.isNumber)(R)?k=function(){return R}:(0,Jv.isFunction)(R)?k=R:k=function(){return 0},A?(0,Jv.isArray)(A)?M=function(W){var z=A[0]>A[1]?A[0]:A[1];return z+k(W)}:M=function(W){return A+k(W)}:M=function(W){if(W.size){if((0,Jv.isArray)(W.size)){var z=W.size[0]>W.size[1]?W.size[0]:W.size[1];return z+k(W)}if((0,Jv.isObject)(W.size)){var z=W.size.width>W.size.height?W.size.width:W.size.height;return z+k(W)}return W.size+k(W)}return 10+k(W)};var D={nodes:r,nodeSizeFunc:M,adjMatrix:c,positions:T,radii:S,height:g,width:p,strictRadial:I,focusID:h,iterations:t.maxPreventOverlapIteration||200,k:T.length/4.5},G=new Vlr.default(D);T=G.layout()}return T.forEach(function(W,z){r[z].x=W[0]+a[0],r[z].y=W[1]+a[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:i}},e.prototype.run=function(){for(var t=this,r=t.maxIteration,i=t.positions||[],a=t.weights||[],o=t.eIdealDistances||[],s=t.radii||[],l=0;l<=r;l++){var u=l/r;t.oneIteration(u,i,s,o,a)}},e.prototype.oneIteration=function(t,r,i,a,o){var s=this,l=1-t,u=s.focusIndex;r.forEach(function(h,c){var f=cEe(h,[0,0]),d=f===0?0:1/f;if(c!==u){var v=0,p=0,g=0;r.forEach(function(y,_){if(c!==_){var x=cEe(h,y),S=x===0?0:1/x,w=a[_][c];g+=o[c][_],v+=o[c][_]*(y[0]+w*(h[0]-y[0])*S),p+=o[c][_]*(y[1]+w*(h[1]-y[1])*S)}});var m=i[c]===0?0:1/i[c];g*=l,g+=t*m*m,v*=l,v+=t*m*h[0]*d,h[0]=v/g,p*=l,p+=t*m*h[1]*d,h[1]=p/g}})},e.prototype.eIdealDisMatrix=function(){var t=this,r=t.nodes;if(!r)return[];var i=t.distances,a=t.linkDistance,o=t.radii||[],s=t.unitRadius||50,l=[];return i&&i.forEach(function(u,h){var c=[];u.forEach(function(f,d){if(h===d)c.push(0);else if(o[h]===o[d])if(t.sortBy==="data")c.push(f*(Math.abs(h-d)*t.sortStrength)/(o[h]/s));else if(t.sortBy){var v=r[h][t.sortBy]||0,p=r[d][t.sortBy]||0;(0,Jv.isString)(v)&&(v=v.charCodeAt(0)),(0,Jv.isString)(p)&&(p=p.charCodeAt(0)),c.push(f*(Math.abs(v-p)*t.sortStrength)/(o[h]/s))}else c.push(f*a/(o[h]/s));else{var g=(a+s)/2;c.push(f*g)}}),l.push(c)}),l},e.prototype.handleInfinity=function(t,r,i){for(var a=t.length,o=0;o<a;o++)if(t[r][o]===1/0){t[r][o]=i,t[o][r]=i;for(var s=0;s<a;s++)t[o][s]!==1/0&&t[r][s]===1/0&&(t[r][s]=i+t[o][s],t[s][r]=i+t[o][s])}for(var o=0;o<a;o++)if(o!==r){for(var s=0;s<a;s++)if(t[o][s]===1/0){var l=Math.abs(t[r][o]-t[r][s]);l=l===0?1:l,t[o][s]=l}}},e.prototype.maxToFocus=function(t,r){for(var i=0,a=0;a<t[r].length;a++)t[r][a]!==1/0&&(i=t[r][a]>i?t[r][a]:i);return i},e.prototype.getType=function(){return"radial"},e}(zlr.Base);AV.RadialLayout=Hlr;(function(n){var e=at&&at.__createBinding||(Object.create?function(r,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(r,o,s)}:function(r,i,a,o){o===void 0&&(o=a),r[o]=i[a]}),t=at&&at.__exportStar||function(r,i){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),t(AV,n)})(Lle);var lk={},jlr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(lk,"__esModule",{value:!0});lk.ConcentricLayout=void 0;var ay=Dl(),Xlr=Xl,Ylr=function(n){jlr(e,n);function e(t){var r=n.call(this)||this;return r.nodeSize=30,r.minNodeSpacing=10,r.nodeSpacing=10,r.preventOverlap=!1,r.equidistant=!1,r.startAngle=3/2*Math.PI,r.clockwise=!0,r.sortBy="degree",r.nodes=[],r.edges=[],r.width=300,r.height=300,r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},e.prototype.execute=function(){var t,r,i=this,a=i.nodes,o=i.edges,s=a.length;if(s===0){(t=i.onLayoutEnd)===null||t===void 0||t.call(i);return}!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),i.center||(i.center=[i.width/2,i.height/2]);var l=i.center;if(s===1){a[0].x=l[0],a[0].y=l[1],(r=i.onLayoutEnd)===null||r===void 0||r.call(i);return}var u=i.nodeSize,h=i.nodeSpacing,c=[],f,d=0;(0,ay.isArray)(u)?f=Math.max(u[0],u[1]):f=u,(0,ay.isArray)(h)?d=Math.max(h[0],h[1]):(0,ay.isNumber)(h)&&(d=h),a.forEach(function(I){c.push(I);var R=f;(0,ay.isArray)(I.size)?R=Math.max(I.size[0],I.size[1]):(0,ay.isNumber)(I.size)?R=I.size:(0,ay.isObject)(I.size)&&(R=Math.max(I.size.width,I.size.height)),f=Math.max(f,R),(0,ay.isFunction)(h)&&(d=Math.max(h(I),d))}),i.clockwise=i.counterclockwise!==void 0?!i.counterclockwise:i.clockwise;var v={},p={};if(c.forEach(function(I,R){v[I.id]=I,p[I.id]=R}),(i.sortBy==="degree"||!(0,ay.isString)(i.sortBy)||c[0][i.sortBy]===void 0)&&(i.sortBy="degree",!(0,ay.isNumber)(a[0].degree))){var g=(0,ay.getDegree)(a.length,p,o);c.forEach(function(I,R){I.degree=g[R].all})}c.sort(function(I,R){return R[i.sortBy]-I[i.sortBy]}),i.maxValueNode=c[0],i.maxLevelDiff=i.maxLevelDiff||i.maxValueNode[i.sortBy]/4;var m=[[]],y=m[0];c.forEach(function(I){if(y.length>0){var R=Math.abs(y[0][i.sortBy]-I[i.sortBy]);i.maxLevelDiff&&R>=i.maxLevelDiff&&(y=[],m.push(y))}y.push(I)});var _=f+(d||i.minNodeSpacing);if(!i.preventOverlap){var x=m.length>0&&m[0].length>1,S=Math.min(i.width,i.height)/2-_,w=S/(m.length+(x?1:0));_=Math.min(_,w)}var b=0;if(m.forEach(function(I){var R=i.sweep;R===void 0&&(R=2*Math.PI-2*Math.PI/I.length);var k=I.dTheta=R/Math.max(1,I.length-1);if(I.length>1&&i.preventOverlap){var D=Math.cos(k)-Math.cos(0),G=Math.sin(k)-Math.sin(0),W=Math.sqrt(_*_/(D*D+G*G));b=Math.max(W,b)}I.r=b,b+=_}),i.equidistant){for(var E=0,T=0,C=0;C<m.length;C++){var A=m[C],M=A.r-T;E=Math.max(E,M)}T=0,m.forEach(function(I,R){R===0&&(T=I.r),I.r=T,T+=E})}return m.forEach(function(I){var R=I.dTheta,k=I.r;I.forEach(function(D,G){var W=i.startAngle+(i.clockwise?1:-1)*R*G;D.x=l[0]+k*Math.cos(W),D.y=l[1]+k*Math.sin(W)})}),i.onLayoutEnd&&i.onLayoutEnd(),{nodes:a,edges:o}},e.prototype.getType=function(){return"concentric"},e}(Xlr.Base);lk.ConcentricLayout=Ylr;var uk={},qlr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(uk,"__esModule",{value:!0});uk.MDSLayout=void 0;var EP=dHe,TY=Dl(),Zlr=Xl,Klr=function(n){qlr(e,n);function e(t){var r=n.call(this)||this;return r.center=[0,0],r.linkDistance=50,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges,a=i===void 0?[]:i,o=t.center;if(!r||r.length===0){t.onLayoutEnd&&t.onLayoutEnd();return}if(r.length===1){r[0].x=o[0],r[0].y=o[1],t.onLayoutEnd&&t.onLayoutEnd();return}var s=t.linkDistance,l=(0,TY.getAdjMatrix)({nodes:r,edges:a},!1),u=(0,TY.floydWarshall)(l);t.handleInfinity(u);var h=(0,TY.scaleMatrix)(u,s);t.scaledDistances=h;var c=t.runMDS();return t.positions=c,c.forEach(function(f,d){r[d].x=f[0]+o[0],r[d].y=f[1]+o[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:r,edges:a}},e.prototype.runMDS=function(){var t=this,r=2,i=t.scaledDistances,a=EP.Matrix.mul(EP.Matrix.pow(i,2),-.5),o=a.mean("row"),s=a.mean("column"),l=a.mean();a.add(l).subRowVector(o).subColumnVector(s);var u=new EP.SingularValueDecomposition(a),h=EP.Matrix.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map(function(c){return EP.Matrix.mul([c],[h]).toJSON()[0].splice(0,r)})},e.prototype.handleInfinity=function(t){var r=-999999;t.forEach(function(i){i.forEach(function(a){a!==1/0&&r<a&&(r=a)})}),t.forEach(function(i,a){i.forEach(function(o,s){o===1/0&&(t[a][s]=r)})})},e.prototype.getType=function(){return"mds"},e}(Zlr.Base);uk.MDSLayout=Klr;var hk={},Jlr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(hk,"__esModule",{value:!0});hk.FruchtermanLayout=void 0;var Qlr=Xl,zl=Dl(),eur=800,tur=function(n){Jlr(e,n);function e(t){var r=n.call(this)||this;return r.maxIteration=1e3,r.workerEnabled=!1,r.gravity=10,r.speed=5,r.clustering=!1,r.clusterGravity=10,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.onLayoutEnd=function(){},r.tick=function(){},r.animate=!0,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t=this,r,i,a=this,o=a.nodes;if(a.timeInterval!==void 0&&typeof window<"u"&&window.clearInterval(a.timeInterval),!o||o.length===0){(r=a.onLayoutEnd)===null||r===void 0||r.call(a);return}!a.width&&typeof window<"u"&&(a.width=window.innerWidth),!a.height&&typeof window<"u"&&(a.height=window.innerHeight),a.center||(a.center=[a.width/2,a.height/2]);var s=a.center;if(o.length===1){o[0].x=s[0],o[0].y=s[1],(i=a.onLayoutEnd)===null||i===void 0||i.call(a);return}var l={},u={};return o.forEach(function(h,c){(0,zl.isNumber)(h.x)||(h.x=Math.random()*t.width),(0,zl.isNumber)(h.y)||(h.y=Math.random()*t.height),l[h.id]=h,u[h.id]=c}),a.nodeMap=l,a.nodeIdxMap=u,a.run()},e.prototype.run=function(){var t,r=this,i=r.nodes;if(!!i){var a=r.edges,o=r.maxIteration,s=r.workerEnabled,l=r.clustering,u=r.animate,h={};if(l&&i.forEach(function(d){h[d.cluster]===void 0&&(h[d.cluster]={name:d.cluster,cx:0,cy:0,count:0})}),s||!u){for(var c=0;c<o;c++)r.runOneStep(h);(t=r.onLayoutEnd)===null||t===void 0||t.call(r)}else{if(typeof window>"u")return;var f=0;this.timeInterval=window.setInterval(function(){var d;r.runOneStep(h),f++,f>=o&&((d=r.onLayoutEnd)===null||d===void 0||d.call(r),window.clearInterval(r.timeInterval))},0)}return{nodes:i,edges:a}}},e.prototype.runOneStep=function(t){var r,i=this,a=i.nodes;if(!!a){var o=i.edges,s=i.center,l=i.gravity,u=i.speed,h=i.clustering,c=i.height*i.width,f=Math.sqrt(c)/10,d=c/(a.length+1),v=Math.sqrt(d),p=[];if(a.forEach(function(y,_){p[_]={x:0,y:0}}),i.applyCalculate(a,o,p,v,d),h){for(var g in t)t[g].cx=0,t[g].cy=0,t[g].count=0;a.forEach(function(y){var _=t[y.cluster];(0,zl.isNumber)(y.x)&&(_.cx+=y.x),(0,zl.isNumber)(y.y)&&(_.cy+=y.y),_.count++});for(var g in t)t[g].cx/=t[g].count,t[g].cy/=t[g].count;var m=i.clusterGravity||l;a.forEach(function(y,_){if(!(!(0,zl.isNumber)(y.x)||!(0,zl.isNumber)(y.y))){var x=t[y.cluster],S=Math.sqrt((y.x-x.cx)*(y.x-x.cx)+(y.y-x.cy)*(y.y-x.cy)),w=v*m;p[_].x-=w*(y.x-x.cx)/S,p[_].y-=w*(y.y-x.cy)/S}})}a.forEach(function(y,_){if(!(!(0,zl.isNumber)(y.x)||!(0,zl.isNumber)(y.y))){var x=.01*v*l;p[_].x-=x*(y.x-s[0]),p[_].y-=x*(y.y-s[1])}}),a.forEach(function(y,_){if((0,zl.isNumber)(y.fx)&&(0,zl.isNumber)(y.fy)){y.x=y.fx,y.y=y.fy;return}if(!(!(0,zl.isNumber)(y.x)||!(0,zl.isNumber)(y.y))){var x=Math.sqrt(p[_].x*p[_].x+p[_].y*p[_].y);if(x>0){var S=Math.min(f*(u/eur),x);y.x+=p[_].x/x*S,y.y+=p[_].y/x*S}}}),(r=i.tick)===null||r===void 0||r.call(i)}},e.prototype.applyCalculate=function(t,r,i,a,o){var s=this;s.calRepulsive(t,i,o),r&&s.calAttractive(r,i,a)},e.prototype.calRepulsive=function(t,r,i){t.forEach(function(a,o){r[o]={x:0,y:0},t.forEach(function(s,l){if(o!==l&&!(!(0,zl.isNumber)(a.x)||!(0,zl.isNumber)(s.x)||!(0,zl.isNumber)(a.y)||!(0,zl.isNumber)(s.y))){var u=a.x-s.x,h=a.y-s.y,c=u*u+h*h;if(c===0){c=1;var f=o>l?1:-1;u=.01*f,h=.01*f}var d=i/c;r[o].x+=u*d,r[o].y+=h*d}})})},e.prototype.calAttractive=function(t,r,i){var a=this;t.forEach(function(o){var s=(0,zl.getEdgeTerminal)(o,"source"),l=(0,zl.getEdgeTerminal)(o,"target");if(!(!s||!l)){var u=a.nodeIdxMap[s],h=a.nodeIdxMap[l];if(u!==h){var c=a.nodeMap[s],f=a.nodeMap[l];if(!(!(0,zl.isNumber)(f.x)||!(0,zl.isNumber)(c.x)||!(0,zl.isNumber)(f.y)||!(0,zl.isNumber)(c.y))){var d=f.x-c.x,v=f.y-c.y,p=Math.sqrt(d*d+v*v),g=p*p/i;r[h].x-=d/p*g,r[h].y-=v/p*g,r[u].x+=d/p*g,r[u].y+=v/p*g}}}})},e.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(Qlr.Base);hk.FruchtermanLayout=tur;var ck={};function fEe(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Vc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){fEe(a,r,i,o,s,"next",l)}function s(l){fEe(a,r,i,o,s,"throw",l)}o(void 0)})}}function GM(n){return GM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},GM(n)}function rur(n,e){if(GM(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(GM(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pHe(n){var e=rur(n,"string");return GM(e)=="symbol"?e:e+""}function Lr(n,e,t){return(e=pHe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function z0(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function dEe(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,pHe(r.key),r)}}function U0(n,e,t){return e&&dEe(n.prototype,e),t&&dEe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}var nur=typeof at=="object"&&at&&at.Object===Object&&at,gHe=nur,iur=gHe,aur=typeof self=="object"&&self&&self.Object===Object&&self,our=iur||aur||Function("return this")(),sur=our,lur=sur,uur=lur.Symbol,yHe=uur,vEe=yHe,mHe=Object.prototype,hur=mHe.hasOwnProperty,cur=mHe.toString,TP=vEe?vEe.toStringTag:void 0;function fur(n){var e=hur.call(n,TP),t=n[TP];try{n[TP]=void 0;var r=!0}catch{}var i=cur.call(n);return r&&(e?n[TP]=t:delete n[TP]),i}var dur=fur,vur=Object.prototype,pur=vur.toString;function gur(n){return pur.call(n)}var yur=gur,pEe=yHe,mur=dur,_ur=yur,xur="[object Null]",Sur="[object Undefined]",gEe=pEe?pEe.toStringTag:void 0;function wur(n){return n==null?n===void 0?Sur:xur:gEe&&gEe in Object(n)?mur(n):_ur(n)}var Rle=wur,bur=9007199254740991;function Eur(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=bur}var Tur=Eur;function Cur(n){return n!=null&&typeof n=="object"}var Dle=Cur,Aur=Rle,Mur=Tur,Iur=Dle,Lur="[object Arguments]",Pur="[object Array]",Our="[object Boolean]",Rur="[object Date]",Dur="[object Error]",Nur="[object Function]",kur="[object Map]",Fur="[object Number]",Bur="[object Object]",Gur="[object RegExp]",zur="[object Set]",Uur="[object String]",Vur="[object WeakMap]",$ur="[object ArrayBuffer]",Wur="[object DataView]",Hur="[object Float32Array]",jur="[object Float64Array]",Xur="[object Int8Array]",Yur="[object Int16Array]",qur="[object Int32Array]",Zur="[object Uint8Array]",Kur="[object Uint8ClampedArray]",Jur="[object Uint16Array]",Qur="[object Uint32Array]",qs={};qs[Hur]=qs[jur]=qs[Xur]=qs[Yur]=qs[qur]=qs[Zur]=qs[Kur]=qs[Jur]=qs[Qur]=!0;qs[Lur]=qs[Pur]=qs[$ur]=qs[Our]=qs[Wur]=qs[Rur]=qs[Dur]=qs[Nur]=qs[kur]=qs[Fur]=qs[Bur]=qs[Gur]=qs[zur]=qs[Uur]=qs[Vur]=!1;function ehr(n){return Iur(n)&&Mur(n.length)&&!!qs[Aur(n)]}var thr=ehr;function rhr(n){return function(e){return n(e)}}var nhr=rhr,Zee={exports:{}};(function(n,e){var t=gHe,r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,a=i&&i.exports===r,o=a&&t.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();n.exports=s})(Zee,Zee.exports);var ihr=thr,ahr=nhr,yEe=Zee.exports,mEe=yEe&&yEe.isTypedArray,ohr=mEe?ahr(mEe):ihr,$9=ohr,shr=Rle,lhr=Dle,uhr="[object Number]";function hhr(n){return typeof n=="number"||lhr(n)&&shr(n)==uhr}var chr=hhr,fhr=Array.isArray,dhr=fhr,_He={exports:{}},Nle={exports:{}};(function(n){function e(t,r){this.v=t,this.k=r}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Nle);var kle={exports:{}},Fle={exports:{}};(function(n){function e(t,r,i,a){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}n.exports=e=function(l,u,h,c){if(u)o?o(l,u,{value:h,enumerable:!c,configurable:!c,writable:!c}):l[u]=h;else{var f=function(v,p){e(l,v,function(g){return this._invoke(v,p,g)})};f("next",0),f("throw",1),f("return",2)}},n.exports.__esModule=!0,n.exports.default=n.exports,e(t,r,i,a)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Fle);(function(n){var e=Fle.exports;function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,i,a=typeof Symbol=="function"?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function l(g,m,y,_){var x=m&&m.prototype instanceof h?m:h,S=Object.create(x.prototype);return e(S,"_invoke",function(w,b,E){var T,C,A,M=0,I=E||[],R=!1,k={p:0,n:0,v:r,a:D,f:D.bind(r,4),d:function(W,z){return T=W,C=0,A=r,k.n=z,u}};function D(G,W){for(C=G,A=W,i=0;!R&&M&&!z&&i<I.length;i++){var z,V=I[i],q=k.p,Y=V[2];G>3?(z=Y===W)&&(A=V[(C=V[4])?5:(C=3,3)],V[4]=V[5]=r):V[0]<=q&&((z=G<2&&q<V[1])?(C=0,k.v=W,k.n=V[1]):q<Y&&(z=G<3||V[0]>W||W>Y)&&(V[4]=G,V[5]=W,k.n=Y,C=0))}if(z||G>1)return u;throw R=!0,W}return function(G,W,z){if(M>1)throw TypeError("Generator is already running");for(R&&W===1&&D(W,z),C=W,A=z;(i=C<2?r:A)||!R;){T||(C?C<3?(C>1&&(k.n=-1),D(C,A)):k.n=A:k.v=A);try{if(M=2,T){if(C||(G="next"),i=T[G]){if(!(i=i.call(T,A)))throw TypeError("iterator result is not an object");if(!i.done)return i;A=i.value,C<2&&(C=0)}else C===1&&(i=T.return)&&i.call(T),C<2&&(A=TypeError("The iterator does not provide a '"+G+"' method"),C=1);T=r}else if((i=(R=k.n<0)?A:w.call(b,k))!==u)break}catch(V){T=r,C=1,A=V}finally{M=1}}return{value:i,done:R}}}(g,y,_),!0),S}var u={};function h(){}function c(){}function f(){}i=Object.getPrototypeOf;var d=[][o]?i(i([][o]())):(e(i={},o,function(){return this}),i),v=f.prototype=h.prototype=Object.create(d);function p(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,f):(g.__proto__=f,e(g,s,"GeneratorFunction")),g.prototype=Object.create(v),g}return c.prototype=f,e(v,"constructor",f),e(f,"constructor",c),c.displayName="GeneratorFunction",e(f,s,"GeneratorFunction"),e(v),e(v,s,"Generator"),e(v,o,function(){return this}),e(v,"toString",function(){return"[object Generator]"}),(n.exports=t=function(){return{w:l,m:p}},n.exports.__esModule=!0,n.exports.default=n.exports)()}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(kle);var xHe={exports:{}},Ble={exports:{}},Gle={exports:{}};(function(n){var e=Nle.exports,t=Fle.exports;function r(i,a){function o(l,u,h,c){try{var f=i[l](u),d=f.value;return d instanceof e?a.resolve(d.v).then(function(v){o("next",v,h,c)},function(v){o("throw",v,h,c)}):a.resolve(d).then(function(v){f.value=v,h(f)},function(v){return o("throw",v,h,c)})}catch(v){c(v)}}var s;this.next||(t(r.prototype),t(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),t(this,"_invoke",function(l,u,h){function c(){return new a(function(f,d){o(l,h,f,d)})}return s=s?s.then(c,c):c()},!0)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports})(Gle);(function(n){var e=kle.exports,t=Gle.exports;function r(i,a,o,s,l){return new t(e().w(i,a,o,s),l||Promise)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports})(Ble);(function(n){var e=Ble.exports;function t(r,i,a,o,s){var l=e(r,i,a,o,s);return l.next().then(function(u){return u.done?u.value:l.next()})}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(xHe);var SHe={exports:{}};(function(n){function e(t){var r=Object(t),i=[];for(var a in r)i.unshift(a);return function o(){for(;i.length;)if((a=i.pop())in r)return o.value=a,o.done=!1,o;return o.done=!0,o}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(SHe);var wHe={exports:{}},bHe={exports:{}};(function(n){function e(t){return n.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,e(t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(bHe);(function(n){var e=bHe.exports.default;function t(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],a=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}}}throw new TypeError(e(r)+" is not iterable")}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(wHe);(function(n){var e=Nle.exports,t=kle.exports,r=xHe.exports,i=Ble.exports,a=Gle.exports,o=SHe.exports,s=wHe.exports;function l(){var u=t(),h=u.m(l),c=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function f(p){var g=typeof p=="function"&&p.constructor;return!!g&&(g===c||(g.displayName||g.name)==="GeneratorFunction")}var d={throw:1,return:2,break:3,continue:3};function v(p){var g,m;return function(y){g||(g={stop:function(){return m(y.a,2)},catch:function(){return y.v},abrupt:function(x,S){return m(y.a,d[x],S)},delegateYield:function(x,S,w){return g.resultName=S,m(y.d,s(x),w)},finish:function(x){return m(y.f,x)}},m=function(x,S,w){y.p=g.prev,y.n=g.next;try{return x(S,w)}finally{g.next=y.n}}),g.resultName&&(g[g.resultName]=y.v,g.resultName=void 0),g.sent=y.v,g.next=y.n;try{return p.call(this,g)}finally{y.p=g.prev,y.n=g.next}}}return(n.exports=l=function(){return{wrap:function(m,y,_,x){return u.w(v(m),y,_,x&&x.reverse())},isGeneratorFunction:f,mark:u.m,awrap:function(m,y){return new e(m,y)},AsyncIterator:a,async:function(m,y,_,x,S){return(f(y)?i:r)(v(m),y,_,x,S)},keys:o,values:s}},n.exports.__esModule=!0,n.exports.default=n.exports)()}n.exports=l,n.exports.__esModule=!0,n.exports.default=n.exports})(_He);var o8=_He.exports(),Rc=o8;try{regeneratorRuntime=o8}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=o8:Function("r","regeneratorRuntime = r")(o8)}var vhr=1;function EHe(){return vhr++}var Qt;(function(n){n[n.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",n[n.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",n[n.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",n[n.POINTS=0]="POINTS",n[n.LINES=1]="LINES",n[n.LINE_LOOP=2]="LINE_LOOP",n[n.LINE_STRIP=3]="LINE_STRIP",n[n.TRIANGLES=4]="TRIANGLES",n[n.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",n[n.TRIANGLE_FAN=6]="TRIANGLE_FAN",n[n.ZERO=0]="ZERO",n[n.ONE=1]="ONE",n[n.SRC_COLOR=768]="SRC_COLOR",n[n.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",n[n.SRC_ALPHA=770]="SRC_ALPHA",n[n.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",n[n.DST_ALPHA=772]="DST_ALPHA",n[n.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",n[n.DST_COLOR=774]="DST_COLOR",n[n.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",n[n.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",n[n.FUNC_ADD=32774]="FUNC_ADD",n[n.BLEND_EQUATION=32777]="BLEND_EQUATION",n[n.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",n[n.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",n[n.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",n[n.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",n[n.MAX_EXT=32776]="MAX_EXT",n[n.MIN_EXT=32775]="MIN_EXT",n[n.BLEND_DST_RGB=32968]="BLEND_DST_RGB",n[n.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",n[n.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",n[n.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",n[n.CONSTANT_COLOR=32769]="CONSTANT_COLOR",n[n.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",n[n.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",n[n.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",n[n.BLEND_COLOR=32773]="BLEND_COLOR",n[n.ARRAY_BUFFER=34962]="ARRAY_BUFFER",n[n.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",n[n.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",n[n.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",n[n.STREAM_DRAW=35040]="STREAM_DRAW",n[n.STATIC_DRAW=35044]="STATIC_DRAW",n[n.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",n[n.BUFFER_SIZE=34660]="BUFFER_SIZE",n[n.BUFFER_USAGE=34661]="BUFFER_USAGE",n[n.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",n[n.FRONT=1028]="FRONT",n[n.BACK=1029]="BACK",n[n.FRONT_AND_BACK=1032]="FRONT_AND_BACK",n[n.CULL_FACE=2884]="CULL_FACE",n[n.BLEND=3042]="BLEND",n[n.DITHER=3024]="DITHER",n[n.STENCIL_TEST=2960]="STENCIL_TEST",n[n.DEPTH_TEST=2929]="DEPTH_TEST",n[n.SCISSOR_TEST=3089]="SCISSOR_TEST",n[n.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",n[n.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",n[n.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",n[n.NO_ERROR=0]="NO_ERROR",n[n.INVALID_ENUM=1280]="INVALID_ENUM",n[n.INVALID_VALUE=1281]="INVALID_VALUE",n[n.INVALID_OPERATION=1282]="INVALID_OPERATION",n[n.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",n[n.CW=2304]="CW",n[n.CCW=2305]="CCW",n[n.LINE_WIDTH=2849]="LINE_WIDTH",n[n.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",n[n.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",n[n.CULL_FACE_MODE=2885]="CULL_FACE_MODE",n[n.FRONT_FACE=2886]="FRONT_FACE",n[n.DEPTH_RANGE=2928]="DEPTH_RANGE",n[n.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",n[n.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",n[n.DEPTH_FUNC=2932]="DEPTH_FUNC",n[n.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",n[n.STENCIL_FUNC=2962]="STENCIL_FUNC",n[n.STENCIL_FAIL=2964]="STENCIL_FAIL",n[n.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",n[n.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",n[n.STENCIL_REF=2967]="STENCIL_REF",n[n.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",n[n.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",n[n.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",n[n.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",n[n.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",n[n.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",n[n.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",n[n.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",n[n.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",n[n.VIEWPORT=2978]="VIEWPORT",n[n.SCISSOR_BOX=3088]="SCISSOR_BOX",n[n.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",n[n.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",n[n.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",n[n.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",n[n.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",n[n.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",n[n.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",n[n.RED_BITS=3410]="RED_BITS",n[n.GREEN_BITS=3411]="GREEN_BITS",n[n.BLUE_BITS=3412]="BLUE_BITS",n[n.ALPHA_BITS=3413]="ALPHA_BITS",n[n.DEPTH_BITS=3414]="DEPTH_BITS",n[n.STENCIL_BITS=3415]="STENCIL_BITS",n[n.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",n[n.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",n[n.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",n[n.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",n[n.SAMPLES=32937]="SAMPLES",n[n.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",n[n.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",n[n.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",n[n.DONT_CARE=4352]="DONT_CARE",n[n.FASTEST=4353]="FASTEST",n[n.NICEST=4354]="NICEST",n[n.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",n[n.BYTE=5120]="BYTE",n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.SHORT=5122]="SHORT",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.INT=5124]="INT",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.FLOAT=5126]="FLOAT",n[n.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",n[n.ALPHA=6406]="ALPHA",n[n.RGB=6407]="RGB",n[n.RGBA=6408]="RGBA",n[n.LUMINANCE=6409]="LUMINANCE",n[n.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",n[n.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",n[n.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",n[n.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",n[n.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",n[n.VERTEX_SHADER=35633]="VERTEX_SHADER",n[n.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",n[n.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",n[n.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",n[n.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",n[n.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",n[n.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",n[n.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",n[n.SHADER_TYPE=35663]="SHADER_TYPE",n[n.DELETE_STATUS=35712]="DELETE_STATUS",n[n.LINK_STATUS=35714]="LINK_STATUS",n[n.VALIDATE_STATUS=35715]="VALIDATE_STATUS",n[n.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",n[n.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",n[n.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",n[n.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",n[n.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",n[n.NEVER=512]="NEVER",n[n.LESS=513]="LESS",n[n.EQUAL=514]="EQUAL",n[n.LEQUAL=515]="LEQUAL",n[n.GREATER=516]="GREATER",n[n.NOTEQUAL=517]="NOTEQUAL",n[n.GEQUAL=518]="GEQUAL",n[n.ALWAYS=519]="ALWAYS",n[n.KEEP=7680]="KEEP",n[n.REPLACE=7681]="REPLACE",n[n.INCR=7682]="INCR",n[n.DECR=7683]="DECR",n[n.INVERT=5386]="INVERT",n[n.INCR_WRAP=34055]="INCR_WRAP",n[n.DECR_WRAP=34056]="DECR_WRAP",n[n.VENDOR=7936]="VENDOR",n[n.RENDERER=7937]="RENDERER",n[n.VERSION=7938]="VERSION",n[n.NEAREST=9728]="NEAREST",n[n.LINEAR=9729]="LINEAR",n[n.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",n[n.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",n[n.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",n[n.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",n[n.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",n[n.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",n[n.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",n[n.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",n[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE=5890]="TEXTURE",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n[n.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",n[n.TEXTURE0=33984]="TEXTURE0",n[n.TEXTURE1=33985]="TEXTURE1",n[n.TEXTURE2=33986]="TEXTURE2",n[n.TEXTURE3=33987]="TEXTURE3",n[n.TEXTURE4=33988]="TEXTURE4",n[n.TEXTURE5=33989]="TEXTURE5",n[n.TEXTURE6=33990]="TEXTURE6",n[n.TEXTURE7=33991]="TEXTURE7",n[n.TEXTURE8=33992]="TEXTURE8",n[n.TEXTURE9=33993]="TEXTURE9",n[n.TEXTURE10=33994]="TEXTURE10",n[n.TEXTURE11=33995]="TEXTURE11",n[n.TEXTURE12=33996]="TEXTURE12",n[n.TEXTURE13=33997]="TEXTURE13",n[n.TEXTURE14=33998]="TEXTURE14",n[n.TEXTURE15=33999]="TEXTURE15",n[n.TEXTURE16=34e3]="TEXTURE16",n[n.TEXTURE17=34001]="TEXTURE17",n[n.TEXTURE18=34002]="TEXTURE18",n[n.TEXTURE19=34003]="TEXTURE19",n[n.TEXTURE20=34004]="TEXTURE20",n[n.TEXTURE21=34005]="TEXTURE21",n[n.TEXTURE22=34006]="TEXTURE22",n[n.TEXTURE23=34007]="TEXTURE23",n[n.TEXTURE24=34008]="TEXTURE24",n[n.TEXTURE25=34009]="TEXTURE25",n[n.TEXTURE26=34010]="TEXTURE26",n[n.TEXTURE27=34011]="TEXTURE27",n[n.TEXTURE28=34012]="TEXTURE28",n[n.TEXTURE29=34013]="TEXTURE29",n[n.TEXTURE30=34014]="TEXTURE30",n[n.TEXTURE31=34015]="TEXTURE31",n[n.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",n[n.REPEAT=10497]="REPEAT",n[n.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",n[n.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",n[n.FLOAT_VEC2=35664]="FLOAT_VEC2",n[n.FLOAT_VEC3=35665]="FLOAT_VEC3",n[n.FLOAT_VEC4=35666]="FLOAT_VEC4",n[n.INT_VEC2=35667]="INT_VEC2",n[n.INT_VEC3=35668]="INT_VEC3",n[n.INT_VEC4=35669]="INT_VEC4",n[n.BOOL=35670]="BOOL",n[n.BOOL_VEC2=35671]="BOOL_VEC2",n[n.BOOL_VEC3=35672]="BOOL_VEC3",n[n.BOOL_VEC4=35673]="BOOL_VEC4",n[n.FLOAT_MAT2=35674]="FLOAT_MAT2",n[n.FLOAT_MAT3=35675]="FLOAT_MAT3",n[n.FLOAT_MAT4=35676]="FLOAT_MAT4",n[n.SAMPLER_2D=35678]="SAMPLER_2D",n[n.SAMPLER_CUBE=35680]="SAMPLER_CUBE",n[n.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",n[n.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",n[n.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",n[n.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",n[n.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",n[n.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",n[n.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",n[n.COMPILE_STATUS=35713]="COMPILE_STATUS",n[n.LOW_FLOAT=36336]="LOW_FLOAT",n[n.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",n[n.HIGH_FLOAT=36338]="HIGH_FLOAT",n[n.LOW_INT=36339]="LOW_INT",n[n.MEDIUM_INT=36340]="MEDIUM_INT",n[n.HIGH_INT=36341]="HIGH_INT",n[n.FRAMEBUFFER=36160]="FRAMEBUFFER",n[n.RENDERBUFFER=36161]="RENDERBUFFER",n[n.RGBA4=32854]="RGBA4",n[n.RGB5_A1=32855]="RGB5_A1",n[n.RGB565=36194]="RGB565",n[n.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",n[n.STENCIL_INDEX=6401]="STENCIL_INDEX",n[n.STENCIL_INDEX8=36168]="STENCIL_INDEX8",n[n.DEPTH_STENCIL=34041]="DEPTH_STENCIL",n[n.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",n[n.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",n[n.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",n[n.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",n[n.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",n[n.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",n[n.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",n[n.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",n[n.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",n[n.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",n[n.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",n[n.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",n[n.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",n[n.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",n[n.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",n[n.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",n[n.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",n[n.NONE=0]="NONE",n[n.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",n[n.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",n[n.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",n[n.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",n[n.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",n[n.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",n[n.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",n[n.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",n[n.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",n[n.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",n[n.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",n[n.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",n[n.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",n[n.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",n[n.COPY_SRC=1]="COPY_SRC",n[n.COPY_DST=2]="COPY_DST",n[n.SAMPLED=4]="SAMPLED",n[n.STORAGE=8]="STORAGE",n[n.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(Qt||(Qt={}));var phr=function(){function n(){z0(this,n),this.config=void 0}return U0(n,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),n}();typeof navigator<"u"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);var rN;(function(n){n.Void="Void",n.Boolean="Boolean",n.Float="Float",n.Uint32="Uint32",n.Int32="Int32",n.Vector="Vector",n.Vector2Float="vec2<f32>",n.Vector3Float="vec3<f32>",n.Vector4Float="vec4<f32>",n.Vector2Boolean="vec2<bool>",n.Vector3Boolean="vec3<bool>",n.Vector4Boolean="vec4<bool>",n.Vector2Uint="vec2<u32>",n.Vector3Uint="vec3<u32>",n.Vector4Uint="vec4<u32>",n.Vector2Int="vec2<i32>",n.Vector3Int="vec3<i32>",n.Vector4Int="vec4<i32>",n.Matrix="Matrix",n.Matrix3x3Float="mat3x3<f32>",n.Matrix4x4Float="mat4x4<i32>",n.Struct="Struct",n.FloatArray="Float[]",n.Vector4FloatArray="vec4<f32>[]"})(rN||(rN={}));var _Ee;(function(n){n.Program="Program",n.Identifier="Identifier",n.VariableDeclaration="VariableDeclaration",n.BlockStatement="BlockStatement",n.ReturnStatement="ReturnStatement",n.FunctionDeclaration="FunctionDeclaration",n.VariableDeclarator="VariableDeclarator",n.AssignmentExpression="AssignmentExpression",n.LogicalExpression="LogicalExpression",n.BinaryExpression="BinaryExpression",n.ArrayExpression="ArrayExpression",n.UnaryExpression="UnaryExpression",n.UpdateExpression="UpdateExpression",n.FunctionExpression="FunctionExpression",n.MemberExpression="MemberExpression",n.ConditionalExpression="ConditionalExpression",n.ExpressionStatement="ExpressionStatement",n.CallExpression="CallExpression",n.NumThreadStatement="NumThreadStatement",n.StorageStatement="StorageStatement",n.DoWhileStatement="DoWhileStatement",n.WhileStatement="WhileStatement",n.ForStatement="ForStatement",n.BreakStatement="BreakStatement",n.ContinueStatement="ContinueStatement",n.IfStatement="IfStatement",n.ImportedFunctionStatement="ImportedFunctionStatement"})(_Ee||(_Ee={}));var zM;(function(n){n.Input="Input",n.Output="Output",n.Uniform="Uniform",n.Workgroup="Workgroup",n.UniformConstant="UniformConstant",n.Image="Image",n.StorageBuffer="StorageBuffer",n.Private="Private",n.Function="Function"})(zM||(zM={}));var wR;(function(n){n.GLSL100="GLSL100",n.GLSL450="GLSL450",n.WGSL="WGSL"})(wR||(wR={}));var ghr="__DefineValuePlaceholder__";function yhr(){if(typeof document<"u")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function xEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function SEe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xEe(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xEe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}var THe=function(){function n(e,t){z0(this,n),this.engine=e,this.configService=t,this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}return U0(n,[{key:"init",value:function(){var t=this.configService.get(),r=t.canvas,i=t.engineOptions;this.initPromise=this.engine.init(SEe({canvas:r||yhr(),antialiasing:!1},i))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,r){var i=this;if(typeof t=="string"){var a=chr(r)||$9(r)||dhr(r);if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find(function(l){return l.name===t});if(o)return o.value=r,this;var s=this.compiledBundle.context.uniforms.find(function(l){return l.name===t});s&&(a?(s.data=r,s.isReferer=!1,s.storageClass===zM.Uniform?this.model&&this.model.updateUniform(t,r):this.model&&this.model.updateBuffer(t,r)):(s.isReferer=!0,s.data=r))}}else Object.keys(t).forEach(function(l){i.setBinding(l,t[l])});return this}},{key:"execute",value:function(){var e=Vc(Rc.mark(function r(){var i=this,a,o,s=arguments;return Rc.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(a=s.length>0&&s[0]!==void 0?s[0]:1,!this.dirty){u.next=6;break}return this.compiledBundle.context&&(a>1?this.compiledBundle.context.maxIteration=a:this.compiledBundle.context.maxIteration++),u.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(h){var c=h.isReferer;return c}).forEach(function(h){var c=h.data,f=h.name;i.model.confirmInput(c.model,f)}),o=0;o<a;o++)this.model.run();return this.engine.endFrame(),u.abrupt("return",this);case 12:case"end":return u.stop()}},r,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"getOutput",value:function(){var e=Vc(Rc.mark(function r(){return Rc.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",this.model.readData());case 1:case"end":return a.stop()}},r,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"compile",value:function(){var e=Vc(Rc.mark(function r(){var i,a,o;return Rc.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,this.initPromise;case 2:return i=SEe({},this.compiledBundle.context),a=this.engine.supportWebGPU?this.engine.useWGSL?wR.WGSL:wR.GLSL450:wR.GLSL100,o=this.compiledBundle.shaders[a],i.defines.filter(function(u){return u.runtime}).forEach(function(u){var h="".concat(ghr).concat(u.name);o=o.replace(h,"".concat(u.value))}),i.shader=o,i.uniforms.forEach(function(u){if(!u.data&&u.storageClass===zM.StorageBuffer){var h=1;u.type===rN.FloatArray?h=1:u.type===rN.Vector4FloatArray&&(h=4),u.data=new Float32Array(i.output.length*h).fill(0)}}),this.compiledBundle.context=i,l.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=l.sent;case 12:case"end":return l.stop()}},r,this)}));function t(){return e.apply(this,arguments)}return t}()}]),n}(),CHe={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(at,function(){var t=function(K){return K instanceof Uint8Array||K instanceof Uint16Array||K instanceof Uint32Array||K instanceof Int8Array||K instanceof Int16Array||K instanceof Int32Array||K instanceof Float32Array||K instanceof Float64Array||K instanceof Uint8ClampedArray},r=function(K,ge){for(var Pe=Object.keys(ge),ct=0;ct<Pe.length;++ct)K[Pe[ct]]=ge[Pe[ct]];return K},i=`
`;function a(K){return typeof atob<"u"?atob(K):"base64:"+K}function o(K){var ge=new Error("(regl) "+K);throw console.error(ge),ge}function s(K,ge){K||o(ge)}function l(K){return K?": "+K:""}function u(K,ge,Pe){K in ge||o("unknown parameter ("+K+")"+l(Pe)+". possible values: "+Object.keys(ge).join())}function h(K,ge){t(K)||o("invalid parameter type"+l(ge)+". must be a typed array")}function c(K,ge){switch(ge){case"number":return typeof K=="number";case"object":return typeof K=="object";case"string":return typeof K=="string";case"boolean":return typeof K=="boolean";case"function":return typeof K=="function";case"undefined":return typeof K>"u";case"symbol":return typeof K=="symbol"}}function f(K,ge,Pe){c(K,ge)||o("invalid parameter type"+l(Pe)+". expected "+ge+", got "+typeof K)}function d(K,ge){K>=0&&(K|0)===K||o("invalid parameter type, ("+K+")"+l(ge)+". must be a nonnegative integer")}function v(K,ge,Pe){ge.indexOf(K)<0&&o("invalid value"+l(Pe)+". must be one of: "+ge)}var p=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function g(K){Object.keys(K).forEach(function(ge){p.indexOf(ge)<0&&o('invalid regl constructor argument "'+ge+'". must be one of '+p)})}function m(K,ge){for(K=K+"";K.length<ge;)K=" "+K;return K}function y(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function _(K,ge){this.number=K,this.line=ge,this.errors=[]}function x(K,ge,Pe){this.file=K,this.line=ge,this.message=Pe}function S(){var K=new Error,ge=(K.stack||K).toString(),Pe=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(ge);if(Pe)return Pe[1];var ct=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(ge);return ct?ct[1]:"unknown"}function w(){var K=new Error,ge=(K.stack||K).toString(),Pe=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(ge);if(Pe)return Pe[1];var ct=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(ge);return ct?ct[1]:"unknown"}function b(K,ge){var Pe=K.split(`
`),ct=1,Ot=0,lt={unknown:new y,0:new y};lt.unknown.name=lt[0].name=ge||S(),lt.unknown.lines.push(new _(0,""));for(var xt=0;xt<Pe.length;++xt){var Kt=Pe[xt],er=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Kt);if(er)switch(er[1]){case"line":var lr=/(\d+)(\s+\d+)?/.exec(er[2]);lr&&(ct=lr[1]|0,lr[2]&&(Ot=lr[2]|0,Ot in lt||(lt[Ot]=new y)));break;case"define":var tr=/SHADER_NAME(_B64)?\s+(.*)$/.exec(er[2]);tr&&(lt[Ot].name=tr[1]?a(tr[2]):tr[2]);break}lt[Ot].lines.push(new _(ct++,Kt))}return Object.keys(lt).forEach(function(dr){var Er=lt[dr];Er.lines.forEach(function(Jt){Er.index[Jt.number]=Jt})}),lt}function E(K){var ge=[];return K.split(`
`).forEach(function(Pe){if(!(Pe.length<5)){var ct=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Pe);ct?ge.push(new x(ct[1]|0,ct[2]|0,ct[3].trim())):Pe.length>0&&ge.push(new x("unknown",0,Pe))}}),ge}function T(K,ge){ge.forEach(function(Pe){var ct=K[Pe.file];if(ct){var Ot=ct.index[Pe.line];if(Ot){Ot.errors.push(Pe),ct.hasErrors=!0;return}}K.unknown.hasErrors=!0,K.unknown.lines[0].errors.push(Pe)})}function C(K,ge,Pe,ct,Ot){if(!K.getShaderParameter(ge,K.COMPILE_STATUS)){var lt=K.getShaderInfoLog(ge),xt=ct===K.FRAGMENT_SHADER?"fragment":"vertex";G(Pe,"string",xt+" shader source must be a string",Ot);var Kt=b(Pe,Ot),er=E(lt);T(Kt,er),Object.keys(Kt).forEach(function(lr){var tr=Kt[lr];if(!tr.hasErrors)return;var dr=[""],Er=[""];function Jt(pr,Ye){dr.push(pr),Er.push(Ye||"")}Jt("file number "+lr+": "+tr.name+`
`,"color:red;text-decoration:underline;font-weight:bold"),tr.lines.forEach(function(pr){if(pr.errors.length>0){Jt(m(pr.number,4)+"| ","background-color:yellow; font-weight:bold"),Jt(pr.line+i,"color:red; background-color:yellow; font-weight:bold");var Ye=0;pr.errors.forEach(function(St){var or=St.message,Mr=/^\s*'(.*)'\s*:\s*(.*)$/.exec(or);if(Mr){var Wt=Mr[1];switch(or=Mr[2],Wt){case"assign":Wt="=";break}Ye=Math.max(pr.line.indexOf(Wt,Ye),0)}else Ye=0;Jt(m("| ",6)),Jt(m("^^^",Ye+3)+i,"font-weight:bold"),Jt(m("| ",6)),Jt(or+i,"font-weight:bold")}),Jt(m("| ",6)+i)}else Jt(m(pr.number,4)+"| "),Jt(pr.line+i,"color:red")}),typeof document<"u"&&!window.chrome?(Er[0]=dr.join("%c"),console.log.apply(console,Er)):console.log(dr.join(""))}),s.raise("Error compiling "+xt+" shader, "+Kt[0].name)}}function A(K,ge,Pe,ct,Ot){if(!K.getProgramParameter(ge,K.LINK_STATUS)){var lt=K.getProgramInfoLog(ge),xt=b(Pe,Ot),Kt=b(ct,Ot),er='Error linking program with vertex shader, "'+Kt[0].name+'", and fragment shader "'+xt[0].name+'"';typeof document<"u"?console.log("%c"+er+i+"%c"+lt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(er+i+lt),s.raise(er)}}function M(K){K._commandRef=S()}function I(K,ge,Pe,ct){M(K);function Ot(er){return er?ct.id(er):0}K._fragId=Ot(K.static.frag),K._vertId=Ot(K.static.vert);function lt(er,lr){Object.keys(lr).forEach(function(tr){er[ct.id(tr)]=!0})}var xt=K._uniformSet={};lt(xt,ge.static),lt(xt,ge.dynamic);var Kt=K._attributeSet={};lt(Kt,Pe.static),lt(Kt,Pe.dynamic),K._hasCount="count"in K.static||"count"in K.dynamic||"elements"in K.static||"elements"in K.dynamic}function R(K,ge){var Pe=w();o(K+" in command "+(ge||S())+(Pe==="unknown"?"":" called from "+Pe))}function k(K,ge,Pe){K||R(ge,Pe||S())}function D(K,ge,Pe,ct){K in ge||R("unknown parameter ("+K+")"+l(Pe)+". possible values: "+Object.keys(ge).join(),ct||S())}function G(K,ge,Pe,ct){c(K,ge)||R("invalid parameter type"+l(Pe)+". expected "+ge+", got "+typeof K,ct||S())}function W(K){K()}function z(K,ge,Pe){K.texture?v(K.texture._texture.internalformat,ge,"unsupported texture format for attachment"):v(K.renderbuffer._renderbuffer.format,Pe,"unsupported renderbuffer format for attachment")}var V=33071,q=9728,Y=9984,le=9985,j=9986,Q=9987,ie=5120,oe=5121,se=5122,me=5123,Ce=5124,Le=5125,re=5126,yt=32819,je=32820,st=33635,Nt=34042,Zt=36193,qe={};qe[ie]=qe[oe]=1,qe[se]=qe[me]=qe[Zt]=qe[st]=qe[yt]=qe[je]=2,qe[Ce]=qe[Le]=qe[re]=qe[Nt]=4;function ur(K,ge){return K===je||K===yt||K===st?2:K===Nt?4:qe[K]*ge}function Dt(K){return!(K&K-1)&&!!K}function ft(K,ge,Pe){var ct,Ot=ge.width,lt=ge.height,xt=ge.channels;s(Ot>0&&Ot<=Pe.maxTextureSize&&lt>0&&lt<=Pe.maxTextureSize,"invalid texture shape"),(K.wrapS!==V||K.wrapT!==V)&&s(Dt(Ot)&&Dt(lt),"incompatible wrap mode for texture, both width and height must be power of 2"),ge.mipmask===1?Ot!==1&&lt!==1&&s(K.minFilter!==Y&&K.minFilter!==j&&K.minFilter!==le&&K.minFilter!==Q,"min filter requires mipmap"):(s(Dt(Ot)&&Dt(lt),"texture must be a square power of 2 to support mipmapping"),s(ge.mipmask===(Ot<<1)-1,"missing or incomplete mipmap data")),ge.type===re&&(Pe.extensions.indexOf("oes_texture_float_linear")<0&&s(K.minFilter===q&&K.magFilter===q,"filter not supported, must enable oes_texture_float_linear"),s(!K.genMipmaps,"mipmap generation not supported with float textures"));var Kt=ge.images;for(ct=0;ct<16;++ct)if(Kt[ct]){var er=Ot>>ct,lr=lt>>ct;s(ge.mipmask&1<<ct,"missing mipmap data");var tr=Kt[ct];if(s(tr.width===er&&tr.height===lr,"invalid shape for mip images"),s(tr.format===ge.format&&tr.internalformat===ge.internalformat&&tr.type===ge.type,"incompatible type for mip image"),!tr.compressed)if(tr.data){var dr=Math.ceil(ur(tr.type,xt)*er/tr.unpackAlignment)*tr.unpackAlignment;s(tr.data.byteLength===dr*lr,"invalid data for image, buffer size is inconsistent with image format")}else tr.element||tr.copy}else K.genMipmaps||s((ge.mipmask&1<<ct)===0,"extra mipmap data");ge.compressed&&s(!K.genMipmaps,"mipmap generation for compressed images not supported")}function Oe(K,ge,Pe,ct){var Ot=K.width,lt=K.height,xt=K.channels;s(Ot>0&&Ot<=ct.maxTextureSize&&lt>0&&lt<=ct.maxTextureSize,"invalid texture shape"),s(Ot===lt,"cube map must be square"),s(ge.wrapS===V&&ge.wrapT===V,"wrap mode not supported by cube map");for(var Kt=0;Kt<Pe.length;++Kt){var er=Pe[Kt];s(er.width===Ot&&er.height===lt,"inconsistent cube map face shape"),ge.genMipmaps&&(s(!er.compressed,"can not generate mipmap for compressed textures"),s(er.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var lr=er.images,tr=0;tr<16;++tr){var dr=lr[tr];if(dr){var Er=Ot>>tr,Jt=lt>>tr;s(er.mipmask&1<<tr,"missing mipmap data"),s(dr.width===Er&&dr.height===Jt,"invalid shape for mip images"),s(dr.format===K.format&&dr.internalformat===K.internalformat&&dr.type===K.type,"incompatible type for mip image"),dr.compressed||(dr.data?s(dr.data.byteLength===Er*Jt*Math.max(ur(dr.type,xt),dr.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):dr.element||dr.copy)}}}}var J=r(s,{optional:W,raise:o,commandRaise:R,command:k,parameter:u,commandParameter:D,constructor:g,type:f,commandType:G,isTypedArray:h,nni:d,oneOf:v,shaderError:C,linkError:A,callSite:w,saveCommandRef:M,saveDrawInfo:I,framebufferFormat:z,guessCommand:S,texture2D:ft,textureCube:Oe}),We=0,Tt=0,Qe=5,zt=6;function mt(K,ge){this.id=We++,this.type=K,this.data=ge}function wt(K){return K.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function pt(K){if(K.length===0)return[];var ge=K.charAt(0),Pe=K.charAt(K.length-1);if(K.length>1&&ge===Pe&&(ge==='"'||ge==="'"))return['"'+wt(K.substr(1,K.length-2))+'"'];var ct=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(K);if(ct)return pt(K.substr(0,ct.index)).concat(pt(ct[1])).concat(pt(K.substr(ct.index+ct[0].length)));var Ot=K.split(".");if(Ot.length===1)return['"'+wt(K)+'"'];for(var lt=[],xt=0;xt<Ot.length;++xt)lt=lt.concat(pt(Ot[xt]));return lt}function ar(K){return"["+pt(K).join("][")+"]"}function kt(K,ge){return new mt(K,ar(ge+""))}function Dr(K){return typeof K=="function"&&!K._reglType||K instanceof mt}function Sr(K,ge){if(typeof K=="function")return new mt(Tt,K);if(typeof K=="number"||typeof K=="boolean")return new mt(Qe,K);if(Array.isArray(K))return new mt(zt,K.map((Pe,ct)=>Sr(Pe,ge+"["+ct+"]")));if(K instanceof mt)return K;J(!1,"invalid option type in uniform "+ge)}var jr={DynamicVariable:mt,define:kt,isDynamic:Dr,unbox:Sr,accessor:ar},pn={next:typeof requestAnimationFrame=="function"?function(K){return requestAnimationFrame(K)}:function(K){return setTimeout(K,16)},cancel:typeof cancelAnimationFrame=="function"?function(K){return cancelAnimationFrame(K)}:clearTimeout},Jn=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function Rn(){var K={"":0},ge=[""];return{id:function(Pe){var ct=K[Pe];return ct||(ct=K[Pe]=ge.length,ge.push(Pe),ct)},str:function(Pe){return ge[Pe]}}}function hi(K,ge,Pe){var ct=document.createElement("canvas");r(ct.style,{border:0,margin:0,padding:0,top:0,left:0}),K.appendChild(ct),K===document.body&&(ct.style.position="absolute",r(K.style,{margin:0,padding:0}));function Ot(){var Kt=window.innerWidth,er=window.innerHeight;if(K!==document.body){var lr=K.getBoundingClientRect();Kt=lr.right-lr.left,er=lr.bottom-lr.top}ct.width=Pe*Kt,ct.height=Pe*er,r(ct.style,{width:Kt+"px",height:er+"px"})}var lt;K!==document.body&&typeof ResizeObserver=="function"?(lt=new ResizeObserver(function(){setTimeout(Ot)}),lt.observe(K)):window.addEventListener("resize",Ot,!1);function xt(){lt?lt.disconnect():window.removeEventListener("resize",Ot),K.removeChild(ct)}return Ot(),{canvas:ct,onDestroy:xt}}function yn(K,ge){function Pe(ct){try{return K.getContext(ct,ge)}catch{return null}}return Pe("webgl")||Pe("experimental-webgl")||Pe("webgl-experimental")}function Oi(K){return typeof K.nodeName=="string"&&typeof K.appendChild=="function"&&typeof K.getBoundingClientRect=="function"}function oi(K){return typeof K.drawArrays=="function"||typeof K.drawElements=="function"}function Gi(K){return typeof K=="string"?K.split():(J(Array.isArray(K),"invalid extension array"),K)}function ws(K){return typeof K=="string"?(J(typeof document<"u","not supported outside of DOM"),document.querySelector(K)):K}function Sl(K){var ge=K||{},Pe,ct,Ot,lt,xt={},Kt=[],er=[],lr=typeof window>"u"?1:window.devicePixelRatio,tr=!1,dr=function(pr){pr&&J.raise(pr)},Er=function(){};if(typeof ge=="string"?(J(typeof document<"u","selector queries only supported in DOM enviroments"),Pe=document.querySelector(ge),J(Pe,"invalid query string for element")):typeof ge=="object"?Oi(ge)?Pe=ge:oi(ge)?(lt=ge,Ot=lt.canvas):(J.constructor(ge),"gl"in ge?lt=ge.gl:"canvas"in ge?Ot=ws(ge.canvas):"container"in ge&&(ct=ws(ge.container)),"attributes"in ge&&(xt=ge.attributes,J.type(xt,"object","invalid context attributes")),"extensions"in ge&&(Kt=Gi(ge.extensions)),"optionalExtensions"in ge&&(er=Gi(ge.optionalExtensions)),"onDone"in ge&&(J.type(ge.onDone,"function","invalid or missing onDone callback"),dr=ge.onDone),"profile"in ge&&(tr=!!ge.profile),"pixelRatio"in ge&&(lr=+ge.pixelRatio,J(lr>0,"invalid pixel ratio"))):J.raise("invalid arguments to regl"),Pe&&(Pe.nodeName.toLowerCase()==="canvas"?Ot=Pe:ct=Pe),!lt){if(!Ot){J(typeof document<"u","must manually specify webgl context outside of DOM environments");var Jt=hi(ct||document.body,dr,lr);if(!Jt)return null;Ot=Jt.canvas,Er=Jt.onDestroy}xt.premultipliedAlpha===void 0&&(xt.premultipliedAlpha=!0),lt=yn(Ot,xt)}return lt?{gl:lt,canvas:Ot,container:ct,extensions:Kt,optionalExtensions:er,pixelRatio:lr,profile:tr,onDone:dr,onDestroy:Er}:(Er(),dr("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function Os(K,ge){var Pe={};function ct(xt){J.type(xt,"string","extension name must be string");var Kt=xt.toLowerCase(),er;try{er=Pe[Kt]=K.getExtension(Kt)}catch{}return!!er}for(var Ot=0;Ot<ge.extensions.length;++Ot){var lt=ge.extensions[Ot];if(!ct(lt))return ge.onDestroy(),ge.onDone('"'+lt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return ge.optionalExtensions.forEach(ct),{extensions:Pe,restore:function(){Object.keys(Pe).forEach(function(xt){if(Pe[xt]&&!ct(xt))throw new Error("(regl): error restoring extension "+xt)})}}}function no(K,ge){for(var Pe=Array(K),ct=0;ct<K;++ct)Pe[ct]=ge(ct);return Pe}var vo=5120,No=5121,Jo=5122,Lo=5123,hs=5124,Rs=5125,Pn=5126;function mo(K){for(var ge=16;ge<=1<<28;ge*=16)if(K<=ge)return ge;return 0}function ue(K){var ge,Pe;return ge=(K>65535)<<4,K>>>=ge,Pe=(K>255)<<3,K>>>=Pe,ge|=Pe,Pe=(K>15)<<2,K>>>=Pe,ge|=Pe,Pe=(K>3)<<1,K>>>=Pe,ge|=Pe,ge|K>>1}function xe(){var K=no(8,function(){return[]});function ge(lt){var xt=mo(lt),Kt=K[ue(xt)>>2];return Kt.length>0?Kt.pop():new ArrayBuffer(xt)}function Pe(lt){K[ue(lt.byteLength)>>2].push(lt)}function ct(lt,xt){var Kt=null;switch(lt){case vo:Kt=new Int8Array(ge(xt),0,xt);break;case No:Kt=new Uint8Array(ge(xt),0,xt);break;case Jo:Kt=new Int16Array(ge(2*xt),0,xt);break;case Lo:Kt=new Uint16Array(ge(2*xt),0,xt);break;case hs:Kt=new Int32Array(ge(4*xt),0,xt);break;case Rs:Kt=new Uint32Array(ge(4*xt),0,xt);break;case Pn:Kt=new Float32Array(ge(4*xt),0,xt);break;default:return null}return Kt.length!==xt?Kt.subarray(0,xt):Kt}function Ot(lt){Pe(lt.buffer)}return{alloc:ge,free:Pe,allocType:ct,freeType:Ot}}var ce=xe();ce.zero=xe();var pe=3408,we=3410,Me=3411,nt=3412,It=3413,ot=3414,ht=3415,ut=33901,qt=33902,fr=3379,Wr=3386,gr=34921,Ar=36347,$n=36348,bi=35661,qa=35660,Qo=34930,Ds=36349,af=34076,mh=34024,Zl=7936,jd=7937,Nl=7938,ec=35724,js=34047,fg=36063,dg=34852,Xd=3553,Yd=34067,vg=34069,qf=33984,Zf=6408,pg=5126,Kf=5121,of=36160,X0=36053,Y0=36064,Kl=16384,sf=function(K,ge){var Pe=1;ge.ext_texture_filter_anisotropic&&(Pe=K.getParameter(js));var ct=1,Ot=1;ge.webgl_draw_buffers&&(ct=K.getParameter(dg),Ot=K.getParameter(fg));var lt=!!ge.oes_texture_float;if(lt){var xt=K.createTexture();K.bindTexture(Xd,xt),K.texImage2D(Xd,0,Zf,1,1,0,Zf,pg,null);var Kt=K.createFramebuffer();if(K.bindFramebuffer(of,Kt),K.framebufferTexture2D(of,Y0,Xd,xt,0),K.bindTexture(Xd,null),K.checkFramebufferStatus(of)!==X0)lt=!1;else{K.viewport(0,0,1,1),K.clearColor(1,0,0,1),K.clear(Kl);var er=ce.allocType(pg,4);K.readPixels(0,0,1,1,Zf,pg,er),K.getError()?lt=!1:(K.deleteFramebuffer(Kt),K.deleteTexture(xt),lt=er[0]===1),ce.freeType(er)}}var lr=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),tr=!0;if(!lr){var dr=K.createTexture(),Er=ce.allocType(Kf,36);K.activeTexture(qf),K.bindTexture(Yd,dr),K.texImage2D(vg,0,Zf,3,3,0,Zf,Kf,Er),ce.freeType(Er),K.bindTexture(Yd,null),K.deleteTexture(dr),tr=!K.getError()}return{colorBits:[K.getParameter(we),K.getParameter(Me),K.getParameter(nt),K.getParameter(It)],depthBits:K.getParameter(ot),stencilBits:K.getParameter(ht),subpixelBits:K.getParameter(pe),extensions:Object.keys(ge).filter(function(Jt){return!!ge[Jt]}),maxAnisotropic:Pe,maxDrawbuffers:ct,maxColorAttachments:Ot,pointSizeDims:K.getParameter(ut),lineWidthDims:K.getParameter(qt),maxViewportDims:K.getParameter(Wr),maxCombinedTextureUnits:K.getParameter(bi),maxCubeMapSize:K.getParameter(af),maxRenderbufferSize:K.getParameter(mh),maxTextureUnits:K.getParameter(Qo),maxTextureSize:K.getParameter(fr),maxAttributes:K.getParameter(gr),maxVertexUniforms:K.getParameter(Ar),maxVertexTextureUnits:K.getParameter(qa),maxVaryingVectors:K.getParameter($n),maxFragmentUniforms:K.getParameter(Ds),glsl:K.getParameter(ec),renderer:K.getParameter(jd),vendor:K.getParameter(Zl),version:K.getParameter(Nl),readFloat:lt,npotTextureCube:tr}};function mu(K){return!!K&&typeof K=="object"&&Array.isArray(K.shape)&&Array.isArray(K.stride)&&typeof K.offset=="number"&&K.shape.length===K.stride.length&&(Array.isArray(K.data)||t(K.data))}var bs=function(K){return Object.keys(K).map(function(ge){return K[ge]})},lf={shape:tc,flatten:q0};function gg(K,ge,Pe){for(var ct=0;ct<ge;++ct)Pe[ct]=K[ct]}function Wm(K,ge,Pe,ct){for(var Ot=0,lt=0;lt<ge;++lt)for(var xt=K[lt],Kt=0;Kt<Pe;++Kt)ct[Ot++]=xt[Kt]}function ho(K,ge,Pe,ct,Ot,lt){for(var xt=lt,Kt=0;Kt<ge;++Kt)for(var er=K[Kt],lr=0;lr<Pe;++lr)for(var tr=er[lr],dr=0;dr<ct;++dr)Ot[xt++]=tr[dr]}function Es(K,ge,Pe,ct,Ot){for(var lt=1,xt=Pe+1;xt<ge.length;++xt)lt*=ge[xt];var Kt=ge[Pe];if(ge.length-Pe===4){var er=ge[Pe+1],lr=ge[Pe+2],tr=ge[Pe+3];for(xt=0;xt<Kt;++xt)ho(K[xt],er,lr,tr,ct,Ot),Ot+=lt}else for(xt=0;xt<Kt;++xt)Es(K[xt],ge,Pe+1,ct,Ot),Ot+=lt}function q0(K,ge,Pe,ct){var Ot=1;if(ge.length)for(var lt=0;lt<ge.length;++lt)Ot*=ge[lt];else Ot=0;var xt=ct||ce.allocType(Pe,Ot);switch(ge.length){case 0:break;case 1:gg(K,ge[0],xt);break;case 2:Wm(K,ge[0],ge[1],xt);break;case 3:ho(K,ge[0],ge[1],ge[2],xt,0);break;default:Es(K,ge,0,xt,0)}return xt}function tc(K){for(var ge=[],Pe=K;Pe.length;Pe=Pe[0])ge.push(Pe.length);return ge}var Xs={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Hm=5120,zv=5122,bc=5124,yg=5121,uf=5123,Ec=5125,mg=5126,Uv=5126,_h={int8:Hm,int16:zv,int32:bc,uint8:yg,uint16:uf,uint32:Ec,float:mg,float32:Uv},Vv=35048,hf=35040,_u={dynamic:Vv,stream:hf,static:35044},$v=lf.flatten,_g=lf.shape,Te=35044,gt=35040,B=5121,O=5126,F=[];F[5120]=1,F[5122]=2,F[5124]=4,F[5121]=1,F[5123]=2,F[5125]=4,F[5126]=4;function N(K){return Xs[Object.prototype.toString.call(K)]|0}function U(K,ge){for(var Pe=0;Pe<ge.length;++Pe)K[Pe]=ge[Pe]}function X(K,ge,Pe,ct,Ot,lt,xt){for(var Kt=0,er=0;er<Pe;++er)for(var lr=0;lr<ct;++lr)K[Kt++]=ge[Ot*er+lt*lr+xt]}function Z(K,ge,Pe,ct){var Ot=0,lt={};function xt(Ye){this.id=Ot++,this.buffer=K.createBuffer(),this.type=Ye,this.usage=Te,this.byteLength=0,this.dimension=1,this.dtype=B,this.persistentData=null,Pe.profile&&(this.stats={size:0})}xt.prototype.bind=function(){K.bindBuffer(this.type,this.buffer)},xt.prototype.destroy=function(){Er(this)};var Kt=[];function er(Ye,St){var or=Kt.pop();return or||(or=new xt(Ye)),or.bind(),dr(or,St,gt,0,1,!1),or}function lr(Ye){Kt.push(Ye)}function tr(Ye,St,or){Ye.byteLength=St.byteLength,K.bufferData(Ye.type,St,or)}function dr(Ye,St,or,Mr,Wt,Nr){var Xt;if(Ye.usage=or,Array.isArray(St)){if(Ye.dtype=Mr||O,St.length>0){var yr;if(Array.isArray(St[0])){Xt=_g(St);for(var jt=1,mr=1;mr<Xt.length;++mr)jt*=Xt[mr];Ye.dimension=jt,yr=$v(St,Xt,Ye.dtype),tr(Ye,yr,or),Nr?Ye.persistentData=yr:ce.freeType(yr)}else if(typeof St[0]=="number"){Ye.dimension=Wt;var cn=ce.allocType(Ye.dtype,St.length);U(cn,St),tr(Ye,cn,or),Nr?Ye.persistentData=cn:ce.freeType(cn)}else t(St[0])?(Ye.dimension=St[0].length,Ye.dtype=Mr||N(St[0])||O,yr=$v(St,[St.length,St[0].length],Ye.dtype),tr(Ye,yr,or),Nr?Ye.persistentData=yr:ce.freeType(yr)):J.raise("invalid buffer data")}}else if(t(St))Ye.dtype=Mr||N(St),Ye.dimension=Wt,tr(Ye,St,or),Nr&&(Ye.persistentData=new Uint8Array(new Uint8Array(St.buffer)));else if(mu(St)){Xt=St.shape;var Hn=St.stride,Tr=St.offset,hr=0,Ut=0,Nn=0,ci=0;Xt.length===1?(hr=Xt[0],Ut=1,Nn=Hn[0],ci=0):Xt.length===2?(hr=Xt[0],Ut=Xt[1],Nn=Hn[0],ci=Hn[1]):J.raise("invalid shape"),Ye.dtype=Mr||N(St.data)||O,Ye.dimension=Ut;var Ur=ce.allocType(Ye.dtype,hr*Ut);X(Ur,St.data,hr,Ut,Nn,ci,Tr),tr(Ye,Ur,or),Nr?Ye.persistentData=Ur:ce.freeType(Ur)}else St instanceof ArrayBuffer?(Ye.dtype=B,Ye.dimension=Wt,tr(Ye,St,or),Nr&&(Ye.persistentData=new Uint8Array(new Uint8Array(St)))):J.raise("invalid buffer data")}function Er(Ye){ge.bufferCount--,ct(Ye);var St=Ye.buffer;J(St,"buffer must not be deleted already"),K.deleteBuffer(St),Ye.buffer=null,delete lt[Ye.id]}function Jt(Ye,St,or,Mr){ge.bufferCount++;var Wt=new xt(St);lt[Wt.id]=Wt;function Nr(jt){var mr=Te,cn=null,Hn=0,Tr=0,hr=1;return Array.isArray(jt)||t(jt)||mu(jt)||jt instanceof ArrayBuffer?cn=jt:typeof jt=="number"?Hn=jt|0:jt&&(J.type(jt,"object","buffer arguments must be an object, a number or an array"),"data"in jt&&(J(cn===null||Array.isArray(cn)||t(cn)||mu(cn),"invalid data for buffer"),cn=jt.data),"usage"in jt&&(J.parameter(jt.usage,_u,"invalid buffer usage"),mr=_u[jt.usage]),"type"in jt&&(J.parameter(jt.type,_h,"invalid buffer type"),Tr=_h[jt.type]),"dimension"in jt&&(J.type(jt.dimension,"number","invalid dimension"),hr=jt.dimension|0),"length"in jt&&(J.nni(Hn,"buffer length must be a nonnegative integer"),Hn=jt.length|0)),Wt.bind(),cn?dr(Wt,cn,mr,Tr,hr,Mr):(Hn&&K.bufferData(Wt.type,Hn,mr),Wt.dtype=Tr||B,Wt.usage=mr,Wt.dimension=hr,Wt.byteLength=Hn),Pe.profile&&(Wt.stats.size=Wt.byteLength*F[Wt.dtype]),Nr}function Xt(jt,mr){J(mr+jt.byteLength<=Wt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+jt.byteLength+" starting from offset "+mr+" to a buffer of size "+Wt.byteLength),K.bufferSubData(Wt.type,mr,jt)}function yr(jt,mr){var cn=(mr||0)|0,Hn;if(Wt.bind(),t(jt)||jt instanceof ArrayBuffer)Xt(jt,cn);else if(Array.isArray(jt)){if(jt.length>0)if(typeof jt[0]=="number"){var Tr=ce.allocType(Wt.dtype,jt.length);U(Tr,jt),Xt(Tr,cn),ce.freeType(Tr)}else if(Array.isArray(jt[0])||t(jt[0])){Hn=_g(jt);var hr=$v(jt,Hn,Wt.dtype);Xt(hr,cn),ce.freeType(hr)}else J.raise("invalid buffer data")}else if(mu(jt)){Hn=jt.shape;var Ut=jt.stride,Nn=0,ci=0,Ur=0,Ei=0;Hn.length===1?(Nn=Hn[0],ci=1,Ur=Ut[0],Ei=0):Hn.length===2?(Nn=Hn[0],ci=Hn[1],Ur=Ut[0],Ei=Ut[1]):J.raise("invalid shape");var Xn=Array.isArray(jt.data)?Wt.dtype:N(jt.data),xi=ce.allocType(Xn,Nn*ci);X(xi,jt.data,Nn,ci,Ur,Ei,jt.offset),Xt(xi,cn),ce.freeType(xi)}else J.raise("invalid data for buffer subdata");return Nr}return or||Nr(Ye),Nr._reglType="buffer",Nr._buffer=Wt,Nr.subdata=yr,Pe.profile&&(Nr.stats=Wt.stats),Nr.destroy=function(){Er(Wt)},Nr}function pr(){bs(lt).forEach(function(Ye){Ye.buffer=K.createBuffer(),K.bindBuffer(Ye.type,Ye.buffer),K.bufferData(Ye.type,Ye.persistentData||Ye.byteLength,Ye.usage)})}return Pe.profile&&(ge.getTotalBufferSize=function(){var Ye=0;return Object.keys(lt).forEach(function(St){Ye+=lt[St].stats.size}),Ye}),{create:Jt,createStream:er,destroyStream:lr,clear:function(){bs(lt).forEach(Er),Kt.forEach(Er)},getBuffer:function(Ye){return Ye&&Ye._buffer instanceof xt?Ye._buffer:null},restore:pr,_initBuffer:dr}}var Ae=0,Re=0,Be=1,Je=1,Xe=4,_t=4,rt={points:Ae,point:Re,lines:Be,line:Je,triangles:Xe,triangle:_t,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ht=0,Yt=1,ne=4,ye=5120,Ue=5121,Bt=5122,$t=5123,ee=5124,Se=5125,Ze=34963,Ct=35040,vr=35044;function Cr(K,ge,Pe,ct){var Ot={},lt=0,xt={uint8:Ue,uint16:$t};ge.oes_element_index_uint&&(xt.uint32=Se);function Kt(pr){this.id=lt++,Ot[this.id]=this,this.buffer=pr,this.primType=ne,this.vertCount=0,this.type=0}Kt.prototype.bind=function(){this.buffer.bind()};var er=[];function lr(pr){var Ye=er.pop();return Ye||(Ye=new Kt(Pe.create(null,Ze,!0,!1)._buffer)),dr(Ye,pr,Ct,-1,-1,0,0),Ye}function tr(pr){er.push(pr)}function dr(pr,Ye,St,or,Mr,Wt,Nr){pr.buffer.bind();var Xt;if(Ye){var yr=Nr;!Nr&&(!t(Ye)||mu(Ye)&&!t(Ye.data))&&(yr=ge.oes_element_index_uint?Se:$t),Pe._initBuffer(pr.buffer,Ye,St,yr,3)}else K.bufferData(Ze,Wt,St),pr.buffer.dtype=Xt||Ue,pr.buffer.usage=St,pr.buffer.dimension=3,pr.buffer.byteLength=Wt;if(Xt=Nr,!Nr){switch(pr.buffer.dtype){case Ue:case ye:Xt=Ue;break;case $t:case Bt:Xt=$t;break;case Se:case ee:Xt=Se;break;default:J.raise("unsupported type for element array")}pr.buffer.dtype=Xt}pr.type=Xt,J(Xt!==Se||!!ge.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var jt=Mr;jt<0&&(jt=pr.buffer.byteLength,Xt===$t?jt>>=1:Xt===Se&&(jt>>=2)),pr.vertCount=jt;var mr=or;if(or<0){mr=ne;var cn=pr.buffer.dimension;cn===1&&(mr=Ht),cn===2&&(mr=Yt),cn===3&&(mr=ne)}pr.primType=mr}function Er(pr){ct.elementsCount--,J(pr.buffer!==null,"must not double destroy elements"),delete Ot[pr.id],pr.buffer.destroy(),pr.buffer=null}function Jt(pr,Ye){var St=Pe.create(null,Ze,!0),or=new Kt(St._buffer);ct.elementsCount++;function Mr(Wt){if(!Wt)St(),or.primType=ne,or.vertCount=0,or.type=Ue;else if(typeof Wt=="number")St(Wt),or.primType=ne,or.vertCount=Wt|0,or.type=Ue;else{var Nr=null,Xt=vr,yr=-1,jt=-1,mr=0,cn=0;Array.isArray(Wt)||t(Wt)||mu(Wt)?Nr=Wt:(J.type(Wt,"object","invalid arguments for elements"),"data"in Wt&&(Nr=Wt.data,J(Array.isArray(Nr)||t(Nr)||mu(Nr),"invalid data for element buffer")),"usage"in Wt&&(J.parameter(Wt.usage,_u,"invalid element buffer usage"),Xt=_u[Wt.usage]),"primitive"in Wt&&(J.parameter(Wt.primitive,rt,"invalid element buffer primitive"),yr=rt[Wt.primitive]),"count"in Wt&&(J(typeof Wt.count=="number"&&Wt.count>=0,"invalid vertex count for elements"),jt=Wt.count|0),"type"in Wt&&(J.parameter(Wt.type,xt,"invalid buffer type"),cn=xt[Wt.type]),"length"in Wt?mr=Wt.length|0:(mr=jt,cn===$t||cn===Bt?mr*=2:(cn===Se||cn===ee)&&(mr*=4))),dr(or,Nr,Xt,yr,jt,mr,cn)}return Mr}return Mr(pr),Mr._reglType="elements",Mr._elements=or,Mr.subdata=function(Wt,Nr){return St.subdata(Wt,Nr),Mr},Mr.destroy=function(){Er(or)},Mr}return{create:Jt,createStream:lr,destroyStream:tr,getElements:function(pr){return typeof pr=="function"&&pr._elements instanceof Kt?pr._elements:null},clear:function(){bs(Ot).forEach(Er)}}}var Jr=new Float32Array(1),nn=new Uint32Array(Jr.buffer),Dn=5123;function si(K){for(var ge=ce.allocType(Dn,K.length),Pe=0;Pe<K.length;++Pe)if(isNaN(K[Pe]))ge[Pe]=65535;else if(K[Pe]===1/0)ge[Pe]=31744;else if(K[Pe]===-1/0)ge[Pe]=64512;else{Jr[0]=K[Pe];var ct=nn[0],Ot=ct>>>31<<15,lt=(ct<<1>>>24)-127,xt=ct>>13&(1<<10)-1;if(lt<-24)ge[Pe]=Ot;else if(lt<-14){var Kt=-14-lt;ge[Pe]=Ot+(xt+(1<<10)>>Kt)}else lt>15?ge[Pe]=Ot+31744:ge[Pe]=Ot+(lt+15<<10)+xt}return ge}function An(K){return Array.isArray(K)||t(K)}var qi=function(K){return!(K&K-1)&&!!K},_o=34467,cs=3553,wl=34067,xu=34069,fa=6408,Ft=6406,nr=6407,Wn=6409,Zi=6410,Ts=32854,ko=32855,Fo=36194,Su=32819,Jf=32820,xg=33635,sF=34042,Y$=6402,lF=34041,q$=35904,Z$=35906,CT=36193,K$=33776,J$=33777,Q$=33778,eW=33779,Zce=35986,Kce=35987,Jce=34798,Qce=35840,efe=35841,tfe=35842,rfe=35843,nfe=36196,AT=5121,tW=5123,rW=5125,ML=5126,WQe=10242,HQe=10243,jQe=10497,nW=33071,XQe=33648,YQe=10240,qQe=10241,iW=9728,ZQe=9729,aW=9984,ife=9985,afe=9986,oW=9987,KQe=33170,uF=4352,JQe=4353,QQe=4354,eet=34046,tet=3317,ret=37440,net=37441,iet=37443,ofe=37444,IL=33984,aet=[aW,afe,ife,oW],hF=[0,Wn,Zi,nr,fa],Wv={};Wv[Wn]=Wv[Ft]=Wv[Y$]=1,Wv[lF]=Wv[Zi]=2,Wv[nr]=Wv[q$]=3,Wv[fa]=Wv[Z$]=4;function MT(K){return"[object "+K+"]"}var sfe=MT("HTMLCanvasElement"),lfe=MT("OffscreenCanvas"),ufe=MT("CanvasRenderingContext2D"),hfe=MT("ImageBitmap"),cfe=MT("HTMLImageElement"),ffe=MT("HTMLVideoElement"),oet=Object.keys(Xs).concat([sfe,lfe,ufe,hfe,cfe,ffe]),IT=[];IT[AT]=1,IT[ML]=4,IT[CT]=2,IT[tW]=2,IT[rW]=4;var xh=[];xh[Ts]=2,xh[ko]=2,xh[Fo]=2,xh[lF]=4,xh[K$]=.5,xh[J$]=.5,xh[Q$]=1,xh[eW]=1,xh[Zce]=.5,xh[Kce]=1,xh[Jce]=1,xh[Qce]=.5,xh[efe]=.25,xh[tfe]=.5,xh[rfe]=.25,xh[nfe]=.5;function dfe(K){return Array.isArray(K)&&(K.length===0||typeof K[0]=="number")}function vfe(K){if(!Array.isArray(K))return!1;var ge=K.length;return!(ge===0||!An(K[0]))}function Nw(K){return Object.prototype.toString.call(K)}function pfe(K){return Nw(K)===sfe}function gfe(K){return Nw(K)===lfe}function set(K){return Nw(K)===ufe}function uet(K){return Nw(K)===hfe}function het(K){return Nw(K)===cfe}function cet(K){return Nw(K)===ffe}function sW(K){if(!K)return!1;var ge=Nw(K);return oet.indexOf(ge)>=0?!0:dfe(K)||vfe(K)||mu(K)}function yfe(K){return Xs[Object.prototype.toString.call(K)]|0}function fet(K,ge){var Pe=ge.length;switch(K.type){case AT:case tW:case rW:case ML:var ct=ce.allocType(K.type,Pe);ct.set(ge),K.data=ct;break;case CT:K.data=si(ge);break;default:J.raise("unsupported texture type, must specify a typed array")}}function mfe(K,ge){return ce.allocType(K.type===CT?ML:K.type,ge)}function _fe(K,ge){K.type===CT?(K.data=si(ge),ce.freeType(ge)):K.data=ge}function det(K,ge,Pe,ct,Ot,lt){for(var xt=K.width,Kt=K.height,er=K.channels,lr=xt*Kt*er,tr=mfe(K,lr),dr=0,Er=0;Er<Kt;++Er)for(var Jt=0;Jt<xt;++Jt)for(var pr=0;pr<er;++pr)tr[dr++]=ge[Pe*Jt+ct*Er+Ot*pr+lt];_fe(K,tr)}function cF(K,ge,Pe,ct,Ot,lt){var xt;if(typeof xh[K]<"u"?xt=xh[K]:xt=Wv[K]*IT[ge],lt&&(xt*=6),Ot){for(var Kt=0,er=Pe;er>=1;)Kt+=xt*er*er,er/=2;return Kt}else return xt*Pe*ct}function vet(K,ge,Pe,ct,Ot,lt,xt){var Kt={"don't care":uF,"dont care":uF,nice:QQe,fast:JQe},er={repeat:jQe,clamp:nW,mirror:XQe},lr={nearest:iW,linear:ZQe},tr=r({mipmap:oW,"nearest mipmap nearest":aW,"linear mipmap nearest":ife,"nearest mipmap linear":afe,"linear mipmap linear":oW},lr),dr={none:0,browser:ofe},Er={uint8:AT,rgba4:Su,rgb565:xg,"rgb5 a1":Jf},Jt={alpha:Ft,luminance:Wn,"luminance alpha":Zi,rgb:nr,rgba:fa,rgba4:Ts,"rgb5 a1":ko,rgb565:Fo},pr={};ge.ext_srgb&&(Jt.srgb=q$,Jt.srgba=Z$),ge.oes_texture_float&&(Er.float32=Er.float=ML),ge.oes_texture_half_float&&(Er.float16=Er["half float"]=CT),ge.webgl_depth_texture&&(r(Jt,{depth:Y$,"depth stencil":lF}),r(Er,{uint16:tW,uint32:rW,"depth stencil":sF})),ge.webgl_compressed_texture_s3tc&&r(pr,{"rgb s3tc dxt1":K$,"rgba s3tc dxt1":J$,"rgba s3tc dxt3":Q$,"rgba s3tc dxt5":eW}),ge.webgl_compressed_texture_atc&&r(pr,{"rgb atc":Zce,"rgba atc explicit alpha":Kce,"rgba atc interpolated alpha":Jce}),ge.webgl_compressed_texture_pvrtc&&r(pr,{"rgb pvrtc 4bppv1":Qce,"rgb pvrtc 2bppv1":efe,"rgba pvrtc 4bppv1":tfe,"rgba pvrtc 2bppv1":rfe}),ge.webgl_compressed_texture_etc1&&(pr["rgb etc1"]=nfe);var Ye=Array.prototype.slice.call(K.getParameter(_o));Object.keys(pr).forEach(function(Ie){var vt=pr[Ie];Ye.indexOf(vt)>=0&&(Jt[Ie]=vt)});var St=Object.keys(Jt);Pe.textureFormats=St;var or=[];Object.keys(Jt).forEach(function(Ie){var vt=Jt[Ie];or[vt]=Ie});var Mr=[];Object.keys(Er).forEach(function(Ie){var vt=Er[Ie];Mr[vt]=Ie});var Wt=[];Object.keys(lr).forEach(function(Ie){var vt=lr[Ie];Wt[vt]=Ie});var Nr=[];Object.keys(tr).forEach(function(Ie){var vt=tr[Ie];Nr[vt]=Ie});var Xt=[];Object.keys(er).forEach(function(Ie){var vt=er[Ie];Xt[vt]=Ie});var yr=St.reduce(function(Ie,vt){var it=Jt[vt];return it===Wn||it===Ft||it===Wn||it===Zi||it===Y$||it===lF||ge.ext_srgb&&(it===q$||it===Z$)?Ie[it]=it:it===ko||vt.indexOf("rgba")>=0?Ie[it]=fa:Ie[it]=nr,Ie},{});function jt(){this.internalformat=fa,this.format=fa,this.type=AT,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ofe,this.width=0,this.height=0,this.channels=0}function mr(Ie,vt){Ie.internalformat=vt.internalformat,Ie.format=vt.format,Ie.type=vt.type,Ie.compressed=vt.compressed,Ie.premultiplyAlpha=vt.premultiplyAlpha,Ie.flipY=vt.flipY,Ie.unpackAlignment=vt.unpackAlignment,Ie.colorSpace=vt.colorSpace,Ie.width=vt.width,Ie.height=vt.height,Ie.channels=vt.channels}function cn(Ie,vt){if(!(typeof vt!="object"||!vt)){if("premultiplyAlpha"in vt&&(J.type(vt.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ie.premultiplyAlpha=vt.premultiplyAlpha),"flipY"in vt&&(J.type(vt.flipY,"boolean","invalid texture flip"),Ie.flipY=vt.flipY),"alignment"in vt&&(J.oneOf(vt.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ie.unpackAlignment=vt.alignment),"colorSpace"in vt&&(J.parameter(vt.colorSpace,dr,"invalid colorSpace"),Ie.colorSpace=dr[vt.colorSpace]),"type"in vt){var it=vt.type;J(ge.oes_texture_float||!(it==="float"||it==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),J(ge.oes_texture_half_float||!(it==="half float"||it==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),J(ge.webgl_depth_texture||!(it==="uint16"||it==="uint32"||it==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),J.parameter(it,Er,"invalid texture type"),Ie.type=Er[it]}var Br=Ie.width,Ti=Ie.height,be=Ie.channels,de=!1;"shape"in vt?(J(Array.isArray(vt.shape)&&vt.shape.length>=2,"shape must be an array"),Br=vt.shape[0],Ti=vt.shape[1],vt.shape.length===3&&(be=vt.shape[2],J(be>0&&be<=4,"invalid number of channels"),de=!0),J(Br>=0&&Br<=Pe.maxTextureSize,"invalid width"),J(Ti>=0&&Ti<=Pe.maxTextureSize,"invalid height")):("radius"in vt&&(Br=Ti=vt.radius,J(Br>=0&&Br<=Pe.maxTextureSize,"invalid radius")),"width"in vt&&(Br=vt.width,J(Br>=0&&Br<=Pe.maxTextureSize,"invalid width")),"height"in vt&&(Ti=vt.height,J(Ti>=0&&Ti<=Pe.maxTextureSize,"invalid height")),"channels"in vt&&(be=vt.channels,J(be>0&&be<=4,"invalid number of channels"),de=!0)),Ie.width=Br|0,Ie.height=Ti|0,Ie.channels=be|0;var Ne=!1;if("format"in vt){var He=vt.format;J(ge.webgl_depth_texture||!(He==="depth"||He==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),J.parameter(He,Jt,"invalid texture format");var Ke=Ie.internalformat=Jt[He];Ie.format=yr[Ke],He in Er&&("type"in vt||(Ie.type=Er[He])),He in pr&&(Ie.compressed=!0),Ne=!0}!de&&Ne?Ie.channels=Wv[Ie.format]:de&&!Ne?Ie.channels!==hF[Ie.format]&&(Ie.format=Ie.internalformat=hF[Ie.channels]):Ne&&de&&J(Ie.channels===Wv[Ie.format],"number of channels inconsistent with specified format")}}function Hn(Ie){K.pixelStorei(ret,Ie.flipY),K.pixelStorei(net,Ie.premultiplyAlpha),K.pixelStorei(iet,Ie.colorSpace),K.pixelStorei(tet,Ie.unpackAlignment)}function Tr(){jt.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function hr(Ie,vt){var it=null;if(sW(vt)?it=vt:vt&&(J.type(vt,"object","invalid pixel data type"),cn(Ie,vt),"x"in vt&&(Ie.xOffset=vt.x|0),"y"in vt&&(Ie.yOffset=vt.y|0),sW(vt.data)&&(it=vt.data)),J(!Ie.compressed||it instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),vt.copy){J(!it,"can not specify copy and data field for the same texture");var Br=Ot.viewportWidth,Ti=Ot.viewportHeight;Ie.width=Ie.width||Br-Ie.xOffset,Ie.height=Ie.height||Ti-Ie.yOffset,Ie.needsCopy=!0,J(Ie.xOffset>=0&&Ie.xOffset<Br&&Ie.yOffset>=0&&Ie.yOffset<Ti&&Ie.width>0&&Ie.width<=Br&&Ie.height>0&&Ie.height<=Ti,"copy texture read out of bounds")}else if(!it)Ie.width=Ie.width||1,Ie.height=Ie.height||1,Ie.channels=Ie.channels||4;else if(t(it))Ie.channels=Ie.channels||4,Ie.data=it,!("type"in vt)&&Ie.type===AT&&(Ie.type=yfe(it));else if(dfe(it))Ie.channels=Ie.channels||4,fet(Ie,it),Ie.alignment=1,Ie.needsFree=!0;else if(mu(it)){var be=it.data;!Array.isArray(be)&&Ie.type===AT&&(Ie.type=yfe(be));var de=it.shape,Ne=it.stride,He,Ke,Ge,Fe,ze,Ee;de.length===3?(Ge=de[2],Ee=Ne[2]):(J(de.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Ge=1,Ee=1),He=de[0],Ke=de[1],Fe=Ne[0],ze=Ne[1],Ie.alignment=1,Ie.width=He,Ie.height=Ke,Ie.channels=Ge,Ie.format=Ie.internalformat=hF[Ge],Ie.needsFree=!0,det(Ie,be,Fe,ze,Ee,it.offset)}else if(pfe(it)||gfe(it)||set(it))pfe(it)||gfe(it)?Ie.element=it:Ie.element=it.canvas,Ie.width=Ie.element.width,Ie.height=Ie.element.height,Ie.channels=4;else if(uet(it))Ie.element=it,Ie.width=it.width,Ie.height=it.height,Ie.channels=4;else if(het(it))Ie.element=it,Ie.width=it.naturalWidth,Ie.height=it.naturalHeight,Ie.channels=4;else if(cet(it))Ie.element=it,Ie.width=it.videoWidth,Ie.height=it.videoHeight,Ie.channels=4;else if(vfe(it)){var De=Ie.width||it[0].length,_e=Ie.height||it.length,Ve=Ie.channels;An(it[0][0])?Ve=Ve||it[0][0].length:Ve=Ve||1;for(var et=lf.shape(it),Lt=1,Rt=0;Rt<et.length;++Rt)Lt*=et[Rt];var bt=mfe(Ie,Lt);lf.flatten(it,et,"",bt),_fe(Ie,bt),Ie.alignment=1,Ie.width=De,Ie.height=_e,Ie.channels=Ve,Ie.format=Ie.internalformat=hF[Ve],Ie.needsFree=!0}Ie.type===ML?J(Pe.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Ie.type===CT&&J(Pe.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Ut(Ie,vt,it){var Br=Ie.element,Ti=Ie.data,be=Ie.internalformat,de=Ie.format,Ne=Ie.type,He=Ie.width,Ke=Ie.height;Hn(Ie),Br?K.texImage2D(vt,it,de,de,Ne,Br):Ie.compressed?K.compressedTexImage2D(vt,it,be,He,Ke,0,Ti):Ie.needsCopy?(ct(),K.copyTexImage2D(vt,it,de,Ie.xOffset,Ie.yOffset,He,Ke,0)):K.texImage2D(vt,it,de,He,Ke,0,de,Ne,Ti||null)}function Nn(Ie,vt,it,Br,Ti){var be=Ie.element,de=Ie.data,Ne=Ie.internalformat,He=Ie.format,Ke=Ie.type,Ge=Ie.width,Fe=Ie.height;Hn(Ie),be?K.texSubImage2D(vt,Ti,it,Br,He,Ke,be):Ie.compressed?K.compressedTexSubImage2D(vt,Ti,it,Br,Ne,Ge,Fe,de):Ie.needsCopy?(ct(),K.copyTexSubImage2D(vt,Ti,it,Br,Ie.xOffset,Ie.yOffset,Ge,Fe)):K.texSubImage2D(vt,Ti,it,Br,Ge,Fe,He,Ke,de)}var ci=[];function Ur(){return ci.pop()||new Tr}function Ei(Ie){Ie.needsFree&&ce.freeType(Ie.data),Tr.call(Ie),ci.push(Ie)}function Xn(){jt.call(this),this.genMipmaps=!1,this.mipmapHint=uF,this.mipmask=0,this.images=Array(16)}function xi(Ie,vt,it){var Br=Ie.images[0]=Ur();Ie.mipmask=1,Br.width=Ie.width=vt,Br.height=Ie.height=it,Br.channels=Ie.channels=4}function Wa(Ie,vt){var it=null;if(sW(vt))it=Ie.images[0]=Ur(),mr(it,Ie),hr(it,vt),Ie.mipmask=1;else if(cn(Ie,vt),Array.isArray(vt.mipmap))for(var Br=vt.mipmap,Ti=0;Ti<Br.length;++Ti)it=Ie.images[Ti]=Ur(),mr(it,Ie),it.width>>=Ti,it.height>>=Ti,hr(it,Br[Ti]),Ie.mipmask|=1<<Ti;else it=Ie.images[0]=Ur(),mr(it,Ie),hr(it,vt),Ie.mipmask=1;mr(Ie,Ie.images[0]),Ie.compressed&&(Ie.internalformat===K$||Ie.internalformat===J$||Ie.internalformat===Q$||Ie.internalformat===eW)&&J(Ie.width%4===0&&Ie.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function Fl(Ie,vt){for(var it=Ie.images,Br=0;Br<it.length;++Br){if(!it[Br])return;Ut(it[Br],vt,Br)}}var wu=[];function Ri(){var Ie=wu.pop()||new Xn;jt.call(Ie),Ie.mipmask=0;for(var vt=0;vt<16;++vt)Ie.images[vt]=null;return Ie}function Jl(Ie){for(var vt=Ie.images,it=0;it<vt.length;++it)vt[it]&&Ei(vt[it]),vt[it]=null;wu.push(Ie)}function fs(){this.minFilter=iW,this.magFilter=iW,this.wrapS=nW,this.wrapT=nW,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=uF}function Bl(Ie,vt){if("min"in vt){var it=vt.min;J.parameter(it,tr),Ie.minFilter=tr[it],aet.indexOf(Ie.minFilter)>=0&&!("faces"in vt)&&(Ie.genMipmaps=!0)}if("mag"in vt){var Br=vt.mag;J.parameter(Br,lr),Ie.magFilter=lr[Br]}var Ti=Ie.wrapS,be=Ie.wrapT;if("wrap"in vt){var de=vt.wrap;typeof de=="string"?(J.parameter(de,er),Ti=be=er[de]):Array.isArray(de)&&(J.parameter(de[0],er),J.parameter(de[1],er),Ti=er[de[0]],be=er[de[1]])}else{if("wrapS"in vt){var Ne=vt.wrapS;J.parameter(Ne,er),Ti=er[Ne]}if("wrapT"in vt){var He=vt.wrapT;J.parameter(He,er),be=er[He]}}if(Ie.wrapS=Ti,Ie.wrapT=be,"anisotropic"in vt){var Ke=vt.anisotropic;J(typeof Ke=="number"&&Ke>=1&&Ke<=Pe.maxAnisotropic,"aniso samples must be between 1 and "),Ie.anisotropic=vt.anisotropic}if("mipmap"in vt){var Ge=!1;switch(typeof vt.mipmap){case"string":J.parameter(vt.mipmap,Kt,"invalid mipmap hint"),Ie.mipmapHint=Kt[vt.mipmap],Ie.genMipmaps=!0,Ge=!0;break;case"boolean":Ge=Ie.genMipmaps=vt.mipmap;break;case"object":J(Array.isArray(vt.mipmap),"invalid mipmap type"),Ie.genMipmaps=!1,Ge=!0;break;default:J.raise("invalid mipmap type")}Ge&&!("min"in vt)&&(Ie.minFilter=aW)}}function Ql(Ie,vt){K.texParameteri(vt,qQe,Ie.minFilter),K.texParameteri(vt,YQe,Ie.magFilter),K.texParameteri(vt,WQe,Ie.wrapS),K.texParameteri(vt,HQe,Ie.wrapT),ge.ext_texture_filter_anisotropic&&K.texParameteri(vt,eet,Ie.anisotropic),Ie.genMipmaps&&(K.hint(KQe,Ie.mipmapHint),K.generateMipmap(vt))}var eu=0,Xu={},Sh=Pe.maxTextureUnits,bl=Array(Sh).map(function(){return null});function fi(Ie){jt.call(this),this.mipmask=0,this.internalformat=fa,this.id=eu++,this.refCount=1,this.target=Ie,this.texture=K.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new fs,xt.profile&&(this.stats={size:0})}function wh(Ie){K.activeTexture(IL),K.bindTexture(Ie.target,Ie.texture)}function io(){var Ie=bl[0];Ie?K.bindTexture(Ie.target,Ie.texture):K.bindTexture(cs,null)}function bn(Ie){var vt=Ie.texture;J(vt,"must not double destroy texture");var it=Ie.unit,Br=Ie.target;it>=0&&(K.activeTexture(IL+it),K.bindTexture(Br,null),bl[it]=null),K.deleteTexture(vt),Ie.texture=null,Ie.params=null,Ie.pixels=null,Ie.refCount=0,delete Xu[Ie.id],lt.textureCount--}r(fi.prototype,{bind:function(){var Ie=this;Ie.bindCount+=1;var vt=Ie.unit;if(vt<0){for(var it=0;it<Sh;++it){var Br=bl[it];if(Br){if(Br.bindCount>0)continue;Br.unit=-1}bl[it]=Ie,vt=it;break}vt>=Sh&&J.raise("insufficient number of texture units"),xt.profile&&lt.maxTextureUnits<vt+1&&(lt.maxTextureUnits=vt+1),Ie.unit=vt,K.activeTexture(IL+vt),K.bindTexture(Ie.target,Ie.texture)}return vt},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&bn(this)}});function Mi(Ie,vt){var it=new fi(cs);Xu[it.id]=it,lt.textureCount++;function Br(de,Ne){var He=it.texInfo;fs.call(He);var Ke=Ri();return typeof de=="number"?typeof Ne=="number"?xi(Ke,de|0,Ne|0):xi(Ke,de|0,de|0):de?(J.type(de,"object","invalid arguments to regl.texture"),Bl(He,de),Wa(Ke,de)):xi(Ke,1,1),He.genMipmaps&&(Ke.mipmask=(Ke.width<<1)-1),it.mipmask=Ke.mipmask,mr(it,Ke),J.texture2D(He,Ke,Pe),it.internalformat=Ke.internalformat,Br.width=Ke.width,Br.height=Ke.height,wh(it),Fl(Ke,cs),Ql(He,cs),io(),Jl(Ke),xt.profile&&(it.stats.size=cF(it.internalformat,it.type,Ke.width,Ke.height,He.genMipmaps,!1)),Br.format=or[it.internalformat],Br.type=Mr[it.type],Br.mag=Wt[He.magFilter],Br.min=Nr[He.minFilter],Br.wrapS=Xt[He.wrapS],Br.wrapT=Xt[He.wrapT],Br}function Ti(de,Ne,He,Ke){J(!!de,"must specify image data");var Ge=Ne|0,Fe=He|0,ze=Ke|0,Ee=Ur();return mr(Ee,it),Ee.width=0,Ee.height=0,hr(Ee,de),Ee.width=Ee.width||(it.width>>ze)-Ge,Ee.height=Ee.height||(it.height>>ze)-Fe,J(it.type===Ee.type&&it.format===Ee.format&&it.internalformat===Ee.internalformat,"incompatible format for texture.subimage"),J(Ge>=0&&Fe>=0&&Ge+Ee.width<=it.width&&Fe+Ee.height<=it.height,"texture.subimage write out of bounds"),J(it.mipmask&1<<ze,"missing mipmap data"),J(Ee.data||Ee.element||Ee.needsCopy,"missing image data"),wh(it),Nn(Ee,cs,Ge,Fe,ze),io(),Ei(Ee),Br}function be(de,Ne){var He=de|0,Ke=Ne|0||He;if(He===it.width&&Ke===it.height)return Br;Br.width=it.width=He,Br.height=it.height=Ke,wh(it);for(var Ge=0;it.mipmask>>Ge;++Ge){var Fe=He>>Ge,ze=Ke>>Ge;if(!Fe||!ze)break;K.texImage2D(cs,Ge,it.format,Fe,ze,0,it.format,it.type,null)}return io(),xt.profile&&(it.stats.size=cF(it.internalformat,it.type,He,Ke,!1,!1)),Br}return Br(Ie,vt),Br.subimage=Ti,Br.resize=be,Br._reglType="texture2d",Br._texture=it,xt.profile&&(Br.stats=it.stats),Br.destroy=function(){it.decRef()},Br}function ia(Ie,vt,it,Br,Ti,be){var de=new fi(wl);Xu[de.id]=de,lt.cubeCount++;var Ne=new Array(6);function He(Fe,ze,Ee,De,_e,Ve){var et,Lt=de.texInfo;for(fs.call(Lt),et=0;et<6;++et)Ne[et]=Ri();if(typeof Fe=="number"||!Fe){var Rt=Fe|0||1;for(et=0;et<6;++et)xi(Ne[et],Rt,Rt)}else if(typeof Fe=="object")if(ze)Wa(Ne[0],Fe),Wa(Ne[1],ze),Wa(Ne[2],Ee),Wa(Ne[3],De),Wa(Ne[4],_e),Wa(Ne[5],Ve);else if(Bl(Lt,Fe),cn(de,Fe),"faces"in Fe){var bt=Fe.faces;for(J(Array.isArray(bt)&&bt.length===6,"cube faces must be a length 6 array"),et=0;et<6;++et)J(typeof bt[et]=="object"&&!!bt[et],"invalid input for cube map face"),mr(Ne[et],de),Wa(Ne[et],bt[et])}else for(et=0;et<6;++et)Wa(Ne[et],Fe);else J.raise("invalid arguments to cube map");for(mr(de,Ne[0]),Pe.npotTextureCube||J(qi(de.width)&&qi(de.height),"your browser does not support non power or two texture dimensions"),Lt.genMipmaps?de.mipmask=(Ne[0].width<<1)-1:de.mipmask=Ne[0].mipmask,J.textureCube(de,Lt,Ne,Pe),de.internalformat=Ne[0].internalformat,He.width=Ne[0].width,He.height=Ne[0].height,wh(de),et=0;et<6;++et)Fl(Ne[et],xu+et);for(Ql(Lt,wl),io(),xt.profile&&(de.stats.size=cF(de.internalformat,de.type,He.width,He.height,Lt.genMipmaps,!0)),He.format=or[de.internalformat],He.type=Mr[de.type],He.mag=Wt[Lt.magFilter],He.min=Nr[Lt.minFilter],He.wrapS=Xt[Lt.wrapS],He.wrapT=Xt[Lt.wrapT],et=0;et<6;++et)Jl(Ne[et]);return He}function Ke(Fe,ze,Ee,De,_e){J(!!ze,"must specify image data"),J(typeof Fe=="number"&&Fe===(Fe|0)&&Fe>=0&&Fe<6,"invalid face");var Ve=Ee|0,et=De|0,Lt=_e|0,Rt=Ur();return mr(Rt,de),Rt.width=0,Rt.height=0,hr(Rt,ze),Rt.width=Rt.width||(de.width>>Lt)-Ve,Rt.height=Rt.height||(de.height>>Lt)-et,J(de.type===Rt.type&&de.format===Rt.format&&de.internalformat===Rt.internalformat,"incompatible format for texture.subimage"),J(Ve>=0&&et>=0&&Ve+Rt.width<=de.width&&et+Rt.height<=de.height,"texture.subimage write out of bounds"),J(de.mipmask&1<<Lt,"missing mipmap data"),J(Rt.data||Rt.element||Rt.needsCopy,"missing image data"),wh(de),Nn(Rt,xu+Fe,Ve,et,Lt),io(),Ei(Rt),He}function Ge(Fe){var ze=Fe|0;if(ze!==de.width){He.width=de.width=ze,He.height=de.height=ze,wh(de);for(var Ee=0;Ee<6;++Ee)for(var De=0;de.mipmask>>De;++De)K.texImage2D(xu+Ee,De,de.format,ze>>De,ze>>De,0,de.format,de.type,null);return io(),xt.profile&&(de.stats.size=cF(de.internalformat,de.type,He.width,He.height,!1,!0)),He}}return He(Ie,vt,it,Br,Ti,be),He.subimage=Ke,He.resize=Ge,He._reglType="textureCube",He._texture=de,xt.profile&&(He.stats=de.stats),He.destroy=function(){de.decRef()},He}function El(){for(var Ie=0;Ie<Sh;++Ie)K.activeTexture(IL+Ie),K.bindTexture(cs,null),bl[Ie]=null;bs(Xu).forEach(bn),lt.cubeCount=0,lt.textureCount=0}xt.profile&&(lt.getTotalTextureSize=function(){var Ie=0;return Object.keys(Xu).forEach(function(vt){Ie+=Xu[vt].stats.size}),Ie});function K0(){for(var Ie=0;Ie<Sh;++Ie){var vt=bl[Ie];vt&&(vt.bindCount=0,vt.unit=-1,bl[Ie]=null)}bs(Xu).forEach(function(it){it.texture=K.createTexture(),K.bindTexture(it.target,it.texture);for(var Br=0;Br<32;++Br)if((it.mipmask&1<<Br)!==0)if(it.target===cs)K.texImage2D(cs,Br,it.internalformat,it.width>>Br,it.height>>Br,0,it.internalformat,it.type,null);else for(var Ti=0;Ti<6;++Ti)K.texImage2D(xu+Ti,Br,it.internalformat,it.width>>Br,it.height>>Br,0,it.internalformat,it.type,null);Ql(it.texInfo,it.target)})}function Vw(){for(var Ie=0;Ie<Sh;++Ie){var vt=bl[Ie];vt&&(vt.bindCount=0,vt.unit=-1,bl[Ie]=null),K.activeTexture(IL+Ie),K.bindTexture(cs,null),K.bindTexture(wl,null)}}return{create2D:Mi,createCube:ia,clear:El,getTexture:function(Ie){return null},restore:K0,refresh:Vw}}var K_=36161,fF=32854,xfe=32855,Sfe=36194,wfe=33189,bfe=36168,Efe=34041,Tfe=35907,Cfe=34836,Afe=34842,Mfe=34843,Sg=[];Sg[fF]=2,Sg[xfe]=2,Sg[Sfe]=2,Sg[wfe]=2,Sg[bfe]=1,Sg[Efe]=4,Sg[Tfe]=4,Sg[Cfe]=16,Sg[Afe]=8,Sg[Mfe]=6;function Ife(K,ge,Pe){return Sg[K]*ge*Pe}var pet=function(K,ge,Pe,ct,Ot){var lt={rgba4:fF,rgb565:Sfe,"rgb5 a1":xfe,depth:wfe,stencil:bfe,"depth stencil":Efe};ge.ext_srgb&&(lt.srgba=Tfe),ge.ext_color_buffer_half_float&&(lt.rgba16f=Afe,lt.rgb16f=Mfe),ge.webgl_color_buffer_float&&(lt.rgba32f=Cfe);var xt=[];Object.keys(lt).forEach(function(Jt){var pr=lt[Jt];xt[pr]=Jt});var Kt=0,er={};function lr(Jt){this.id=Kt++,this.refCount=1,this.renderbuffer=Jt,this.format=fF,this.width=0,this.height=0,Ot.profile&&(this.stats={size:0})}lr.prototype.decRef=function(){--this.refCount<=0&&tr(this)};function tr(Jt){var pr=Jt.renderbuffer;J(pr,"must not double destroy renderbuffer"),K.bindRenderbuffer(K_,null),K.deleteRenderbuffer(pr),Jt.renderbuffer=null,Jt.refCount=0,delete er[Jt.id],ct.renderbufferCount--}function dr(Jt,pr){var Ye=new lr(K.createRenderbuffer());er[Ye.id]=Ye,ct.renderbufferCount++;function St(Mr,Wt){var Nr=0,Xt=0,yr=fF;if(typeof Mr=="object"&&Mr){var jt=Mr;if("shape"in jt){var mr=jt.shape;J(Array.isArray(mr)&&mr.length>=2,"invalid renderbuffer shape"),Nr=mr[0]|0,Xt=mr[1]|0}else"radius"in jt&&(Nr=Xt=jt.radius|0),"width"in jt&&(Nr=jt.width|0),"height"in jt&&(Xt=jt.height|0);"format"in jt&&(J.parameter(jt.format,lt,"invalid renderbuffer format"),yr=lt[jt.format])}else typeof Mr=="number"?(Nr=Mr|0,typeof Wt=="number"?Xt=Wt|0:Xt=Nr):Mr?J.raise("invalid arguments to renderbuffer constructor"):Nr=Xt=1;if(J(Nr>0&&Xt>0&&Nr<=Pe.maxRenderbufferSize&&Xt<=Pe.maxRenderbufferSize,"invalid renderbuffer size"),!(Nr===Ye.width&&Xt===Ye.height&&yr===Ye.format))return St.width=Ye.width=Nr,St.height=Ye.height=Xt,Ye.format=yr,K.bindRenderbuffer(K_,Ye.renderbuffer),K.renderbufferStorage(K_,yr,Nr,Xt),J(K.getError()===0,"invalid render buffer format"),Ot.profile&&(Ye.stats.size=Ife(Ye.format,Ye.width,Ye.height)),St.format=xt[Ye.format],St}function or(Mr,Wt){var Nr=Mr|0,Xt=Wt|0||Nr;return Nr===Ye.width&&Xt===Ye.height||(J(Nr>0&&Xt>0&&Nr<=Pe.maxRenderbufferSize&&Xt<=Pe.maxRenderbufferSize,"invalid renderbuffer size"),St.width=Ye.width=Nr,St.height=Ye.height=Xt,K.bindRenderbuffer(K_,Ye.renderbuffer),K.renderbufferStorage(K_,Ye.format,Nr,Xt),J(K.getError()===0,"invalid render buffer format"),Ot.profile&&(Ye.stats.size=Ife(Ye.format,Ye.width,Ye.height))),St}return St(Jt,pr),St.resize=or,St._reglType="renderbuffer",St._renderbuffer=Ye,Ot.profile&&(St.stats=Ye.stats),St.destroy=function(){Ye.decRef()},St}Ot.profile&&(ct.getTotalRenderbufferSize=function(){var Jt=0;return Object.keys(er).forEach(function(pr){Jt+=er[pr].stats.size}),Jt});function Er(){bs(er).forEach(function(Jt){Jt.renderbuffer=K.createRenderbuffer(),K.bindRenderbuffer(K_,Jt.renderbuffer),K.renderbufferStorage(K_,Jt.format,Jt.width,Jt.height)}),K.bindRenderbuffer(K_,null)}return{create:dr,clear:function(){bs(er).forEach(tr)},restore:Er}},jm=36160,lW=36161,kw=3553,dF=34069,Lfe=36064,Pfe=36096,Ofe=36128,Rfe=33306,Dfe=36053,get=36054,yet=36055,met=36057,_et=36061,xet=36193,wet=5121,bet=5126,Nfe=6407,kfe=6408,Eet=6402,Tet=[Nfe,kfe],uW=[];uW[kfe]=4,uW[Nfe]=3;var vF=[];vF[wet]=1,vF[bet]=4,vF[xet]=2;var Cet=32854,Aet=32855,Met=36194,Iet=33189,Let=36168,Ffe=34041,Pet=35907,Oet=34836,Ret=34842,Det=34843,Net=[Cet,Aet,Met,Pet,Ret,Det,Oet],LT={};LT[Dfe]="complete",LT[get]="incomplete attachment",LT[met]="incomplete dimensions",LT[yet]="incomplete, missing attachment",LT[_et]="unsupported";function ket(K,ge,Pe,ct,Ot,lt){var xt={cur:null,next:null,dirty:!1,setFBO:null},Kt=["rgba"],er=["rgba4","rgb565","rgb5 a1"];ge.ext_srgb&&er.push("srgba"),ge.ext_color_buffer_half_float&&er.push("rgba16f","rgb16f"),ge.webgl_color_buffer_float&&er.push("rgba32f");var lr=["uint8"];ge.oes_texture_half_float&&lr.push("half float","float16"),ge.oes_texture_float&&lr.push("float","float32");function tr(Tr,hr,Ut){this.target=Tr,this.texture=hr,this.renderbuffer=Ut;var Nn=0,ci=0;hr?(Nn=hr.width,ci=hr.height):Ut&&(Nn=Ut.width,ci=Ut.height),this.width=Nn,this.height=ci}function dr(Tr){Tr&&(Tr.texture&&Tr.texture._texture.decRef(),Tr.renderbuffer&&Tr.renderbuffer._renderbuffer.decRef())}function Er(Tr,hr,Ut){if(!!Tr)if(Tr.texture){var Nn=Tr.texture._texture,ci=Math.max(1,Nn.width),Ur=Math.max(1,Nn.height);J(ci===hr&&Ur===Ut,"inconsistent width/height for supplied texture"),Nn.refCount+=1}else{var Ei=Tr.renderbuffer._renderbuffer;J(Ei.width===hr&&Ei.height===Ut,"inconsistent width/height for renderbuffer"),Ei.refCount+=1}}function Jt(Tr,hr){hr&&(hr.texture?K.framebufferTexture2D(jm,Tr,hr.target,hr.texture._texture.texture,0):K.framebufferRenderbuffer(jm,Tr,lW,hr.renderbuffer._renderbuffer.renderbuffer))}function pr(Tr){var hr=kw,Ut=null,Nn=null,ci=Tr;typeof Tr=="object"&&(ci=Tr.data,"target"in Tr&&(hr=Tr.target|0)),J.type(ci,"function","invalid attachment data");var Ur=ci._reglType;return Ur==="texture2d"?(Ut=ci,J(hr===kw)):Ur==="textureCube"?(Ut=ci,J(hr>=dF&&hr<dF+6,"invalid cube map target")):Ur==="renderbuffer"?(Nn=ci,hr=lW):J.raise("invalid regl object for attachment"),new tr(hr,Ut,Nn)}function Ye(Tr,hr,Ut,Nn,ci){if(Ut){var Ur=ct.create2D({width:Tr,height:hr,format:Nn,type:ci});return Ur._texture.refCount=0,new tr(kw,Ur,null)}else{var Ei=Ot.create({width:Tr,height:hr,format:Nn});return Ei._renderbuffer.refCount=0,new tr(lW,null,Ei)}}function St(Tr){return Tr&&(Tr.texture||Tr.renderbuffer)}function or(Tr,hr,Ut){Tr&&(Tr.texture?Tr.texture.resize(hr,Ut):Tr.renderbuffer&&Tr.renderbuffer.resize(hr,Ut),Tr.width=hr,Tr.height=Ut)}var Mr=0,Wt={};function Nr(){this.id=Mr++,Wt[this.id]=this,this.framebuffer=K.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Xt(Tr){Tr.colorAttachments.forEach(dr),dr(Tr.depthAttachment),dr(Tr.stencilAttachment),dr(Tr.depthStencilAttachment)}function yr(Tr){var hr=Tr.framebuffer;J(hr,"must not double destroy framebuffer"),K.deleteFramebuffer(hr),Tr.framebuffer=null,lt.framebufferCount--,delete Wt[Tr.id]}function jt(Tr){var hr;K.bindFramebuffer(jm,Tr.framebuffer);var Ut=Tr.colorAttachments;for(hr=0;hr<Ut.length;++hr)Jt(Lfe+hr,Ut[hr]);for(hr=Ut.length;hr<Pe.maxColorAttachments;++hr)K.framebufferTexture2D(jm,Lfe+hr,kw,null,0);K.framebufferTexture2D(jm,Rfe,kw,null,0),K.framebufferTexture2D(jm,Pfe,kw,null,0),K.framebufferTexture2D(jm,Ofe,kw,null,0),Jt(Pfe,Tr.depthAttachment),Jt(Ofe,Tr.stencilAttachment),Jt(Rfe,Tr.depthStencilAttachment);var Nn=K.checkFramebufferStatus(jm);!K.isContextLost()&&Nn!==Dfe&&J.raise("framebuffer configuration not supported, status = "+LT[Nn]),K.bindFramebuffer(jm,xt.next?xt.next.framebuffer:null),xt.cur=xt.next,K.getError()}function mr(Tr,hr){var Ut=new Nr;lt.framebufferCount++;function Nn(Ur,Ei){var Xn;J(xt.next!==Ut,"can not update framebuffer which is currently in use");var xi=0,Wa=0,Fl=!0,wu=!0,Ri=null,Jl=!0,fs="rgba",Bl="uint8",Ql=1,eu=null,Xu=null,Sh=null,bl=!1;if(typeof Ur=="number")xi=Ur|0,Wa=Ei|0||xi;else if(!Ur)xi=Wa=1;else{J.type(Ur,"object","invalid arguments for framebuffer");var fi=Ur;if("shape"in fi){var wh=fi.shape;J(Array.isArray(wh)&&wh.length>=2,"invalid shape for framebuffer"),xi=wh[0],Wa=wh[1]}else"radius"in fi&&(xi=Wa=fi.radius),"width"in fi&&(xi=fi.width),"height"in fi&&(Wa=fi.height);("color"in fi||"colors"in fi)&&(Ri=fi.color||fi.colors,Array.isArray(Ri)&&J(Ri.length===1||ge.webgl_draw_buffers,"multiple render targets not supported")),Ri||("colorCount"in fi&&(Ql=fi.colorCount|0,J(Ql>0,"invalid color buffer count")),"colorTexture"in fi&&(Jl=!!fi.colorTexture,fs="rgba4"),"colorType"in fi&&(Bl=fi.colorType,Jl?(J(ge.oes_texture_float||!(Bl==="float"||Bl==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),J(ge.oes_texture_half_float||!(Bl==="half float"||Bl==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):Bl==="half float"||Bl==="float16"?(J(ge.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),fs="rgba16f"):(Bl==="float"||Bl==="float32")&&(J(ge.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),fs="rgba32f"),J.oneOf(Bl,lr,"invalid color type")),"colorFormat"in fi&&(fs=fi.colorFormat,Kt.indexOf(fs)>=0?Jl=!0:er.indexOf(fs)>=0?Jl=!1:Jl?J.oneOf(fi.colorFormat,Kt,"invalid color format for texture"):J.oneOf(fi.colorFormat,er,"invalid color format for renderbuffer"))),("depthTexture"in fi||"depthStencilTexture"in fi)&&(bl=!!(fi.depthTexture||fi.depthStencilTexture),J(!bl||ge.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in fi&&(typeof fi.depth=="boolean"?Fl=fi.depth:(eu=fi.depth,wu=!1)),"stencil"in fi&&(typeof fi.stencil=="boolean"?wu=fi.stencil:(Xu=fi.stencil,Fl=!1)),"depthStencil"in fi&&(typeof fi.depthStencil=="boolean"?Fl=wu=fi.depthStencil:(Sh=fi.depthStencil,Fl=!1,wu=!1))}var io=null,bn=null,Mi=null,ia=null;if(Array.isArray(Ri))io=Ri.map(pr);else if(Ri)io=[pr(Ri)];else for(io=new Array(Ql),Xn=0;Xn<Ql;++Xn)io[Xn]=Ye(xi,Wa,Jl,fs,Bl);J(ge.webgl_draw_buffers||io.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),J(io.length<=Pe.maxColorAttachments,"too many color attachments, not supported"),xi=xi||io[0].width,Wa=Wa||io[0].height,eu?bn=pr(eu):Fl&&!wu&&(bn=Ye(xi,Wa,bl,"depth","uint32")),Xu?Mi=pr(Xu):wu&&!Fl&&(Mi=Ye(xi,Wa,!1,"stencil","uint8")),Sh?ia=pr(Sh):!eu&&!Xu&&wu&&Fl&&(ia=Ye(xi,Wa,bl,"depth stencil","depth stencil")),J(!!eu+!!Xu+!!Sh<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var El=null;for(Xn=0;Xn<io.length;++Xn)if(Er(io[Xn],xi,Wa),J(!io[Xn]||io[Xn].texture&&Tet.indexOf(io[Xn].texture._texture.format)>=0||io[Xn].renderbuffer&&Net.indexOf(io[Xn].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Xn+" is invalid"),io[Xn]&&io[Xn].texture){var K0=uW[io[Xn].texture._texture.format]*vF[io[Xn].texture._texture.type];El===null?El=K0:J(El===K0,"all color attachments much have the same number of bits per pixel.")}return Er(bn,xi,Wa),J(!bn||bn.texture&&bn.texture._texture.format===Eet||bn.renderbuffer&&bn.renderbuffer._renderbuffer.format===Iet,"invalid depth attachment for framebuffer object"),Er(Mi,xi,Wa),J(!Mi||Mi.renderbuffer&&Mi.renderbuffer._renderbuffer.format===Let,"invalid stencil attachment for framebuffer object"),Er(ia,xi,Wa),J(!ia||ia.texture&&ia.texture._texture.format===Ffe||ia.renderbuffer&&ia.renderbuffer._renderbuffer.format===Ffe,"invalid depth-stencil attachment for framebuffer object"),Xt(Ut),Ut.width=xi,Ut.height=Wa,Ut.colorAttachments=io,Ut.depthAttachment=bn,Ut.stencilAttachment=Mi,Ut.depthStencilAttachment=ia,Nn.color=io.map(St),Nn.depth=St(bn),Nn.stencil=St(Mi),Nn.depthStencil=St(ia),Nn.width=Ut.width,Nn.height=Ut.height,jt(Ut),Nn}function ci(Ur,Ei){J(xt.next!==Ut,"can not resize a framebuffer which is currently in use");var Xn=Math.max(Ur|0,1),xi=Math.max(Ei|0||Xn,1);if(Xn===Ut.width&&xi===Ut.height)return Nn;for(var Wa=Ut.colorAttachments,Fl=0;Fl<Wa.length;++Fl)or(Wa[Fl],Xn,xi);return or(Ut.depthAttachment,Xn,xi),or(Ut.stencilAttachment,Xn,xi),or(Ut.depthStencilAttachment,Xn,xi),Ut.width=Nn.width=Xn,Ut.height=Nn.height=xi,jt(Ut),Nn}return Nn(Tr,hr),r(Nn,{resize:ci,_reglType:"framebuffer",_framebuffer:Ut,destroy:function(){yr(Ut),Xt(Ut)},use:function(Ur){xt.setFBO({framebuffer:Nn},Ur)}})}function cn(Tr){var hr=Array(6);function Ut(ci){var Ur;J(hr.indexOf(xt.next)<0,"can not update framebuffer which is currently in use");var Ei={color:null},Xn=0,xi=null,Wa="rgba",Fl="uint8",wu=1;if(typeof ci=="number")Xn=ci|0;else if(!ci)Xn=1;else{J.type(ci,"object","invalid arguments for framebuffer");var Ri=ci;if("shape"in Ri){var Jl=Ri.shape;J(Array.isArray(Jl)&&Jl.length>=2,"invalid shape for framebuffer"),J(Jl[0]===Jl[1],"cube framebuffer must be square"),Xn=Jl[0]}else"radius"in Ri&&(Xn=Ri.radius|0),"width"in Ri?(Xn=Ri.width|0,"height"in Ri&&J(Ri.height===Xn,"must be square")):"height"in Ri&&(Xn=Ri.height|0);("color"in Ri||"colors"in Ri)&&(xi=Ri.color||Ri.colors,Array.isArray(xi)&&J(xi.length===1||ge.webgl_draw_buffers,"multiple render targets not supported")),xi||("colorCount"in Ri&&(wu=Ri.colorCount|0,J(wu>0,"invalid color buffer count")),"colorType"in Ri&&(J.oneOf(Ri.colorType,lr,"invalid color type"),Fl=Ri.colorType),"colorFormat"in Ri&&(Wa=Ri.colorFormat,J.oneOf(Ri.colorFormat,Kt,"invalid color format for texture"))),"depth"in Ri&&(Ei.depth=Ri.depth),"stencil"in Ri&&(Ei.stencil=Ri.stencil),"depthStencil"in Ri&&(Ei.depthStencil=Ri.depthStencil)}var fs;if(xi)if(Array.isArray(xi))for(fs=[],Ur=0;Ur<xi.length;++Ur)fs[Ur]=xi[Ur];else fs=[xi];else{fs=Array(wu);var Bl={radius:Xn,format:Wa,type:Fl};for(Ur=0;Ur<wu;++Ur)fs[Ur]=ct.createCube(Bl)}for(Ei.color=Array(fs.length),Ur=0;Ur<fs.length;++Ur){var Ql=fs[Ur];J(typeof Ql=="function"&&Ql._reglType==="textureCube","invalid cube map"),Xn=Xn||Ql.width,J(Ql.width===Xn&&Ql.height===Xn,"invalid cube map shape"),Ei.color[Ur]={target:dF,data:fs[Ur]}}for(Ur=0;Ur<6;++Ur){for(var eu=0;eu<fs.length;++eu)Ei.color[eu].target=dF+Ur;Ur>0&&(Ei.depth=hr[0].depth,Ei.stencil=hr[0].stencil,Ei.depthStencil=hr[0].depthStencil),hr[Ur]?hr[Ur](Ei):hr[Ur]=mr(Ei)}return r(Ut,{width:Xn,height:Xn,color:fs})}function Nn(ci){var Ur,Ei=ci|0;if(J(Ei>0&&Ei<=Pe.maxCubeMapSize,"invalid radius for cube fbo"),Ei===Ut.width)return Ut;var Xn=Ut.color;for(Ur=0;Ur<Xn.length;++Ur)Xn[Ur].resize(Ei);for(Ur=0;Ur<6;++Ur)hr[Ur].resize(Ei);return Ut.width=Ut.height=Ei,Ut}return Ut(Tr),r(Ut,{faces:hr,resize:Nn,_reglType:"framebufferCube",destroy:function(){hr.forEach(function(ci){ci.destroy()})}})}function Hn(){xt.cur=null,xt.next=null,xt.dirty=!0,bs(Wt).forEach(function(Tr){Tr.framebuffer=K.createFramebuffer(),jt(Tr)})}return r(xt,{getFramebuffer:function(Tr){if(typeof Tr=="function"&&Tr._reglType==="framebuffer"){var hr=Tr._framebuffer;if(hr instanceof Nr)return hr}return null},create:mr,createCube:cn,clear:function(){bs(Wt).forEach(yr)},restore:Hn})}var Fet=5126,Bfe=34962;function hW(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Fet,this.offset=0,this.stride=0,this.divisor=0}function Bet(K,ge,Pe,ct,Ot){for(var lt=Pe.maxAttributes,xt=new Array(lt),Kt=0;Kt<lt;++Kt)xt[Kt]=new hW;var er=0,lr={},tr={Record:hW,scope:{},state:xt,currentVAO:null,targetVAO:null,restore:Er()?Wt:function(){},createVAO:Nr,getVAO:pr,destroyBuffer:dr,setVAO:Er()?Ye:St,clear:Er()?or:function(){}};function dr(Xt){for(var yr=0;yr<xt.length;++yr){var jt=xt[yr];jt.buffer===Xt&&(K.disableVertexAttribArray(yr),jt.buffer=null)}}function Er(){return ge.oes_vertex_array_object}function Jt(){return ge.angle_instanced_arrays}function pr(Xt){return typeof Xt=="function"&&Xt._vao?Xt._vao:null}function Ye(Xt){if(Xt!==tr.currentVAO){var yr=Er();Xt?yr.bindVertexArrayOES(Xt.vao):yr.bindVertexArrayOES(null),tr.currentVAO=Xt}}function St(Xt){if(Xt!==tr.currentVAO){if(Xt)Xt.bindAttrs();else for(var yr=Jt(),jt=0;jt<xt.length;++jt){var mr=xt[jt];mr.buffer?(K.enableVertexAttribArray(jt),K.vertexAttribPointer(jt,mr.size,mr.type,mr.normalized,mr.stride,mr.offfset),yr&&mr.divisor&&yr.vertexAttribDivisorANGLE(jt,mr.divisor)):(K.disableVertexAttribArray(jt),K.vertexAttrib4f(jt,mr.x,mr.y,mr.z,mr.w))}tr.currentVAO=Xt}}function or(){bs(lr).forEach(function(Xt){Xt.destroy()})}function Mr(){this.id=++er,this.attributes=[];var Xt=Er();Xt?this.vao=Xt.createVertexArrayOES():this.vao=null,lr[this.id]=this,this.buffers=[]}Mr.prototype.bindAttrs=function(){for(var Xt=Jt(),yr=this.attributes,jt=0;jt<yr.length;++jt){var mr=yr[jt];mr.buffer?(K.enableVertexAttribArray(jt),K.bindBuffer(Bfe,mr.buffer.buffer),K.vertexAttribPointer(jt,mr.size,mr.type,mr.normalized,mr.stride,mr.offset),Xt&&mr.divisor&&Xt.vertexAttribDivisorANGLE(jt,mr.divisor)):(K.disableVertexAttribArray(jt),K.vertexAttrib4f(jt,mr.x,mr.y,mr.z,mr.w))}for(var cn=yr.length;cn<lt;++cn)K.disableVertexAttribArray(cn)},Mr.prototype.refresh=function(){var Xt=Er();Xt&&(Xt.bindVertexArrayOES(this.vao),this.bindAttrs(),tr.currentVAO=this)},Mr.prototype.destroy=function(){if(this.vao){var Xt=Er();this===tr.currentVAO&&(tr.currentVAO=null,Xt.bindVertexArrayOES(null)),Xt.deleteVertexArrayOES(this.vao),this.vao=null}lr[this.id]&&(delete lr[this.id],ct.vaoCount-=1)};function Wt(){var Xt=Er();Xt&&bs(lr).forEach(function(yr){yr.refresh()})}function Nr(Xt){var yr=new Mr;ct.vaoCount+=1;function jt(mr){J(Array.isArray(mr),"arguments to vertex array constructor must be an array"),J(mr.length<lt,"too many attributes"),J(mr.length>0,"must specify at least one attribute");var cn={},Hn=yr.attributes;Hn.length=mr.length;for(var Tr=0;Tr<mr.length;++Tr){var hr=mr[Tr],Ut=Hn[Tr]=new hW,Nn=hr.data||hr;if(Array.isArray(Nn)||t(Nn)||mu(Nn)){var ci;yr.buffers[Tr]&&(ci=yr.buffers[Tr],t(Nn)&&ci._buffer.byteLength>=Nn.byteLength?ci.subdata(Nn):(ci.destroy(),yr.buffers[Tr]=null)),yr.buffers[Tr]||(ci=yr.buffers[Tr]=Ot.create(hr,Bfe,!1,!0)),Ut.buffer=Ot.getBuffer(ci),Ut.size=Ut.buffer.dimension|0,Ut.normalized=!1,Ut.type=Ut.buffer.dtype,Ut.offset=0,Ut.stride=0,Ut.divisor=0,Ut.state=1,cn[Tr]=1}else Ot.getBuffer(hr)?(Ut.buffer=Ot.getBuffer(hr),Ut.size=Ut.buffer.dimension|0,Ut.normalized=!1,Ut.type=Ut.buffer.dtype,Ut.offset=0,Ut.stride=0,Ut.divisor=0,Ut.state=1):Ot.getBuffer(hr.buffer)?(Ut.buffer=Ot.getBuffer(hr.buffer),Ut.size=(+hr.size||Ut.buffer.dimension)|0,Ut.normalized=!!hr.normalized||!1,"type"in hr?(J.parameter(hr.type,_h,"invalid buffer type"),Ut.type=_h[hr.type]):Ut.type=Ut.buffer.dtype,Ut.offset=(hr.offset||0)|0,Ut.stride=(hr.stride||0)|0,Ut.divisor=(hr.divisor||0)|0,Ut.state=1,J(Ut.size>=1&&Ut.size<=4,"size must be between 1 and 4"),J(Ut.offset>=0,"invalid offset"),J(Ut.stride>=0&&Ut.stride<=255,"stride must be between 0 and 255"),J(Ut.divisor>=0,"divisor must be positive"),J(!Ut.divisor||!!ge.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in hr?(J(Tr>0,"first attribute must not be a constant"),Ut.x=+hr.x||0,Ut.y=+hr.y||0,Ut.z=+hr.z||0,Ut.w=+hr.w||0,Ut.state=2):J(!1,"invalid attribute spec for location "+Tr)}for(var Ur=0;Ur<yr.buffers.length;++Ur)!cn[Ur]&&yr.buffers[Ur]&&(yr.buffers[Ur].destroy(),yr.buffers[Ur]=null);return yr.refresh(),jt}return jt.destroy=function(){for(var mr=0;mr<yr.buffers.length;++mr)yr.buffers[mr]&&yr.buffers[mr].destroy();yr.buffers.length=0,yr.destroy()},jt._vao=yr,jt._reglType="vao",jt(Xt)}return tr}var Gfe=35632,Get=35633,zet=35718,Uet=35721;function Vet(K,ge,Pe,ct){var Ot={},lt={};function xt(Ye,St,or,Mr){this.name=Ye,this.id=St,this.location=or,this.info=Mr}function Kt(Ye,St){for(var or=0;or<Ye.length;++or)if(Ye[or].id===St.id){Ye[or].location=St.location;return}Ye.push(St)}function er(Ye,St,or){var Mr=Ye===Gfe?Ot:lt,Wt=Mr[St];if(!Wt){var Nr=ge.str(St);Wt=K.createShader(Ye),K.shaderSource(Wt,Nr),K.compileShader(Wt),J.shaderError(K,Wt,Nr,Ye,or),Mr[St]=Wt}return Wt}var lr={},tr=[],dr=0;function Er(Ye,St){this.id=dr++,this.fragId=Ye,this.vertId=St,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,ct.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Jt(Ye,St,or){var Mr,Wt,Nr=er(Gfe,Ye.fragId),Xt=er(Get,Ye.vertId),yr=Ye.program=K.createProgram();if(K.attachShader(yr,Nr),K.attachShader(yr,Xt),or)for(Mr=0;Mr<or.length;++Mr){var jt=or[Mr];K.bindAttribLocation(yr,jt[0],jt[1])}K.linkProgram(yr),J.linkError(K,yr,ge.str(Ye.fragId),ge.str(Ye.vertId),St);var mr=K.getProgramParameter(yr,zet);ct.profile&&(Ye.stats.uniformsCount=mr);var cn=Ye.uniforms;for(Mr=0;Mr<mr;++Mr)if(Wt=K.getActiveUniform(yr,Mr),Wt)if(Wt.size>1)for(var Hn=0;Hn<Wt.size;++Hn){var Tr=Wt.name.replace("[0]","["+Hn+"]");Kt(cn,new xt(Tr,ge.id(Tr),K.getUniformLocation(yr,Tr),Wt))}else Kt(cn,new xt(Wt.name,ge.id(Wt.name),K.getUniformLocation(yr,Wt.name),Wt));var hr=K.getProgramParameter(yr,Uet);ct.profile&&(Ye.stats.attributesCount=hr);var Ut=Ye.attributes;for(Mr=0;Mr<hr;++Mr)Wt=K.getActiveAttrib(yr,Mr),Wt&&Kt(Ut,new xt(Wt.name,ge.id(Wt.name),K.getAttribLocation(yr,Wt.name),Wt))}ct.profile&&(Pe.getMaxUniformsCount=function(){var Ye=0;return tr.forEach(function(St){St.stats.uniformsCount>Ye&&(Ye=St.stats.uniformsCount)}),Ye},Pe.getMaxAttributesCount=function(){var Ye=0;return tr.forEach(function(St){St.stats.attributesCount>Ye&&(Ye=St.stats.attributesCount)}),Ye});function pr(){Ot={},lt={};for(var Ye=0;Ye<tr.length;++Ye)Jt(tr[Ye],null,tr[Ye].attributes.map(function(St){return[St.location,St.name]}))}return{clear:function(){var Ye=K.deleteShader.bind(K);bs(Ot).forEach(Ye),Ot={},bs(lt).forEach(Ye),lt={},tr.forEach(function(St){K.deleteProgram(St.program)}),tr.length=0,lr={},Pe.shaderCount=0},program:function(Ye,St,or,Mr){J.command(Ye>=0,"missing vertex shader",or),J.command(St>=0,"missing fragment shader",or);var Wt=lr[St];Wt||(Wt=lr[St]={});var Nr=Wt[Ye];if(Nr&&(Nr.refCount++,!Mr))return Nr;var Xt=new Er(St,Ye);return Pe.shaderCount++,Jt(Xt,or,Mr),Nr||(Wt[Ye]=Xt),tr.push(Xt),r(Xt,{destroy:function(){if(Xt.refCount--,Xt.refCount<=0){K.deleteProgram(Xt.program);var yr=tr.indexOf(Xt);tr.splice(yr,1),Pe.shaderCount--}Wt[Xt.vertId].refCount<=0&&(K.deleteShader(lt[Xt.vertId]),delete lt[Xt.vertId],delete lr[Xt.fragId][Xt.vertId]),Object.keys(lr[Xt.fragId]).length||(K.deleteShader(Ot[Xt.fragId]),delete Ot[Xt.fragId],delete lr[Xt.fragId])}})},restore:pr,shader:er,frag:-1,vert:-1}}var $et=6408,LL=5121,Wet=3333,pF=5126;function Het(K,ge,Pe,ct,Ot,lt,xt){function Kt(tr){var dr;ge.next===null?(J(Ot.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),dr=LL):(J(ge.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),dr=ge.next.colorAttachments[0].texture._texture.type,lt.oes_texture_float?(J(dr===LL||dr===pF,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),dr===pF&&J(xt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):J(dr===LL,"Reading from a framebuffer is only allowed for the type 'uint8'"));var Er=0,Jt=0,pr=ct.framebufferWidth,Ye=ct.framebufferHeight,St=null;t(tr)?St=tr:tr&&(J.type(tr,"object","invalid arguments to regl.read()"),Er=tr.x|0,Jt=tr.y|0,J(Er>=0&&Er<ct.framebufferWidth,"invalid x offset for regl.read"),J(Jt>=0&&Jt<ct.framebufferHeight,"invalid y offset for regl.read"),pr=(tr.width||ct.framebufferWidth-Er)|0,Ye=(tr.height||ct.framebufferHeight-Jt)|0,St=tr.data||null),St&&(dr===LL?J(St instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):dr===pF&&J(St instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),J(pr>0&&pr+Er<=ct.framebufferWidth,"invalid width for read pixels"),J(Ye>0&&Ye+Jt<=ct.framebufferHeight,"invalid height for read pixels"),Pe();var or=pr*Ye*4;return St||(dr===LL?St=new Uint8Array(or):dr===pF&&(St=St||new Float32Array(or))),J.isTypedArray(St,"data buffer for regl.read() must be a typedarray"),J(St.byteLength>=or,"data buffer for regl.read() too small"),K.pixelStorei(Wet,4),K.readPixels(Er,Jt,pr,Ye,$et,dr,St),St}function er(tr){var dr;return ge.setFBO({framebuffer:tr.framebuffer},function(){dr=Kt(tr)}),dr}function lr(tr){return!tr||!("framebuffer"in tr)?Kt(tr):er(tr)}return lr}function PT(K){return Array.prototype.slice.call(K)}function OT(K){return PT(K).join("")}function jet(){var K=0,ge=[],Pe=[];function ct(dr){for(var Er=0;Er<Pe.length;++Er)if(Pe[Er]===dr)return ge[Er];var Jt="g"+K++;return ge.push(Jt),Pe.push(dr),Jt}function Ot(){var dr=[];function Er(){dr.push.apply(dr,PT(arguments))}var Jt=[];function pr(){var Ye="v"+K++;return Jt.push(Ye),arguments.length>0&&(dr.push(Ye,"="),dr.push.apply(dr,PT(arguments)),dr.push(";")),Ye}return r(Er,{def:pr,toString:function(){return OT([Jt.length>0?"var "+Jt.join(",")+";":"",OT(dr)])}})}function lt(){var dr=Ot(),Er=Ot(),Jt=dr.toString,pr=Er.toString;function Ye(St,or){Er(St,or,"=",dr.def(St,or),";")}return r(function(){dr.apply(dr,PT(arguments))},{def:dr.def,entry:dr,exit:Er,save:Ye,set:function(St,or,Mr){Ye(St,or),dr(St,or,"=",Mr,";")},toString:function(){return Jt()+pr()}})}function xt(){var dr=OT(arguments),Er=lt(),Jt=lt(),pr=Er.toString,Ye=Jt.toString;return r(Er,{then:function(){return Er.apply(Er,PT(arguments)),this},else:function(){return Jt.apply(Jt,PT(arguments)),this},toString:function(){var St=Ye();return St&&(St="else{"+St+"}"),OT(["if(",dr,"){",pr(),"}",St])}})}var Kt=Ot(),er={};function lr(dr,Er){var Jt=[];function pr(){var Wt="a"+Jt.length;return Jt.push(Wt),Wt}Er=Er||0;for(var Ye=0;Ye<Er;++Ye)pr();var St=lt(),or=St.toString,Mr=er[dr]=r(St,{arg:pr,toString:function(){return OT(["function(",Jt.join(),"){",or(),"}"])}});return Mr}function tr(){var dr=['"use strict";',Kt,"return {"];Object.keys(er).forEach(function(pr){dr.push('"',pr,'":',er[pr].toString(),",")}),dr.push("}");var Er=OT(dr).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),Jt=Function.apply(null,ge.concat(Er));return Jt.apply(null,Pe)}return{global:Kt,link:ct,block:Ot,proc:lr,scope:lt,cond:xt,compile:tr}}var RT="xyzw".split(""),zfe=5121,DT=1,cW=2,fW=0,dW=1,vW=2,pW=3,gF=4,Ufe=5,Vfe=6,$fe="dither",Wfe="blend.enable",Hfe="blend.color",gW="blend.equation",yW="blend.func",jfe="depth.enable",Xfe="depth.func",Yfe="depth.range",qfe="depth.mask",mW="colorMask",Zfe="cull.enable",Kfe="cull.face",_W="frontFace",xW="lineWidth",Jfe="polygonOffset.enable",SW="polygonOffset.offset",Qfe="sample.alpha",ede="sample.enable",wW="sample.coverage",tde="stencil.enable",rde="stencil.mask",bW="stencil.func",EW="stencil.opFront",PL="stencil.opBack",nde="scissor.enable",yF="scissor.box",Xm="viewport",OL="profile",Fw="framebuffer",RL="vert",DL="frag",Bw="elements",Gw="primitive",zw="count",mF="offset",_F="instances",NL="vao",TW="Width",CW="Height",NT=Fw+TW,kT=Fw+CW,Xet=Xm+TW,Yet=Xm+CW,ide="drawingBuffer",ade=ide+TW,ode=ide+CW,qet=[yW,gW,bW,EW,PL,wW,Xm,yF,SW],FT=34962,Zet=34963,Ket=35632,Jet=35633,sde=3553,Qet=34067,ett=2884,ttt=3042,rtt=3024,ntt=2960,itt=2929,att=3089,ott=32823,stt=32926,ltt=32928,AW=5126,xF=35664,SF=35665,wF=35666,MW=5124,bF=35667,EF=35668,TF=35669,IW=35670,CF=35671,AF=35672,MF=35673,kL=35674,FL=35675,BL=35676,GL=35678,zL=35680,lde=4,UL=1028,Uw=1029,ude=2304,LW=2305,utt=32775,htt=32776,ctt=519,J_=7680,hde=0,cde=1,fde=32774,ftt=513,dde=36160,dtt=36064,Z0={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},vde=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],BT={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Q_={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},pde={frag:Ket,vert:Jet},PW={cw:ude,ccw:LW};function IF(K){return Array.isArray(K)||t(K)||mu(K)}function gde(K){return K.sort(function(ge,Pe){return ge===Xm?-1:Pe===Xm?1:ge<Pe?-1:1})}function cf(K,ge,Pe,ct){this.thisDep=K,this.contextDep=ge,this.propDep=Pe,this.append=ct}function ex(K){return K&&!(K.thisDep||K.contextDep||K.propDep)}function kl(K){return new cf(!1,!1,!1,K)}function Qf(K,ge){var Pe=K.type;if(Pe===fW){var ct=K.data.length;return new cf(!0,ct>=1,ct>=2,ge)}else if(Pe===gF){var Ot=K.data;return new cf(Ot.thisDep,Ot.contextDep,Ot.propDep,ge)}else{if(Pe===Ufe)return new cf(!1,!1,!1,ge);if(Pe===Vfe){for(var lt=!1,xt=!1,Kt=!1,er=0;er<K.data.length;++er){var lr=K.data[er];if(lr.type===dW)Kt=!0;else if(lr.type===vW)xt=!0;else if(lr.type===pW)lt=!0;else if(lr.type===fW){lt=!0;var tr=lr.data;tr>=1&&(xt=!0),tr>=2&&(Kt=!0)}else lr.type===gF&&(lt=lt||lr.data.thisDep,xt=xt||lr.data.contextDep,Kt=Kt||lr.data.propDep)}return new cf(lt,xt,Kt,ge)}else return new cf(Pe===pW,Pe===vW,Pe===dW,ge)}}var yde=new cf(!1,!1,!1,function(){});function vtt(K,ge,Pe,ct,Ot,lt,xt,Kt,er,lr,tr,dr,Er,Jt,pr){var Ye=lr.Record,St={add:32774,subtract:32778,"reverse subtract":32779};Pe.ext_blend_minmax&&(St.min=utt,St.max=htt);var or=Pe.angle_instanced_arrays,Mr=Pe.webgl_draw_buffers,Wt={dirty:!0,profile:pr.profile},Nr={},Xt=[],yr={},jt={};function mr(be){return be.replace(".","_")}function cn(be,de,Ne){var He=mr(be);Xt.push(be),Nr[He]=Wt[He]=!!Ne,yr[He]=de}function Hn(be,de,Ne){var He=mr(be);Xt.push(be),Array.isArray(Ne)?(Wt[He]=Ne.slice(),Nr[He]=Ne.slice()):Wt[He]=Nr[He]=Ne,jt[He]=de}cn($fe,rtt),cn(Wfe,ttt),Hn(Hfe,"blendColor",[0,0,0,0]),Hn(gW,"blendEquationSeparate",[fde,fde]),Hn(yW,"blendFuncSeparate",[cde,hde,cde,hde]),cn(jfe,itt,!0),Hn(Xfe,"depthFunc",ftt),Hn(Yfe,"depthRange",[0,1]),Hn(qfe,"depthMask",!0),Hn(mW,mW,[!0,!0,!0,!0]),cn(Zfe,ett),Hn(Kfe,"cullFace",Uw),Hn(_W,_W,LW),Hn(xW,xW,1),cn(Jfe,ott),Hn(SW,"polygonOffset",[0,0]),cn(Qfe,stt),cn(ede,ltt),Hn(wW,"sampleCoverage",[1,!1]),cn(tde,ntt),Hn(rde,"stencilMask",-1),Hn(bW,"stencilFunc",[ctt,0,-1]),Hn(EW,"stencilOpSeparate",[UL,J_,J_,J_]),Hn(PL,"stencilOpSeparate",[Uw,J_,J_,J_]),cn(nde,att),Hn(yF,"scissor",[0,0,K.drawingBufferWidth,K.drawingBufferHeight]),Hn(Xm,Xm,[0,0,K.drawingBufferWidth,K.drawingBufferHeight]);var Tr={gl:K,context:Er,strings:ge,next:Nr,current:Wt,draw:dr,elements:lt,buffer:Ot,shader:tr,attributes:lr.state,vao:lr,uniforms:er,framebuffer:Kt,extensions:Pe,timer:Jt,isBufferArgs:IF},hr={primTypes:rt,compareFuncs:BT,blendFuncs:Z0,blendEquations:St,stencilOps:Q_,glTypes:_h,orientationType:PW};J.optional(function(){Tr.isArrayLike=An}),Mr&&(hr.backBuffer=[Uw],hr.drawBuffer=no(ct.maxDrawbuffers,function(be){return be===0?[0]:no(be,function(de){return dtt+de})}));var Ut=0;function Nn(){var be=jet(),de=be.link,Ne=be.global;be.id=Ut++,be.batchId="0";var He=de(Tr),Ke=be.shared={props:"a0"};Object.keys(Tr).forEach(function(De){Ke[De]=Ne.def(He,".",De)}),J.optional(function(){be.CHECK=de(J),be.commandStr=J.guessCommand(),be.command=de(be.commandStr),be.assert=function(De,_e,Ve){De("if(!(",_e,"))",this.CHECK,".commandRaise(",de(Ve),",",this.command,");")},hr.invalidBlendCombinations=vde});var Ge=be.next={},Fe=be.current={};Object.keys(jt).forEach(function(De){Array.isArray(Wt[De])&&(Ge[De]=Ne.def(Ke.next,".",De),Fe[De]=Ne.def(Ke.current,".",De))});var ze=be.constants={};Object.keys(hr).forEach(function(De){ze[De]=Ne.def(JSON.stringify(hr[De]))}),be.invoke=function(De,_e){switch(_e.type){case fW:var Ve=["this",Ke.context,Ke.props,be.batchId];return De.def(de(_e.data),".call(",Ve.slice(0,Math.max(_e.data.length+1,4)),")");case dW:return De.def(Ke.props,_e.data);case vW:return De.def(Ke.context,_e.data);case pW:return De.def("this",_e.data);case gF:return _e.data.append(be,De),_e.data.ref;case Ufe:return _e.data.toString();case Vfe:return _e.data.map(function(et){return be.invoke(De,et)})}},be.attribCache={};var Ee={};return be.scopeAttrib=function(De){var _e=ge.id(De);if(_e in Ee)return Ee[_e];var Ve=lr.scope[_e];Ve||(Ve=lr.scope[_e]=new Ye);var et=Ee[_e]=de(Ve);return et},be}function ci(be){var de=be.static,Ne=be.dynamic,He;if(OL in de){var Ke=!!de[OL];He=kl(function(Fe,ze){return Ke}),He.enable=Ke}else if(OL in Ne){var Ge=Ne[OL];He=Qf(Ge,function(Fe,ze){return Fe.invoke(ze,Ge)})}return He}function Ur(be,de){var Ne=be.static,He=be.dynamic;if(Fw in Ne){var Ke=Ne[Fw];return Ke?(Ke=Kt.getFramebuffer(Ke),J.command(Ke,"invalid framebuffer object"),kl(function(Fe,ze){var Ee=Fe.link(Ke),De=Fe.shared;ze.set(De.framebuffer,".next",Ee);var _e=De.context;return ze.set(_e,"."+NT,Ee+".width"),ze.set(_e,"."+kT,Ee+".height"),Ee})):kl(function(Fe,ze){var Ee=Fe.shared;ze.set(Ee.framebuffer,".next","null");var De=Ee.context;return ze.set(De,"."+NT,De+"."+ade),ze.set(De,"."+kT,De+"."+ode),"null"})}else if(Fw in He){var Ge=He[Fw];return Qf(Ge,function(Fe,ze){var Ee=Fe.invoke(ze,Ge),De=Fe.shared,_e=De.framebuffer,Ve=ze.def(_e,".getFramebuffer(",Ee,")");J.optional(function(){Fe.assert(ze,"!"+Ee+"||"+Ve,"invalid framebuffer object")}),ze.set(_e,".next",Ve);var et=De.context;return ze.set(et,"."+NT,Ve+"?"+Ve+".width:"+et+"."+ade),ze.set(et,"."+kT,Ve+"?"+Ve+".height:"+et+"."+ode),Ve})}else return null}function Ei(be,de,Ne){var He=be.static,Ke=be.dynamic;function Ge(Ee){if(Ee in He){var De=He[Ee];J.commandType(De,"object","invalid "+Ee,Ne.commandStr);var _e=!0,Ve=De.x|0,et=De.y|0,Lt,Rt;return"width"in De?(Lt=De.width|0,J.command(Lt>=0,"invalid "+Ee,Ne.commandStr)):_e=!1,"height"in De?(Rt=De.height|0,J.command(Rt>=0,"invalid "+Ee,Ne.commandStr)):_e=!1,new cf(!_e&&de&&de.thisDep,!_e&&de&&de.contextDep,!_e&&de&&de.propDep,function(en,di){var Vr=en.shared.context,Mn=Lt;"width"in De||(Mn=di.def(Vr,".",NT,"-",Ve));var Qn=Rt;return"height"in De||(Qn=di.def(Vr,".",kT,"-",et)),[Ve,et,Mn,Qn]})}else if(Ee in Ke){var bt=Ke[Ee],ir=Qf(bt,function(en,di){var Vr=en.invoke(di,bt);J.optional(function(){en.assert(di,Vr+"&&typeof "+Vr+'==="object"',"invalid "+Ee)});var Mn=en.shared.context,Qn=di.def(Vr,".x|0"),Ha=di.def(Vr,".y|0"),sl=di.def('"width" in ',Vr,"?",Vr,".width|0:","(",Mn,".",NT,"-",Qn,")"),ff=di.def('"height" in ',Vr,"?",Vr,".height|0:","(",Mn,".",kT,"-",Ha,")");return J.optional(function(){en.assert(di,sl+">=0&&"+ff+">=0","invalid "+Ee)}),[Qn,Ha,sl,ff]});return de&&(ir.thisDep=ir.thisDep||de.thisDep,ir.contextDep=ir.contextDep||de.contextDep,ir.propDep=ir.propDep||de.propDep),ir}else return de?new cf(de.thisDep,de.contextDep,de.propDep,function(en,di){var Vr=en.shared.context;return[0,0,di.def(Vr,".",NT),di.def(Vr,".",kT)]}):null}var Fe=Ge(Xm);if(Fe){var ze=Fe;Fe=new cf(Fe.thisDep,Fe.contextDep,Fe.propDep,function(Ee,De){var _e=ze.append(Ee,De),Ve=Ee.shared.context;return De.set(Ve,"."+Xet,_e[2]),De.set(Ve,"."+Yet,_e[3]),_e})}return{viewport:Fe,scissor_box:Ge(yF)}}function Xn(be,de){var Ne=be.static,He=typeof Ne[DL]=="string"&&typeof Ne[RL]=="string";if(He){if(Object.keys(de.dynamic).length>0)return null;var Ke=de.static,Ge=Object.keys(Ke);if(Ge.length>0&&typeof Ke[Ge[0]]=="number"){for(var Fe=[],ze=0;ze<Ge.length;++ze)J(typeof Ke[Ge[ze]]=="number","must specify all vertex attribute locations when using vaos"),Fe.push([Ke[Ge[ze]]|0,Ge[ze]]);return Fe}}return null}function xi(be,de,Ne){var He=be.static,Ke=be.dynamic;function Ge(_e){if(_e in He){var Ve=ge.id(He[_e]);J.optional(function(){tr.shader(pde[_e],Ve,J.guessCommand())});var et=kl(function(){return Ve});return et.id=Ve,et}else if(_e in Ke){var Lt=Ke[_e];return Qf(Lt,function(Rt,bt){var ir=Rt.invoke(bt,Lt),en=bt.def(Rt.shared.strings,".id(",ir,")");return J.optional(function(){bt(Rt.shared.shader,".shader(",pde[_e],",",en,",",Rt.command,");")}),en})}return null}var Fe=Ge(DL),ze=Ge(RL),Ee=null,De;return ex(Fe)&&ex(ze)?(Ee=tr.program(ze.id,Fe.id,null,Ne),De=kl(function(_e,Ve){return _e.link(Ee)})):De=new cf(Fe&&Fe.thisDep||ze&&ze.thisDep,Fe&&Fe.contextDep||ze&&ze.contextDep,Fe&&Fe.propDep||ze&&ze.propDep,function(_e,Ve){var et=_e.shared.shader,Lt;Fe?Lt=Fe.append(_e,Ve):Lt=Ve.def(et,".",DL);var Rt;ze?Rt=ze.append(_e,Ve):Rt=Ve.def(et,".",RL);var bt=et+".program("+Rt+","+Lt;return J.optional(function(){bt+=","+_e.command}),Ve.def(bt+")")}),{frag:Fe,vert:ze,progVar:De,program:Ee}}function Wa(be,de){var Ne=be.static,He=be.dynamic;function Ke(){if(Bw in Ne){var _e=Ne[Bw];IF(_e)?_e=lt.getElements(lt.create(_e,!0)):_e&&(_e=lt.getElements(_e),J.command(_e,"invalid elements",de.commandStr));var Ve=kl(function(Lt,Rt){if(_e){var bt=Lt.link(_e);return Lt.ELEMENTS=bt,bt}return Lt.ELEMENTS=null,null});return Ve.value=_e,Ve}else if(Bw in He){var et=He[Bw];return Qf(et,function(Lt,Rt){var bt=Lt.shared,ir=bt.isBufferArgs,en=bt.elements,di=Lt.invoke(Rt,et),Vr=Rt.def("null"),Mn=Rt.def(ir,"(",di,")"),Qn=Lt.cond(Mn).then(Vr,"=",en,".createStream(",di,");").else(Vr,"=",en,".getElements(",di,");");return J.optional(function(){Lt.assert(Qn.else,"!"+di+"||"+Vr,"invalid elements")}),Rt.entry(Qn),Rt.exit(Lt.cond(Mn).then(en,".destroyStream(",Vr,");")),Lt.ELEMENTS=Vr,Vr})}return null}var Ge=Ke();function Fe(){if(Gw in Ne){var _e=Ne[Gw];return J.commandParameter(_e,rt,"invalid primitve",de.commandStr),kl(function(et,Lt){return rt[_e]})}else if(Gw in He){var Ve=He[Gw];return Qf(Ve,function(et,Lt){var Rt=et.constants.primTypes,bt=et.invoke(Lt,Ve);return J.optional(function(){et.assert(Lt,bt+" in "+Rt,"invalid primitive, must be one of "+Object.keys(rt))}),Lt.def(Rt,"[",bt,"]")})}else if(Ge)return ex(Ge)?Ge.value?kl(function(et,Lt){return Lt.def(et.ELEMENTS,".primType")}):kl(function(){return lde}):new cf(Ge.thisDep,Ge.contextDep,Ge.propDep,function(et,Lt){var Rt=et.ELEMENTS;return Lt.def(Rt,"?",Rt,".primType:",lde)});return null}function ze(_e,Ve){if(_e in Ne){var et=Ne[_e]|0;return J.command(!Ve||et>=0,"invalid "+_e,de.commandStr),kl(function(Rt,bt){return Ve&&(Rt.OFFSET=et),et})}else if(_e in He){var Lt=He[_e];return Qf(Lt,function(Rt,bt){var ir=Rt.invoke(bt,Lt);return Ve&&(Rt.OFFSET=ir,J.optional(function(){Rt.assert(bt,ir+">=0","invalid "+_e)})),ir})}else if(Ve&&Ge)return kl(function(Rt,bt){return Rt.OFFSET="0",0});return null}var Ee=ze(mF,!0);function De(){if(zw in Ne){var _e=Ne[zw]|0;return J.command(typeof _e=="number"&&_e>=0,"invalid vertex count",de.commandStr),kl(function(){return _e})}else if(zw in He){var Ve=He[zw];return Qf(Ve,function(Rt,bt){var ir=Rt.invoke(bt,Ve);return J.optional(function(){Rt.assert(bt,"typeof "+ir+'==="number"&&'+ir+">=0&&"+ir+"===("+ir+"|0)","invalid vertex count")}),ir})}else if(Ge)if(ex(Ge)){if(Ge)return Ee?new cf(Ee.thisDep,Ee.contextDep,Ee.propDep,function(Rt,bt){var ir=bt.def(Rt.ELEMENTS,".vertCount-",Rt.OFFSET);return J.optional(function(){Rt.assert(bt,ir+">=0","invalid vertex offset/element buffer too small")}),ir}):kl(function(Rt,bt){return bt.def(Rt.ELEMENTS,".vertCount")});var et=kl(function(){return-1});return J.optional(function(){et.MISSING=!0}),et}else{var Lt=new cf(Ge.thisDep||Ee.thisDep,Ge.contextDep||Ee.contextDep,Ge.propDep||Ee.propDep,function(Rt,bt){var ir=Rt.ELEMENTS;return Rt.OFFSET?bt.def(ir,"?",ir,".vertCount-",Rt.OFFSET,":-1"):bt.def(ir,"?",ir,".vertCount:-1")});return J.optional(function(){Lt.DYNAMIC=!0}),Lt}return null}return{elements:Ge,primitive:Fe(),count:De(),instances:ze(_F,!1),offset:Ee}}function Fl(be,de){var Ne=be.static,He=be.dynamic,Ke={};return Xt.forEach(function(Ge){var Fe=mr(Ge);function ze(Ee,De){if(Ge in Ne){var _e=Ee(Ne[Ge]);Ke[Fe]=kl(function(){return _e})}else if(Ge in He){var Ve=He[Ge];Ke[Fe]=Qf(Ve,function(et,Lt){return De(et,Lt,et.invoke(Lt,Ve))})}}switch(Ge){case Zfe:case Wfe:case $fe:case tde:case jfe:case nde:case Jfe:case Qfe:case ede:case qfe:return ze(function(Ee){return J.commandType(Ee,"boolean",Ge,de.commandStr),Ee},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,"typeof "+_e+'==="boolean"',"invalid flag "+Ge,Ee.commandStr)}),_e});case Xfe:return ze(function(Ee){return J.commandParameter(Ee,BT,"invalid "+Ge,de.commandStr),BT[Ee]},function(Ee,De,_e){var Ve=Ee.constants.compareFuncs;return J.optional(function(){Ee.assert(De,_e+" in "+Ve,"invalid "+Ge+", must be one of "+Object.keys(BT))}),De.def(Ve,"[",_e,"]")});case Yfe:return ze(function(Ee){return J.command(An(Ee)&&Ee.length===2&&typeof Ee[0]=="number"&&typeof Ee[1]=="number"&&Ee[0]<=Ee[1],"depth range is 2d array",de.commandStr),Ee},function(Ee,De,_e){J.optional(function(){Ee.assert(De,Ee.shared.isArrayLike+"("+_e+")&&"+_e+".length===2&&typeof "+_e+'[0]==="number"&&typeof '+_e+'[1]==="number"&&'+_e+"[0]<="+_e+"[1]","depth range must be a 2d array")});var Ve=De.def("+",_e,"[0]"),et=De.def("+",_e,"[1]");return[Ve,et]});case yW:return ze(function(Ee){J.commandType(Ee,"object","blend.func",de.commandStr);var De="srcRGB"in Ee?Ee.srcRGB:Ee.src,_e="srcAlpha"in Ee?Ee.srcAlpha:Ee.src,Ve="dstRGB"in Ee?Ee.dstRGB:Ee.dst,et="dstAlpha"in Ee?Ee.dstAlpha:Ee.dst;return J.commandParameter(De,Z0,Fe+".srcRGB",de.commandStr),J.commandParameter(_e,Z0,Fe+".srcAlpha",de.commandStr),J.commandParameter(Ve,Z0,Fe+".dstRGB",de.commandStr),J.commandParameter(et,Z0,Fe+".dstAlpha",de.commandStr),J.command(vde.indexOf(De+", "+Ve)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+De+", "+Ve+")",de.commandStr),[Z0[De],Z0[Ve],Z0[_e],Z0[et]]},function(Ee,De,_e){var Ve=Ee.constants.blendFuncs;J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid blend func, must be an object")});function et(Vr,Mn){var Qn=De.def('"',Vr,Mn,'" in ',_e,"?",_e,".",Vr,Mn,":",_e,".",Vr);return J.optional(function(){Ee.assert(De,Qn+" in "+Ve,"invalid "+Ge+"."+Vr+Mn+", must be one of "+Object.keys(Z0))}),Qn}var Lt=et("src","RGB"),Rt=et("dst","RGB");J.optional(function(){var Vr=Ee.constants.invalidBlendCombinations;Ee.assert(De,Vr+".indexOf("+Lt+'+", "+'+Rt+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var bt=De.def(Ve,"[",Lt,"]"),ir=De.def(Ve,"[",et("src","Alpha"),"]"),en=De.def(Ve,"[",Rt,"]"),di=De.def(Ve,"[",et("dst","Alpha"),"]");return[bt,en,ir,di]});case gW:return ze(function(Ee){if(typeof Ee=="string")return J.commandParameter(Ee,St,"invalid "+Ge,de.commandStr),[St[Ee],St[Ee]];if(typeof Ee=="object")return J.commandParameter(Ee.rgb,St,Ge+".rgb",de.commandStr),J.commandParameter(Ee.alpha,St,Ge+".alpha",de.commandStr),[St[Ee.rgb],St[Ee.alpha]];J.commandRaise("invalid blend.equation",de.commandStr)},function(Ee,De,_e){var Ve=Ee.constants.blendEquations,et=De.def(),Lt=De.def(),Rt=Ee.cond("typeof ",_e,'==="string"');return J.optional(function(){function bt(ir,en,di){Ee.assert(ir,di+" in "+Ve,"invalid "+en+", must be one of "+Object.keys(St))}bt(Rt.then,Ge,_e),Ee.assert(Rt.else,_e+"&&typeof "+_e+'==="object"',"invalid "+Ge),bt(Rt.else,Ge+".rgb",_e+".rgb"),bt(Rt.else,Ge+".alpha",_e+".alpha")}),Rt.then(et,"=",Lt,"=",Ve,"[",_e,"];"),Rt.else(et,"=",Ve,"[",_e,".rgb];",Lt,"=",Ve,"[",_e,".alpha];"),De(Rt),[et,Lt]});case Hfe:return ze(function(Ee){return J.command(An(Ee)&&Ee.length===4,"blend.color must be a 4d array",de.commandStr),no(4,function(De){return+Ee[De]})},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,Ee.shared.isArrayLike+"("+_e+")&&"+_e+".length===4","blend.color must be a 4d array")}),no(4,function(Ve){return De.def("+",_e,"[",Ve,"]")})});case rde:return ze(function(Ee){return J.commandType(Ee,"number",Fe,de.commandStr),Ee|0},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,"typeof "+_e+'==="number"',"invalid stencil.mask")}),De.def(_e,"|0")});case bW:return ze(function(Ee){J.commandType(Ee,"object",Fe,de.commandStr);var De=Ee.cmp||"keep",_e=Ee.ref||0,Ve="mask"in Ee?Ee.mask:-1;return J.commandParameter(De,BT,Ge+".cmp",de.commandStr),J.commandType(_e,"number",Ge+".ref",de.commandStr),J.commandType(Ve,"number",Ge+".mask",de.commandStr),[BT[De],_e,Ve]},function(Ee,De,_e){var Ve=Ee.constants.compareFuncs;J.optional(function(){function bt(){Ee.assert(De,Array.prototype.join.call(arguments,""),"invalid stencil.func")}bt(_e+"&&typeof ",_e,'==="object"'),bt('!("cmp" in ',_e,")||(",_e,".cmp in ",Ve,")")});var et=De.def('"cmp" in ',_e,"?",Ve,"[",_e,".cmp]",":",J_),Lt=De.def(_e,".ref|0"),Rt=De.def('"mask" in ',_e,"?",_e,".mask|0:-1");return[et,Lt,Rt]});case EW:case PL:return ze(function(Ee){J.commandType(Ee,"object",Fe,de.commandStr);var De=Ee.fail||"keep",_e=Ee.zfail||"keep",Ve=Ee.zpass||"keep";return J.commandParameter(De,Q_,Ge+".fail",de.commandStr),J.commandParameter(_e,Q_,Ge+".zfail",de.commandStr),J.commandParameter(Ve,Q_,Ge+".zpass",de.commandStr),[Ge===PL?Uw:UL,Q_[De],Q_[_e],Q_[Ve]]},function(Ee,De,_e){var Ve=Ee.constants.stencilOps;J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid "+Ge)});function et(Lt){return J.optional(function(){Ee.assert(De,'!("'+Lt+'" in '+_e+")||("+_e+"."+Lt+" in "+Ve+")","invalid "+Ge+"."+Lt+", must be one of "+Object.keys(Q_))}),De.def('"',Lt,'" in ',_e,"?",Ve,"[",_e,".",Lt,"]:",J_)}return[Ge===PL?Uw:UL,et("fail"),et("zfail"),et("zpass")]});case SW:return ze(function(Ee){J.commandType(Ee,"object",Fe,de.commandStr);var De=Ee.factor|0,_e=Ee.units|0;return J.commandType(De,"number",Fe+".factor",de.commandStr),J.commandType(_e,"number",Fe+".units",de.commandStr),[De,_e]},function(Ee,De,_e){J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid "+Ge)});var Ve=De.def(_e,".factor|0"),et=De.def(_e,".units|0");return[Ve,et]});case Kfe:return ze(function(Ee){var De=0;return Ee==="front"?De=UL:Ee==="back"&&(De=Uw),J.command(!!De,Fe,de.commandStr),De},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,_e+'==="front"||'+_e+'==="back"',"invalid cull.face")}),De.def(_e,'==="front"?',UL,":",Uw)});case xW:return ze(function(Ee){return J.command(typeof Ee=="number"&&Ee>=ct.lineWidthDims[0]&&Ee<=ct.lineWidthDims[1],"invalid line width, must be a positive number between "+ct.lineWidthDims[0]+" and "+ct.lineWidthDims[1],de.commandStr),Ee},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,"typeof "+_e+'==="number"&&'+_e+">="+ct.lineWidthDims[0]+"&&"+_e+"<="+ct.lineWidthDims[1],"invalid line width")}),_e});case _W:return ze(function(Ee){return J.commandParameter(Ee,PW,Fe,de.commandStr),PW[Ee]},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,_e+'==="cw"||'+_e+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),De.def(_e+'==="cw"?'+ude+":"+LW)});case mW:return ze(function(Ee){return J.command(An(Ee)&&Ee.length===4,"color.mask must be length 4 array",de.commandStr),Ee.map(function(De){return!!De})},function(Ee,De,_e){return J.optional(function(){Ee.assert(De,Ee.shared.isArrayLike+"("+_e+")&&"+_e+".length===4","invalid color.mask")}),no(4,function(Ve){return"!!"+_e+"["+Ve+"]"})});case wW:return ze(function(Ee){J.command(typeof Ee=="object"&&Ee,Fe,de.commandStr);var De="value"in Ee?Ee.value:1,_e=!!Ee.invert;return J.command(typeof De=="number"&&De>=0&&De<=1,"sample.coverage.value must be a number between 0 and 1",de.commandStr),[De,_e]},function(Ee,De,_e){J.optional(function(){Ee.assert(De,_e+"&&typeof "+_e+'==="object"',"invalid sample.coverage")});var Ve=De.def('"value" in ',_e,"?+",_e,".value:1"),et=De.def("!!",_e,".invert");return[Ve,et]})}}),Ke}function wu(be,de){var Ne=be.static,He=be.dynamic,Ke={};return Object.keys(Ne).forEach(function(Ge){var Fe=Ne[Ge],ze;if(typeof Fe=="number"||typeof Fe=="boolean")ze=kl(function(){return Fe});else if(typeof Fe=="function"){var Ee=Fe._reglType;Ee==="texture2d"||Ee==="textureCube"?ze=kl(function(De){return De.link(Fe)}):Ee==="framebuffer"||Ee==="framebufferCube"?(J.command(Fe.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Ge+'"',de.commandStr),ze=kl(function(De){return De.link(Fe.color[0])})):J.commandRaise('invalid data for uniform "'+Ge+'"',de.commandStr)}else An(Fe)?ze=kl(function(De){var _e=De.global.def("[",no(Fe.length,function(Ve){return J.command(typeof Fe[Ve]=="number"||typeof Fe[Ve]=="boolean","invalid uniform "+Ge,De.commandStr),Fe[Ve]}),"]");return _e}):J.commandRaise('invalid or missing data for uniform "'+Ge+'"',de.commandStr);ze.value=Fe,Ke[Ge]=ze}),Object.keys(He).forEach(function(Ge){var Fe=He[Ge];Ke[Ge]=Qf(Fe,function(ze,Ee){return ze.invoke(Ee,Fe)})}),Ke}function Ri(be,de){var Ne=be.static,He=be.dynamic,Ke={};return Object.keys(Ne).forEach(function(Ge){var Fe=Ne[Ge],ze=ge.id(Ge),Ee=new Ye;if(IF(Fe))Ee.state=DT,Ee.buffer=Ot.getBuffer(Ot.create(Fe,FT,!1,!0)),Ee.type=0;else{var De=Ot.getBuffer(Fe);if(De)Ee.state=DT,Ee.buffer=De,Ee.type=0;else if(J.command(typeof Fe=="object"&&Fe,"invalid data for attribute "+Ge,de.commandStr),"constant"in Fe){var _e=Fe.constant;Ee.buffer="null",Ee.state=cW,typeof _e=="number"?Ee.x=_e:(J.command(An(_e)&&_e.length>0&&_e.length<=4,"invalid constant for attribute "+Ge,de.commandStr),RT.forEach(function(en,di){di<_e.length&&(Ee[en]=_e[di])}))}else{IF(Fe.buffer)?De=Ot.getBuffer(Ot.create(Fe.buffer,FT,!1,!0)):De=Ot.getBuffer(Fe.buffer),J.command(!!De,'missing buffer for attribute "'+Ge+'"',de.commandStr);var Ve=Fe.offset|0;J.command(Ve>=0,'invalid offset for attribute "'+Ge+'"',de.commandStr);var et=Fe.stride|0;J.command(et>=0&&et<256,'invalid stride for attribute "'+Ge+'", must be integer betweeen [0, 255]',de.commandStr);var Lt=Fe.size|0;J.command(!("size"in Fe)||Lt>0&&Lt<=4,'invalid size for attribute "'+Ge+'", must be 1,2,3,4',de.commandStr);var Rt=!!Fe.normalized,bt=0;"type"in Fe&&(J.commandParameter(Fe.type,_h,"invalid type for attribute "+Ge,de.commandStr),bt=_h[Fe.type]);var ir=Fe.divisor|0;"divisor"in Fe&&(J.command(ir===0||or,'cannot specify divisor for attribute "'+Ge+'", instancing not supported',de.commandStr),J.command(ir>=0,'invalid divisor for attribute "'+Ge+'"',de.commandStr)),J.optional(function(){var en=de.commandStr,di=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(Fe).forEach(function(Vr){J.command(di.indexOf(Vr)>=0,'unknown parameter "'+Vr+'" for attribute pointer "'+Ge+'" (valid parameters are '+di+")",en)})}),Ee.buffer=De,Ee.state=DT,Ee.size=Lt,Ee.normalized=Rt,Ee.type=bt||De.dtype,Ee.offset=Ve,Ee.stride=et,Ee.divisor=ir}}Ke[Ge]=kl(function(en,di){var Vr=en.attribCache;if(ze in Vr)return Vr[ze];var Mn={isStream:!1};return Object.keys(Ee).forEach(function(Qn){Mn[Qn]=Ee[Qn]}),Ee.buffer&&(Mn.buffer=en.link(Ee.buffer),Mn.type=Mn.type||Mn.buffer+".dtype"),Vr[ze]=Mn,Mn})}),Object.keys(He).forEach(function(Ge){var Fe=He[Ge];function ze(Ee,De){var _e=Ee.invoke(De,Fe),Ve=Ee.shared,et=Ee.constants,Lt=Ve.isBufferArgs,Rt=Ve.buffer;J.optional(function(){Ee.assert(De,_e+"&&(typeof "+_e+'==="object"||typeof '+_e+'==="function")&&('+Lt+"("+_e+")||"+Rt+".getBuffer("+_e+")||"+Rt+".getBuffer("+_e+".buffer)||"+Lt+"("+_e+'.buffer)||("constant" in '+_e+"&&(typeof "+_e+'.constant==="number"||'+Ve.isArrayLike+"("+_e+".constant))))",'invalid dynamic attribute "'+Ge+'"')});var bt={isStream:De.def(!1)},ir=new Ye;ir.state=DT,Object.keys(ir).forEach(function(Mn){bt[Mn]=De.def(""+ir[Mn])});var en=bt.buffer,di=bt.type;De("if(",Lt,"(",_e,")){",bt.isStream,"=true;",en,"=",Rt,".createStream(",FT,",",_e,");",di,"=",en,".dtype;","}else{",en,"=",Rt,".getBuffer(",_e,");","if(",en,"){",di,"=",en,".dtype;",'}else if("constant" in ',_e,"){",bt.state,"=",cW,";","if(typeof "+_e+'.constant === "number"){',bt[RT[0]],"=",_e,".constant;",RT.slice(1).map(function(Mn){return bt[Mn]}).join("="),"=0;","}else{",RT.map(function(Mn,Qn){return bt[Mn]+"="+_e+".constant.length>"+Qn+"?"+_e+".constant["+Qn+"]:0;"}).join(""),"}}else{","if(",Lt,"(",_e,".buffer)){",en,"=",Rt,".createStream(",FT,",",_e,".buffer);","}else{",en,"=",Rt,".getBuffer(",_e,".buffer);","}",di,'="type" in ',_e,"?",et.glTypes,"[",_e,".type]:",en,".dtype;",bt.normalized,"=!!",_e,".normalized;");function Vr(Mn){De(bt[Mn],"=",_e,".",Mn,"|0;")}return Vr("size"),Vr("offset"),Vr("stride"),Vr("divisor"),De("}}"),De.exit("if(",bt.isStream,"){",Rt,".destroyStream(",en,");","}"),bt}Ke[Ge]=Qf(Fe,ze)}),Ke}function Jl(be,de){var Ne=be.static,He=be.dynamic;if(NL in Ne){var Ke=Ne[NL];return Ke!==null&&lr.getVAO(Ke)===null&&(Ke=lr.createVAO(Ke)),kl(function(Fe){return Fe.link(lr.getVAO(Ke))})}else if(NL in He){var Ge=He[NL];return Qf(Ge,function(Fe,ze){var Ee=Fe.invoke(ze,Ge);return ze.def(Fe.shared.vao+".getVAO("+Ee+")")})}return null}function fs(be){var de=be.static,Ne=be.dynamic,He={};return Object.keys(de).forEach(function(Ke){var Ge=de[Ke];He[Ke]=kl(function(Fe,ze){return typeof Ge=="number"||typeof Ge=="boolean"?""+Ge:Fe.link(Ge)})}),Object.keys(Ne).forEach(function(Ke){var Ge=Ne[Ke];He[Ke]=Qf(Ge,function(Fe,ze){return Fe.invoke(ze,Ge)})}),He}function Bl(be,de,Ne,He,Ke){var Ge=be.static,Fe=be.dynamic;J.optional(function(){var Vr=[Fw,RL,DL,Bw,Gw,mF,zw,_F,OL,NL].concat(Xt);function Mn(Qn){Object.keys(Qn).forEach(function(Ha){J.command(Vr.indexOf(Ha)>=0,'unknown parameter "'+Ha+'"',Ke.commandStr)})}Mn(Ge),Mn(Fe)});var ze=Xn(be,de),Ee=Ur(be),De=Ei(be,Ee,Ke),_e=Wa(be,Ke),Ve=Fl(be,Ke),et=xi(be,Ke,ze);function Lt(Vr){var Mn=De[Vr];Mn&&(Ve[Vr]=Mn)}Lt(Xm),Lt(mr(yF));var Rt=Object.keys(Ve).length>0,bt={framebuffer:Ee,draw:_e,shader:et,state:Ve,dirty:Rt,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(bt.profile=ci(be),bt.uniforms=wu(Ne,Ke),bt.drawVAO=bt.scopeVAO=Jl(be),!bt.drawVAO&&et.program&&!ze&&Pe.angle_instanced_arrays){var ir=!0,en=et.program.attributes.map(function(Vr){var Mn=de.static[Vr];return ir=ir&&!!Mn,Mn});if(ir&&en.length>0){var di=lr.getVAO(lr.createVAO(en));bt.drawVAO=new cf(null,null,null,function(Vr,Mn){return Vr.link(di)}),bt.useVAO=!0}}return ze?bt.useVAO=!0:bt.attributes=Ri(de,Ke),bt.context=fs(He),bt}function Ql(be,de,Ne){var He=be.shared,Ke=He.context,Ge=be.scope();Object.keys(Ne).forEach(function(Fe){de.save(Ke,"."+Fe);var ze=Ne[Fe],Ee=ze.append(be,de);Array.isArray(Ee)?Ge(Ke,".",Fe,"=[",Ee.join(),"];"):Ge(Ke,".",Fe,"=",Ee,";")}),de(Ge)}function eu(be,de,Ne,He){var Ke=be.shared,Ge=Ke.gl,Fe=Ke.framebuffer,ze;Mr&&(ze=de.def(Ke.extensions,".webgl_draw_buffers"));var Ee=be.constants,De=Ee.drawBuffer,_e=Ee.backBuffer,Ve;Ne?Ve=Ne.append(be,de):Ve=de.def(Fe,".next"),He||de("if(",Ve,"!==",Fe,".cur){"),de("if(",Ve,"){",Ge,".bindFramebuffer(",dde,",",Ve,".framebuffer);"),Mr&&de(ze,".drawBuffersWEBGL(",De,"[",Ve,".colorAttachments.length]);"),de("}else{",Ge,".bindFramebuffer(",dde,",null);"),Mr&&de(ze,".drawBuffersWEBGL(",_e,");"),de("}",Fe,".cur=",Ve,";"),He||de("}")}function Xu(be,de,Ne){var He=be.shared,Ke=He.gl,Ge=be.current,Fe=be.next,ze=He.current,Ee=He.next,De=be.cond(ze,".dirty");Xt.forEach(function(_e){var Ve=mr(_e);if(!(Ve in Ne.state)){var et,Lt;if(Ve in Fe){et=Fe[Ve],Lt=Ge[Ve];var Rt=no(Wt[Ve].length,function(ir){return De.def(et,"[",ir,"]")});De(be.cond(Rt.map(function(ir,en){return ir+"!=="+Lt+"["+en+"]"}).join("||")).then(Ke,".",jt[Ve],"(",Rt,");",Rt.map(function(ir,en){return Lt+"["+en+"]="+ir}).join(";"),";"))}else{et=De.def(Ee,".",Ve);var bt=be.cond(et,"!==",ze,".",Ve);De(bt),Ve in yr?bt(be.cond(et).then(Ke,".enable(",yr[Ve],");").else(Ke,".disable(",yr[Ve],");"),ze,".",Ve,"=",et,";"):bt(Ke,".",jt[Ve],"(",et,");",ze,".",Ve,"=",et,";")}}}),Object.keys(Ne.state).length===0&&De(ze,".dirty=false;"),de(De)}function Sh(be,de,Ne,He){var Ke=be.shared,Ge=be.current,Fe=Ke.current,ze=Ke.gl;gde(Object.keys(Ne)).forEach(function(Ee){var De=Ne[Ee];if(!(He&&!He(De))){var _e=De.append(be,de);if(yr[Ee]){var Ve=yr[Ee];ex(De)?_e?de(ze,".enable(",Ve,");"):de(ze,".disable(",Ve,");"):de(be.cond(_e).then(ze,".enable(",Ve,");").else(ze,".disable(",Ve,");")),de(Fe,".",Ee,"=",_e,";")}else if(An(_e)){var et=Ge[Ee];de(ze,".",jt[Ee],"(",_e,");",_e.map(function(Lt,Rt){return et+"["+Rt+"]="+Lt}).join(";"),";")}else de(ze,".",jt[Ee],"(",_e,");",Fe,".",Ee,"=",_e,";")}})}function bl(be,de){or&&(be.instancing=de.def(be.shared.extensions,".angle_instanced_arrays"))}function fi(be,de,Ne,He,Ke){var Ge=be.shared,Fe=be.stats,ze=Ge.current,Ee=Ge.timer,De=Ne.profile;function _e(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Ve,et;function Lt(Vr){Ve=de.def(),Vr(Ve,"=",_e(),";"),typeof Ke=="string"?Vr(Fe,".count+=",Ke,";"):Vr(Fe,".count++;"),Jt&&(He?(et=de.def(),Vr(et,"=",Ee,".getNumPendingQueries();")):Vr(Ee,".beginQuery(",Fe,");"))}function Rt(Vr){Vr(Fe,".cpuTime+=",_e(),"-",Ve,";"),Jt&&(He?Vr(Ee,".pushScopeStats(",et,",",Ee,".getNumPendingQueries(),",Fe,");"):Vr(Ee,".endQuery();"))}function bt(Vr){var Mn=de.def(ze,".profile");de(ze,".profile=",Vr,";"),de.exit(ze,".profile=",Mn,";")}var ir;if(De){if(ex(De)){De.enable?(Lt(de),Rt(de.exit),bt("true")):bt("false");return}ir=De.append(be,de),bt(ir)}else ir=de.def(ze,".profile");var en=be.block();Lt(en),de("if(",ir,"){",en,"}");var di=be.block();Rt(di),de.exit("if(",ir,"){",di,"}")}function wh(be,de,Ne,He,Ke){var Ge=be.shared;function Fe(Ee){switch(Ee){case xF:case bF:case CF:return 2;case SF:case EF:case AF:return 3;case wF:case TF:case MF:return 4;default:return 1}}function ze(Ee,De,_e){var Ve=Ge.gl,et=de.def(Ee,".location"),Lt=de.def(Ge.attributes,"[",et,"]"),Rt=_e.state,bt=_e.buffer,ir=[_e.x,_e.y,_e.z,_e.w],en=["buffer","normalized","offset","stride"];function di(){de("if(!",Lt,".buffer){",Ve,".enableVertexAttribArray(",et,");}");var Mn=_e.type,Qn;if(_e.size?Qn=de.def(_e.size,"||",De):Qn=De,de("if(",Lt,".type!==",Mn,"||",Lt,".size!==",Qn,"||",en.map(function(sl){return Lt+"."+sl+"!=="+_e[sl]}).join("||"),"){",Ve,".bindBuffer(",FT,",",bt,".buffer);",Ve,".vertexAttribPointer(",[et,Qn,Mn,_e.normalized,_e.stride,_e.offset],");",Lt,".type=",Mn,";",Lt,".size=",Qn,";",en.map(function(sl){return Lt+"."+sl+"="+_e[sl]+";"}).join(""),"}"),or){var Ha=_e.divisor;de("if(",Lt,".divisor!==",Ha,"){",be.instancing,".vertexAttribDivisorANGLE(",[et,Ha],");",Lt,".divisor=",Ha,";}")}}function Vr(){de("if(",Lt,".buffer){",Ve,".disableVertexAttribArray(",et,");",Lt,".buffer=null;","}if(",RT.map(function(Mn,Qn){return Lt+"."+Mn+"!=="+ir[Qn]}).join("||"),"){",Ve,".vertexAttrib4f(",et,",",ir,");",RT.map(function(Mn,Qn){return Lt+"."+Mn+"="+ir[Qn]+";"}).join(""),"}")}Rt===DT?di():Rt===cW?Vr():(de("if(",Rt,"===",DT,"){"),di(),de("}else{"),Vr(),de("}"))}He.forEach(function(Ee){var De=Ee.name,_e=Ne.attributes[De],Ve;if(_e){if(!Ke(_e))return;Ve=_e.append(be,de)}else{if(!Ke(yde))return;var et=be.scopeAttrib(De);J.optional(function(){be.assert(de,et+".state","missing attribute "+De)}),Ve={},Object.keys(new Ye).forEach(function(Lt){Ve[Lt]=de.def(et,".",Lt)})}ze(be.link(Ee),Fe(Ee.info.type),Ve)})}function io(be,de,Ne,He,Ke){for(var Ge=be.shared,Fe=Ge.gl,ze,Ee=0;Ee<He.length;++Ee){var De=He[Ee],_e=De.name,Ve=De.info.type,et=Ne.uniforms[_e],Lt=be.link(De),Rt=Lt+".location",bt;if(et){if(!Ke(et))continue;if(ex(et)){var ir=et.value;if(J.command(ir!==null&&typeof ir<"u",'missing uniform "'+_e+'"',be.commandStr),Ve===GL||Ve===zL){J.command(typeof ir=="function"&&(Ve===GL&&(ir._reglType==="texture2d"||ir._reglType==="framebuffer")||Ve===zL&&(ir._reglType==="textureCube"||ir._reglType==="framebufferCube")),"invalid texture for uniform "+_e,be.commandStr);var en=be.link(ir._texture||ir.color[0]._texture);de(Fe,".uniform1i(",Rt,",",en+".bind());"),de.exit(en,".unbind();")}else if(Ve===kL||Ve===FL||Ve===BL){J.optional(function(){J.command(An(ir),"invalid matrix for uniform "+_e,be.commandStr),J.command(Ve===kL&&ir.length===4||Ve===FL&&ir.length===9||Ve===BL&&ir.length===16,"invalid length for matrix uniform "+_e,be.commandStr)});var di=be.global.def("new Float32Array(["+Array.prototype.slice.call(ir)+"])"),Vr=2;Ve===FL?Vr=3:Ve===BL&&(Vr=4),de(Fe,".uniformMatrix",Vr,"fv(",Rt,",false,",di,");")}else{switch(Ve){case AW:J.commandType(ir,"number","uniform "+_e,be.commandStr),ze="1f";break;case xF:J.command(An(ir)&&ir.length===2,"uniform "+_e,be.commandStr),ze="2f";break;case SF:J.command(An(ir)&&ir.length===3,"uniform "+_e,be.commandStr),ze="3f";break;case wF:J.command(An(ir)&&ir.length===4,"uniform "+_e,be.commandStr),ze="4f";break;case IW:J.commandType(ir,"boolean","uniform "+_e,be.commandStr),ze="1i";break;case MW:J.commandType(ir,"number","uniform "+_e,be.commandStr),ze="1i";break;case CF:J.command(An(ir)&&ir.length===2,"uniform "+_e,be.commandStr),ze="2i";break;case bF:J.command(An(ir)&&ir.length===2,"uniform "+_e,be.commandStr),ze="2i";break;case AF:J.command(An(ir)&&ir.length===3,"uniform "+_e,be.commandStr),ze="3i";break;case EF:J.command(An(ir)&&ir.length===3,"uniform "+_e,be.commandStr),ze="3i";break;case MF:J.command(An(ir)&&ir.length===4,"uniform "+_e,be.commandStr),ze="4i";break;case TF:J.command(An(ir)&&ir.length===4,"uniform "+_e,be.commandStr),ze="4i";break}de(Fe,".uniform",ze,"(",Rt,",",An(ir)?Array.prototype.slice.call(ir):ir,");")}continue}else bt=et.append(be,de)}else{if(!Ke(yde))continue;bt=de.def(Ge.uniforms,"[",ge.id(_e),"]")}Ve===GL?(J(!Array.isArray(bt),"must specify a scalar prop for textures"),de("if(",bt,"&&",bt,'._reglType==="framebuffer"){',bt,"=",bt,".color[0];","}")):Ve===zL&&(J(!Array.isArray(bt),"must specify a scalar prop for cube maps"),de("if(",bt,"&&",bt,'._reglType==="framebufferCube"){',bt,"=",bt,".color[0];","}")),J.optional(function(){function ff(wg,Ede){be.assert(de,wg,'bad data or missing for uniform "'+_e+'". '+Ede)}function OW(wg){J(!Array.isArray(bt),"must not specify an array type for uniform"),ff("typeof "+bt+'==="'+wg+'"',"invalid type, expected "+wg)}function Hv(wg,Ede){Array.isArray(bt)?J(bt.length===wg,"must have length "+wg):ff(Ge.isArrayLike+"("+bt+")&&"+bt+".length==="+wg,"invalid vector, should have length "+wg,be.commandStr)}function bde(wg){J(!Array.isArray(bt),"must not specify a value type"),ff("typeof "+bt+'==="function"&&'+bt+'._reglType==="texture'+(wg===sde?"2d":"Cube")+'"',"invalid texture type",be.commandStr)}switch(Ve){case MW:OW("number");break;case bF:Hv(2);break;case EF:Hv(3);break;case TF:Hv(4);break;case AW:OW("number");break;case xF:Hv(2);break;case SF:Hv(3);break;case wF:Hv(4);break;case IW:OW("boolean");break;case CF:Hv(2);break;case AF:Hv(3);break;case MF:Hv(4);break;case kL:Hv(4);break;case FL:Hv(9);break;case BL:Hv(16);break;case GL:bde(sde);break;case zL:bde(Qet);break}});var Mn=1;switch(Ve){case GL:case zL:var Qn=de.def(bt,"._texture");de(Fe,".uniform1i(",Rt,",",Qn,".bind());"),de.exit(Qn,".unbind();");continue;case MW:case IW:ze="1i";break;case bF:case CF:ze="2i",Mn=2;break;case EF:case AF:ze="3i",Mn=3;break;case TF:case MF:ze="4i",Mn=4;break;case AW:ze="1f";break;case xF:ze="2f",Mn=2;break;case SF:ze="3f",Mn=3;break;case wF:ze="4f",Mn=4;break;case kL:ze="Matrix2fv";break;case FL:ze="Matrix3fv";break;case BL:ze="Matrix4fv";break}if(de(Fe,".uniform",ze,"(",Rt,","),ze.charAt(0)==="M"){var Ha=Math.pow(Ve-kL+2,2),sl=be.global.def("new Float32Array(",Ha,")");Array.isArray(bt)?de("false,(",no(Ha,function(ff){return sl+"["+ff+"]="+bt[ff]}),",",sl,")"):de("false,(Array.isArray(",bt,")||",bt," instanceof Float32Array)?",bt,":(",no(Ha,function(ff){return sl+"["+ff+"]="+bt+"["+ff+"]"}),",",sl,")")}else Mn>1?de(no(Mn,function(ff){return Array.isArray(bt)?bt[ff]:bt+"["+ff+"]"})):(J(!Array.isArray(bt),"uniform value must not be an array"),de(bt));de(");")}}function bn(be,de,Ne,He){var Ke=be.shared,Ge=Ke.gl,Fe=Ke.draw,ze=He.draw;function Ee(){var Qn=ze.elements,Ha,sl=de;return Qn?((Qn.contextDep&&He.contextDynamic||Qn.propDep)&&(sl=Ne),Ha=Qn.append(be,sl)):Ha=sl.def(Fe,".",Bw),Ha&&sl("if("+Ha+")"+Ge+".bindBuffer("+Zet+","+Ha+".buffer.buffer);"),Ha}function De(){var Qn=ze.count,Ha,sl=de;return Qn?((Qn.contextDep&&He.contextDynamic||Qn.propDep)&&(sl=Ne),Ha=Qn.append(be,sl),J.optional(function(){Qn.MISSING&&be.assert(de,"false","missing vertex count"),Qn.DYNAMIC&&be.assert(sl,Ha+">=0","missing vertex count")})):(Ha=sl.def(Fe,".",zw),J.optional(function(){be.assert(sl,Ha+">=0","missing vertex count")})),Ha}var _e=Ee();function Ve(Qn){var Ha=ze[Qn];return Ha?Ha.contextDep&&He.contextDynamic||Ha.propDep?Ha.append(be,Ne):Ha.append(be,de):de.def(Fe,".",Qn)}var et=Ve(Gw),Lt=Ve(mF),Rt=De();if(typeof Rt=="number"){if(Rt===0)return}else Ne("if(",Rt,"){"),Ne.exit("}");var bt,ir;or&&(bt=Ve(_F),ir=be.instancing);var en=_e+".type",di=ze.elements&&ex(ze.elements);function Vr(){function Qn(){Ne(ir,".drawElementsInstancedANGLE(",[et,Rt,en,Lt+"<<(("+en+"-"+zfe+")>>1)",bt],");")}function Ha(){Ne(ir,".drawArraysInstancedANGLE(",[et,Lt,Rt,bt],");")}_e?di?Qn():(Ne("if(",_e,"){"),Qn(),Ne("}else{"),Ha(),Ne("}")):Ha()}function Mn(){function Qn(){Ne(Ge+".drawElements("+[et,Rt,en,Lt+"<<(("+en+"-"+zfe+")>>1)"]+");")}function Ha(){Ne(Ge+".drawArrays("+[et,Lt,Rt]+");")}_e?di?Qn():(Ne("if(",_e,"){"),Qn(),Ne("}else{"),Ha(),Ne("}")):Ha()}or&&(typeof bt!="number"||bt>=0)?typeof bt=="string"?(Ne("if(",bt,">0){"),Vr(),Ne("}else if(",bt,"<0){"),Mn(),Ne("}")):Vr():Mn()}function Mi(be,de,Ne,He,Ke){var Ge=Nn(),Fe=Ge.proc("body",Ke);return J.optional(function(){Ge.commandStr=de.commandStr,Ge.command=Ge.link(de.commandStr)}),or&&(Ge.instancing=Fe.def(Ge.shared.extensions,".angle_instanced_arrays")),be(Ge,Fe,Ne,He),Ge.compile().body}function ia(be,de,Ne,He){bl(be,de),Ne.useVAO?Ne.drawVAO?de(be.shared.vao,".setVAO(",Ne.drawVAO.append(be,de),");"):de(be.shared.vao,".setVAO(",be.shared.vao,".targetVAO);"):(de(be.shared.vao,".setVAO(null);"),wh(be,de,Ne,He.attributes,function(){return!0})),io(be,de,Ne,He.uniforms,function(){return!0}),bn(be,de,de,Ne)}function El(be,de){var Ne=be.proc("draw",1);bl(be,Ne),Ql(be,Ne,de.context),eu(be,Ne,de.framebuffer),Xu(be,Ne,de),Sh(be,Ne,de.state),fi(be,Ne,de,!1,!0);var He=de.shader.progVar.append(be,Ne);if(Ne(be.shared.gl,".useProgram(",He,".program);"),de.shader.program)ia(be,Ne,de,de.shader.program);else{Ne(be.shared.vao,".setVAO(null);");var Ke=be.global.def("{}"),Ge=Ne.def(He,".id"),Fe=Ne.def(Ke,"[",Ge,"]");Ne(be.cond(Fe).then(Fe,".call(this,a0);").else(Fe,"=",Ke,"[",Ge,"]=",be.link(function(ze){return Mi(ia,be,de,ze,1)}),"(",He,");",Fe,".call(this,a0);"))}Object.keys(de.state).length>0&&Ne(be.shared.current,".dirty=true;")}function K0(be,de,Ne,He){be.batchId="a1",bl(be,de);function Ke(){return!0}wh(be,de,Ne,He.attributes,Ke),io(be,de,Ne,He.uniforms,Ke),bn(be,de,de,Ne)}function Vw(be,de,Ne,He){bl(be,de);var Ke=Ne.contextDep,Ge=de.def(),Fe="a0",ze="a1",Ee=de.def();be.shared.props=Ee,be.batchId=Ge;var De=be.scope(),_e=be.scope();de(De.entry,"for(",Ge,"=0;",Ge,"<",ze,";++",Ge,"){",Ee,"=",Fe,"[",Ge,"];",_e,"}",De.exit);function Ve(en){return en.contextDep&&Ke||en.propDep}function et(en){return!Ve(en)}if(Ne.needsContext&&Ql(be,_e,Ne.context),Ne.needsFramebuffer&&eu(be,_e,Ne.framebuffer),Sh(be,_e,Ne.state,Ve),Ne.profile&&Ve(Ne.profile)&&fi(be,_e,Ne,!1,!0),He)Ne.useVAO?Ne.drawVAO?Ve(Ne.drawVAO)?_e(be.shared.vao,".setVAO(",Ne.drawVAO.append(be,_e),");"):De(be.shared.vao,".setVAO(",Ne.drawVAO.append(be,De),");"):De(be.shared.vao,".setVAO(",be.shared.vao,".targetVAO);"):(De(be.shared.vao,".setVAO(null);"),wh(be,De,Ne,He.attributes,et),wh(be,_e,Ne,He.attributes,Ve)),io(be,De,Ne,He.uniforms,et),io(be,_e,Ne,He.uniforms,Ve),bn(be,De,_e,Ne);else{var Lt=be.global.def("{}"),Rt=Ne.shader.progVar.append(be,_e),bt=_e.def(Rt,".id"),ir=_e.def(Lt,"[",bt,"]");_e(be.shared.gl,".useProgram(",Rt,".program);","if(!",ir,"){",ir,"=",Lt,"[",bt,"]=",be.link(function(en){return Mi(K0,be,Ne,en,2)}),"(",Rt,");}",ir,".call(this,a0[",Ge,"],",Ge,");")}}function Ie(be,de){var Ne=be.proc("batch",2);be.batchId="0",bl(be,Ne);var He=!1,Ke=!0;Object.keys(de.context).forEach(function(Lt){He=He||de.context[Lt].propDep}),He||(Ql(be,Ne,de.context),Ke=!1);var Ge=de.framebuffer,Fe=!1;Ge?(Ge.propDep?He=Fe=!0:Ge.contextDep&&He&&(Fe=!0),Fe||eu(be,Ne,Ge)):eu(be,Ne,null),de.state.viewport&&de.state.viewport.propDep&&(He=!0);function ze(Lt){return Lt.contextDep&&He||Lt.propDep}Xu(be,Ne,de),Sh(be,Ne,de.state,function(Lt){return!ze(Lt)}),(!de.profile||!ze(de.profile))&&fi(be,Ne,de,!1,"a1"),de.contextDep=He,de.needsContext=Ke,de.needsFramebuffer=Fe;var Ee=de.shader.progVar;if(Ee.contextDep&&He||Ee.propDep)Vw(be,Ne,de,null);else{var De=Ee.append(be,Ne);if(Ne(be.shared.gl,".useProgram(",De,".program);"),de.shader.program)Vw(be,Ne,de,de.shader.program);else{Ne(be.shared.vao,".setVAO(null);");var _e=be.global.def("{}"),Ve=Ne.def(De,".id"),et=Ne.def(_e,"[",Ve,"]");Ne(be.cond(et).then(et,".call(this,a0,a1);").else(et,"=",_e,"[",Ve,"]=",be.link(function(Lt){return Mi(Vw,be,de,Lt,2)}),"(",De,");",et,".call(this,a0,a1);"))}}Object.keys(de.state).length>0&&Ne(be.shared.current,".dirty=true;")}function vt(be,de){var Ne=be.proc("scope",3);be.batchId="a2";var He=be.shared,Ke=He.current;Ql(be,Ne,de.context),de.framebuffer&&de.framebuffer.append(be,Ne),gde(Object.keys(de.state)).forEach(function(Fe){var ze=de.state[Fe],Ee=ze.append(be,Ne);An(Ee)?Ee.forEach(function(De,_e){Ne.set(be.next[Fe],"["+_e+"]",De)}):Ne.set(He.next,"."+Fe,Ee)}),fi(be,Ne,de,!0,!0),[Bw,mF,zw,_F,Gw].forEach(function(Fe){var ze=de.draw[Fe];!ze||Ne.set(He.draw,"."+Fe,""+ze.append(be,Ne))}),Object.keys(de.uniforms).forEach(function(Fe){var ze=de.uniforms[Fe].append(be,Ne);Array.isArray(ze)&&(ze="["+ze.join()+"]"),Ne.set(He.uniforms,"["+ge.id(Fe)+"]",ze)}),Object.keys(de.attributes).forEach(function(Fe){var ze=de.attributes[Fe].append(be,Ne),Ee=be.scopeAttrib(Fe);Object.keys(new Ye).forEach(function(De){Ne.set(Ee,"."+De,ze[De])})}),de.scopeVAO&&Ne.set(He.vao,".targetVAO",de.scopeVAO.append(be,Ne));function Ge(Fe){var ze=de.shader[Fe];ze&&Ne.set(He.shader,"."+Fe,ze.append(be,Ne))}Ge(RL),Ge(DL),Object.keys(de.state).length>0&&(Ne(Ke,".dirty=true;"),Ne.exit(Ke,".dirty=true;")),Ne("a1(",be.shared.context,",a0,",be.batchId,");")}function it(be){if(!(typeof be!="object"||An(be))){for(var de=Object.keys(be),Ne=0;Ne<de.length;++Ne)if(jr.isDynamic(be[de[Ne]]))return!0;return!1}}function Br(be,de,Ne){var He=de.static[Ne];if(!He||!it(He))return;var Ke=be.global,Ge=Object.keys(He),Fe=!1,ze=!1,Ee=!1,De=be.global.def("{}");Ge.forEach(function(Ve){var et=He[Ve];if(jr.isDynamic(et)){typeof et=="function"&&(et=He[Ve]=jr.unbox(et));var Lt=Qf(et,null);Fe=Fe||Lt.thisDep,Ee=Ee||Lt.propDep,ze=ze||Lt.contextDep}else{switch(Ke(De,".",Ve,"="),typeof et){case"number":Ke(et);break;case"string":Ke('"',et,'"');break;case"object":Array.isArray(et)&&Ke("[",et.join(),"]");break;default:Ke(be.link(et));break}Ke(";")}});function _e(Ve,et){Ge.forEach(function(Lt){var Rt=He[Lt];if(!!jr.isDynamic(Rt)){var bt=Ve.invoke(et,Rt);et(De,".",Lt,"=",bt,";")}})}de.dynamic[Ne]=new jr.DynamicVariable(gF,{thisDep:Fe,contextDep:ze,propDep:Ee,ref:De,append:_e}),delete de.static[Ne]}function Ti(be,de,Ne,He,Ke){var Ge=Nn();Ge.stats=Ge.link(Ke),Object.keys(de.static).forEach(function(ze){Br(Ge,de,ze)}),qet.forEach(function(ze){Br(Ge,be,ze)});var Fe=Bl(be,de,Ne,He,Ge);return El(Ge,Fe),vt(Ge,Fe),Ie(Ge,Fe),r(Ge.compile(),{destroy:function(){Fe.shader.program.destroy()}})}return{next:Nr,current:Wt,procs:function(){var be=Nn(),de=be.proc("poll"),Ne=be.proc("refresh"),He=be.block();de(He),Ne(He);var Ke=be.shared,Ge=Ke.gl,Fe=Ke.next,ze=Ke.current;He(ze,".dirty=false;"),eu(be,de),eu(be,Ne,null,!0);var Ee;or&&(Ee=be.link(or)),Pe.oes_vertex_array_object&&Ne(be.link(Pe.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var De=0;De<ct.maxAttributes;++De){var _e=Ne.def(Ke.attributes,"[",De,"]"),Ve=be.cond(_e,".buffer");Ve.then(Ge,".enableVertexAttribArray(",De,");",Ge,".bindBuffer(",FT,",",_e,".buffer.buffer);",Ge,".vertexAttribPointer(",De,",",_e,".size,",_e,".type,",_e,".normalized,",_e,".stride,",_e,".offset);").else(Ge,".disableVertexAttribArray(",De,");",Ge,".vertexAttrib4f(",De,",",_e,".x,",_e,".y,",_e,".z,",_e,".w);",_e,".buffer=null;"),Ne(Ve),or&&Ne(Ee,".vertexAttribDivisorANGLE(",De,",",_e,".divisor);")}return Ne(be.shared.vao,".currentVAO=null;",be.shared.vao,".setVAO(",be.shared.vao,".targetVAO);"),Object.keys(yr).forEach(function(et){var Lt=yr[et],Rt=He.def(Fe,".",et),bt=be.block();bt("if(",Rt,"){",Ge,".enable(",Lt,")}else{",Ge,".disable(",Lt,")}",ze,".",et,"=",Rt,";"),Ne(bt),de("if(",Rt,"!==",ze,".",et,"){",bt,"}")}),Object.keys(jt).forEach(function(et){var Lt=jt[et],Rt=Wt[et],bt,ir,en=be.block();if(en(Ge,".",Lt,"("),An(Rt)){var di=Rt.length;bt=be.global.def(Fe,".",et),ir=be.global.def(ze,".",et),en(no(di,function(Vr){return bt+"["+Vr+"]"}),");",no(di,function(Vr){return ir+"["+Vr+"]="+bt+"["+Vr+"];"}).join("")),de("if(",no(di,function(Vr){return bt+"["+Vr+"]!=="+ir+"["+Vr+"]"}).join("||"),"){",en,"}")}else bt=He.def(Fe,".",et),ir=He.def(ze,".",et),en(bt,");",ze,".",et,"=",bt,";"),de("if(",bt,"!==",ir,"){",en,"}");Ne(en)}),be.compile()}(),compile:Ti}}function ptt(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var gtt=34918,ytt=34919,mde=35007,mtt=function(K,ge){if(!ge.ext_disjoint_timer_query)return null;var Pe=[];function ct(){return Pe.pop()||ge.ext_disjoint_timer_query.createQueryEXT()}function Ot(or){Pe.push(or)}var lt=[];function xt(or){var Mr=ct();ge.ext_disjoint_timer_query.beginQueryEXT(mde,Mr),lt.push(Mr),Jt(lt.length-1,lt.length,or)}function Kt(){ge.ext_disjoint_timer_query.endQueryEXT(mde)}function er(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var lr=[];function tr(){return lr.pop()||new er}function dr(or){lr.push(or)}var Er=[];function Jt(or,Mr,Wt){var Nr=tr();Nr.startQueryIndex=or,Nr.endQueryIndex=Mr,Nr.sum=0,Nr.stats=Wt,Er.push(Nr)}var pr=[],Ye=[];function St(){var or,Mr,Wt=lt.length;if(Wt!==0){Ye.length=Math.max(Ye.length,Wt+1),pr.length=Math.max(pr.length,Wt+1),pr[0]=0,Ye[0]=0;var Nr=0;for(or=0,Mr=0;Mr<lt.length;++Mr){var Xt=lt[Mr];ge.ext_disjoint_timer_query.getQueryObjectEXT(Xt,ytt)?(Nr+=ge.ext_disjoint_timer_query.getQueryObjectEXT(Xt,gtt),Ot(Xt)):lt[or++]=Xt,pr[Mr+1]=Nr,Ye[Mr+1]=or}for(lt.length=or,or=0,Mr=0;Mr<Er.length;++Mr){var yr=Er[Mr],jt=yr.startQueryIndex,mr=yr.endQueryIndex;yr.sum+=pr[mr]-pr[jt];var cn=Ye[jt],Hn=Ye[mr];Hn===cn?(yr.stats.gpuTime+=yr.sum/1e6,dr(yr)):(yr.startQueryIndex=cn,yr.endQueryIndex=Hn,Er[or++]=yr)}Er.length=or}}return{beginQuery:xt,endQuery:Kt,pushScopeStats:Jt,update:St,getNumPendingQueries:function(){return lt.length},clear:function(){Pe.push.apply(Pe,lt);for(var or=0;or<Pe.length;or++)ge.ext_disjoint_timer_query.deleteQueryEXT(Pe[or]);lt.length=0,Pe.length=0},restore:function(){lt.length=0,Pe.length=0}}},_tt=16384,xtt=256,Stt=1024,wtt=34962,_de="webglcontextlost",xde="webglcontextrestored",Sde=1,btt=2,Ett=3;function wde(K,ge){for(var Pe=0;Pe<K.length;++Pe)if(K[Pe]===ge)return Pe;return-1}function Ttt(K){var ge=Sl(K);if(!ge)return null;var Pe=ge.gl,ct=Pe.getContextAttributes(),Ot=Pe.isContextLost(),lt=Os(Pe,ge);if(!lt)return null;var xt=Rn(),Kt=ptt(),er=lt.extensions,lr=mtt(Pe,er),tr=Jn(),dr=Pe.drawingBufferWidth,Er=Pe.drawingBufferHeight,Jt={tick:0,time:0,viewportWidth:dr,viewportHeight:Er,framebufferWidth:dr,framebufferHeight:Er,drawingBufferWidth:dr,drawingBufferHeight:Er,pixelRatio:ge.pixelRatio},pr={},Ye={elements:null,primitive:4,count:-1,offset:0,instances:-1},St=sf(Pe,er),or=Z(Pe,Kt,ge,Wt),Mr=Bet(Pe,er,St,Kt,or);function Wt(bn){return Mr.destroyBuffer(bn)}var Nr=Cr(Pe,er,or,Kt),Xt=Vet(Pe,xt,Kt,ge),yr=vet(Pe,er,St,function(){cn.procs.poll()},Jt,Kt,ge),jt=pet(Pe,er,St,Kt,ge),mr=ket(Pe,er,St,yr,jt,Kt),cn=vtt(Pe,xt,er,St,or,Nr,yr,mr,pr,Mr,Xt,Ye,Jt,lr,ge),Hn=Het(Pe,mr,cn.procs.poll,Jt,ct,er,St),Tr=cn.next,hr=Pe.canvas,Ut=[],Nn=[],ci=[],Ur=[ge.onDestroy],Ei=null;function Xn(){if(Ut.length===0){lr&&lr.update(),Ei=null;return}Ei=pn.next(Xn),Sh();for(var bn=Ut.length-1;bn>=0;--bn){var Mi=Ut[bn];Mi&&Mi(Jt,null,0)}Pe.flush(),lr&&lr.update()}function xi(){!Ei&&Ut.length>0&&(Ei=pn.next(Xn))}function Wa(){Ei&&(pn.cancel(Xn),Ei=null)}function Fl(bn){bn.preventDefault(),Ot=!0,Wa(),Nn.forEach(function(Mi){Mi()})}function wu(bn){Pe.getError(),Ot=!1,lt.restore(),Xt.restore(),or.restore(),yr.restore(),jt.restore(),mr.restore(),Mr.restore(),lr&&lr.restore(),cn.procs.refresh(),xi(),ci.forEach(function(Mi){Mi()})}hr&&(hr.addEventListener(_de,Fl,!1),hr.addEventListener(xde,wu,!1));function Ri(){Ut.length=0,Wa(),hr&&(hr.removeEventListener(_de,Fl),hr.removeEventListener(xde,wu)),Xt.clear(),mr.clear(),jt.clear(),yr.clear(),Nr.clear(),or.clear(),Mr.clear(),lr&&lr.clear(),Ur.forEach(function(bn){bn()})}function Jl(bn){J(!!bn,"invalid args to regl({...})"),J.type(bn,"object","invalid args to regl({...})");function Mi(Ke){var Ge=r({},Ke);delete Ge.uniforms,delete Ge.attributes,delete Ge.context,delete Ge.vao,"stencil"in Ge&&Ge.stencil.op&&(Ge.stencil.opBack=Ge.stencil.opFront=Ge.stencil.op,delete Ge.stencil.op);function Fe(ze){if(ze in Ge){var Ee=Ge[ze];delete Ge[ze],Object.keys(Ee).forEach(function(De){Ge[ze+"."+De]=Ee[De]})}}return Fe("blend"),Fe("depth"),Fe("cull"),Fe("stencil"),Fe("polygonOffset"),Fe("scissor"),Fe("sample"),"vao"in Ke&&(Ge.vao=Ke.vao),Ge}function ia(Ke,Ge){var Fe={},ze={};return Object.keys(Ke).forEach(function(Ee){var De=Ke[Ee];if(jr.isDynamic(De)){ze[Ee]=jr.unbox(De,Ee);return}else if(Ge&&Array.isArray(De)){for(var _e=0;_e<De.length;++_e)if(jr.isDynamic(De[_e])){ze[Ee]=jr.unbox(De,Ee);return}}Fe[Ee]=De}),{dynamic:ze,static:Fe}}var El=ia(bn.context||{},!0),K0=ia(bn.uniforms||{},!0),Vw=ia(bn.attributes||{},!1),Ie=ia(Mi(bn),!1),vt={gpuTime:0,cpuTime:0,count:0},it=cn.compile(Ie,Vw,K0,El,vt),Br=it.draw,Ti=it.batch,be=it.scope,de=[];function Ne(Ke){for(;de.length<Ke;)de.push(null);return de}function He(Ke,Ge){var Fe;if(Ot&&J.raise("context lost"),typeof Ke=="function")return be.call(this,null,Ke,0);if(typeof Ge=="function")if(typeof Ke=="number")for(Fe=0;Fe<Ke;++Fe)be.call(this,null,Ge,Fe);else if(Array.isArray(Ke))for(Fe=0;Fe<Ke.length;++Fe)be.call(this,Ke[Fe],Ge,Fe);else return be.call(this,Ke,Ge,0);else if(typeof Ke=="number"){if(Ke>0)return Ti.call(this,Ne(Ke|0),Ke|0)}else if(Array.isArray(Ke)){if(Ke.length)return Ti.call(this,Ke,Ke.length)}else return Br.call(this,Ke)}return r(He,{stats:vt,destroy:function(){it.destroy()}})}var fs=mr.setFBO=Jl({framebuffer:jr.define.call(null,Sde,"framebuffer")});function Bl(bn,Mi){var ia=0;cn.procs.poll();var El=Mi.color;El&&(Pe.clearColor(+El[0]||0,+El[1]||0,+El[2]||0,+El[3]||0),ia|=_tt),"depth"in Mi&&(Pe.clearDepth(+Mi.depth),ia|=xtt),"stencil"in Mi&&(Pe.clearStencil(Mi.stencil|0),ia|=Stt),J(!!ia,"called regl.clear with no buffer specified"),Pe.clear(ia)}function Ql(bn){if(J(typeof bn=="object"&&bn,"regl.clear() takes an object as input"),"framebuffer"in bn)if(bn.framebuffer&&bn.framebuffer_reglType==="framebufferCube")for(var Mi=0;Mi<6;++Mi)fs(r({framebuffer:bn.framebuffer.faces[Mi]},bn),Bl);else fs(bn,Bl);else Bl(null,bn)}function eu(bn){J.type(bn,"function","regl.frame() callback must be a function"),Ut.push(bn);function Mi(){var ia=wde(Ut,bn);J(ia>=0,"cannot cancel a frame twice");function El(){var K0=wde(Ut,El);Ut[K0]=Ut[Ut.length-1],Ut.length-=1,Ut.length<=0&&Wa()}Ut[ia]=El}return xi(),{cancel:Mi}}function Xu(){var bn=Tr.viewport,Mi=Tr.scissor_box;bn[0]=bn[1]=Mi[0]=Mi[1]=0,Jt.viewportWidth=Jt.framebufferWidth=Jt.drawingBufferWidth=bn[2]=Mi[2]=Pe.drawingBufferWidth,Jt.viewportHeight=Jt.framebufferHeight=Jt.drawingBufferHeight=bn[3]=Mi[3]=Pe.drawingBufferHeight}function Sh(){Jt.tick+=1,Jt.time=fi(),Xu(),cn.procs.poll()}function bl(){yr.refresh(),Xu(),cn.procs.refresh(),lr&&lr.update()}function fi(){return(Jn()-tr)/1e3}bl();function wh(bn,Mi){J.type(Mi,"function","listener callback must be a function");var ia;switch(bn){case"frame":return eu(Mi);case"lost":ia=Nn;break;case"restore":ia=ci;break;case"destroy":ia=Ur;break;default:J.raise("invalid event, must be one of frame,lost,restore,destroy")}return ia.push(Mi),{cancel:function(){for(var El=0;El<ia.length;++El)if(ia[El]===Mi){ia[El]=ia[ia.length-1],ia.pop();return}}}}var io=r(Jl,{clear:Ql,prop:jr.define.bind(null,Sde),context:jr.define.bind(null,btt),this:jr.define.bind(null,Ett),draw:Jl({}),buffer:function(bn){return or.create(bn,wtt,!1,!1)},elements:function(bn){return Nr.create(bn,!1)},texture:yr.create2D,cube:yr.createCube,renderbuffer:jt.create,framebuffer:mr.create,framebufferCube:mr.createCube,vao:Mr.createVAO,attributes:ct,frame:eu,on:wh,limits:St,hasExtension:function(bn){return St.extensions.indexOf(bn.toLowerCase())>=0},read:Hn,destroy:Ri,_gl:Pe,_refresh:bl,poll:function(){Sh(),lr&&lr.update()},now:fi,stats:Kt});return ge.onDone(null,io),io}return Ttt})})(CHe);const mhr=CHe.exports;var _hr=function(){function n(e,t){z0(this,n),this.attribute=void 0,this.buffer=void 0;var r=t.buffer,i=t.offset,a=t.stride,o=t.normalized,s=t.size,l=t.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:a||0,normalized:o||!1,divisor:l||0},s&&(this.attribute.size=s)}return U0(n,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),n}(),e1,CP,t1,Qv,AP,px,MP,G5,oy,gb,rc,sy,ly,z5,xhr=(e1={},Lr(e1,Qt.POINTS,"points"),Lr(e1,Qt.LINES,"lines"),Lr(e1,Qt.LINE_LOOP,"line loop"),Lr(e1,Qt.LINE_STRIP,"line strip"),Lr(e1,Qt.TRIANGLES,"triangles"),Lr(e1,Qt.TRIANGLE_FAN,"triangle fan"),Lr(e1,Qt.TRIANGLE_STRIP,"triangle strip"),e1),AHe=(CP={},Lr(CP,Qt.STATIC_DRAW,"static"),Lr(CP,Qt.DYNAMIC_DRAW,"dynamic"),Lr(CP,Qt.STREAM_DRAW,"stream"),CP),zle=(t1={},Lr(t1,Qt.BYTE,"int8"),Lr(t1,Qt.UNSIGNED_INT,"int16"),Lr(t1,Qt.INT,"int32"),Lr(t1,Qt.UNSIGNED_BYTE,"uint8"),Lr(t1,Qt.UNSIGNED_SHORT,"uint16"),Lr(t1,Qt.UNSIGNED_INT,"uint32"),Lr(t1,Qt.FLOAT,"float"),t1),Shr=(Qv={},Lr(Qv,Qt.ALPHA,"alpha"),Lr(Qv,Qt.LUMINANCE,"luminance"),Lr(Qv,Qt.LUMINANCE_ALPHA,"luminance alpha"),Lr(Qv,Qt.RGB,"rgb"),Lr(Qv,Qt.RGBA,"rgba"),Lr(Qv,Qt.RGBA4,"rgba4"),Lr(Qv,Qt.RGB5_A1,"rgb5 a1"),Lr(Qv,Qt.RGB565,"rgb565"),Lr(Qv,Qt.DEPTH_COMPONENT,"depth"),Lr(Qv,Qt.DEPTH_STENCIL,"depth stencil"),Qv),whr=(AP={},Lr(AP,Qt.DONT_CARE,"dont care"),Lr(AP,Qt.NICEST,"nice"),Lr(AP,Qt.FASTEST,"fast"),AP),wEe=(px={},Lr(px,Qt.NEAREST,"nearest"),Lr(px,Qt.LINEAR,"linear"),Lr(px,Qt.LINEAR_MIPMAP_LINEAR,"mipmap"),Lr(px,Qt.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Lr(px,Qt.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Lr(px,Qt.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),px),bEe=(MP={},Lr(MP,Qt.REPEAT,"repeat"),Lr(MP,Qt.CLAMP_TO_EDGE,"clamp"),Lr(MP,Qt.MIRRORED_REPEAT,"mirror"),MP),bhr=(G5={},Lr(G5,Qt.NONE,"none"),Lr(G5,Qt.BROWSER_DEFAULT_WEBGL,"browser"),G5),Ehr=(oy={},Lr(oy,Qt.NEVER,"never"),Lr(oy,Qt.ALWAYS,"always"),Lr(oy,Qt.LESS,"less"),Lr(oy,Qt.LEQUAL,"lequal"),Lr(oy,Qt.GREATER,"greater"),Lr(oy,Qt.GEQUAL,"gequal"),Lr(oy,Qt.EQUAL,"equal"),Lr(oy,Qt.NOTEQUAL,"notequal"),oy),EEe=(gb={},Lr(gb,Qt.FUNC_ADD,"add"),Lr(gb,Qt.MIN_EXT,"min"),Lr(gb,Qt.MAX_EXT,"max"),Lr(gb,Qt.FUNC_SUBTRACT,"subtract"),Lr(gb,Qt.FUNC_REVERSE_SUBTRACT,"reverse subtract"),gb),U5=(rc={},Lr(rc,Qt.ZERO,"zero"),Lr(rc,Qt.ONE,"one"),Lr(rc,Qt.SRC_COLOR,"src color"),Lr(rc,Qt.ONE_MINUS_SRC_COLOR,"one minus src color"),Lr(rc,Qt.SRC_ALPHA,"src alpha"),Lr(rc,Qt.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Lr(rc,Qt.DST_COLOR,"dst color"),Lr(rc,Qt.ONE_MINUS_DST_COLOR,"one minus dst color"),Lr(rc,Qt.DST_ALPHA,"dst alpha"),Lr(rc,Qt.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Lr(rc,Qt.CONSTANT_COLOR,"constant color"),Lr(rc,Qt.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Lr(rc,Qt.CONSTANT_ALPHA,"constant alpha"),Lr(rc,Qt.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Lr(rc,Qt.SRC_ALPHA_SATURATE,"src alpha saturate"),rc),Thr=(sy={},Lr(sy,Qt.NEVER,"never"),Lr(sy,Qt.ALWAYS,"always"),Lr(sy,Qt.LESS,"less"),Lr(sy,Qt.LEQUAL,"lequal"),Lr(sy,Qt.GREATER,"greater"),Lr(sy,Qt.GEQUAL,"gequal"),Lr(sy,Qt.EQUAL,"equal"),Lr(sy,Qt.NOTEQUAL,"notequal"),sy),pC=(ly={},Lr(ly,Qt.ZERO,"zero"),Lr(ly,Qt.KEEP,"keep"),Lr(ly,Qt.REPLACE,"replace"),Lr(ly,Qt.INVERT,"invert"),Lr(ly,Qt.INCR,"increment"),Lr(ly,Qt.DECR,"decrement"),Lr(ly,Qt.INCR_WRAP,"increment wrap"),Lr(ly,Qt.DECR_WRAP,"decrement wrap"),ly),Chr=(z5={},Lr(z5,Qt.FRONT,"front"),Lr(z5,Qt.BACK,"back"),z5),Ahr=function(){function n(e,t){z0(this,n),this.buffer=void 0;var r=t.data,i=t.usage,a=t.type;this.buffer=e.buffer({data:r,usage:AHe[i||Qt.STATIC_DRAW],type:zle[a||Qt.UNSIGNED_BYTE]})}return U0(n,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var r=t.data,i=t.offset;this.buffer.subdata(r,i)}}]),n}();function Kee(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Mhr(n){if(Array.isArray(n))return Kee(n)}function Ihr(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Lhr(n,e){if(n){if(typeof n=="string")return Kee(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Kee(n,e):void 0}}function Phr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ohr(n){return Mhr(n)||Ihr(n)||Lhr(n)||Phr()}function TEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function CEe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?TEe(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):TEe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}var Rhr=`attribute vec3 a_Position;
attribute vec2 a_TexCoord;
varying vec2 v_TexCoord;
void main() {
gl_Position = vec4(a_Position, 1.0);
v_TexCoord = a_TexCoord;
}`,AEe=0,Dhr=function(){function n(e,t){var r=this;z0(this,n),this.reGl=e,this.context=t,this.entity=EHe(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach(function(u){var h=u.name,c=u.type,f=u.data,d=u.isReferer,v=u.storageClass;if(v===zM.StorageBuffer){if(d)r.textureCache[h]={data:void 0},i["".concat(h,"Size")]=function(){return f.compiledBundle.context.output.textureSize};else{r.textureCache[h]=r.calcDataTexture(h,c,f);var p=r.textureCache[h],g=p.textureWidth,m=p.isOutput;i["".concat(h,"Size")]=[g,g],m&&(r.outputTextureName=h,r.context.needPingpong&&(r.outputTextureName="".concat(h,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(h,c,f)))}i[h]=function(){return r.textureCache[h].texture}}else if(v===zM.Uniform){if(f&&(Array.isArray(f)||$9(f))&&f.length>16)throw new Error("invalid data type ".concat(c));i[h]=function(){return u.data}}});var a=this.getOuputDataTexture(),o=a.textureWidth,s=a.texelCount;i.u_OutputTextureSize=[o,o],i.u_OutputTexelCount=s,this.context.output.textureSize=[o,o];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`.concat(this.context.shader),uniforms:i,vert:Rhr,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return U0(n,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()})}},{key:"readData",value:function(){var e=Vc(Rc.mark(function r(){var i=this,a,o,s,l,u,h,c,f;return Rc.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){a=i.reGl.read()}),!a){v.next=6;break}if(o=this.getOuputDataTexture(),s=o.originalDataLength,l=o.elementsPerTexel,u=o.typedArrayConstructor,h=u===void 0?Float32Array:u,c=[],l!==4)for(f=0;f<a.length;f+=4)l===1?c.push(a[f]):l===2?c.push(a[f],a[f+1]):c.push(a[f],a[f+1],a[f+2]);else c=a;return v.abrupt("return",new h(c.slice(0,s)));case 6:return v.abrupt("return",new Float32Array);case 7:case"end":return v.stop()}},r,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"confirmInput",value:function(t,r){var i;this.entity===t.entity?(this.dynamicPingpong=!0,i=this):i=t,this.textureCache[r].id=i.getOuputDataTexture().id,this.textureCache[r].texture=i.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,r){var i=this.context.uniforms.find(function(l){var u=l.name;return u===t});if(i){var a=this.calcDataTexture(t,i.type,r),o=a.texture,s=a.data;this.textureCache[t].data=s,this.textureCache[t].texture=o}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var r=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=r}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var r=t.data,i=t.textureWidth;return CEe(CEe({},t),{},{id:AEe++,texture:this.reGl.texture({width:i,height:i,data:r,type:"float"})})}},{key:"calcDataTexture",value:function(t,r,i){var a=1;r===rN.Vector4FloatArray&&(a=4);for(var o=[],s=0;s<i.length;s+=a)a===1?o.push(i[s],0,0,0):a===2?o.push(i[s],i[s+1],0,0):a===3?o.push(i[s],i[s+1],i[s+2],0):a===4&&o.push(i[s],i[s+1],i[s+2],i[s+3]);var l=i.length,u=Math.ceil(l/a),h=Math.ceil(Math.sqrt(u)),c=h*h;u<c&&o.push.apply(o,Ohr(new Array((c-u)*4).fill(0)));var f=this.reGl.texture({width:h,height:h,data:o,type:"float"});return{id:AEe++,data:o,originalDataLength:l,typedArrayConstructor:$9(i)?i.constructor:void 0,textureWidth:h,texture:f,texelCount:u,elementsPerTexel:a,isOutput:t===this.context.output.name}}}]),n}(),Nhr=function(){function n(e,t){z0(this,n),this.elements=void 0;var r=t.data,i=t.usage,a=t.type,o=t.count;this.elements=e.elements({data:r,usage:AHe[i||Qt.STATIC_DRAW],type:zle[a||Qt.UNSIGNED_BYTE],count:o})}return U0(n,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var r=t.data;this.elements.subdata(r)}},{key:"destroy",value:function(){this.elements.destroy()}}]),n}(),khr=function(){function n(e,t){z0(this,n),this.framebuffer=void 0;var r=t.width,i=t.height,a=t.color,o=t.colors;t.depth,t.stencil;var s={width:r,height:i};Array.isArray(o)&&(s.colors=o.map(function(l){return l.get()})),a&&typeof a!="boolean"&&(s.color=a.get()),this.framebuffer=e.framebuffer(s)}return U0(n,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var r=t.width,i=t.height;this.framebuffer.resize(r,i)}}]),n}();function Fhr(n,e){return function(t){return n(e(t))}}var Bhr=Fhr,Ghr=Bhr,zhr=Ghr(Object.getPrototypeOf,Object),Uhr=zhr,Vhr=Rle,$hr=Uhr,Whr=Dle,Hhr="[object Object]",jhr=Function.prototype,Xhr=Object.prototype,MHe=jhr.toString,Yhr=Xhr.hasOwnProperty,qhr=MHe.call(Object);function Zhr(n){if(!Whr(n)||Vhr(n)!=Hhr)return!1;var e=$hr(n);if(e===null)return!0;var t=Yhr.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&MHe.call(t)==qhr}var Khr=Zhr;function CY(n){var e={};return Object.keys(n).forEach(function(t){Jee(t,n[t],e,"")}),e}function Jee(n,e,t,r){if(e===null||typeof e=="number"||typeof e=="boolean"||Array.isArray(e)&&typeof e[0]=="number"||$9(e)||e===""||e.resize!==void 0){t["".concat(r&&r+".").concat(n)]=e;return}Khr(e)&&Object.keys(e).forEach(function(i){Jee(i,e[i],t,"".concat(r&&r+".").concat(n))}),Array.isArray(e)&&e.forEach(function(i,a){Object.keys(i).forEach(function(o){Jee(o,i[o],t,"".concat(r&&r+".").concat(n,"[").concat(a,"]"))})})}function MEe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gC(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?MEe(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):MEe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}var Jhr=function(){function n(e,t){z0(this,n),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=t.vs,i=t.fs,a=t.defines,o=t.attributes,s=t.uniforms,l=t.primitive,u=t.count,h=t.elements,c=t.depth,f=t.blend,d=t.stencil,v=t.cull,p=t.instances,g=t.scissor,m=t.viewport,y={};s&&(this.uniforms=CY(s),Object.keys(s).forEach(function(w){y[w]=e.prop(w)}));var _={};Object.keys(o).forEach(function(w){_[w]=o[w].get()});var x=a&&this.generateDefines(a)||"",S={attributes:_,frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
`.concat(x,`
`).concat(i),uniforms:y,vert:`
`.concat(x,`
`).concat(r),primitive:xhr[l===void 0?Qt.TRIANGLES:l]};p&&(S.instances=p),u&&(S.count=u),h&&(S.elements=h.get()),g&&(S.scissor=g),m&&(S.viewport=m),this.initDepthDrawParams({depth:c},S),this.initBlendDrawParams({blend:f},S),this.initStencilDrawParams({stencil:d},S),this.initCullDrawParams({cull:v},S),this.drawCommand=e(S)}return U0(n,[{key:"addUniforms",value:function(t){this.uniforms=gC(gC({},this.uniforms),CY(t))}},{key:"draw",value:function(t){var r=gC(gC({},this.uniforms),CY(t.uniforms||{})),i={};Object.keys(r).forEach(function(a){var o=GM(r[a]);o==="boolean"||o==="number"||Array.isArray(r[a])||r[a].BYTES_PER_ELEMENT?i[a]=r[a]:o==="string"||(i[a]=r[a].get())}),this.drawCommand(i)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,r){var i=t.depth;i&&(r.depth={enable:i.enable===void 0?!0:!!i.enable,mask:i.mask===void 0?!0:!!i.mask,func:Ehr[i.func||Qt.LESS],range:i.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,r){var i=t.blend;if(i){var a=i.enable,o=i.func,s=i.equation,l=i.color,u=l===void 0?[0,0,0,0]:l;r.blend={enable:!!a,func:{srcRGB:U5[o&&o.srcRGB||Qt.SRC_ALPHA],srcAlpha:U5[o&&o.srcAlpha||Qt.SRC_ALPHA],dstRGB:U5[o&&o.dstRGB||Qt.ONE_MINUS_SRC_ALPHA],dstAlpha:U5[o&&o.dstAlpha||Qt.ONE_MINUS_SRC_ALPHA]},equation:{rgb:EEe[s&&s.rgb||Qt.FUNC_ADD],alpha:EEe[s&&s.alpha||Qt.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,r){var i=t.stencil;if(i){var a=i.enable,o=i.mask,s=o===void 0?-1:o,l=i.func,u=l===void 0?{cmp:Qt.ALWAYS,ref:0,mask:-1}:l,h=i.opFront,c=h===void 0?{fail:Qt.KEEP,zfail:Qt.KEEP,zpass:Qt.KEEP}:h,f=i.opBack,d=f===void 0?{fail:Qt.KEEP,zfail:Qt.KEEP,zpass:Qt.KEEP}:f;r.stencil={enable:!!a,mask:s,func:gC(gC({},u),{},{cmp:Thr[u.cmp]}),opFront:{fail:pC[c.fail],zfail:pC[c.zfail],zpass:pC[c.zpass]},opBack:{fail:pC[d.fail],zfail:pC[d.zfail],zpass:pC[d.zpass]}}}}},{key:"initCullDrawParams",value:function(t,r){var i=t.cull;if(i){var a=i.enable,o=i.face,s=o===void 0?Qt.BACK:o;r.cull={enable:!!a,face:Chr[s]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map(function(r){return"#define ".concat(r," ").concat(Number(t[r]))}).join(`
`)}}]),n}(),Qhr=function(){function n(e,t){z0(this,n),this.texture=void 0,this.width=void 0,this.height=void 0;var r=t.data,i=t.type,a=i===void 0?Qt.UNSIGNED_BYTE:i,o=t.width,s=t.height,l=t.flipY,u=l===void 0?!1:l,h=t.format,c=h===void 0?Qt.RGBA:h,f=t.mipmap,d=f===void 0?!1:f,v=t.wrapS,p=v===void 0?Qt.CLAMP_TO_EDGE:v,g=t.wrapT,m=g===void 0?Qt.CLAMP_TO_EDGE:g,y=t.aniso,_=y===void 0?0:y,x=t.alignment,S=x===void 0?1:x,w=t.premultiplyAlpha,b=w===void 0?!1:w,E=t.mag,T=E===void 0?Qt.NEAREST:E,C=t.min,A=C===void 0?Qt.NEAREST:C,M=t.colorSpace,I=M===void 0?Qt.BROWSER_DEFAULT_WEBGL:M;this.width=o,this.height=s;var R={width:o,height:s,type:zle[a],format:Shr[c],wrapS:bEe[p],wrapT:bEe[m],mag:wEe[T],min:wEe[A],alignment:S,flipY:u,colorSpace:bhr[I],premultiplyAlpha:b,aniso:_};r&&(R.data=r),typeof d=="number"?R.mipmap=whr[d]:typeof d=="boolean"&&(R.mipmap=d),this.texture=e.texture(R)}return U0(n,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var r=t.width,i=t.height;this.texture.resize(r,i),this.width=r,this.height=i}},{key:"destroy",value:function(){this.texture.destroy()}}]),n}(),ecr=function(){function n(){var e=this;z0(this,n),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Vc(Rc.mark(function r(i){return Rc.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!i.uniforms){o.next=3;break}return o.next=3,Promise.all(Object.keys(i.uniforms).map(function(){var s=Vc(Rc.mark(function l(u){var h;return Rc.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(!(i.uniforms[u]&&i.uniforms[u].load!==void 0)){f.next=5;break}return f.next=3,i.uniforms[u].load();case 3:h=f.sent,i.uniforms[u]=h;case 5:case"end":return f.stop()}},l)}));return function(l){return s.apply(this,arguments)}}()));case 3:return o.abrupt("return",new Jhr(e.gl,i));case 4:case"end":return o.stop()}},r)}));return function(r){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new _hr(e.gl,t)},this.createBuffer=function(t){return new Ahr(e.gl,t)},this.createElements=function(t){return new Nhr(e.gl,t)},this.createTexture2D=function(t){return new Qhr(e.gl,t)},this.createFramebuffer=function(t){return new khr(e.gl,t)},this.useFramebuffer=function(t,r){e.gl({framebuffer:t?t.get():null})(r)},this.createComputeModel=function(){var t=Vc(Rc.mark(function r(i){return Rc.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Dhr(e.gl,i));case 1:case"end":return o.stop()}},r)}));return function(r){return t.apply(this,arguments)}}(),this.clear=function(t){var r=t.color,i=t.depth,a=t.stencil,o=t.framebuffer,s=o===void 0?null:o,l={color:r,depth:i,stencil:a};l.framebuffer=s===null?s:s.get(),e.gl.clear(l)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Qt.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Qt.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(r,i,a,o),e.gl._refresh())},this.readPixels=function(t){var r=t.framebuffer,i=t.x,a=t.y,o=t.width,s=t.height,l={x:i,y:a,width:o,height:s};return r&&(l.framebuffer=r.get()),e.gl.read(l)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}return U0(n,[{key:"init",value:function(){var e=Vc(Rc.mark(function r(i){return Rc.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!this.inited){o.next=2;break}return o.abrupt("return");case 2:return this.$canvas=i.canvas,o.next=5,new Promise(function(s,l){mhr({canvas:i.canvas,attributes:{alpha:!0,antialias:i.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(h,c){(h||!c)&&l(h),s(c)}})});case 5:this.gl=o.sent,this.inited=!0;case 7:case"end":return o.stop()}},r,this)}));function t(r){return e.apply(this,arguments)}return t}()},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),n}(),tcr=function(){function n(){z0(this,n),this.engine=void 0,this.configService=new phr}return U0(n,[{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setEngine",value:function(t){this.engine=t}},{key:"createEntity",value:function(){return EHe()}},{key:"createKernel",value:function(t){var r=new THe(this.engine,this.configService);return typeof t=="string"?r.setBundle(JSON.parse(t)):r.setBundle(t),r.init(),r}},{key:"destroy",value:function(){this.engine.destroy()}}],[{key:"create",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new n;return r.setConfig(t),r.setEngine(new ecr),r}}]),n}();const rcr=Object.freeze(Object.defineProperty({__proto__:null,World:tcr,Kernel:THe},Symbol.toStringTag,{value:"Module"})),IHe=Nd(rcr);var lv={};Object.defineProperty(lv,"__esModule",{value:!0});lv.arrayToTextureData=lv.attributesToTextureData=lv.buildTextureDataWithTwoEdgeAttr=lv.buildTextureData=lv.proccessToFunc=void 0;var ncr=Dl(),W9=nV,icr=function(n,e){var t;return n?(0,ncr.isNumber)(n)?t=function(){return n}:t=n:t=function(){return e||1},t};lv.proccessToFunc=icr;var acr=function(n,e){var t=[],r=[],i={},a=0;for(a=0;a<n.length;a++){var o=n[a];i[o.id]=a,t.push(o.x),t.push(o.y),t.push(0),t.push(0),r.push([])}for(a=0;a<e.length;a++){var s=e[a],l=(0,W9.getEdgeTerminal)(s,"source"),u=(0,W9.getEdgeTerminal)(s,"target");!isNaN(i[l])&&!isNaN(i[u])&&(r[i[l]].push(i[u]),r[i[u]].push(i[l]))}var h=0;for(a=0;a<n.length;a++){var c=t.length,f=r[a],d=f.length;t[a*4+2]=c,t[a*4+3]=d,h=Math.max(h,d);for(var v=0;v<d;++v){var p=f[v];t.push(+p)}}for(;t.length%4!==0;)t.push(0);return{maxEdgePerVetex:h,array:new Float32Array(t)}};lv.buildTextureData=acr;var ocr=function(n,e,t,r){var i=[],a=[],o={},s=0;for(s=0;s<n.length;s++){var l=n[s];o[l.id]=s,i.push(l.x),i.push(l.y),i.push(0),i.push(0),a.push([])}for(s=0;s<e.length;s++){var u=e[s],h=(0,W9.getEdgeTerminal)(u,"source"),c=(0,W9.getEdgeTerminal)(u,"target");a[o[h]].push(o[c]),a[o[h]].push(t(u)),a[o[h]].push(r(u)),a[o[h]].push(0),a[o[c]].push(o[h]),a[o[c]].push(t(u)),a[o[c]].push(r(u)),a[o[c]].push(0)}var f=0;for(s=0;s<n.length;s++){var d=i.length,v=a[s],p=v.length;i[s*4+2]=d+1048576*p/4,i[s*4+3]=0,f=Math.max(f,p/4);for(var g=0;g<p;++g){var m=v[g];i.push(+m)}}for(;i.length%4!==0;)i.push(0);return{maxEdgePerVetex:f,array:new Float32Array(i)}};lv.buildTextureDataWithTwoEdgeAttr=ocr;var scr=function(n,e){var t=[],r=n.length,i={};return e.forEach(function(a){n.forEach(function(o,s){if(i[a[o]]===void 0&&(i[a[o]]=Object.keys(i).length),t.push(i[a[o]]),s===r-1)for(;t.length%4!==0;)t.push(0)})}),{array:new Float32Array(t),count:Object.keys(i).length}};lv.attributesToTextureData=scr;var lcr=function(n){for(var e=[],t=n.length,r=n[0].length,i=function(o){n.forEach(function(s,l){if(e.push(s[o]),l===t-1)for(;e.length%4!==0;)e.push(0)})},a=0;a<r;a++)i(a);return new Float32Array(e)};lv.arrayToTextureData=lcr;var Wy={};Object.defineProperty(Wy,"__esModule",{value:!0});Wy.clusterBundle=Wy.clusterCode=Wy.fruchtermanBundle=Wy.fruchtermanCode=void 0;Wy.fruchtermanCode=`
import { globalInvocationID } from 'g-webgpu';
const MAX_EDGE_PER_VERTEX;
const VERTEX_COUNT;
@numthreads(1, 1, 1)
class Fruchterman {
@in @out
u_Data: vec4[];
@in
u_K: float;
@in
u_K2: float;
@in
u_Center: vec2;
@in
u_Gravity: float;
@in
u_ClusterGravity: float;
@in
u_Speed: float;
@in
u_MaxDisplace: float;
@in
u_Clustering: float;
@in
u_AttributeArray: vec4[];
@in
u_ClusterCenters: vec4[];
calcRepulsive(i: int, currentNode: vec4): vec2 {
let dx = 0, dy = 0;
for (let j = 0; j < VERTEX_COUNT; j++) {
if (i != j) {
const nextNode = this.u_Data[j];
const xDist = currentNode[0] - nextNode[0];
const yDist = currentNode[1] - nextNode[1];
const dist = (xDist * xDist + yDist * yDist) + 0.01;
let param = this.u_K2 / dist;
if (dist > 0.0) {
dx += param * xDist;
dy += param * yDist;
if (xDist == 0 && yDist == 0) {
const sign = i < j ? 1 : -1;
dx += param * sign;
dy += param * sign;
}
}
}
}
return [dx, dy];
}
calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { //
let dx = 0, dy = 0;
const vx = currentNode[0] - this.u_Center[0];
const vy = currentNode[1] - this.u_Center[1];
const gf = 0.01 * this.u_K * this.u_Gravity;
dx = gf * vx;
dy = gf * vy;
if (this.u_Clustering == 1) {
const clusterIdx = int(nodeAttributes[0]);
const center = this.u_ClusterCenters[clusterIdx];
const cvx = currentNode[0] - center[0];
const cvy = currentNode[1] - center[1];
const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;
const parma = this.u_K * this.u_ClusterGravity / dist;
dx += parma * cvx;
dy += parma * cvy;
}
return [dx, dy];
}
calcAttractive(i: int, currentNode: vec4): vec2 {
let dx = 0, dy = 0;
const arr_offset = int(floor(currentNode[2] + 0.5));
const length = int(floor(currentNode[3] + 0.5));
const node_buffer: vec4;
for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {
if (p >= length) break;
const arr_idx = arr_offset + p;
// when arr_idx % 4 == 0 update currentNodedx_buffer
const buf_offset = arr_idx - arr_idx / 4 * 4;
if (p == 0 || buf_offset == 0) {
node_buffer = this.u_Data[int(arr_idx / 4)];
}
const float_j = buf_offset == 0 ? node_buffer[0] :
buf_offset == 1 ? node_buffer[1] :
buf_offset == 2 ? node_buffer[2] :
node_buffer[3];
const nextNode = this.u_Data[int(float_j)];
const xDist = currentNode[0] - nextNode[0];
const yDist = currentNode[1] - nextNode[1];
const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;
let attractiveF = dist / this.u_K;
if (dist > 0.0) {
dx -= xDist * attractiveF;
dy -= yDist * attractiveF;
if (xDist == 0 && yDist == 0) {
const sign = i < int(float_j) ? 1 : -1;
dx -= sign * attractiveF;
dy -= sign * attractiveF;
}
}
}
return [dx, dy];
}
@main
compute() {
const i = globalInvocationID.x;
const currentNode = this.u_Data[i];
let dx = 0, dy = 0;
if (i >= VERTEX_COUNT) {
this.u_Data[i] = currentNode;
return;
}
// [gravity, fx, fy, 0]
const nodeAttributes = this.u_AttributeArray[i];
if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {
// the node is fixed
this.u_Data[i] = [
nodeAttributes[1],
nodeAttributes[2],
currentNode[2],
currentNode[3]
];
return;
}
// repulsive
const repulsive = this.calcRepulsive(i, currentNode);
dx += repulsive[0];
dy += repulsive[1];
// attractive
const attractive = this.calcAttractive(i, currentNode);
dx += attractive[0];
dy += attractive[1];
// gravity
const gravity = this.calcGravity(currentNode, nodeAttributes);
dx -= gravity[0];
dy -= gravity[1];
// speed
dx *= this.u_Speed;
dy *= this.u_Speed;
// move
const distLength = sqrt(dx * dx + dy * dy);
if (distLength > 0.0) {
const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);
this.u_Data[i] = [
currentNode[0] + dx / distLength * limitedDist,
currentNode[1] + dy / distLength * limitedDist,
currentNode[2],
currentNode[3]
];
}
}
}
`;Wy.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}';Wy.clusterCode=`
import { globalInvocationID } from 'g-webgpu';
const VERTEX_COUNT;
const CLUSTER_COUNT;
@numthreads(1, 1, 1)
class CalcCenter {
@in
u_Data: vec4[];
@in
u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]
@in @out
u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]
@main
compute() {
const i = globalInvocationID.x;
const center = this.u_ClusterCenters[i];
let sumx = 0;
let sumy = 0;
let count = 0;
for (let j = 0; j < VERTEX_COUNT; j++) {
const attributes = this.u_NodeAttributes[j];
const clusterIdx = int(attributes[0]);
const vertex = this.u_Data[j];
if (clusterIdx == i) {
sumx += vertex.x;
sumy += vertex.y;
count += 1;
}
}
this.u_ClusterCenters[i] = [
sumx / count,
sumy / count,
count,
i
];
}
}
`;Wy.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}';var ucr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),V5=at&&at.__awaiter||function(n,e,t,r){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(h){try{u(r.next(h))}catch(c){o(c)}}function l(h){try{u(r.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):i(h.value).then(s,l)}u((r=r.apply(n,e||[])).next())})},$5=at&&at.__generator||function(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(h){u=[6,h],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(ck,"__esModule",{value:!0});ck.FruchtermanGPULayout=void 0;var hcr=Xl,yC=Dl(),IEe=IHe,LEe=lv,PEe=Wy,ccr=y_,fcr=function(n){ucr(e,n);function e(t){var r=n.call(this)||this;return r.maxIteration=1e3,r.gravity=10,r.speed=1,r.clustering=!1,r.clusterField="cluster",r.clusterGravity=10,r.workerEnabled=!1,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return V5(this,void 0,void 0,function(){var t,r,i,a,o,s=this;return $5(this,function(l){switch(l.label){case 0:return t=this,r=t.nodes,!r||r.length===0?(t.onLayoutEnd&&t.onLayoutEnd(),[2]):(!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),i=t.center,r.length===1?(r[0].x=i[0],r[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(a={},o={},r.forEach(function(u,h){(0,yC.isNumber)(u.x)||(u.x=Math.random()*s.width),(0,yC.isNumber)(u.y)||(u.y=Math.random()*s.height),a[u.id]=u,o[u.id]=h}),t.nodeMap=a,t.nodeIdxMap=o,[4,t.run()]));case 1:return l.sent(),[2]}})})},e.prototype.executeWithWorker=function(t,r){return V5(this,void 0,void 0,function(){var i,a,o,s,l,u=this;return $5(this,function(h){switch(h.label){case 0:return i=this,a=i.nodes,o=i.center,!a||a.length===0?[2]:a.length===1?(a[0].x=o[0],a[0].y=o[1],[2]):(s={},l={},a.forEach(function(c,f){(0,yC.isNumber)(c.x)||(c.x=Math.random()*u.width),(0,yC.isNumber)(c.y)||(c.y=Math.random()*u.height),s[c.id]=c,l[c.id]=f}),i.nodeMap=s,i.nodeIdxMap=l,[4,i.run(t,r)]);case 1:return h.sent(),[2]}})})},e.prototype.run=function(t,r){return V5(this,void 0,void 0,function(){var i,a,o,s,l,u,h,c,f,d,v,p,g,m,y,_,x,S,w,b,E,T,C,A,M,I,R=this;return $5(this,function(k){switch(k.label){case 0:for(i=this,a=i.nodes,o=i.edges,s=i.maxIteration,l=i.center,u=i.height*i.width,h=Math.sqrt(u)/10,c=u/(a.length+1),f=Math.sqrt(c),d=i.speed,v=i.clustering,p=(0,LEe.attributesToTextureData)([i.clusterField],a),g=p.array,m=p.count,a.forEach(function(D,G){var W=0,z=0;(0,yC.isNumber)(D.fx)&&(0,yC.isNumber)(D.fy)&&(W=D.fx||.001,z=D.fy||.001),g[4*G+1]=W,g[4*G+2]=z}),y=a.length,_=(0,LEe.buildTextureData)(a,o),x=_.maxEdgePerVetex,S=_.array,w=i.workerEnabled,w?b=IEe.World.create({canvas:t,engineOptions:{supportCompute:!0}}):b=IEe.World.create({engineOptions:{supportCompute:!0}}),E=i.onLayoutEnd,T=[],C=0;C<m;C++)T.push(0,0,0,0);return A=b.createKernel(PEe.fruchtermanBundle).setDispatch([y,1,1]).setBinding({u_Data:S,u_K:f,u_K2:c,u_Gravity:i.gravity,u_ClusterGravity:i.clusterGravity||i.gravity||1,u_Speed:d,u_MaxDisplace:h,u_Clustering:v?1:0,u_Center:l,u_AttributeArray:g,u_ClusterCenters:T,MAX_EDGE_PER_VERTEX:x,VERTEX_COUNT:y}),v&&(M=b.createKernel(PEe.clusterBundle).setDispatch([m,1,1]).setBinding({u_Data:S,u_NodeAttributes:g,u_ClusterCenters:T,VERTEX_COUNT:y,CLUSTER_COUNT:m})),I=function(){return V5(R,void 0,void 0,function(){var D,G;return $5(this,function(W){switch(W.label){case 0:D=0,W.label=1;case 1:return D<s?[4,A.execute()]:[3,6];case 2:return W.sent(),v?(M.setBinding({u_Data:A}),[4,M.execute()]):[3,4];case 3:W.sent(),A.setBinding({u_ClusterCenters:M}),W.label=4;case 4:A.setBinding({u_MaxDisplace:h*=.99}),W.label=5;case 5:return D++,[3,1];case 6:return[4,A.getOutput()];case 7:return G=W.sent(),t?r.postMessage({type:ccr.LAYOUT_MESSAGE.GPUEND,vertexEdgeData:G}):a.forEach(function(z,V){var q=G[4*V],Y=G[4*V+1];z.x=q,z.y=Y}),E&&E(),[2]}})})},[4,I()];case 1:return k.sent(),[2]}})})},e.prototype.getType=function(){return"fruchterman-gpu"},e}(hcr.Base);ck.FruchtermanGPULayout=fcr;var fk={},Hy={};Object.defineProperty(Hy,"__esModule",{value:!0});Hy.aveMovementBundle=Hy.aveMovementCode=Hy.gForceBundle=Hy.gForceCode=void 0;Hy.gForceCode=`
import { globalInvocationID } from 'g-webgpu';
const MAX_EDGE_PER_VERTEX;
const VERTEX_COUNT;
const SHIFT_20 = 1048576;
@numthreads(1, 1, 1)
class GGForce {
@in @out
u_Data: vec4[];
@in
u_damping: float;
@in
u_maxSpeed: float;
@in
u_minMovement: float;
@in
u_AveMovement: vec4[];
@in
u_coulombDisScale: float;
@in
u_factor: float;
@in
u_NodeAttributeArray1: vec4[];
@in
u_NodeAttributeArray2: vec4[];
@in
u_interval: float;
unpack_float(packedValue: float): ivec2 {
const packedIntValue = int(packedValue);
const v0 = packedIntValue / SHIFT_20;
return [v0, packedIntValue - v0 * SHIFT_20];
}
calcRepulsive(i: int, currentNode: vec4): vec2 {
let ax = 0, ay = 0;
for (let j: int = 0; j < VERTEX_COUNT; j++) {
if (i != j) {
const nextNode = this.u_Data[j];
const vx = currentNode[0] - nextNode[0];
const vy = currentNode[1] - nextNode[1];
const dist = sqrt(vx * vx + vy * vy) + 0.01;
const n_dist = (dist + 0.1) * this.u_coulombDisScale;
const direx = vx / dist;
const direy = vy / dist;
const attributesi = this.u_NodeAttributeArray1[i];
const attributesj = this.u_NodeAttributeArray1[j];
const massi = attributesi[0];
const nodeStrengthi = attributesi[2];
const nodeStrengthj = attributesj[2];
const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;
// const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);
const param = nodeStrength * this.u_factor / (n_dist * n_dist);
ax += direx * param;
ay += direy * param;
}
}
return [ax, ay];
}
calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {
// note: attributes2 = [centerX, centerY, gravity, 0]
const vx = currentNode[0] - attributes2[0];
const vy = currentNode[1] - attributes2[1];
const ax = vx * attributes2[2];
const ay = vy * attributes2[2];
return [ax, ay];
}
calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {
// note: attributes1 = [mass, degree, nodeSterngth, 0]
const mass = attributes1[0];
let ax = 0, ay = 0;
// const arr_offset = int(floor(currentNode[2] + 0.5));
// const length = int(floor(currentNode[3] + 0.5));
const compressed = this.unpack_float(currentNode[2]);
const length = compressed[0];
const arr_offset = compressed[1];
const node_buffer: vec4;
for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {
if (p >= length) break;
const arr_idx = arr_offset + 4 * p; // i \u8282\u70B9\u7684\u7B2C p \u6761\u8FB9\u5F00\u59CB\u7684\u5C0F\u683C\u5B50\u4F4D\u7F6E
const buf_offset = arr_idx - arr_idx / 4 * 4;
if (p == 0 || buf_offset == 0) {
node_buffer = this.u_Data[int(arr_idx / 4)]; // \u5927\u683C\u5B50\uFF0C\u5927\u683C\u5B50\u4F4D\u7F6E=\u5C0F\u4E2A\u5B50\u4F4D\u7F6E / 4\uFF0C
}
let float_j: float = node_buffer[0];
const nextNode = this.u_Data[int(float_j)];
const vx = nextNode[0] - currentNode[0];
const vy = nextNode[1] - currentNode[1];
const dist = sqrt(vx * vx + vy * vy) + 0.01;
const direx = vx / dist;
const direy = vy / dist;
const edgeLength = node_buffer[1];
const edgeStrength = node_buffer[2];
const diff: float = edgeLength - dist;//edgeLength
// const param = diff * this.u_stiffness / mass; //
const param = diff * edgeStrength / mass; //
ax -= direx * param;
ay -= direy * param;
}
return [ax, ay];
}
@main
compute() {
const i = globalInvocationID.x;
const currentNode = this.u_Data[i];
const movement = u_AveMovement[0];
let ax = 0, ay = 0;
if (i >= VERTEX_COUNT || movement.x < u_minMovement) {
this.u_Data[i] = currentNode;
return;
}
// \u6BCF\u4E2A\u8282\u70B9\u5C5E\u6027\u5360\u4E24\u4E2A\u6570\u7EC4\u4E2D\u5404\u4E00\u683C
// [mass, degree, nodeStrength, fx]
const nodeAttributes1 = this.u_NodeAttributeArray1[i];
// [centerX, centerY, centerGravity, fy]
const nodeAttributes2 = this.u_NodeAttributeArray2[i];
// repulsive
const repulsive = this.calcRepulsive(i, currentNode);
ax += repulsive[0];
ay += repulsive[1];
// attractive
const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);
ax += attractive[0];
ay += attractive[1];
// gravity
const gravity = this.calcGravity(i, currentNode, nodeAttributes2);
ax -= gravity[0];
ay -= gravity[1];
// speed
const param = this.u_interval * this.u_damping;
let vx = ax * param;
let vy = ay * param;
const vlength = sqrt(vx * vx + vy * vy) + 0.0001;
if (vlength > this.u_maxSpeed) {
const param2 = this.u_maxSpeed / vlength;
vx = param2 * vx;
vy = param2 * vy;
}
// move
if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {
this.u_Data[i] = [
nodeAttributes1[3],
nodeAttributes2[3],
currentNode[2],
0
];
} else {
const distx = vx * this.u_interval;
const disty = vy * this.u_interval;
const distLength = sqrt(distx * distx + disty * disty);
this.u_Data[i] = [
currentNode[0] + distx,
currentNode[1] + disty,
currentNode[2],
distLength
];
}
// the avarage move distance
// need to share memory
}
}
`;Hy.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}';Hy.aveMovementCode=`
const VERTEX_COUNT;
@numthreads(1, 1, 1)
class CalcAveMovement {
@in
u_Data: vec4[];
@in
u_iter: float;
@in @out
u_AveMovement: vec4[];
@main
compute() {
let movement = 0;
for (let j: int = 0; j < VERTEX_COUNT; j++) {
const vertex = this.u_Data[j];
movement += vertex[3];
}
movement = movement / float(VERTEX_COUNT);
this.u_AveMovement[0] = [movement, 0, 0, 0];
}
}
`;Hy.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}';var dcr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),AY=at&&at.__awaiter||function(n,e,t,r){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(h){try{u(r.next(h))}catch(c){o(c)}}function l(h){try{u(r.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):i(h.value).then(s,l)}u((r=r.apply(n,e||[])).next())})},MY=at&&at.__generator||function(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(h){u=[6,h],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(fk,"__esModule",{value:!0});fk.GForceGPULayout=void 0;var vcr=Xl,r1=Dl(),OEe=IHe,n1=lv,pcr=nV,REe=Hy,gcr=y_,ycr=function(n){dcr(e,n);function e(t){var r=n.call(this)||this;return r.maxIteration=1e3,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.workerEnabled=!1,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return AY(this,void 0,void 0,function(){var t,r,i,a,o;return MY(this,function(s){switch(s.label){case 0:return t=this,r=t.nodes,!r||r.length===0?(t.onLayoutEnd&&t.onLayoutEnd(),[2]):(!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),i=t.center,r.length===1?(r[0].x=i[0],r[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(a={},o={},r.forEach(function(l,u){(0,r1.isNumber)(l.x)||(l.x=Math.random()*t.width),(0,r1.isNumber)(l.y)||(l.y=Math.random()*t.height),a[l.id]=l,o[l.id]=u}),t.nodeMap=a,t.nodeIdxMap=o,t.nodeStrength=(0,n1.proccessToFunc)(t.nodeStrength,1),t.edgeStrength=(0,n1.proccessToFunc)(t.edgeStrength,1),[4,t.run()]));case 1:return s.sent(),[2]}})})},e.prototype.executeWithWorker=function(t,r){var i=this,a=i.nodes,o=i.center;if(!(!a||a.length===0)){if(a.length===1){a[0].x=o[0],a[0].y=o[1];return}var s={},l={};a.forEach(function(u,h){(0,r1.isNumber)(u.x)||(u.x=Math.random()*i.width),(0,r1.isNumber)(u.y)||(u.y=Math.random()*i.height),s[u.id]=u,l[u.id]=h}),i.nodeMap=s,i.nodeIdxMap=l,i.nodeStrength=(0,n1.proccessToFunc)(i.nodeStrength,1),i.edgeStrength=(0,n1.proccessToFunc)(i.edgeStrength,1),i.run(t,r)}},e.prototype.run=function(t,r){return AY(this,void 0,void 0,function(){var i,a,o,s,l,u,h,c,f,d,v,p,g,m,y,_,x,S,w,b,E,T,C,A,M,I,R,k=this;return MY(this,function(D){switch(D.label){case 0:for(i=this,a=i.nodes,o=i.edges,s=i.maxIteration,!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),l=a.length,i.linkDistance=(0,n1.proccessToFunc)(i.linkDistance),i.edgeStrength=(0,n1.proccessToFunc)(i.edgeStrength),u=(0,n1.buildTextureDataWithTwoEdgeAttr)(a,o,i.linkDistance,i.edgeStrength),h=u.maxEdgePerVetex,c=u.array,i.degrees=(0,pcr.getDegree)(a.length,i.nodeIdxMap,o).map(function(G){return G.all}),f=[],d=[],v=[],p=[],g=[],m=[],y=[],i.getMass||(i.getMass=function(G){return i.degrees[i.nodeIdxMap[G.id]]||1}),_=i.gravity,x=i.center,a.forEach(function(G,W){f.push(i.getMass(G)),d.push(i.nodeStrength(G)),i.degrees[W]||(i.degrees[W]=0);var z=[x[0],x[1],_];if(i.getCenter){var V=i.getCenter(G,i.degrees[W]);V&&(0,r1.isNumber)(V[0])&&(0,r1.isNumber)(V[1])&&(0,r1.isNumber)(V[2])&&(z=V)}v.push(z[0]),p.push(z[1]),g.push(z[2]),(0,r1.isNumber)(G.fx)&&(0,r1.isNumber)(G.fy)?(m.push(G.fx||.001),y.push(G.fy||.001)):(m.push(0),y.push(0))}),S=(0,n1.arrayToTextureData)([f,i.degrees,d,m]),w=(0,n1.arrayToTextureData)([v,p,g,y]),b=i.workerEnabled,b?E=OEe.World.create({canvas:t,engineOptions:{supportCompute:!0}}):E=OEe.World.create({engineOptions:{supportCompute:!0}}),T=i.onLayoutEnd,C=[],c.forEach(function(G){C.push(G)}),A=0;A<4;A++)C.push(0);return M=E.createKernel(REe.gForceBundle).setDispatch([l,1,1]).setBinding({u_Data:c,u_damping:i.damping,u_maxSpeed:i.maxSpeed,u_minMovement:i.minMovement,u_coulombDisScale:i.coulombDisScale,u_factor:i.factor,u_NodeAttributeArray1:S,u_NodeAttributeArray2:w,MAX_EDGE_PER_VERTEX:h,VERTEX_COUNT:l,u_AveMovement:C,u_interval:i.interval}),I=E.createKernel(REe.aveMovementBundle).setDispatch([1,1,1]).setBinding({u_Data:c,VERTEX_COUNT:l,u_AveMovement:[0,0,0,0]}),R=function(){return AY(k,void 0,void 0,function(){var G,W,z;return MY(this,function(V){switch(V.label){case 0:G=0,V.label=1;case 1:return G<s?[4,M.execute()]:[3,5];case 2:return V.sent(),I.setBinding({u_Data:M}),[4,I.execute()];case 3:V.sent(),W=Math.max(.02,i.interval-G*.002),M.setBinding({u_interval:W,u_AveMovement:I}),V.label=4;case 4:return G++,[3,1];case 5:return[4,M.getOutput()];case 6:return z=V.sent(),t?r.postMessage({type:gcr.LAYOUT_MESSAGE.GPUEND,vertexEdgeData:z}):a.forEach(function(q,Y){var le=z[4*Y],j=z[4*Y+1];q.x=le,q.y=j}),T&&T(),[2]}})})},[4,R()];case 1:return D.sent(),[2]}})})},e.prototype.getType=function(){return"gForce-gpu"},e}(vcr.Base);fk.GForceGPULayout=ycr;var dk={},mcr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();Object.defineProperty(dk,"__esModule",{value:!0});dk.ComboForceLayout=void 0;var _cr=Xl,zi=Dl(),xcr=function(n){mcr(e,n);function e(t){var r=n.call(this)||this;return r.center=[0,0],r.maxIteration=100,r.gravity=10,r.comboGravity=10,r.linkDistance=10,r.alpha=1,r.alphaMin=.001,r.alphaDecay=1-Math.pow(r.alphaMin,1/300),r.alphaTarget=0,r.velocityDecay=.6,r.edgeStrength=.6,r.nodeStrength=30,r.preventOverlap=!1,r.preventNodeOverlap=!1,r.preventComboOverlap=!1,r.collideStrength=void 0,r.nodeCollideStrength=.5,r.comboCollideStrength=.5,r.comboSpacing=20,r.comboPadding=10,r.optimizeRangeFactor=1,r.onTick=function(){},r.onLayoutEnd=function(){},r.depthAttractiveForceScale=1,r.depthRepulsiveForceScale=2,r.nodes=[],r.edges=[],r.combos=[],r.comboTrees=[],r.width=300,r.height=300,r.bias=[],r.nodeMap={},r.oriComboMap={},r.indexMap={},r.comboMap={},r.previousLayouted=!1,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},!r||r.length===0){t.onLayoutEnd&&t.onLayoutEnd();return}if(r.length===1){r[0].x=i[0],r[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd();return}t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,r=t.nodes,i=t.previousLayouted?t.maxIteration/5:t.maxIteration;!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight);var a=t.center,o=t.velocityDecay,s=t.comboMap;t.previousLayouted||t.initPos(s);for(var l=function(f){var d=[];r.forEach(function(v,p){d[p]={x:0,y:0}}),t.applyCalculate(d),t.applyComboCenterForce(d),r.forEach(function(v,p){!(0,zi.isNumber)(v.x)||!(0,zi.isNumber)(v.y)||(v.x+=d[p].x*o,v.y+=d[p].y*o)}),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;u<i;u++)l();var h=[0,0];r.forEach(function(f){!(0,zi.isNumber)(f.x)||!(0,zi.isNumber)(f.y)||(h[0]+=f.x,h[1]+=f.y)}),h[0]/=r.length,h[1]/=r.length;var c=[a[0]-h[0],a[1]-h[1]];r.forEach(function(f,d){!(0,zi.isNumber)(f.x)||!(0,zi.isNumber)(f.y)||(f.x+=c[0],f.y+=c[1])}),t.combos.forEach(function(f){var d=s[f.id];d&&d.empty&&(f.x=d.cx||f.x,f.y=d.cy||f.y)}),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,r=t.edges,i=t.nodes,a=t.combos,o={},s={},l={};i.forEach(function(G,W){s[G.id]=G,l[G.id]=W}),t.nodeMap=s,t.indexMap=l;var u={};a.forEach(function(G){u[G.id]=G}),t.oriComboMap=u,t.comboMap=t.getComboMap();var h=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||h,t.preventNodeOverlap=t.preventNodeOverlap||h;var c=t.collideStrength;c&&(t.comboCollideStrength=c,t.nodeCollideStrength=c),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var f=0;f<r.length;++f){var d=(0,zi.getEdgeTerminal)(r[f],"source"),v=(0,zi.getEdgeTerminal)(r[f],"target");o[d]?o[d]++:o[d]=1,o[v]?o[v]++:o[v]=1}for(var p=[],f=0;f<r.length;++f){var d=(0,zi.getEdgeTerminal)(r[f],"source"),v=(0,zi.getEdgeTerminal)(r[f],"target");p[f]=o[d]/(o[d]+o[v])}this.bias=p;var g=t.nodeSize,m=t.nodeSpacing,y,_;if((0,zi.isNumber)(m)?_=function(){return m}:(0,zi.isFunction)(m)?_=m:_=function(){return 0},this.nodeSpacing=_,!g)y=function(G){if(G.size){if((0,zi.isArray)(G.size)){var W=G.size[0]>G.size[1]?G.size[0]:G.size[1];return W/2}if((0,zi.isObject)(G.size)){var W=G.size.width>G.size.height?G.size.width:G.size.height;return W/2}return G.size/2}return 10};else if((0,zi.isFunction)(g))y=function(G){return g(G)};else if((0,zi.isArray)(g)){var x=g[0]>g[1]?g[0]:g[1],S=x/2;y=function(G){return S}}else{var w=g/2;y=function(G){return w}}this.nodeSize=y;var b=t.comboSpacing,E;(0,zi.isNumber)(b)?E=function(){return b}:(0,zi.isFunction)(b)?E=b:E=function(){return 0},this.comboSpacing=E;var T=t.comboPadding,C;(0,zi.isNumber)(T)?C=function(){return T}:(0,zi.isArray)(T)?C=function(){return Math.max.apply(null,T)}:(0,zi.isFunction)(T)?C=T:C=function(){return 0},this.comboPadding=C;var A=this.linkDistance,M;A||(A=10),(0,zi.isNumber)(A)?M=function(G){return A}:M=A,this.linkDistance=M;var I=this.edgeStrength,R;I||(I=1),(0,zi.isNumber)(I)?R=function(G){return I}:R=I,this.edgeStrength=R;var k=this.nodeStrength,D;k||(k=30),(0,zi.isNumber)(k)?D=function(G){return k}:D=k,this.nodeStrength=D},e.prototype.initPos=function(t){var r=this,i=r.nodes;i.forEach(function(a,o){var s=a.comboId,l=t[s];s&&l?(a.x=l.cx+100/(o+1),a.y=l.cy+100/(o+1)):(a.x=100/(o+1),a.y=100/(o+1))})},e.prototype.getComboMap=function(){var t=this,r=t.nodeMap,i=t.comboTrees,a=t.oriComboMap,o={};return(i||[]).forEach(function(s){var l=[];(0,zi.traverseTreeUp)(s,function(u){if(u.itemType==="node"||!a[u.id])return!0;if(o[u.id]===void 0){var h={id:u.id,name:u.id,cx:0,cy:0,count:0,depth:t.oriComboMap[u.id].depth||0,children:[]};o[u.id]=h}var c=u.children;c&&c.forEach(function(v){if(!o[v.id]&&!r[v.id])return!0;l.push(v)});var f=o[u.id];if(f.cx=0,f.cy=0,l.length===0){f.empty=!0;var d=a[u.id];f.cx=d.x,f.cy=d.y}return l.forEach(function(v){if(f.count++,v.itemType!=="node"){var p=o[v.id];(0,zi.isNumber)(p.cx)&&(f.cx+=p.cx),(0,zi.isNumber)(p.cy)&&(f.cy+=p.cy);return}var g=r[v.id];!g||((0,zi.isNumber)(g.x)&&(f.cx+=g.x),(0,zi.isNumber)(g.y)&&(f.cy+=g.y))}),f.cx/=f.count||1,f.cy/=f.count||1,f.children=l,!0})}),o},e.prototype.applyComboCenterForce=function(t){var r=this,i=r.gravity,a=r.comboGravity||i,o=this.alpha,s=r.comboTrees,l=r.indexMap,u=r.nodeMap,h=r.comboMap;(s||[]).forEach(function(c){(0,zi.traverseTreeUp)(c,function(f){if(f.itemType==="node")return!0;var d=h[f.id];if(!d)return!0;var v=h[f.id],p=(v.depth+1)/10*.5,g=v.cx,m=v.cy;return v.cx=0,v.cy=0,v.children.forEach(function(y){if(y.itemType!=="node"){var _=h[y.id];_&&(0,zi.isNumber)(_.cx)&&(v.cx+=_.cx),_&&(0,zi.isNumber)(_.cy)&&(v.cy+=_.cy);return}var x=u[y.id],S=x.x-g||.005,w=x.y-m||.005,b=Math.sqrt(S*S+w*w),E=l[x.id],T=a*o/b*p;t[E].x-=S*T,t[E].y-=w*T,(0,zi.isNumber)(x.x)&&(v.cx+=x.x),(0,zi.isNumber)(x.y)&&(v.cy+=x.y)}),v.cx/=v.count||1,v.cy/=v.count||1,!0})})},e.prototype.applyCalculate=function(t){var r=this,i=r.comboMap,a=r.nodes,o={};a.forEach(function(l,u){a.forEach(function(h,c){if(!(u<c)){var f=l.x-h.x||.005,d=l.y-h.y||.005,v=f*f+d*d,p=Math.sqrt(v);v<1&&(v=p),o["".concat(l.id,"-").concat(h.id)]={vx:f,vy:d,vl2:v,vl:p},o["".concat(h.id,"-").concat(l.id)]={vl2:v,vl:p,vx:-f,vy:-d}}})}),r.updateComboSizes(i),r.calRepulsive(t,o),r.calAttractive(t,o);var s=r.preventComboOverlap;s&&r.comboNonOverlapping(t,i)},e.prototype.updateComboSizes=function(t){var r=this,i=r.comboTrees,a=r.nodeMap,o=r.nodeSize,s=r.comboSpacing,l=r.comboPadding;(i||[]).forEach(function(u){var h=[];(0,zi.traverseTreeUp)(u,function(c){if(c.itemType==="node")return!0;var f=t[c.id];if(!f)return!1;var d=c.children;d&&d.forEach(function(g){!t[g.id]&&!a[g.id]||h.push(g)}),f.minX=1/0,f.minY=1/0,f.maxX=-1/0,f.maxY=-1/0,h.forEach(function(g){if(g.itemType!=="node")return!0;var m=a[g.id];if(!m)return!0;var y=o(m),_=m.x-y,x=m.y-y,S=m.x+y,w=m.y+y;f.minX>_&&(f.minX=_),f.minY>x&&(f.minY=x),f.maxX<S&&(f.maxX=S),f.maxY<w&&(f.maxY=w)});var v=r.oriComboMap[c.id].size||10;(0,zi.isArray)(v)&&(v=v[0]);var p=Math.max(f.maxX-f.minX,f.maxY-f.minY,v);return f.r=p/2+s(f)/2+l(f),!0})})},e.prototype.comboNonOverlapping=function(t,r){var i=this,a=i.comboTree,o=i.comboCollideStrength,s=i.indexMap,l=i.nodeMap;(0,zi.traverseTreeUp)(a,function(u){if(!r[u.id]&&!l[u.id]&&u.id!=="comboTreeRoot")return!1;var h=u.children;return h&&h.length>1&&h.forEach(function(c,f){if(c.itemType==="node")return!1;var d=r[c.id];!d||h.forEach(function(v,p){if(f<=p||v.itemType==="node")return!1;var g=r[v.id];if(!g)return!1;var m=d.cx-g.cx||.005,y=d.cy-g.cy||.005,_=m*m+y*y,x=d.r||1,S=g.r||1,w=x+S,b=S*S,E=x*x;if(_<w*w){var T=c.children;if(!T||T.length===0)return!1;var C=v.children;if(!C||C.length===0)return!1;var A=Math.sqrt(_),M=(w-A)/A*o,I=m*M,R=y*M,k=b/(E+b),D=1-k;T.forEach(function(G){if(G.itemType!=="node")return!1;if(!!l[G.id]){var W=s[G.id];C.forEach(function(z){if(z.itemType!=="node"||!l[z.id])return!1;var V=s[z.id];t[W].x+=I*k,t[W].y+=R*k,t[V].x-=I*D,t[V].y-=R*D})}})}})}),!0})},e.prototype.calRepulsive=function(t,r){var i=this,a=i.nodes,o=i.width*i.optimizeRangeFactor,s=i.nodeStrength,l=i.alpha,u=i.nodeCollideStrength,h=i.preventNodeOverlap,c=i.nodeSize,f=i.nodeSpacing,d=i.depthRepulsiveForceScale,v=i.center;a.forEach(function(p,g){if(!(!p.x||!p.y)){if(v){var m=i.gravity,y=p.x-v[0]||.005,_=p.y-v[1]||.005,x=Math.sqrt(y*y+_*_);t[g].x-=y*m*l/x,t[g].y-=_*m*l/x}a.forEach(function(S,w){if(g!==w&&!(!S.x||!S.y)){var b=r["".concat(p.id,"-").concat(S.id)],E=b.vl2,T=b.vl;if(!(T>o)){var C=r["".concat(p.id,"-").concat(S.id)],A=C.vx,M=C.vy,I=Math.log(Math.abs(S.depth-p.depth)/10)+1||1;I=I<1?1:I,S.comboId!==p.comboId&&(I+=1);var R=I?Math.pow(d,I):1,k=s(S)*l/E*R;if(t[g].x+=A*k,t[g].y+=M*k,g<w&&h){var D=c(p)+f(p)||1,G=c(S)+f(S)||1,W=D+G;if(E<W*W){var z=(W-T)/T*u,V=G*G,q=V/(D*D+V),Y=A*z,le=M*z;t[g].x+=Y*q,t[g].y+=le*q,q=1-q,t[w].x-=Y*q,t[w].y-=le*q}}}}})}})},e.prototype.calAttractive=function(t,r){var i=this,a=i.edges,o=i.linkDistance,s=i.alpha,l=i.edgeStrength,u=i.bias,h=i.depthAttractiveForceScale;a.forEach(function(c,f){var d=(0,zi.getEdgeTerminal)(c,"source"),v=(0,zi.getEdgeTerminal)(c,"target");if(!(!d||!v||d===v)){var p=i.indexMap[d],g=i.indexMap[v],m=i.nodeMap[d],y=i.nodeMap[v];if(!(!m||!y)){var _=m.depth===y.depth?0:Math.log(Math.abs(m.depth-y.depth)/10);m.comboId===y.comboId&&(_=_/2);var x=_?Math.pow(h,_):1;if(m.comboId!==y.comboId&&x===1?x=h/2:m.comboId===y.comboId&&(x=2),!(!(0,zi.isNumber)(y.x)||!(0,zi.isNumber)(m.x)||!(0,zi.isNumber)(y.y)||!(0,zi.isNumber)(m.y))){var S=r["".concat(v,"-").concat(d)],w=S.vl,b=S.vx,E=S.vy,T=(w-o(c))/w*s*l(c)*x,C=b*T,A=E*T,M=u[f];t[g].x-=C*M,t[g].y-=A*M,t[p].x+=C*(1-M),t[p].y+=A*(1-M)}}}})},e.prototype.getType=function(){return"comboForce"},e}(_cr.Base);dk.ComboForceLayout=xcr;var IP={},DEe;function LHe(){if(DEe)return IP;DEe=1;var n=at&&at.__extends||function(){var s=function(l,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,c){h.__proto__=c}||function(h,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(h[f]=c[f])},s(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(l,u);function h(){this.constructor=l}l.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}}(),e=at&&at.__assign||function(){return e=Object.assign||function(s){for(var l,u=1,h=arguments.length;u<h;u++){l=arguments[u];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(s[c]=l[c])}return s},e.apply(this,arguments)};Object.defineProperty(IP,"__esModule",{value:!0}),IP.ComboCombinedLayout=void 0;var t=y_,r=Xl,i=Dl(),a=BHe(),o=function(s){n(l,s);function l(u){var h=s.call(this)||this;return h.center=[0,0],h.nodes=[],h.edges=[],h.combos=[],h.comboEdges=[],h.comboPadding=10,h.comboTrees=[],h.updateCfg(u),h}return l.prototype.getDefaultCfg=function(){return{}},l.prototype.execute=function(){var u=this,h=u.nodes,c=u.center;if(!h||h.length===0){u.onLayoutEnd&&u.onLayoutEnd();return}if(h.length===1){h[0].x=c[0],h[0].y=c[1],u.onLayoutEnd&&u.onLayoutEnd();return}u.initVals(),u.run(),u.onLayoutEnd&&u.onLayoutEnd()},l.prototype.run=function(){var u,h=this,c=h.nodes,f=h.edges,d=h.combos,v=h.comboEdges,p=h.center,g={};c.forEach(function(k){g[k.id]=k});var m={};d.forEach(function(k){m[k.id]=k});var y=h.getInnerGraphs(g),_=[],x=[],S={},w=!0;this.comboTrees.forEach(function(k){var D=y[k.id];if(!!D){var G=e(e({},k),{x:D.x||m[k.id].x,y:D.y||m[k.id].y,fx:D.fx||m[k.id].fx,fy:D.fy||m[k.id].fy,mass:D.mass||m[k.id].mass,size:D.size});x.push(G),!isNaN(G.x)&&G.x!==0&&!isNaN(G.y)&&G.y!==0?w=!1:(G.x=Math.random()*100,G.y=Math.random()*100),_.push(k.id),(0,i.traverseTreeUp)(k,function(W){return W.id!==k.id&&(S[W.id]=k.id),!0})}}),c.forEach(function(k){if(!(k.comboId&&m[k.comboId])){var D=e({},k);x.push(D),!isNaN(D.x)&&D.x!==0&&!isNaN(D.y)&&D.y!==0?w=!1:(D.x=Math.random()*100,D.y=Math.random()*100),_.push(k.id)}});var b=[];if(f.concat(v).forEach(function(k){var D=S[k.source]||k.source,G=S[k.target]||k.target;D!==G&&_.includes(D)&&_.includes(G)&&b.push({source:D,target:G})}),x!=null&&x.length){if(x.length===1)x[0].x=p[0],x[0].y=p[1];else{var E={nodes:x,edges:b},T=this.outerLayout||new a.GForceLayout({gravity:1,factor:4,linkDistance:function(k,D,G){var W,z,V=((((W=D.size)===null||W===void 0?void 0:W[0])||30)+(((z=G.size)===null||z===void 0?void 0:z[0])||30))/2;return Math.min(V*1.5,700)}}),C=(u=T.getType)===null||u===void 0?void 0:u.call(T);if(T.updateCfg({center:p,kg:5,preventOverlap:!0,animate:!1}),w&&t.FORCE_LAYOUT_TYPE_MAP[C]){var A=x.length<100?new a.MDSLayout:new a.GridLayout;A.layout(E)}T.layout(E)}x.forEach(function(k){var D=y[k.id];if(!D){var G=g[k.id];G&&(G.x=k.x,G.y=k.y);return}D.visited=!0,D.x=k.x,D.y=k.y,D.nodes.forEach(function(W){W.x+=k.x,W.y+=k.y})})}for(var M=Object.keys(y),I=function(k){var D=M[k],G=y[D];if(!G)return"continue";G.nodes.forEach(function(W){G.visited||(W.x+=G.x||0,W.y+=G.y||0),g[W.id]&&(g[W.id].x=W.x,g[W.id].y=W.y)}),m[D]&&(m[D].x=G.x,m[D].y=G.y)},R=M.length-1;R>=0;R--)I(R);return{nodes:c,edges:f,combos:d,comboEdges:v}},l.prototype.getInnerGraphs=function(u){var h=this,c=h.comboTrees,f=h.nodeSize,d=h.edges,v=h.comboPadding,p=h.spacing,g={},m=this.innerLayout||new a.ConcentricLayout({type:"concentric",sortBy:"id"});return m.center=[0,0],m.preventOverlap=!0,m.nodeSpacing=p,(c||[]).forEach(function(y){(0,i.traverseTreeUp)(y,function(_){var x,S=(v==null?void 0:v(_))||10;if((0,i.isArray)(S)&&(S=Math.max.apply(Math,S)),!((x=_.children)===null||x===void 0)&&x.length){var b=_.children.map(function(z){if(z.itemType==="combo")return g[z.id];var V=u[z.id]||{};return e(e({},V),z)}),E=b.map(function(z){return z.id}),T={nodes:b,edges:d.filter(function(z){return E.includes(z.source)&&E.includes(z.target)})},C=1/0;b.forEach(function(z){var V;z.size||(z.size=((V=g[z.id])===null||V===void 0?void 0:V.size)||(f==null?void 0:f(z))||[30,30]),(0,i.isNumber)(z.size)&&(z.size=[z.size,z.size]),C>z.size[0]&&(C=z.size[0]),C>z.size[1]&&(C=z.size[1])}),m.layout(T);var A=(0,i.getLayoutBBox)(b),M=A.minX,I=A.minY,R=A.maxX,k=A.maxY,D={x:(R+M)/2,y:(k+I)/2};T.nodes.forEach(function(z){z.x-=D.x,z.y-=D.y});var G=Math.max(R-M,C)+S*2,W=Math.max(k-I,C)+S*2;g[_.id]={id:_.id,nodes:b,size:[G,W]}}else if(_.itemType==="combo"){var w=S?[S*2,S*2]:[30,30];g[_.id]={id:_.id,nodes:[],size:w}}return!0})}),g},l.prototype.initVals=function(){var u=this,h=u.nodeSize,c=u.spacing,f,d;if((0,i.isNumber)(c)?d=function(){return c}:(0,i.isFunction)(c)?d=c:d=function(){return 0},this.spacing=d,!h)f=function(_){var x=d(_);if(_.size){if((0,i.isArray)(_.size)){var S=_.size[0]>_.size[1]?_.size[0]:_.size[1];return(S+x)/2}if((0,i.isObject)(_.size)){var S=_.size.width>_.size.height?_.size.width:_.size.height;return(S+x)/2}return(_.size+x)/2}return 10+x/2};else if((0,i.isFunction)(h))f=function(_){var x=h(_),S=d(_);if((0,i.isArray)(_.size)){var w=_.size[0]>_.size[1]?_.size[0]:_.size[1];return(w+S)/2}return((x||10)+S)/2};else if((0,i.isArray)(h)){var v=h[0]>h[1]?h[0]:h[1],p=v/2;f=function(_){return p+d(_)/2}}else{var g=h/2;f=function(_){return g+d(_)/2}}this.nodeSize=f;var m=u.comboPadding,y;(0,i.isNumber)(m)?y=function(){return m}:(0,i.isArray)(m)?y=function(){return Math.max.apply(null,m)}:(0,i.isFunction)(m)?y=m:y=function(){return 0},this.comboPadding=y},l.prototype.getType=function(){return"comboCombined"},l}(r.Base);return IP.ComboCombinedLayout=o,IP}var vk={},Ule={};Object.defineProperty(Ule,"__esModule",{value:!0});var Scr=function(){function n(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}return n.prototype.distanceTo=function(e){var t=this.rx-e.rx,r=this.ry-e.ry;return Math.hypot(t,r)},n.prototype.setPos=function(e,t){this.rx=e,this.ry=t},n.prototype.resetForce=function(){this.fx=0,this.fy=0},n.prototype.addForce=function(e){var t=e.rx-this.rx,r=e.ry-this.ry,i=Math.hypot(t,r);i=i<1e-4?1e-4:i;var a=this.g*(this.degree+1)*(e.degree+1)/i;this.fx+=a*t/i,this.fy+=a*r/i},n.prototype.in=function(e){return e.contains(this.rx,this.ry)},n.prototype.add=function(e){var t=this.mass+e.mass,r=(this.rx*this.mass+e.rx*e.mass)/t,i=(this.ry*this.mass+e.ry*e.mass)/t,a=this.degree+e.degree,o={rx:r,ry:i,mass:t,degree:a};return new n(o)},n}();Ule.default=Scr;var Vle={};Object.defineProperty(Vle,"__esModule",{value:!0});var wcr=function(){function n(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}return n.prototype.getLength=function(){return this.length},n.prototype.contains=function(e,t){var r=this.length/2;return e<=this.xmid+r&&e>=this.xmid-r&&t<=this.ymid+r&&t>=this.ymid-r},n.prototype.NW=function(){var e=this.xmid-this.length/4,t=this.ymid+this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n.prototype.NE=function(){var e=this.xmid+this.length/4,t=this.ymid+this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n.prototype.SW=function(){var e=this.xmid-this.length/4,t=this.ymid-this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n.prototype.SE=function(){var e=this.xmid+this.length/4,t=this.ymid-this.length/4,r=this.length/2,i={xmid:e,ymid:t,length:r},a=new n(i);return a},n}();Vle.default=wcr;var $le={};Object.defineProperty($le,"__esModule",{value:!0});var bcr=function(){function n(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}return n.prototype.insert=function(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new n(this.quad.NW()),this.NE=new n(this.quad.NE()),this.SW=new n(this.quad.SW()),this.SE=new n(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))},n.prototype._putBody=function(e){!this.quad||(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))},n.prototype._isExternal=function(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null},n.prototype.updateForce=function(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{var t=this.quad?this.quad.getLength():0,r=this.body.distanceTo(e);t/r<this.theta?e.addForce(this.body):(this.NW&&this.NW.updateForce(e),this.NE&&this.NE.updateForce(e),this.SW&&this.SW.updateForce(e),this.SE&&this.SE.updateForce(e))}},n}();$le.default=bcr;var Ecr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Wle=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(vk,"__esModule",{value:!0});vk.ForceAtlas2Layout=void 0;var Tcr=Xl,i1=Dl(),Ccr=Wle(Ule),Acr=Wle(Vle),Mcr=Wle($le),Icr=function(n){Ecr(e,n);function e(t){var r=n.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.kr=5,r.kg=1,r.mode="normal",r.preventOverlap=!1,r.dissuadeHubs=!1,r.barnesHut=void 0,r.maxIteration=0,r.ks=.1,r.ksmax=10,r.tao=.1,r.onLayoutEnd=function(){},r.prune=void 0,r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.onLayoutEnd,a=t.prune,o=t.maxIteration;!t.width&&typeof window<"u"&&(t.width=window.innerWidth),!t.height&&typeof window<"u"&&(t.height=window.innerHeight);for(var s=[],l=r.length,u=0;u<l;u+=1){var h=r[u],c=10,f=10;(0,i1.isNumber)(h.size)&&(c=h.size,f=h.size),(0,i1.isArray)(h.size)?(isNaN(h.size[0])||(c=h.size[0]),isNaN(h.size[1])||(f=h.size[1])):(0,i1.isObject)(h.size)&&(c=h.size.width,f=h.size.height),t.getWidth&&!isNaN(t.getWidth(h))&&(f=t.getWidth(h)),t.getHeight&&!isNaN(t.getHeight(h))&&(c=t.getHeight(h));var d=Math.max(c,f);s.push(d)}t.barnesHut===void 0&&l>250&&(t.barnesHut=!0),t.prune===void 0&&l>100&&(t.prune=!0),this.maxIteration===0&&!t.prune?(o=250,l<=200&&l>100?o=1e3:l>200&&(o=1200),this.maxIteration=o):this.maxIteration===0&&a&&(o=100,l<=200&&l>100?o=500:l>200&&(o=950),this.maxIteration=o),t.kr||(t.kr=50,l>100&&l<=500?t.kr=20:l>500&&(t.kr=1)),t.kg||(t.kg=20,l>100&&l<=500?t.kg=10:l>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(s),i()},e.prototype.updateNodesByForces=function(t){for(var r=this,i=r.edges,a=r.maxIteration,o=r.nodes,s=i.filter(function(b){var E=(0,i1.getEdgeTerminal)(b,"source"),T=(0,i1.getEdgeTerminal)(b,"target");return E!==T}),l=o.length,u=s.length,h=[],c={},f={},d=[],v=0;v<l;v+=1)c[o[v].id]=v,h[v]=0,(o[v].x===void 0||isNaN(o[v].x))&&(o[v].x=Math.random()*1e3),(o[v].y===void 0||isNaN(o[v].y))&&(o[v].y=Math.random()*1e3),d.push({x:o[v].x,y:o[v].y});for(var v=0;v<u;v+=1){for(var p=void 0,g=void 0,m=0,y=0,_=0;_<l;_+=1){var x=(0,i1.getEdgeTerminal)(s[v],"source"),S=(0,i1.getEdgeTerminal)(s[v],"target");o[_].id===x?(p=o[_],m=_):o[_].id===S&&(g=o[_],y=_),f[v]={sourceIdx:m,targetIdx:y}}p&&(h[c[p.id]]+=1),g&&(h[c[g.id]]+=1)}var w=a;if(o=this.iterate(w,c,f,u,h,t),r.prune){for(var _=0;_<u;_+=1)h[f[_].sourceIdx]<=1?(o[f[_].sourceIdx].x=o[f[_].targetIdx].x,o[f[_].sourceIdx].y=o[f[_].targetIdx].y):h[f[_].targetIdx]<=1&&(o[f[_].targetIdx].x=o[f[_].sourceIdx].x,o[f[_].targetIdx].y=o[f[_].sourceIdx].y);r.prune=!1,r.barnesHut=!1,w=100,o=this.iterate(w,c,f,u,h,t)}return o},e.prototype.iterate=function(t,r,i,a,o,s){for(var l=this,u=l.nodes,h=l.kr,c=l.preventOverlap,f=l.barnesHut,d=u.length,v=0,p=100,g=t,m=50,y=[],_=[],x=[],S=0;S<d;S+=1)if(y[2*S]=0,y[2*S+1]=0,f){var w={id:S,rx:u[S].x,ry:u[S].y,mass:1,g:h,degree:o[S]};x[S]=new Ccr.default(w)}for(;g>0;){for(var S=0;S<d;S+=1)_[2*S]=y[2*S],_[2*S+1]=y[2*S+1],y[2*S]=0,y[2*S+1]=0;y=this.getAttrForces(g,m,a,r,i,o,s,y),f&&(c&&g>m||!c)?y=this.getOptRepGraForces(y,x,o):y=this.getRepGraForces(g,m,y,p,s,o);var b=this.updatePos(y,_,v,o);u=b.nodes,v=b.sg,g--,l.tick&&l.tick()}return u},e.prototype.getAttrForces=function(t,r,i,a,o,s,l,u){for(var h=this,c=h.nodes,f=h.preventOverlap,d=h.dissuadeHubs,v=h.mode,p=h.prune,g=0;g<i;g+=1){var m=c[o[g].sourceIdx],y=o[g].sourceIdx,_=c[o[g].targetIdx],x=o[g].targetIdx;if(!(p&&(s[y]<=1||s[x]<=1))){var S=[_.x-m.x,_.y-m.y],w=Math.hypot(S[0],S[1]);w=w<1e-4?1e-4:w,S[0]=S[0]/w,S[1]=S[1]/w,f&&t<r&&(w=w-l[y]-l[x]);var b=w,E=b;v==="linlog"&&(b=Math.log(1+w),E=b),d&&(b=w/s[y],E=w/s[x]),f&&t<r&&w<=0?(b=0,E=0):f&&t<r&&w>0&&(b=w,E=w),u[2*a[m.id]]+=b*S[0],u[2*a[_.id]]-=E*S[0],u[2*a[m.id]+1]+=b*S[1],u[2*a[_.id]+1]-=E*S[1]}}return u},e.prototype.getRepGraForces=function(t,r,i,a,o,s){for(var l=this,u=l.nodes,h=l.preventOverlap,c=l.kr,f=l.kg,d=l.center,v=l.prune,p=u.length,g=0;g<p;g+=1){for(var m=g+1;m<p;m+=1)if(!(v&&(s[g]<=1||s[m]<=1))){var y=[u[m].x-u[g].x,u[m].y-u[g].y],_=Math.hypot(y[0],y[1]);_=_<1e-4?1e-4:_,y[0]=y[0]/_,y[1]=y[1]/_,h&&t<r&&(_=_-o[g]-o[m]);var x=c*(s[g]+1)*(s[m]+1)/_;h&&t<r&&_<0?x=a*(s[g]+1)*(s[m]+1):h&&t<r&&_===0?x=0:h&&t<r&&_>0&&(x=c*(s[g]+1)*(s[m]+1)/_),i[2*g]-=x*y[0],i[2*m]+=x*y[0],i[2*g+1]-=x*y[1],i[2*m+1]+=x*y[1]}var S=[u[g].x-d[0],u[g].y-d[1]],w=Math.hypot(S[0],S[1]);S[0]=S[0]/w,S[1]=S[1]/w;var b=f*(s[g]+1);i[2*g]-=b*S[0],i[2*g+1]-=b*S[1]}return i},e.prototype.getOptRepGraForces=function(t,r,i){for(var a=this,o=a.nodes,s=a.kg,l=a.center,u=a.prune,h=o.length,c=9e10,f=-9e10,d=9e10,v=-9e10,p=0;p<h;p+=1)u&&i[p]<=1||(r[p].setPos(o[p].x,o[p].y),o[p].x>=f&&(f=o[p].x),o[p].x<=c&&(c=o[p].x),o[p].y>=v&&(v=o[p].y),o[p].y<=d&&(d=o[p].y));for(var g=Math.max(f-c,v-d),m={xmid:(f+c)/2,ymid:(v+d)/2,length:g,massCenter:l,mass:h},y=new Acr.default(m),_=new Mcr.default(y),p=0;p<h;p+=1)u&&i[p]<=1||r[p].in(y)&&_.insert(r[p]);for(var p=0;p<h;p+=1)if(!(u&&i[p]<=1)){r[p].resetForce(),_.updateForce(r[p]),t[2*p]-=r[p].fx,t[2*p+1]-=r[p].fy;var x=[o[p].x-l[0],o[p].y-l[1]],S=Math.hypot(x[0],x[1]);S=S<1e-4?1e-4:S,x[0]=x[0]/S,x[1]=x[1]/S;var w=s*(i[p]+1);t[2*p]-=w*x[0],t[2*p+1]-=w*x[1]}return t},e.prototype.updatePos=function(t,r,i,a){for(var o=this,s=o.nodes,l=o.ks,u=o.tao,h=o.prune,c=o.ksmax,f=s.length,d=[],v=[],p=0,g=0,m=0;m<f;m+=1)if(!(h&&a[m]<=1)){var y=[t[2*m]-r[2*m],t[2*m+1]-r[2*m+1]],_=Math.hypot(y[0],y[1]),x=[t[2*m]+r[2*m],t[2*m+1]+r[2*m+1]],S=Math.hypot(x[0],x[1]);d[m]=_,v[m]=S/2,p+=(a[m]+1)*d[m],g+=(a[m]+1)*v[m]}var w=i;i=u*g/p,w!==0&&(i=i>1.5*w?1.5*w:i);for(var m=0;m<f;m+=1)if(!(h&&a[m]<=1)&&!((0,i1.isNumber)(s[m].fx)&&(0,i1.isNumber)(s[m].fy))){var b=l*i/(1+i*Math.sqrt(d[m])),E=Math.hypot(t[2*m],t[2*m+1]);E=E<1e-4?1e-4:E;var T=c/E;b=b>T?T:b;var C=b*t[2*m],A=b*t[2*m+1];s[m].x+=C,s[m].y+=A}return{nodes:s,sg:i}},e}(Tcr.Base);vk.ForceAtlas2Layout=Icr;var pk={},Hle={},jle={},Xle={},yA=at&&at.__assign||function(){return yA=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yA.apply(this,arguments)};Object.defineProperty(Xle,"__esModule",{value:!0});var Lcr=function(){function n(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return n.prototype.init=function(e,t,r){this.cells=[],this.CELL_W=r.CELL_W||n.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||n.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(t/this.CELL_H),n.MIN_DIST=Math.pow(e,2)+Math.pow(t,2);for(var i=0;i<this.columnNum;i++){for(var a=[],o=0;o<this.rowNum;o++){var s={dx:i,dy:o,x:i*this.CELL_W,y:o*this.CELL_H,occupied:!1};a.push(s)}this.cells.push(a)}},n.prototype.findGridByNodeId=function(e){for(var t,r,i=0;i<this.columnNum;i++)for(var a=0;a<this.rowNum;a++)if(this.cells[i][a].node&&((r=(t=this.cells[i][a])===null||t===void 0?void 0:t.node)===null||r===void 0?void 0:r.id)===e)return{column:i,row:a};return null},n.prototype.sqdist=function(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)},n.prototype.occupyNearest=function(e){for(var t=n.MIN_DIST,r,i=null,a=0;a<this.columnNum;a++)for(var o=0;o<this.rowNum;o++)!this.cells[a][o].occupied&&(r=this.sqdist(e,this.cells[a][o]))<t&&(t=r,i=this.cells[a][o]);return i&&(i.occupied=!0),i},n.prototype.insertColumn=function(e,t){if(!(t<=0)){for(var r=0;r<t;r++){this.cells[r+this.columnNum]=[];for(var i=0;i<this.rowNum;i++)this.cells[r+this.columnNum][i]={dx:r,dy:i,x:r*this.CELL_W,y:i*this.CELL_H,occupied:!1,node:null}}for(var r=this.columnNum-1;r>e;r--)for(var i=0;i<this.rowNum;i++)this.cells[r+t][i]=yA(yA({},this.cells[r][i]),{x:(r+t)*this.CELL_W,y:i*this.CELL_H}),this.cells[r][i]={x:r*this.CELL_W,y:i*this.CELL_H,occupied:!0,node:null};for(var i=0;i<this.additionColumn.length;i++)this.additionColumn[i]>=e&&(this.additionColumn[i]+=t);for(var r=0;r<t;r++)this.additionColumn.push(e+r+1);this.columnNum+=t}},n.prototype.insertRow=function(e,t){if(!(t<=0)){for(var r=0;r<t;r++)for(var i=0;i<this.columnNum;i++)this.cells[i][r+this.rowNum]={dx:i,dy:r,x:i*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null};for(var i=0;i<this.columnNum;i++)for(var r=this.rowNum-1;r>e;r--)this.cells[i][r+t]=yA(yA({},this.cells[i][r]),{dx:i,dy:r+t,x:i*this.CELL_W,y:(r+t)*this.CELL_H}),this.cells[i][r]={dx:i,dy:r,x:i*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null};for(var r=0;r<this.additionRow.length;r++)this.additionRow[r]>=e&&(this.additionRow[r]+=t);for(var i=0;i<t;i++)this.additionRow.push(e+i+1);this.rowNum+=t}},n.prototype.getNodes=function(){for(var e=[],t=0;t<this.columnNum;t++)for(var r=0;r<this.rowNum;r++)this.cells[t][r].node&&e.push(this.cells[t][r]);return e},n.MIN_DIST=50,n.DEFAULT_CELL_W=80,n.DEFAULT_CELL_H=80,n}();Xle.default=Lcr;var Pcr=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(jle,"__esModule",{value:!0});var Ocr=Pcr(Xle);function Rcr(n,e){if(!n.nodes||n.nodes.length===0)return n;var t=e.width,r=e.height,i=e.nodeMinGap,a=1e4,o=1e4;n.nodes.forEach(function(y){var _=y.size[0]||50,x=y.size[1]||50;a=Math.min(_,a),o=Math.min(x,o)});var s=new Ocr.default;s.init(t,r,{CELL_H:o,CELL_W:a}),n.nodes.forEach(function(y){var _=s.occupyNearest(y);_&&(_.node={id:y.id,size:y.size},y.x=_.x,y.y=_.y,y.dx=_.dx,y.dy=_.dy)});for(var l=0;l<n.nodes.length;l++){var u=n.nodes[l],h=s.findGridByNodeId(u.id);if(!h)throw new Error("can not find node cell");var c=h.column,f=h.row;if(u.size[0]+i>a){for(var d=Math.ceil((u.size[0]+i)/a)-1,v=d,p=0;p<d;p++){var g=s.additionColumn.indexOf(c+p+1)>-1;if(g&&!s.cells[c+p+1][f].node)v--;else break}s.insertColumn(c,v)}if(u.size[1]+i>o){for(var d=Math.ceil((u.size[1]+i)/o)-1,v=d,p=0;p<d;p++){var g=s.additionRow.indexOf(f+p+1)>-1;if(g&&!s.cells[c][f+p+1].node)v--;else break}s.insertRow(f,v)}}for(var l=0;l<s.columnNum;l++)for(var m=function(_){var x=s.cells[l][_];if(x.node){var S=n.nodes.find(function(w){var b;return w.id===((b=x==null?void 0:x.node)===null||b===void 0?void 0:b.id)});S&&(S.x=x.x+S.size[0]/2,S.y=x.y+S.size[1]/2)}},p=0;p<s.rowNum;p++)m(p)}jle.default=Rcr;var Yle={};Object.defineProperty(Yle,"__esModule",{value:!0});var PHe=1200,OHe=800,W5=1e7,LP=10,RHe=3.141592653589793,IY=1.5707963267948966,Dcr=RHe*.375,Ncr=RHe*.625,s8=new Map,kcr=10,Fcr=10,LY=.8,NEe=.1,Bcr=.5;function Gcr(n,e,t){var r=n.x-n.size[0]/2,i=n.y-n.size[1]/2,a=n.x+n.size[0]/2,o=n.y+n.size[1]/2,s=e.x-e.size[0]/2,l=e.y-e.size[1]/2,u=e.x+e.size[0]/2,h=e.y+e.size[1]/2,c=n.x,f=n.y,d=e.x,v=e.y,p=d-c,g=Math.atan2(p,v-f),m=0,y=0,_=0,x=0;g>IY?(y=i-h,m=s-a,_=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)),x=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):0<g&&g<=IY?(y=l-o,m=s-a,y>m?_=x=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):_=x=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):g<-IY?(y=i-h,m=-(u-r),y>m?_=x=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):_=x=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):(y=l-o,Math.abs(p)>(a-r)/2?m=r-u:m=p,y>m?_=x=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):_=x=parseFloat(m&&g!==0?(m/Math.sin(g)).toFixed(2):y.toFixed(2)));var S=parseFloat(g.toFixed(2)),w=t;return t&&(w=Dcr<S&&S<Ncr),{distance:Math.abs(_<x?_:x),isHoriz:w}}function DHe(n,e){var t=s8.get(n.id)||[],r=t.find(function(D){return D.source===e.id||D.target===e.id}),i=n.size[0]*n.size[1],a=e.size[0]*e.size[1],o=i>a?e:n,s=i>a?n:e,l=o.x-o.size[0]/2,u=o.y-o.size[1]/2,h=o.x+o.size[0]/2,c=o.y+o.size[1]/2,f=s.x-s.size[0]/2,d=s.y-s.size[1]/2,v=s.x+s.size[0]/2,p=s.y+s.size[1]/2,g=o.x,m=o.y,y=s.x,_=s.y,x=h>=f&&v>=l&&c>=d&&p>=u,S=0,w=0;if(x){w=Math.sqrt(Math.pow(y-g,2)+Math.pow(_-m,2));var b=l>f?l:f,E=u>d?u:d,T=h<v?h:v,C=c<p?c:p,A=T-b,M=C-E,I=A*M;w===0&&(w=1e-7),S=LP*1/w*100+I,S*=W5}else{var R=!1,k=Gcr(o,s,R);w=k.distance,R=k.isHoriz,w<=LP?w!==0?r?S+=LP+W5*1/w:S+=LP+W5*LP/w:S+=W5:(S+=w,r&&(S+=w*w))}return S}function NHe(n){for(var e=0,t=0;t<n.length;t++){var r=n[t];(r.x<0||r.y<0||r.x>PHe||r.y>OHe)&&(e+=1e12);for(var i=t+1;i<n.length;i++)e+=DHe(r,n[i])}return e}function zcr(n,e,t,r){var i=new Map;t.forEach(function(g,m){i.set(g.id,g)});var a=r.filter(function(g){return g.source===n.id||g.target===n.id})||[],o=[];a.forEach(function(g){var m=g.source===n.id?g.target:g.source,y=i.get(m);y&&o.push(y)});for(var s=!0,l=0;l<o.length;l++){var u=o[l],h=Math.atan((n.y-u.y)/(u.x-n.y))*180,c=Math.atan((e.y-u.y)/(u.x-e.y))*180,f=h<30||h>150,d=c<30||c>150,v=h>70&&h<110,p=c>70&&c<110;if(f&&!d||h*c<0){s=!1;break}else if(v&&!p||h*c<0){s=!1;break}else if((u.x-n.x)*(u.x-e.x)<0){s=!1;break}else if((u.y-n.y)*(u.y-e.y)<0){s=!1;break}}return s}function Ucr(n,e){for(var t=!1,r=1,i=kcr*r,a=Fcr*r,o=[i,-i,0,0],s=[0,0,a,-a],l=0;l<n.length;++l)for(var u=n[l],h=kEe(u,n),c=0;c<o.length;c++){var f=zcr(u,{x:u.x+o[c],y:u.y+s[c]},n,e);if(f){u.x+=o[c],u.y+=s[c];var d=kEe(u,n),v=Math.random();d<h||v<LY&&v>NEe?(h=d,t=!0):(u.x-=o[c],u.y-=s[c])}}return LY>NEe&&(LY*=Bcr),t?NHe(n):0}function kEe(n,e){var t=0;(n.x<0||n.y<0||n.x+n.size[0]+20>PHe||n.y+n.size[1]+20>OHe)&&(t+=1e12);for(var r=0;r<e.length;++r)n.id!==e[r].id&&(t+=DHe(n,e[r]));return t}function Vcr(n,e){if(n.length===0)return{nodes:n,edges:e};n.forEach(function(u){var h=e.filter(function(c){return c.source===u.id||c.target===u.id});s8.set(u,h)}),n.sort(function(u,h){var c,f;return((c=s8.get(u.id))===null||c===void 0?void 0:c.length)-((f=s8.get(h.id))===null||f===void 0?void 0:f.length)});for(var t=NHe(n),r=20,i=1,a=0,o=50,s=0;r>0&&(s++,!(s>=o));){var l=Ucr(n,e);l!==0&&(a=l),i=a-t,t=a,i===0?--r:r=20}return n.forEach(function(u){u.x=u.x-u.size[0]/2,u.y=u.y-u.size[1]/2}),{nodes:n,edges:e}}Yle.default=Vcr;var Qee=at&&at.__assign||function(){return Qee=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Qee.apply(this,arguments)},$cr=at&&at.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Wcr=at&&at.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Hcr=at&&at.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&$cr(e,n,t);return Wcr(e,n),e},kHe=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Hle,"__esModule",{value:!0});var mC=Hcr(kse),jcr=kHe(jle),Xcr=kHe(Yle),Ycr=qI;function qcr(n,e){var t=n.nodes,r=n.edges,i=e.width,a=e.height;if(!(t!=null&&t.length))return Promise.resolve();var o=[];t.forEach(function(v){var p=r.filter(function(m){return m.source===v.id||m.target===v.id});if(p.length>1){var g=Qee({},v);delete g.size,o.push(g)}});var s=[];r.forEach(function(v){var p=o.find(function(m){return m.id===v.source}),g=o.find(function(m){return m.id===v.target});p&&g&&s.push(v)});var l=new Ycr.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}),u=l.layout({nodes:o,edges:s}).nodes;t.forEach(function(v){var p=(u||[]).find(function(g){return g.id===v.id});v.x=(p==null?void 0:p.x)||i/2,v.y=(p==null?void 0:p.y)||a/2});var h=JSON.parse(JSON.stringify(t)),c=JSON.parse(JSON.stringify(r)),f=mC.forceSimulation().nodes(h).force("link",mC.forceLink(c).id(function(v){return v.id}).distance(function(v){var p=s.find(function(g){return g.source===v.source&&g.target===v.target});return p?30:20})).force("charge",mC.forceManyBody()).force("center",mC.forceCenter(i/2,a/2)).force("x",mC.forceX(i/2)).force("y",mC.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),d=new Promise(function(v){f.on("end",function(){t.forEach(function(S){var w=h.find(function(b){return b.id===S.id});w&&(S.x=w.x,S.y=w.y)});var p=Math.min.apply(Math,t.map(function(S){return S.x})),g=Math.max.apply(Math,t.map(function(S){return S.x})),m=Math.min.apply(Math,t.map(function(S){return S.y})),y=Math.max.apply(Math,t.map(function(S){return S.y})),_=i/(g-p),x=a/(y-m);t.forEach(function(S){S.x!==void 0&&_<1&&(S.x=(S.x-p)*_),S.y!==void 0&&x<1&&(S.y=(S.y-m)*x)}),t.forEach(function(S){S.sizeTemp=S.size,S.size=[10,10]}),(0,Xcr.default)(t,r),t.forEach(function(S){S.size=S.sizeTemp||[],delete S.sizeTemp}),(0,jcr.default)({nodes:t,edges:r},e),v()})});return d}Hle.default=qcr;var Zcr=at&&at.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Kcr=at&&at.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(pk,"__esModule",{value:!0});pk.ERLayout=void 0;var Jcr=Xl,Qcr=Kcr(Hle),efr=function(n){Zcr(e,n);function e(t){var r=n.call(this)||this;return r.width=300,r.height=300,r.nodeMinGap=50,r.onLayoutEnd=function(){},t&&r.updateCfg(t),r}return e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,r=t.nodes,i=t.edges;return r==null||r.forEach(function(a){a.size||(a.size=[50,50])}),(0,Qcr.default)({nodes:r,edges:i},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then(function(){t.onLayoutEnd&&t.onLayoutEnd()})},e.prototype.getType=function(){return"er"},e}(Jcr.Base);pk.ERLayout=efr;var yb={},FEe;function tfr(){if(FEe)return yb;FEe=1,Object.defineProperty(yb,"__esModule",{value:!0}),yb.Layouts=yb.Layout=void 0;var n=Z1,e=Z3,t=K3,r=Q3,i=J3,a=Nse,o=ek,s=qI,l=Lle,u=lk,h=uk,c=hk,f=ck,d=fk,v=dk,p=LHe(),g=vk,m=pk,y=nk,_=Dl(),x=function(){function S(w){var b=(0,n.getLayoutByName)(w.type);this.layoutInstance=new b(w)}return S.prototype.layout=function(w){return this.layoutInstance.layout(w)},S.prototype.updateCfg=function(w){this.layoutInstance.updateCfg(w)},S.prototype.init=function(w){this.correctLayers(w.nodes),this.layoutInstance.init(w)},S.prototype.correctLayers=function(w){if(!!(w!=null&&w.length)){var b=1/0,E=[];if(w.forEach(function(C){(0,_.isString)(C.layer)&&(C.layer=parseInt(C.layer,10)),!(C.layer===void 0||isNaN(C.layer))&&(E.push(C),C.layer<b&&(b=C.layer))}),b<=0){var T=Math.abs(b)+1;E.forEach(function(C){return C.layer+=T})}}},S.prototype.execute=function(){this.layoutInstance.execute()},S.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},S.prototype.destroy=function(){return this.layoutInstance.destroy()},S}();return yb.Layout=x,yb.Layouts={force:a.ForceLayout,fruchterman:c.FruchtermanLayout,forceAtlas2:g.ForceAtlas2Layout,gForce:i.GForceLayout,force2:r.Force2Layout,dagre:s.DagreLayout,dagreCompound:y.DagreCompoundLayout,circular:o.CircularLayout,radial:l.RadialLayout,concentric:u.ConcentricLayout,grid:e.GridLayout,mds:h.MDSLayout,comboForce:v.ComboForceLayout,comboCombined:p.ComboCombinedLayout,random:t.RandomLayout,"gForce-gpu":d.GForceGPULayout,"fruchterman-gpu":f.FruchtermanGPULayout,er:m.ERLayout},yb}var FHe={};Object.defineProperty(FHe,"__esModule",{value:!0});var BEe;function BHe(){return BEe||(BEe=1,function(n){var e=at&&at.__createBinding||(Object.create?function(w,b,E,T){T===void 0&&(T=E);var C=Object.getOwnPropertyDescriptor(b,E);(!C||("get"in C?!b.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return b[E]}}),Object.defineProperty(w,T,C)}:function(w,b,E,T){T===void 0&&(T=E),w[T]=b[E]}),t=at&&at.__exportStar||function(w,b){for(var E in w)E!=="default"&&!Object.prototype.hasOwnProperty.call(b,E)&&e(b,w,E)};Object.defineProperty(n,"__esModule",{value:!0}),n.ERLayout=n.ForceAtlas2Layout=n.ComboCombinedLayout=n.ComboForceLayout=n.GForceGPULayout=n.FruchtermanGPULayout=n.FruchtermanLayout=n.MDSLayout=n.ConcentricLayout=n.RadialLayout=n.DagreCompoundLayout=n.DagreLayout=n.CircularLayout=n.ForceLayout=n.Force2Layout=n.GForceLayout=n.RandomLayout=n.GridLayout=n.Layouts=n.Layout=void 0;var r=Z3;Object.defineProperty(n,"GridLayout",{enumerable:!0,get:function(){return r.GridLayout}});var i=K3;Object.defineProperty(n,"RandomLayout",{enumerable:!0,get:function(){return i.RandomLayout}});var a=J3;Object.defineProperty(n,"GForceLayout",{enumerable:!0,get:function(){return a.GForceLayout}});var o=Q3;Object.defineProperty(n,"Force2Layout",{enumerable:!0,get:function(){return o.Force2Layout}});var s=Nse;Object.defineProperty(n,"ForceLayout",{enumerable:!0,get:function(){return s.ForceLayout}});var l=ek;Object.defineProperty(n,"CircularLayout",{enumerable:!0,get:function(){return l.CircularLayout}});var u=qI;Object.defineProperty(n,"DagreLayout",{enumerable:!0,get:function(){return u.DagreLayout}});var h=nk;Object.defineProperty(n,"DagreCompoundLayout",{enumerable:!0,get:function(){return h.DagreCompoundLayout}});var c=Lle;Object.defineProperty(n,"RadialLayout",{enumerable:!0,get:function(){return c.RadialLayout}});var f=lk;Object.defineProperty(n,"ConcentricLayout",{enumerable:!0,get:function(){return f.ConcentricLayout}});var d=uk;Object.defineProperty(n,"MDSLayout",{enumerable:!0,get:function(){return d.MDSLayout}});var v=hk;Object.defineProperty(n,"FruchtermanLayout",{enumerable:!0,get:function(){return v.FruchtermanLayout}});var p=ck;Object.defineProperty(n,"FruchtermanGPULayout",{enumerable:!0,get:function(){return p.FruchtermanGPULayout}});var g=fk;Object.defineProperty(n,"GForceGPULayout",{enumerable:!0,get:function(){return g.GForceGPULayout}});var m=dk;Object.defineProperty(n,"ComboForceLayout",{enumerable:!0,get:function(){return m.ComboForceLayout}});var y=LHe();Object.defineProperty(n,"ComboCombinedLayout",{enumerable:!0,get:function(){return y.ComboCombinedLayout}});var _=vk;Object.defineProperty(n,"ForceAtlas2Layout",{enumerable:!0,get:function(){return _.ForceAtlas2Layout}});var x=pk;Object.defineProperty(n,"ERLayout",{enumerable:!0,get:function(){return x.ERLayout}});var S=tfr();Object.defineProperty(n,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(n,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),t(FHe,n)}(JX)),JX}(function(n){var e=at&&at.__createBinding||(Object.create?function(i,a,o,s){s===void 0&&(s=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(i,s,l)}:function(i,a,o,s){s===void 0&&(s=o),i[s]=a[o]}),t=at&&at.__exportStar||function(i,a){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),n.getLayoutByName=n.unRegisterLayout=n.registerLayout=void 0;var r=Z1;Object.defineProperty(n,"registerLayout",{enumerable:!0,get:function(){return r.registerLayout}}),Object.defineProperty(n,"unRegisterLayout",{enumerable:!0,get:function(){return r.unRegisterLayout}}),Object.defineProperty(n,"getLayoutByName",{enumerable:!0,get:function(){return r.getLayoutByName}}),t(BHe(),n)})(Yi);function rfr(n,e,t,r){return r===void 0&&(r="height"),t==="center"?(n[r]+e[r])/2:n.height}var Mw={assign:Object.assign,getHeight:rfr},GHe=Mw,qle=18,nfr=qle*2,GEe=qle,ifr={getId:function(e){return e.id||e.name},getPreH:function(e){return e.preH||0},getPreV:function(e){return e.preV||0},getHGap:function(e){return e.hgap||GEe},getVGap:function(e){return e.vgap||GEe},getChildren:function(e){return e.children},getHeight:function(e){return e.height||nfr},getWidth:function(e){var t=e.label||" ";return e.width||t.split("").length*qle}};function H9(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof H9)return n;t.data=n;var r=e.getHGap(n),i=e.getVGap(n);return t.preH=e.getPreH(n),t.preV=e.getPreV(n),t.width=e.getWidth(n),t.height=e.getHeight(n),t.width+=t.preH,t.height+=t.preV,t.id=e.getId(n),t.x=t.y=0,t.depth=0,t.children||(t.children=[]),t.addGap(r,i),t}GHe.assign(H9.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(e,t){var r=this;r.hgap+=e,r.vgap+=t,r.width+=2*e,r.height+=2*t},eachNode:function(e){for(var t=this,r=[t],i;i=r.shift();)e(i),r=i.children.concat(r)},DFTraverse:function(e){this.eachNode(e)},BFTraverse:function(e){for(var t=this,r=[t],i;i=r.shift();)e(i),r=r.concat(i.children)},getBoundingBox:function(){var e={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(t){e.left=Math.min(e.left,t.x),e.top=Math.min(e.top,t.y),e.width=Math.max(e.width,t.x+t.width),e.height=Math.max(e.height,t.y+t.height)}),e},translate:function(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.eachNode(function(r){r.x+=e,r.y+=t,r.x+=r.preH,r.y+=r.preV})},right2left:function(){var e=this,t=e.getBoundingBox();e.eachNode(function(r){r.x=r.x-(r.x-t.left)*2-r.width}),e.translate(t.width,0)},bottom2top:function(){var e=this,t=e.getBoundingBox();e.eachNode(function(r){r.y=r.y-(r.y-t.top)*2-r.height}),e.translate(0,t.height)}});function afr(n,e,t){e===void 0&&(e={}),e=GHe.assign({},ifr,e);var r=new H9(n,e),i=[r],a;if(!t&&!n.collapsed){for(;a=i.shift();)if(!a.data.collapsed){var o=e.getChildren(a.data),s=o?o.length:0;if(a.children=new Array(s),o&&s)for(var l=0;l<s;l++){var u=new H9(o[l],e);a.children[l]=u,i.push(u),u.parent=a,u.depth=a.depth+1}}}return r}var zHe=afr,ofr=zHe,sfr=function(){function n(t,r){r===void 0&&(r={});var i=this;i.options=r,i.rootNode=ofr(t,r)}var e=n.prototype;return e.execute=function(){throw new Error("please override this method")},n}(),IV=sfr;function bO(n,e,t,r){r===void 0&&(r=[]);var i=this;i.w=n||0,i.h=e||0,i.y=t||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}bO.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach(function(r){t.push(bO.fromNode(r,e))}),e?new bO(n.height,n.width,n.x,t):new bO(n.width,n.height,n.y,t)};function UHe(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach(function(r){UHe(r,e,t)})}function VHe(n,e){var t=e?n.y:n.x;return n.children.forEach(function(r){t=Math.min(VHe(r,e),t)}),t}function lfr(n,e){var t=VHe(n,e);UHe(n,-t,e)}function $He(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach(function(r,i){$He(r,e.children[i],t)})}function WHe(n,e,t){t===void 0&&(t=0),e?(n.x=t,t+=n.width):(n.y=t,t+=n.height),n.children.forEach(function(r){WHe(r,e,t)})}var ufr=function(n,e){e===void 0&&(e={});var t=e.isHorizontal;function r(y){if(y.cs===0){i(y);return}r(y.c[0]);for(var _=g(u(y.c[0].el),0,null),x=1;x<y.cs;++x){r(y.c[x]);var S=u(y.c[x].er);a(y,x,_),_=g(S,x,_)}f(y),i(y)}function i(y){y.cs===0?(y.el=y,y.er=y,y.msel=y.mser=0):(y.el=y.c[0].el,y.msel=y.c[0].msel,y.er=y.c[y.cs-1].er,y.mser=y.c[y.cs-1].mser)}function a(y,_,x){for(var S=y.c[_-1],w=S.mod,b=y.c[_],E=b.mod;S!==null&&b!==null;){u(S)>x.low&&(x=x.nxt);var T=w+S.prelim+S.w-(E+b.prelim);T>0&&(E+=T,o(y,_,x.index,T));var C=u(S),A=u(b);C<=A&&(S=l(S),S!==null&&(w+=S.mod)),C>=A&&(b=s(b),b!==null&&(E+=b.mod))}!S&&!!b?h(y,_,b,E):!!S&&!b&&c(y,_,S,w)}function o(y,_,x,S){y.c[_].mod+=S,y.c[_].msel+=S,y.c[_].mser+=S,v(y,_,x,S)}function s(y){return y.cs===0?y.tl:y.c[0]}function l(y){return y.cs===0?y.tr:y.c[y.cs-1]}function u(y){return y.y+y.h}function h(y,_,x,S){var w=y.c[0].el;w.tl=x;var b=S-x.mod-y.c[0].msel;w.mod+=b,w.prelim-=b,y.c[0].el=y.c[_].el,y.c[0].msel=y.c[_].msel}function c(y,_,x,S){var w=y.c[_].er;w.tr=x;var b=S-x.mod-y.c[_].mser;w.mod+=b,w.prelim-=b,y.c[_].er=y.c[_-1].er,y.c[_].mser=y.c[_-1].mser}function f(y){y.prelim=(y.c[0].prelim+y.c[0].mod+y.c[y.cs-1].mod+y.c[y.cs-1].prelim+y.c[y.cs-1].w)/2-y.w/2}function d(y,_){_+=y.mod,y.x=y.prelim+_,p(y);for(var x=0;x<y.cs;x++)d(y.c[x],_)}function v(y,_,x,S){if(x!==_-1){var w=_-x;y.c[x+1].shift+=S/w,y.c[_].shift-=S/w,y.c[_].change-=S-S/w}}function p(y){for(var _=0,x=0,S=0;S<y.cs;S++)_+=y.c[S].shift,x+=_+y.c[S].change,y.c[S].mod+=x}function g(y,_,x){for(;x!==null&&y>=x.low;)x=x.nxt;return{low:y,index:_,nxt:x}}WHe(n,t);var m=bO.fromNode(n,t);return r(m),d(m,0),$He(m,n,t),lfr(n,t),n},zEe=zHe,HHe=function(n,e){for(var t=zEe(n.data,e,!0),r=zEe(n.data,e,!0),i=n.children.length,a=Math.round(i/2),o=e.getSide||function(h,c){return c<a?"right":"left"},s=0;s<i;s++){var l=n.children[s],u=o(l,s);u==="right"?r.children.push(l):t.children.push(l)}return t.eachNode(function(h){h.isRoot()||(h.side="left")}),r.eachNode(function(h){h.isRoot()||(h.side="right")}),{left:t,right:r}},hfr=HHe,Ix=["LR","RL","TB","BT","H","V"],cfr=["LR","RL","H"],ffr=function(e){return cfr.indexOf(e)>-1},dfr=Ix[0],Zle=function(n,e,t){var r=e.direction||dfr;if(e.isHorizontal=ffr(r),r&&Ix.indexOf(r)===-1)throw new TypeError("Invalid direction: "+r);if(r===Ix[0])t(n,e);else if(r===Ix[1])t(n,e),n.right2left();else if(r===Ix[2])t(n,e);else if(r===Ix[3])t(n,e),n.bottom2top();else if(r===Ix[4]||r===Ix[5]){var i=hfr(n,e),a=i.left,o=i.right;t(a,e),t(o,e),e.isHorizontal?a.right2left():a.bottom2top(),o.translate(a.x-o.x,a.y-o.y),n.x=a.x,n.y=o.y;var s=n.getBoundingBox();e.isHorizontal?s.top<0&&n.translate(0,-s.top):s.left<0&&n.translate(-s.left,0)}var l=e.fixedRoot;return l===void 0&&(l=!0),l&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),vfr(n,e),n};function vfr(n,e){if(e.radial){var t=e.isHorizontal?["x","y"]:["y","x"],r=t[0],i=t[1],a={x:1/0,y:1/0},o={x:-1/0,y:-1/0},s=0;n.DFTraverse(function(h){s++;var c=h.x,f=h.y;a.x=Math.min(a.x,c),a.y=Math.min(a.y,f),o.x=Math.max(o.x,c),o.y=Math.max(o.y,f)});var l=o[i]-a[i];if(l===0)return;var u=Math.PI*2/s;n.DFTraverse(function(h){var c=(h[i]-a[i])/l*(Math.PI*2-u)+u,f=h[r]-n[r];h.x=Math.cos(c)*f,h.y=Math.sin(c)*f})}}function pfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,ete(n,e)}function ete(n,e){return ete=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ete(n,e)}var gfr=IV,yfr=ufr,mfr=Zle,_fr=Mw,xfr=function(n){function e(){return n.apply(this,arguments)||this}pfr(e,n);var t=e.prototype;return t.execute=function(){var i=this;return mfr(i.rootNode,i.options,yfr)},e}(gfr),Sfr={};function wfr(n,e){return e=_fr.assign({},Sfr,e),new xfr(n,e).execute()}var bfr=wfr,Efr=Mw;function Tfr(n,e){e===void 0&&(e=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=e}var Cfr={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function jHe(n,e,t){t?(e.x=n.x,e.y=n.y):(e.x=n.y,e.y=n.x),n.children.forEach(function(r,i){jHe(r,e.children[i],t)})}var Afr=function(n,e){e===void 0&&(e={}),e=Efr.assign({},Cfr,e);var t=0;function r(l){if(!l)return null;l.width=0,l.depth&&l.depth>t&&(t=l.depth);var u=l.children,h=u.length,c=new Tfr(l.height,[]);return u.forEach(function(f,d){var v=r(f);c.children.push(v),d===0&&(c.leftChild=v),d===h-1&&(c.rightChild=v)}),c.originNode=l,c.isLeaf=l.isLeaf(),c}function i(l){if(l.isLeaf||l.children.length===0)l.drawingDepth=t;else{var u=l.children.map(function(c){return i(c)}),h=Math.min.apply(null,u);l.drawingDepth=h-1}return l.drawingDepth}var a;function o(l){l.x=l.drawingDepth*e.rankSep,l.isLeaf?(l.y=0,a&&(l.y=a.y+a.height+e.nodeSep,l.originNode.parent!==a.originNode.parent&&(l.y+=e.subTreeSep)),a=l):(l.children.forEach(function(u){o(u)}),l.y=(l.leftChild.y+l.rightChild.y)/2)}var s=r(n);return i(s),o(s),jHe(s,n,e.isHorizontal),n};function Mfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,tte(n,e)}function tte(n,e){return tte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},tte(n,e)}var Ifr=IV,Lfr=Afr,Pfr=Zle,Ofr=Mw,Rfr=function(n){function e(){return n.apply(this,arguments)||this}Mfr(e,n);var t=e.prototype;return t.execute=function(){var i=this;return i.rootNode.width=0,Pfr(i.rootNode,i.options,Lfr)},e}(Ifr),Dfr={};function Nfr(n,e){return e=Ofr.assign({},Dfr,e),new Rfr(n,e).execute()}var kfr=Nfr,UEe=Mw;function Ffr(n,e,t,r,i){var a=(typeof t=="function"?t(n):t)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id){n.x+=a,n.y=e?e.y:0;return}}catch{}if(n.x+=a,e){if(n.y=e.y+UEe.getHeight(e,n,i),e.parent&&n.parent.id!==e.parent.id){var o=e.parent,s=o.y+UEe.getHeight(o,n,i);n.y=s>n.y?s:n.y}}else n.y=0}var Bfr=function(n,e,t,r){var i=null;n.eachNode(function(a){Ffr(a,i,e,t,r),i=a})};function Gfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,rte(n,e)}function rte(n,e){return rte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},rte(n,e)}var zfr=IV,H5=Bfr,Ufr=HHe,Vfr=Mw,EO=["LR","RL","H"],$fr=EO[0],Wfr=function(n){function e(){return n.apply(this,arguments)||this}Gfr(e,n);var t=e.prototype;return t.execute=function(){var i=this,a=i.options,o=i.rootNode;a.isHorizontal=!0;var s=a.indent,l=s===void 0?20:s,u=a.dropCap,h=u===void 0?!0:u,c=a.direction,f=c===void 0?$fr:c,d=a.align;if(f&&EO.indexOf(f)===-1)throw new TypeError("Invalid direction: "+f);if(f===EO[0])H5(o,l,h,d);else if(f===EO[1])H5(o,l,h,d),o.right2left();else if(f===EO[2]){var v=Ufr(o,a),p=v.left,g=v.right;H5(p,l,h,d),p.right2left(),H5(g,l,h,d);var m=p.getBoundingBox();g.translate(m.width,0),o.x=g.x-o.width/2}return o},e}(zfr),Hfr={};function jfr(n,e){return e=Vfr.assign({},Hfr,e),new Wfr(n,e).execute()}var Xfr=jfr,Yfr=Mw;function XHe(n,e){var t=0;return n.children.length?n.children.forEach(function(r){t+=XHe(r,e)}):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function YHe(n){var e=n.children,t=e.length;if(t){e.forEach(function(l){YHe(l)});var r=e[0],i=e[t-1],a=i.y-r.y+i.height,o=0;if(e.forEach(function(l){o+=l.totalHeight}),a>n.height)n.y=r.y+a/2-n.height/2;else if(e.length!==1||n.height>o){var s=n.y+(n.height-a)/2-r.y;e.forEach(function(l){l.translate(0,s)})}else n.y=(r.y+r.height/2+i.y+i.height/2)/2-n.height/2}}var qfr={getSubTreeSep:function(){return 0}},Zfr=function(n,e){e===void 0&&(e={}),e=Yfr.assign({},qfr,e),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse(function(t){t.x=t.parent.x+t.parent.width}),n.parent=null,XHe(n,e),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode(function(t){var r=t.children,i=r.length;if(i){var a=r[0];if(a.startY=t.startY+t._subTreeSep,i===1)a.y=t.y+t.height/2-a.height/2;else{a.y=a.startY+a.totalHeight/2-a.height/2;for(var o=1;o<i;o++){var s=r[o];s.startY=r[o-1].startY+r[o-1].totalHeight,s.y=s.startY+s.totalHeight/2-s.height/2}}}}),YHe(n)};function Kfr(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,nte(n,e)}function nte(n,e){return nte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},nte(n,e)}var Jfr=IV,Qfr=Zfr,edr=Zle,tdr=Mw,rdr=function(n){function e(){return n.apply(this,arguments)||this}Kfr(e,n);var t=e.prototype;return t.execute=function(){var i=this;return edr(i.rootNode,i.options,Qfr)},e}(Jfr),ndr={};function idr(n,e){return e=tdr.assign({},ndr,e),new rdr(n,e).execute()}var adr=idr,odr={compactBox:bfr,dendrogram:kfr,indented:Xfr,mindmap:adr},j9=odr,VEe=gc.traverseTree,sdr=function(e,t){var r;return e?on(e)?r=function(a){return e}:r=e:r=function(a){return t||1},r},ldr=function(e,t){var r=[],i=[],a={},o=0;for(o=0;o<e.length;o++){var s=e[o];a[s.id]=o,r.push(s.x),r.push(s.y),r.push(0),r.push(0),i.push([])}for(o=0;o<t.length;o++){var l=t[o];i[a[l.source]].push(a[l.target]),i[a[l.target]].push(a[l.source])}var u=0;for(o=0;o<e.length;o++){var h=r.length,c=i[o],f=c.length;r[o*4+2]=h,r[o*4+3]=c.length,u=Math.max(u,c.length);for(var d=0;d<f;++d){var v=c[d];r.push(+v)}}for(;r.length%4!==0;)r.push(0);return{array:new Float32Array(r),maxEdgePerVetex:u}},udr=function(e,t,r){var i=[],a=[],o={},s=0;for(s=0;s<e.length;s++){var l=e[s];o[l.id]=s,i.push(l.x),i.push(l.y),i.push(0),i.push(0),a.push([])}for(s=0;s<t.length;s++){var u=t[s];a[o[u.source]].push(o[u.target]),a[o[u.source]].push(r(u)),a[o[u.target]].push(o[u.source]),a[o[u.target]].push(r(u))}var h=0;for(s=0;s<e.length;s++){var c=i.length,f=a[s],d=f.length;i[s*4+2]=c,i[s*4+3]=d/2,h=Math.max(h,d/2);for(var v=0;v<d;++v){var p=f[v];i.push(+p)}}for(;i.length%4!==0;)i.push(0);return{array:new Float32Array(i),maxEdgePerVetex:h}},hdr=function(e,t,r,i){var a=[],o=[],s={},l=0;for(l=0;l<e.length;l++){var u=e[l];s[u.id]=l,a.push(u.x),a.push(u.y),a.push(0),a.push(0),o.push([])}for(l=0;l<t.length;l++){var h=t[l];o[s[h.source]].push(s[h.target]),o[s[h.source]].push(r(h)),o[s[h.source]].push(i(h)),o[s[h.source]].push(0),o[s[h.target]].push(s[h.source]),o[s[h.target]].push(r(h)),o[s[h.target]].push(i(h)),o[s[h.target]].push(0)}var c=0;for(l=0;l<e.length;l++){var f=a.length,d=o[l],v=d.length;a[l*4+2]=f+1048576*v/4,a[l*4+3]=0,c=Math.max(c,v/4);for(var p=0;p<v;++p){var g=d[p];a.push(+g)}}for(;a.length%4!==0;)a.push(0);return{array:new Float32Array(a),maxEdgePerVetex:c}},cdr=function(e,t){var r=[],i=e.length,a={};return t.forEach(function(o){e.forEach(function(s,l){if(a[o[s]]===void 0&&(a[o[s]]=Object.keys(a).length),r.push(a[o[s]]),l===i-1)for(;r.length%4!==0;)r.push(0)})}),{array:new Float32Array(r),count:Object.keys(a).length}},fdr=function(e){for(var t=[],r=e.length,i=e[0].length,a=function(l){e.forEach(function(u,h){if(t.push(u[l]),h===r-1)for(;t.length%4!==0;)t.push(0)})},o=0;o<i;o++)a(o);return new Float32Array(t)},ddr=function(e,t){var r=["V","TB","BT"],i={x:1/0,y:1/0},a={x:-1/0,y:-1/0},o="x",s="y";t&&r.indexOf(t)>=0&&(s="x",o="y");var l=0;VEe(e,function(c){return l++,c.x>a.x&&(a.x=c.x),c.x<i.x&&(i.x=c.x),c.y>a.y&&(a.y=c.y),c.y<i.y&&(i.y=c.y),!0});var u=Math.PI*2/l,h=a[s]-i[s];return h===0||VEe(e,function(c){var f=(c[s]-i[s])/h*(Math.PI*2-u)+u,d=Math.abs(o==="x"?c.x-e.x:c.y-e.y);return c.x=d*Math.cos(f),c.y=d*Math.sin(f),!0}),e};const vdr=Object.freeze(Object.defineProperty({__proto__:null,proccessToFunc:sdr,buildTextureData:ldr,buildTextureDataWithOneEdgeAttr:udr,buildTextureDataWithTwoEdgeAttr:hdr,attributesToTextureData:cdr,arrayToTextureData:fdr,radialLayout:ddr},Symbol.toStringTag,{value:"Module"}));var Kle=function(){return typeof window>"u"||typeof document>"u"?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch{return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
`):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
`)),t},addGetWebGLMessage:function(t){t=t||{};var r=t.parent!==void 0?t.parent:document.body,i=t.id!==void 0?t.id:"oldie",a=Kle().getWebGLErrorMessage();a.id=i,r.appendChild(a)}}};const pdr=Object.freeze(Object.defineProperty({__proto__:null,gpuDetector:Kle},Symbol.toStringTag,{value:"Module"}));var qHe=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("firefox")>-1?"firefox":e.indexOf("safari")>-1?"safari":e.indexOf("opr")>-1?"opera":e.indexOf("chrome")>-1?"chrome":e.indexOf("trident")>-1?"ie 11":e.indexOf("ie")>-1?"ie":"unknown"};const gdr=Object.freeze(Object.defineProperty({__proto__:null,getBrowserName:qHe},Symbol.toStringTag,{value:"Module"}));var H_=ve(ve(ve(ve(ve({},gc),fYt),vdr),pdr),gdr),ydr=H_.radialLayout,mdr=function(){function n(e){this.type=e.type,this.radial=e.radial,this.config=e}return n.prototype.init=function(e){var t=this;if(this.data=e,this.radial){this.layoutMethod=function(r){var i=j9[t.type](r,t.config);return ydr(i),i};return}this.layoutMethod=function(r){return j9[t.type](r,t.config)}},n.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},n.prototype.layout=function(e){return this.init(e),this.execute()},n}();Yi.registerLayout("grid",Yi.GridLayout);Yi.registerLayout("random",Yi.RandomLayout);Yi.registerLayout("force",Yi.ForceLayout);Yi.registerLayout("circular",Yi.CircularLayout);Yi.registerLayout("dagre",Yi.DagreLayout);Yi.registerLayout("dagreCompound",Yi.DagreCompoundLayout);Yi.registerLayout("radial",Yi.RadialLayout);Yi.registerLayout("concentric",Yi.ConcentricLayout);Yi.registerLayout("mds",Yi.MDSLayout);Yi.registerLayout("fruchterman",Yi.FruchtermanLayout);Yi.registerLayout("fruchterman-gpu",Yi.FruchtermanGPULayout);Yi.registerLayout("gForce",Yi.GForceLayout);Yi.registerLayout("force2",Yi.Force2Layout);Yi.registerLayout("gForce-gpu",Yi.GForceGPULayout);Yi.registerLayout("comboForce",Yi.ComboForceLayout);Yi.registerLayout("comboCombined",Yi.ComboCombinedLayout);Yi.registerLayout("forceAtlas2",Yi.ForceAtlas2Layout);var _dr=function(e,t){t.isCustomLayout=!0,Yi.Layouts[e]=Yi.registerLayout(e,t)},xdr=function(){function n(e,t){var r=e.toString(),i=new Blob(["importScripts('".concat(t,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(i))}return n}(),Sdr=function(e){e===void 0&&(e="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js");function t(){var i={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout);function a(s){var l=s.data.type;return l===i.RUN||l===i.GPURUN}function o(s){var l=this,u=s.data.type;switch(u){case i.RUN:{var h=s.data,c=h.nodes,f=h.edges,d=h.layoutCfg,v=d===void 0?{}:d,p=v.type,g=layout.getLayoutByName(p);if(!g){this.postMessage({type:i.ERROR,message:"layout ".concat(p," not found")});break}var m;v.onLayoutEnd=function(){l.postMessage({type:i.END,nodes:c}),m==null||m.destroy()},m=new g(v),m.init({nodes:c,edges:f}),m.execute();break}case i.GPURUN:{var y=s.data,_=y.nodes,f=y.edges,x=y.layoutCfg,v=x===void 0?{}:x,S=y.canvas,p=v.type,g=layout.getLayoutByName(p);if(!g){this.postMessage({type:i.ERROR,message:"layout ".concat(p," not found")});break}if(p.split("-")[1]!=="gpu"){this.postMessage({type:i.ERROR,message:"layout ".concat(p," does not support GPU")});break}var w=new g(v);w.init({nodes:_,edges:f}),w.executeWithWorker(S,this);break}}}onmessage=function(l){a(l)&&o(l)}}var r=new xdr(t,e);return r},_C={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};function ite(n){return ite=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ite(n)}var $Ee=function(e){return setTimeout(e,16)},WEe=function(e){return clearTimeout(e)},j5={requestAnimationFrame:function(e){var t=typeof window<"u"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||$Ee;return t(e)},cancelAnimationFrame:function(e){var t=typeof window<"u"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||WEe;return t(e)}},wdr=["fruchterman","gForce"],bdr=["force","grid","circular"],Edr=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.graph=t,r.layoutCfg=t.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:(typeof Worker>"u"?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=Sdr(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;!this.worker||(this.worker.terminate(),this.worker=null,t.requestId&&(j5.cancelAnimationFrame(t.requestId),t.requestId=null),t.requestId2&&(j5.cancelAnimationFrame(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,r){var i=this;return new Promise(function(a,o){return Qd(i,void 0,void 0,function(){var s,l,u,h,c,p,f,d,v,p,g;return ev(this,function(m){switch(m.label){case 0:if(s=this.graph,!s||s.get("destroyed"))return[2];l=t.type,t.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},l&&this.isGPU&&(ZHe(l)?l="".concat(l,"-gpu"):console.warn("The '".concat(l,"' layout does not support GPU calculation for now, it will run in CPU."))),gc.isForce(l)?(u=t.onTick,h=t.animate,c=h===void 0&&(l==="force"||l==="force2"),p=function(){u&&u(),(h||c)&&s.refreshPositions()},t.tick=p):(l==="comboForce"||l==="comboCombined")&&(t.comboTrees=s.get("comboTrees")),f=!1;try{d=new Yi.Layouts[l](t),this.layoutMethods[r]&&this.layoutMethods[r].destroy(),this.layoutMethods[r]=d}catch{console.warn("The layout method: '".concat(l,"' does not exist! Please specify it first.")),o()}return f=d.enableTick,f&&(v=t.onTick,p=function(){v&&v(),s.refreshPositions()},d.tick=p),g=this.filterLayoutData(this.data,t),Adr(g,r),d.init(g),s.emit("beforesublayout",{type:l}),[4,d.execute()];case 1:return m.sent(),d.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}})})})},e.prototype.updateLayoutMethod=function(t,r){var i=this;return new Promise(function(a,o){return Qd(i,void 0,void 0,function(){var s,l,u,h,c,f,d;return ev(this,function(v){switch(v.label){case 0:return s=this.graph,l=r==null?void 0:r.type,r.onLayoutEnd=function(){s.emit("aftersublayout",{type:l}),a()},gc.isForce(l)&&(u=r.onTick,h=r.animate,c=h===void 0&&(l==="force"||l==="force2"),f=function(){u==null||u(),(h||c)&&s.refreshPositions()},r.tick=f),d=this.filterLayoutData(this.data,r),t.init(d),t.updateCfg(r),s.emit("beforesublayout",{type:l}),[4,t.execute()];case 1:return v.sent(),t.isCustomLayout&&r.onLayoutEnd&&r.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var r=this,i,a=this.graph;if(!(!a||a.get("destroyed"))){this.data=this.setDataFromGraph();var o=this.data,s=o.nodes,l=o.hiddenNodes;if(!s)return!1;var u=a.get("width"),h=a.get("height"),c={};Object.assign(c,{width:u,height:h,center:[u/2,h/2]},this.layoutCfg),this.layoutCfg=c;var f=c.type,d=!1;(i=this.layoutMethods)===null||i===void 0||i.forEach(function(S){var w;return d=!!(!((w=S.nodes)===null||w===void 0)&&w.length)||d});var v=this.destoryLayoutMethods();a.emit("beforelayout");var p=Promise.resolve();d&&f&&(v==null?void 0:v.length)===1&&v[0]===f?this.tweakInit():p=this.initPositions(c.center,s);var g=this.initPositions(c.center,l);g.then(),this.isGPU=HEe(c,f);var m=c.onLayoutEnd,y=c.layoutEndFormatted,_=c.adjust;if(y||(c.layoutEndFormatted=!0,c.onAllLayoutEnd=function(){return Qd(r,void 0,void 0,function(){return ev(this,function(S){switch(S.label){case 0:return m&&m(s),this.refreshLayout(),_&&c.pipes?[4,this.adjustPipesBox(this.data,_)]:[3,2];case 1:S.sent(),this.refreshLayout(),S.label=2;case 2:return a.emit("afterlayout"),[2]}})})}),this.stopWorker(),c.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var x=!1;return c.type?(x=!0,p=p.then(function(){return Qd(r,void 0,void 0,function(){return ev(this,function(S){switch(S.label){case 0:return[4,this.execLayoutMethod(c,0)];case 1:return[2,S.sent()]}})})})):c.pipes&&(x=!0,c.pipes.forEach(function(S,w){p=p.then(function(){return Qd(r,void 0,void 0,function(){return ev(this,function(b){switch(b.label){case 0:return[4,this.execLayoutMethod(S,w)];case 1:return[2,b.sent()]}})})})})),x?p.then(function(){c.onAllLayoutEnd&&c.onAllLayoutEnd(),t&&t()}).catch(function(S){console.warn("graph layout failed,",S)}):(a.refreshPositions(),t==null||t()),!1}},e.prototype.tweakInit=function(){var t=this,r=t.data,i=t.graph,a=r.nodes,o=r.edges;if(!!(a!=null&&a.length)){var s={};a.forEach(function(h){var c=h.x,f=h.y;!isNaN(c)&&!isNaN(f)&&(s[h.id]={x:c,y:f},h.mass=h.mass||2)}),o.forEach(function(h){var c=h.source,f=h.target,d=s[c],v=s[f];!d&&v?s[c]={x:v.x+(Math.random()-.5)*80,y:v.y+(Math.random()-.5)*80}:!v&&d&&(s[f]={x:d.x+(Math.random()-.5)*80,y:d.y+(Math.random()-.5)*80})});var l=i.get("width"),u=i.get("height");a.forEach(function(h){var c=s[h.id]||{x:l/2+(Math.random()-.5)*20,y:u/2+(Math.random()-.5)*20};h.x=c.x,h.y=c.y})}},e.prototype.initWithPreset=function(t,r){var i=this;return new Promise(function(a,o){return Qd(i,void 0,void 0,function(){var s,l,u,h,c,f,d;return ev(this,function(v){switch(v.label){case 0:return s=this,l=s.layoutCfg,u=s.data,h=l.preset,!(h!=null&&h.type)||!Yi.Layouts[h==null?void 0:h.type]?(r==null||r(),a(),[2,!1]):(c=HEe(h,h.type),f=c?"".concat(h.type,"-gpu"):h.type,d=new Yi.Layouts[f](h),delete l.preset,d.init(u),[4,d.execute()]);case 1:return v.sent(),t==null||t(),a(),[2,!0]}})})})},e.prototype.layoutWithWorker=function(t,r){var i=this,a=this,o=a.layoutCfg,s=a.graph,l=this.getWorker(),u=this.workerData;if(!l)return!1;u.requestId=null,u.requestId2=null,u.currentTick=null,u.currentTickData=null,s.emit("beforelayout");var h=Promise.resolve(),c=!1;if(o.type)c=!0,h=h.then(function(){return i.runWebworker(l,t,o)});else if(o.pipes){c=!0;for(var f=function(m){h=h.then(function(){return i.runWebworker(l,t,m)})},d=0,v=o.pipes;d<v.length;d++){var p=v[d];f(p)}}return c&&h.then(function(){o.onAllLayoutEnd&&o.onAllLayoutEnd(),r==null||r()}).catch(function(g){console.error("layout failed",g)}),!0},e.prototype.runWebworker=function(t,r,i){var a=this,o=this.isGPU,s=this.filterLayoutData(r,i),l=s.nodes,u=s.edges,h=document.createElement("canvas"),c=o&&typeof window<"u"&&window.navigator&&!navigator.gpu&&"OffscreenCanvas"in window&&"transferControlToOffscreen"in h,f=Tdr(i,function(v){return typeof v!="function"});if(!c)t.postMessage({type:_C.RUN,nodes:l,edges:u,layoutCfg:f});else{var d=h.transferControlToOffscreen();f.type="".concat(f.type,"-gpu"),t.postMessage({type:_C.GPURUN,nodes:l,edges:u,layoutCfg:f,canvas:d},[d])}return new Promise(function(v,p){t.onmessage=function(g){a.handleWorkerMessage(v,p,g,s,i)}})},e.prototype.handleWorkerMessage=function(t,r,i,a,o){var s=this,l=s.graph,u=s.workerData,h=i.data,c=h.type,f=function(){o.onTick&&o.onTick()};switch(c){case _C.TICK:u.currentTick=h.currentTick,u.currentTickData=h,u.requestId||(u.requestId=j5.requestAnimationFrame(function(){PY(a,h),l.refreshPositions(),f(),h.currentTick===h.totalTicks?t():u.currentTick===h.totalTicks&&(u.requestId2=j5.requestAnimationFrame(function(){PY(a,u.currentTickData),l.refreshPositions(),u.requestId2=null,f(),t()})),u.requestId=null}));break;case _C.END:u.currentTick==null&&(PY(a,h),t());break;case _C.GPUEND:u.currentTick==null&&(Cdr(a,h),t());break;case _C.ERROR:console.warn("Web-Worker layout error!",h.message),r();break;default:r();break}},e.prototype.updateLayoutCfg=function(t){var r=this,i=this,a=i.graph,o=i.layoutMethods;if(!(!a||a.get("destroyed"))){var s=t.disableTriggerLayout,l=rh(t,["disableTriggerLayout"]),u=_n({},this.layoutCfg,l);if(this.layoutCfg=u,!s){if(!(o!=null&&o.length)){this.layout();return}if(this.data=this.setDataFromGraph(),this.stopWorker(),!(l.workerEnabled&&this.layoutWithWorker(this.data,null))){a.emit("beforelayout");var h=Promise.resolve(),c=!1;(o==null?void 0:o.length)===1?(c=!0,h=h.then(function(){return Qd(r,void 0,void 0,function(){return ev(this,function(f){switch(f.label){case 0:return[4,this.updateLayoutMethod(o[0],u)];case 1:return[2,f.sent()]}})})})):o!=null&&o.length&&(c=!0,o.forEach(function(f,d){var v=u.pipes[d];h=h.then(function(){return Qd(r,void 0,void 0,function(){return ev(this,function(p){switch(p.label){case 0:return[4,this.updateLayoutMethod(f,v)];case 1:return[2,p.sent()]}})})})})),c&&h.then(function(){u.onAllLayoutEnd&&u.onAllLayoutEnd()}).catch(function(f){console.warn("layout failed",f)})}}}},e.prototype.adjustPipesBox=function(t,r){var i=this;return new Promise(function(a){var o=t.nodes;o!=null&&o.length||a(),bdr.includes(r)||(console.warn("The adjust type ".concat(r," is not supported yet, please assign it with 'force', 'grid', or 'circular'.")),a());var s={center:i.layoutCfg.center,nodeSize:function(v){return Math.max(v.height,v.width)},preventOverlap:!0,onLayoutEnd:function(){}},l=i.getLayoutBBox(o),u=l.groupNodes,h=l.layoutNodes,c=Xi(h);s.onLayoutEnd=function(){h==null||h.forEach(function(d,v){var p,g,m,y=d.x-((p=c[v])===null||p===void 0?void 0:p.x),_=d.y-((g=c[v])===null||g===void 0?void 0:g.y);(m=u[v])===null||m===void 0||m.forEach(function(x){x.x+=y,x.y+=_})}),a()};var f=new Yi.Layouts[r](s);f.layout({nodes:h})})},e.prototype.destroy=function(){this.destoryLayoutMethods();var t=this.worker;t&&(t.terminate(),this.worker=null),this.destroyed=!0,this.graph.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0,this.graph=null},e}(RUe);function PY(n,e){for(var t=n.nodes,r=e.nodes,i=t.length,a=0;a<i;a++){var o=t[a];o.x=r[a].x,o.y=r[a].y}}function Tdr(n,e){var t={};return n&&ite(n)==="object"?(Object.keys(n).forEach(function(r){n.hasOwnProperty(r)&&e(n[r])&&(t[r]=n[r])}),t):n}function Cdr(n,e){for(var t=n.nodes,r=e.vertexEdgeData,i=t.length,a=0;a<i;a++){var o=t[a],s=r[4*a],l=r[4*a+1];o.x=s,o.y=l}}function Adr(n,e){var t;if(!!(!((t=n==null?void 0:n.nodes)===null||t===void 0)&&t.length)){var r=n.nodes;r.forEach(function(i){i.layoutOrder=e})}}function ZHe(n){return wdr.includes(n)}function HEe(n,e){var t=e;e&&e.split("-")[1]==="gpu"&&(t=e.split("-")[0],n.gpuEnabled=!0);var r=!1;return n.gpuEnabled&&(r=!0,Kle().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),r=!1)),r&&!ZHe(t)&&(console.warn("The '".concat(t,"' layout does not support GPU calculation for now, it will run in CPU.")),r=!1),r}var jEe=sg,Mdr="svg",KHe=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this,i=r.get("defaultNode");return i||r.set("defaultNode",{type:"circle"}),i.type||(i.type="circle",r.set("defaultNode",i)),r.destroyed=!1,r}return e.prototype.initLayoutController=function(){var t=new Edr(this);this.set({layoutController:t})},e.prototype.initEventController=function(){var t=new mYt(this);this.set({eventController:t})},e.prototype.initCanvas=function(){var t=this.get("container");if(typeof t=="string"&&(t=document.getElementById(t),this.set("container",t)),!t)throw new Error("invalid container");var r=t.clientWidth,i=t.clientHeight,a=this.get("width")||r,o=this.get("height")||i;!this.get("width")&&!this.get("height")&&(this.set("width",r),this.set("height",i));var s=this.get("renderer"),l;if(s===Mdr)l=new yR({container:t,width:a,height:o});else{var u={container:t,width:a,height:o},h=this.get("pixelRatio");h&&(u.pixelRatio=h,window.devicePixelRatio=h),l=new M1(u)}this.set("canvas",l)},e.prototype.initPlugins=function(){var t=this;At(t.get("plugins"),function(r){!r.destroyed&&r.initPlugin&&r.initPlugin(t)})},e.prototype.downloadImageWatermark=function(t,r,i,a){return Qd(this,void 0,void 0,function(){var o,s,l;return ev(this,function(u){switch(u.label){case 0:return o=t.style.backgroundImage,s=o.slice(5,o.length-2),l=new Image,l.src=s,[4,new Promise(function(h){l.onload=function(){var c=r.createPattern(l,"repeat");r.rect(0,0,i,a),r.fillStyle=c,r.fill(),h("")}})];case 1:return u.sent(),[2]}})})},e.prototype.asyncToDataUrl=function(t,r,i,a,o,s){var l=this,u=document.querySelector(".g6-graph-watermarker"),h=this.get("canvas"),c=h.getRenderer(),f=s||h.get("el"),d="";t||(t="image/png"),setTimeout(function(){return Qd(l,void 0,void 0,function(){var v,p,g,m,y,_,x,S,w,b;return ev(this,function(E){switch(E.label){case 0:return c!=="svg"?[3,1]:(v=f.cloneNode(!0),p=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),g=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",p),g.replaceChild(v,g.documentElement),m=new XMLSerializer().serializeToString(g),d="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(m)),[3,4]);case 1:return y=void 0,_=f.getContext("2d"),x=a||this.get("width"),S=o||this.get("height"),w=void 0,u?[4,this.downloadImageWatermark(u,_,x,S)]:[3,3];case 2:E.sent(),E.label=3;case 3:if(r){b=typeof window<"u"?window.devicePixelRatio:1;try{y=_.getImageData(0,0,x*b,S*b),w=_.globalCompositeOperation,_.globalCompositeOperation="destination-over",_.fillStyle=r,_.fillRect(0,0,x,S)}catch{console.error("Download image failed. Out of memory at ImageData creation")}}d=f.toDataURL(t),r&&(_.clearRect(0,0,x,S),_.putImageData(y,0,0),_.globalCompositeOperation=w),E.label=4;case 4:return i&&i(d),[2]}})})},16)},e.prototype.toDataURL=function(t,r){var i=this.get("canvas"),a=i.getRenderer(),o=i.get("el");t||(t="image/png");var s="";if(a==="svg"){var l=o.cloneNode(!0),u=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),h=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",u);h.replaceChild(l,h.documentElement);var c=new XMLSerializer().serializeToString(h);s="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(c))}else{var f=void 0,d=o.getContext("2d"),v=Math.max(this.get("width"),500),p=Math.max(this.get("height"),500),g=void 0;if(r){var m=typeof window<"u"&&window.devicePixelRatio||1;try{f=d.getImageData(0,0,v*m,p*m),g=d.globalCompositeOperation,d.globalCompositeOperation="destination-over",d.fillStyle=r,d.fillRect(0,0,v,p)}catch{console.error("Download image failed. Out of memory at ImageData creation")}}s=o.toDataURL(t),r&&(d.clearRect(0,0,v,p),d.putImageData(f,0,0),d.globalCompositeOperation=g)}return s},e.prototype.toFullDataURL=function(t,r,i){var a=this.get("group").getCanvasBBox(),o=a.height,s=a.width,l=this.get("renderer"),u=zs('<div id="virtual-image"></div>'),h=i?i.backgroundColor:void 0,c=i?i.padding:void 0;c?on(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var f=o+c[0]+c[2],d=s+c[1]+c[3],v={container:u,height:f,width:d,quickHit:!0},p=l==="svg"?new yR(v):new M1(v),g=this.get("group"),m=g.clone(),y=Xi(m.getMatrix());y||(y=[1,0,0,0,1,0,0,0,1]);var _=(a.maxX+a.minX)/2,x=(a.maxY+a.minY)/2;y=jEe(y,[["t",-_,-x],["t",s/2+c[3],o/2+c[0]]]),m.resetMatrix(),m.setMatrix(y),p.add(m);var S=p.get("el"),w="";r||(r="image/png"),setTimeout(function(){if(l==="svg"){var b=S.cloneNode(!0),E=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),T=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",E);T.replaceChild(b,T.documentElement);var C=new XMLSerializer().serializeToString(T);w="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(C))}else{var A=void 0,M=S.getContext("2d"),I=void 0;if(h){var R=typeof window<"u"?window.devicePixelRatio:1;try{A=M.getImageData(0,0,d*R,f*R),I=M.globalCompositeOperation,M.globalCompositeOperation="destination-over",M.fillStyle=h,M.fillRect(0,0,d,f)}catch{console.error("Download image failed. Out of memory at ImageData creation")}}w=S.toDataURL(r),h&&(M.clearRect(0,0,d,f),M.putImageData(A,0,0),M.globalCompositeOperation=I)}t&&t(w)},16)},e.prototype.downloadFullImage=function(t,r,i){var a=this,o=this.get("group").getCanvasBBox(),s=o.height,l=o.width,u=this.get("renderer"),h=zs('<div id="virtual-image"></div>'),c=document.querySelector(".g6-graph-watermarker"),f=i?i.backgroundColor:void 0,d=i?i.padding:void 0;d?on(d)&&(d=[d,d,d,d]):d=[0,0,0,0];var v=s+d[0]+d[2],p=l+d[1]+d[3];if(c){var g=this.get("graphWaterMarker").cfg||{},m=g.width,y=g.height;v=Math.ceil(v/y)*y,p=Math.ceil(p/m)*m}var _={container:h,height:v,width:p},x=u==="svg"?new yR(_):new M1(_),S=this.get("group"),w=pYt(S),b=Xi(w.getMatrix());b||(b=[1,0,0,0,1,0,0,0,1]);var E=(o.maxX+o.minX)/2,T=(o.maxY+o.minY)/2;b=jEe(b,[["t",-E,-T],["t",l/2+d[3],s/2+d[0]]]),w.resetMatrix(),w.setMatrix(b),x.add(w);var C=x.get("el");r||(r="image/png"),this.asyncToDataUrl(r,f,function(A){var M=document.createElement("a"),I=(t||"graph")+(u==="svg"?".svg":".".concat(r.split("/")[1]));a.dataURLToImage(A,u,M,I);var R=document.createEvent("MouseEvents");R.initEvent("click",!1,!1),M.dispatchEvent(R)},p,v,C)},e.prototype.downloadImage=function(t,r,i){var a=this,o=this;o.stopAnimate();var s=o.get("canvas"),l=s.getRenderer();r||(r="image/png");var u=(t||"graph")+(l==="svg"?".svg":".".concat(r.split("/")[1])),h=document.createElement("a");o.asyncToDataUrl(r,i,function(c){a.dataURLToImage(c,l,h,u);var f=document.createEvent("MouseEvents");f.initEvent("click",!1,!1),h.dispatchEvent(f)})},e.prototype.dataURLToImage=function(t,r,i,a){if(!t||t==="data:"){console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items");return}if(typeof window<"u")if(window.Blob&&window.URL&&r!=="svg"){var o=t.split(","),s="";if(o&&o.length>0){var l=o[0].match(/:(.*?);/);l&&l.length>=2&&(s=l[1])}for(var u=atob(o[1]),h=u.length,c=new Uint8Array(h);h--;)c[h]=u.charCodeAt(h);var f=new Blob([c],{type:s});window.navigator.msSaveBlob?window.navigator.msSaveBlob(f,a):i.addEventListener("click",function(){i.download=a,i.href=window.URL.createObjectURL(f)})}else i.addEventListener("click",function(){i.download=a,i.href=t})},e.prototype.addPlugin=function(t){var r=this;t.destroyed||(r.get("plugins").push(t),t.initPlugin(r))},e.prototype.removePlugin=function(t){var r=this.get("plugins"),i=r.indexOf(t);i>=0&&(t.destroyPlugin(),r.splice(i,1))},e.prototype.setImageWaterMarker=function(t,r){t===void 0&&(t=BE.waterMarkerImage);var i=this.get("container");rr(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=ms({},BE.imageWaterMarkerConfig,r),s=o.width,l=o.height,u=o.compatible,h=o.image;if(!t){var c=u?i:document.querySelector(".g6-graph-watermarker");c&&(c.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var f={container:i,width:s,height:l,capture:!1},d=this.get("pixelRatio");d&&(f.pixelRatio=d,window.devicePixelRatio=d),a=new M1(f),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var v=a.get("context"),p=h.rotate,g=h.x,m=h.y;v.rotate(-p*Math.PI/180);var y=new Image;y.crossOrigin="anonymous",y.src=t,y.onload=function(){if(v.drawImage(y,g,m,h.width,h.height),v.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var _=document.querySelector(".g6-graph-watermarker");_||(_=document.createElement("div"),_.className="g6-graph-watermarker"),_.className="g6-graph-watermarker",a.destroyed||(_.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),i.appendChild(_))}}},e.prototype.setTextWaterMarker=function(t,r){var i=this.get("container");rr(i)&&(i=document.getElementById(i)),i.style.position||(i.style.position="relative");var a=this.get("graphWaterMarker"),o=ms({},BE.textWaterMarkerConfig,r),s=o.width,l=o.height,u=o.compatible,h=o.text;if(!(t!=null&&t.length)){var c=u?i:document.querySelector(".g6-graph-watermarker");c&&(c.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var f={container:i,width:s,height:l,capture:!1},d=this.get("pixelRatio");d&&(f.pixelRatio=d,window.devicePixelRatio=d),a=new M1(f),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var v=a.get("context"),p=h.rotate,g=h.fill,m=h.fontFamily,y=h.fontSize,_=h.baseline,x=h.x,S=h.y,w=h.lineHeight;v.rotate(-p*Math.PI/180),v.font="".concat(y,"px ").concat(m),v.fillStyle=g,v.textBaseline=_;for(var b=rr(t)?[t]:t,E=b.length-1;E>=0;E--)v.fillText(b[E],x,S+E*w);if(v.rotate(p*Math.PI/180),u)i.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var T=document.querySelector(".g6-graph-watermarker");T||(T=document.createElement("div"),T.className="g6-graph-watermarker"),T.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),i.appendChild(T)}},e.prototype.destroy=function(){var t,r,i,a;At(this.get("plugins"),function(h){h.destroyPlugin()});var o=this.get("tooltips");if(o)for(var s=0;s<o.length;s++){var l=o[s];if(!!l){var u=l.parentElement;!u||u.removeChild(l)}}(t=this.get("eventController"))===null||t===void 0||t.destroy(),(r=this.get("layoutController"))===null||r===void 0||r.destroy(),(i=this.get("graphWaterMarker"))===null||i===void 0||i.destroy(),(a=document.querySelector(".g6-graph-watermarker"))===null||a===void 0||a.remove(),n.prototype.destroy.call(this)},e}(IUe);function ate(n){return ate=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ate(n)}function JHe(n,e){if(e===void 0&&(e=new WeakMap),n===null)return n;if(n instanceof Date)return new Date(n);if(n instanceof RegExp)return new RegExp(n);if(ate(n)!=="object")return n;if(e.get(n))return e.get(n);var t=Array.isArray(n)?[]:{};e.set(n,t);for(var r in n)n.hasOwnProperty(r)&&n[r]!==void 0&&(t[r]=JHe(n[r],e));return t}function Idr(n){try{return structuredClone(n)}catch{return JHe(n)}}var Ldr=H_.radialLayout,OY=H_.traverseTree,Pdr=function(n){Kn(e,n);function e(t){var r=n.call(this,t)||this;return r.layoutAnimating=!1,r.set("removeList",[]),r.set("layoutMethod",r.getLayout()),r}return e.prototype.getLayout=function(){var t=this.get("layout");return t?typeof t=="function"?t:(t.type||(t.type="dendrogram"),t.direction||(t.direction=t.type==="indented"?"LR":"TB"),t.radial?function(r){var i=j9[t.type](r,t);return Ldr(i),i}:function(r){return j9[t.type](r,t)}):null},e.indexOfChild=function(t,r){var i=-1;return At(t,function(a,o){if(r===a.id)return i=o,!1}),i},e.prototype.getDefaultCfg=function(){var t=n.prototype.getDefaultCfg.call(this);return t.animate=!0,t},e.prototype.innerAddChild=function(t,r,i){var a=this,o=t.data;o&&(o.x=t.x,o.y=t.y,o.depth=t.depth);var s=a.addItem("node",o,!1);if(r){if(s.set("parent",r),i){var l=r.get("originAttrs");if(l)s.set("originAttrs",l);else{var u=r.getModel();s.set("originAttrs",{x:u.x,y:u.y})}}var h=r.get("children");h?h.push(s):r.set("children",[s]),a.addItem("edge",{source:r.get("id"),target:s.get("id"),id:"".concat(r.get("id"),":").concat(s.get("id"))},!1)}return At(t.children||[],function(c){a.innerAddChild(c,s,i)}),a.emit("afteraddchild",{item:s,parent:r}),s},e.prototype.innerUpdateChild=function(t,r,i){var a=this,o=a.findById(t.id);if(!o){a.innerAddChild(t,r,i);return}At(t.children||[],function(v){a.innerUpdateChild(v,o,i)});var s=o.get("children");if(s){var l=s.length;if(l>0)for(var u=s.length-1;u>=0;u--){var h=s[u].getModel();e.indexOfChild(t.children||[],h.id)===-1&&(a.innerRemoveChild(h.id,{x:t.x,y:t.y},i),s.splice(u,1))}}var c,f;o.get("originAttrs")&&(c=o.get("originAttrs").x,f=o.get("originAttrs").y);var d=o.getModel();i&&o.set("originAttrs",{x:d.x,y:d.y}),o.set("model",Object.assign(d,t.data)),(c!==t.x||f!==t.y)&&o.updatePosition({x:t.x,y:t.y})},e.prototype.innerRemoveChild=function(t,r,i){var a=this,o=a.findById(t);if(!!o)if(At(o.get("children"),function(l){a.innerRemoveChild(l.getModel().id,r,i)}),i){var s=o.getModel();o.set("to",r),o.set("originAttrs",{x:s.x,y:s.y}),a.get("removeList").push(o)}else a.removeItem(o,!1)},e.prototype.changeData=function(t,r){r===void 0&&(r=!0);var i=this;this.getNodes().map(function(a){return i.clearItemStates(a)}),this.getEdges().map(function(a){return i.clearItemStates(a)}),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:i.get("originData"),after:t||i.get("data")}),t?(i.data(t),i.render(!1)):i.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var r=this;r.updateLayout(t)},e.prototype.updateLayout=function(t,r,i,a){a===void 0&&(a=!0);var o=this;if(!t){console.warn("layout cannot be null");return}if(a&&this.get("enabledStack")&&this.pushStack("layout",{before:o.get("layout"),after:t}),o.set("layout",t),o.set("layoutMethod",o.getLayout()),o.layout(),r){var s=i;s||(r==="begin"?s={x:0,y:0}:s={x:this.getWidth()/2,y:this.getHeight()/2}),s=this.getPointByCanvas(s.x,s.y);var l=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];s.x=s.x*l[0]+l[6],s.y=s.y*l[0]+l[7];var u=this.getGroup().getCanvasBBox(),h=u.minX,c=u.maxX,f=u.minY,d=u.maxY,v={x:(h+c)/2,y:(f+d)/2};r==="begin"&&(v.x=h,v.y=f),this.translate(s.x-v.x,s.y-v.y)}},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var r=this;r.layout(t)},e.prototype.layout=function(t){var r=this,i=this,a=i.get("data"),o=i.get("layoutMethod"),s=i.get("layout"),l=a;if(s!=null&&s.excludeInvisibles){a=Xi(i.get("data"));var u={};OY(a,function(f){var d=f.children;if(!(d!=null&&d.length))return!0;for(var v=d.length-1;v>=0;v--){var p=r.findById(d[v].id),g=p?!p.isVisible():d[v].visible===!1;g&&(u[f.id]=u[f.id]||[],u[f.id].push({idx:v,child:d.splice(v,1)[0]}))}}),l=o?o(a,i.get("layout")):a,OY(l,function(f){var d=u[f.id];if(d!=null&&d.length)for(var v=d.length-1;v>=0;v--){var p=d[v],g=p.idx,m=p.child;f.children.splice(g,0,m)}})}else l=o?o(a,i.get("layout")):a;var h=i.get("animate");if(i.emit("beforerefreshlayout",{data:a,layoutData:l}),i.emit("beforelayout"),i.innerUpdateChild(l,void 0,h),t){var c=i.get("viewController");c.fitView()}h?i.layoutAnimate(l):(i.refresh(),i.paint()),i.emit("afterrefreshlayout",{data:a,layoutData:l}),i.emit("afterlayout")},e.prototype.addChild=function(t,r,i){i===void 0&&(i=!0);var a=this;a.emit("beforeaddchild",{model:t,parent:r}),rr(r)||(r=r.get("id"));var o=a.findDataById(r);if(o){o.children||(o.children=[]),o.children.push(t);var s=a.findById(r);s.refresh(),a.changeData(void 0,i)}},e.prototype.updateChildren=function(t,r,i){i===void 0&&(i=!0);var a=this,o=a.findById(r);if(!r||!o){console.warn("Update children failed! There is no node with id '".concat(r,"'"));return}var s=a.findDataById(r);s.children=t,o.refresh(),a.changeData(void 0,i)},e.prototype.updateChild=function(t,r,i){i===void 0&&(i=!0);var a=this;if(!r||!a.findById(r)){a.changeData(t,i);return}var o=a.findDataById(r),s=a.findById(t.id);if(o.children||(o.children=[]),!s)o.children.push(t);else{var l=e.indexOfChild(o.children,t.id);l>-1&&(o.children[l]=t)}var u=a.findById(r);u==null||u.refresh(),a.changeData(void 0,i)},e.prototype.removeChild=function(t,r){r===void 0&&(r=!0);var i=this,a=i.findById(t),o;if(a?o=a==null?void 0:a.get("parent"):o=i.getNodes().find(function(c){var f=c.getModel().children||[];return!!f.find(function(d){return d.id===t})}),o&&!o.destroyed){var s=o.get("id"),l=i.findDataById(s),u=l&&l.children||[],h=e.indexOfChild(u,t);u.splice(h,1),o.refresh()}i.changeData(void 0,r)},e.prototype.findDataById=function(t,r){var i=this;if(r||(r=i.get("data")),t===r.id)return r;var a=null;return At(r.children||[],function(o){if(o.id===t)return a=o,!1;if(a=i.findDataById(t,o),a)return!1}),a},e.prototype.layoutAnimate=function(t,r){var i=this,a=this.get("animateCfg");i.emit("beforeanimate",{data:t}),i.getEdges().forEach(function(o){var s=o.get("model");s.sourceAnchor||(s.sourceAnchor=o.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(o){OY(t,function(s){var l=i.findById(s.id);if(l){var u=l.get("originAttrs"),h=l.get("model");if(u||(u={x:h.x,y:h.y},l.set("originAttrs",u)),r){var c=r(l,o,u,t);l.set("model",Object.assign(h,c))}else h.x=u.x+(s.x-u.x)*o,h.y=u.y+(s.y-u.y)*o}return!0}),At(i.get("removeList"),function(s){var l=s.getModel(),u=s.get("originAttrs"),h=s.get("to");l.x=u.x+(h.x-u.x)*o,l.y=u.y+(h.y-u.y)*o}),i.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){At(i.getNodes(),function(s){s.set("originAttrs",null)}),At(i.get("removeList"),function(s){i.removeItem(s,!1)}),i.set("removeList",[]),a.callback&&a.callback(),i.emit("afteranimate",{data:t})},delay:a.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){t===void 0&&(t=!0);var r=this,i=r.get("data");if(!i||!Wh(i)||!Object.keys(i).length)throw new Error("data must be defined first");r.clear(),t&&this.get("enabledStack")&&this.clearStack(),r.emit("beforerender"),r.layout(this.get("fitView")),r.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(t){n.prototype.data.call(this,t),this.set("originData",Idr(t))},e}(KHe),Odr=function(){function n(e){this._cfgs=ms(this.getDefaultCfgs(),e),this._events={},this.destroyed=!1}return n.prototype.getDefaultCfgs=function(){return{}},n.prototype.initPlugin=function(e){var t=this;t.set("graph",e);var r=t.getEvents(),i={};At(r,function(a,o){var s=hE(t,a);i[o]=s,e.on(o,s)}),this._events=i,this.init()},n.prototype.getEvents=function(){return{}},n.prototype.get=function(e){var t;return(t=this._cfgs)===null||t===void 0?void 0:t[e]},n.prototype.set=function(e,t){this._cfgs[e]=t},n.prototype.destroy=function(){},n.prototype.destroyPlugin=function(){this.destroy();var e=this.get("graph"),t=this._events;At(t,function(r,i){e.off(i,r)}),this._events=null,this._cfgs=null,this.destroyed=!0},n}();const zd=Odr;var Rdr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),XEe="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",Ddr=function(n){Rdr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{img:XEe,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),r=t.get("container"),i=t.get("canvas").get("el"),a=this.get("img")||XEe;a.includes("url(")||(a='url("'.concat(a,'")'));var o=zs(`<div class='g6-grid-container' style="position:absolute;overflow:hidden;z-index: -1;"></div>`),s=zs(`<div
class='g6-grid'
style='position:absolute;
background-image: `.concat(a,`;
user-select: none
'></div>`));this.set("container",o),this.set("gridContainer",s),this.positionInit(),o.appendChild(s),r.insertBefore(o,i)},e.prototype.positionInit=function(){var t=this.get("graph"),r=t.get("minZoom"),i=t.get("width"),a=t.get("height");Di(this.get("container"),{width:"".concat(i,"px"),height:"".concat(a,"px")});var o=i*80/r,s=a*80/r;Di(this.get("gridContainer"),{width:"".concat(o,"px"),height:"".concat(s,"px"),left:"-".concat(o/2,"px"),top:"-".concat(s/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var r=this.get("gridContainer"),i=t.matrix;i||(i=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),o="matrix(".concat(i[0],", ").concat(i[1],", ").concat(i[3],", ").concat(i[4],", ").concat(a?i[6]:"0",", ").concat(a?i[7]:"0",")");Di(r,{transform:o})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph"),r=t.get("container"),i=this.get("container");r.removeChild(i)},e}(zd);const Ndr=Ddr;var cT={exports:{}},YEe=[],PP=[],kdr="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function QHe(n,e){if(e=e||{},n===void 0)throw new Error(kdr);var t=e.prepend===!0?"prepend":"append",r=e.container!==void 0?e.container:document.querySelector("head"),i=YEe.indexOf(r);i===-1&&(i=YEe.push(r)-1,PP[i]={});var a;return PP[i]!==void 0&&PP[i][t]!==void 0?a=PP[i][t]:(a=PP[i][t]=Fdr(),t==="prepend"?r.insertBefore(a,r.childNodes[0]):r.appendChild(a)),n.charCodeAt(0)===65279&&(n=n.substr(1,n.length)),a.styleSheet?a.styleSheet.cssText+=n:a.textContent+=n,a}function Fdr(){var n=document.createElement("style");return n.setAttribute("type","text/css"),n}cT.exports=QHe;cT.exports.insertCss=QHe;var Bdr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();typeof document<"u"&&cT.exports(`
.g6-component-contextmenu {
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
background-color: rgba(255, 255, 255, 0.9);
padding: 10px 8px;
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}
.g6-contextmenu-ul {
padding: 0;
margin: 0;
list-style: none;
}
`);var Gdr=function(n){Bdr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(r){return`
<ul class='g6-contextmenu-ul'>
<li>\u83DC\u5355\u98791</li>
<li>\u83DC\u5355\u98792</li>
</ul>
`},shouldBegin:function(r){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),r=zs("<div class=".concat(t||"g6-component-contextmenu","></div>"));Di(r,{top:"0px",position:"absolute",visibility:"hidden"});var i=this.get("container");i||(i=this.get("graph").get("container")),rr(i)&&(i=document.getElementById(i)),i.appendChild(r),this.set("menu",r)},e.prototype.onMenuShow=function(t){var r=this;t.preventDefault();var i=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&i.indexOf(t.item.getType())===-1){r.onMenuHide();return}}else if(i.indexOf("canvas")===-1){r.onMenuHide();return}var a=this.get("shouldBegin");if(!!a(t)){var o=this.get("menu"),s=this.get("getContent"),l=this.get("graph"),u=s(t,l);rr(u)?o.innerHTML=u:o.innerHTML=u.outerHTML,this.removeMenuEventListener();var h=this.get("handleMenuClick");if(h){var c=function(E){h(E.target,t.item,l)};this.set("handleMenuClickWrapper",c),o.addEventListener("click",c)}var f=l.get("width"),d=l.get("height"),v=o.getBoundingClientRect(),p=this.get("offsetX")||0,g=this.get("offsetY")||0,m=l.getContainer().offsetTop,y=l.getContainer().offsetLeft,_=t.canvasX+y+p,x=t.canvasY+m+g;_+v.width>f&&(_=t.canvasX-v.width-p+y),x+v.height>d&&(x=t.canvasY-v.height-g+m),x<0&&(x=0),Di(o,{top:"".concat(x,"px"),left:"".concat(_,"px"),visibility:"visible"});var S=this.get("trigger")==="click",w=function(E){if(S){S=!1;return}r.onMenuHide()};document.body.addEventListener("click",w),this.set("handler",w)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),r=this.get("handler");if(t){var i=this.get("menu");i.removeEventListener("click",t),this.set("handleMenuClickWrapper",null)}r&&document.body.removeEventListener("click",r)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&Di(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var r=this.get("container");r||(r=this.get("graph").get("container")),rr(r)&&(r=document.getElementById(r)),r.removeChild(t)}},e}(zd);const zdr=Gdr;var Udr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ote=globalThis&&globalThis.__assign||function(){return ote=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ote.apply(this,arguments)},qEe=Math.max,Vdr=sg,$dr="default",Wdr="keyShape",Hdr="delegate",ZEe="svg",jdr=function(n){Udr(e,n);function e(t){var r=n.call(this,t)||this;return r.handleUpdateCanvas=U3(function(i){var a=r;a.destroyed||a.updateCanvas()},100,!1),r}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",type:"default",padding:50,size:[200,120],delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0,hideEdge:!1}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,r=this._cfgs,i=r.size,a=r.graph;if(!this.destroyed){var o=this.get("canvas"),s=o.get("container"),l=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,u=navigator.userAgent.toLowerCase().indexOf("safari")>-1,h=zs(`
<div
class=`.concat(r.viewportClassName,`
style='position:absolute;
left:0;
top:0;
box-sizing:border-box;
outline: 2px solid #1980ff;
cursor:move'
draggable=`).concat(!(u||l),`
</div>`)),c=0,f=0,d=!1,v=0,p=0,g=0,m=0,y=0,_=0,x=u||l?"mousedown":"dragstart";h.addEventListener(x,function(E){var T,C;if(E.dataTransfer){var A=new Image;A.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(C=(T=E.dataTransfer).setDragImage)===null||C===void 0||C.call(T,A,0,0);try{E.dataTransfer.setData("text/html","view-port-minimap")}catch{E.dataTransfer.setData("text","view-port-minimap")}}if(r.refresh=!1,E.target===h){var M=h.style;v=parseInt(M.left,10),p=parseInt(M.top,10),g=parseInt(M.width,10),m=parseInt(M.height,10),!(g>i[0]||m>i[1])&&(_=a.getZoom(),y=t.get("ratio"),d=!0,c=E.clientX,f=E.clientY)}},!1);var S=function(T){if(!(!d||an(T.clientX)||an(T.clientY))){var C=c-T.clientX,A=f-T.clientY;(v-C<0||v-C+g>=i[0])&&(C=0),(p-A<0||p-A+m>=i[1])&&(A=0),v-=C,p-=A,Di(h,{left:"".concat(v,"px"),top:"".concat(p,"px")}),a.translate(C*_/y,A*_/y),c=T.clientX,f=T.clientY}};!u&&!l&&h.addEventListener("drag",S,!1);var w=function(){d=!1,r.refresh=!0},b=u||l?"mouseup":"dragend";h.addEventListener(b,w,!1),s.addEventListener("mouseleave",w),s.addEventListener("mouseup",w),(u||l)&&s.addEventListener("mousemove",S,!1),this.set("viewport",h),s.appendChild(h)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),r=this.get("totaldx"),i=this.get("totaldy"),a=this.get("graph"),o=this.get("size"),s=a.get("canvas").get("el"),l=a.get("width")||s.scrollWidth||500,u=a.get("height")||s.scrollHeight||500,h=a.getPointByCanvas(0,0),c=a.getPointByCanvas(l,u),f=this.get("viewport");f||this.initViewport();var d=(c.x-h.x)*t,v=(c.y-h.y)*t,p=h.x*t+r,g=h.y*t+i,m=p+d,y=g+v;p<0&&(d+=p,p=0),m>o[0]&&(d=d-(m-o[0])),g<0&&(v+=g,g=0),y>o[1]&&(v=v-(y-o[1])),this.set("ratio",t);var _="".concat(p,"px"),x="".concat(g,"px");Di(f,{left:_,top:x,width:"".concat(d,"px"),height:"".concat(v,"px")})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,r=this.get("canvas"),i=t.get("group");if(!i.destroyed){r.clear();var a;this.get("hideEdge")?(a=r.addGroup(),i.get("children").forEach(function(s){s.get("id").includes("-edge")||a.add(s.clone())})):(a=i.clone(),a.resetMatrix(),r.add(a));var o=t.get("renderer");o===ZEe&&this.updateVisible(a)}},e.prototype.updateVisible=function(t){var r=this;if(!t.isGroup()&&!t.get("visible"))t.hide();else{var i=t.get("children");if(!i||!i.length)return;i.forEach(function(a){a.get("visible")||a.hide(),r.updateVisible(a)})}},e.prototype.updateKeyShapes=function(){var t=this,r=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();this.get("hideEdge")||At(r.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),At(r.getNodes(),function(l){t.updateOneNodeKeyShape(l,a)});var o=r.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||(At(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,r){if(!this.destroyed){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?u=Object.assign(l,u):(a=s,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)}},e.prototype.updateOneNodeKeyShape=function(t,r){var i=this.get("itemMap")||{},a=i[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),l=s.attr(),u={x:o.centerX,y:o.centerY};a?(u=Object.assign(l,u),a.toFront()):(a=s,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(u.x=o.minX,u.y=o.minY),a.attr(u),t.isVisible()?a.show():a.hide(),a.exist=!0;var c=t.getModel().depth;isNaN(c)||a.set("zIndex",c),i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateDelegateShapes=function(){var t=this,r=this._cfgs.graph,i=this.get("canvas"),a=i.get("children")[0]||i.addGroup();this.get("hideEdge")||At(r.getEdges(),function(l){t.updateOneEdgeKeyShape(l,a)}),At(r.getNodes(),function(l){t.updateOneNodeDelegateShape(l,a)});var o=r.getCombos();if(o&&o.length){var s=a.find(function(l){return l.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||(At(o,function(l){t.updateOneComboKeyShape(l,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},r=Object.keys(t);if(!(!r||r.length===0))for(var i=r.length-1;i>=0;i--){var a=t[r[i]],o=a.exist;a.exist=!1,o||(a.remove(),delete t[r[i]])}},e.prototype.updateOneEdgeKeyShape=function(t,r){var i=this.get("itemMap")||{},a=i[t.get("id")];if(a){var o=t.get("keyShape").attr("path");a.attr("path",o)}else a=t.get("keyShape").clone(),r.add(a);t.isVisible()?a.show():a.hide(),a.exist=!0,i[t.get("id")]=a,this.set("itemMap",i)},e.prototype.updateOneNodeDelegateShape=function(t,r){var i=this.get("delegateStyle"),a=this.get("itemMap")||{},o=a[t.get("id")],s=t.getBBox();if(o){var l={x:s.minX,y:s.minY,width:s.width,height:s.height};o.attr(l),o.toFront()}else o=r.addShape("rect",{attrs:ote({x:s.minX,y:s.minY,width:s.width,height:s.height},i),name:"minimap-node-shape"});t.isVisible()?o.show():o.hide(),o.exist=!0,a[t.get("id")]=o,this.set("itemMap",a)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this,r=t.get("graph"),i=t.get("size"),a=t.get("className"),o=t.get("container"),s=zs("<div class='".concat(a,"' style='width: ").concat(i[0],"px; height: ").concat(i[1],"px; overflow: hidden'></div>"));rr(o)&&(o=document.getElementById(o)),o?o.appendChild(s):r.get("container").appendChild(s),t.set("container",s);var l=zs('<div class="g6-minimap-container" style="position: relative;"></div>');s.appendChild(l),l.addEventListener("dragenter",function(c){c.preventDefault()}),l.addEventListener("dragover",function(c){c.preventDefault()});var u,h=r.get("renderer");h===ZEe?u=new yR({container:l,width:i[0],height:i[1]}):u=new M1({container:l,width:i[0],height:i[1]}),t.set("canvas",u),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed){var t=this.get("refresh");if(!!t){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("size"),a=this.get("canvas"),o=this.get("type"),s=this.get("padding");if(!a.destroyed){switch(o){case $dr:this.updateGraphShapes();break;case Wdr:this.updateKeyShapes();break;case Hdr:this.updateDelegateShapes();break}var l=a.get("children")[0];if(!!l){l.resetMatrix();var u=l.getCanvasBBox(),h=r.get("canvas").getCanvasBBox(),c=r.getZoom()||1,f=h.width/c,d=h.height/c;Number.isFinite(u.width)&&(f=qEe(u.width,f),d=qEe(u.height,d)),f+=2*s,d+=2*s;var v=Math.min(i[0]/f,i[1]/d),p=[1,0,0,0,1,0,0,0,1],g=0,m=0;Number.isFinite(u.minX)&&(g=-u.minX),Number.isFinite(u.minY)&&(m=-u.minY);var y=(i[0]-(f-2*s)*v)/2,_=(i[1]-(d-2*s)*v)/2;p=Vdr(p,[["t",g,m],["s",v,v],["t",y,_]]),l.setMatrix(p),this.set("ratio",v),this.set("totaldx",y+g*v),this.set("totaldy",_+m*v),this.set("dx",y),this.set("dy",_),this.updateViewport()}}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;(t=this.get("canvas"))===null||t===void 0||t.destroy();var r=this.get("container");r!=null&&r.parentNode&&r.parentNode.removeChild(r)},e}(zd);const Xdr=jdr;var Ydr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function uy(n,e,t){var r=n.x-e.x,i=n.y-e.y;return!t||Math.abs(r)>t||Math.abs(i)>t?Math.sqrt(r*r+i*i):t}function qdr(n,e){return n.x*e.x+n.y*e.y}function KEe(n,e){var t=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(t*t*e.source.x+t*(n.y-e.source.y)+n.x)/(t*t+1),i=t*(r-e.source.x)+e.source.y;return{x:r,y:i}}var Zdr=function(n){Ydr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),r=this.get("onTick"),i=function(){r&&r(),t.refreshPositions()};this.set("tick",i)},e.prototype.bundling=function(t){var r=this;if(r.set("data",t),!r.isTicking()){var i=t.edges||[],a=t.nodes||[],o={},s=!1;if(a.forEach(function(x){(x.x===null||!x.y===null||x.x===void 0||!x.y===void 0)&&(s=!0),o[x.id]=x}),s)throw new Error("please layout the graph or assign x and y for nodes first");r.set("nodeIdMap",o);var l=r.get("divisions"),u=r.get("divRate"),h=r.divideEdges(l);r.set("edgePoints",h);var c=r.getEdgeBundles();r.set("edgeBundles",c);for(var f=r.get("cycles"),d=r.get("iterations"),v=r.get("iterRate"),p=r.get("lambda"),g=0;g<f;g++){for(var m=function(S){var w=[];i.forEach(function(b,E){if(b.source!==b.target){var T=o[b.source],C=o[b.target];w[E]=r.getEdgeForces({source:T,target:C},E,l,p);for(var A=0;A<l+1;A++)h[E][A].x+=w[E][A].x,h[E][A].y+=w[E][A].y}})},y=0;y<d;y++)m(y);p=p/2,l*=u,d*=v,h=r.divideEdges(l),r.set("edgePoints",h)}i.forEach(function(x,S){x.source!==x.target&&(x.type="polyline",x.controlPoints=h[S].slice(1,h[S].length-1))});var _=r.get("graph");_.refresh()}},e.prototype.updateBundling=function(t){var r=this,i=t.data;if(i&&r.set("data",i),r.get("ticking")&&r.set("ticking",!1),Object.keys(t).forEach(function(o){r.set(o,t[o])}),t.onTick){var a=this.get("graph");r.set("tick",function(){t.onTick(),a.refresh()})}r.bundling(i)},e.prototype.divideEdges=function(t){var r=this,i=r.get("data").edges,a=r.get("nodeIdMap"),o=r.get("edgePoints");return(!o||o===void 0)&&(o=[]),i.forEach(function(s,l){var u;(!o[l]||o[l]===void 0)&&(o[l]=[]);var h=a[s.source],c=a[s.target];if(t===1)o[l].push({x:h.x,y:h.y}),o[l].push({x:.5*(h.x+c.x),y:.5*(h.y+c.y)}),o[l].push({x:c.x,y:c.y});else{var f=0;!((u=o[l])===null||u===void 0)&&u.length?f=r.getEdgeLength(o[l]):f=uy({x:h.x,y:h.y},{x:c.x,y:c.y});var d=f/(t+1),v=d,p=[{x:h.x,y:h.y}];o[l].forEach(function(g,m){if(m!==0){for(var y=uy(g,o[l][m-1]);y>v;){var _=v/y,x={x:o[l][m-1].x,y:o[l][m-1].y};x.x+=_*(g.x-o[l][m-1].x),x.y+=_*(g.y-o[l][m-1].y),p.push(x),y-=v,v=d}v-=y}}),p.push({x:c.x,y:c.y}),o[l]=p}}),o},e.prototype.getEdgeLength=function(t){var r=0;return t.forEach(function(i,a){a!==0&&(r+=uy(i,t[a-1]))}),r},e.prototype.getEdgeBundles=function(){var t=this,r=t.get("data"),i=r.edges||[],a=t.get("bundleThreshold"),o=t.get("nodeIdMap"),s=t.get("edgeBundles");return s||(s=[]),i.forEach(function(l,u){(!s[u]||s[u]===void 0)&&(s[u]=[])}),i.forEach(function(l,u){var h=o[l.source],c=o[l.target];i.forEach(function(f,d){if(!(d<=u)){var v=o[f.source],p=o[f.target],g=t.getBundleScore({source:h,target:c},{source:v,target:p});g>=a&&(s[u].push(d),s[d].push(u))}})}),s},e.prototype.getBundleScore=function(t,r){var i=this;t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,r.vx=r.target.x-r.source.x,r.vy=r.target.y-r.source.y,t.length=uy({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),r.length=uy({x:r.source.x,y:r.source.y},{x:r.target.x,y:r.target.y});var a=i.getAngleScore(t,r),o=i.getScaleScore(t,r),s=i.getPositionScore(t,r),l=i.getVisibilityScore(t,r);return a*o*s*l},e.prototype.getAngleScore=function(t,r){var i=qdr({x:t.vx,y:t.vy},{x:r.vx,y:r.vy});return i/(t.length*r.length)},e.prototype.getScaleScore=function(t,r){var i=(t.length+r.length)/2,a=2/(i/Math.min(t.length,r.length)+Math.max(t.length,r.length)/i);return a},e.prototype.getPositionScore=function(t,r){var i=(t.length+r.length)/2,a={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},o={x:(r.source.x+r.target.x)/2,y:(r.source.y+r.target.y)/2},s=uy(a,o);return i/(i+s)},e.prototype.getVisibilityScore=function(t,r){var i=this.getEdgeVisibility(t,r),a=this.getEdgeVisibility(r,t);return i<a?i:a},e.prototype.getEdgeVisibility=function(t,r){var i=KEe(r.source,t),a=KEe(r.target,t),o={x:(i.x+a.x)/2,y:(i.y+a.y)/2},s={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2};return Math.max(0,1-2*uy(o,s)/uy(i,a))},e.prototype.getEdgeForces=function(t,r,i,a){for(var o=this,s=o.get("edgePoints"),l=o.get("K"),u=l/(uy(t.source,t.target)*(i+1)),h=[{x:0,y:0}],c=1;c<i;c++){var f={x:0,y:0},d=o.getSpringForce({pre:s[r][c-1],cur:s[r][c],next:s[r][c+1]},u),v=o.getElectrostaticForce(c,r);f.x=a*(d.x+v.x),f.y=a*(d.y+v.y),h.push(f)}return h.push({x:0,y:0}),h},e.prototype.getSpringForce=function(t,r){var i=t.pre.x+t.next.x-2*t.cur.x,a=t.pre.y+t.next.y-2*t.cur.y;return i*=r,a*=r,{x:i,y:a}},e.prototype.getElectrostaticForce=function(t,r){var i=this,a=i.get("eps"),o=i.get("edgeBundles"),s=i.get("edgePoints"),l=o[r],u={x:0,y:0};return l.forEach(function(h){var c={x:s[h][t].x-s[r][t].x,y:s[h][t].y-s[r][t].y};if(Math.abs(c.x)>a||Math.abs(c.y)>a){var f=uy(s[h][t],s[r][t]),d=1/f;u.x+=c.x*d,u.y+=c.y*d}}),u},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),n.prototype.destroy.call(this)},e}(zd);const Kdr=Zdr;var Jdr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ste=globalThis&&globalThis.__assign||function(){return ste=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ste.apply(this,arguments)},X5=.05,JEe={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:.1,fill:"#ccc"},Qdr=function(n){Jdr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{trigger:"mousemove",d:1.5,r:300,delegateStyle:Xi(JEe),showLabel:!1,maxD:5,minD:0,scaleRBy:"unset",scaleDBy:"unset",showDPercent:!0}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"magnify"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"magnify"};break}return t},e.prototype.init=function(){var t=this,r=t.get("r");t.set("cachedMagnifiedModels",[]),t.set("cachedOriginPositions",{}),t.set("r2",r*r);var i=t.get("d");t.set("molecularParam",(i+1)*r)},e.prototype.createDelegate=function(t){var r=this,i=this,a=i.get("delegate");(!a||a.destroyed)&&(i.magnify(t),a=i.get("delegate"),a.on("dragstart",function(o){i.set("delegateCenterDiff",{x:a.attr("x")-o.x,y:a.attr("y")-o.y})}),a.on("drag",function(o){i.magnify(o)}),this.get("scaleDBy")==="wheel"&&a.on("mousewheel",function(o){r.scaleDByWheel(o)}),this.get("scaleRBy")==="wheel"&&a.on("mousewheel",function(o){i.scaleRByWheel(o)}))},e.prototype.scaleRByWheel=function(t){var r=this;if(!(!t||!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=r.get("graph"),a,o=r.get("delegate"),s=o?{x:o.attr("x"),y:o.attr("y")}:void 0,l=s||i.getPointByClient(t.clientX,t.clientY);t.originalEvent.wheelDelta<0?a=1-X5:a=1/(1-X5);var u=r.get("maxR"),h=r.get("minR"),c=r.get("r");(c>(u||i.get("height"))&&a>1||c<(h||i.get("height")*.05)&&a<1)&&(a=1),c*=a,r.set("r",c),r.set("r2",c*c);var f=r.get("d");r.set("molecularParam",(f+1)*c),r.set("delegateCenterDiff",void 0),r.magnify(t,l)}},e.prototype.scaleRByDrag=function(t){var r=this;if(!!t){var i=r.get("dragPrePos"),a=r.get("graph"),o,s=a.getPointByClient(t.clientX,t.clientY);t.x-i.x<0?o=1-X5:o=1/(1-X5);var l=r.get("maxR"),u=r.get("minR"),h=r.get("r");(h>(l||a.get("height"))&&o>1||h<(u||a.get("height")*.05)&&o<1)&&(o=1),h*=o,r.set("r",h),r.set("r2",h*h);var c=r.get("d");r.set("molecularParam",(c+1)*h),r.magnify(t,s),r.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var r=this;if(!(!t&&!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=0;t.originalEvent.wheelDelta<0?i=-.1:i=.1;var a=r.get("d"),o=a+i,s=r.get("maxD"),l=r.get("minD");if(o<s&&o>l){r.set("d",o);var u=r.get("r");r.set("molecularParam",(o+1)*u);var h=r.get("delegate"),c=h?{x:h.attr("x"),y:h.attr("y")}:void 0;r.set("delegateCenterDiff",void 0),r.magnify(t,c)}}},e.prototype.scaleDByDrag=function(t){var r=this,i=r.get("dragPrePos"),a=t.x-i.x>0?.1:-.1,o=r.get("d"),s=o+a,l=r.get("maxD"),u=r.get("minD");if(s<l&&s>u){r.set("d",s);var h=r.get("r");r.set("molecularParam",(s+1)*h),r.magnify(t)}r.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,r){var i=this;i.restoreCache();var a=i.get("graph"),o=i.get("cachedMagnifiedModels"),s=i.get("cachedOriginPositions"),l=i.get("showLabel"),u=i.get("r"),h=i.get("r2"),c=i.get("d"),f=i.get("molecularParam"),d=a.getNodes(),v=d.length,p=r?{x:r.x,y:r.y}:{x:t.x,y:t.y};i.get("dragging")&&(i.get("trigger")==="mousemove"||i.get("trigger")==="click")&&(p=i.get("cacheCenter"));var g=i.get("delegateCenterDiff");g&&(p.x+=g.x,p.y+=g.y),i.updateDelegate(p,u);for(var m=0;m<v;m++){var y=d[m].getModel(),_=y.x,x=y.y;if(!(isNaN(_)||isNaN(x))){var S=(_-p.x)*(_-p.x)+(x-p.y)*(x-p.y);if(!isNaN(S)&&S<h&&S!==0){var w=Math.sqrt(S),b=f*w/(c*w+u),E=(_-p.x)/w,T=(x-p.y)/w;if(y.x=E*b+p.x,y.y=T*b+p.y,s[y.id]||(s[y.id]={x:_,y:x,texts:[]}),o.push(y),l&&2*w<u)for(var C=d[m],A=C.getContainer(),M=A.getChildren(),I=M.length,R=0;R<I;R++){var k=M[R];k.get("type")==="text"&&(s[y.id].texts.push({visible:k.get("visible"),shape:k}),k.set("visible",!0))}}}}a.refreshPositions()},e.prototype.restoreCache=function(){for(var t=this,r=t.get("cachedMagnifiedModels"),i=t.get("cachedOriginPositions"),a=r.length,o=0;o<a;o++){var s=r[o],l=s.id,u=i[l];s.x=u.x,s.y=u.y;for(var h=u.texts.length,c=0;c<h;c++){var f=u.texts[c];f.shape.set("visible",f.visible)}}t.set("cachedMagnifiedModels",[]),t.set("cachedOriginPositions",{})},e.prototype.updateParams=function(t){var r=this,i=t.r,a=t.d,o=t.trigger,s=t.minD,l=t.maxD,u=t.minR,h=t.maxR,c=t.scaleDBy,f=t.scaleRBy;isNaN(t.r)||(r.set("r",i),r.set("r2",i*i)),isNaN(a)||r.set("d",a),isNaN(l)||r.set("maxD",l),isNaN(s)||r.set("minD",s),isNaN(h)||r.set("maxR",h),isNaN(u)||r.set("minR",u);var d=r.get("d"),v=r.get("r");if(r.set("molecularParam",(d+1)*v),(o==="mousemove"||o==="click"||o==="drag")&&r.set("trigger",o),c==="drag"||c==="wheel"||c==="unset"){r.set("scaleDBy",c),r.get("delegate").remove(),r.get("delegate").destroy();var p=r.get("dPercentText");p&&(p.remove(),p.destroy())}if(f==="drag"||f==="wheel"||f==="unset"){r.set("scaleRBy",f),r.get("delegate").remove(),r.get("delegate").destroy();var p=r.get("dPercentText");p&&(p.remove(),p.destroy())}},e.prototype.updateDelegate=function(t,r){var i=this,a=this,o=a.get("graph"),s=a.get("delegate");if(!s||s.destroyed){var l=o.get("group"),u=a.get("delegateStyle")||JEe;s=l.addShape("circle",{attrs:ste({r:r/1.5,x:t.x,y:t.y},u),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&(this.get("scaleRBy")==="wheel"?s.on("mousewheel",function(v){a.scaleRByWheel(v)}):this.get("scaleRBy")==="drag"&&(s.on("dragstart",function(v){a.set("dragging",!0),a.set("cacheCenter",{x:v.x,y:v.y}),a.set("dragPrePos",{x:v.x,y:v.y})}),s.on("drag",function(v){a.scaleRByDrag(v)}),s.on("dragend",function(v){a.set("dragging",!1)})),this.get("scaleDBy")==="wheel"?s.on("mousewheel",function(v){i.scaleDByWheel(v)}):this.get("scaleDBy")==="drag"&&(s.on("dragstart",function(v){a.set("dragging",!0),a.set("cacheCenter",{x:v.x,y:v.y}),a.set("dragPrePos",{x:v.x,y:v.y})}),s.on("drag",function(v){i.scaleDByDrag(v)}),s.on("dragend",function(v){a.set("dragging",!1)})))}else s.attr({x:t.x,y:t.y,r:r/1.5});if(a.get("showDPercent")){var h=Math.round((a.get("d")-a.get("minD"))/(a.get("maxD")-a.get("minD"))*100),c=a.get("dPercentText"),f=t.y+r/1.5+16;if(!c||c.destroyed){var d=o.get("group");c=d.addShape("text",{attrs:{text:"".concat(h,"%"),x:t.x,y:f,fill:"#aaa",stroke:"#fff",lineWidth:1,fontSize:12}}),a.set("dPercentText",c)}else c.attr({text:"".concat(h,"%"),x:t.x,y:f})}a.set("delegate",s)},e.prototype.clear=function(){var t=this.get("graph");this.restoreCache(),t.refreshPositions();var r=this.get("delegate");r&&!r.destroyed&&(r.remove(),r.destroy());var i=this.get("dPercentText");i&&!i.destroyed&&(i.remove(),i.destroy())},e.prototype.destroy=function(){this.clear()},e}(zd);const evr=Qdr;var tvr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),QEe=.05;typeof document<"u"&&cT.exports(`
.g6-component-toolbar {
position: absolute;
list-style-type: none;
padding: 6px;
left: 0px;
top: 0px;
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
margin: 0;
}
.g6-component-toolbar li {
float: left;
text-align: center;
width: 35px;
height: 24px;
cursor: pointer;
list-style-type:none;
list-style: none;
margin-left: 0px;
}
.g6-component-toolbar li .icon {
opacity: 0.7;
}
.g6-component-toolbar li .icon:hover {
opacity: 1;
}
`);var rvr=function(e){if(!e)return[];if(e.composedPath)return e.composedPath();for(var t=[],r=e.target;r;){if(t.push(r),r.tagName==="HTML")return t.push(document,window),t;r=r.parentElement}return t},nvr=function(n){tvr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{handleClick:void 0,getContent:function(r){return`
<ul class='g6-component-toolbar'>
<li code='redo'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M256 682.666667c0-102.741333 66.730667-213.333333 213.333333-213.333334 107.008 0 190.762667 56.576 230.570667 125.354667L611.968 682.666667H853.333333v-241.365334l-91.562666 91.562667C704.768 448.469333 601.130667 384 469.333333 384c-196.096 0-298.666667 150.229333-298.666666 298.666667h85.333333z" fill="" p-id="2041"></path>
</svg>
</li>
<li code='undo'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M170.666667 682.666667h241.365333l-87.936-87.978667C363.904 525.909333 447.658667 469.333333 554.666667 469.333333c146.602667 0 213.333333 110.592 213.333333 213.333334h85.333333c0-148.437333-102.570667-298.666667-298.666666-298.666667-131.797333 0-235.392 64.469333-292.48 148.821333L170.666667 441.301333V682.666667z" fill="" p-id="2764"></path>
</svg>
</li>
<li code='zoomOut'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M658.432 428.736a33.216 33.216 0 0 1-33.152 33.152H525.824v99.456a33.216 33.216 0 0 1-66.304 0V461.888H360.064a33.152 33.152 0 0 1 0-66.304H459.52V296.128a33.152 33.152 0 0 1 66.304 0V395.52H625.28c18.24 0 33.152 14.848 33.152 33.152z m299.776 521.792a43.328 43.328 0 0 1-60.864-6.912l-189.248-220.992a362.368 362.368 0 0 1-215.36 70.848 364.8 364.8 0 1 1 364.8-364.736 363.072 363.072 0 0 1-86.912 235.968l192.384 224.64a43.392 43.392 0 0 1-4.8 61.184z m-465.536-223.36a298.816 298.816 0 0 0 298.432-298.432 298.816 298.816 0 0 0-298.432-298.432A298.816 298.816 0 0 0 194.24 428.8a298.816 298.816 0 0 0 298.432 298.432z"></path>
</svg>
</li>
<li code='zoomIn'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M639.936 416a32 32 0 0 1-32 32h-256a32 32 0 0 1 0-64h256a32 32 0 0 1 32 32z m289.28 503.552a41.792 41.792 0 0 1-58.752-6.656l-182.656-213.248A349.76 349.76 0 0 1 480 768 352 352 0 1 1 832 416a350.4 350.4 0 0 1-83.84 227.712l185.664 216.768a41.856 41.856 0 0 1-4.608 59.072zM479.936 704c158.784 0 288-129.216 288-288S638.72 128 479.936 128a288.32 288.32 0 0 0-288 288c0 158.784 129.216 288 288 288z" p-id="3853"></path>
</svg>
</li>
<li code='realZoom'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
<path d="M384 320v384H320V320h64z m256 0v384H576V320h64zM512 576v64H448V576h64z m0-192v64H448V384h64z m355.968 576H92.032A28.16 28.16 0 0 1 64 931.968V28.032C64 12.608 76.608 0 95.168 0h610.368L896 192v739.968a28.16 28.16 0 0 1-28.032 28.032zM704 64v128h128l-128-128z m128 192h-190.464V64H128v832h704V256z"></path>
</svg>
</li>
<li code='autoZoom'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
<path d="M684.288 305.28l0.128-0.64-0.128-0.64V99.712c0-19.84 15.552-35.904 34.496-35.712a35.072 35.072 0 0 1 34.56 35.776v171.008h170.944c19.648 0 35.84 15.488 35.712 34.432a35.072 35.072 0 0 1-35.84 34.496h-204.16l-0.64-0.128a32.768 32.768 0 0 1-20.864-7.552c-1.344-1.024-2.816-1.664-3.968-2.816-0.384-0.32-0.512-0.768-0.832-1.088a33.472 33.472 0 0 1-9.408-22.848zM305.28 64a35.072 35.072 0 0 0-34.56 35.776v171.008H99.776A35.072 35.072 0 0 0 64 305.216c0 18.944 15.872 34.496 35.84 34.496h204.16l0.64-0.128a32.896 32.896 0 0 0 20.864-7.552c1.344-1.024 2.816-1.664 3.904-2.816 0.384-0.32 0.512-0.768 0.768-1.088a33.024 33.024 0 0 0 9.536-22.848l-0.128-0.64 0.128-0.704V99.712A35.008 35.008 0 0 0 305.216 64z m618.944 620.288h-204.16l-0.64 0.128-0.512-0.128c-7.808 0-14.72 3.2-20.48 7.68-1.28 1.024-2.752 1.664-3.84 2.752-0.384 0.32-0.512 0.768-0.832 1.088a33.664 33.664 0 0 0-9.408 22.912l0.128 0.64-0.128 0.704v204.288c0 19.712 15.552 35.904 34.496 35.712a35.072 35.072 0 0 0 34.56-35.776V753.28h170.944c19.648 0 35.84-15.488 35.712-34.432a35.072 35.072 0 0 0-35.84-34.496z m-593.92 11.52c-0.256-0.32-0.384-0.768-0.768-1.088-1.088-1.088-2.56-1.728-3.84-2.688a33.088 33.088 0 0 0-20.48-7.68l-0.512 0.064-0.64-0.128H99.84a35.072 35.072 0 0 0-35.84 34.496 35.072 35.072 0 0 0 35.712 34.432H270.72v171.008c0 19.84 15.552 35.84 34.56 35.776a35.008 35.008 0 0 0 34.432-35.712V720l-0.128-0.64 0.128-0.704a33.344 33.344 0 0 0-9.472-22.848zM512 374.144a137.92 137.92 0 1 0 0.128 275.84A137.92 137.92 0 0 0 512 374.08z"></path>
</svg>
</li>
</ul>
`},zoomSensitivity:2}},e.prototype.init=function(){var t=this,r=this.get("graph"),i=this.get("getContent"),a=i(r),o=a;rr(a)&&(o=zs(a));var s=this.get("className");o.setAttribute("class",s||"g6-component-toolbar");var l=this.get("container");l||(l=this.get("graph").get("container")),rr(l)&&(l=document.getElementById(l)),l.appendChild(o),this.set("toolBar",o);var u=this.get("handleClick");o.addEventListener("click",function(c){var f=rvr(c).filter(function(v){return v.nodeName==="LI"});if(f.length!==0){var d=f[0].getAttribute("code");!d||(u?u(d,r):t.handleDefaultOperator(d))}});var h=this.get("position");h&&Di(o,{top:"".concat(h.y,"px"),left:"".concat(h.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),r=document.querySelector('.g6-component-toolbar li[code="undo"]'),i=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),a=document.querySelector('.g6-component-toolbar li[code="redo"]'),o=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!r||!i||!a||!o||(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4"),t.on("stackchange",function(s){var l=s.undoStack,u=s.redoStack,h=l.length,c=u.length;h===0?(r.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),i.removeAttribute("style")),c===0?(a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),o.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),r=t.getUndoStack();if(!(!r||r.length===0)){var i=r.pop();if(i){var a=i.action;t.pushStack(a,Xi(i.data),"redo");var o=i.data.before;if(a==="add"&&(o=i.data.after),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){var v=t.findById(d.id);d.visible?t.showItem(v,!1):t.hideItem(v,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){var v=t.findById(d.id);delete d.id,t.updateItem(v,d,!1),v.getType()==="combo"&&t.updateCombo(v)})});break;case"changedata":t.changeData(o,!1);break;case"delete":{Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){var v=d.itemType;delete d.itemType,t.addItem(v,d,!1)})});break}case"add":Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){t.removeItem(d.id,!1)})});break;case"updateComboTree":Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){t.updateComboTree(d.id,d.parentId,!1)})});break;case"createCombo":var s=i.data.after.combos,l=s[s.length-1];Object.keys(o).forEach(function(c){var f=o[c];!f||f.forEach(function(d){t.updateComboTree(d.id,d.parentId,!1)})}),t.removeItem(l.id,!1);break;case"uncombo":var u=o.combos[o.combos.length-1],h=o.nodes.concat(o.combos).map(function(c){return c.id}).filter(function(c){return c!==u.id});t.createCombo(u,h,!1);break;case"layout":t.updateLayout(o,void 0,void 0,!1);break}}}},e.prototype.redo=function(){var t=this.get("graph"),r=t.getRedoStack();if(!(!r||r.length===0)){var i=r.pop();if(i){var a=i.action,o=i.data.after;if(t.pushStack(a,Xi(i.data)),a==="delete"&&(o=i.data.before),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){var d=t.findById(f.id);f.visible?t.showItem(d,!1):t.hideItem(d,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){var d=t.findById(f.id);delete f.id,t.updateItem(d,f,!1),d.getType()==="combo"&&t.updateCombo(d)})});break;case"changedata":t.changeData(o,!1);break;case"delete":o.edges&&o.edges.forEach(function(h){t.removeItem(h.id,!1)}),o.nodes&&o.nodes.forEach(function(h){t.removeItem(h.id,!1)}),o.combos&&o.combos.forEach(function(h){t.removeItem(h.id,!1)});break;case"add":{Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){var d=f.itemType;delete f.itemType,t.addItem(d,f,!1)})});break}case"updateComboTree":Object.keys(o).forEach(function(h){var c=o[h];!c||c.forEach(function(f){t.updateComboTree(f.id,f.parentId,!1)})});break;case"createCombo":var s=o.combos[o.combos.length-1];t.createCombo(s,s.children.map(function(h){return h.id}),!1);break;case"uncombo":var l=i.data.before.combos,u=l[l.length-1];t.uncombo(u.id,!1);break;case"layout":t.updateLayout(o,void 0,void 0,!1);break}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),r=t.getZoom(),i=1/(1-QEe*this.get("zoomSensitivity")),a=this.get("maxZoom")||t.get("maxZoom");i*r>a||t.zoomTo(r*i)},e.prototype.zoomIn=function(){var t=this.get("graph"),r=t.getZoom(),i=1-QEe*this.get("zoomSensitivity"),a=this.get("minZoom")||t.get("minZoom");i*r<a||t.zoomTo(r*i)},e.prototype.realZoom=function(){var t=this.get("graph");t.zoomTo(1)},e.prototype.autoZoom=function(){var t=this.get("graph");t.fitView([20,20])},e.prototype.handleDefaultOperator=function(t){switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom();break}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var r=this.get("container");r||(r=this.get("graph").get("container")),rr(r)&&(r=document.getElementById(r)),r.removeChild(t)}var i=this.get("handleClick");i&&t.removeEventListener("click",i)},e}(zd);const ivr=nvr;var avr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();typeof document<"u"&&cT.exports(`
.g6-component-tooltip {
border: 1px solid #e2e2e2;
border-radius: 4px;
font-size: 12px;
color: #545454;
background-color: rgba(255, 255, 255, 0.9);
padding: 10px 8px;
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
}
.tooltip-type {
padding: 0;
margin: 0;
}
.tooltip-id {
color: #531dab;
}
`);var ovr=function(n){avr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(r){return`
<h4 class='tooltip-type'>\u7C7B\u578B\uFF1A`.concat(r.item.getType(),`</h4>
<span class='tooltip-id'>ID\uFF1A`).concat(r.item.getID(),`</span>
`)},shouldBegin:function(r){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,r=t.get("className")||"g6-component-tooltip",i=zs("<div class='".concat(r,"'></div>")),a=t.get("container");a||(a=t.get("graph").get("container")),rr(a)&&(a=document.getElementById(a)),Di(i,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(i),t.get("trigger")!=="click"&&(i.addEventListener("mouseenter",function(o){Di(i,{visibility:"visible",display:"unset"})}),i.addEventListener("mouseleave",function(o){t.hideTooltip()})),t.set("tooltip",i)},e.prototype.onClick=function(t){var r=this.get("itemTypes");if(!(t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget===i?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var r=this.get("itemTypes");if(!(t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1)){var i=t.item,a=this.get("graph");this.currentTarget=i,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var r=this.get("itemTypes");t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1||!this.currentTarget||t.item!==this.currentTarget||this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip();var t=this.get("graph");t.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(!!t.item){var r=this.get("itemTypes");if(!(t.item.getType&&r.indexOf(t.item.getType())===-1)){var i=this.get("tooltip"),a=this.get("getContent"),o=a(t);rr(o)?i.innerHTML=o:(this.clearContainer(),i.appendChild(o)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&Di(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var r=this.get("shouldBegin"),i=this.get("tooltip");if(!r(t)){Di(i,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=this.get("offsetX")||0,u=this.get("offsetY")||0,h=a.getPointByClient(t.clientX,t.clientY),c=this.get("fixToNode"),f=t.item;if(f.getType&&f.getType()==="node"&&c&&vn(c)&&c.length>=2){var d=f.getBBox();h={x:d.minX+d.width*c[0],y:d.minY+d.height*c[1]}}var v=a.getCanvasByPoint(h.x,h.y),p=v.x,g=v.y,m=a.getContainer(),y={x:p+m.offsetLeft+l,y:g+m.offsetTop+u};Di(i,{visibility:"visible",display:"unset"});var _=i.getBoundingClientRect();p+_.width+l>o&&(y.x-=_.width+l),g+_.height+u>s&&(y.y-=_.height+u,y.y<0&&(y.y=0)),Di(i,{left:"".concat(y.x,"px"),top:"".concat(y.y,"px")})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var r=this.get("container");r||(r=this.get("graph").get("container")),rr(r)&&(r=document.getElementById(r)),r.removeChild(t)}},e}(zd);const svr=ovr;var eje="timebarstartplay",tje="timebarendplay",Oy="valuechange",GE="timebarConfigChanged",uS="playPauseBtn",nN="nextStepBtn",iN="preStepBtn",lvr=function(){function n(e){var t=e.x,r=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.container,s=e.text,l=e.padding,u=l===void 0?[4,4,4,4]:l,h=e.className,c=h===void 0?"g6-component-timebar-tooltip":h,f=e.backgroundColor,d=f===void 0?"#000":f,v=e.textColor,p=v===void 0?"#fff":v,g=e.opacity,m=g===void 0?.8:g,y=e.fontSize,_=y===void 0?12:y;this.container=o,this.className=c,this.backgroundColor=d,this.textColor=p,this.x=r,this.y=a,this.text=s,this.padding=u,this.opacity=m,this.fontSize=_,this.render()}return n.prototype.render=function(){var e=this,t=e.className;e.x,e.y;var r=e.backgroundColor,i=e.textColor,a=e.text,o=e.padding,s=e.opacity,l=e.fontSize,u=e.container,h=zs("<div class='".concat(t,`' style="position: absolute; width: fit-content; height: fit-content; opacity: `).concat(s,'"></div>'));rr(u)&&(u=document.getElementById(u)),u.appendChild(h),e.parentHeight=u.offsetHeight,e.parentWidth=u.offsetWidth,Di(h,{visibility:"hidden",top:0,left:0});var c=zs(`
<div style='position: absolute; white-space:nowrap; background-color: `.concat(r,"; font-size: ").concat(l,"px; border-radius: 4px; width: fit-content; height: fit-content; color: ").concat(i,"; padding: ").concat(o[0],"px ").concat(o[1],"px ").concat(o[2],"px ").concat(o[3],"px'></div>"));c.innerHTML=a,h.appendChild(c),e.backgroundDOM=c;var f=zs("<div style='position: absolute; width: 0px; height: 0px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid ".concat(r,"'></div>"));h.appendChild(f),e.arrowDOM=f,e.container=h},n.prototype.show=function(e){var t=this,r=e.text,i=e.x;e.y,e.clientX,e.clientY,t.backgroundDOM.innerHTML=r;var a=t.backgroundDOM.offsetWidth,o=t.backgroundDOM.offsetHeight,s=t.arrowDOM.offsetWidth,l=t.arrowDOM.offsetHeight;Di(t.container,{top:"".concat(-o-l,"px"),left:"".concat(i,"px"),visibility:"visible"}),Di(t.backgroundDOM,{marginLeft:"".concat(-a/2,"px")}),Di(t.arrowDOM,{marginLeft:"".concat(-s/2,"px"),top:"".concat(o,"px")});var u=i-a/2,h=i+a/2;u<0?Di(t.backgroundDOM,{marginLeft:"".concat(-a/2-u,"px")}):h>t.parentWidth&&Di(t.backgroundDOM,{marginLeft:"".concat(-a/2-h+t.parentWidth+12,"px")})},n.prototype.hide=function(){Di(this.container,{top:0,left:0,visibility:"hidden"})},n}();const uvr=lvr;var lte=globalThis&&globalThis.__assign||function(){return lte=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},lte.apply(this,arguments)},hvr=function(){function n(e){this.config=ms({},e),this.init()}return n.prototype.update=function(e){this.config=ms({},this.config,e),this.updateElement(),this.renderMarker()},n.prototype.init=function(){this.initElement(),this.renderMarker()},n.prototype.initElement=function(){var e=this.config,t=e.group,r=e.style,i=r.scale,a=i===void 0?1:i,o=r.offsetX,s=o===void 0?0:o,l=r.offsetY,u=l===void 0?0:l,h=this.config.x+s,c=this.config.y+u,f=t.addGroup({name:uS});this.startMarkerGroup=f.addGroup({name:uS}),this.circle=t.addShape("circle",{attrs:lte({x:h,y:c,r:this.config.r*a},r),name:uS}),this.startMarker=this.startMarkerGroup.addShape("path",{attrs:{path:this.getStartMarkerPath(h,c,a),fill:r.stroke||"#aaa"},name:"start-marker"}),this.pauseMarkerGroup=f.addGroup({name:uS});var d=.25*this.config.r*a,v=.5*this.config.r*Math.sqrt(3)*a;this.pauseLeftMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:h-.375*this.config.r*a,y:c-v/2,width:d,height:v,fill:r.stroke||"#aaa",lineWidth:0}}),this.pauseRightMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:h+1/8*this.config.r*a,y:c-v/2,width:d,height:v,fill:r.stroke||"#aaa",lineWidth:0}})},n.prototype.updateElement=function(){var e=this.config.style,t=e.scale,r=t===void 0?1:t,i=e.offsetX,a=i===void 0?0:i,o=e.offsetY,s=o===void 0?0:o,l=this.config.x+a,u=this.config.y+s;this.circle.attr("x",l),this.circle.attr("y",u),this.circle.attr("r",this.config.r*r),this.startMarker.attr("path",this.getStartMarkerPath(l,u,r));var h=.25*this.config.r*r,c=.5*this.config.r*Math.sqrt(3)*r;this.pauseLeftMarker.attr("x",l-(1/4+1/8)*this.config.r*r),this.pauseLeftMarker.attr("y",u-c/2),this.pauseLeftMarker.attr("width",h),this.pauseLeftMarker.attr("height",c),this.pauseRightMarker.attr("x",l+1/8*this.config.r*r),this.pauseRightMarker.attr("y",u-c/2),this.pauseRightMarker.attr("width",h),this.pauseRightMarker.attr("height",c)},n.prototype.renderMarker=function(){this.config.isPlay?(this.startMarkerGroup.hide(),this.pauseMarkerGroup.show()):(this.startMarkerGroup.show(),this.pauseMarkerGroup.hide())},n.prototype.getStartMarkerPath=function(e,t,r){var i=.5*this.config.r*Math.sqrt(3)*r;return[["M",e-i/Math.sqrt(3)/2,t-i/2],["L",e+i/Math.sqrt(3),t],["L",e-i/Math.sqrt(3)/2,t+i/2]]},n}();const cvr=hvr;var ru=globalThis&&globalThis.__assign||function(){return ru=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ru.apply(this,arguments)},OP=sg,fvr="#aaa",dvr="green",vvr={fill:"#aaa",fillOpacity:.35,stroke:"#aaa"},pvr={fill:"#fff"},gvr={fill:"green"},rje={pointer:{fill:"#aaa",lineWidth:0},scroller:{stroke:"#aaa",fill:"#aaa",lineWidth:1,lineAppendWidth:5,cursor:"pointer"},text:{fill:"#aaa",textBaseline:"top"}},nje={check:{stroke:"green",lineWidth:3},box:{fill:"#fff",stroke:"#aaa",lineWidth:2,radius:3,width:12,height:12},text:{fill:"#aaa",fontSize:12,textBaseline:"top"}},yvr={speed:1,loop:!1,fill:"#fff",stroke:"#fff",hideTimeTypeController:!1,preBtnStyle:{fill:"#aaa",stroke:"#aaa"},nextBtnStyle:{fill:"#aaa",stroke:"#aaa"},playBtnStyle:{fill:"#aaa",stroke:"#aaa",fillOpacity:.05},speedControllerStyle:rje,timeTypeControllerStyle:nje},RY=110,gx=50,Cy={SINGLE:"single",RANGE:"range"},mvr=function(){function n(e){this.controllerCfg=ms({},yvr,e),this.group=e.group,this.controllerGroup=this.group.addGroup({name:"controller-group"}),this.speedAxisY=[],this.currentSpeed=this.controllerCfg.speed,this.currentType=this.controllerCfg.defaultTimeType||Cy.RANGE,this.fontFamily=e.fontFamily||"Arial, sans-serif",this.init()}return n.prototype.init=function(){this.renderPlayButton()},n.prototype.getNextMarkerPath=function(e,t,r){return[["M",e,t-r],["L",e+r,t],["L",e,t+r],["Z",e,t-r],["M",e,t],["L",e-r,t-r],["L",e-r,t+r],["Z"]]},n.prototype.getPreMarkerPath=function(e,t,r){return[["M",e,t-r],["L",e-r,t],["L",e,t+r],["L",e,t-r],["M",e,t],["L",e+r,t-r],["L",e+r,t+r],["Z"]]},n.prototype.renderPlayButton=function(){var e=this.controllerCfg,t=e.width,r=e.height,i=e.x,a=e.y,o=e.hideTimeTypeController,s=e.fill,l=s===void 0?fvr:s,u=e.stroke,h=u===void 0?dvr:u,c=e.containerStyle,f=c===void 0?{}:c,d=ru(ru({},vvr),e.playBtnStyle||{}),v=ru(ru({},pvr),e.preBtnStyle||{}),p=ru(ru({},gvr),e.nextBtnStyle||{}),g=r/2-5,m=a+10,y=this.controllerGroup.addShape("rect",{attrs:ru({x:i,y:m,width:t,height:r,stroke:h,fill:l},f),name:"container-rect"});this.playButton?this.playButton.update({x:t/2,y:m,r:g}):this.playButton=new cvr({group:this.controllerGroup,x:t/2,y:m+g+5,r:g,isPlay:this.isPlay,style:d});var _=v.offsetX||0,x=v.offsetY||0,S=(v.scale||1)*g;this.controllerGroup.addShape("path",{attrs:ru({path:this.getPreMarkerPath(t/2-5*g+_,m+g+5+x,S*.5)},v),name:iN});var w=p.offsetX||0,b=p.offsetY||0,E=(p.scale||1)*g;this.controllerGroup.addShape("path",{attrs:ru({path:this.getNextMarkerPath(t/2+5*g+w,m+g+5+b,E*.5)},p),name:nN}),y.toBack(),this.renderSpeedBtn(),o||this.renderToggleTime(),this.bindEvent();var T=this.controllerCfg.scale,C=T===void 0?1:T,A=this.controllerGroup.getCanvasBBox(),M=(A.maxX+A.minX)/2,I=(A.maxY+A.minY)/2,R=OP([1,0,0,0,1,0,0,0,1],[["t",-M,-I],["s",C,C],["t",M,I]]);this.controllerGroup.setMatrix(R)},n.prototype.renderSpeedBtn=function(){var e=this.controllerCfg,t=e.y,r=e.width,i=e.hideTimeTypeController,a=ru(ru({},rje),this.controllerCfg.speedControllerStyle||{}),o=a.scroller,s=o===void 0?{}:o,l=a.text,u=l===void 0?{}:l,h=a.pointer,c=h===void 0?{}:h,f=a.scale,d=f===void 0?1:f,v=a.offsetX,p=v===void 0?0:v,g=a.offsetY,m=g===void 0?0:g,y=this.controllerGroup.addGroup({name:"speed-group"});this.speedGroup=y;var _=5;this.speedAxisY=[19,22,26,32,39];for(var x=0;x<5;x++){var S=t+this.speedAxisY[x],w=r-(i?gx:RY);y.addShape("line",{attrs:ru({x1:w,x2:w+15,y1:S,y2:S},s),speed:_,name:"speed-rect"}),this.speedAxisY[x]=S,_=_-1}this.speedText=y.addShape("text",{attrs:ru({x:r-(i?gx:RY)+20,y:this.speedAxisY[0]+4,text:"1.0X",fontFamily:this.fontFamily||"Arial, sans-serif"},u),name:"speed-text"}),this.speedPoint=y.addShape("path",{attrs:ru({path:this.getPointerPath(r-(i?gx:RY),0),matrix:[1,0,0,0,1,0,0,this.speedAxisY[4],1]},c),name:"speed-pointer"});var b=this.speedGroup.getCanvasBBox(),E=(b.maxX+b.minX)/2,T=(b.maxY+b.minY)/2,C=this.speedGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];C=OP(C,[["t",-E,-T],["s",d,d],["t",E+p*d,T+m*d]]),this.speedGroup.setMatrix(C)},n.prototype.getPointerPath=function(e,t){return[["M",e,t],["L",e-10,t-4],["L",e-10,t+4],["Z"]]},n.prototype.renderToggleTime=function(){var e,t,r=this.controllerCfg,i=r.width,a=r.defaultTimeType,o=ru(ru({},nje),this.controllerCfg.timeTypeControllerStyle||{}),s=o.scale,l=s===void 0?1:s,u=o.offsetX,h=u===void 0?0:u,c=o.offsetY,f=c===void 0?0:c,d=o.box,v=d===void 0?{}:d,p=o.check,g=p===void 0?{}:p,m=o.text,y=m===void 0?{}:m;this.toggleGroup=this.controllerGroup.addGroup({name:"toggle-group"});var _=a===Cy.SINGLE;this.toggleGroup.addShape("rect",{attrs:ru({x:i-gx,y:this.speedAxisY[0]+3.5},v),isChecked:_,name:"toggle-model"}),this.checkedIcon=this.toggleGroup.addShape("path",{attrs:ru({path:[["M",i-gx+3,this.speedAxisY[1]+6],["L",i-gx+7,this.speedAxisY[1]+10],["L",i-gx+12,this.speedAxisY[1]+4]]},g),capture:!1,name:"check-icon"}),_||this.checkedIcon.hide(),this.checkedText=this.toggleGroup.addShape("text",{attrs:ru({text:_?((e=this.controllerCfg)===null||e===void 0?void 0:e.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4":((t=this.controllerCfg)===null||t===void 0?void 0:t.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4",x:i-gx+15,y:this.speedAxisY[0]+4,fontFamily:typeof window<"u"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},y),name:"checked-text"});var x=this.toggleGroup.getCanvasBBox(),S=(x.maxX+x.minX)/2,w=(x.maxY+x.minY)/2,b=this.toggleGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];b=OP(b,[["t",-S,-w],["s",l,l],["t",S+h*l,w+f*l]]),this.toggleGroup.setMatrix(b)},n.prototype.bindEvent=function(){var e=this;this.speedGroup.on("speed-rect:click",function(t){var r=t.target.attr("y1"),i=e.speedPoint.attr("matrix"),a=e.speedAxisY.indexOf(i[7]||0),o=e.speedAxisY.indexOf(r),s=e.speedAxisY[o]-e.speedAxisY[a];i=OP(i,[["t",0,s]]),e.speedPoint.setMatrix(i),e.currentSpeed=e.speedAxisY.length-o,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(GE,{speed:e.currentSpeed,type:e.currentType})}),this.speedGroup.on("mousewheel",function(t){t.preventDefault();var r=e.speedPoint.attr("matrix")||[1,0,0,0,1,0,0,0,1],i=r[7],a=e.speedAxisY.indexOf(i);if(a===-1){var o=1/0;e.speedAxisY.forEach(function(l,u){var h=Math.abs(l-i);o>h&&(o=h,a=u)})}t.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(e.speedAxisY.length-1,a+1);var s=e.speedAxisY[a]-i;r=OP(r,[["t",0,s]]),e.speedPoint.setMatrix(r),e.currentSpeed=e.speedAxisY.length-a,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(GE,{speed:e.currentSpeed,type:e.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(t){var r,i,a=t.target.get("isChecked");a?(e.checkedIcon.hide(),e.checkedText.attr("text",((i=e.controllerCfg)===null||i===void 0?void 0:i.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),e.currentType=Cy.RANGE):(e.checkedIcon.show(),e.checkedText.attr("text",((r=e.controllerCfg)===null||r===void 0?void 0:r.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),e.currentType=Cy.SINGLE),t.target.set("isChecked",!a),e.group.emit(GE,{type:e.currentType,speed:e.currentSpeed})})},n.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},n}();const ije=mvr;var bR=globalThis&&globalThis.__assign||function(){return bR=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},bR.apply(this,arguments)},_vr=sg,xvr={fill:"#5B8FF9"},Svr={fill:"#e6e8e9"},wvr=function(){function n(e){this.frameCount=0,this.fontFamily="Arial, sans-serif";var t=e.graph,r=e.canvas,i=e.group,a=e.width,o=e.height,s=e.padding,l=e.data,u=e.start,h=e.end,c=e.x,f=c===void 0?0:c,d=e.y,v=d===void 0?0:d,p=e.tickLabelFormatter,g=e.selectedTickStyle,m=g===void 0?xvr:g,y=e.unselectedTickStyle,_=y===void 0?Svr:y,x=e.tooltipBackgroundColor,S=e.tooltipFomatter,w=e.tickLabelStyle,b=e.controllerCfg,E=b===void 0?{speed:1}:b;this.graph=t,this.group=i,this.sliceGroup=i.addGroup({name:"slice-group"}),this.canvas=r,this.width=a,this.height=o,this.padding=s,this.data=l,this.start=u,this.end=h,this.tickLabelFormatter=p,this.tickLabelStyle=w||{},this.selectedTickStyle=m,this.unselectedTickStyle=_,this.controllerCfg=E,this.currentSpeed=E.speed||1,this.x=f,this.y=v,this.tooltipBackgroundColor=x,this.tooltipFomatter=S,this.fontFamily=typeof window<"u"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlices(),this.initEvent()}return n.prototype.renderSlices=function(){var e=this,t=this,r=t.width,i=t.height,a=t.padding,o=t.data,s=t.start,l=t.end,u=t.tickLabelFormatter,h=t.selectedTickStyle,c=t.unselectedTickStyle,f=t.tickLabelStyle,d=r-2*a,v=10,p=4,g=3*a+p+v,m=i-g-2*a,y=2,_=o.length,x=(d-y*(_-1))/_;this.tickWidth=x;var S=this.sliceGroup,w=[],b=[],E=Math.round(_*s),T=Math.round(_*l);this.startTickRectId=E,this.endTickRectId=T;var C=f.rotate;delete f.rotate,o.forEach(function(M,I){var R=I>=E&&I<=T,k=R?h:c,D=S.addShape("rect",{attrs:bR({x:a+I*(x+y),y:a,width:x,height:m},k),draggable:!0,name:"tick-rect-".concat(I)}),G=S.addShape("rect",{attrs:{x:a+I*x+y*(2*I-1)/2,y:a,width:I===0||I===_-1?x+y/2:x+y,height:m,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(I)});G.toFront();var W=D.getBBox(),z=(W.minX+W.maxX)/2;w.push({rect:D,pickRect:G,value:M.date,x:z,y:W.minY});var V;if(u?(V=u(M),!rr(V)&&V&&(V=M.date)):I%Math.round(_/10)===0&&(V=M.date),V){b.push(V);var q=W.maxY+a*2;S.addShape("line",{attrs:{stroke:"#BFBFBF",x1:z,y1:q,x2:z,y2:q+p},name:"tick-line"});var Y=q+p+a,le=S.addShape("text",{attrs:bR({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:z,y:Y,textAlign:"center",text:V,textBaseline:"top",fontSize:10,fontFamily:e.fontFamily||"Arial, sans-serif"},f),capture:!1,name:"tick-label"}),j=le.getBBox();if(j.maxX>r?le.attr("textAlign","right"):j.minX<0&&le.attr("textAlign","left"),on(C)&&b.length!==10){var Q=_vr([1,0,0,0,1,0,0,0,1],[["t",-z,-Y],["r",C],["t",z-5,Y+2]]);le.attr({textAlign:"left",matrix:Q})}b.length===1?le.attr({textAlign:"left"}):b.length===10&&le.attr({textAlign:"right"})}}),this.tickRects=w;var A=this.group;this.currentSpeed=1,this.controllerBtnGroup=new ije(bR({group:A,x:this.x,y:this.y+i+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},n.prototype.initEvent=function(){var e=this,t=this.sliceGroup;t.on("click",function(h){var c=h.target;if(!(c.get("type")!=="rect"||!c.get("name"))){var f=parseInt(c.get("name").split("-")[2],10);if(!isNaN(f)){var d=e.tickRects,v=e.unselectedTickStyle;d.forEach(function(y){y.rect.attr(v)});var p=e.selectedTickStyle;d[f].rect.attr(p),e.startTickRectId=f,e.endTickRectId=f;var g=d.length,m=f/g;e.graph.emit(Oy,{value:[m,m]})}}}),t.on("dragstart",function(h){var c=e.tickRects,f=e.unselectedTickStyle;c.forEach(function(y){y.rect.attr(f)});var d=h.target,v=parseInt(d.get("name").split("-")[2],10),p=e.selectedTickStyle;c[v].rect.attr(p),e.startTickRectId=v;var g=c.length,m=v/g;e.graph.emit(Oy,{value:[m,m]}),e.dragging=!0}),t.on("dragover",function(h){if(!!e.dragging&&h.target.get("type")==="rect"){for(var c=parseInt(h.target.get("name").split("-")[2],10),f=e.startTickRectId,d=e.tickRects,v=e.selectedTickStyle,p=e.unselectedTickStyle,g=0;g<d.length;g++){var m=g>=f&&g<=c?v:p;d[g].rect.attr(m)}var y=d.length;e.endTickRectId=c;var _=f/y,x=c/y;e.graph.emit(Oy,{value:[_,x]})}}),t.on("drop",function(h){if(!!e.dragging&&(e.dragging=!1,h.target.get("type")==="rect")){var c=e.startTickRectId,f=parseInt(h.target.get("name").split("-")[2],10);if(!(f<c)){var d=e.selectedTickStyle,v=e.tickRects;v[f].rect.attr(d),e.endTickRectId=f;var p=v.length,g=c/p,m=f/p;e.graph.emit(Oy,{value:[g,m]})}}});var r=this,i=r.tooltipBackgroundColor,a=r.tooltipFomatter,o=r.canvas,s=new uvr({container:o.get("container"),backgroundColor:i}),l=this.tickRects;l.forEach(function(h){var c=h.pickRect;c.on("mouseenter",function(f){var d=f.target;if(d.get("type")==="rect"){var v=parseInt(d.get("name").split("-")[2],10),p=o.getClientByPoint(l[v].x,l[v].y);s.show({x:l[v].x,y:l[v].y,clientX:p.x,clientY:p.y,text:a?a(l[v].value):l[v].value})}}),c.on("mouseleave",function(f){s.hide()})});var u=this.group;u.on("".concat(uS,":click"),function(){e.isPlay=!e.isPlay,e.changePlayStatus()}),u.on("".concat(nN,":click"),function(){e.updateStartEnd(1)}),u.on("".concat(iN,":click"),function(){e.updateStartEnd(-1)}),u.on(GE,function(h){h.type;var c=h.speed;e.currentSpeed=c})},n.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(eje,null)):this.playHandler&&(typeof window<"u"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(tje,null))},n.prototype.startPlay=function(){var e=this;return typeof window<"u"?window.requestAnimationFrame(function(){var t=e.currentSpeed;e.frameCount%(60/t)===0&&(e.frameCount=0,e.updateStartEnd(1)),e.frameCount++,e.isPlay&&(e.playHandler=e.startPlay())}):void 0},n.prototype.updateStartEnd=function(e){var t=this,r=this.tickRects,i=r.length,a=this.unselectedTickStyle,o=this.selectedTickStyle,s=t.endTickRectId;if(e>0?t.endTickRectId++:(r[t.endTickRectId].rect.attr(a),t.endTickRectId--),s!==t.startTickRectId)t.endTickRectId<t.startTickRectId&&(t.startTickRectId=t.endTickRectId);else{for(var l=t.startTickRectId;l<=t.endTickRectId-1;l++)r[l].rect.attr(a);t.startTickRectId=t.endTickRectId}if(r[t.endTickRectId]){r[t.endTickRectId].rect.attr(o);var u=t.startTickRectId/i,h=t.endTickRectId/i;this.graph.emit(Oy,{value:[u,h]})}},n.prototype.destory=function(){var e=this.sliceGroup;e.off("click"),e.off("dragstart"),e.off("dragover"),e.off("drop"),this.tickRects.forEach(function(t){var r=t.pickRect;r.off("mouseenter"),r.off("mouseleave")}),this.tickRects.length=0,e.off("".concat(uS,":click")),e.off("".concat(nN,":click")),e.off("".concat(iN,":click")),e.off(GE),this.sliceGroup.destroy()},n}();const bvr=wvr;var aje={};function Evr(n){return aje[n]}function Nm(n,e){aje[n]=e}var Jle=function(){function n(e){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=e,this.initCfg(),this.init()}return n.prototype.translate=function(e){return e},n.prototype.change=function(e){_n(this.__cfg__,e),this.init()},n.prototype.clone=function(){return this.constructor(this.__cfg__)},n.prototype.getTicks=function(){var e=this;return n2(this.ticks,function(t,r){return Wh(t)?t:{text:e.getText(t,r),tickValue:t,value:e.scale(t)}})},n.prototype.getText=function(e,t){var r=this.formatter,i=r?r(e,t):e;return an(i)||!nl(i.toString)?"":i.toString()},n.prototype.getConfig=function(e){return this.__cfg__[e]},n.prototype.init=function(){_n(this,this.__cfg__),this.setDomain(),E9e(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},n.prototype.initCfg=function(){},n.prototype.setDomain=function(){},n.prototype.calculateTicks=function(){var e=this.tickMethod,t=[];if(rr(e)){var r=Evr(e);if(!r)throw new Error("There is no method to to calculate ticks!");t=r(this)}else nl(e)&&(t=e(this));return t},n.prototype.rangeMin=function(){return this.range[0]},n.prototype.rangeMax=function(){return this.range[1]},n.prototype.calcPercent=function(e,t,r){return on(e)?(e-t)/(r-t):NaN},n.prototype.calcValue=function(e,t,r){return t+e*(r-t)},n}(),gk=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;t<this.values.length;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var r=this.translateIndexMap.get(t);return r===void 0&&(r=on(t)?t:NaN),r},e.prototype.scale=function(t){var r=this.translate(t),i=this.calcPercent(r,this.min,this.max);return this.calcValue(i,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var r=this.max-this.min,i=this.calcPercent(t,this.rangeMin(),this.rangeMax()),a=Math.round(r*i)+this.min;return a<this.min||a>this.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=t;return on(t)&&!this.values.includes(t)&&(a=this.values[a]),n.prototype.getText.apply(this,OU([a],r))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(an(this.getConfig("min"))&&(this.min=0),an(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(Jle),oje=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Lx="\\d\\d?",yx="\\d\\d",Tvr="\\d{3}",Cvr="\\d{4}",ER="[^\\s]+",sje=/\[([^]*?)\]/gm;function lje(n,e){for(var t=[],r=0,i=n.length;r<i;r++)t.push(n[r].substr(0,e));return t}var e2e=function(n){return function(e,t){var r=t[n].map(function(a){return a.toLowerCase()}),i=r.indexOf(e.toLowerCase());return i>-1?i:null}};function JS(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var r=0,i=e;r<i.length;r++){var a=i[r];for(var o in a)n[o]=a[o]}return n}var uje=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],hje=["January","February","March","April","May","June","July","August","September","October","November","December"],Avr=lje(hje,3),Mvr=lje(uje,3),Qle={dayNamesShort:Mvr,dayNames:uje,monthNamesShort:Avr,monthNames:hje,amPm:["am","pm"],DoFn:function(n){return n+["th","st","nd","rd"][n%10>3?0:(n-n%10!==10?1:0)*n%10]}},X9=JS({},Qle),cje=function(n){return X9=JS(X9,n)},t2e=function(n){return n.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},nd=function(n,e){for(e===void 0&&(e=2),n=String(n);n.length<e;)n="0"+n;return n},Ivr={D:function(n){return String(n.getDate())},DD:function(n){return nd(n.getDate())},Do:function(n,e){return e.DoFn(n.getDate())},d:function(n){return String(n.getDay())},dd:function(n){return nd(n.getDay())},ddd:function(n,e){return e.dayNamesShort[n.getDay()]},dddd:function(n,e){return e.dayNames[n.getDay()]},M:function(n){return String(n.getMonth()+1)},MM:function(n){return nd(n.getMonth()+1)},MMM:function(n,e){return e.monthNamesShort[n.getMonth()]},MMMM:function(n,e){return e.monthNames[n.getMonth()]},YY:function(n){return nd(String(n.getFullYear()),4).substr(2)},YYYY:function(n){return nd(n.getFullYear(),4)},h:function(n){return String(n.getHours()%12||12)},hh:function(n){return nd(n.getHours()%12||12)},H:function(n){return String(n.getHours())},HH:function(n){return nd(n.getHours())},m:function(n){return String(n.getMinutes())},mm:function(n){return nd(n.getMinutes())},s:function(n){return String(n.getSeconds())},ss:function(n){return nd(n.getSeconds())},S:function(n){return String(Math.round(n.getMilliseconds()/100))},SS:function(n){return nd(Math.round(n.getMilliseconds()/10),2)},SSS:function(n){return nd(n.getMilliseconds(),3)},a:function(n,e){return n.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(n,e){return n.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(n){var e=n.getTimezoneOffset();return(e>0?"-":"+")+nd(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(n){var e=n.getTimezoneOffset();return(e>0?"-":"+")+nd(Math.floor(Math.abs(e)/60),2)+":"+nd(Math.abs(e)%60,2)}},r2e=function(n){return+n-1},n2e=[null,Lx],i2e=[null,ER],a2e=["isPm",ER,function(n,e){var t=n.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],o2e=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(n){var e=(n+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],Lvr={D:["day",Lx],DD:["day",yx],Do:["day",Lx+ER,function(n){return parseInt(n,10)}],M:["month",Lx,r2e],MM:["month",yx,r2e],YY:["year",yx,function(n){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+n>68?t-1:t)+n)}],h:["hour",Lx,void 0,"isPm"],hh:["hour",yx,void 0,"isPm"],H:["hour",Lx],HH:["hour",yx],m:["minute",Lx],mm:["minute",yx],s:["second",Lx],ss:["second",yx],YYYY:["year",Cvr],S:["millisecond","\\d",function(n){return+n*100}],SS:["millisecond",yx,function(n){return+n*10}],SSS:["millisecond",Tvr],d:n2e,dd:n2e,ddd:i2e,dddd:i2e,MMM:["month",ER,e2e("monthNamesShort")],MMMM:["month",ER,e2e("monthNames")],a:a2e,A:a2e,ZZ:o2e,Z:o2e},Y9={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},fje=function(n){return JS(Y9,n)},dje=function(n,e,t){if(e===void 0&&(e=Y9.default),t===void 0&&(t={}),typeof n=="number"&&(n=new Date(n)),Object.prototype.toString.call(n)!=="[object Date]"||isNaN(n.getTime()))throw new Error("Invalid Date pass to format");e=Y9[e]||e;var r=[];e=e.replace(sje,function(a,o){return r.push(o),"@@@"});var i=JS(JS({},X9),t);return e=e.replace(oje,function(a){return Ivr[a](n,i)}),e.replace(/@@@/g,function(){return r.shift()})};function vje(n,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=Y9[e]||e,n.length>1e3)return null;var r=new Date,i={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(sje,function(x,S){return o.push(t2e(S)),"@@@"}),l={},u={};s=t2e(s).replace(oje,function(x){var S=Lvr[x],w=S[0],b=S[1],E=S[3];if(l[w])throw new Error("Invalid format. "+w+" specified twice in format");return l[w]=!0,E&&(u[E]=!0),a.push(S),"("+b+")"}),Object.keys(u).forEach(function(x){if(!l[x])throw new Error("Invalid format. "+x+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var h=n.match(new RegExp(s,"i"));if(!h)return null;for(var c=JS(JS({},X9),t),f=1;f<h.length;f++){var d=a[f-1],v=d[0],p=d[2],g=p?p(h[f],c):+h[f];if(g==null)return null;i[v]=g}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var m;if(i.timezoneOffset==null){m=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var y=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],f=0,_=y.length;f<_;f++)if(l[y[f][0]]&&i[y[f][0]]!==m[y[f][1]]())return null}else if(m=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return m}var pje={format:dje,parse:vje,defaultI18n:Qle,setGlobalDateI18n:cje,setGlobalDateMasks:fje};const Pvr=Object.freeze(Object.defineProperty({__proto__:null,default:pje,assign:JS,format:dje,parse:vje,defaultI18n:Qle,setGlobalDateI18n:cje,setGlobalDateMasks:fje},Symbol.toStringTag,{value:"Module"}));function Ovr(n){return function(e,t,r,i){for(var a=an(r)?0:r,o=an(i)?e.length:i;a<o;){var s=a+o>>>1;n(e[s])>t?o=s:a=s+1}return a}}var s2e="format";function gje(n,e){var t=Pvr[s2e]||pje[s2e];return t(n,e)}function q9(n){return rr(n)&&(n.indexOf("T")>0?n=new Date(n).getTime():n=new Date(n.replace(/-/gi,"/")).getTime()),Doe(n)&&(n=n.getTime()),n}var Vg=1e3,zE=60*Vg,UE=60*zE,N1=24*UE,TR=N1*31,l2e=N1*365,RP=[["HH:mm:ss",Vg],["HH:mm:ss",Vg*10],["HH:mm:ss",Vg*30],["HH:mm",zE],["HH:mm",zE*10],["HH:mm",zE*30],["HH",UE],["HH",UE*6],["HH",UE*12],["YYYY-MM-DD",N1],["YYYY-MM-DD",N1*4],["YYYY-WW",N1*7],["YYYY-MM",TR],["YYYY-MM",TR*4],["YYYY-MM",TR*6],["YYYY",N1*380]];function Rvr(n,e,t){var r=(e-n)/t,i=Ovr(function(o){return o[1]})(RP,r)-1,a=RP[i];return i<0?a=RP[0]:i>=RP.length&&(a=Fp(RP)),a}var Dvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=q9(t);var r=this.values.indexOf(t);return r===-1&&(on(t)&&t<this.values.length?r=t:r=NaN),r},e.prototype.getText=function(t,r){var i=this.translate(t);if(i>-1){var a=this.values[i],o=this.formatter;return a=o?o(a,r):gje(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;At(t,function(r,i){t[i]=q9(r)}),t.sort(function(r,i){return r-i}),n.prototype.setDomain.call(this)},e}(gk),LV=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if(an(t))return NaN;var r=this.rangeMin(),i=this.rangeMax(),a=this.max,o=this.min;if(a===o)return r;var s=this.getScalePercent(t);return r+s*(i-r)},e.prototype.init=function(){n.prototype.init.call(this);var t=this.ticks,r=Ky(t),i=Fp(t);r<this.min&&(this.min=r),i>this.max&&(this.max=i),an(this.minLimit)||(this.min=r),an(this.maxLimit)||(this.max=i)},e.prototype.setDomain=function(){var t=f9e(this.values),r=t.min,i=t.max;an(this.min)&&(this.min=r),an(this.max)&&(this.max=i),this.min>this.max&&(this.min=r,this.max=i)},e.prototype.calculateTicks=function(){var t=this,r=n.prototype.calculateTicks.call(this);return this.nice||(r=RU(r,function(i){return i>=t.min&&i<=t.max})),r},e.prototype.getScalePercent=function(t){var r=this.max,i=this.min;return(t-i)/(r-i)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(Jle),Nvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var r=this.getInvertPercent(t);return this.min+r*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(LV);const yk=Nvr;function zx(n,e){var t=Math.E,r;return e>=0?r=Math.pow(t,Math.log(e)/n):r=Math.pow(t,Math.log(-e)/n)*-1,r}function dp(n,e){return n===1?1:Math.log(e)/Math.log(n)}function yje(n,e,t){an(t)&&(t=Math.max.apply(null,n));var r=t;return At(n,function(i){i>0&&i<r&&(r=i)}),r===t&&(r=t/e),r>1&&(r=1),r}var kvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var r=this.base,i=dp(r,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=dp(r,l/r);var u=1/(i-s)*o;if(t<u)return t/u*l}else s=dp(r,this.min);var h=(t-a)/o,c=h*(i-s)+s;return Math.pow(r,c)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){n.prototype.setDomain.call(this);var t=this.min;if(t<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");t===0&&(this.positiveMin=yje(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var r=this.max,i=this.min;if(r===i||t<=0)return 0;var a=this.base,o=this.positiveMin;o&&(i=o*1/a);var s;return t<o?s=t/o/(dp(a,r)-dp(a,i)):s=(dp(a,t)-dp(a,i))/(dp(a,r)-dp(a,i)),s},e}(LV),Fvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="pow",t}return e.prototype.invert=function(t){var r=this.getInvertPercent(t),i=this.exponent,a=zx(i,this.max),o=zx(i,this.min),s=r*(a-o)+o,l=s>=0?1:-1;return Math.pow(s,i)*l},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var r=this.max,i=this.min;if(r===i)return 0;var a=this.exponent,o=(zx(a,t)-zx(a,i))/(zx(a,r)-zx(a,i));return o},e}(LV),Bvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,r){var i=this.translate(t),a=this.formatter;return a?a(i,r):gje(i,this.mask)},e.prototype.scale=function(t){var r=t;return(rr(r)||Doe(r))&&(r=this.translate(r)),n.prototype.scale.call(this,r)},e.prototype.translate=function(t){return q9(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,r=this.getConfig("min"),i=this.getConfig("max");if((!an(r)||!on(r))&&(this.min=this.translate(this.min)),(!an(i)||!on(i))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;At(t,function(u){var h=q9(u);if(isNaN(h))throw new TypeError("Invalid Time: "+u+" in time scale!");o>h?(s=o,o=h):s>h&&(s=h),l<h&&(l=h),a.push(h)}),t.length>1&&(this.minTickInterval=s-o),an(r)&&(this.min=o),an(i)&&(this.max=l)}},e}(yk),mje=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var r=this.ticks,i=r.length,a=this.getInvertPercent(t),o=Math.floor(a*(i-1));if(o>=i-1)return Fp(r);if(o<0)return Ky(r);var s=r[o],l=r[o+1],u=o/(i-1),h=(o+1)/(i-1);return s+(a-u)/(h-u)*(l-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=n.prototype.calculateTicks.call(this);return this.nice||(Fp(t)!==this.max&&t.push(this.max),Ky(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var r=this.ticks;if(t<Ky(r))return 0;if(t>Fp(r))return 1;var i=0;return At(r,function(a,o){if(t>=a)i=o;else return!1}),i/(r.length-1)},e}(LV),Gvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(mje),_je={};function zvr(n){return _je[n]}function km(n,e){if(zvr(n))throw new Error("type '"+n+"' existed.");_je[n]=e}var Uvr=function(n){Kn(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&on(t)?t:this.range[0]},e.prototype.invert=function(t){var r=this.range;return t<r[0]||t>r[1]?NaN:this.values[0]},e}(Jle);function xje(n){var e=n.values,t=n.tickInterval,r=n.tickCount,i=n.showLast;if(on(t)){var a=RU(e,function(v,p){return p%t===0}),o=Fp(e);return i&&Fp(a)!==o&&a.push(o),a}var s=e.length,l=n.min,u=n.max;if(an(l)&&(l=0),an(u)&&(u=e.length-1),!on(r)||r>=s)return e.slice(l,u+1);if(r<=0||u<=0)return[];for(var h=r===1?s:Math.floor(s/(r-1)),c=[],f=l,d=0;d<r&&!(f>=u);d++)f=Math.min(l+d*h,u),d===r-1&&i?c.push(e[u]):c.push(e[f]);return c}function Vvr(n){var e=n.min,t=n.max,r=n.nice,i=n.tickCount,a=new $vr;return a.domain([e,t]),r&&a.nice(i),a.ticks(i)}var DY=5,u2e=Math.sqrt(50),h2e=Math.sqrt(10),c2e=Math.sqrt(2),$vr=function(){function n(){this._domain=[0,1]}return n.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},n.prototype.nice=function(e){var t,r;e===void 0&&(e=DY);var i=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l<s&&(t=[l,s],s=t[0],l=t[1],r=[o,a],a=r[0],o=r[1]),u=l8(s,l,e),u>0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=l8(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=l8(s,l,e)),u>0?(i[a]=Math.floor(s/u)*u,i[o]=Math.ceil(l/u)*u,this.domain(i)):u<0&&(i[a]=Math.ceil(s*u)/u,i[o]=Math.floor(l*u)/u,this.domain(i)),this},n.prototype.ticks=function(e){return e===void 0&&(e=DY),Wvr(this._domain[0],this._domain[this._domain.length-1],e||DY)},n}();function Wvr(n,e,t){var r,i=-1,a,o,s;if(e=+e,n=+n,t=+t,n===e&&t>0)return[n];if((r=e<n)&&(a=n,n=e,e=a),(s=l8(n,e,t))===0||!isFinite(s))return[];if(s>0)for(n=Math.ceil(n/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-n+1));++i<a;)o[i]=(n+i)*s;else for(n=Math.floor(n*s),e=Math.ceil(e*s),o=new Array(a=Math.ceil(n-e+1));++i<a;)o[i]=(n-i)/s;return r&&o.reverse(),o}function l8(n,e,t){var r=(e-n)/Math.max(0,t),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=u2e?10:a>=h2e?5:a>=c2e?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=u2e?10:a>=h2e?5:a>=c2e?2:1)}function f2e(n,e,t){var r;return t==="ceil"?r=Math.ceil(n/e):t==="floor"?r=Math.floor(n/e):r=Math.round(n/e),r*e}function eue(n,e,t){var r=f2e(n,t,"floor"),i=f2e(e,t,"ceil");r=BB(r,t),i=BB(i,t);for(var a=[],o=Math.max((i-r)/(Math.pow(2,12)-1),t),s=r;s<=i;s=s+o){var l=BB(s,o);a.push(l)}return{min:r,max:i,ticks:a}}function tue(n,e,t){var r,i=n.minLimit,a=n.maxLimit,o=n.min,s=n.max,l=n.tickCount,u=l===void 0?5:l,h=an(i)?an(e)?o:e:i,c=an(a)?an(t)?s:t:a;if(h>c&&(r=[h,c],c=r[0],h=r[1]),u<=2)return[h,c];for(var f=(c-h)/(u-1),d=[],v=0;v<u;v++)d.push(h+f*v);return d}function Hvr(n){var e=n.min,t=n.max,r=n.tickInterval,i=n.minLimit,a=n.maxLimit,o=Vvr(n);return!an(i)||!an(a)?tue(n,Ky(o),Fp(o)):r?eue(e,t,r).ticks:o}function Ub(n){return Math.abs(n)<1e-15?n:parseFloat(n.toFixed(15))}var jvr=[1,5,2,2.5,4,3],d2e=Number.EPSILON*100;function Xvr(n,e){return(n%e+e)%e}function Yvr(n){return Math.round(n*1e12)/1e12}function qvr(n,e,t,r,i,a){var o=kU(e),s=Noe(e,n),l=0,u=Xvr(r,a);return(u<d2e||a-u<d2e)&&r<=0&&i>=0&&(l=1),1-s/(o-1)-t+l}function Zvr(n,e,t){var r=kU(e),i=Noe(e,n),a=1;return 1-i/(r-1)-t+a}function Kvr(n,e,t,r,i,a){var o=(n-1)/(a-i),s=(e-1)/(Math.max(a,r)-Math.min(t,i));return 2-Math.max(o/s,s/o)}function Jvr(n,e){return n>=e?2-(n-1)/(e-1):1}function Qvr(n,e,t,r){var i=e-n;return 1-.5*(Math.pow(e-r,2)+Math.pow(n-t,2))/Math.pow(.1*i,2)}function epr(n,e,t){var r=e-n;if(t>r){var i=(t-r)/2;return 1-Math.pow(i,2)/Math.pow(.1*r,2)}return 1}function tpr(){return 1}function rpr(n,e,t,r,i,a){t===void 0&&(t=5),r===void 0&&(r=!0),i===void 0&&(i=jvr),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(e)||typeof n!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-n<1e-15||o===1)return{min:n,max:e,ticks:[n]};if(e-n>1e148){var s=t||5,l=(e-n)/s;return{min:n,max:e,ticks:Array(s).fill(null).map(function(q,Y){return Ub(n+l*Y)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},h=1;h<1/0;){for(var c=0;c<i.length;c+=1){var f=i[c],d=Zvr(f,i,h);if(a[0]*d+a[1]+a[2]+a[3]<u.score){h=1/0;break}for(var v=2;v<1/0;){var p=Jvr(v,o);if(a[0]*d+a[1]+a[2]*p+a[3]<u.score)break;for(var g=(e-n)/(v+1)/h/f,m=Math.ceil(Math.log10(g));m<1/0;){var y=h*f*Math.pow(10,m),_=epr(n,e,y*(v-1));if(a[0]*d+a[1]*_+a[2]*p+a[3]<u.score)break;var x=Math.floor(e/y)*h-(v-1)*h,S=Math.ceil(n/y)*h;if(x<=S)for(var s=S-x,w=0;w<=s;w+=1){var b=x+w,E=b*(y/h),T=E+y*(v-1),C=y,A=qvr(f,i,h,E,T,C),M=Qvr(n,e,E,T),I=Kvr(v,o,n,e,E,T),R=tpr(),k=a[0]*A+a[1]*M+a[2]*I+a[3]*R;k>u.score&&(!r||E<=n&&T>=e)&&(u.lmin=E,u.lmax=T,u.lstep=C,u.score=k)}m+=1}v+=1}}h+=1}var D=Ub(u.lmax),G=Ub(u.lmin),W=Ub(u.lstep),z=Math.floor(Yvr((D-G)/W))+1,V=new Array(z);V[0]=Ub(G);for(var c=1;c<z;c++)V[c]=Ub(V[c-1]+W);return{min:Math.min(n,Ky(V)),max:Math.max(e,Fp(V)),ticks:V}}function npr(n){var e=n.min,t=n.max,r=n.tickCount,i=n.nice,a=n.tickInterval,o=n.minLimit,s=n.maxLimit,l=rpr(e,t,r,i).ticks;return!an(o)||!an(s)?tue(n,Ky(l),Fp(l)):a?eue(e,t,a).ticks:l}function ipr(n){var e=n.base,t=n.tickCount,r=n.min,i=n.max,a=n.values,o,s=dp(e,i);if(r>0)o=Math.floor(dp(e,r));else{var l=yje(a,e,i);o=Math.floor(dp(e,l))}for(var u=s-o,h=Math.ceil(u/t),c=[],f=o;f<s+h;f=f+h)c.push(Math.pow(e,f));return r<=0&&c.unshift(0),c}function Sje(n,e,t){if(t===void 0&&(t=5),n===e)return{max:e,min:n,ticks:[n]};var r=t<0?0:Math.round(t);if(r===0)return{max:e,min:n,ticks:[]};var i=1.5,a=.5+1.5*i,o=e-n,s=o/r,l=Math.pow(10,Math.floor(Math.log10(s))),u=l;2*l-s<i*(s-u)&&(u=2*l,5*l-s<a*(s-u)&&(u=5*l,10*l-s<i*(s-u)&&(u=10*l)));for(var h=Math.ceil(e/u),c=Math.floor(n/u),f=Math.max(h*u,e),d=Math.min(c*u,n),v=Math.floor((f-d)/u)+1,p=new Array(v),g=0;g<v;g++)p[g]=Ub(d+g*u);return{min:d,max:f,ticks:p}}function apr(n){var e=n.exponent,t=n.tickCount,r=Math.ceil(zx(e,n.max)),i=Math.floor(zx(e,n.min)),a=Sje(i,r,t).ticks;return a.map(function(o){var s=o>=0?1:-1;return Math.pow(o,e)*s})}function opr(n,e){var t=n.length*e;return e===1?n[n.length-1]:e===0?n[0]:t%1!==0?n[Math.ceil(t)-1]:n.length%2===0?(n[t-1]+n[t])/2:n[t]}function spr(n){var e=n.tickCount,t=n.values;if(!t||!t.length)return[];for(var r=t.slice().sort(function(s,l){return s-l}),i=[],a=0;a<e;a++){var o=a/(e-1);i.push(opr(r,o))}return i}function lpr(n){var e=n.min,t=n.max,r=n.tickCount,i=n.tickInterval,a=n.minLimit,o=n.maxLimit,s=Sje(e,t,r).ticks;return!an(a)||!an(o)?tue(n,Ky(s),Fp(s)):i?eue(e,t,i).ticks:s}function upr(n){var e=n.min,t=n.max,r=n.minTickInterval,i=n.tickInterval,a=n.tickCount;if(i)a=Math.ceil((t-e)/i);else{i=Rvr(e,t,a)[1];var o=(t-e)/i,s=o/a;s>1&&(i=i*Math.ceil(s)),r&&i<r&&(i=r)}i=Math.max(Math.floor((t-e)/(Math.pow(2,12)-1)),i);for(var l=[],u=e;u<t+i;u+=i)l.push(u);return l}function hpr(n){var e=xje(ve({showLast:!0},n));return e}function Z9(n){return new Date(n).getFullYear()}function cpr(n){return new Date(n,0,1).getTime()}function ute(n){return new Date(n).getMonth()}function fpr(n,e){var t=Z9(n),r=Z9(e),i=ute(n),a=ute(e);return(r-t)*12+(a-i)%12}function dpr(n,e){return new Date(n,e,1).getTime()}function vpr(n,e){return Math.ceil((e-n)/N1)}function ppr(n,e){return Math.ceil((e-n)/UE)}function gpr(n,e){return Math.ceil((e-n)/(60*1e3))}function ypr(n){var e=n.min,t=n.max,r=n.minTickInterval,i=n.tickCount,a=n.tickInterval,o=[];a||(a=(t-e)/i,r&&a<r&&(a=r)),a=Math.max(Math.floor((t-e)/(Math.pow(2,12)-1)),a);var s=Z9(e);if(a>l2e)for(var l=Z9(t),u=Math.ceil(a/l2e),h=s;h<=l+u;h=h+u)o.push(cpr(h));else if(a>TR)for(var c=Math.ceil(a/TR),f=ute(e),d=fpr(e,t),h=0;h<=d+c;h=h+c)o.push(dpr(s,h+f));else if(a>N1)for(var v=new Date(e),p=v.getFullYear(),g=v.getMonth(),m=v.getDate(),y=Math.ceil(a/N1),_=vpr(e,t),h=0;h<_+y;h=h+y)o.push(new Date(p,g,m+h).getTime());else if(a>UE)for(var v=new Date(e),p=v.getFullYear(),g=v.getMonth(),y=v.getDate(),x=v.getHours(),S=Math.ceil(a/UE),w=ppr(e,t),h=0;h<=w+S;h=h+S)o.push(new Date(p,g,y,x+h).getTime());else if(a>zE)for(var b=gpr(e,t),E=Math.ceil(a/zE),h=0;h<=b+E;h=h+E)o.push(e+h*zE);else{var T=a;T<Vg&&(T=Vg);for(var C=Math.floor(e/Vg)*Vg,A=Math.ceil((t-e)/Vg),M=Math.ceil(T/Vg),h=0;h<A+M;h=h+M)o.push(C+h*Vg)}return o.length>=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}Nm("cat",xje);Nm("time-cat",hpr);Nm("wilkinson-extended",npr);Nm("r-pretty",lpr);Nm("time",upr);Nm("time-pretty",ypr);Nm("log",ipr);Nm("pow",apr);Nm("quantile",spr);Nm("d3-linear",Hvr);km("cat",gk);km("category",gk);km("identity",Uvr);km("linear",yk);km("log",kvr);km("pow",Fvr);km("time",Bvr);km("timeCat",Dvr);km("quantize",mje);km("quantile",Gvr);var mpr=globalThis&&globalThis.__spreadArray||function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))};function _pr(n){return n2(n,function(e,t){var r=t===0?"M":"L",i=e[0],a=e[1];return[r,i,a]})}function wje(n){return _pr(n)}function xpr(n){if(n.length<=2)return wje(n);var e=[];At(n,function(o){HS(o,e.slice(e.length-2))||e.push(o[0],o[1])});var t=cUe(e,!1),r=Ky(n),i=r[0],a=r[1];return t.unshift(["M",i,a]),t}function Spr(n,e,t,r){r===void 0&&(r=!0);var i=new yk({values:n}),a=new gk({values:n2(n,function(s,l){return l})}),o=n2(n,function(s,l){return[a.scale(l)*e,t-i.scale(s)*t]});return r?xpr(o):wje(o)}function wpr(n,e,t,r){r===void 0&&(r=5);for(var i=new yk({values:n}),a=new gk({values:n2(n,function(f,d){return d})}),o=n2(n,function(f,d){return[a.scale(d)*e,t-i.scale(f)*t]}),s=[],l=0;l<o.length;l++){var u=o[l],h={x:u[0],y:u[1],y0:t,size:r},c=Tpr(h);s.push.apply(s,c)}return Cpr(s)}function bpr(n,e){var t=new yk({values:n}),r=Math.max(0,t.min);return e-t.scale(r)*e}function Epr(n,e,t,r){var i=mpr([],n,!0),a=bpr(r,t);return i.push(["L",e,a]),i.push(["L",0,a]),i.push(["Z"]),i}function Tpr(n){var e=n.x,t=n.y,r=n.y0,i=n.size,a,o;vn(t)?(a=t[0],o=t[1]):(a=r,o=t);var s,l;vn(e)?(s=e[0],l=e[1]):(s=e-i/2,l=e+i/2);var u=[{x:s,y:a},{x:s,y:o}];return u.push({x:l,y:o},{x:l,y:a}),u}function Cpr(n,e){e===void 0&&(e=!0);var t=[],r=n[0];t.push(["M",r.x,r.y]);for(var i=1,a=n.length;i<a;i++)t.push(["L",n[i].x,n[i].y]);return e&&(t.push(["L",r.x,r.y]),t.push(["z"])),t}var CR=globalThis&&globalThis.__assign||function(){return CR=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},CR.apply(this,arguments)},Apr={stroke:"#C5C5C5",strokeOpacity:.85},Mpr={fill:"#CACED4",opacity:.85},Ipr=function(){function n(e){var t=e.x,r=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.width,s=o===void 0?200:o,l=e.height,u=l===void 0?26:l,h=e.smooth,c=h===void 0?!0:h,f=e.isArea,d=f===void 0?!1:f,v=e.data,p=v===void 0?[]:v,g=e.lineStyle,m=e.areaStyle,y=e.group,_=e.interval,x=_===void 0?null:_;this.group=y,this.x=r,this.y=a,this.width=s,this.height=u,this.data=p,this.smooth=c,this.isArea=d,this.lineStyle=Object.assign({},Apr,g),this.areaStyle=Object.assign({},Mpr,m),this.intervalConfig=x,this.renderLine()}return n.prototype.renderLine=function(){var e=this,t=e.x,r=e.y,i=e.width,a=e.height;e.barWidth;var o=e.data,s=e.smooth,l=e.isArea,u=e.lineStyle,h=e.areaStyle,c=this.group.addGroup({name:"trend-group"});if(o){var f=Spr(o,i,a,s);if(c.addShape("path",{attrs:CR({path:f},u),name:"trend-line"}),l){var d=Epr(f,i,a,o);c.addShape("path",{attrs:CR({path:d},h),name:"trend-area"})}}this.intervalConfig&&c.addShape("path",{attrs:CR({path:wpr(this.intervalConfig.data,i,a,this.intervalConfig.style.barWidth)},this.intervalConfig.style),name:"trend-interval"}),c.move(t,r)},n.prototype.destory=function(){this.group.destroy()},n}();const Lpr=Ipr;var mA=globalThis&&globalThis.__assign||function(){return mA=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},mA.apply(this,arguments)},Ppr={fill:"#1890ff",stroke:"#1890ff",type:"trend",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},Opr={fill:"#fff",stroke:"#1890ff",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},Rpr=function(){function n(e){var t=e.group,r=e.name,i=e.type,a=e.x,o=a===void 0?0:a,s=e.y,l=s===void 0?0:s,u=e.width,h=u===void 0?2:u,c=e.height,f=c===void 0?24:c,d=e.style,v=d===void 0?{}:d;this.group=t,this.name=r,this.handleType=i,this.x=o,this.y=l,this.width=h,this.height=f,i==="trend"?this.style=mA(mA({},Ppr),v):i==="simple"&&(this.style=mA(mA({},Opr),v)),this.renderHandle()}return n.prototype.setX=function(e){this.setXY(e,void 0)},n.prototype.setY=function(e){this.setXY(void 0,e)},n.prototype.setXY=function(e,t){on(e)&&(this.x=e),on(t)&&(this.y=t),this.updateXY()},n.prototype.renderHandle=function(){var e=this,t=e.width,r=e.height,i=e.style,a=e.name,o=i.fill,s=i.stroke,l=i.radius,u=i.opacity,h=i.cursor;this.handleGroup=this.group.addGroup(),this.handleType==="trend"?(this.verticalLine=this.handleGroup.addShape("rect",{attrs:{x:0,y:0,width:t,height:r,fill:o,stroke:s,radius:l,opacity:u,cursor:h},name:"".concat(a,"-handler")}),this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:0,r:2*t,fill:o,stroke:s,radius:l,opacity:u,cursor:h,lineAppendWidth:12},name:"".concat(a,"-handler")}),this.bottomCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:r,r:2*t,fill:o,stroke:s,radius:l,opacity:u,cursor:h},name:"".concat(a,"-handler")})):this.handleType==="simple"&&(this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:t/2,y:r/2,r:2*t,fill:o,stroke:s,radius:l,opacity:u,cursor:h,lineWidth:2},name:"".concat(a,"-handler")})),this.updateXY(),this.handleType==="trend"?this.bindTrendEvents():this.handleType==="simple"&&this.bindSimpleEvents()},n.prototype.bindSimpleEvents=function(){var e=this,t=this.name;this.handleGroup.on("".concat(t,"-handler:mouseenter"),function(){var r=e.style.highLightFill;e.topCircle.attr("fill",r)}),this.handleGroup.on("".concat(t,"-handler:mouseleave"),function(){var r=e.style.fill;e.topCircle.attr("fill",r)})},n.prototype.bindTrendEvents=function(){var e=this,t=this.name;this.handleGroup.on("".concat(t,"-handler:mouseenter"),function(){var r=e.style.highLightFill;e.verticalLine.attr("fill",r),e.topCircle.attr("fill",r),e.bottomCircle.attr("fill",r)}),this.handleGroup.on("".concat(t,"-handler:mouseleave"),function(){var r=e.style.fill;e.verticalLine.attr("fill",r),e.topCircle.attr("fill",r),e.bottomCircle.attr("fill",r)})},n.prototype.show=function(){this.handleGroup.show()},n.prototype.hide=function(){this.handleGroup.hide()},n.prototype.updateXY=function(){this.handleGroup.setMatrix([1,0,0,0,1,0,this.x,this.y,1])},n}();const v2e=Rpr;var Cs=globalThis&&globalThis.__assign||function(){return Cs=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Cs.apply(this,arguments)},Dpr=sg,Npr={fill:"#416180",opacity:.05},kpr={fill:"#416180",opacity:.15,radius:5},Fpr={fill:"#5B8FF9",opacity:.3,cursor:"grab"},hte=2,Bpr={width:hte,height:24},Gpr={textBaseline:"middle",fill:"#000",opacity:.45},zpr={textAlign:"center",textBaseline:"top",fill:"#607889",opacity:.35},Upr={lineWidth:1,stroke:"#ccc"},Vpr=function(){function n(e){var t=this;this.prevX=0,this.onMouseDown=function(q){return function(Y){t.currentHandler=q;var le=Y.originalEvent;le.stopPropagation(),le.preventDefault(),t.prevX=y1(le,"touches.0.pageX",le.pageX);var j=t.canvas.get("container");j.addEventListener("mousemove",t.onMouseMove),j.addEventListener("mouseup",t.onMouseUp),j.addEventListener("mouseleave",t.onMouseUp),j.addEventListener("touchmove",t.onMouseMove),j.addEventListener("touchend",t.onMouseUp),j.addEventListener("touchcancel",t.onMouseUp)}},this.onMouseMove=function(q){q.stopPropagation(),q.preventDefault();var Y=y1(q,"touches.0.pageX",q.pageX),le=Y-t.prevX,j=t.adjustOffsetRange(le/t.width);t.updateStartEnd(j),t.updateUI(),t.prevX=Y},this.onMouseUp=function(){t.currentHandler&&(t.currentHandler=void 0);var q=t.canvas.get("container");q&&(q.removeEventListener("mousemove",t.onMouseMove),q.removeEventListener("mouseup",t.onMouseUp),q.removeEventListener("mouseleave",t.onMouseUp),q.removeEventListener("touchmove",t.onMouseMove),q.removeEventListener("touchend",t.onMouseUp),q.removeEventListener("touchcancel",t.onMouseUp))};var r=e.x,i=r===void 0?0:r,a=e.y,o=a===void 0?0:a,s=e.width,l=s===void 0?100:s,u=e.height,h=e.padding,c=h===void 0?10:h,f=e.trendCfg,d=e.controllerCfg,v=d===void 0?{speed:1}:d,p=e.backgroundStyle,g=p===void 0?{}:p,m=e.foregroundStyle,y=m===void 0?{}:m,_=e.handlerStyle,x=_===void 0?{}:_,S=e.textStyle,w=S===void 0?{}:S,b=e.start,E=b===void 0?0:b,T=e.end,C=T===void 0?1:T,A=e.minText,M=A===void 0?"":A,I=e.maxText,R=I===void 0?"":I,k=e.group,D=e.graph,G=e.canvas,W=e.tick,z=W===void 0?{tickLabelStyle:{},tickLineStyle:{},tickLabelFormatter:function(Y){return Y},ticks:[]}:W,V=e.type;this.graph=D,this.canvas=G,this.group=k,this.timeBarType=V,this.x=i,this.y=o,this.width=l,this.height=u,this.padding=c,this.ticks=z.ticks,this.trendCfg=f,this.controllerCfg=v,this.currentSpeed=v.speed||1,this.tickLabelFormatter=z.tickLabelFormatter,V==="trend"?this.backgroundStyle=Cs(Cs({},Npr),g):V==="simple"&&(this.backgroundStyle=Cs(Cs({},kpr),g)),this.foregroundStyle=Cs(Cs({},Fpr),y),this.handlerStyle=Cs(Cs({},Bpr),x),this.textStyle=Cs(Cs({},Gpr),w),this.tickLabelStyle=Cs(Cs({},zpr),z.tickLabelStyle),this.tickLineStyle=Cs(Cs({},Upr),z.tickLineStyle),this.currentMode=v.defaultTimeType||Cy.RANGE,this.start=E,this.end=C,this.minText=M,this.maxText=R,this.fontFamily=typeof window<"u"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlider()}return n.prototype.update=function(e){var t=e.x,r=e.y,i=e.width,a=e.height,o=e.minText,s=e.maxText,l=e.start,u=e.end;this.start=Math.min(1,Math.max(l,0)),this.end=Math.min(1,Math.max(u,0)),_n(this,{x:t,y:r,width:i,height:a,minText:o,maxText:s}),this.updateUI()},n.prototype.setText=function(e,t){this.minTextShape.attr("text",e),this.maxTextShape.attr("text",t)},n.prototype.renderSlider=function(){var e=this,t=this,r=t.width,i=t.height,a=t.timeBarType;if(a==="trend"&&kU(y1(this.trendCfg,"data"))){var o=new Lpr(Cs(Cs({x:this.x,y:this.y,width:r,height:i},this.trendCfg),{group:this.group}));this.trendComponent=o}var s=this.group.addGroup({name:"slider-group"});s.addShape("rect",{attrs:Cs({x:0,y:0,width:r,height:i},this.backgroundStyle),name:"background"});var l=this.group.addGroup();a==="trend"?(this.minTextShape=l.addShape("text",{attrs:Cs({x:0,y:i/2+this.y,textAlign:"right",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=l.addShape("text",{attrs:Cs({y:i/2+this.y,textAlign:"left",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})):(this.minTextShape=l.addShape("text",{attrs:Cs({x:0,y:this.y-10,textAlign:"center",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=l.addShape("text",{attrs:Cs({y:this.y-10,textAlign:"center",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})),this.foregroundShape=this.group.addGroup().addShape("rect",{attrs:Cs({x:0,y:this.y,height:i},this.foregroundStyle),name:"foreground-shape"}),this.foregroundShape.on("mousedown",function(m){m.target.attr("cursor","grabbing")}),this.foregroundShape.on("mouseup",function(m){m.target.attr("cursor",e.foregroundStyle.cursor||"grab")});var u=y1(this.handlerStyle,"width",2),h=y1(this.handlerStyle,"height",24),c=this.group.addGroup({name:"minHandlerShape"});this.minHandlerShape=new v2e({name:"minHandlerShape",group:c,type:a,x:this.x,y:this.y,width:u,height:h,style:this.handlerStyle});var f=this.group.addGroup({name:"maxHandlerShape"});this.maxHandlerShape=new v2e({name:"maxHandlerShape",group:f,type:a,x:this.x,y:this.y,width:u,height:h,style:this.handlerStyle});var d=this.ticks,v=r/(d.length-1);this.tickPosList=[],this.textList&&this.textList.length&&this.textList.forEach(function(m){m.destroy()});var p=-1/0,g=this.tickLabelStyle.rotate;delete this.tickLabelStyle.rotate,this.textList=d.map(function(m,y){e.tickPosList.push(e.x+y*v);var _;e.tickLabelFormatter?(_=e.tickLabelFormatter(m),!rr(_)&&_&&(_=m.date)):_=m.date;var x=e.x+y*v,S=e.y+i+5,w=e.group.addShape("text",{attrs:Cs({x,y:S,text:_,fontFamily:e.fontFamily||"Arial, sans-serif"},e.tickLabelStyle),name:"tick-label"});if(on(g)&&y!==d.length-1){var b=Dpr([1,0,0,0,1,0,0,0,1],[["t",-x,-S],["r",g],["t",x-5,S+2]]);w.attr({textAlign:"left",matrix:b})}y===0?w.attr({textAlign:"left"}):y!==d.length-1&&w.attr({textAlign:"right"});var E=e.group.addShape("line",{attrs:Cs({x1:e.x+y*v,y1:e.y+i+2,x2:e.x+y*v,y2:e.y+i+6},e.tickLineStyle),name:"tick-line"});E.toBack();var T=w.getBBox();return T.minX>p?(w.show(),E.show(),p=T.minX+T.width+10):(w.hide(),E.hide()),w}),this.controllerBtnGroup=new ije(Cs({group:this.group,x:this.x,y:this.y+i+25,width:r,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),s.move(this.x,this.y),this.bindEvents(),this.currentMode===Cy.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},n.prototype.bindEvents=function(){var e=this,t=this.group.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),t.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(i){return i.get("name")==="maxHandlerShape"});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(uS,":click"),function(){e.isPlay=!e.isPlay,e.currentHandler=e.maxHandlerShape,e.changePlayStatus()}),this.group.on("".concat(nN,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(.01),e.updateUI()}),this.group.on("".concat(iN,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(-.01),e.updateUI()}),this.group.on(GE,function(i){var a=i.type,o=i.speed;e.currentSpeed=o,e.currentMode=a,a===Cy.SINGLE?(e.minHandlerShape.hide(),e.foregroundShape.hide(),e.minTextShape.hide()):a===Cy.RANGE&&(e.minHandlerShape.show(),e.foregroundShape.show(),e.minTextShape.show())})},n.prototype.adjustTickIndex=function(e){for(var t=0;t<this.tickPosList.length-1;t++)if(this.tickPosList[t]<=e&&e<=this.tickPosList[t+1])return Math.abs(this.tickPosList[t]-e)<Math.abs(e-this.tickPosList[t+1])?t:t+1;return 0},n.prototype.adjustOffsetRange=function(e){switch(this.currentHandler){case this.minHandlerShape:{var t=0-this.start,r=1-this.start;return Math.min(r,Math.max(t,e))}case this.maxHandlerShape:{var t=0-this.end,r=1-this.end;return Math.min(r,Math.max(t,e))}case this.foregroundShape:{var t=0-this.start,r=1-this.end;return Math.min(r,Math.max(t,e))}default:return 0}},n.prototype.updateStartEnd=function(e){var t=this.ticks[this.adjustTickIndex(this.start*this.width)],r=this.ticks[this.adjustTickIndex(this.end*this.width)];if(!this.currentHandler){this.minText=this.tickLabelFormatter?this.tickLabelFormatter(t):t==null?void 0:t.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r==null?void 0:r.date;return}switch(this.currentHandler){case this.minHandlerShape:this.maxText=this.maxTextShape.attr("text"),this.start+=e,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(t):t.date;break;case this.maxHandlerShape:this.minText=this.minTextShape.attr("text"),this.end+=e,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r.date;break;case this.foregroundShape:this.start+=e,this.end+=e,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(t):t.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r.date;break}},n.prototype.updateUI=function(){var e=this;this.start<0&&(this.start=0),this.start>1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var t=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",t),this.foregroundShape.attr("width",r-t);var i=y1(this.handlerStyle,"width",hte);this.setText(this.minText,this.maxText);var a=this.dodgeText([t,r]),o=a[0],s=a[1];this.minHandlerShape.setX(t-i/2),At(o,function(l,u){return e.minTextShape.attr(u,l)}),this.maxHandlerShape.setX(r-i/2),At(s,function(l,u){return e.maxTextShape.attr(u,l)}),this.currentMode===Cy.RANGE?this.graph.emit(Oy,{value:[this.start,this.end].sort()}):this.currentMode===Cy.SINGLE&&this.graph.emit(Oy,{value:[this.end,this.end]})},n.prototype.dodgeText=function(e){var t,r,i=2,a=y1(this.handlerStyle,"width",hte),o=this.minTextShape,s=this.maxTextShape,l=e[0],u=e[1],h=!1;l>u&&(t=[u,l],l=t[0],u=t[1],r=[s,o],o=r[0],s=r[1],h=!0);var c=o.getBBox(),f=s.getBBox(),d=null,v=null;return this.timeBarType==="trend"?(d=l-c.width<this.x+i?{x:l+a/2+i,textAlign:"left"}:{x:l-a/2-i,textAlign:"right"},v=u+f.width>this.x+this.width?{x:u-a/2-i,textAlign:"right"}:{x:u+a/2+i,textAlign:"left"}):this.timeBarType==="simple"&&(d=o.attr("x")>c.width?{x:l,textAlign:"center"}:{x:l,textAlign:"left"},v=s.attr("x")>this.width-f.width?{x:u,textAlign:"right"}:{x:u,textAlign:"center"}),h?[v,d]:[d,v]},n.prototype.startPlay=function(){var e=this;return typeof window<"u"?window.requestAnimationFrame(function(){var t=e,r=t.ticks,i=t.width,a=e.currentSpeed,o=i/r.length,s=o/((10-a)*1e3/60),l=e.adjustOffsetRange(s/e.width);e.updateStartEnd(l),e.updateUI(),e.isPlay&&(e.playHandler=e.startPlay())}):void 0},n.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(eje,null)):this.playHandler&&(typeof window<"u"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(tje,null))},n.prototype.destory=function(){this.graph.off(Oy,function(){});var e=this.group,t=e.find(function(i){return i.get("name")==="minHandlerShape"});t&&(t.off("minHandlerShape-handler:mousedown"),t.off("minHandlerShape-handler:touchstart"),t.destroy());var r=e.find(function(i){return i.get("name")==="maxHandlerShape"});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),e.off("".concat(uS,":click")),e.off("".concat(nN,":click")),e.off("".concat(iN,":click")),e.off(GE),e.destroy(),this.trendComponent&&this.trendComponent.destory()},n}();const $pr=Vpr;var Wpr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),m1=globalThis&&globalThis.__assign||function(){return m1=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},m1.apply(this,arguments)},Hpr=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},jpr=4,Xpr=26,Ypr=function(n){Wpr(e,n);function e(t){var r=n.call(this,t)||this;return r.afterrenderListener=function(i){return r.filterData({})},r.valueChangeListener=FD(function(i){return r.filterData(i)},200,{trailing:!0,leading:!0}),r.changeData=function(i){var a=r.get("graph");r.cacheGraphData=a.get("data"),r.filterData({})},r}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-component-timebar",padding:10,type:"trend",trend:{data:[],isArea:!1,smooth:!0},controllerCfg:{speed:1,loop:!1},slider:{start:.1,end:.9,minText:"min",maxText:"max"},tick:{start:.1,end:.9,data:[]},textStyle:{},filterEdge:!1,filterItemTypes:["node"],containerCSS:{},putInGraphContainer:!0}},e.prototype.initContainer=function(){var t=this.get("graph"),r=this._cfgs,i=r.width,a=r.height,o=r.putInGraphContainer,s=this.get("className")||"g6-component-timebar",l=this.get("container"),u;if(l?(rr(l)&&(l=document.getElementById(l)),u=l):(u=zs("<div class='".concat(s,"'></div>")),Di(u,{position:"relative"})),o){var h=this.get("graph").get("container");h.appendChild(u)}this.set("timeBarContainer",u);var c,f=t.get("renderer");f==="SVG"?c=new yR({container:u,width:i,height:a}):c=new M1({container:u,width:i,height:a}),this.get("containerCSS")&&Di(u,this.get("containerCSS")),this.set("canvas",c)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas"),r=t.addGroup({name:"timebar-group"});this.set("timeBarGroup",r),this.renderTrend(),this.initEvent();var i=typeof window<"u"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",i)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var r=this.get("timebar");!r||(r.isPlay=!!t,r.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,r=this._cfgs,i=r.width,a=r.x,o=r.y,s=r.padding,l=r.type,u=r.trend,h=r.slider,c=r.controllerCfg,f=r.textStyle,d=r.tick,v=r.backgroundStyle,p=r.foregroundStyle,g=u.data,m=Hpr(u,["data"]),y=i-2*s,_=l==="trend"?Xpr:jpr,x=this.get("graph"),S=this.get("timeBarGroup"),w=this.get("canvas"),b=null;if(l==="trend"||l==="simple"){var E=this.get("getValue");b=new $pr(m1(m1({graph:x,canvas:w,group:S,type:l,x:a+s,y:l==="trend"?o+s:o+s+15,width:y,height:_,padding:s,backgroundStyle:v,foregroundStyle:p,trendCfg:m1(m1({},m),{data:g.map(function(C){return(E==null?void 0:E(C))||C.value})})},h),{tick:{ticks:g,tickLabelFormatter:d.tickLabelFormatter,tickLabelStyle:d.tickLabelStyle,tickLineStyle:d.tickLineStyle},handlerStyle:m1(m1({},h.handlerStyle),{height:h.height||_}),controllerCfg:c,textStyle:f}))}else l==="tick"&&(b=new bvr(m1({graph:x,canvas:w,group:S,x:a+s,y:o+s,width:i,height:42,padding:2,controllerCfg:c},d)));var T=function(){var A=t.get("timebar");A.draggingHandler=!1,A.isPlay&&(A.isPlay=!1,A.currentHandler=A.maxHandlerShape,A.changePlayStatus()),document.removeEventListener("mouseup",T)};w.on("mousedown",function(C){(C.target.get("name")==="maxHandlerShape-handler"||C.target.get("name")==="minHandlerShape-handler"||C.target===b.foregroundShape)&&document.addEventListener("mouseup",T)}),this.set("timebar",b)},e.prototype.filterData=function(t){var r,i=t.value;if(!i){i=[];var a=this._cfgs.type;!a||a==="trend"||a==="simple"?(i[0]=this._cfgs.slider.start,i[1]=this._cfgs.slider.end):a==="tick"&&(i[0]=this._cfgs.tick.start,i[1]=this._cfgs.tick.end)}var o=null,s=this._cfgs.type;if(s==="trend"||s==="simple"?o=this._cfgs.trend.data:s==="tick"&&(o=this._cfgs.tick.data),!o||o.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var l=this.get("rangeChange"),u=this.get("graph"),h=Math.round(o.length*i[0]),c=Math.round(o.length*i[1]);c=c>=o.length?o.length-1:c,h=h>=o.length?o.length-1:h;var f=(r=this._cfgs.tick)===null||r===void 0?void 0:r.tickLabelFormatter,d=f?f(o[h]):o[h].date,v=f?f(o[c]):o[c].date;if(s!=="tick"){var p=this.get("timebar");p.setText(d,v)}if(l)l(u,d,v);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=u.get("data"));var g=this.get("filterItemTypes"),m=this.get("changeData"),y=this.get("getDate"),_=this.get("shouldIgnore"),x=o[h].date,S=o[c].date;if(m||m===void 0){var w=this.cacheGraphData.nodes,b=this.cacheGraphData.edges,E={},T={};u.getNodes().forEach(function(C){return E[C.getID()]=!0}),u.getEdges().forEach(function(C){return T[C.getID()]=!0}),g.includes("node")&&(w==null||w.forEach(function(C){var A=+((y==null?void 0:y(C))||C.date),M=A>=x&&A<=S||(_==null?void 0:_("node",C,{min:x,max:S})),I=E[C.id];I&&!M?(u.removeItem(C.id),E[C.id]=!1):!I&&M&&(u.addItem("node",C),E[C.id]=!0)}),b==null||b.forEach(function(C){var A=E[C.source]&&E[C.target]||(_==null?void 0:_("edge",C,{min:x,max:S})),M=!!u.findById(C.id);M&&!A?(u.removeItem(C.id),T[C.id]=!1):!M&&A?(u.addItem("edge",C),T[C.id]=!0):M||(T[C.id]=!1)})),(this.get("filterEdge")||g.includes("edge"))&&(b==null||b.filter(function(C){var A=+((y==null?void 0:y(C))||C.date),M=A>=x&&A<=S||(_==null?void 0:_("edge",C,{min:x,max:S})),I=E[C.source]&&E[C.target],R=M&&I,k=T[C.id];k&&!R?(T[C.id]=!1,u.removeItem(C.id)):!k&&R&&(T[C.id]=!0,u.addItem("edge",C))}))}else g.includes("node")&&u.getNodes().forEach(function(C){var A=C.getModel();if(!(_!=null&&_("node",A,{min:x,max:S}))){var M=+((y==null?void 0:y(A))||A.date);M<x||M>S?u.hideItem(C):u.showItem(C)}}),(this.get("filterEdge")||g.includes("edge"))&&u.getEdges().forEach(function(C){var A=C.getModel();if(!(_!=null&&_("edge",A,{min:o[h].date,max:o[c].date}))){var M=+((y==null?void 0:y(A))||A.date);if(M<o[h].date||M>o[c].date)u.hideItem(C);else{var I=C.getSource().isVisible(),R=C.getTarget().isVisible();I&&R&&u.showItem(C)}}})}},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on(Oy,this.valueChangeListener)},e.prototype.destroy=function(){var t=this.get("graph");t.off("afterchangedata",this.changeData),t.off("afterrender",this.afterrenderListener),t.off(Oy,this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),n.prototype.destroy.call(this);var i=this.get("timeBarContainer");if(i){var a=this.get("container");a||(a=this.get("graph").get("container")),rr(a)&&(a=document.getElementById(a)),a===i&&(a=a.parentElement),a.removeChild(i)}},e}(zd);const qpr=Ypr;var Zpr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Kpr=gc.applyMatrix;function Jpr(n,e){var t,r;if(n.naturalWidth)t=n.naturalWidth,r=n.naturalHeight;else{var i=new Image;i.src=n.src,i.onload=function(){e&&e(i.width,i.height)}}return[t,r]}var Qpr=function(n){Zpr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,r=this._cfgs,i=r.graph;if(!this.destroyed){var a=this.get("container");rr(a)&&(a=document.getElementById(a));var o=zs("<div class=".concat(r.viewportClassName,`
style='position:absolute;
left:0;
top:0;
box-sizing:border-box;
border: 2px solid #1980ff;
cursor:move'
</div>`)),s=0,l=0,u=!1,h=0,c=0,f=0,d=0,v=0,p=0;a.addEventListener("mousedown",function(g){if(r.refresh=!1,g.target===o){var m=o.style;f=parseInt(m.width,10),d=parseInt(m.height,10);var y=t.get("width"),_=t.get("height");f>y||d>_||(p=i.getZoom(),v=t.get("ratio"),u=!0,s=g.clientX,l=g.clientY)}},!1),a.addEventListener("mousemove",function(g){if(!(!u||an(g.clientX)||an(g.clientY))){var m=t.get("width"),y=t.get("height"),_=o.style;h=parseInt(_.left,10),c=parseInt(_.top,10),f=parseInt(_.width,10),d=parseInt(_.height,10);var x=s-g.clientX,S=l-g.clientY;h-x<0?x=h:h-x+f>=m&&(x=0),c-S<0?S=c:c-S+d>=y&&(S=0),h-=x,c-=S,Di(o,{left:"".concat(h,"px"),top:"".concat(c,"px")}),i.translate(x*p/v,S*p/v),s=g.clientX,l=g.clientY}},!1),a.addEventListener("mouseleave",function(){u=!1,r.refresh=!0},!1),a.addEventListener("mouseup",function(){u=!1,r.refresh=!0},!1),this.set("viewport",o),a.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),r=this.get("width"),i=this.get("height"),a=this.get("graph"),o=a.get("width"),s=a.get("height"),l=o/s,u=a.getGroup(),h=u.getCanvasBBox(),c=[(h.minX+h.maxX)/2,(h.minY+h.maxY)/2],f=[h.maxX-h.minX,h.maxY-h.minY],d={centerX:c[0],centerY:c[1],width:0,height:0,minX:0,minY:0};h[0]/h[1]>l?(d.width=f[0],d.height=d.width/l):(d.height=f[1],d.width=d.height*l),d.minX=c[0]-d.width/2,d.minY=c[1]-d.height/2;var v=u.getMatrix();v||(v=[1,0,0,0,1,0,0,0,1]);var p=Foe([1,0,0,0,1,0,0,0,1],v),g=Kpr({x:d.minX,y:d.minY},p),m=a.getCanvasByPoint(g.x,g.y),y=this.get("viewport");y||this.initViewport();var _=o/d.width,x=_*r,S=_*i,w=r*-m.x/d.width,b=i*-m.y/d.height,E=w+x,T=b+S;w<0&&(x+=w,w=0),E>r&&(x=x-(E-r)),b<0&&(S+=b,b=0),T>i&&(S=S-(T-i)),this.set("ratio",t);var C="".concat(w,"px"),A="".concat(b,"px");Di(y,{left:C,top:A,width:"".concat(x,"px"),height:"".concat(S,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,r=t.get("graph"),i=r.get("width"),a=r.get("height"),o=a/i,s=t.get("className"),l=t.get("container"),u=t.get("width"),h=t.get("height");!u&&!h&&(u=200),u?(h=o*u,t.set("height",h)):(u=1/o*h,t.set("width",u));var c=zs("<div class='".concat(s,"' style='width: ").concat(u,"px; height: ").concat(h,"px; overflow: hidden; position: relative;'></div>"));rr(l)&&(l=document.getElementById(l)),l?l.appendChild(c):r.get("container").appendChild(c),t.set("container",c);var f=zs('<div class="g6-minimap-container" style="position: relative; width: 100%; height: 100%; text-align: center; display: table;"></div>');c.appendChild(f);var d=zs('<span style="display: table-cell; vertical-align: middle; "></span>');f.appendChild(d),t.set("containerDOM",f),t.set("containerSpan",d);var v=zs('<img alt="" src="'.concat(this.get("graphImg"),'" style="display: inline-block; user-select: none;" draggable="false" />'));t.set("imgDOM",v),t.updateImgSize(),d.appendChild(v),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,r=t.get("imgDOM"),i=t.get("width"),a=t.get("height");r.onload=function(){var o=Jpr(r);o[0]>o[1]?r.width=i:r.height=a}},e.prototype.updateCanvas=function(){var t=this.get("refresh");if(!!t){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var i=this.get("width"),a=r.get("canvas").getCanvasBBox(),o=a.width,s=i/o;this.set("ratio",s),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var r=this,i=r.get("imgDOM");i.remove(),r.set("graphImg",t);var a=zs('<img alt="" src="'.concat(t,'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>'));r.set("imgDOM",a),a.src=t,r.updateImgSize();var o=r.get("containerSpan");o.appendChild(a),r.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(zd);const egr=Qpr;var tgr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cte=globalThis&&globalThis.__assign||function(){return cte=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},cte.apply(this,arguments)},rgr=gc.distance,p2e=.05,g2e={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:1,fill:"#fff"},ngr=function(n){tgr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{type:"both",trigger:"mousemove",r:60,delegateStyle:Xi(g2e),showLabel:"edge",scaleRBy:"wheel"}},e.prototype.getEvents=function(){var t;switch(this.get("trigger")){case"click":t={click:"filter"};break;case"drag":t={click:"createDelegate"};break;default:t={mousemove:"filter"};break}return t},e.prototype.init=function(){var t=this,r=t.get("showLabel"),i=r==="node"||r==="both",a=r==="edge"||r==="both";t.set("showNodeLabel",i),t.set("showEdgeLabel",a);var o=t.get("shouldShow");o||t.set("shouldShow",function(){return!0})},e.prototype.createDelegate=function(t){var r=this,i=r.get("delegate");(!i||i.destroyed)&&(r.filter(t),i=r.get("delegate"),i.on("dragstart",function(a){}),i.on("drag",function(a){r.filter(a)}),this.get("scaleRBy")==="wheel"&&i.on("mousewheel",function(a){r.scaleRByWheel(a)}))},e.prototype.scaleRByWheel=function(t){var r=this;if(!(!t||!t.originalEvent)){t.preventDefault&&t.preventDefault();var i=r.get("graph"),a,o=r.get("delegate"),s=o?{x:o.attr("x"),y:o.attr("y")}:void 0;s||i.getPointByClient(t.clientX,t.clientY),t.originalEvent.wheelDelta<0?a=1-p2e:a=1/(1-p2e);var l=r.get("maxR"),u=r.get("minR"),h=r.get("r");(h>(l||i.get("height"))&&a>1||h<(u||i.get("height")*.05)&&a<1)&&(a=1),h*=a,r.set("r",h),r.filter(t)}},e.prototype.filter=function(t){var r=this,i=r.get("graph"),a=i.getNodes(),o={},s=r.get("r"),l=r.get("type"),u={x:t.x,y:t.y};r.updateDelegate(u,s);var h=r.get("shouldShow"),c=r.get("vShapes");c&&c.forEach(function(m){m.remove(),m.destroy()}),c=[],a.forEach(function(m){var y=m.getModel(),_=y.x,x=y.y;rgr({x:_,y:x},u)<s&&(o[y.id]=m)});var f=i.getEdges(),d=[];f.forEach(function(m){var y=m.getModel(),_=y.source,x=y.target;h(y)&&(l==="only-source"||l==="one"?o[_]&&!o[x]&&d.push(m):l==="only-target"||l==="one"?o[x]&&!o[_]&&d.push(m):l==="both"&&o[_]&&o[x]&&d.push(m))});var v=r.get("showNodeLabel"),p=r.get("showEdgelabel"),g=i.get("group");d.forEach(function(m){var y=m.get("group").get("children");y.forEach(function(_){var x=_.get("type"),S=g.addShape(x,{attrs:_.attr()});c.push(S),v&&x==="text"&&S.set("visible",!0)})}),Object.keys(o).forEach(function(m){var y=o[m],_=y.get("group").clone();if(g.add(_),c.push(_),p)for(var x=_.get("children"),S=0;S<x.length;S++){var w=x[S];w.get("type")==="text"&&w.set("visible",!0)}}),r.set("vShapes",c)},e.prototype.updateParams=function(t){var r=this,i=t.r,a=t.trigger,o=t.minR,s=t.maxR,l=t.scaleRBy,u=t.showLabel,h=t.shouldShow;if(isNaN(t.r)||r.set("r",i),isNaN(s)||r.set("maxR",s),isNaN(o)||r.set("minR",o),(a==="mousemove"||a==="click")&&r.set("trigger",a),l==="wheel"||l==="unset"){r.set("scaleRBy",l),r.get("delegate").remove(),r.get("delegate").destroy();var c=r.get("dPercentText");c&&(c.remove(),c.destroy())}(u==="node"||u==="both")&&r.set("showNodeLabel",!0),(u==="edge"||u==="both")&&r.set("showEdgeLabel",!0),h&&r.set("shouldShow",h)},e.prototype.updateDelegate=function(t,r){var i=this,a=i.get("graph"),o=i.get("delegate");if(!o||o.destroyed){var s=a.get("group"),l=i.get("delegateStyle")||g2e;o=s.addShape("circle",{attrs:cte({r,x:t.x,y:t.y},l),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&this.get("scaleRBy")==="wheel"&&o.on("mousewheel",function(u){i.scaleRByWheel(u)})}else o.attr({x:t.x,y:t.y,r});i.set("delegate",o)},e.prototype.clear=function(){var t=this,r=t.get("vShapes");r&&r.forEach(function(a){a.remove(),a.destroy()}),r=[],t.set("vShapes",r);var i=t.get("delegate");i&&!i.destroyed&&(i.remove(),i.destroy())},e.prototype.destroy=function(){this.clear()},e}(zd);const igr=ngr;var agr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ogr=gc.pointLineDistance,sgr={stroke:"#FA8C16",lineWidth:1},lgr=function(n){agr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{line:sgr,itemAlignType:"center",tolerance:5,horizontalLines:{},verticalLines:{},alignLines:[]}},e.prototype.init=function(){},e.prototype.getEvents=function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd"}},e.prototype.onDragStart=function(){this.initBoxLine()},e.prototype.onDrag=function(t){var r=t.item,i=r.get("delegateShape")||r,a=i.getBBox(),o=r.getModel(),s=o.x-a.x,l=o.y-a.y;this.show({x:a.minX+s,y:a.minY+l},{width:a.width,height:a.height})},e.prototype.onDragEnd=function(){this.destory()},e.prototype.initBoxLine=function(){var t=this._cfgs,r=t.horizontalLines,i=t.verticalLines,a=t.itemAlignType,o=this.get("graph"),s=o.getNodes();s.forEach(function(l){var u=l.getBBox(),h=l.get("id");a===!0||a==="horizontal"?(r["".concat(h,"tltr")]=[u.minX,u.minY,u.maxX,u.minY,l],r["".concat(h,"lcrc")]=[u.minX,u.centerY,u.maxX,u.centerY,l],r["".concat(h,"blbr")]=[u.minX,u.maxY,u.maxX,u.maxY,l]):a==="center"&&(r["".concat(h,"lcrc")]=[u.minX,u.centerY,u.maxX,u.centerY,l]),a===!0||a==="vertical"?(i["".concat(h,"tlbl")]=[u.minX,u.minY,u.minX,u.maxY,l],i["".concat(h,"tcbc")]=[u.centerX,u.minY,u.centerX,u.maxY,l],i["".concat(h,"trbr")]=[u.maxX,u.minY,u.maxX,u.maxY,l]):a==="center"&&(i["".concat(h,"tcbc")]=[u.centerX,u.minY,u.centerX,u.maxY,l])})},e.prototype.show=function(t,r){var i=_n({},t);return this.itemAlign(t,r,i),t},e.prototype.itemAlign=function(t,r,i){var a=this,o=this._cfgs,s=o.horizontalLines,l=o.verticalLines,u=o.tolerance,h={x:i.x+r.width/2,y:i.y},c={x:i.x+r.width/2,y:i.y+r.height/2},f={x:i.x+r.width/2,y:i.y+r.height},d={x:i.x,y:i.y+r.height/2},v={x:i.x+r.width,y:i.y+r.height/2},p=[],g=[],m=null;if(this.clearAlignLine(),At(s,function(_){_[4].isVisible&&(p.push(a.getLineDisObject(_,h)),p.push(a.getLineDisObject(_,c)),p.push(a.getLineDisObject(_,f)))}),At(l,function(_){_[4].isVisible&&(g.push(a.getLineDisObject(_,d)),g.push(a.getLineDisObject(_,c)),g.push(a.getLineDisObject(_,v)))}),p.sort(function(_,x){return _.dis-x.dis}),g.sort(function(_,x){return _.dis-x.dis}),p.length!==0&&p[0].dis<u){t.y=p[0].line[1]-p[0].point.y+i.y,m={type:"item",horizontals:[p[0]]};for(var y=1;y<3;y++)p[0].dis===p[y].dis&&m.horizontals.push(p[y])}if(g.length!==0&&g[0].dis<u){t.x=g[0].line[0]-g[0].point.x+i.x,m?m.verticals=[g[0]]:m={type:"item",verticals:[g[0]]};for(var y=1;y<3;y++)g[0].dis===g[y].dis&&m.verticals.push(g[y])}m&&(m.bbox=r,this.addAlignLine(m))},e.prototype.addAlignLine=function(t){var r=t.bbox,i=t.type,a=t.horizontals,o=t.verticals,s=this._cfgs,l=s.line,u=s.alignLines,h=this.get("graph"),c=h.get("group");i==="item"&&(a&&At(a,function(f){var d=f.line,v=f.point,p=(d[0]+d[2])/2,g,m;v.x<p?(g=v.x-r.width/2,m=Math.max(d[0],d[2])):(g=v.x+r.width/2,m=Math.min(d[0],d[2]));var y=_n({x1:g,y1:d[1],x2:m,y2:d[1]},l),_=c.addShape("line",{attrs:y,capture:!1});u.push(_)}),o&&At(o,function(f){var d=f.line,v=f.point,p=(d[1]+d[3])/2,g,m;v.y<p?(g=v.y-r.height/2,m=Math.max(d[1],d[3])):(g=v.y+r.height/2,m=Math.min(d[1],d[3]));var y=_n({x1:d[0],y1:g,x2:d[0],y2:m},l),_=c.addShape("line",{attrs:y,capture:!1});u.push(_)}))},e.prototype.getLineDisObject=function(t,r){return{line:t,point:r,dis:ogr(t,r)}},e.prototype.getContainer=function(){return this.get("container")},e.prototype.clearAlignLine=function(){var t=this._cfgs.alignLines;At(t,function(r){r.remove()}),t.length=0},e.prototype.destory=function(){var t=this._cfgs,r=t.horizontalLines,i=t.verticalLines,a=this.get("graph"),o=a.getNodes();o.forEach(function(s){var l=s.get("id");delete r["".concat(l,"tltr")],delete r["".concat(l,"lcrc")],delete r["".concat(l,"blbr")],delete i["".concat(l,"tlbl")],delete i["".concat(l,"tcbc")],delete i["".concat(l,"trbr")]}),this.clearAlignLine()},e}(zd);const ugr=lgr;var hgr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ll=globalThis&&globalThis.__assign||function(){return ll=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ll.apply(this,arguments)},cgr=["click","mouseenter"],fgr=function(n){hgr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{data:{},position:"top",padding:8,margin:8,offsetX:0,offsetY:0,layout:"horizontal",flipPage:!1,containerStyle:{},align:void 0,horiSep:8,vertiSep:8,filter:{enable:!1,trigger:"click"}}},e.prototype.init=function(){this.formatArray("padding"),this.formatArray("margin");var t=this.get("filter")||{},r=t.multiple;r&&t.trigger==="mouseenter"&&this.set("multiple",!1);var i=this.get("align");if(!i){var a=this.get("position").split("-");a.includes("left")&&(i="left"),a.includes("right")?i="right":i="center",this.set("align",i)}var o=this.get("graph"),s=o.get("container"),l=zs(`<div class='g6-legend-container' style="position: absolute;"></div>`);s.appendChild(l),this.set("container",l);var u=this.render();Di(l,this.getContainerPos(u)),this.bindEvents()},e.prototype.getContainerPos=function(t){t===void 0&&(t=[0,0]);var r=this,i=r.get("graph"),a=this.get("offsetX"),o=this.get("offsetY"),s=this.get("margin"),l=this.get("position").split("-"),u={top:0,right:1,bottom:2,left:3},h=0,c=0,f={left:(i.getWidth()-t[0])/2+h,top:(i.getHeight()-t[1])/2+c};return l.forEach(function(d){var v=s[u[d]],p=d;switch(d){case"top":v+=c;break;case"left":v+=h;break;case"bottom":v=i.getHeight()-t[1]-v+c,p="top";break;default:v=i.getWidth()-t[0]-v+h,p="left";break}f[p]=v}),f.top+=o+i.getContainer().offsetTop,f.left+=a+i.getContainer().offsetLeft,Object.keys(f).forEach(function(d){f[d]="".concat(f[d],"px")}),f},e.prototype.bindEvents=function(){var t=this,r=t.get("filter");if(!(!r||!r.enable)){var i=r.trigger||"click";cgr.includes(i)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),i="click");var a=t.get("legendCanvas");i==="mouseenter"?(a.on("node-container:mouseenter",function(o){return t.filterData(o)}),a.on("node-container:mouseleave",function(o){t.clearFilter(),t.clearActiveLegend()})):(a.on("node-container:click",function(o){return t.filterData(o)}),a.on("click",function(o){o.target&&o.target.isCanvas&&o.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var r=this.render();Di(this.get("container"),this.getContainerPos(r))},e.prototype.activateLegend=function(t){var r=this.get("filter"),i=r==null?void 0:r.multiple;i||this.clearActiveLegend();var a=t.get("parent");a.get("active")?(a.set("active",!1),this.findLegendItemsByState("active").length&&a.set("inactive",!0)):(a.set("inactive",!1),a.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(c){c.set("inactive",!0)}):this.clearActiveLegend();var o=(r==null?void 0:r.legendStateStyles)||{},s=(o==null?void 0:o.inactive)||{opacity:.5,"text-shape":{opacity:.5}},l=s["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(c){var f=c.get("children"),d=f[0],v=f[1];d.attr(ll(ll({},d.get("oriAttrs")),s)),v.attr(ll(ll({},v.get("oriAttrs")),l))});var u=(o==null?void 0:o.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},h=u["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(c){var f=c.get("children"),d=f[0],v=f[1];d.attr(ll(ll({},d.get("oriAttrs")),u)),v.attr(ll(ll({},v.get("oriAttrs")),h))})},e.prototype.findLegendItemsByState=function(t,r,i){r===void 0&&(r="all"),i===void 0&&(i=!0);var a=this.get("legendCanvas").find(function(l){return l.get("name")==="root"}),o=a.find(function(l){return l.get("name")==="node-group"}),s=a.find(function(l){return l.get("name")==="edge-group"});return r==="node"?o.get("children").filter(function(l){return!!l.get(t)===i}):r==="edge"?s.get("children").filter(function(l){return!!l.get(t)===i}):o.get("children").filter(function(l){return!!l.get(t)===i}).concat(s.get("children").filter(function(l){return!!l.get(t)===i}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas"),r=t.find(function(a){return a.get("name")==="root"}),i=[r.find(function(a){return a.get("name")==="node-group"}),r.find(function(a){return a.get("name")==="edge-group"})];i.forEach(function(a){a.get("children").forEach(function(o){o.set("active",!1),o.set("inactive",!1);var s=o.get("children"),l=s[0],u=s[1];l.attr(l.get("oriAttrs")),u.attr(u.get("oriAttrs"))})})},e.prototype.filterData=function(t){var r=this.get("filter"),i=r==null?void 0:r.filterFunctions;if(!(!r||!i)){var a=this.get("legendCanvas"),o=this.get("graph"),s=r.graphActiveState||"active",l=r.graphInactiveState||"inactive",u=r.multiple;this.clearFilter(),u||this.clearActiveLegend(),this.activateLegend(t.target);var h=a.find(function(m){return m.get("name")==="root"}),c=h.find(function(m){return m.get("name")==="node-group"}),f=h.find(function(m){return m.get("name")==="edge-group"}),d=c.get("children").filter(function(m){return m.get("active")}),v=f.get("children").filter(function(m){return m.get("active")}),p=0,g=["getNodes","getEdges"];g.forEach(function(m){o[m]().forEach(function(y){var _=!1,x=m==="getNodes"?d:v;x.forEach(function(S){var w=i[S.get("id")];_=_||w(y.getModel())}),_?(o.setItemState(y,l,!1),o.setItemState(y,s,!0),p++):(o.setItemState(y,s,!1),o.setItemState(y,l,!0))})}),p||g.forEach(function(m){o[m]().forEach(function(y){o.clearItemStates(y,[l])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),r=this.get("filter");if(!!r){var i=r.graphActiveState||"active",a=r.graphInactiveState||"inactive";t.getNodes().forEach(function(o){t.clearItemStates(o,[i,a])}),t.getEdges().forEach(function(o){t.clearItemStates(o,[i,a])})}},e.prototype.render=function(){var t=this;this.processData();var r=this.get("legendCanvas");r?r.clear():r=new M1({container:this.get("container"),width:200,height:200});var i=r.addGroup({name:"root"}),a=i.addGroup({name:"node-group"}),o=i.addGroup({name:"edge-group"});this.set("legendCanvas",r);var s=this.get("itemsData"),l=["nodes","edges"],u=[a,o];l.forEach(function(D,G){s[D].forEach(function(W){var z,V=u[G].addGroup({id:W.id,name:"node-container"}),q,Y=W.type,le=t.getShapeSize(W),j=le.width,Q=le.height,ie=le.r,oe=t.getStyle(D.substr(0,4),W);switch(W.type){case"circle":q={r:ie,x:0,y:0};break;case"rect":q={width:j,height:Q,x:-j/2,y:-Q/2};break;case"ellipse":q={rx:j,ry:Q,x:0,y:0},Y="ellipse";break;case"line":q={x1:-j/2,y1:0,x2:j/2,y2:0},Y="line";break;case"quadratic":q={path:[["M",-j/2,0],["Q",0,j/2,j/2,0]]},Y="path";break;case"cubic":q={path:[["M",-j/2,0],["C",-j/6,j/2,j/6,-j/2,j/2,0]]},Y="path";break;case"diamond":q={path:[["M",0,-Q],["L",j,0],["L",0,Q],["L",-j,0],["Z"]]},Y="path";break;case"triangle":q={path:[["M",-j,Q],["L",0,-Q],["L",j,Q],["Z"]]},Y="path";break;case"star":q={path:gc.getStarPath(ie*3,ie*1.2)},Y="path";break;default:q={r:ie,x:0,y:0};break}var se=V.addShape(Y,{attrs:ll(ll({},q),oe),name:"".concat(W.type,"-node-keyShape"),oriAttrs:ll({opacity:1},oe)});if(W.label){var me=se.getBBox(),Ce=((z=W.labelCfg)===null||z===void 0?void 0:z.style)||{},Le=ll({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},Ce);V.addShape("text",{attrs:ll({x:me.maxX+4,y:0,text:W.label},Le),className:"legend-label",name:"".concat(W.type,"-node-text"),oriAttrs:Le})}})});var h=this.get("padding"),c,f=i.find(function(D){return D.get("name")==="title-container"}),d={height:0,maxY:0,width:0};if(this.get("title")){f||(f=i.addGroup({name:"title-container"}));var v={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:h[0]},p=this.get("titleConfig")||{},g=Object.assign(v,p.style||{});c=f.addShape("text",{attrs:ll({text:this.get("title")},g)}),d=f.getCanvasBBox(),f.setMatrix([1,0,0,0,1,0,p.offsetX,p.offsetY,1])}this.layoutItems();var m=i.getCanvasBBox(),y=a.getCanvasBBox(),_=y.minX<0?Math.abs(y.minX)+h[3]:h[3],x=d.maxY<y.minY?Math.abs(d.maxY-y.minY)+h[0]:d.maxY+h[0],S=[1,0,0,0,1,0,_,x,1];a.setMatrix(S),m=i.getCanvasBBox();var w=[m.minX+m.width+h[1],m.minY+m.height+h[2]];if(c){var p=ll({position:"center",offsetX:0,offsetY:0},this.get("titleConfig"));d=f.getCanvasBBox();var b=f.getMatrix()||[1,0,0,0,1,0,0,0,1];p.position==="center"?b[6]=w[0]/2+p.offsetX:p.position==="right"?(b[6]=w[0]-h[3]+p.offsetX,c.attr({textAlign:"right"})):(b[6]=h[3]+p.offsetX,c.attr({textAlign:"left"})),f.setMatrix(b),d=f.getCanvasBBox(),_=y.minX<0?Math.abs(y.minX)+h[3]:h[3],x=y.minY<d.maxY?Math.abs(d.maxY-y.minY)+h[0]:d.maxY+h[0],S=[1,0,0,0,1,0,_,x,1],a.setMatrix(S);var E=[1,0,0,0,1,0,_,x,1];this.get("layout")==="vertical"?E[6]+=y.maxX+this.get("horiSep"):E[7]+=y.maxY+this.get("vertiSep"),o.setMatrix(E)}else{y=a.getCanvasBBox();var T=[1,0,0,0,1,0,0,0,1];this.get("layout")==="vertical"?T[6]+=S[6]+y.maxX+this.get("horiSep"):T[7]+=S[7]+y.maxY+this.get("vertiSep"),o.setMatrix(T)}m=i.getCanvasBBox(),y=a.getCanvasBBox(),S=a.getMatrix()||[1,0,0,0,1,0,0,0,1];var C=o.getMatrix()||[1,0,0,0,1,0,0,0,1],A=o.getCanvasBBox();w=[Math.max(y.width+S[6],A.width+C[6])+h[1],Math.max(y.height+S[7],A.height+C[7])+h[2]],r.changeSize(w[0],w[1]);var M=this.get("containerStyle"),I=i.getMatrix()||[1,0,0,0,1,0,0,0,1],R=gc.invertMatrix({x:0,y:0},I),k=i.addShape("rect",{attrs:ll({x:R.x+(M.lineWidth||1),y:R.y+(M.lineWidth||1),width:w[0]-2*(M.lineWidth||1),height:w[1]-2*(M.lineWidth||1),fill:"#f00",stroke:"#000",lineWidth:1,opacity:.5},M),name:"legend-back-rect",capture:!1});return k.toBack(),w},e.prototype.layoutItems=function(){var t=this.get("legendCanvas"),r=this.get("horiSep"),i=this.get("vertiSep"),a=this.get("layout"),o=this.get("align"),s=[0,0],l=t.find(function(_){return _.get("name")==="root"}),u=l.find(function(_){return _.get("name")==="node-group"}),h=l.find(function(_){return _.get("name")==="edge-group"}),c={min:0,max:-1/0};u.get("children").forEach(function(_,x){x===0&&(c.min=s[0]);var S=_.get("children")[0],w=_.getCanvasBBox(),b=S.getBBox(),E=b.width,T=b.height,C=0,A=0;a==="vertical"?(C=s[1],A=s[0]+E/2,s[0]=A+w.height+i,w.maxX+C+E/2):(C=s[0]+E/2,A=s[1],s[0]=C+w.width+r,w.maxY+A+T/2),s[0]>c.max&&(c.max=s[0]),_.setMatrix([1,0,0,0,1,0,C,A,1])});var f=c.max-c.min,d={min:0,max:-1/0},v=u.getCanvasBBox();s[0]=0,s[1]=a==="vertical"?v.maxX+r:v.maxY+i,h.get("children").forEach(function(_,x){x===0&&(d.min=s[0]);var S=_.get("children")[0],w=_.getCanvasBBox(),b=S.getBBox(),E=b.width,T=b.height,C=0,A=0;a==="vertical"?(C=s[1],A=s[0],s[0]=A+w.height+i,_.setMatrix([1,0,0,0,1,0,0,A+T/2,1])):(C=s[0],A=s[1],s[0]=C+w.width+r,_.setMatrix([1,0,0,0,1,0,C+E/2,0,1])),s[0]>d.max&&(d.max=s[0])});var p=d.max-d.min;if(o&&o!==""&&o!=="left"){var g=f-p,m=o==="center"?Math.abs(g)/2:Math.abs(g),y=g<0?u:h;y.get("children").forEach(function(_){var x=_.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?x[7]+=m:x[6]+=m,_.setMatrix(x)})}},e.prototype.processData=function(){var t=this.get("data"),r={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(i,a){return i.order-a.order}),t.nodes.forEach(function(i){var a,o,s,l,u,h=i.size||[((a=i.style)===null||a===void 0?void 0:a.width)||((o=i.style)===null||o===void 0?void 0:o.r)||8,((s=i.style)===null||s===void 0?void 0:s.height)||((l=i.style)===null||l===void 0?void 0:l.r)||8],c=((u=i.labelCfg)===null||u===void 0?void 0:u.style)||{};r.nodes.push({id:i.id||vm(),type:i.type||"circle",style:ll({},i.style),order:i.order,label:i.label,itemType:"node",size:h,labelCfg:{position:"right",style:ll({fontFamily:"Arial"},c)}})})),t.edges&&(t.edges.sort(function(i,a){return i.order-a.order}),t.edges.forEach(function(i){var a,o,s=i.type||"line";i.type==="cubic-horizontal"&&(s="cubic");var l=((a=i.labelCfg)===null||a===void 0?void 0:a.style)||{},u=i.size||[((o=i.style)===null||o===void 0?void 0:o.width)||8,1];r.edges.push({id:i.id||vm(),type:s,size:u,style:ll({lineWidth:vn(u)?u[1]:1},i.style),order:i.order,label:i.label,itemType:"edge",labelCfg:{position:"right",style:ll({fontFamily:"Arial"},l)}})})),this.set("itemsData",r)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var r=this.get(t);if(on(r))this.set(t,[r,r,r,r]);else if(vn(r))switch(r.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[r[0],r[0],r[0],r[0]]);break;case 2:this.set(t,[r[0],r[1],r[0],r[1]]);break;case 3:this.set(t,[r[0],r[1],r[2],r[1]]);break}return this.get(t)},e.prototype.getShapeSize=function(t){var r,i,a;return t.size&&(vn(t.size)?(r=t.size[0],i=t.size[1]||t.size[0],a=t.size[0]/2):on(t.size)&&(r=t.size,i=t.size,a=t.size/2)),t.style&&(t.style.width&&(r=t.style.width),t.style.height&&(i=t.style.height),t.style.r&&(a=t.style.r)),a||(a=5),r||(r=a),i||(i=a),{width:r,height:i,r:a}},e.prototype.getStyle=function(t,r){var i=t==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return ll(ll({},i),r.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");t==null||t.destroy();var r=this.get("graph"),i=r.get("container"),a=this.get("container");i.removeChild(a)},e}(zd);const dgr=fgr;var vgr=globalThis&&globalThis.__extends||function(){var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},n(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ip=globalThis&&globalThis.__assign||function(){return ip=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ip.apply(this,arguments)},y2e=globalThis&&globalThis.__rest||function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t};typeof document<"u"&&cT.exports(`
.g6-annotation-container {
background-color: rgba(255, 255, 255, 0.3);
padding: 8px;
}
.g6-annotation-wrapper {
background-color: #fff;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.85);
}
.g6-annotation-header-wapper {
height: fit-content;
width: 100%;
background-color: #5B8FF9;
display: inline-flex;
cursor: move;
}
.g6-annotation-title {
margin: 4px 40px 4px 8px;
cursor: text;
min-width: 32px;
}
.g6-annotation-collapse {
margin: 4px;
cursor: pointer;
}
.g6-annotation-expand {
margin: 4px;
cursor: pointer;
}
.g6-annotation-close {
margin: 4px 8px 4px 0;
cursor: pointer;
}
.g6-annotation-content {
padding: 8px;
width: fit-content;
cursor: text;
word-break: break-all;
min-width: 32px;
}
.g6-annotation-title-input-wrapper {
margin: 4px 40px 4px 8px;
}
.g6-annotation-content-input {
height: 100%;
word-break: break-all;
}
.g6-annotation-content-input-wrapper {
margin: 8px;
height: 100%;
}
`);var m2e="canvas-annotation",pgr=function(n){vgr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{trigger:"click",editable:!0,itemHighlightState:"highlight",linkHighlightStyle:{shadowColor:"#5B8FF9",shadowBlur:10},cardCfg:{minHeight:60,width:"fit-content",height:"fit-content",collapseType:"minimize",closeType:"hide",borderRadius:5,maxTitleLength:20}}},e.prototype.getEvents=function(){var t={viewportchange:"updateLinks",afterlayout:"updateLinks",aftergraphrefreshposition:"updateLinks",afterupdateitem:"updateLink",afterchangedata:"onGraphDataChange",afteritemvisibilitychange:"onGraphItemVisibilityChange"};switch(this.get("trigger")){case"click":t=ip(ip({},t),{"node:click":"showAnnotation","edge:click":"showAnnotation"})}return t},e.prototype.getDOMContent=function(t){if(!this.destroyed){var r=t.collapsed,i=t.maxWidth,a=t.title,o=a===void 0?"":a,s=t.content,l=s===void 0?"":s,u=t.borderRadius,h=u===void 0?5:u,c=r?"<p class='g6-annotation-expand'>+</p>":"<p class='g6-annotation-collapse'>-</p>",f=r?"":" <p class='g6-annotation-content'>".concat(l,"</p>"),d="<p class='g6-annotation-close'>x</p>",v=r?"".concat(h,"px"):"".concat(h,"px ").concat(h,"px 0 0");return'<div class="g6-annotation-wrapper" style="border-radius: '.concat(h,"px; max-width: ").concat(i,`px">
<div
class="g6-annotation-header-wapper"
style="border-radius: `).concat(v,`;"
>
<h4 class='g6-annotation-title'>`).concat(o,`</h4>
`).concat(c,`
`).concat(d,`
</div>
`).concat(f,`
</div>`)}},e.prototype.init=function(){var t=this;if(!t.destroyed){var r=t.get("graph"),i=r.getContainer(),a=t.get("container"),o=this.get("containerCfg");o?(a=this.createContainer(),i.appendChild(a)):a=i,this.set("container",a);var s=i.getBoundingClientRect(),l=new M1({container:i,width:s.right-s.left,height:s.bottom-s.top});Di(l.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",U3(function(){return t.resizeCanvas(t)},100));var u=l.addGroup({id:"annotation-link-group"});t.set("linkGroup",u),t.set("canvas",l),t.get("getTitle")||t.set("getTitle",function(c){var f,d=((f=c==null?void 0:c.getModel)===null||f===void 0?void 0:f.call(c))||{},v=d.label,p=d.id;return v||p||"-"}),t.get("getContent")||t.set("getContent",function(c){var f,d;if(!c)return"-";var v=((f=c.getModel)===null||f===void 0?void 0:f.call(c))||{},p=v.label,g=v.id,m=(d=c.getType)===null||d===void 0?void 0:d.call(c),y=m?"".concat(m,": "):"";return"".concat(y).concat(p||g||"")});var h=t.get("defaultData");h&&this.readData(h)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var r=this.get("containerCfg"),i=this.get("graph"),a=i.getContainer(),o=a.getBoundingClientRect(),s=o.left,l=o.right,u=o.top,h=o.bottom,c=h-u,f=l-s,d=r.position,v=d===void 0?"top":d,p=r.offsetX,g=p===void 0?0:p,m=r.offsetY,y=m===void 0?0:m,_=y2e(r,["position","offsetX","offsetY"]),x=r.height,S=x===void 0?"fit-content":x,w=r.width,b=w===void 0?i.getWidth():w;S==="100%"&&(S=c),b==="100%"&&(b=f);var E="unset",T="unset",C={};switch(v){case"right":E="".concat(c,"px"),C={top:0,right:0},C.right+=s+g,C.top+=u+y;break;case"bottom":T="".concat(f,"px"),C={bottom:0,left:0},C.left+=s+g,C.bottom+=u+y;break;case"top":T="".concat(f,"px");case"left":E="".concat(c,"px");default:C={top:0,left:0},C.left+=s+g,C.top+=u+y;break}Object.keys(C).forEach(function(M){C[M]="".concat(C[M],"px")});var A=zs("<div class='".concat(r.className," g6-annotation-container'></div>"));return Di(A,ip(ip({position:"absolute",display:v==="top"||v==="bottom"?"inline-flex":"unset",width:on(b)?"".concat(b,"px"):b,height:on(S)?"".concat(S,"px"):S,maxHeight:E,maxWidth:T,overflow:"scroll"},C),_)),a.appendChild(A),A.addEventListener("scroll",function(M){t.updateLinks()}),A}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(!(!t||t.destroyed)){var r=t.get("container").getBoundingClientRect(),i=r.right-r.left,a=r.bottom-r.top;t.get("canvas").changeSize(i,a),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var r=t||this,i=r.get("cardInfoMap")||{},a=r.get("graph"),o=a.getPointByCanvas(0,0),s=a.getPointByCanvas(a.getWidth(),a.getHeight()),l=a.getClientByPoint(o.x,o.y),u=l.x,h=l.y,c=a.getClientByPoint(s.x,s.y),f=c.x,d=c.y;Object.values(i).forEach(function(v){var p=v.card;if(!!p){var g=p.style,m=mb(g.left),y=mb(g.top),_=p.getBoundingClientRect(),x=_.width,S=_.height,w=m,b=y;m+x>f-u&&(w=f-u-x),m<0&&(w=0),y+S>d-h&&(b=d-h-S),y<0&&(b=0),Di(p,{left:"".concat(w,"px"),top:"".concat(b,"px")})}}),r.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var r=t.item;this.toggleAnnotation(r)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var r=t.get("cardInfoMap")||{};Object.keys(r).forEach(function(i){t.hideCard(i)})}},e.prototype.toggleAnnotation=function(t,r){var i,a;r===void 0&&(r={});var o=this;if(!o.destroyed){var s=o.get("cardInfoMap")||{},l=o.get("graph"),u=o.get("container"),h=o.get("containerCfg"),c=Object.assign({},o.get("cardCfg")||{},r),f=c.minHeight,d=c.minWidth,v=c.width,p=c.height,g=c.collapsed,m=g===void 0?!1:g,y=c.x,_=c.y,x=c.title,S=c.content,w=c.maxTitleLength,b=c.defaultBegin,E=y2e(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),T=o.get("linkGroup"),C=this.get("rows")||[[]],A=(i=t.isCanvas)===null||i===void 0?void 0:i.call(t),M=A?m2e:t.getID(),I=s[M]||{},R=I.card,k=I.link,D=I.x,G=I.y,W=I.title,z=I.content,V=this.get("getTitle"),q=this.get("getContent"),Y=this.get("getContentPlaceholder")||function(){return""},le=this.get("getTitlePlaceHolder")||function(){return""},j=Y(t),Q=le(t),ie=zs(this.getDOMContent(ip({itemId:M,collapsed:m,title:((a=W||x||(V==null?void 0:V(t)))===null||a===void 0?void 0:a.substr(0,w))||Q,content:z||S||(q==null?void 0:q(t))||j},E))),oe=on(f)?"".concat(f,"px"):f;Di(ie,{minHeight:m?"unset":oe,minWidth:on(d)?"".concat(d,"px"):d,height:p,width:v});var se=!!R;se?(k==null||k.remove(!0),u.replaceChild(ie,R)):u.appendChild(ie);var me;if(!h){if(me=u.getBoundingClientRect()||{},y!==void 0&&_!==void 0)D=y,G=_;else if(!se&&!A){var Ce=me.top,Le=b||{},re=Le.left,yt=Le.right,je=yt===void 0?16:yt,st=Le.top,Nt=st===void 0?8:st,Zt=Le.bottom,qe=je,ur=Nt;isNaN(re)||(qe=u.scrollWidth-re),isNaN(Zt)||(ur=u.scrollHeight-Zt);var Dt=on(d)?d:100;D=u.scrollWidth-ie.scrollWidth-(C.length-1)*Dt-qe;var ft=C[C.length-1],Oe=(ft[ft.length-1]||{}).bbox;G=(Oe==null?void 0:Oe.bottom)-Ce||ur}Di(ie,{position:"absolute",left:"".concat(D,"px"),top:"".concat(G,"px"),cusor:h?"unset":"move"})}this.bindListener(ie,M);var J=ie.getBoundingClientRect();if(!A){var We=NY(t,J,l,this.get("canvas")),Tt=this.get("linkStyle");k=T.addShape("path",{attrs:ip({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:We},Tt)})}if(s[M]=ip(ip({},s[M]||{}),{id:M,collapsed:m,card:ie,link:k,x:D,y:G,cardBBox:J,content:z||S,title:W||x,contentPlaceholder:j,titlePlaceholder:Q,isCanvas:A}),o.set("cardInfoMap",s),h)this.updateCardPositionsInConatainer(),this.updateLinks();else{var Qe=!isNaN(y)&&!isNaN(_);if(!se&&!A&&!Qe){var zt=me.bottom,mt=zt===void 0?0:zt,Ce=me.top;C[C.length-1].push({id:M,bbox:J}),J.top>mt-Ce-J.height-16&&C.push([]),this.set("rows",C)}}this.updateCardSize(M);var wt=this.get("onAnnotationChange");wt==null||wt(s[M],se?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(!!t){var r=this.get("container"),i=this.get("containerCfg").position,a=r.getBoundingClientRect().width,o=getComputedStyle(r),s=mb(o.paddingLeft)+mb(o.paddingRight);a-=s,Object.values(t).forEach(function(l){var u=l.card,h=u.getBoundingClientRect().width;switch(i){case"right":Di(u,{marginLeft:a?"".concat(a-h,"px"):"0px"});break;case"top":case"bottom":Di(u,{marginLeft:"8px"})}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var r=this.get("graph"),i=this.get("cardInfoMap");if(!!i){var a=i[t].collapsed,o=r.findById(t);if(!!o){var s=this.get("cardCfg").collapseType;s==="hide"&&!a?this.hideCard(t):this.toggleAnnotation(o,{collapsed:!a}),i[t]=ip(ip({},i[t]),{collapsed:!a})}}}},e.prototype.hideCard=function(t){if(!this.destroyed){var r=this.get("cardInfoMap");if(!(!r||!r[t])){var i=r[t],a=i.card,o=i.link;Di(a,{display:"none"}),o==null||o.hide();var s=this.get("onAnnotationChange");s(r[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var r=this.get("cardInfoMap");if(!!r){var i=r[t],a=i.card,o=i.link,s=this.get("container");s.removeChild(a),o==null||o.remove(!0),delete r[t];var l=this.get("onAnnotationChange");l(i,"remove")}}},e.prototype.bindListener=function(t,r){var i=this;if(!this.destroyed){t.addEventListener("mousemove",function(l){var u;if(l.target.className==="g6-annotation-collapse"?u="collapse":l.target.className==="g6-annotation-expand"?u="expand":l.target.className==="g6-annotation-close"&&(u="close"),u){var h=i.get("cardCfg").onMouseEnterIcon,c=h===void 0?function(){}:h;c(l,r,u)}}),t.addEventListener("mouseout",function(l){var u;if(l.target.className==="g6-annotation-collapse"?u="collapse":l.target.className==="g6-annotation-expand"?u="expand":l.target.className==="g6-annotation-close"&&(u="close"),u){var h=i.get("cardCfg").onMouseLeaveIcon,c=h===void 0?function(){}:h;c(l,r,u)}}),t.addEventListener("mouseenter",function(l){var u=i.get("cardInfoMap");if(!!u){var h=i.get("graph"),c=h.findById(r);if(c){var f=i.get("itemHighlightState");h.setItemState(c,f,!0)}var d=u[r].link;if(d){var v=i.get("linkHighlightStyle")||{};d.attr(v)}}}),t.addEventListener("mouseleave",function(l){var u=i.get("cardInfoMap");if(!!u){var h=i.get("graph"),c=h.findById(r);if(c){var f=i.get("itemHighlightState");h.setItemState(c,f,!1)}var d=u[r].link;if(d){var v=i.get("linkHighlightStyle")||{};Object.keys(v).forEach(function(g){d.attr(g,void 0),d.attr(g,void 0)});var p=i.get("linkStyle");d.attr(p)}}}),t.addEventListener("click",function(l){var u=(i.get("cardCfg")||{}).onClickIcon;if(l.target.className==="g6-annotation-collapse"||l.target.className==="g6-annotation-expand"){var h=i.get("cardCfg").collapseType;h==="hide"?i.hideCard(r):i.handleExpandCollapseCard(r),u==null||u(l,r,l.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(l.target.className==="g6-annotation-close"){var c=i.get("cardCfg").closeType;c==="remove"?i.removeCard(r):i.hideCard(r),u==null||u(l,r,"close")}});var a=this.get("editable");a&&t.addEventListener("dblclick",function(l){var u=i.get("cardInfoMap"),h=(i.get("cardCfg")||{}).maxTitleLength,c=h===void 0?20:h;if(!!u){var f=l.target,d=f.className;if(!(d!=="g6-annotation-title"&&d!=="g6-annotation-content")){var v=d==="g6-annotation-title"?f.getBoundingClientRect():f.parentNode.getBoundingClientRect(),p=v.width,g=v.height,m=getComputedStyle(f),y=d==="g6-annotation-title"?"input":"textarea",_=zs("<".concat(y,' class="').concat(d,'-input" type="textarea" style="width:').concat(p,"px; height: ").concat(g,'px; min-width: 16px;"/>')),x=zs('<div class="'.concat(d,'-input-wrapper" style="width: ').concat(p,"px; height: ").concat(g,"px; min-width: 16px; margin-right: ").concat(m.marginRight,'" />'));x.appendChild(_),f.parentNode.replaceChild(x,f);var S=u[r],w=S.contentPlaceholder,b=S.titlePlaceholder,E=S.content,T=S.title,C=E;d==="g6-annotation-title"?(_.name="title",_.maxLength=c,C=T):_.name="content",C?(_.innerHTML=f.innerHTML,_.value=f.innerHTML):_.placeholder=d==="g6-annotation-title"?b:w,_.focus(),_.addEventListener("blur",function(A){_.value&&(f.innerHTML=_.value,S[_.name||"title"]=_.value),x.parentNode.replaceChild(f,x),i.updateCardSize(r);var M=i.get("onAnnotationChange");M==null||M(S,"update")})}}});var o=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(l){var u=l.target.className;if(!o.includes(u)){var h=t.style;i.set("dragging",{card:t,x:l.clientX,y:l.clientY,left:mb(h.left),top:mb(h.top)})}}),t.addEventListener("drag",function(l){l.preventDefault();var u=i.get("cardInfoMap");if(!!u){var h=l.clientX,c=l.clientY,f=i.get("dragging");if(!(isNaN(h)||isNaN(c)||!f)){var d=f.x,v=f.y,p=f.left,g=f.top,m=f.card,y=h-d,_=c-v;p+=y,g+=_;var x=i.get("graph"),S=x.getPointByCanvas(0,0),w=x.getPointByCanvas(x.getWidth(),x.getHeight()),b=x.getClientByPoint(S.x,S.y),E=b.x,T=b.y,C=x.getClientByPoint(w.x,w.y),A=C.x,M=C.y,I=m.getBoundingClientRect(),R=I.right-I.left,k=I.bottom-I.top;(p>A-E-R&&y>0||p<0&&y<0)&&(p-=y),(g>M-T-k&&_>0||g<0&&_<0)&&(g-=_),Di(m,{left:"".concat(p,"px"),top:"".concat(g,"px"),visibility:"hidden"}),d=h,v=c;var D=(u[r]||{}).link;if(D){var G=x.findById(r);D.attr("path",NY(G,I,x,i.get("canvas")))}i.set("dragging",{x:d,y:v,left:p,top:g,card:m})}}});var s=function(u){var h=i.get("cardInfoMap");if(!!h){var c=i.get("dragging");if(c){var f=c.left,d=c.top,v=c.card;h[r].x=f,h[r].y=d,Di(v,{visibility:"visible"}),i.set("dragging",!1);var p=i.get("rows");p==null||p.forEach(function(m){for(var y=m.length-1;y>=0;y--)m[y].id===r&&m.splice(y,1)});var g=i.get("onAnnotationChange");g==null||g(h[r],"update")}}};t.addEventListener("dragend",s)}},e.prototype.updateCardSize=function(t){var r=this.get("cardInfoMap");if(!!r){var i=r[t].card,a=i.getBoundingClientRect().width,o=i.getElementsByClassName("g6-annotation-title")[0];if(o){var s=getComputedStyle(o),l=mb(s.marginLeft),u=o.getBoundingClientRect().width;Di(o,{marginRight:"".concat(a-l-24-16-u,"px")})}}},e.prototype.updateLink=function(t){var r=t.item;if(!!r){var i=this.get("cardInfoMap");if(!!i){var a=this.get("canvas"),o=this.get("graph"),s=r.getID(),l=i[s]||{},u=l.link,h=l.card;if(u){var c=NY(r,h.getBoundingClientRect(),o,a);u.attr("path",c)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var r=this.get("cardInfoMap");if(!!r){var i=this.get("graph");Object.values(r).forEach(function(a){var o=a.id,s=i.findById(o);t.updateLink({item:s})})}}},e.prototype.onGraphDataChange=function(){var t=this,r=this.get("cardInfoMap");if(!!r){var i=this.get("graph");Object.values(r).forEach(function(a){var o=a.id,s=a.card,l=a.isCanvas;if(!(!s||l||s.style.display==="none")){var u=i.findById(o);u&&u.isVisible()?t.toggleAnnotation(u):t.hideCard(o)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var r=t.item,i=t.visible;if(!(!r||r.destroyed)){var a=this.get("cardInfoMap");if(!!a){var o=r.getID();!a[o]||i||this.hideCard(o)}}},e.prototype.saveData=function(t){t===void 0&&(t=!1);var r=this.get("cardInfoMap");if(!!r){var i=this.get("graph"),a=this.get("getTitle"),o=this.get("getContent"),s=[];return Object.values(r).forEach(function(l){var u=l.title,h=l.content,c=l.x,f=l.y,d=l.id,v=l.collapsed,p=l.card;if(!(p&&p.style.display==="none"&&!t)){var g=i.findById(d)||i.get("canvas");s.push({id:d,x:c,y:f,collapsed:v,title:u||(a==null?void 0:a(g)),content:h||(o==null?void 0:o(g)),visible:p&&p.style.display!=="none"})}}),s}},e.prototype.readData=function(t){var r=this,i=this.get("graph");t.forEach(function(a){var o=a.id,s=a.x,l=a.y,u=a.title,h=a.content,c=a.collapsed,f=a.visible,d=i.findById(o);if(!d&&o===m2e&&(d=i.get("canvas")),!d){var v=r.get("cardInfoMap")||{};v[o]=a,r.set("cardInfoMap",v);return}r.toggleAnnotation(d,{x:s,y:l,title:u,content:h,collapsed:c}),f||r.hideCard(o)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(!!t){var r=this.get("container");Object.values(t).forEach(function(i){var a=i.card,o=i.link;r.removeChild(a),o==null||o.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),(t=this.get("canvas"))===null||t===void 0||t.destroy();var r=this.get("graph");!r||r.destroyed||(this.get("containerCfg")&&r.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(zd);const ggr=pgr;var ygr=function(e,t){var r,i,a=1/0;Object.keys(e).forEach(function(l){var u=e[l];Object.keys(t).forEach(function(h){var c=t[h],f=u.x-c.x,d=u.y-c.y,v=f*f+d*d;a>v&&(a=v,r=u,i=c)})});var o=20,s=gc.getControlPoint(r,i,.5,o);return[["M",r.x,r.y],["Q",s.x,s.y,i.x,i.y]]},NY=function(e,t,r,i){var a,o,s=e.getType();if(s==="edge")o=[e.getKeyShape().getPoint(.5)];else{var l=(a=e.getKeyShape)===null||a===void 0?void 0:a.call(e).getBBox(),u=l.minX,h=l.minY,c=l.maxX,f=l.maxY,d=e.getModel(),v=d.x,p=d.y;u+=v,h+=p,c+=v,f+=p,o={left:{x:u,y:(h+f)/2},right:{x:c,y:(h+f)/2},top:{x:(u+c)/2,y:h},bottom:{x:(u+c)/2,y:f}}}Object.keys(o).forEach(function(T){var C=o[T],A=C.x,M=C.y,I=r.getClientByPoint(A,M);o[T]=i.getPointByClient(I.x,I.y)});var g=t.top,m=g===void 0?0:g,y=t.left,_=y===void 0?0:y,x=t.right,S=x===void 0?0:x,w=t.bottom,b=w===void 0?0:w,E={left:i.getPointByClient(_,(m+b)/2),right:i.getPointByClient(S,(m+b)/2),top:i.getPointByClient((_+S)/2,m),bottom:i.getPointByClient((_+S)/2,b)};return ygr(o,E)},mb=function(e){return Number(e.replace(/\s+|px/gi,""))||0},mgr={PluginBase:zd,Menu:zdr,Grid:Ndr,Minimap:Xdr,Bundling:Kdr,ToolBar:ivr,Tooltip:svr,Fisheye:evr,TimeBar:qpr,ImageMinimap:egr,EdgeFilterLens:igr,SnapLine:ugr,Legend:dgr,Annotation:ggr};const Lu=mgr;G_("circle",{options:{size:Rr.defaultNode.size,style:{x:0,y:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=ms({},i,e.icon),s="".concat(this.type,"-keyShape"),l=t.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});t.shapeMap[s]=l;var u=o.width,h=o.height,c=o.show,f=o.text;if(c){var d="".concat(this.type,"-icon");f?t.shapeMap[d]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:d,name:d,draggable:!0}):t.shapeMap[d]=t.addShape("image",{attrs:ve({x:-u/2,y:-h/2},o),className:d,name:d,draggable:!0})}return this.drawLinkPoints(e,t),l},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints;if(!!r){var i=r||{},a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0]/2;if(o){var v="link-point-left";t.shapeMap[v]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d,y:0,r:u/2||h||5}),className:v,name:v,isAnchorPoint:!0})}if(s){var p="link-point-right";t.shapeMap[p]=t.addShape("circle",{attrs:ve(ve({},c),{x:d,y:0,r:u/2||h||5}),className:p,name:p,isAnchorPoint:!0})}if(a){var g="link-point-top";t.shapeMap[g]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-d,r:u/2||h||5}),className:g,name:g,isAnchorPoint:!0})}if(l){var m="link-point-bottom";t.shapeMap[m]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:d,r:u/2||h||5}),className:m,name:m,isAnchorPoint:!0})}}},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=ms({},t,r),a=this.getSize(e),o=a[0]/2,s=ve({x:0,y:0,r:o},i);return s},update:function(e,t,r){var i=t.getContainer(),a=this.getSize(e),o=ve({},e.style);e.style.stroke===void 0&&e.color&&(o.stroke=e.color),e.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(e,t,o,!0,r),this.updateLinkPoints(e,i)}},"single-node");G_("rect",{options:{size:[100,30],style:{radius:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e),i=t.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return t.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(e,t),i},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0],v=f[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d/2,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d/2,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v/2,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v/2,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=ve({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var l={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=_n({},a,s.attr(),l);u=_n(u,e.style),this.updateShape(e,t,u,!1,r),this.updateLinkPoints(e,i)}},"single-node");G_("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});t.shapeMap["ellipse-keyShape"]=o;var s=i.width,l=i.height,u=i.show,h=i.text;return u&&(h?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0]/2,v=f[1]/2;o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=a[0]/2,s=a[1]/2,l=ve({x:0,y:0,rx:o,ry:s},i);return l},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s={stroke:e.color,rx:o[0]/2,ry:o[1]/2},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)}},"single-node");G_("diamond",{options:{size:[80,80],style:{stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,h=i.text;return u&&(h?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0],v=f[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d/2,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d/2,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v/2,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v/2,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(e){var t=this.getSize(e),r=t[0],i=t[1],a=[["M",0,-i/2],["L",r/2,0],["L",0,i/2],["L",-r/2,0],["Z"]];return a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getPath(e),o=ve({path:a},i);return o},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)}},"single-node");G_("triangle",{options:{size:40,direction:"up",style:{stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(e,t){var r=this.mergeStyle||this.getOptions(e),i=r.icon,a=i===void 0?{}:i,o=r.direction,s=this.getShapeStyle(e),l=e.direction||o,u=t.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var h=a.width,c=a.height,f=a.show,d=a.offset,v=a.text;if(f)if(v)t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var p=-h/2,g=-c/2;(l==="up"||l==="down")&&(g+=d),(l==="left"||l==="right")&&(p+=d),t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:p,y:g},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(e,t),u},drawLinkPoints:function(e,t){var r=this.mergeStyle||this.getOptions(e),i=r.linkPoints,a=i===void 0?{}:i,o=r.direction,s=e.direction||o,l=a.top,u=a.left,h=a.right,c=a.bottom,f=a.size,d=a.r,v=rh(a,["top","left","right","bottom","size","r"]),p=this.getSize(e),g=p[0];if(u){var m=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="up"?m=[-_,y]:s==="down"?m=[-_,-y]:s==="left"&&(m=[-_,_-y]),m&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},v),{x:m[0],y:m[1],r:f/2||d||5}),className:"link-point-left",name:"link-point-left"}))}if(h){var x=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="up"?x=[_,y]:s==="down"?x=[_,-y]:s==="right"&&(x=[_,_-y]),x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},v),{x:x[0],y:x[1],r:f/2||d||5}),className:"link-point-right",name:"link-point-right"}))}if(l){var S=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="up"?S=[_-y,-y]:s==="left"?S=[_,-y]:s==="right"&&(S=[-_,-y]),S&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},v),{x:S[0],y:S[1],r:f/2||d||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var w=null,y=g*Math.sin(1/3*Math.PI),_=g*Math.sin(1/3*Math.PI);s==="down"?w=[-_+y,y]:s==="left"?w=[_,y]:s==="right"&&(w=[-_,y]),w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},v),{x:w[0],y:w[1],r:f/2||d||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(e){var t=(this.mergeStyle||this.getOptions(e)).direction,r=e.direction||t,i=this.getSize(e),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),l=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return r==="down"?l=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:r==="left"?l=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:r==="right"&&(l=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),l},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getPath(e),o=ve({path:a},i);return o},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var r=this.getOptions({}),i=r.linkPoints,a=r.direction,o=e.direction||a,s=t.shapeMap["link-point-left"]||t.find(function(D){return D.get("className")==="link-point-left"}),l=t.shapeMap["link-point-right"]||t.find(function(D){return D.get("className")==="link-point-right"}),u=t.shapeMap["link-point-top"]||t.find(function(D){return D.get("className")==="link-point-top"}),h=t.shapeMap["link-point-bottom"]||t.find(function(D){return D.get("className")==="link-point-bottom"}),c=i,f=s||l||u||h;f&&(c=f.attr());var d=_n({},c,e.linkPoints),v=d.fill,p=d.stroke,g=d.lineWidth,m=d.size/2;m||(m=d.r);var y=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},_=y.left,x=y.right,S=y.top,w=y.bottom,b=this.getSize(e),E=b[0],T={r:m,fill:v,stroke:p,lineWidth:g},C=null,A=E*Math.sin(1/3*Math.PI),M=E*Math.sin(1/3*Math.PI);o==="up"?C=[-M,A]:o==="down"?C=[-M,-A]:o==="left"&&(C=[-M,M-A]),C&&(s?!_&&_!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr(ve(ve({},T),{x:C[0],y:C[1]})):_&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},T),{x:C[0],y:C[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var I=null;o==="up"?I=[M,A]:o==="down"?I=[M,-A]:o==="right"&&(I=[M,M-A]),I&&(l?!x&&x!==void 0?(l.remove(),delete t.shapeMap["link-point-right"]):l.attr(ve(ve({},T),{x:I[0],y:I[1]})):x&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},T),{x:I[0],y:I[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var R=null;o==="up"?R=[M-A,-A]:o==="left"?R=[M,-A]:o==="right"&&(R=[-M,-A]),R&&(u?!S&&S!==void 0?(u.remove(),delete t.shapeMap["link-point-top"]):u.attr(ve(ve({},T),{x:R[0],y:R[1]})):S&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},T),{x:R[0],y:R[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var k=null;o==="down"?k=[-M+A,A]:o==="left"?k=[M,A]:o==="right"&&(k=[-M,A]),k&&(h?!w&&w!==void 0?(h.remove(),delete t.shapeMap["link-point-bottom"]):h.attr(ve(ve({},T),{x:k[0],y:k[1]})):w&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},T),{x:k[0],y:k[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");G_("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Rr.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Rr.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Rr.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).preRect,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=this.getSize(e),s=o[0],l=o[1],u=t.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=u;var h=i.show,c=rh(i,["show"]);return h&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:ve({x:-s/2,y:-l/2,height:l},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(e,t),this.drawStateIcon(e,t),this.drawLinkPoints(e,t),u},drawLogoIcon:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).logoIcon,i=r===void 0?{}:r,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,h=i.y,c=i.offset,f=i.text,d=rh(i,["width","height","x","y","offset","text"]);f?t.shapeMap["rect-logo-icon"]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):t.shapeMap["rect-logo-icon"]=t.addShape("image",{attrs:ve(ve({},d),{x:u||-o/2+s+c,y:h||-l/2,width:s,height:l}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).stateIcon,i=r===void 0?{}:r,a=this.getSize(e),o=a[0];if(i.show){var s=i.width,l=i.height,u=i.x,h=i.y,c=i.offset,f=i.text,d=rh(i,["width","height","x","y","offset","text"]);f?t.shapeMap["rect-state-icon"]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):t.shapeMap["rect-state-icon"]=t.addShape("image",{attrs:ve(ve({},d),{x:u||o/2-s+c,y:h||-l/2,width:s,height:l}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.bottom,u=i.size,h=i.r,c=rh(i,["top","left","right","bottom","size","r"]),f=this.getSize(e),d=f[0],v=f[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},c),{x:-d/2,y:0,r:u/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},c),{x:d/2,y:0,r:u/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:-v/2,r:u/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),l&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},c),{x:0,y:v/2,r:u/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(e,t){var r=this.getOptions(e),i=r.labelCfg,a=i===void 0?{}:i,o=r.logoIcon,s=o===void 0?{}:o,l=r.descriptionCfg,u=l===void 0?{}:l,h=this.getSize(e),c=h[0],f=null,d=s.show,v=s.width,p=-c/2+a.offset;d&&(p=-c/2+v+a.offset);var g=a.style,m=u.style,y=u.paddingTop;return rr(e.description)?(f=t.addShape("text",{attrs:ve(ve({},g),{x:p,y:-5,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=f,t.shapeMap["rect-description"]=t.addShape("text",{attrs:ve(ve({},m),{x:p,y:17+(y||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(f=t.addShape("text",{attrs:ve(ve({},g),{x:p,y:7,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=f),f},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getSize(e),o=i.width||a[0],s=i.height||a[1],l=ve({x:-o/2,y:-s/2,width:o,height:s},i);return l},update:function(e,t){var r=this.mergeStyle||this.getOptions(e),i=r.style,a=i===void 0?{}:i,o=r.labelCfg,s=o===void 0?{}:o,l=r.descriptionCfg,u=l===void 0?{}:l,h=this.getSize(e),c=h[0],f=h[1],d=t.get("keyShape");d.attr(ve(ve({},a),{x:-c/2,y:-f/2,width:c,height:f}));var v=t.getContainer(),p=v.shapeMap["rect-logo-icon"]||v.find(function(ie){return ie.get("className")==="rect-logo-icon"}),g=p?p.attr():{},m=_n({},g,e.logoIcon),y=m.width;y===void 0&&(y=this.options.logoIcon.width);var _=e.logoIcon?e.logoIcon.show:void 0,x=s.offset,S=-c/2+y+x;!_&&_!==void 0&&(S=-c/2+x);var w=v.shapeMap["node-label"]||v.find(function(ie){return ie.get("className")==="node-label"}),b=v.shapeMap["rect-description"]||v.find(function(ie){return ie.get("className")==="rect-description"});if(e.label)if(!w)v.shapeMap["node-label"]=v.addShape("text",{attrs:ve(ve({},s.style),{x:S,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var E=e.labelCfg?e.labelCfg.style:{},T=_n({},w.attr(),E);e.label&&(T.text=e.label),T.x=S,rr(e.description)&&(T.y=-5),b&&(b.resetMatrix(),b.attr({x:S})),w.resetMatrix(),w.attr(T)}if(rr(e.description)){var C=u.paddingTop;if(!b)v.shapeMap["rect-description"]=v.addShape("text",{attrs:ve(ve({},u.style),{x:S,y:17+(C||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var E=e.descriptionCfg?e.descriptionCfg.style:{},A=_n({},b.attr(),E);rr(e.description)&&(A.text=e.description),A.x=S,b.resetMatrix(),b.attr(ve(ve({},A),{y:17+(C||0)}))}}var M=v.shapeMap["pre-rect"]||v.find(function(ie){return ie.get("className")==="pre-rect"});if(M&&!M.destroyed){var I=_n({},M.attr(),e.preRect);M.attr(ve(ve({},I),{x:-c/2,y:-f/2,height:f}))}if(p&&!p.destroyed)if(!_&&_!==void 0)p.remove(),delete v.shapeMap["pre-rect"];else{var R=m.width,k=m.height,D=m.x,G=m.y,W=m.offset,z=rh(m,["width","height","x","y","offset"]);p.attr(ve(ve({},z),{x:D||-c/2+R+W,y:G||-k/2,width:R,height:k}))}else _&&this.drawLogoIcon(e,v);var V=v.shapeMap["rect-state-icon"]||v.find(function(ie){return ie.get("className")==="rect-state-icon"}),q=V?V.attr():{},Y=_n({},q,e.stateIcon);if(V){!Y.show&&Y.show!==void 0&&(V.remove(),delete v.shapeMap["rect-state-icon"]);var le=Y.width,k=Y.height,D=Y.x,G=Y.y,j=Y.offset,Q=rh(Y,["width","height","x","y","offset"]);V.attr(ve(ve({},Q),{x:D||c/2-le+j,y:G||-k/2,width:le,height:k}))}else Y.show&&this.drawStateIcon(e,v);this.updateLinkPoints(e,v)},getOptions:function(e,t){return t==="move"?e:ms({},this.options,this.getCustomConfig(e)||{},e)}},"single-node");G_("star",{options:{size:60,style:{stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,u=i.show,h=i.text;return u&&(h?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,i=r===void 0?{}:r,a=i.top,o=i.left,s=i.right,l=i.leftBottom,u=i.rightBottom,h=i.size,c=i.r,f=rh(i,["top","left","right","leftBottom","rightBottom","size","r"]),d=this.getSize(e),v=d[0];if(s){var p=Math.cos(.1*Math.PI)*v,g=Math.sin((18+72*0)/180*Math.PI)*v;t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var p=Math.cos(.5*Math.PI)*v,g=Math.sin((18+72*1)/180*Math.PI)*v;t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var p=Math.cos(.9*Math.PI)*v,g=Math.sin((18+72*2)/180*Math.PI)*v;t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(l){var p=Math.cos(1.3*Math.PI)*v,g=Math.sin((18+72*3)/180*Math.PI)*v;t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){var p=Math.cos(1.7*Math.PI)*v,g=Math.sin((18+72*4)/180*Math.PI)*v;t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:ve(ve({},f),{x:p,y:-g,r:h/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(e){var t=this.getSize(e),r=t[0],i=r*3/8,a=e.innerR||i;return gc.getStarPath(r,a)},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},i=_n({},t,r),a=this.getPath(e),o=ve({path:a},i);return o},update:function(e,t,r){var i=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},l=t.get("keyShape"),u=_n({},a,l.attr(),s);u=_n(u,e.style),this.updateShape(e,t,u,!0,r),this.updateLinkPoints(e,i)},updateLinkPoints:function(e,t){var r=this.getOptions({}).linkPoints,i=t.shapeMap["link-point-left"]||t.find(function(A){return A.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(A){return A.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(A){return A.get("className")==="link-point-top"}),s=t.shapeMap["link-point-left-bottom"]||t.find(function(A){return A.get("className")==="link-point-left-bottom"}),l=t.shapeMap["link-point-left-bottom"]||t.find(function(A){return A.get("className")==="link-point-right-bottom"}),u=r,h=i||a||o||s||l;h&&(u=h.attr());var c=_n({},u,e.linkPoints),f=c.fill,d=c.stroke,v=c.lineWidth,p=c.size/2;p||(p=c.r);var g=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},m=g.left,y=g.right,_=g.top,x=g.leftBottom,S=g.rightBottom,w=this.getSize(e),b=w[0],E={r:p,fill:f,stroke:d,lineWidth:v},T=Math.cos((18+72*0)/180*Math.PI)*b,C=Math.sin((18+72*0)/180*Math.PI)*b;a?!y&&y!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr(ve(ve({},E),{x:T,y:-C})):y&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),T=Math.cos((18+72*1)/180*Math.PI)*b,C=Math.sin((18+72*1)/180*Math.PI)*b,o?!_&&_!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr(ve(ve({},E),{x:T,y:-C})):_&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),T=Math.cos((18+72*2)/180*Math.PI)*b,C=Math.sin((18+72*2)/180*Math.PI)*b,i?!m&&m!==void 0?(i.remove(),delete t.shapeMap["link-point-left"]):i.attr(ve(ve({},E),{x:T,y:-C})):m&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),T=Math.cos((18+72*3)/180*Math.PI)*b,C=Math.sin((18+72*3)/180*Math.PI)*b,s?!x&&x!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr(ve(ve({},E),{x:T,y:-C})):x&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),T=Math.cos((18+72*4)/180*Math.PI)*b,C=Math.sin((18+72*4)/180*Math.PI)*b,l?!S&&S!==void 0?(l.remove(),delete t.shapeMap["link-point-right-bottom"]):l.attr(ve(ve({},E),{x:T,y:-C})):S&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:ve(ve({},E),{x:T,y:-C}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var _2e=gc.defaultSubjectColors,AR="fan-shape-",bje=function(e,t){var r=0,i=[];return Object.keys(e).forEach(function(a){var o=+e[a];isNaN(o)||(i.push({key:a,value:o,color:t[a]}),r+=o)}),{totalValue:r,configs:i}},Eje=function(e){var t=e.attr("r"),r=.6*t,i=(t+r)/2,a=t-r;return{lineWidth:a,arcR:i}},fte=function(e,t){var r=t.arcR,i=t.arcBegin,a=t.beginAngle,o=t.config,s=t.fanIndex,l=t.lineWidth,u=t.totalValue,h=t.drawWhole,c=h===void 0?!1:h,f=t.updateShape,d=f===void 0?void 0:f,v=o.value/u;if(v<.001)return{beginAngle:a,arcBegin:i,shape:void 0,shouldEnd:!1};var p,g,m;if(c||v>.999)p=[r,1e-4],m=1;else{var y=v*Math.PI*2;g=a+y,p=[r*Math.cos(g),-r*Math.sin(g)],m=y>Math.PI?1:0}var _={path:[["M",i[0],i[1]],["A",r,r,0,m,0,p[0],p[1]]],stroke:o.color||(d==null?void 0:d.attr("stroke"))||_2e[s%_2e.length],lineWidth:l};return d?d.attr(_):e.shapeMap["".concat(AR).concat(s)]=e.addShape("path",{attrs:_,name:"".concat(AR).concat(s),draggable:!0}),{beginAngle:g,arcBegin:p,shape:e.shapeMap["".concat(AR).concat(s)],shouldEnd:c||v>.999}},_gr=function(e,t,r){var i=e.donutAttrs,a=i===void 0?{}:i,o=e.donutColorMap,s=o===void 0?{}:o,l=Object.keys(a).length;if(a&&l>1){var u=bje(a,s),h=u.configs,c=u.totalValue;if(c){var f=Eje(r),d=f.lineWidth,v=f.arcR,p=[v,0],g=0;if(l===1){fte(t,{arcR:v,arcBegin:p,beginAngle:g,config:h[0],fanIndex:0,lineWidth:d,totalValue:c,drawWhole:!0});return}for(var m=0;m<h.length;m++){var y=fte(t,{arcR:v,arcBegin:p,beginAngle:g,config:h[m],fanIndex:m,lineWidth:d,totalValue:c});if(y.shouldEnd)return;p=y.arcBegin,g=y.beginAngle}}}},xgr=function(e,t,r){var i=e.donutAttrs,a=e.donutColorMap,o=a===void 0?{}:a,s={},l=t.getContainer();if(i){var u=bje(i,o),h=u.configs,c=u.totalValue;if(c)for(var f=Eje(r),d=f.lineWidth,v=f.arcR,p=[v,0],g=0,m=0;m<h.length;m++){var y="".concat(AR).concat(m),_=fte(l,{arcR:v,arcBegin:p,beginAngle:g,config:h[m],fanIndex:m,lineWidth:d,totalValue:c,drawWhole:h.length===1,updateShape:l.shapeMap[y]});if(_.shape&&(s[y]=!0),_.shouldEnd)break;p=_.arcBegin,g=_.beginAngle}}var x=Object.keys(l.shapeMap).filter(function(S){return S.includes(AR)});x.forEach(function(S){s[S]||(l.shapeMap[S].remove(!0),delete l.shapeMap[S])})};G_("donut",{options:{size:Rr.defaultNode.size,style:{x:0,y:0,stroke:Rr.defaultNode.style.stroke,fill:Rr.defaultNode.style.fill,lineWidth:Rr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Rr.nodeLabel.style.fill,fontSize:Rr.nodeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Rr.defaultNode.linkPoints.size,lineWidth:Rr.defaultNode.linkPoints.lineWidth,fill:Rr.defaultNode.linkPoints.fill,stroke:Rr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:ve({},Rr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,i=r===void 0?{}:r,a=this.getShapeStyle(e),o=ms({},i,e.icon),s=t.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});t.shapeMap["".concat(this.type,"-keyShape")]=s;var l=o.width,u=o.height,h=o.show,c=o.text;return h&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:ve({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:ve({x:-l/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),_gr(e,t,s),this.drawLinkPoints(e,t),s},updateShape:function(e,t,r,i,a){var o=t.get("keyShape");o.attr(ve({},r)),xgr(e,t,o),this.updateLabel(e,t,a),i&&this.updateIcon(e,t)}},"circle");var Y5=function(e){var t=e.x,r=e.y;return{x:t,y:r,centerX:t,centerY:r,minX:t,minY:r,maxX:t,maxY:r,height:0,width:0}},Sgr=function(e){e===void 0&&(e=[]);var t=[],r=[];e.forEach(function(l){t.push(l.x),r.push(l.y)});var i=Math.min.apply(Math,t),a=Math.max.apply(Math,t),o=Math.min.apply(Math,r),s=Math.max.apply(Math,r);return{centerX:(i+a)/2,centerY:(o+s)/2,maxX:a,maxY:s,minX:i,minY:o,height:s-o,width:a-i}},rue=function(e){for(var t=[],r={},i=e.length,a=i-1;a>=0;a--){var o=e[a];o.id="".concat(o.x,"|||").concat(o.y),r[o.id]||(r[o.id]=o,t.push(o))}return t},Tje=function(e){return rue(e)},K9=function(e,t){return e.width||e.height?{centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}:e},wgr=function(e,t){var r=Math.abs(e.x-t.centerX),i=Math.abs(e.y-t.centerY);return r===0&&i===0?0:r/t.width>i/t.height},dte=function(e,t,r){var i=wgr(t,e);if(i===0){var a=e.centerX,o=e.centerY;return r.y<t.y?o=e.minY:r.x>t.x?a=e.maxX:r.x<t.x?a=e.minX:r.x===t.x&&(o=e.maxY),{x:a,y:o}}return i?{x:t.x>e.centerX?e.maxX:e.minX,y:t.y}:{x:t.x,y:t.y>e.centerY?e.maxY:e.minY}},x2e=function(e,t){var r=Math.min(e.minX,t.minX),i=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),o=Math.max(e.maxY,t.maxY);return{centerX:(r+a)/2,centerY:(i+o)/2,minX:r,minY:i,maxX:a,maxY:o,height:o-i,width:a-r}},vte=function(e){return[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}]},q5=function(e,t){var r=e.x,i=e.y;return r<t.minX||r>t.maxX||i<t.minY||i>t.maxY},bgr=function(e,t){return t<e.minX||t>e.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},Egr=function(e,t){return t<e.minY||t>e.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Tgr=function(e,t){return bgr(e,t.x).concat(Egr(e,t.y))},aN=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Cgr=function(e,t){var r=-2,i=0;return t.forEach(function(a){a&&(e.x===a.x&&(i+=r),e.y===a.y&&(i+=r))}),i},S2e=function(e,t,r,i,a){return aN(e,t)+aN(e,r)+Cgr(e,[t,r,i,a])},Cje=function(e,t,r,i,a){a===void 0&&(a=0),e.unshift(t[i]),r[i]&&r[i]!==i&&a<=100&&Cje(e,t,r,r[i],a+1)},Z5=function(e,t,r,i){var a=r.x-e.x,o=r.y-e.y,s=i.x-e.x,l=i.y-e.y,u=r.x-t.x,h=r.y-t.y,c=i.x-t.x,f=i.y-t.y,d=a*l-o*s,v=u*f-h*c,p=a*h-o*u,g=s*f-l*c;return d*v<=0&&p*g<=0},pte=function(e,t,r){if(r.width||r.height){var i=vte(r),a=i[0],o=i[1],s=i[2],l=i[3];return Z5(e,t,a,o)||Z5(e,t,a,l)||Z5(e,t,o,s)||Z5(e,t,s,l)}return!1},Agr=function(e,t,r,i){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(pte(o,t,r)||pte(o,t,i))return;a.push(o)}}),rue(a)},Aje=function(){function n(){this.arr=[],this.map={},this.arr=[],this.map={}}return n.prototype._innerAdd=function(e,t){for(var r=[0,t-1];r[1]-r[0]>1;){var i=Math.floor((r[0]+r[1])/2);if(this.arr[i].value>e.value)r[1]=i;else if(this.arr[i].value<e.value)r[0]=i;else{this.arr.splice(i,0,e),this.map[e.id]=!0;return}}this.arr.splice(r[1],0,e),this.map[e.id]=!0},n.prototype.add=function(e){delete this.map[e.id];var t=this.arr.length;if(!t){this.arr.push(e),this.map[e.id]=!0;return}if(this.arr[t-1].value<e.value){this.arr.push(e),this.map[e.id]=!0;return}this._innerAdd(e,t)},n.prototype.remove=function(e){!this.map[e]||delete this.map[e]},n.prototype._clearAndGetMinId=function(){for(var e,t=this.arr.length-1;t>=0;t--)this.map[this.arr[t].id]?e=this.arr[t].id:this.arr.splice(t,1);return e},n.prototype._findFirstId=function(){for(;this.arr.length;){var e=this.arr.shift();if(this.map[e.id])return e.id}},n.prototype.minId=function(e){return e?this._clearAndGetMinId():this._findFirstId()},n}(),Mgr=function(e,t,r,i,a,o,s){var l,u=[],h=(l={},l[t.id]=t,l),c={},f={},d={};f[t.id]=0,d[t.id]=S2e(t,r,t);var v=new Aje;v.add({id:t.id,value:d[t.id]});var p={};e.forEach(function(S){p[S.id]=S});for(var g;Object.keys(h).length;){var m=v.minId(!1);if(m)g=h[m];else break;if(g===r){var y=[];return Cje(y,p,c,r.id),y}delete h[g.id],v.remove(g.id),u.push(g);var _=Agr(e,g,i,a),x=function(w){w.forEach(function(b){if(u.indexOf(b)===-1){var E=b.id;h[E]||(h[E]=b);var T=d[g.id]+aN(g,b);if(f[E]&&T>=f[E]){v.add({id:E,value:d[E]});return}c[E]=g.id,f[E]=T,d[E]=f[E]+S2e(b,r,t,o,s),v.add({id:E,value:d[E]})}})};x(_)}return[t,r]},Igr=function(e,t,r){return!(e.x===t.x&&t.x===r.x||e.y===t.y&&t.y===r.y)},Lgr=function(e,t,r,i){var a=aN(e,t),o=aN(r,t);a<i&&(i=a),o<i&&(i=o);var s={x:t.x-i/a*(t.x-e.x),y:t.y-i/a*(t.y-e.y)},l={x:t.x-i/o*(t.x-r.x),y:t.y-i/o*(t.y-r.y)};return[s,l]},w2e=function(e,t){var r=[],i=e[0];return r.push("M".concat(i.x," ").concat(i.y)),e.forEach(function(a,o){var s=e[o+1],l=e[o+2];if(s&&l)if(Igr(a,s,l)){var u=Lgr(a,s,l,t),h=u[0],c=u[1];r.push("L".concat(h.x," ").concat(h.y)),r.push("Q".concat(s.x," ").concat(s.y," ").concat(c.x," ").concat(c.y)),r.push("L".concat(c.x," ").concat(c.y))}else r.push("L".concat(s.x," ").concat(s.y));else s&&r.push("L".concat(s.x," ").concat(s.y))}),r.join("")},Mje=function(e,t,r,i,a){var o,s;if(!r||!r.getType())o=Y5(e);else if(r.getType()==="combo"){var l=r.getKeyShape().getBBox();if(l){var u=r.getModel(),h=u.x,c=u.y;o={x:h,y:c,width:l.width,height:l.height,minX:l.minX+h,maxX:l.maxX+h,minY:l.minY+c,maxY:l.maxY+c},o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=Y5(e)}else o=r&&r.getBBox();if(!i||!i.getType())s=Y5(t);else if(i.getType()==="combo"){var f=i.getKeyShape().getBBox();if(f){var d=i.getModel(),v=d.x,p=d.y;s={x:v,y:p,width:f.width,height:f.height,minX:f.minX+v,maxX:f.maxX+v,minY:f.minY+p,maxY:f.maxY+p},s.centerX=(s.minX+s.maxX)/2,s.centerY=(s.minY+s.maxY)/2}else s=Y5(t)}else s=i&&i.getBBox();var g=K9(o,a),m=K9(s,a),y=dte(g,e,t),_=dte(m,t,e),x=Sgr([y,_]),S=x2e(g,x),w=x2e(m,x),b=[];b=b.concat(vte(S)).concat(vte(w));var E={x:(e.x+t.x)/2,y:(e.y+t.y)/2};[x,S,w].forEach(function(C){b=b.concat(Tgr(C,E).filter(function(A){return q5(A,g)&&q5(A,m)}))}),[{x:y.x,y:_.y},{x:_.x,y:y.y}].forEach(function(C){q5(C,g)&&q5(C,m)&&b.push(C)}),b.unshift(y),b.push(_),b=rue(b);var T=Mgr(b,y,_,o,s,e,t);return T.unshift(e),T.push(t),Tje(T)},Pgr=function(e){if(!(e!=null&&e.length))return e;for(var t=e[e.length-1],r={x:t.x,y:t.y},i=[t],a=[t],o=e.length-2;o>=0;o--){var s=e[o];if(s.x===r.x?i.push(s):(i=[s],r.x=s.x),s.y===r.y?a.push(s):(a=[s],r.y=s.y),i.length>2){var l=e.indexOf(i[1]);l>-1&&e.splice(l,1);continue}if(a.length>2){var l=e.indexOf(a[1]);l>-1&&e.splice(l,1)}}return e},Ogr=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Rgr=function(e,t,r,i,a){return Tje(Mje(e,t,r,i,a.offset))},Dgr={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:Ogr,fallbackRoute:Rgr},k1=function(e,t){var r=Math.round(Math.abs(e/t)),i=e<0?-1:1;return r<0?0:i*r},Ngr=function(e,t,r){var i={};return e.forEach(function(a){if(!!a)for(var o=K9(a.getBBox(),r),s=k1(o.minX,t);s<=k1(o.maxX,t);s+=1)for(var l=k1(o.minY,t);l<=k1(o.maxY,t);l+=1)i["".concat(s,"|||").concat(l)]=!0}),i},kY=function(e,t){var r=t.x-e.x,i=t.y-e.y;return r||i?Math.atan2(i,r):0},b2e=function(e,t){var r=Math.abs(e-t);return r>Math.PI?2*Math.PI-r:r},E2e=function(e,t,r){for(var i=1/0,a=0,o=t.length;a<o;a++){var s=r(e,t[a]);s<i&&(i=s)}return i},T2e=function(e,t,r,i,a){var o=[];if(!r)return[e];var s=a.directions,l=a.offset,u=r.getBBox(),h=t.x>u.minX&&t.x<u.maxX&&t.y>u.minY&&t.y<u.maxY,c=K9(u,l);for(var f in c)c[f]=k1(c[f],a.gridSize);if(h){for(var d=0,v=s;d<v.length;d++)for(var p=v[d],g=[[{x:c.minX,y:c.minY},{x:c.maxX,y:c.minY}],[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY}],[{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}],[{x:c.minX,y:c.maxY},{x:c.maxX,y:c.maxY}]],f=0;f<4;f++){var m=g[f],y=gc.getLineIntersect(e,{x:e.x+p.stepX*c.width,y:e.y+p.stepY*c.height},m[0],m[1]);y&&!pte(e,y,u)&&(y.id="".concat(y.x,"|||").concat(y.y),o.push(y))}return o}var _=dte(c,e,i);return _.id="".concat(_.x,"|||").concat(_.y),[_]},gte=function(e,t,r,i){var a=kY(e,t),o=r[e.id];if(!o){var s=kY(i,e);return b2e(s,a)}var l=kY({x:o.x,y:o.y},e);return b2e(l,a)},kgr=function(e,t,r,i,a,o,s){var l=[i],u=i,h=e.id,c=e.x,f=e.y,d={x:c,y:f,id:h};gte(d,o,t,r)&&(u={x:o.x===i.x?i.x:d.x*s,y:o.y===i.y?i.y:d.y*s},l.unshift(u));for(var v=t[h];v&&v.id!==h;){var p={x:c,y:f,id:h},g={x:v.x,y:v.y,id:v.id},m=gte(g,p,t,r);m&&(u={x:g.x===p.x?u.x:g.x*s,y:g.y===p.y?u.y:g.y*s},l.unshift(u)),h=g.id,c=g.x,f=g.y,v=t[h]}return l[0].x=c===r.x?a.x:u.x,l[0].y=f===r.y?a.y:u.y,l.unshift(a),l},Fgr=function(e,t,r,i,a){if(isNaN(e.x)||isNaN(t.x))return[];var o=ms(Dgr,a);o.obstacles=o.obstacles||[];var s=o.penalties,l=o.gridSize,u=Ngr(o.obstacles.concat([r,i]),l,o.offset),h={x:k1(e.x,l),y:k1(e.y,l)},c={x:k1(t.x,l),y:k1(t.y,l)};e.id="".concat(h.x,"|||").concat(h.y),t.id="".concat(c.x,"|||").concat(c.y);var f=T2e(h,e,r,c,o),d=T2e(c,t,i,h,o);f.forEach(function(z){delete u[z.id]}),d.forEach(function(z){delete u[z.id]});for(var v={},p={},g={},m={},y={},_=new Aje,x=0;x<f.length;x++){var S=f[x];v[S.id]=S,m[S.id]=0,y[S.id]=E2e(S,d,o.distFunc),_.add({id:S.id,value:y[S.id]})}var w=o.maximumLoops,b,E,T,C,A,M,I=1/0,R={};for(d.forEach(function(z){R["".concat(z.x,"|||").concat(z.y)]=!0}),Object.keys(v).forEach(function(z){var V=v[z].id;y[V]<=I&&(I=y[V],b=v[V])});Object.keys(v).length>0&&w>0;){var k=_.minId((w+1)%30===0);if(k)b=v[k];else break;if(R["".concat(b.x,"|||").concat(b.y)])return kgr(b,g,h,t,e,c,l);delete v[b.id],_.remove(b.id),p[b.id]=!0;for(var x=0;x<o.directions.length;x++){E=o.directions[x];var D="".concat(Math.round(b.x)+E.stepX,"|||").concat(Math.round(b.y)+E.stepY);if(T={x:b.x+E.stepX,y:b.y+E.stepY,id:D},!p[D]&&(M=gte(b,T,g,h),!(M>o.maxAllowedDirectionChange)&&!u[D])){v[D]||(v[D]=T);var G=s[M];C=o.distFunc(b,T)+(isNaN(G)?l:G),A=m[b.id]+C;var W=m[D];W&&A>=W||(g[D]=b,m[D]=A,y[D]=A+E2e(T,d,o.distFunc),_.add({id:D,value:y[D]}))}}w-=1}return o.fallbackRoute(e,t,r,i,o)};NUe("polyline",{options:{color:Rr.defaultEdge.color,size:Rr.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Rr.defaultEdge.style.stroke,lineAppendWidth:Rr.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Rr.edgeLabel.style.fill,fontSize:Rr.edgeLabel.style.fontSize,fontFamily:Rr.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:ve({},Rr.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e);r.radius===0&&delete r.radius;var i=t.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return t.shapeMap["edge-shape"]=i,i},getShapeStyle:function(e){var t=this.options.style,r={stroke:e.color},i=_n({},t,r,e.style);e=this.getPathPoints(e),this.radius=i.radius,this.offset=i.offset;var a=e.startPoint,o=e.endPoint,s=this.getControlPoints(e),l=[a];s&&(l=l.concat(s)),l.push(o);var u=e.sourceNode,h=e.targetNode,c=i.radius,f=this.options.routeCfg,d=_n({},f,e.routeCfg);d.offset=i.offset;var v=this.getPath(l,u,h,c,d,!Boolean(s));(vn(v)&&v.length<=1||rr(v)&&v.indexOf("L")===-1)&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(v="M0 0, L0 0");var p=_n({},Rr.defaultEdge.style,i,{lineWidth:e.size,path:v});return p},updateShapeStyle:function(e,t){var r=t.getContainer();if(!!t.isVisible()){var i={stroke:e.color},a=r.shapeMap["edge-shape"]||r.find(function(x){return x.get("className")==="edge-shape"})||t.getKeyShape(),o=e.size;e=this.getPathPoints(e);var s=e.startPoint,l=e.endPoint,u=this.getControlPoints(e),h=[s];u&&(h=h.concat(u)),h.push(l);var c=a.attr(),f=_n({},i,c,e.style),d=e.sourceNode,v=e.targetNode,p=f.radius,g=this.options.routeCfg,m=_n({},g,e.routeCfg);m.offset=f.offset;var y=this.getPath(h,d,v,p,m,!Boolean(u));(vn(y)&&y.length<=1||rr(y)&&y.indexOf("L")===-1)&&(y="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(l.x)||isNaN(l.y))&&(y="M0 0, L0 0"),c.endArrow&&f.endArrow===!1&&(e.style.endArrow={path:""}),c.startArrow&&f.startArrow===!1&&(e.style.startArrow={path:""});var _=_n(i,a.attr(),{lineWidth:o,path:y},e.style);a&&a.attr(_)}},getPath:function(e,t,r,i,a,o){var s=a.offset,l=a.obstacles,u=a.simple;if(!s||e.length>2||o===!1){if(i)return w2e(e,i);var h=[];return At(e,function(v,p){p===0?h.push(["M",v.x,v.y]):h.push(["L",v.x,v.y])}),h}u!==!1&&!(l!=null&&l.length)&&(u=!0);var c=u?Mje(e[e.length-1],e[0],r,t,s):Fgr(e[0],e[e.length-1],t,r,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var f=w2e(c,i);return f}c=Pgr(c);var d=gc.pointsToPolygon(c);return d}},"single-edge");var C2e=H_.cloneEvent,A2e=H_.isNaN,M2e=Math.abs,Bgr=10,Ggr=["shift","ctrl","alt","control"];const zgr={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(e){var t=this.origin,r=+e.clientX,i=+e.clientY;if(!(A2e(r)||A2e(i))){var a=r-t.x,o=i-t.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:r,y:i};var s=this.graph.get("width"),l=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,c=this.scalableRange;h<1&&h>-1&&(h=s*h,c=l*c),(u.minX<=s+h&&u.minX+a>s+h||u.maxX+h>=0&&u.maxX+h+a<0)&&(a=0),(u.minY<=l+c&&u.minY+o>l+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(e){var t=this,r=e.originalEvent.touches,i=r[0],a=r[1];i&&a||(e.preventDefault(),this.mousedown=!0,t.onDragStart(e))},onMouseDown:function(e){this.mousedown=!0},onDragMove:function(e){!this.mousedown||(this.dragstart?this.onDrag(e):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this,r=e.originalEvent;if(!(r&&e.name!=="touchstart"&&r.button!==0)&&!(e.name!=="touchstart"&&typeof window<"u"&&window.event&&!window.event.buttons&&!window.event.button)&&!!this.shouldBegin(e,this)&&!t.keydown&&!!this.allowDrag(e)){if(t.origin={x:e.clientX,y:e.clientY},t.dragging=!1,this.enableOptimize){for(var i=this.graph,a=i.getEdges(),o=0,s=a.length;o<s;o++){var l=a[o].get("group").get("children");!l||l.forEach(function(_){_.set("ori-visibility",_.get("ori-visibility")||_.get("visible")),_.hide()})}for(var u=i.getNodes(),h=0,c=u.length;h<c;h++)for(var f=u[h].getContainer(),d=f.get("children"),v=0,p=d;v<p.length;v++){var g=p[v],m=g.get("isKeyShape");m||(g.set("ori-visibility",g.get("ori-visibility")||g.get("visible")),g.hide())}}if(typeof window<"u"){var y=this;this.handleDOMContextMenu=function(_){return y.onMouseUp(_)},document.body.addEventListener("contextmenu",this.handleDOMContextMenu)}}},onTouchMove:function(e){var t=this,r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a){this.onMouseUp(e);return}e.preventDefault(),t.onDrag(e)},onDrag:function(e){if(!!this.mousedown){var t=this.graph;if(!this.keydown&&!!this.allowDrag(e)&&(e=C2e(e),!!this.origin)){if(this.dragging)e.type="drag",t.emit("canvas:drag",e);else{if(M2e(this.origin.x-e.clientX)+M2e(this.origin.y-e.clientY)<Bgr)return;this.shouldBegin(e,this)&&(e.type="dragstart",t.emit("canvas:dragstart",e),this.originPosition={x:e.clientX,y:e.clientY},this.dragging=!0)}this.shouldUpdate(e,this)&&this.updateViewport(e)}}},onMouseUp:function(e){var t,r;this.mousedown=!1,this.dragstart=!1;var i=this.graph;if(!this.keydown){var a=i.getZoom(),o=i.get("modeController"),s=(r=(t=o==null?void 0:o.modes[o.mode])===null||t===void 0?void 0:t.filter(function(b){return b.type==="zoom-canvas"}))===null||r===void 0?void 0:r[0],l=s?s.optimizeZoom||.1:0;if(this.enableOptimize){for(var u=i.getEdges(),h=0,c=u.length;h<c;h++){var f=u[h].get("group").get("children");!f||f.forEach(function(b){var E=b.get("ori-visibility");b.set("ori-visibility",void 0),E&&b.show()})}if(a>l)for(var d=i.getNodes(),v=0,p=d.length;v<p;v++)for(var g=d[v].getContainer(),m=g.get("children"),y=0,_=m;y<_.length;y++){var x=_[y],S=x.get("isKeyShape");if(!S){var w=x.get("ori-visibility");x.set("ori-visibility",void 0),w&&x.show()}}}if(!this.dragging){this.origin=null;return}e=C2e(e),this.shouldEnd(e,this)&&this.updateViewport(e),e.type="dragend",e.dx=e.clientX-this.originPosition.x,e.dy=e.clientY-this.originPosition.y,i.emit("canvas:dragend",e),this.endDrag(),typeof window<"u"&&document.body.removeEventListener("contextmenu",this.handleDOMContextMenu)}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1,this.mousedown=!1,this.dragstart=!1},onKeyDown:function(e){var t=this,r=e.key;!r||(Ggr.indexOf(r.toLowerCase())>-1?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(e){var t,r,i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(z3(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(Wh(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,l=o.edge,u=o.combo,h=(r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t);if(!s&&h==="node"||!l&&h==="edge"||!u&&h==="combo")return!1}return!0}},Ugr={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(e){if(!this.origin||!e||e.destroyed)return!1;var t=e.getType();return t==="combo"},onTouchStart:function(e){if(!!e.item){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},this.dragstart=!0,t.onDragStart(e)}},onTouchMove:function(e){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a){t.onDragEnd(e);return}e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.onDrag(e)},onMouseDown:function(e){this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},typeof window<"u"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(e){var t,r;if(((r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t))!=="node"){this.onDragEnd();return}!this.mousedown||(this.dragstart?this.onDrag(ve(ve({},e),this.mousedown)):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin(ve(ve({},e),this.mousedown),this)){var r=this.mousedown,i=r.item,a=r.target;if(!(!i||i.destroyed||i.hasLocked())){var o=i.getContainer();if(o.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(i),a){var s=a.get("isAnchorPoint");if(s)return}var l=this.graph;this.targets=[],this.targetCombo=null;var u=l.findAllByState("node",this.selectedState),h=i.get("id"),c=u.filter(function(d){var v=d.get("id");return h===v});if(c.length===0?this.targets.push(i):u.length>1?u.forEach(function(d){var v=d.hasLocked();v||t.targets.push(d)}):this.targets.push(i),this.graph.get("enabledStack")&&this.enableStack){var f=[];this.targets.forEach(function(d){var v=d.getModel(),p=v.x,g=v.y,m=v.id;f.push({x:p,y:g,id:m})}),this.set("beforeDragNodes",f)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(d){var v=d.getEdges();v.forEach(function(p){!p.isVisible()||(t.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(e){var t=this;if(!(!this.mousedown||!this.origin)&&!!this.shouldUpdate(e,this))if(this.get("enableDelegate"))this.updateDelegate(e);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(i){t.update(i,e);var a=i.getModel().comboId;a&&(r[a]=t.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(e){var t=this,r;if(this.mousedown=!1,this.dragstart=!1,typeof window<"u"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(r=this.cachedCaptureItems)===null||r===void 0||r.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(l){t.hidenEdge[l.getID()]&&l.show(),l.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push(o)}),this.targets.forEach(function(o){var s=o.getModel(),l=s.x,u=s.y,h=s.id;a.after.nodes.push({x:l,y:u,id:h})}),i.pushStack("update",Xi(a))}i.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(e){var t=e.item;if(this.currentShouldEnd=this.shouldEnd(e,t,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(t))){var r=this.graph;if(this.comboActiveState&&r.setItemState(t,this.comboActiveState,!1),this.targetCombo=t,this.onlyChangeComboSize)r.updateCombos();else{var i=t.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&r.updateComboTree(a,i.id)}),r.updateCombo(t)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(e){var t=this.graph;this.currentShouldEnd=this.shouldEnd(e,void 0,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(r){var i=r.getModel();i.comboId&&t.updateComboTree(r)}))},onDropNode:function(e){if(!(!this.targets||this.targets.length===0)){var t=this,r=e.item,i=t.graph,a=r.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var s=i.findById(a);t.comboActiveState&&i.setItemState(s,t.comboActiveState,!1),this.targets.map(function(l){var u=l.getModel();a!==u.comboId&&i.updateComboTree(l,a)}),i.updateCombo(s)}else this.targets.map(function(l){var u=l.getModel();u.comboId&&i.updateComboTree(l)});i.emit("dragnodeend",{items:this.targets,targetItem:r})}}},onDragEnter:function(e){var t=e.item;if(!!this.validationCombo(t)){var r=this.graph;this.comboActiveState&&r.setItemState(t,this.comboActiveState,!0)}},onDragLeave:function(e){var t=e.item;if(!!this.validationCombo(t)){var r=this.graph;this.comboActiveState&&r.setItemState(t,this.comboActiveState,!1)}},updatePositions:function(e,t){var r=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):t||this.targets.map(function(i){return r.update(i,e)}):this.targets.map(function(i){return r.update(i,e,t)}))},update:function(e,t,r){var i=this.origin,a=e.get("model"),o=e.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=t.x-i.x+this.point[o].x,l=t.y-i.y+this.point[o].y;r&&(s+=i.x-t.x,l+=i.y-t.y);var u={x:s,y:l};this.get("updateEdge")?this.graph.updateItem(e,u,!1):e.updatePosition(u)},debounceUpdate:U3(function(n){var e=n.targets,t=n.graph,r=n.point,i=n.origin,a=n.evt,o=n.updateEdge,s=n.onlyChangeComboSize,l=n.updateParentCombos;e.map(function(u){var h=u.get("model"),c=u.get("id");r[c]||(r[c]={x:h.x||0,y:h.y||0});var f=a.x-i.x+r[c].x,d=a.y-i.y+r[c].y,v={x:f,y:d};o?t.updateItem(u,v,!1):u.updatePosition(v)}),s&&l(t,e)},50,!0),updateDelegate:function(e){var t=this.graph;if(this.delegateRect){var f=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:f,y:d})}else{var r=t.get("group"),i=ms({},BE.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(e),o=a.x,s=a.y,l=a.width,u=a.height,h=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:l,height:u,minX:h,minY:c},this.delegateRect=r.addShape("rect",{attrs:ve({width:l,height:u,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(e){var t=this.targets;t.length===0&&t.push(e.item);for(var r=1/0,i=-1/0,a=1/0,o=-1/0,s=0;s<t.length;s++){var l=t[s],u=l.getBBox(),h=u.minX,c=u.minY,f=u.maxX,d=u.maxY;h<r&&(r=h),c<a&&(a=c),f>i&&(i=f),d>o&&(o=d)}var v=Math.floor(r),p=Math.floor(a),g=Math.ceil(i)-Math.floor(r),m=Math.ceil(o)-Math.floor(a);return{x:v,y:p,width:g,height:m,minX:r,minY:a}},updateParentCombos:function(e,t){var r=e||this.graph,i=t||this.targets,a={};i==null||i.forEach(function(o){var s=o.getModel().comboId;s&&(a[s]=r.findById(s))}),Object.values(a).forEach(function(o){o&&r.updateCombo(o)})}};var K5=null;const Vgr={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(e){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.setAllItemStates(e)},clearOnTouchStart:function(e){var t=this;try{var r=e.originalEvent.touches,i=r[0],a=r[1];if(i&&a)return;e.preventDefault()}catch{console.warn("Touch original event not exist!")}t.clearActiveState(e)},setAllItemStates:function(e){clearTimeout(this.timer),this.throttleSetAllItemStates(e,this)},clearActiveState:function(e){var t=this,r=this.shouldClearStatusOnSecond;r&&(K5=null),this.timer=setTimeout(function(){t.throttleClearActiveState(e,t)},50)},throttleSetAllItemStates:FD(function(n,e){var t=n.item,r=e.graph;if(!(!r||r.destroyed)&&(e.item=t,!!e.shouldUpdate(n.item,{event:n,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,a=t.getModel().id;if(K5===a&&i){e.throttleClearActiveState(n,e),K5=null;return}for(var o=e.activeState,s=e.inactiveState,l=r.getNodes(),u=r.getCombos(),h=r.getEdges(),c=r.get("vedges"),f=l.length,d=u.length,v=h.length,p=c.length,g=e.inactiveItems||{},m=e.activeItems||{},y=0;y<f;y++){var _=l[y],x=_.getID(),S=_.hasState("selected");e.resetSelected&&S&&r.setItemState(_,"selected",!1),m[x]&&(r.setItemState(_,o,!1),delete m[x]),s&&!g[x]&&(r.setItemState(_,s,!0),g[x]=_)}for(var y=0;y<d;y++){var w=u[y],b=w.getID(),S=w.hasState("selected");e.resetSelected&&S&&r.setItemState(w,"selected",!1),m[b]&&(r.setItemState(w,o,!1),delete m[b]),s&&!g[b]&&(r.setItemState(w,s,!0),g[b]=w)}for(var y=0;y<v;y++){var E=h[y],T=E.getID();m[T]&&(r.setItemState(E,o,!1),delete m[T]),s&&!g[T]&&(r.setItemState(E,s,!0),g[T]=E)}for(var y=0;y<p;y++){var C=c[y],A=C.getID();m[A]&&(r.setItemState(C,o,!1),delete m[A]),s&&!g[A]&&(r.setItemState(C,s,!0),g[A]=C)}if(t&&!t.destroyed){s&&(r.setItemState(t,s,!1),delete g[t.getID()]),m[t.getID()]||(r.setItemState(t,o,!0),m[t.getID()]=t);for(var M=t.getEdges(),I=M.length,y=0;y<I;y++){var E=M[y],T=E.getID(),R=void 0;E.getSource()===t?R=E.getTarget():R=E.getSource();var k=R.getID();s&&g[k]&&(r.setItemState(R,s,!1),delete g[k]),m[k]||(r.setItemState(R,o,!0),m[k]=R),g[T]&&(r.setItemState(E,s,!1),delete g[T]),m[T]||(r.setItemState(E,o,!0),m[T]=E),E.toFront()}}e.activeItems=m,e.inactiveItems=g,i&&(K5=t.getModel().id),r.emit("afteractivaterelations",{item:n.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:FD(function(n,e){var t=e.get("graph");if(!(!t||t.destroyed)&&!!e.shouldUpdate(n.item,{event:n,action:"deactivate"},e)){var r=e.activeState,i=e.inactiveState,a=e.activeItems||{},o=e.inactiveItems||{};Object.values(a).filter(function(s){return!s.destroyed}).forEach(function(s){t.clearItemStates(s,r)}),Object.values(o).filter(function(s){return!s.destroyed}).forEach(function(s){t.clearItemStates(s,i)}),e.activeItems={},e.inactiveItems={},t.emit("afteractivaterelations",{item:n.item||e.get("item"),action:"deactivate"})}},50,{trailing:!0,leading:!0})};var J5=Math.min,I2e=Math.max,L2e=Math.abs,P2e="shift",$gr=["drag","shift","ctrl","alt","control"];const Wgr={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:P2e,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return $gr.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=P2e,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(e){var t=e.item,r=this.brush,i=this.selectOnCombo,a=(t==null?void 0:t.getType())==="combo";a&&!i||!a&&t||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:e.canvasX,y:e.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||this.updateBrush(e)},onMouseUp:function(e){this.graph,!(!this.brush&&!this.dragging)&&(this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(e),this.dragging=!1))},clearStates:function(){var e=this,t=e.graph,r=e.selectedState,i=t.findAllByState("node",r),a=t.findAllByState("edge",r),o=t.findAllByState("combo",r);i.forEach(function(s){return t.setItemState(s,r,!1)}),a.forEach(function(s){return t.setItemState(s,r,!1)}),o.forEach(function(s){return t.setItemState(s,r,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(e,t,r,i,a){var o=e.getBBox();return o.centerX>=t&&o.centerX<=r&&o.centerY>=i&&o.centerY<=a},getSelectedNodes:function(e){var t=this,r=this,i=r.graph,a=r.originPoint,o=r.shouldUpdate,s=r.isBBoxCenterInRect,l=this.selectedState,u={x:e.x,y:e.y},h=i.getPointByCanvas(a.x,a.y),c=J5(u.x,h.x),f=I2e(u.x,h.x),d=J5(u.y,h.y),v=I2e(u.y,h.y),p=[],g=[];i.getNodes().forEach(function(_){if(_.isVisible()&&s(_,c,f,d,v)&&o(_,"select",t)){p.push(_);var x=_.getModel();g.push(x.id),i.setItemState(_,l,!0)}});var m=[];this.includeEdges&&p.forEach(function(_){var x=_.getOutEdges();x.forEach(function(S){if(!!S.isVisible()){var w=S.getModel(),b=w.source,E=w.target;g.includes(b)&&g.includes(E)&&o(S,"select",t)&&(m.push(S),i.setItemState(S,t.selectedState,!0))}})});var y=[];this.includeCombos&&i.getCombos().forEach(function(_){if(_.isVisible()&&s(_,c,f,d,v)&&o(_,"select",t)){y.push(_);var x=_.getModel();g.push(x.id),i.setItemState(_,l,!0)}}),this.selectedEdges=m,this.selectedNodes=p,this.selectedCombos=y,this.onSelect&&this.onSelect(p,m,y),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:m,combos:y},select:!0})},createBrush:function(){var e=this,t=e.graph.get("canvas").addShape("rect",{attrs:e.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(e){var t=this.originPoint;this.brush.attr({width:L2e(e.canvasX-t.x),height:L2e(e.canvasY-t.y),x:J5(e.canvasX,t.x),y:J5(e.canvasY,t.y)})},onKeyDown:function(e){var t=e.key;if(!!t){var r=this.trigger.toLowerCase(),i=t.toLowerCase();i===r||i==="control"&&r==="ctrl"||i==="ctrl"&&r==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var O2e="shift",Hgr=["shift","ctrl","alt","control"];const jgr={getDefaultCfg:function(){return{multiple:!0,trigger:O2e,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var e=this;return Hgr.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=O2e,console.warn("Behavior click-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),e.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(e){var t=this,r=e.item;if(!(!r||r.destroyed)){var i=r.getType(),a=t.graph,o=t.keydown,s=t.multiple,l=t.shouldUpdate,u=t.shouldBegin;if(!!u(e,t)){if(!o||!s){var h=a.findAllByState("node",t.selectedState).concat(a.findAllByState("edge",t.selectedState)).concat(a.findAllByState("combo",t.selectedState));At(h,function(p){p!==r&&a.setItemState(p,t.selectedState,!1)})}var c=function(){switch(i){case"node":return t.selectNode;case"edge":return t.selectEdge;case"combo":return t.selectCombo;default:return!1}}();if(!c){var f=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:f,edges:d,combos:v},select:!1});return}if(r.hasState(t.selectedState)){l(e,t)&&a.setItemState(r,t.selectedState,!1);var f=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:f,edges:d,combos:v},select:!1})}else{l(e,t)&&a.setItemState(r,t.selectedState,!0);var f=a.findAllByState("node",t.selectedState),d=a.findAllByState("edge",t.selectedState),v=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:f,edges:d,combos:v},select:!0})}}}},onCanvasClick:function(e){var t=this,r=this,i=r.graph,a=r.shouldBegin;if(!!a(e,this)){var o=i.findAllByState("node",this.selectedState);At(o,function(u){i.setItemState(u,t.selectedState,!1)});var s=i.findAllByState("edge",this.selectedState);At(s,function(u){i.setItemState(u,t.selectedState,!1)});var l=i.findAllByState("combo",this.selectedState);At(l,function(u){i.setItemState(u,t.selectedState,!1)}),i.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(e){var t=this,r=e.key;!r||(r.toLowerCase()===this.trigger.toLowerCase()||r.toLowerCase()==="control"?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.keydown=!1}};var Xgr=sg,Q5=.05;const Ygr={getDefaultCfg:function(){return this.isFireFox=qHe()==="firefox",{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var e=this.fixSelectedItems;return e.fixState||(e.fixState="selected"),e.fixAll&&(e.fixLineWidth=!0,e.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(e){var t=e.originalEvent.touches,r=t[0],i=t[1];e.preventDefault(),i&&(this.shouldBegin&&!this.shouldBegin(e,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(e){if(!!this.moveable){e.preventDefault();var t=e.originalEvent.touches,r=t[0],i=t[1];if(!!i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(p,g){return Math.hypot(g.x-p.x,g.y-p.y)},o=a({x:r.pageX,y:r.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var l=this.get("minZoom")||this.graph.get("minZoom"),u=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>u||s<l)){var h=this.get("animate"),c=this.get("animateCfg"),f=this.graph.get("canvas"),d=f.getPointByClient(e.clientX,e.clientY);this.graph.zoomTo(s,{x:d.x,y:d.y},h,c),this.graph.emit("wheelzoom",e)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(e){var t=this,r=this,i=r.graph,a=r.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin(e,this))&&!!this.shouldUpdate(e,this)){e.preventDefault();var o=i.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),l=this.get("sensitivity"),u=i.getZoom(),h=u,c=u;this.isFireFox?e.deltaY>0||e.wheelDelta<0?h=1-Q5*l:h=1/(1-Q5*l):e.wheelDelta<0?h=1-Q5*l:h=1/(1-Q5*l),c=u*h;var f=this.get("minZoom")||i.get("minZoom"),d=this.get("maxZoom")||i.get("maxZoom");c>d?c=d:c<f&&(c=f);var v=this.get("enableOptimize");if(v){var p=this.get("optimizeZoom"),g=this.get("optimized"),m=i.getNodes(),y=i.getEdges(),_=m.length,x=y.length;if(!g){for(var S=0;S<_;S++){var w=m[S];if(!w.destroyed)for(var b=w.get("group").get("children"),E=b.length,T=0;T<E;T++){var C=b[T];!C.destoryed&&!C.get("isKeyShape")&&(C.set("ori-visibility",C.get("ori-visibility")||C.get("visible")),C.hide())}}for(var A=0;A<x;A++)for(var M=y[A],b=M.get("group").get("children"),E=b.length,T=0;T<E;T++){var C=b[T];C.set("ori-visibility",C.get("ori-visibility")||C.get("visible")),C.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var I=setTimeout(function(){var ft=i.getZoom(),Oe=t.get("optimized");if(Oe){t.set("optimized",!1);for(var J=0;J<_;J++){var We=m[J],Tt=We.get("group").get("children"),Qe=Tt.length;if(ft<p){var zt=We.getKeyShape(),mt=zt.get("ori-visibility");zt.set("ori-visibility",void 0),mt&&zt.show()}else for(var wt=0;wt<Qe;wt++){var pt=Tt[wt],mt=pt.get("ori-visibility");pt.set("ori-visibility",void 0),!pt.get("visible")&&mt&&mt&&pt.show()}}for(var ar=0;ar<x;ar++){var kt=y[ar],Tt=kt.get("group").get("children"),Qe=Tt.length;if(ft<p){var zt=kt.getKeyShape(),mt=zt.get("ori-visibility");zt.set("ori-visibility",void 0),mt&&zt.show()}else for(var wt=0;wt<Qe;wt++){var pt=Tt[wt];if(!pt.get("visible")){var mt=pt.get("ori-visibility");pt.set("ori-visibility",void 0),mt&&pt.show()}}}}},100);this.set("timeout",I)}if(u<=1){var R=void 0,k=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){R=i.findAllByState("node",a.fixState),k=i.findAllByState("edge",a.fixState);for(var D=u/c,G=R.length,W=0;W<G;W++){var w=R[W],z=w.getContainer(),V=w.getModel(),q=w.getOriginStyle(),Y=w.getStateStyle(a.fixState),le=w.get("shapeFactory").getShape(V.type).getStateStyle(a.fixState,w)[a.fixState];if(a.fixAll){if(c<=1){var j=Xi(z.getMatrix());j||(j=[1,0,0,0,1,0,0,0,1]);var Q=w.getModel(),ie=Q.x,oe=Q.y;j=Xgr(j,[["t",-ie,-oe],["s",D,D],["t",ie,oe]]),z.setMatrix(j)}}else for(var b=z.get("children"),E=b.length,T=0;T<E;T++){var C=b[T],se=void 0,me=void 0;if(a.fixLabel){var Ce=C.get("type");if(Ce==="text"){se=C.attr("fontSize")||12;var Le=Y[C.get("name")],re=le[C.get("name")],yt=Le?Le.fontSize:12,je=re?re.fontSize:12,st=yt||je||12;if(c<=1&&C.attr("fontSize",st/c),me)break}}if(a.fixLineWidth&&C.get("isKeyShape")){me=C.attr("lineWidth")||0;var Nt=Y.lineWidth||le.lineWidth||q.lineWidth||0;if(c<=1&&C.attr("lineWidth",Nt/c),se)break}}}for(var Zt=k.length,qe=0;qe<Zt;qe++)for(var M=k[qe],z=M.getContainer(),b=z.get("children"),V=M.getModel(),Y=M.getStateStyle(a.fixState),le=M.get("shapeFactory").getShape(V.type).getStateStyle(a.fixState,M)[a.fixState],E=b.length,T=0;T<E;T++){var C=b[T],se=void 0,me=void 0;if(a.fixLabel||a.fixAll){var Ce=C.get("type");if(Ce==="text"){se=C.attr("fontSize")||12;var Le=Y[C.get("name")],re=le[C.get("name")],yt=Le?Le.fontSize:12,je=re?re.fontSize:12,st=yt||je||12;if(c<=1&&C.attr("fontSize",st/c),me)break}}if((a.fixLineWidth||a.fixAll)&&C.get("isKeyShape")){me=C.attr("lineWidth")||0;var Nt=Y.lineWidth||le.lineWidth||1;if(c<=1&&C.attr("lineWidth",Nt/c),se)break}}}}var ur=this.get("animate"),Dt=this.get("animateCfg");i.zoomTo(c,{x:s.x,y:s.y},ur,Dt),i.emit("wheelzoom",e)}}},Ije={onMouseEnter:function(e){var t=e.item;this.currentTarget=t,this.showTooltip(e),this.graph.emit("tooltipchange",{item:e.item,action:"show"})},onMouseMove:function(e){if(!this.shouldUpdate(e,this)){this.hideTooltip();return}!this.currentTarget||e.item!==this.currentTarget||this.updatePosition(e)},onMouseLeave:function(e){!this.shouldEnd(e,this)||(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(e){var t=this.container;if(!(!e.item||e.item.destroyed)){t||(t=this.createTooltip(this.graph.get("canvas")),this.container=t);var r=this.formatText(e.item.get("model"),e);rr(r)?t.innerHTML=r:t.appendChild(r),Di(this.container,{visibility:"visible"}),this.updatePosition(e)}},hideTooltip:function(){Di(this.container,{visibility:"hidden"})},updatePosition:function(e){var t=this.get("shouldBegin"),r=this,i=r.width,a=r.height,o=r.container,s=r.graph;if(!t(e,this)){Di(o,{visibility:"hidden"});return}var l=s.getPointByClient(e.clientX,e.clientY),u=s.getCanvasByPoint(l.x,l.y),h=u.x,c=u.y,f=o.getBoundingClientRect();h>i/2?h-=f.width:h+=this.offset,c>a/2?c-=f.height:c+=this.offset;var d="".concat(h,"px"),v="".concat(c,"px");Di(this.container,{left:d,top:v,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var r=zs('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return t.parentNode.appendChild(r),Di(r,{position:"absolute",visibility:"visible"}),this.width=e.get("width"),this.height=e.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},qgr=ve({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Ije),Zgr=ve({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Ije);var R2e="click",Kgr=["click","dblclick"];const Jgr={getDefaultCfg:function(){return{trigger:R2e,onChange:function(){}}},getEvents:function(){var e,t;return Kgr.includes(this.trigger)?t=this.trigger:(t=R2e,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["node:".concat(t)]="onNodeClick",e.touchstart="onNodeClick",e},onNodeClick:function(e){var t=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){t.toggle(e),clearTimeout(t.timer),t.timer=0},200)}else this.toggle(e)},toggle:function(e){var t=e.item;if(!!t){var r=this.graph.findDataById(t.get("id"));if(!!r){var i=r.children;if(!(!i||i.length===0)){var a=!r.collapsed;!this.shouldBegin(e,a,this)||(r.collapsed=a,t.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:e.item,collapsed:a}),this.shouldUpdate(e,a,this)&&(this.onChange(t,a,this),this.graph.layout()))}}}}};var Qgr=H_.calculationItemsBBox,Lje=function(e,t){if(t(e)!==!1&&e){var r=e.get("combos");if(r.length===0)return!1;At(r,function(i){Lje(i,t)})}};const e0r={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(e){var t=e.item;if(!t||t.destroyed||!this.shouldUpdate(e,this))return!1;var r=t.getType();return r==="combo"},onMouseDown:function(e){this.origin={x:e.x,y:e.y}},onDragStart:function(e){var t=this,r=this.graph,i=e.item;if(this.currentShouldEnd=!0,!!this.validationCombo(e)&&!i.hasLocked()){this.targets=[];var a=r.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(u){var h=u.get("id");return o===h});s.length===0?this.targets.push(i):this.targets=a.filter(function(u){return!u.hasLocked()});var l=[];this.targets.forEach(function(u){var h=u.getModel(),c=h.x,f=h.y,d=h.id;l.push({x:c,y:f,id:d})}),this.set("beforeDragItems",l),this.activeState&&this.targets.map(function(u){var h=u.getModel();if(h.parentId){var c=r.findById(h.parentId);c&&r.setItemState(c,t.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],Lje(i,function(u){if(u.destroyed)return!1;var h=u.getModel();return t.currentItemChildCombos.push(h.id),!0})}},onDrag:function(e){var t=this;if(!!this.origin&&!!this.validationCombo(e))if(this.enableDelegate)this.updateDelegate(e);else{if(this.activeState){var r=this.graph,i=e.item,a=i.getModel(),o=r.getCombos(),s=i.getBBox(),l=s.centerX,u=s.centerY,h=s.width,c=o.filter(function(f){var d=f.getModel();return a.parentId,d.id!==a.id&&!t.currentItemChildCombos.includes(d.id)});c.map(function(f){var d=f.getBBox(),v=d.centerX,p=d.centerY,g=d.width,m=l-v,y=u-p,_=2*Math.sqrt(m*m+y*y);h+g-_>.8*h?r.setItemState(f,t.activeState,!0):r.setItemState(f,t.activeState,!1)})}At(this.targets,function(f){t.updateCombo(f,e)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(e,t){var r=this;(this.enableDelegate||t)&&At(this.targets,function(i){r.updateCombo(i,e,t)})},onDrop:function(e){var t=this,r=e.item;if(this.currentShouldEnd=this.shouldEnd(e,r,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!r||!this.targets||r.destroyed)){var i=this.graph,a=r.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(t.activeState&&i.setItemState(r,t.activeState,!1),t.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id,!1)):i.updateCombo(r)}),this.end(r,e),this.endComparison=!0}},onNodeDrop:function(e){var t=this;if(!(!this.targets||this.targets.length===0)){var r=this.graph,i=e.item,a=i.getModel().comboId,o=a?r.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var l=r.findById(a);r.setItemState(l,this.activeState,!1)}this.targets.map(function(u){t.onlyChangeComboSize?r.updateCombo(u):a!==u.getID()&&(s=r.findById(a),a!==u.getModel().parentId&&r.updateComboTree(u,a,!1))})}else this.targets.map(function(u){if(t.onlyChangeComboSize)r.updateCombo(u);else{var h=u.getModel();h.comboId&&r.updateComboTree(u,void 0,!1)}});this.endComparison=!0,this.end(s,e)}}},onDragEnter:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,r=this.graph;this.activeState&&r.setItemState(t,this.activeState,!0)}},onDragLeave:function(e){if(!!this.origin&&!!this.validationCombo(e)){var t=e.item,r=this.graph;this.activeState&&r.setItemState(t,this.activeState,!1)}},onDragEnd:function(e){if(!(!this.targets||this.targets.length===0)){var t=e.item;this.currentShouldEnd&&this.updatePositions(e);var r=this.getParentCombo(t.getModel().parentId),i=this.graph;r&&this.activeState&&i.setItemState(r,this.activeState,!1),this.end(void 0,e)}},end:function(e,t){var r=this;if(!!this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}if(e&&this.activeState&&i.setItemState(e,this.activeState,!1),!e){var o=i.get("enabledStack")&&this.enableStack,s={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(l){if(!r.onlyChangeComboSize)i.updateComboTree(l,void 0,o);else{i.updateCombo(l);var u=l.getModel(),h=u.x,c=u.y,f=u.id;s.after.combos.push({x:h,y:c,id:f}),i.pushStack("update",s)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(e,t,r){var i=this;if(r===void 0&&(r={}),t(e,r)!==!1&&e){var a=e.get("combos");At(a,function(s){i.traverse(s,t,r)});var o=e.get("nodes");At(o,function(s){i.traverse(s,t,r)})}},updateCombo:function(e,t,r){this.updateSingleItem(e,t,r);var i={};this.traverse(e,function(a,o){return a.destroyed?!1:(a.getEdges().forEach(function(s){return o[s.getID()]=s}),!0)},i),Object.values(i).forEach(function(a){return a.refresh()})},updateSingleItem:function(e,t,r){var i=this.origin,a=this.graph,o=e.getModel(),s=e.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var l=t.x-i.x+this.point[s].x,u=t.y-i.y+this.point[s].y;r&&(l+=i.x-t.x,u+=i.y-t.y),a.updateItem(e,{x:l,y:u},!1)},getParentCombo:function(e){var t=this.graph;if(!!e){var r=t.findById(e);if(!!r)return r}},updateDelegate:function(e){var t=this.graph;if(this.delegateShape){var f=e.x-this.origin.x+this.originPoint.minX,d=e.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:f,y:d})}else{var r=t.get("delegateGroup"),i=null;this.targets.length>1?i=Qgr(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,l=i.height,u=i.minX,h=i.minY;this.originPoint={x:a,y:o,width:s,height:l,minX:u,minY:h};var c=ve(ve({},BE.delegateStyle),this.delegateStyle);this.delegateShape=r.addShape("rect",{attrs:ve({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var e=this,t=e.graph,r=e.targets,i={};r==null||r.forEach(function(a){var o=a.getModel().parentId;o&&(i[o]=t.findById(o))}),Object.values(i).forEach(function(a){a&&t.updateCombo(a)})}};var D2e="dblclick",t0r=["click","dblclick"];const r0r={getDefaultCfg:function(){return{trigger:D2e,relayout:!0}},getEvents:function(){var e,t;return t0r.includes(this.trigger)?t=this.trigger:(t=D2e,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["combo:".concat(t)]="onComboClick",e},onComboClick:function(e){var t=e.item,r=this,i=r.graph,a=r.relayout;if(!(!t||t.destroyed||t.getType()!=="combo")){var o=t.getModel(),s=o.id;!s||(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var n0r=H_.isPolygonsIntersect,i0r=H_.pathToPoints,N2e="shift",a0r=["drag","shift","ctrl","alt","control"],o0r=function(e,t){var r,i=e.getKeyShape();if(e.get("type")==="path")r=i0r(i.attr("path"));else{var a=i.getCanvasBBox();r=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return n0r(t,r)};const s0r={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:N2e,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return a0r.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=N2e,console.warn("Behavior lasso-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(e){var t=this.lasso,r=e.item;r||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),t||(t=this.createLasso()),this.dragging=!0,this.originPoint={x:e.x,y:e.y},this.points.push(this.originPoint),t.show())},onDragMove:function(e){!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push({x:e.x,y:e.y}),this.updateLasso(e))},onDragEnd:function(e){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var e=this.points,t=[];return e.length&&(e.forEach(function(r,i){i===0?t.push(["M",r.x,r.y]):t.push(["L",r.x,r.y])}),t.push(["L",e[0].x,e[0].y])),t},clearStates:function(e){e===void 0&&(e="canvas:click");var t=this,r=t.graph,i=t.selectedState,a=t.shouldDeselect,o=r.findAllByState("node",i),s=r.findAllByState("edge",i);(!a||a({action:e,nodes:o,edges:s}))&&(o.forEach(function(l){return r.setItemState(l,i,!1)}),s.forEach(function(l){return r.setItemState(l,i,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var e=this,t=this,r=t.graph,i=t.shouldUpdate,a=this.points.map(function(h){return[r.getCanvasByPoint(h.x,h.y).x,r.getCanvasByPoint(h.x,h.y).y]}),o=this.selectedState,s=[],l=[];r.getNodes().forEach(function(h){if(!!h.isVisible()&&o0r(h,a)&&i(h,"select",e)){s.push(h);var c=h.getModel();l.push(c.id),r.setItemState(h,o,!0)}});var u=[];this.includeEdges&&s.forEach(function(h){var c=h.getOutEdges();c.forEach(function(f){if(!!f.isVisible()){var d=f.getModel(),v=d.source,p=d.target;l.includes(v)&&l.includes(p)&&i(f,"select",e)&&(u.push(f),r.setItemState(f,e.selectedState,!0))}})}),this.selectedEdges=u,this.selectedNodes=s,this.onSelect&&this.onSelect(s,u),r.emit("nodeselectchange",{selectedItems:{nodes:s,edges:u},select:!0})},createLasso:function(){var e=this,t=e.graph.get("delegateGroup").addShape("path",{attrs:ve({path:[]},e.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(e){var t=this;this.lasso.attr({path:t.getLassoPath()})},onKeyDown:function(e){var t=e.key;!t||(t.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}};var k2e="click",l0r=["click","drag"],F2e=void 0,u0r=["shift","ctrl","control","alt","meta",void 0];const h0r={getDefaultCfg:function(){return{trigger:k2e,key:F2e,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;l0r.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=k2e,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),e.key&&u0r.indexOf(e.key.toLowerCase())===-1&&(e.trigger=F2e,console.warn("Behavior create-edge \u7684 key \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'shift'\uFF0C'ctrl'\uFF0C'alt'\uFF0C'control'\uFF0C\u6216 undefined"));var t;return e.trigger==="drag"?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:e.trigger==="click"&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(e){var t=this;if(!(t.key&&!t.keydown)){var r=e.item;(!r||r.getID()===t.source||r.getType()!=="node")&&t.cancelCreating({item:t.edge,x:e.x,y:e.y})}},onClick:function(e){var t=this;if(!(t.key&&!t.keydown)){var r=e.item,i=t.graph,a=r.getModel(),o=t.getEdgeConfig;if(t.addingEdge&&t.edge){if(!t.shouldEnd(e,t))return;var s=void 0;o&&nl(o)?s=o({source:t.source,target:a.id},t):s=t.edgeConfig;var l=ve({target:a.id},s);if(t.source===a.id&&(l.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(t.edge,l,!1),i.get("enabledStack")){var u=ve(ve({},t.edge.getModel()),{itemType:"edge"}),h={};h.edges=[u],i.pushStack("add",{before:{},after:h})}i.emit("aftercreateedge",{edge:t.edge}),t.edge.getKeyShape().set("capture",!0),t.edge=null,t.addingEdge=!1}else{if(!t.shouldBegin(e,t))return;var s=void 0;o&&nl(o)?s=o({source:a.id,target:a.id},t):s=t.edgeConfig,t.edge=i.addItem("edge",ve({source:a.id,target:a.id},s),!1),t.source=a.id,t.addingEdge=!0,t.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(e){var t=this;if(!(t.key&&!t.keydown)){t.edge&&t.edge.destroyed&&t.cancelCreating({item:t.edge});var r={x:e.x,y:e.y};if(!t.graph.findById(t.source)){t.addingEdge=!1;return}t.addingEdge&&t.edge&&t.graph.updateItem(t.edge,{target:r},!1)}},cancelCreating:function(e){var t,r,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=e.item;if(i.addingEdge&&(i.edge===o||((r=(t=e.target)===null||t===void 0?void 0:t.isCanvas)===null||r===void 0?void 0:r.call(t)))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(e){var t=this,r=e.key;!r||(r.toLowerCase()===t.key.toLowerCase()?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.addingEdge&&e.edge&&(e.graph.removeItem(e.edge,!1),e.addingEdge=!1,e.edge=null),this.keydown=!1}};var B2e="ctrl",c0r=["shift","ctrl","alt","control"],f0r="1";const d0r={getDefaultCfg:function(){return{trigger:B2e,combinedKey:f0r,functionName:"fitView",functionParams:[]}},getEvents:function(){return c0r.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=B2e,console.warn("Behavior shortcuts-fit-view \u7684 trigger \u53C2\u6570 '".concat(this.trigger,"' \u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(e){var t=e.key;if(!!t){var r=this.trigger.toLowerCase(),i=t.toLowerCase();this.triggerKeydown||(i===r||i==="control"&&r==="ctrl"||i==="ctrl"&&r==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view \u7684 functionName \u53C2\u6570 '".concat(this.functionName,"' \u4E0D\u5408\u6CD5\uFF0C\u5B83\u4E0D\u662F Graph \u7684\u4E00\u4E2A\u51FD\u6570\u540D")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var v0r=["shift","ctrl","alt","control","meta"];const p0r={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||v0r.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(e){var t=this;if(!!this.allowDrag(e)){var r=this.graph,i=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];i.includes("control")&&i.push("ctrl");var a=i.some(function(V){return e["".concat(V,"Key")]});if(a){var o=r.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),l=r.getZoom();e.wheelDelta>0?l=l+l*.05:l=l-l*.05,r.zoomTo(l,{x:s.x,y:s.y})}else{var u=e.deltaX||e.movementX,h=e.deltaY||e.movementY;!h&&navigator.userAgent.indexOf("Firefox")>-1&&(h=-e.wheelDelta*125/3);var c=this.graph.get("width"),f=this.graph.get("height"),d=this.graph.get("canvas").getCanvasBBox(),v=this.scalableRange,p=this.scalableRange;v<1&&v>-1&&(v=c*v,p=f*p);var g=d.minX,m=d.maxX,y=d.minY,_=d.maxY;u>0?m<-v?u=0:m-u<-v&&(u=m+v):u<0&&(g>c+v?u=0:g-u>c+v&&(u=g-(c+v))),h>0?_<-p?h=0:_-h<-p&&(h=_+p):h<0&&(y>f+p?h=0:y-h>f+p&&(h=y-(f+p))),this.get("direction")==="x"?h=0:this.get("direction")==="y"&&(u=0),r.translate(-u,-h)}e.preventDefault();var x=this.get("enableOptimize");if(x){var S=this.get("optimizeZoom"),w=this.get("optimized"),b=r.getNodes(),E=r.getEdges(),T=b.length,C=E.length;if(!w){for(var A=0;A<T;A++){var M=b[A];if(!M.destroyed)for(var I=M.get("group").get("children"),R=I.length,k=0;k<R;k++){var D=I[k];!D.destoryed&&!D.get("isKeyShape")&&(D.set("ori-visibility",D.get("ori-visibility")||D.get("visible")),D.hide())}}for(var G=0;G<C;G++)for(var W=E[G],I=W.get("group").get("children"),R=I.length,k=0;k<R;k++){var D=I[k];D.set("ori-visibility",D.get("ori-visibility")||D.get("visible")),D.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var z=setTimeout(function(){var V=r.getZoom(),q=t.get("optimized");if(q){t.set("optimized",!1);for(var Y=0;Y<T;Y++){var le=b[Y],j=le.get("group").get("children"),Q=j.length;if(V<S){var ie=le.getKeyShape(),oe=ie.get("ori-visibility");oe&&ie.show()}else for(var se=0;se<Q;se++){var me=j[se],oe=me.get("ori-visibility");!me.get("visible")&&oe&&oe&&me.show()}}for(var Ce=0;Ce<C;Ce++){var Le=E[Ce],j=Le.get("group").get("children"),Q=j.length;if(V<S){var ie=Le.getKeyShape(),oe=ie.get("ori-visibility");oe&&ie.show()}else for(var se=0;se<Q;se++){var me=j[se];if(!me.get("visible")){var oe=me.get("ori-visibility");oe&&me.show()}}}}},100);this.set("timeout",z)}}},allowDrag:function(e){var t,r,i=e.target,a=i&&i.isCanvas&&i.isCanvas();if(z3(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(Wh(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,l=o.edge,u=o.combo,h=(r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t);if(!s&&h==="node"||!l&&h==="edge"||!u&&h==="combo")return!1}return!0}};var g0r={"drag-canvas":zgr,"zoom-canvas":Ygr,"drag-node":Ugr,"activate-relations":Vgr,"brush-select":Wgr,"click-select":jgr,"lasso-select":s0r,tooltip:qgr,"edge-tooltip":Zgr,"collapse-expand":Jgr,"drag-combo":e0r,"collapse-expand-combo":r0r,"create-edge":h0r,"shortcuts-call":d0r,"scroll-canvas":p0r};At(g0r,function(n,e){kUe(e,n)});var y0r=ve(ve({},M7t),DHt);Lu.Grid;Lu.Minimap;Lu.Bundling;Lu.Menu;var m0r=Lu.Fisheye;Lu.ToolBar;Lu.Tooltip;var _0r=Lu.TimeBar,x0r=Lu.ImageMinimap,S0r=Lu.EdgeFilterLens,w0r=Lu.SnapLine;Lu.Legend;var b0r=Lu.Annotation;const JC={version:BE.version,Graph:KHe,TreeGraph:Pdr,Util:H_,Layout:Yi.Layouts,TreeLayout:mdr,registerLayout:_dr,Global:BE,registerBehavior:kUe,registerCombo:g$t,registerEdge:NUe,registerNode:G_,Minimap:Lu.Minimap,Grid:Lu.Grid,Bundling:Lu.Bundling,Menu:Lu.Menu,ToolBar:Lu.ToolBar,Tooltip:Lu.Tooltip,Legend:Lu.Legend,TimeBar:_0r,SnapLine:w0r,Fisheye:m0r,ImageMinimap:x0r,EdgeFilterLens:S0r,Annotation:b0r,Algorithm:y0r,Arrow:LUe,Marker:PUe,Shape:_s};JC.version="4.8.23";class E0r{constructor(){this.config=null,this.graph=null,this.data=null,this.collpasedData={},this.importG6(),this.CLASS_NAME="SuperMap.G6Render"}importG6(){JC||console.log("please import g6, eg\uFF1Ahttps://gw.alipayobjects.com/os/lib/antv/g6/4.3.2/dist/g6.min.js")}initGraph(e){const t=new JC.Graph(e);return this.graph=t,(!e||e.highlightNode!==!1)&&this.highlightNode(t),(!e||e.highlightEdge!==!1)&&this.highlightEdge(t),(e.dragCanvas!==!1||e.dragNode!==!1)&&this.stopDefaultEventPropagation(),t}_getContextMenu(){return new JC.Menu({shouldBegin(t){return!!(t.target&&t.target.isCanvas&&t.target.isCanvas()||t.item)},getContent:t=>{const{item:r}=t;if(t.target&&t.target.isCanvas&&t.target.isCanvas()||!r)return;const i=r.getType(),a=r.getModel();if(i&&a&&i==="node")return this.isCollpased(a.id)?`<ul>
<li id='expand'>\u5C55\u5F00</li>
</ul>`:`<ul>
<li id='collapse'>\u6298\u53E0</li>
</ul>`},handleMenuClick:(t,r)=>{switch(t.id.split("-")[0]){case"hide":this.hideItem(r);break;case"expand":this.expandNode(r);break;case"collapse":this.collapseNode(r);break;case"show":this.showItem(r);break}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}_getGraphConfig(e){const t={speed:120,maxIteration:83,tick:()=>{this.refreshPositions()}},r={type:"fruchterman",gravity:5},i={},a={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},o={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),l=[new JC.ToolBar,s],u="#b4d6ff",h={lineWidth:3,stroke:u},c={stroke:u,shadowColor:u,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:u}},f=(v="knowledgeGraph")=>{const p=document.querySelector(`#${v}`);return{container:v,width:p.scrollWidth,height:p.scrollHeight,plugins:l,modes:o,layout:{...r,...t},defaultNode:i,defaultEdge:a,nodeStateStyles:{hover:h},edgeStateStyles:{hover:c}}};if(!e)return this._setToolBarStyle(),f();e.container=e.container||"knowledgeGraph";const d=typeof e.container=="string"?document.querySelector(`#${e.container}`):e.container;return e.width=e.width||d.scrollWidth,e.height=e.height||d.scrollHeight,e.layout={...r,...e.layout||{},...e.animate!==!1?t:{}},e.defaultNode={...i,...e.defaultNode||{}},e.defaultEdge={...a,...e.defaultEdge||{}},e.modes={default:[e.dragCanvas!==!1&&"drag-canvas",e.zoomCanvas!==!1&&"zoom-canvas",e.dragNode!==!1&&"drag-node"]},e.nodeStateStyles={hover:{...h,...e.nodeHighlightStyle||{}}},e.edgeStateStyles={hover:{...c,...e.edgeHighlightStyle||{}}},e.showToolBar!==!1&&(e.plugins=[new JC.ToolBar],this._setToolBarStyle()),e.showContextMenu!==!1&&(e.plugins=[...e.plugins||[],s],this._setToolBarStyle()),e}changeSize(e,t){return this.graph.changeSize(e,t)}autoResize(){const e=this.getContainer();window.addEventListener("resize",()=>{const t=e.scrollWidth,r=e.scrollHeight;this.graph.changeSize(t,r),this.graph.refresh()})}zoom(e,t,r,i){this.graph.zoom(e,t,r,i)}zoomTo(e,t,r,i){this.graph.zoomTo(e,t,r,i)}fitView(e,t,r,i){this.graph.fitView(e,t,r,i)}fitCenter(e,t){this.graph.fitCenter(e,t)}getGraphCenterPoint(){return this.graph.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graph.getViewPortCenterPoint()}getZoom(){return this.graph.getZoom()}getMinZoom(){return this.graph.getMinZoom()}setMinZoom(e){this.graph.setMinZoom(e)}getMaxZoom(){return this.graph.getMaxZoom()}setMaxZoom(e){this.graph.setMaxZoom(e)}getWidth(){return this.graph.getWidth()}getHeight(){return this.graph.getHeight()}setCenter(e){var t=this.graph.getWidth()/2,r=this.graph.getHeight()/2,i=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-i.x,r-i.y)}_setToolBarStyle(){cT.exports(`
.g6-component-toolbar li[code='redo'],
.g6-component-toolbar li[code='undo'],
.g6-component-toolbar li[code='realZoom'] {
display: none;
}
.g6-component-contextmenu {
position: absolute;
z-index: 2;
list-style-type: none;
border-radius: 6px;
font-size: 14px;
width: fit-content;
transition: opacity .2s;
text-align: center;
box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);
border: 0px;
}
.g6-component-contextmenu ul {
padding-left: 0px;
margin: 0;
}
.g6-component-contextmenu li {
cursor: pointer;
list-style-type: none;
list-style: none;
margin-left: 0;
line-height: 38px;
padding: 0px 35px;
}
.g6-component-contextmenu li:hover {
color: #333;
background: #aaaaaa45;
}
`)}highlightNode(e=this.graph){function t(){e.setAutoPaint(!1),e.getNodes().forEach(function(r){e.clearItemStates(r)}),e.paint(),e.setAutoPaint(!0)}e.on("node:mouseenter",function(r){const i=r.item;e.setAutoPaint(!1),e.getNodes().forEach(function(a){e.clearItemStates(a)}),e.setItemState(i,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("node:mouseleave",t)}highlightEdge(e=this.graph){function t(){e.setAutoPaint(!1),e.getEdges().forEach(function(r){e.clearItemStates(r)}),e.paint(),e.setAutoPaint(!0)}e.on("edge:mouseenter",function(r){const i=r.item;e.setAutoPaint(!1),e.getNodes().forEach(function(a){e.clearItemStates(a)}),e.setItemState(i,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("edge:mouseleave",t)}setData(e,t=this.graph){this.data?t.changeData(e):t.data(e),this.data=e}render(e=this.graph){return e.render()}updateGraph(e,t=this.graph){this.data=e,t.changeData(e)}refresh(e=this.graph){e.refresh()}getContainer(e=this.graph){return e.getContainer()}getCanvas(e=this.graph){return e.get("canvas")}getNodes(e=this.graph){return e.getNodes()}getEdges(e=this.graph){return e.getEdges()}getNeighbors(e,t,r=this.graph){return r.getNeighbors(e,t)}findById(e,t=this.graph){return t.findById(e)}find(e,t,r=this.graph){return r.find(e,t)}findAll(e,t,r=this.graph){return r.findAll(e,t)}getEdgesByNode(e){return e.getEdges()}getInEdges(e){return e.getInEdges()}getOutEdges(e){return e.getOutEdges()}getSourceByEdge(e){return e.getSource()}getTargetByEdge(e){return e.getTarget()}expandNode(e){const t=e.getModel().id;this._expandCollapseNode(this.collpasedData[t],"show"),delete this.collpasedData[t]}collapseNode(e){const t=e.getModel().id,r=[];this._collapseFunc(e,r),this.collpasedData[t]=r,this._expandCollapseNode(r)}isCollpased(e){return!!this.collpasedData[e]}_collapseFunc(e,t=[]){const r=this.getNeighbors(e,"target"),i=this.getNeighbors(e,"source");for(let a=0;a<r.length;a++){const o=r[a],s=o.getModel();this.getNeighbors(o).length===1&&t.push({id:s.id})}for(let a=0;a<i.length;a++){const o=i[a],s=o.getModel();let l=this.getNeighbors(o),u=this.getNeighbors(o,"source");if(l.length===1||u.length===0)t.push({id:s.id});else{const h=[];this._collapseFunc(o,h),t.push({id:s.id,children:h})}}return t}_expandCollapseNode(e,t="hide"){!e||e.forEach(r=>{t==="hide"?this.hideItem(r.id):(this.showItem(r.id),this.isCollpased(r.id)&&delete this.collpasedData[r.id]),r.children&&this._expandCollapseNode(r.children,t)})}showItem(e,t,r=this.graph){r.showItem(e,t)}hideItem(e,t,r=this.graph){r.hideItem(e,t)}show(e){e.show()}hide(e){e.hide()}changeVisibility(e,t){e.changeVisibility(t)}isVisible(e){return e.isVisible()}getModel(e){return e.getModel()}addItem(e,t,r=this.graph){r.addItem(e,t)}removeItem(e,t=this.graph){t.removeItem(e)}updateItem(e,t,r=this.graph){r.updateItem(e,t)}refreshItem(e,t=this.graph){t.refreshItem(e)}refreshPositions(e=this.graph){e.refreshPositions()}on(e,t,r=this.graph){r.on(e,t)}off(e,t,r=this.graph){r.off(e,t)}toDataURL(e,t,r=this.graph){r.toDataURL(e,t)}bindNodeDefaultDragEvent(e=this.graph){e.on("node:dragstart",function(t){G2e(t)}),e.on("node:drag",function(t){G2e(t)}),e.on("node:dragend",function(t){t.item.get("model").fx=null,t.item.get("model").fy=null})}stopDefaultEventPropagation(e=this.graph){e.on("click",function(t){t.stopPropagation()}),e.on("mousedown",function(t){t.stopPropagation()}),e.on("mouseover",function(t){t.stopPropagation()}),e.on("mouseout",function(t){t.stopPropagation()})}clear(e=this.graph){e.clear()}destroy(e=this.graph){e.destroy()}}function G2e(n){const e=n.item.get("model");return e.fx=n.x,e.fy=n.y,e.x=n.x,e.y=n.y,e}var yte={exports:{}};(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",o="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",c="[object GeneratorFunction]",f="[object Map]",d="[object Number]",v="[object Object]",p="[object Promise]",g="[object RegExp]",m="[object Set]",y="[object String]",_="[object Symbol]",x="[object WeakMap]",S="[object ArrayBuffer]",w="[object DataView]",b="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",M="[object Uint8Array]",I="[object Uint8ClampedArray]",R="[object Uint16Array]",k="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,G=/\w*$/,W=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,V={};V[a]=V[o]=V[S]=V[w]=V[s]=V[l]=V[b]=V[E]=V[T]=V[C]=V[A]=V[f]=V[d]=V[v]=V[g]=V[m]=V[y]=V[_]=V[M]=V[I]=V[R]=V[k]=!0,V[u]=V[h]=V[x]=!1;var q=typeof at=="object"&&at&&at.Object===Object&&at,Y=typeof self=="object"&&self&&self.Object===Object&&self,le=q||Y||Function("return this")(),j=e&&!e.nodeType&&e,Q=j&&!0&&n&&!n.nodeType&&n,ie=Q&&Q.exports===j;function oe(Te,gt){return Te.set(gt[0],gt[1]),Te}function se(Te,gt){return Te.add(gt),Te}function me(Te,gt){for(var B=-1,O=Te?Te.length:0;++B<O&&gt(Te[B],B,Te)!==!1;);return Te}function Ce(Te,gt){for(var B=-1,O=gt.length,F=Te.length;++B<O;)Te[F+B]=gt[B];return Te}function Le(Te,gt,B,O){var F=-1,N=Te?Te.length:0;for(O&&N&&(B=Te[++F]);++F<N;)B=gt(B,Te[F],F,Te);return B}function re(Te,gt){for(var B=-1,O=Array(Te);++B<Te;)O[B]=gt(B);return O}function yt(Te,gt){return Te==null?void 0:Te[gt]}function je(Te){var gt=!1;if(Te!=null&&typeof Te.toString!="function")try{gt=!!(Te+"")}catch{}return gt}function st(Te){var gt=-1,B=Array(Te.size);return Te.forEach(function(O,F){B[++gt]=[F,O]}),B}function Nt(Te,gt){return function(B){return Te(gt(B))}}function Zt(Te){var gt=-1,B=Array(Te.size);return Te.forEach(function(O){B[++gt]=O}),B}var qe=Array.prototype,ur=Function.prototype,Dt=Object.prototype,ft=le["__core-js_shared__"],Oe=function(){var Te=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||"");return Te?"Symbol(src)_1."+Te:""}(),J=ur.toString,We=Dt.hasOwnProperty,Tt=Dt.toString,Qe=RegExp("^"+J.call(We).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=ie?le.Buffer:void 0,mt=le.Symbol,wt=le.Uint8Array,pt=Nt(Object.getPrototypeOf,Object),ar=Object.create,kt=Dt.propertyIsEnumerable,Dr=qe.splice,Sr=Object.getOwnPropertySymbols,jr=zt?zt.isBuffer:void 0,pn=Nt(Object.keys,Object),Jn=sf(le,"DataView"),Rn=sf(le,"Map"),hi=sf(le,"Promise"),yn=sf(le,"Set"),Oi=sf(le,"WeakMap"),oi=sf(Object,"create"),Gi=Xs(Jn),ws=Xs(Rn),Sl=Xs(hi),Os=Xs(yn),no=Xs(Oi),vo=mt?mt.prototype:void 0,No=vo?vo.valueOf:void 0;function Jo(Te){var gt=-1,B=Te?Te.length:0;for(this.clear();++gt<B;){var O=Te[gt];this.set(O[0],O[1])}}function Lo(){this.__data__=oi?oi(null):{}}function hs(Te){return this.has(Te)&&delete this.__data__[Te]}function Rs(Te){var gt=this.__data__;if(oi){var B=gt[Te];return B===r?void 0:B}return We.call(gt,Te)?gt[Te]:void 0}function Pn(Te){var gt=this.__data__;return oi?gt[Te]!==void 0:We.call(gt,Te)}function mo(Te,gt){var B=this.__data__;return B[Te]=oi&&gt===void 0?r:gt,this}Jo.prototype.clear=Lo,Jo.prototype.delete=hs,Jo.prototype.get=Rs,Jo.prototype.has=Pn,Jo.prototype.set=mo;function ue(Te){var gt=-1,B=Te?Te.length:0;for(this.clear();++gt<B;){var O=Te[gt];this.set(O[0],O[1])}}function xe(){this.__data__=[]}function ce(Te){var gt=this.__data__,B=Ds(gt,Te);if(B<0)return!1;var O=gt.length-1;return B==O?gt.pop():Dr.call(gt,B,1),!0}function pe(Te){var gt=this.__data__,B=Ds(gt,Te);return B<0?void 0:gt[B][1]}function we(Te){return Ds(this.__data__,Te)>-1}function Me(Te,gt){var B=this.__data__,O=Ds(B,Te);return O<0?B.push([Te,gt]):B[O][1]=gt,this}ue.prototype.clear=xe,ue.prototype.delete=ce,ue.prototype.get=pe,ue.prototype.has=we,ue.prototype.set=Me;function nt(Te){var gt=-1,B=Te?Te.length:0;for(this.clear();++gt<B;){var O=Te[gt];this.set(O[0],O[1])}}function It(){this.__data__={hash:new Jo,map:new(Rn||ue),string:new Jo}}function ot(Te){return Kl(this,Te).delete(Te)}function ht(Te){return Kl(this,Te).get(Te)}function ut(Te){return Kl(this,Te).has(Te)}function qt(Te,gt){return Kl(this,Te).set(Te,gt),this}nt.prototype.clear=It,nt.prototype.delete=ot,nt.prototype.get=ht,nt.prototype.has=ut,nt.prototype.set=qt;function fr(Te){this.__data__=new ue(Te)}function Wr(){this.__data__=new ue}function gr(Te){return this.__data__.delete(Te)}function Ar(Te){return this.__data__.get(Te)}function $n(Te){return this.__data__.has(Te)}function bi(Te,gt){var B=this.__data__;if(B instanceof ue){var O=B.__data__;if(!Rn||O.length<t-1)return O.push([Te,gt]),this;B=this.__data__=new nt(O)}return B.set(Te,gt),this}fr.prototype.clear=Wr,fr.prototype.delete=gr,fr.prototype.get=Ar,fr.prototype.has=$n,fr.prototype.set=bi;function qa(Te,gt){var B=yg(Te)||bc(Te)?re(Te.length,String):[],O=B.length,F=!!O;for(var N in Te)(gt||We.call(Te,N))&&!(F&&(N=="length"||ho(N,O)))&&B.push(N);return B}function Qo(Te,gt,B){var O=Te[gt];(!(We.call(Te,gt)&&zv(O,B))||B===void 0&&!(gt in Te))&&(Te[gt]=B)}function Ds(Te,gt){for(var B=Te.length;B--;)if(zv(Te[B][0],gt))return B;return-1}function af(Te,gt){return Te&&of(gt,_u(gt),Te)}function mh(Te,gt,B,O,F,N,U){var X;if(O&&(X=N?O(Te,F,N,U):O(Te)),X!==void 0)return X;if(!Vv(Te))return Te;var Z=yg(Te);if(Z){if(X=lf(Te),!gt)return Kf(Te,X)}else{var Ae=bs(Te),Re=Ae==h||Ae==c;if(mg(Te))return fg(Te,gt);if(Ae==v||Ae==a||Re&&!N){if(je(Te))return N?Te:{};if(X=gg(Re?{}:Te),!gt)return X0(Te,af(X,Te))}else{if(!V[Ae])return N?Te:{};X=Wm(Te,Ae,mh,gt)}}U||(U=new fr);var Be=U.get(Te);if(Be)return Be;if(U.set(Te,X),!Z)var Je=B?Y0(Te):_u(Te);return me(Je||Te,function(Xe,_t){Je&&(_t=Xe,Xe=Te[_t]),Qo(X,_t,mh(Xe,gt,B,O,_t,Te,U))}),X}function Zl(Te){return Vv(Te)?ar(Te):{}}function jd(Te,gt,B){var O=gt(Te);return yg(Te)?O:Ce(O,B(Te))}function Nl(Te){return Tt.call(Te)}function ec(Te){if(!Vv(Te)||q0(Te))return!1;var gt=Uv(Te)||je(Te)?Qe:W;return gt.test(Xs(Te))}function js(Te){if(!tc(Te))return pn(Te);var gt=[];for(var B in Object(Te))We.call(Te,B)&&B!="constructor"&&gt.push(B);return gt}function fg(Te,gt){if(gt)return Te.slice();var B=new Te.constructor(Te.length);return Te.copy(B),B}function dg(Te){var gt=new Te.constructor(Te.byteLength);return new wt(gt).set(new wt(Te)),gt}function Xd(Te,gt){var B=gt?dg(Te.buffer):Te.buffer;return new Te.constructor(B,Te.byteOffset,Te.byteLength)}function Yd(Te,gt,B){var O=gt?B(st(Te),!0):st(Te);return Le(O,oe,new Te.constructor)}function vg(Te){var gt=new Te.constructor(Te.source,G.exec(Te));return gt.lastIndex=Te.lastIndex,gt}function qf(Te,gt,B){var O=gt?B(Zt(Te),!0):Zt(Te);return Le(O,se,new Te.constructor)}function Zf(Te){return No?Object(No.call(Te)):{}}function pg(Te,gt){var B=gt?dg(Te.buffer):Te.buffer;return new Te.constructor(B,Te.byteOffset,Te.length)}function Kf(Te,gt){var B=-1,O=Te.length;for(gt||(gt=Array(O));++B<O;)gt[B]=Te[B];return gt}function of(Te,gt,B,O){B||(B={});for(var F=-1,N=gt.length;++F<N;){var U=gt[F],X=O?O(B[U],Te[U],U,B,Te):void 0;Qo(B,U,X===void 0?Te[U]:X)}return B}function X0(Te,gt){return of(Te,mu(Te),gt)}function Y0(Te){return jd(Te,_u,mu)}function Kl(Te,gt){var B=Te.__data__;return Es(gt)?B[typeof gt=="string"?"string":"hash"]:B.map}function sf(Te,gt){var B=yt(Te,gt);return ec(B)?B:void 0}var mu=Sr?Nt(Sr,Object):$v,bs=Nl;(Jn&&bs(new Jn(new ArrayBuffer(1)))!=w||Rn&&bs(new Rn)!=f||hi&&bs(hi.resolve())!=p||yn&&bs(new yn)!=m||Oi&&bs(new Oi)!=x)&&(bs=function(Te){var gt=Tt.call(Te),B=gt==v?Te.constructor:void 0,O=B?Xs(B):void 0;if(O)switch(O){case Gi:return w;case ws:return f;case Sl:return p;case Os:return m;case no:return x}return gt});function lf(Te){var gt=Te.length,B=Te.constructor(gt);return gt&&typeof Te[0]=="string"&&We.call(Te,"index")&&(B.index=Te.index,B.input=Te.input),B}function gg(Te){return typeof Te.constructor=="function"&&!tc(Te)?Zl(pt(Te)):{}}function Wm(Te,gt,B,O){var F=Te.constructor;switch(gt){case S:return dg(Te);case s:case l:return new F(+Te);case w:return Xd(Te,O);case b:case E:case T:case C:case A:case M:case I:case R:case k:return pg(Te,O);case f:return Yd(Te,O,B);case d:case y:return new F(Te);case g:return vg(Te);case m:return qf(Te,O,B);case _:return Zf(Te)}}function ho(Te,gt){return gt=gt==null?i:gt,!!gt&&(typeof Te=="number"||z.test(Te))&&Te>-1&&Te%1==0&&Te<gt}function Es(Te){var gt=typeof Te;return gt=="string"||gt=="number"||gt=="symbol"||gt=="boolean"?Te!=="__proto__":Te===null}function q0(Te){return!!Oe&&Oe in Te}function tc(Te){var gt=Te&&Te.constructor,B=typeof gt=="function"&&gt.prototype||Dt;return Te===B}function Xs(Te){if(Te!=null){try{return J.call(Te)}catch{}try{return Te+""}catch{}}return""}function Hm(Te){return mh(Te,!0,!0)}function zv(Te,gt){return Te===gt||Te!==Te&&gt!==gt}function bc(Te){return Ec(Te)&&We.call(Te,"callee")&&(!kt.call(Te,"callee")||Tt.call(Te)==a)}var yg=Array.isArray;function uf(Te){return Te!=null&&_h(Te.length)&&!Uv(Te)}function Ec(Te){return hf(Te)&&uf(Te)}var mg=jr||_g;function Uv(Te){var gt=Vv(Te)?Tt.call(Te):"";return gt==h||gt==c}function _h(Te){return typeof Te=="number"&&Te>-1&&Te%1==0&&Te<=i}function Vv(Te){var gt=typeof Te;return!!Te&&(gt=="object"||gt=="function")}function hf(Te){return!!Te&&typeof Te=="object"}function _u(Te){return uf(Te)?qa(Te):js(Te)}function $v(){return[]}function _g(){return!1}n.exports=Hm})(yte,yte.exports);const T0r=yte.exports;class mte{constructor(e,t="G6"){this.graph=null,this.config=T0r(e),this.graphRender=null,this.type=t,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"}static dataFromGraphMap(e,t){return rxe(e,t)}static dataFromKnowledgeGraphQuery(e){return rxe(e)}handleNodeStatus(e){const{expand:t,collapse:r,hidden:i}=e;this.expandNodes(t),this.collapseNodes(r),this.hideNodes(i)}expandNodes(e){!e||e.forEach(t=>{this.expandNode(t+"")})}collapseNodes(e){!e||e.forEach(t=>{this.collapseNode(t+"")})}hideNodes(e){!e||e.forEach(t=>{this.hideItem(t+"")})}createGraphRender(e){e==="G6"&&(this.graphRender=new E0r)}createGraph(e){const t=this.initGraph(e);return this.graph=t,this.autoResize(),t}getGraph(){return this.graph}autoResize(){this.config&&this.config.autoResize!==!1&&this.graphRender.autoResize()}zoom(e,t,r,i){this.graphRender.zoom(e,t,r,i)}zoomTo(e,t,r,i){this.graphRender.zoomTo(e,t,r,i)}fitView(e,t,r,i){this.graphRender.fitView(e,t,r,i)}fitCenter(e,t){this.graphRender.fitCenter(e,t)}getGraphCenterPoint(){return this.graphRender.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graphRender.getViewPortCenterPoint()}getZoom(){return this.graphRender.getZoom()}getMinZoom(){return this.graphRender.getMinZoom()}setMinZoom(e){this.graphRender.setMinZoom(e)}getMaxZoom(){return this.graphRender.getMaxZoom()}setMaxZoom(e){this.graphRender.setMaxZoom(e)}getWidth(){return this.graphRender.getWidth()}getHeight(){return this.graphRender.getHeight()}initGraph(e){const t=this.graphRender.initGraph(e);this.graph=t;const r=()=>{this.config.zoom!==void 0&&this.zoom(this.config.zoom),this.config.center!==void 0&&this.graphRender.setCenter({x:this.config.center[0],y:this.config.center[1]})};return this.graph.on("beforelayout",r),t}setData(e,t=this.graph){e=e||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(e.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,e.nodes)),this.graphRender.setData(e,t),this.render(t),this.data=e}render(e=this.graph){e&&this.graphRender.render(e)}updateGraph(e,t=this.graph){t&&this.graphRender.updateGraph(e,t)}refresh(){return this.graphRender.refresh()}changeSize(e,t){return this.graphRender.changeSize(e,t)}resize(e,t){this.graphRender.changeSize(e,t),this.graphRender.refresh()}getContainer(){return this.graphRender.getContainer()}getCanvas(){return this.graphRender.getCanvas()}getNodes(){return this.graphRender.getNodes()}getEdges(){return this.graphRender.getEdges()}getNeighbors(e,t){return this.graphRender.getNeighbors(e,t)}findById(e){return this.graphRender.findById(e)}find(e,t){return this.graphRender.find(e,t)}findAll(e,t){return this.graphRender.findAll(e,t)}getEdgesByNode(e){return this.graphRender.getEdgesByNode(e)}getInEdges(e){return this.graphRender.getInEdges(e)}getOutEdges(e){return this.graphRender.getOutEdges(e)}getSourceByEdge(e){return this.graphRender.getSourceByEdge(e)}getTargetByEdge(e){return this.graphRender.getTargetByEdge(e)}expandNode(e){const t=this.findById(e);t&&this.graphRender.expandNode(t)}collapseNode(e){const t=this.findById(e);t&&this.graphRender.collapseNode(t)}showItem(e,t){this.graphRender.showItem(e,t)}hideItem(e,t){this.graphRender.hideItem(e,t)}show(e){this.graphRender.show(e)}hide(e){this.graphRender.hide(e)}changeVisibility(e,t){this.graphRender.changeVisibility(e,t)}isVisible(e){return this.graphRender.isVisible(e)}getModel(e){return this.graphRender.getModel(e)}addItem(e,t){return this.graphRender.addItem(e,t)}removeItem(e){return this.graphRender.removeItem(e)}updateItem(e,t){return this.graphRender.updateItem(e,t)}refreshItem(e){return this.graphRender.refreshItem(e)}refreshPositions(){return this.graphRender.refreshPositions()}on(e,t){this.graphRender.on(e,t)}off(e,t){this.graphRender.off(e,t)}toDataURL(e,t){this.graphRender.toDataURL(e,t)}nodeLabelOpenEllipsis(e,t){return t?e?t.map(r=>{const i=r.labelCfg&&r.labelCfg.fontSize||this.defaultNode&&this.defaultNode.labelCfg&&this.defaultNode.labelCfg.fontSize||14;return r.label=C0r(r.label,e,i),r}):t:[]}clear(e=this.graph){e&&e.clear()}destroy(e=this.graph){e&&e.destroy()}}function C0r(n,e,t){const r=s=>{let l=0;for(let u=0;u<s.length;u++)s.charCodeAt(u)>0&&s.charCodeAt(u)<128?l++:l+=2;return l},i=t*1;e=e*1.6;const a=r(n)*i,o="\u2026";if(a>e){const s=Math.floor((e-20)/i),l=n.substring(0,s);return(n.substring(s).length+o.length)*i>e?l+`
`+n.substring(s,s+s-2)+o:n.substring(s).length==0?l:l+`
`+n.substring(s)}else return n}ae.Lang=rv;ae.i18n=ae.Lang.i18n;ae.Util={...ae.Util,...H};ae.Browser=Ane;ae.INCHES_PER_UNIT=Ii;ae.METERS_PER_INCH=Fn;ae.DOTS_PER_INCH=eE;ae.IS_GECKO=Hat;ae.setCORS=eot;ae.isCORS=DOe;ae.setRequestTimeout=tot;ae.getRequestTimeout=tK;ae.FetchRequest=li;ae.inherit=Vat;ae.mixin=Cne;ae.String=ad;ae.Number=G8;ae.Function=UR;ae.Array=$at;ae.Date=Yat;ae.Event=Ul;ae.Bounds=po;ae.Credential=z8;ae.Events=y0;ae.Feature=LOe;ae.Geometry=rg;ae.Geometry3D=qat;ae.Pixel=WE;ae.Size=a3;ae.Feature.Vector=sc;ae.Geometry.Collection=O0;ae.Geometry.Curve=Mne;ae.Geometry.GeoText=O_;ae.Geometry.LinearRing=tv;ae.Geometry.LineString=Vl;ae.Geometry.MultiLineString=_E;ae.Geometry.MultiPoint=HE;ae.Geometry.MultiPolygon=A1;ae.Geometry.Point=Ki;ae.Geometry.Polygon=_p;ae.Geometry.Rectangle=IOe;ae.Components.Chart=C4t;ae.Components.ChartViewModel=NGe;ae.Components.MessageBox=UNe;ae.Components.AttributesPopContainer=L4t;ae.Components.CityTabsPage=P4t;ae.Components.CommonContainer=A4t;ae.Components.DropDownBox=I4t;ae.Components.IndexTabsPageContainer=FGe;ae.Components.NavTabsPage=O4t;ae.Components.PaginationContainer=R4t;ae.Components.PopContainer=kGe;ae.Components.Select=M4t;ae.Components.TemplateBase=bw;ae.Components.FileReaderUtil=AQ;ae.TimeControlBase=POe;ae.TimeFlowControl=Jat;ae.Format=ae.Format||Ine;ae.Format.GeoJSON=uh;ae.Format.JSON=yz;ae.Format.WKT=Zat;ae.iManager=rot;ae.iManagerCreateNodeParam=rK;ae.iManagerServiceBase=NOe;ae.iPortal=not;ae.iPortalAddDataParam=UOe;ae.iPortalAddResourceParam=nK;ae.iPortalDataConnectionInfoParam=$Oe;ae.iPortalDataMetaInfoParam=iK;ae.iPortalDataStoreInfoParam=VOe;ae.iPortalQueryParam=kOe;ae.iPortalQueryResult=FOe;ae.iPortalRegisterServiceParam=zOe;ae.iPortalResource=BOe;ae.iPortalServiceBase=mz;ae.iPortalShareEntity=iot;ae.iPortalShareParam=GOe;ae.iPortalUser=aot;ae.AddressMatchService=jOe;ae.AggregationParameter=Lne;ae.AreaSolarRadiationParameters=iB;ae.AreaSolarRadiationService=YOe;ae.BucketAggParameter=XOe;ae.BufferAnalystParameters=Pne;ae.BufferAnalystService=ZOe;ae.BufferDistance=aK;ae.BuffersAnalystJobsParameter=KOe;ae.BuffersAnalystJobsService=aB;ae.BufferSetting=qOe;ae.BurstPipelineAnalystParameters=JOe;ae.BurstPipelineAnalystService=QOe;ae.ChartFeatureInfoSpecsService=eRe;ae.ChartQueryFilterParameter=tRe;ae.ChartQueryParameters=rRe;ae.ChartQueryService=nRe;ae.ClipParameter=sot;ae.ColorDictionary=iRe;ae.CommonServiceBase=ra;ae.ComputeWeightMatrixParameters=oRe;ae.ComputeWeightMatrixService=sRe;ae.CreateDatasetParameters=xK;ae.DataFlowService=lRe;ae.DataReturnOption=_z;ae.DatasetBufferAnalystParameters=oK;ae.DatasetInfo=uRe;ae.DatasetOverlayAnalystParameters=sK;ae.DatasetService=jRe;ae.DatasetSurfaceAnalystParameters=lK;ae.DatasetThiessenAnalystParameters=uK;ae.DatasourceConnectionInfo=One;ae.DatasourceService=cRe;ae.DensityAnalystService=fRe;ae.DensityKernelAnalystParameters=hK;ae.EditFeaturesParameters=cK;ae.EditFeaturesService=V8;ae.FacilityAnalyst3DParameters=EI;ae.FacilityAnalystSinks3DParameters=dRe;ae.FacilityAnalystSinks3DService=vRe;ae.FacilityAnalystSources3DParameters=pRe;ae.FacilityAnalystSources3DService=gRe;ae.FacilityAnalystStreamParameters=yRe;ae.FacilityAnalystStreamService=mRe;ae.FacilityAnalystTracedown3DParameters=_Re;ae.FacilityAnalystTracedown3DService=xRe;ae.FacilityAnalystTraceup3DParameters=SRe;ae.FacilityAnalystTraceup3DService=wRe;ae.FacilityAnalystUpstream3DParameters=bRe;ae.FacilityAnalystUpstream3DService=ERe;ae.FieldParameters=TRe;ae.FieldsFilter=KR;ae.FieldStatisticService=ARe;ae.FieldStatisticsParameters=CRe;ae.FilterParameter=Of;ae.FindClosestFacilitiesParameters=MRe;ae.FindClosestFacilitiesService=IRe;ae.FindLocationParameters=LRe;ae.FindLocationService=PRe;ae.FindMTSPPathsParameters=ORe;ae.FindMTSPPathsService=RRe;ae.FindPathParameters=DRe;ae.FindPathService=NRe;ae.FindServiceAreasParameters=kRe;ae.FindServiceAreasService=FRe;ae.FindTSPPathsParameters=BRe;ae.FindTSPPathsService=GRe;ae.GenerateSpatialDataParameters=zRe;ae.GenerateSpatialDataService=URe;ae.GeoCodingParameter=WOe;ae.GeoDecodingParameter=HOe;ae.GeoHashGridAggParameter=lot;ae.GeometryBatchAnalystService=aNe;ae.GeometryBufferAnalystParameters=U8;ae.GeometryOverlayAnalystParameters=$8;ae.GeometrySurfaceAnalystParameters=VRe;ae.GeometryThiessenAnalystParameters=W8;ae.GeoprocessingService=$Re;ae.GeoRelationAnalystParameters=WRe;ae.GeoRelationAnalystService=HRe;ae.GetFeaturesByBoundsParameters=xE;ae.GetFeaturesByBoundsService=XRe;ae.GetFeaturesByBufferParameters=fK;ae.GetFeaturesByBufferService=YRe;ae.GetFeaturesByGeometryParameters=qRe;ae.GetFeaturesByGeometryService=ZRe;ae.GetFeaturesByIDsParameters=KRe;ae.GetFeaturesByIDsService=JRe;ae.GetFeaturesBySQLParameters=VR;ae.GetFeaturesBySQLService=H8;ae.GetFeaturesParametersBase=TI;ae.GetFeaturesServiceBase=CI;ae.GetFieldsService=QRe;ae.GetGridCellInfosParameters=eDe;ae.GetGridCellInfosService=tDe;ae.GetLayersInfoService=lDe;ae.Grid=aDe;ae.HillshadeParameter=wot;ae.Image=oDe;ae.ImageCollectionService=ANe;ae.ImageGFAspect=jne;ae.ImageGFHillShade=Hne;ae.ImageGFOrtho=Xne;ae.ImageGFSlope=Yne;ae.ImageRenderingRule=h3;ae.ImageSearchParameter=Wne;ae.ImageService=MNe;ae.ImageStretchOption=cM;ae.InterpolationAnalystParameters=Dy;ae.InterpolationAnalystService=dDe;ae.InterpolationDensityAnalystParameters=hDe;ae.InterpolationIDWAnalystParameters=cDe;ae.InterpolationKrigingAnalystParameters=fDe;ae.InterpolationRBFAnalystParameters=uDe;ae.JoinItem=nDe;ae.KernelDensityJobParameter=vDe;ae.KernelDensityJobsService=oB;ae.LabelImageCell=uot;ae.LabelMatrixCell=Lz;ae.LabelMixedTextStyle=wz;ae.LabelSymbolCell=hot;ae.LabelThemeCell=cot;ae.LayerStatus=fot;ae.LinkItem=dot;ae.MappingParameters=Am;ae.MapService=dK;ae.MathExpressionAnalysisParameters=vK;ae.MathExpressionAnalysisService=pDe;ae.MeasureParameters=gDe;ae.MeasureService=yDe;ae.MetricsAggParameter=oot;ae.NDVIParameter=Sot;ae.NetworkAnalystServiceBase=Bd;ae.OutputSetting=Cm;ae.OverlapDisplayedOptions=vot;ae.OverlayAnalystParameters=Rne;ae.OverlayAnalystService=mDe;ae.OverlayGeoJobParameter=_De;ae.OverlayGeoJobsService=sB;ae.PointWithMeasure=pz;ae.ProcessingServiceBase=Mm;ae.QueryByBoundsParameters=xDe;ae.QueryByBoundsService=SDe;ae.QueryByDistanceParameters=wDe;ae.QueryByDistanceService=bDe;ae.QueryByGeometryParameters=EDe;ae.QueryByGeometryService=TDe;ae.QueryBySQLParameters=ZR;ae.QueryBySQLService=j8;ae.DatasetMinDistanceAnalystParameters=ADe;ae.MinDistanceAnalystService=MDe;ae.TerrainCutFillCalculationParameters=gK;ae.TerrainCutFillCalculationService=IDe;ae.terrainAnalystSetting=_ot;ae.TerrainAspectCalculationParameters=yK;ae.TerrainAspectCalculationService=LDe;ae.TerrainSlopeCalculationParameters=mK;ae.TerrainSlopeCalculationService=PDe;ae.GeometryMinDistanceAnalystParameters=pK;ae.ConvexHullAnalystParameters=pot;ae.ConvexHullAnalystService=ODe;ae.TraceAnalystParameters=RDe;ae.TraceAnalystService=DDe;ae.ConnectedEdgesAnalystParameters=NDe;ae.ConnectedEdgesAnalystService=kDe;ae.GetLayersLegendInfoParameters=got;ae.GetLayersLegendInfoService=FDe;ae.QueryParameters=OS;ae.QueryService=BDe;ae.RasterFunctionParameter=Vne;ae.Route=gz;ae.RouteCalculateMeasureParameters=GDe;ae.RouteCalculateMeasureService=zDe;ae.RouteLocatorParameters=UDe;ae.RouteLocatorService=VDe;ae.ServerColor=Js;ae.ServerFeature=u3;ae.ServerGeometry=Vo;ae.ServerStyle=gs;ae.ServerTextStyle=md;ae.ServerTheme=iDe;ae.SetDatasourceParameters=$De;ae.SetLayerInfoParameters=yot;ae.SetLayerInfoService=WDe;ae.SetLayersInfoParameters=mot;ae.SetLayersInfoService=HDe;ae.SetLayerStatusParameters=jDe;ae.SetLayerStatusService=XDe;ae.SingleObjectQueryJobsParameter=YDe;ae.SingleObjectQueryJobsService=lB;ae.Sortby=jE;ae.SpatialAnalystBase=Hu;ae.StopQueryParameters=qDe;ae.StopQueryService=ZDe;ae.SummaryAttributesJobsParameter=KDe;ae.SummaryAttributesJobsService=uB;ae.SummaryMeshJobParameter=JDe;ae.SummaryMeshJobsService=hB;ae.SummaryRegionJobParameter=QDe;ae.SummaryRegionJobsService=cB;ae.SupplyCenter=kne;ae.SurfaceAnalystParameters=xz;ae.SurfaceAnalystParametersSetting=hRe;ae.SurfaceAnalystService=eNe;ae.TerrainCurvatureCalculationParameters=_K;ae.TerrainCurvatureCalculationService=tNe;ae.Theme=R_;ae.ThemeDotDensity=Cz;ae.ThemeFlow=Fne;ae.ThemeGraduatedSymbol=Az;ae.ThemeGraduatedSymbolStyle=qR;ae.ThemeGraph=Tz;ae.ThemeGraphAxes=jR;ae.ThemeGraphItem=Ez;ae.ThemeGraphSize=XR;ae.ThemeGraphText=YR;ae.ThemeGridRange=Bne;ae.ThemeGridRangeItem=Oz;ae.ThemeGridUnique=Gne;ae.ThemeGridUniqueItem=Rz;ae.ThemeLabel=s3;ae.ThemeLabelAlongLine=WR;ae.ThemeLabelBackground=HR;ae.ThemeLabelItem=Sz;ae.ThemeLabelText=$R;ae.ThemeLabelUniqueItem=zne;ae.ThemeMemoryData=xot;ae.ThemeOffset=o_;ae.ThemeParameters=rNe;ae.ThemeRange=Iz;ae.ThemeRangeItem=Mz;ae.ThemeService=nNe;ae.ThemeUnique=bz;ae.ThemeUniqueItem=o3;ae.ThiessenAnalystParameters=Dne;ae.ThiessenAnalystService=iNe;ae.TilesetsService=oNe;ae.TopologyValidatorJobsParameter=sNe;ae.TopologyValidatorJobsService=fB;ae.TransferLine=Une;ae.TransferPathParameters=lNe;ae.TransferPathService=uNe;ae.TransferSolutionParameters=hNe;ae.TransferSolutionService=cNe;ae.TransportationAnalystParameter=$2;ae.TransportationAnalystResultSetting=aRe;ae.UGCLayer=Nne;ae.UGCMapLayer=rDe;ae.UGCSubLayer=l3;ae.UpdateDatasetParameters=SK;ae.UpdateEdgeWeightParameters=fNe;ae.UpdateEdgeWeightService=dNe;ae.UpdateTurnNodeWeightParameters=vNe;ae.UpdateTurnNodeWeightService=pNe;ae.Vector=sDe;ae.VectorClipJobsParameter=gNe;ae.VectorClipJobsService=dB;ae.WebPrintingJobContent=bNe;ae.WebPrintingJobCustomItems=yNe;ae.WebPrintingJobExportOptions=TNe;ae.WebPrintingJobImage=mNe;ae.WebPrintingJobLayers=$ne;ae.WebPrintingJobLayoutOptions=ENe;ae.WebPrintingJobLegendOptions=_Ne;ae.WebPrintingJobLittleMapOptions=xNe;ae.WebPrintingJobNorthArrowOptions=SNe;ae.WebPrintingJobParameters=bot;ae.WebPrintingJobScaleBarOptions=wNe;ae.WebPrintingService=CNe;ae.Online=Mot;ae.OnlineData=LNe;ae.OnlineQueryDatasParameter=Iot;ae.ServiceStatus=Tot;ae.DataItemType=Fat;ae.DataItemOrderBy=Cot;ae.FilterField=Aot;ae.OnlineServiceBase=INe;ae.Feature=ae.Feature||{};ae.Feature.Theme=am;ae.Feature.Theme.Bar=Bst;ae.Feature.Theme.Bar3D=Gst;ae.Feature.Theme.Circle=zst;ae.Feature.Theme.Graph=mw;ae.Feature.Theme.Line=Ust;ae.Feature.Theme.Pie=Vst;ae.Feature.Theme.Point=$st;ae.Feature.Theme.RankSymbol=zNe;ae.Feature.Theme.Ring=Wst;ae.Feature.Theme.ThemeVector=f3;ae.Feature.ShapeParameters=D_;ae.Feature.ShapeParameters.Circle=qne;ae.Feature.ShapeParameters.Image=kNe;ae.Feature.ShapeParameters.Label=Ib;ae.Feature.ShapeParameters.Line=VO;ae.Feature.ShapeParameters.Point=Fz;ae.Feature.ShapeParameters.Polygon=I1;ae.Feature.ShapeParameters.Rectangle=IK;ae.Feature.ShapeParameters.Sector=Bz;ae.Feature.ShapeFactory=Vn;ae.LevelRenderer=Gg;ae.KeyServiceParameter=Lot;ae.SecurityManager=xs;ae.ServerInfo=Pot;ae.TokenServiceParameter=Oot;ae.ThemeStyle=Ast;ae.CartoCSS=Pt;ae.ElasticSearch=Rot;ae.ArrayStatistic=pB;ae.ColorsPickerUtil=vB;ae.DataFormat=Ni;ae.ServerType=KP;ae.GeometryType=Lc;ae.QueryOption=dz;ae.JoinType=cat;ae.SpatialQueryMode=n3;ae.SpatialRelationType=fat;ae.MeasureMode=JZ;ae.Unit=Wl;ae.BufferRadiusUnit=nOe;ae.EngineType=dat;ae.ThemeGraphTextFormat=iOe;ae.ThemeGraphType=aOe;ae.GraphAxesTextDisplayMode=oOe;ae.GraduatedMode=B8;ae.RangeMode=vz;ae.ThemeType=vat;ae.ColorGradientType=i3;ae.TextAlignment=sOe;ae.FillGradientMode=pat;ae.AlongLineDirection=lOe;ae.LabelBackShape=uOe;ae.LabelOverLengthMode=hOe;ae.DirectionType=gat;ae.OverlayOperationType=fOe;ae.OutputType=dOe;ae.SideType=yat;ae.SupplyCenterType=mat;ae.TurnType=_at;ae.BufferEndType=cOe;ae.SmoothMethod=vOe;ae.SurfaceAnalystMethod=pOe;ae.DataReturnMode=gOe;ae.EditType=GR;ae.TransferTactic=yOe;ae.TransferPreference=mOe;ae.GridType=xat;ae.ColorSpaceType=Sat;ae.LayerType=wat;ae.UGCLayerType=bat;ae.StatisticMode=Eat;ae.PixelFormat=Tat;ae.SearchMode=Cat;ae.InterpolationAlgorithmType=Aat;ae.VariogramMode=_Oe;ae.Exponent=xOe;ae.ClientType=bne;ae.ChartType=Mat;ae.ClipAnalystMode=SOe;ae.AnalystAreaUnit=wOe;ae.AnalystSizeUnit=zR;ae.StatisticAnalystMode=bOe;ae.SummaryType=Ene;ae.TopologyValidatorRule=EOe;ae.BucketAggType=TOe;ae.MetricsAggType=COe;ae.GetFeatureMode=Iat;ae.RasterFunctionType=Tne;ae.ResourceType=Lat;ae.OrderBy=Pat;ae.OrderType=Oat;ae.SearchType=Rat;ae.AggregationTypes=Dat;ae.PermissionType=Nat;ae.EntityType=kat;ae.WebExportFormatType=Bat;ae.WebScaleOrientationType=Gat;ae.WebScaleType=zat;ae.WebScaleUnit=Uat;ae.KnowledgeGraph=mte;ae.BoundsType=AOe;ae.CellSizeType=MOe;var A0r=function(){function n(){this.disposed=!1}return n.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},n.prototype.disposeInternal=function(){},n}();const PV=A0r;var M0r=function(){function n(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return n.prototype.preventDefault=function(){this.defaultPrevented=!0},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n}();const Fm=M0r;function I0r(n,e,t){for(var r,i,a=t||f2,o=0,s=n.length,l=!1;o<s;)r=o+(s-o>>1),i=+a(n[r],e),i<0?o=r+1:(s=r,l=!i);return l?o:~o}function f2(n,e){return n>e?1:n<e?-1:0}function OV(n,e,t){var r=n.length;if(n[0]<=e)return 0;if(e<=n[r-1])return r-1;var i=void 0;if(t>0){for(i=1;i<r;++i)if(n[i]<e)return i-1}else if(t<0){for(i=1;i<r;++i)if(n[i]<=e)return i}else for(i=1;i<r;++i){if(n[i]==e)return i;if(n[i]<e)return typeof t=="function"?t(e,n[i-1],n[i])>0?i-1:i:n[i-1]-e<e-n[i]?i-1:i}return r-1}function L0r(n,e,t){for(;e<t;){var r=n[e];n[e]=n[t],n[t]=r,++e,--t}}function em(n,e){for(var t=Array.isArray(e)?e:[e],r=t.length,i=0;i<r;i++)n[n.length]=t[i]}function Iw(n,e){var t=n.length;if(t!==e.length)return!1;for(var r=0;r<t;r++)if(n[r]!==e[r])return!1;return!0}function P0r(n,e,t){var r=e||f2;return n.every(function(i,a){if(a===0)return!0;var o=r(n[a-1],i);return!(o>0||t&&o===0)})}function ZA(){return!0}function RV(){return!1}function d2(){}function O0r(n){var e=!1,t,r,i;return function(){var a=Array.prototype.slice.call(arguments);return(!e||this!==i||!Iw(a,r))&&(e=!0,i=this,r=a,t=n.apply(this,arguments)),t}}var Ao=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),r=1,i=arguments.length;r<i;++r){var a=arguments[r];if(a!=null)for(var o in a)a.hasOwnProperty(o)&&(t[o]=a[o])}return t};function QI(n){for(var e in n)delete n[e]}var Pje=typeof Object.values=="function"?Object.values:function(n){var e=[];for(var t in n)e.push(n[t]);return e};function v2(n){var e;for(e in n)return!1;return!e}var R0r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),D0r=function(n){R0r(e,n);function e(t){var r=n.call(this)||this;return r.eventTarget_=t,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return e.prototype.addEventListener=function(t,r){if(!(!t||!r)){var i=this.listeners_||(this.listeners_={}),a=i[t]||(i[t]=[]);a.indexOf(r)===-1&&a.push(r)}},e.prototype.dispatchEvent=function(t){var r=typeof t=="string",i=r?t:t.type,a=this.listeners_&&this.listeners_[i];if(!!a){var o=r?new Fm(t):t;o.target||(o.target=this.eventTarget_||this);var s=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});i in s||(s[i]=0,l[i]=0),++s[i];for(var u,h=0,c=a.length;h<c;++h)if("handleEvent"in a[h]?u=a[h].handleEvent(o):u=a[h].call(this,o),u===!1||o.propagationStopped){u=!1;break}if(--s[i]===0){var f=l[i];for(delete l[i];f--;)this.removeEventListener(i,d2);delete s[i]}return u}},e.prototype.disposeInternal=function(){this.listeners_&&QI(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1},e.prototype.removeEventListener=function(t,r){var i=this.listeners_&&this.listeners_[t];if(i){var a=i.indexOf(r);a!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[a]=d2,++this.pendingRemovals_[t]):(i.splice(a,1),i.length===0&&delete this.listeners_[t]))}},e}(PV);const eL=D0r,Ci={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function pa(n,e,t,r,i){if(r&&r!==n&&(t=t.bind(r)),i){var a=t;t=function(){n.removeEventListener(e,t),a.apply(this,arguments)}}var o={target:n,type:e,listener:t};return n.addEventListener(e,t),o}function J9(n,e,t,r){return pa(n,e,t,r,!0)}function Ms(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),QI(n))}var N0r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),DV=function(n){N0r(e,n);function e(){var t=n.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Ci.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,r){if(Array.isArray(t)){for(var i=t.length,a=new Array(i),o=0;o<i;++o)a[o]=pa(this,t[o],r);return a}else return pa(this,t,r)},e.prototype.onceInternal=function(t,r){var i;if(Array.isArray(t)){var a=t.length;i=new Array(a);for(var o=0;o<a;++o)i[o]=J9(this,t[o],r)}else i=J9(this,t,r);return r.ol_key=i,i},e.prototype.unInternal=function(t,r){var i=r.ol_key;if(i)k0r(i);else if(Array.isArray(t))for(var a=0,o=t.length;a<o;++a)this.removeEventListener(t[a],r);else this.removeEventListener(t,r)},e}(eL);DV.prototype.on;DV.prototype.once;DV.prototype.un;function k0r(n){if(Array.isArray(n))for(var e=0,t=n.length;e<t;++e)Ms(n[e]);else Ms(n)}const fT=DV;class _l extends fT{constructor(e,t){super(e,t),this.options=t||{},this.url=e,this.dispatchEvent({type:"initialized",value:this})}}class nue extends _l{constructor(e,t){super(e,t)}getMapInfo(e){var t=this,r=new dK(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection});return r.processAsync(e)}getWKT(e){var t=this,r=new dK(`${t.url}/prjCoordSys.wkt`,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,withoutFormatSuffix:!0,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection});return r.processAsync(e)}getTilesets(e){var t=this,r=new oNe(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers});return r.processAsync(e)}}const UM={PROPERTYCHANGE:"propertychange"};function ti(){return function(){throw new Error("Unimplemented abstract method.")}()}var F0r=0;function vi(n){return n.ol_uid||(n.ol_uid=String(++F0r))}var Q9="6.14.1";const B0r=Object.freeze(Object.defineProperty({__proto__:null,abstract:ti,getUid:vi,VERSION:Q9},Symbol.toStringTag,{value:"Module"}));var Oje=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),z2e=function(n){Oje(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.key=r,a.oldValue=i,a}return e}(Fm),G0r=function(n){Oje(e,n);function e(t){var r=n.call(this)||this;return r.on,r.once,r.un,vi(r),r.values_=null,t!==void 0&&r.setProperties(t),r}return e.prototype.get=function(t){var r;return this.values_&&this.values_.hasOwnProperty(t)&&(r=this.values_[t]),r},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&Ao({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,r){var i;i="change:".concat(t),this.hasListener(i)&&this.dispatchEvent(new z2e(i,t,r)),i=UM.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new z2e(i,t,r))},e.prototype.addChangeListener=function(t,r){this.addEventListener("change:".concat(t),r)},e.prototype.removeChangeListener=function(t,r){this.removeEventListener("change:".concat(t),r)},e.prototype.set=function(t,r,i){var a=this.values_||(this.values_={});if(i)a[t]=r;else{var o=a[t];a[t]=r,o!==r&&this.notify(t,o)}},e.prototype.setProperties=function(t,r){for(var i in t)this.set(i,t[i],r)},e.prototype.applyProperties=function(t){!t.values_||Ao(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,r){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],v2(this.values_)&&(this.values_=null),r||this.notify(t,i)}},e}(fT);const kv=G0r,Px={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"};var QS=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",z0r=QS.indexOf("firefox")!==-1,U0r=QS.indexOf("safari")!==-1&&QS.indexOf("chrom")==-1,V0r=U0r&&!!(QS.indexOf("version/15.4")>=0||QS.match(/cpu (os|iphone os) 15_4 like mac os x/)),$0r=QS.indexOf("webkit")!==-1&&QS.indexOf("edge")==-1,W0r=QS.indexOf("macintosh")!==-1,iue=typeof devicePixelRatio<"u"?devicePixelRatio:1,NV=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,H0r=typeof Image<"u"&&Image.prototype.decode,Rje=function(){var n=!1;try{var e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n}();function Ad(n,e,t,r){var i;return t&&t.length?i=t.shift():NV?i=new OffscreenCanvas(n||300,e||300):i=document.createElement("canvas"),n&&(i.width=n),e&&(i.height=e),i.getContext("2d",r)}function U2e(n,e){var t=e.parentNode;t&&t.replaceChild(n,e)}function _te(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function j0r(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function X0r(n,e){for(var t=n.childNodes,r=0;;++r){var i=t[r],a=e[r];if(!i&&!a)break;if(i!==a){if(!i){n.appendChild(a);continue}if(!a){n.removeChild(i),--r;continue}n.insertBefore(a,i)}}}var Y0r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),q0r=function(n){Y0r(e,n);function e(t){var r=n.call(this)||this,i=t.element;return i&&!t.target&&!i.style.pointerEvents&&(i.style.pointerEvents="auto"),r.element=i||null,r.target_=null,r.map_=null,r.listenerKeys=[],t.render&&(r.render=t.render),t.target&&r.setTarget(t.target),r}return e.prototype.disposeInternal=function(){_te(this.element),n.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&_te(this.element);for(var r=0,i=this.listenerKeys.length;r<i;++r)Ms(this.listenerKeys[r]);if(this.listenerKeys.length=0,this.map_=t,t){var a=this.target_?this.target_:t.getOverlayContainerStopEvent();a.appendChild(this.element),this.render!==d2&&this.listenerKeys.push(pa(t,Px.POSTRENDER,this.render,this)),t.render()}},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_=typeof t=="string"?document.getElementById(t):t},e}(kv);const tL=q0r;class Z0r extends tL{constructor(e){e=e||{},e.title||(e.title="switch tile version"),e.tooltip||(e.tooltip="top"),e.collapsed||(e.collapsed=!0),e.lastText||(e.lastText="-"),e.nextText||(e.nextText="+"),e.ico||(e.ico="V"),e.orientation!=="vertical"&&(e.orientation="horizontal"),e.switch||(e.switch=!0),super(e),this.options=e,this.element=e.element=t.call(this),e.layer&&this.setLayer(e.layer);function t(){var u="ol-control-ctv";this._container=r("div",u+" "+u+"-"+e.orientation+" ol-unselectable ol-control"),this._sliderBtn=r("button",u+"-toggle",this._container),this._sliderBtn.setAttribute("title",e.title),this._sliderBtn.innerHTML=e.ico,this._sliderValue=r("p",u+"-value",this._container),this._sliderValue.innerHTML=e.ico,this._sliderValue.setAttribute("title",e.title);var h="ol-ctv-slider";return this._sliderContent=r("div",h+"-main tooltip",this._container),e.orientation==="vertical"&&e.tooltip==="top"&&(e.tooltip="right"),this.tooltip=r("span","tooltip-text tooltip-"+e.tooltip,this._sliderContent),this.tooltip.innerHTML=e.ico,e.switch&&(this._next=r("a",h+"-incdec "+h+"-next",this._sliderContent),this._next.innerHTML=e.nextText,i(this._next,"click",this.nextTilesVersion,this),this._container.classList.add(u+"-incdec")),this._sliderContainer=r("div",h+"-container",this._sliderContent),this.slider=r("input",h,this._sliderContainer),this.min=this.min==null||isNaN(this.min)?0:parseInt(this.min),this.slider.setAttribute("title",e.title),this.slider.setAttribute("id","slider"),this.slider.setAttribute("type","range"),this.slider.setAttribute("min",this.min),this.slider.setAttribute("max",0),this.slider.setAttribute("step",1),this.slider.setAttribute("value",0),this.firstLoad=!0,"oninput"in this.slider||"onchange"in this.slider?i(this.slider,"change",l,this):this.slider.onpropertychange=l,e.switch&&(this._last=r("a",h+"-incdec "+h+"-last",this._sliderContent),this._last.innerHTML=e.lastText,i(this._last,"click",this.lastTilesVersion,this)),e.orientation=="vertical"?(this.slider.style.width=170+"px",this._sliderContainer.style.height=170+"px"):this._sliderContainer.style.width=150+"px",i(this._container,"click",function(c){c.preventDefault(),c.stopPropagation()},this),e.collapsed?(i(this._container,"mouseenter",o,this),i(this._container,"mouseleave",s,this),i(this._sliderBtn,"click",function(c){c.preventDefault(),c.stopPropagation()}),i(this._sliderBtn,"click",o,this),i(this._sliderBtn,"focus",o,this)):o(),this._container}function r(u,h,c){var f=document.createElement(u);return f.className=h||"",c&&c.appendChild(f),f}function i(u,h,c,f){var d=function(p){if(c)return c.call(f||u,p||window.event)},v=d;return"addEventListener"in u?h==="mousewheel"?u.addEventListener("onwheel"in u?"wheel":"mousewheel",d,!1):h==="mouseenter"||h==="mouseleave"?(d=function(p){p=p||window.event,a(u,p)&&v(p)},u.addEventListener(h==="mouseenter"?"mouseover":"mouseout",d,!1)):u.addEventListener(h,d,!1):"attachEvent"in u&&u.attachEvent("on"+h,d),this}function a(u,h){var c=h.relatedTarget;if(!c)return!0;try{for(;c&&c!==u;)c=c.parentNode}catch{return!1}return c!==u}function o(){this._container.classList.add("ol-control-ctv-expanded")}function s(){this._container.classList.remove("ol-control-ctv-expanded")}function l(){var u=this.getVersion();this.tilesVersion(u)}}setContent(e){var t=e||{};this.setVersionName(t.desc).setToolTip(t.desc)}setVersionName(e){var t=e;return e||(t=this.getValue()),this._sliderValue.innerHTML=t,this}setToolTip(e){return this.tooltip.innerHTML=e,this}updateLength(e){e>0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))}setLayer(e){e&&(this.options.layer=e);var t=this,r=t.options.layer;r.on("tilesetsinfoloaded",function(i){var a=i.value&&i.value.tileVersions;t.update(a)}),r.on("tileversionschanged",function(i){var a=i.value&&i.value.tileVersion;t.setContent(a)}),t.getTileSetsInfo()}update(e){this.tileVersions=e||[],this.updateLength(this.tileVersions.length)}getTileSetsInfo(){var e=this;e.options.layer&&new nue(e.options.layer._url).getTilesets(function(r){e.options.layer.setTileSetsInfo(r.result)})}removeLayer(){this.options.layer=null}nextTilesVersion(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)}lastTilesVersion(){return parseInt(this.slider.value)<this.min+1?this:(this.slider.value=parseInt(this.slider.value)-1,this.options.layer.lastTilesVersion(),this)}tilesVersion(e){for(var t=this.options.layer,r=this.tileVersions,i=r.length,a=0;a<i;a++)if(r[a].name==e){t.updateCurrentTileSetsIndex(a),t.changeTilesVersion();break}}getValue(){return this.slider.value}getVersion(){var e=this.tileVersions[this.getValue()];return e&&e.name}}var rL={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Hp={};Hp[rL.RADIANS]=6370997/(2*Math.PI);Hp[rL.DEGREES]=2*Math.PI*6370997/360;Hp[rL.FEET]=.3048;Hp[rL.METERS]=1;Hp[rL.USFEET]=1200/3937;const $c=rL;var e6="ol-hidden",mk="ol-unselectable",aue="ol-control",V2e="ol-collapsed",K0r=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),$2e=["style","variant","weight","size","lineHeight","family"],Dje=function(n){var e=n.match(K0r);if(!e)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=$2e.length;r<i;++r){var a=e[r+1];a!==void 0&&(t[$2e[r]]=a)}return t.families=t.family.split(/,\s?/),t};function Nje(n){return n===1?"":String(Math.round(n*100)/100)}var J0r=function(){function n(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return n.prototype.canWrapX=function(){return this.canWrapX_},n.prototype.getCode=function(){return this.code_},n.prototype.getExtent=function(){return this.extent_},n.prototype.getUnits=function(){return this.units_},n.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Hp[this.units_]},n.prototype.getWorldExtent=function(){return this.worldExtent_},n.prototype.getAxisOrientation=function(){return this.axisOrientation_},n.prototype.isGlobal=function(){return this.global_},n.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},n.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},n.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},n.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},n.prototype.setWorldExtent=function(e){this.worldExtent_=e},n.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},n.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},n}();const ew=J0r;function Ui(n,e,t){return Math.min(Math.max(n,e),t)}var Q0r=function(){var n;return"cosh"in Math?n=Math.cosh:n=function(e){var t=Math.exp(e);return(t+1/t)/2},n}(),eyr=function(){var n;return"log2"in Math?n=Math.log2:n=function(e){return Math.log(e)*Math.LOG2E},n}();function kje(n,e,t,r,i,a){var o=i-t,s=a-r;if(o!==0||s!==0){var l=((n-t)*o+(e-r)*s)/(o*o+s*s);l>1?(t=i,r=a):l>0&&(t+=o*l,r+=s*l)}return VE(n,e,t,r)}function VE(n,e,t,r){var i=t-n,a=r-e;return i*i+a*a}function tyr(n){for(var e=n.length,t=0;t<e;t++){for(var r=t,i=Math.abs(n[t][t]),a=t+1;a<e;a++){var o=Math.abs(n[a][t]);o>i&&(i=o,r=a)}if(i===0)return null;var s=n[r];n[r]=n[t],n[t]=s;for(var l=t+1;l<e;l++)for(var u=-n[l][t]/n[t][t],h=t;h<e+1;h++)t==h?n[l][h]=0:n[l][h]+=u*n[t][h]}for(var c=new Array(e),f=e-1;f>=0;f--){c[f]=n[f][e]/n[f][f];for(var d=f-1;d>=0;d--)n[d][e]-=n[d][f]*c[f]}return c}function u8(n){return n*Math.PI/180}function bS(n,e){var t=n%e;return t*e<0?t+e:t}function S1(n,e,t){return n+t*(e-n)}function Fje(n,e){var t=Math.pow(10,e);return Math.round(n*t)/t}function t6(n,e){return Math.floor(Fje(n,e))}function r6(n,e){return Math.ceil(Fje(n,e))}var ryr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_k=6378137,_A=Math.PI*_k,nyr=[-_A,-_A,_A,_A],iyr=[-180,-85,180,85],n6=_k*Math.log(Math.tan(Math.PI/2)),xC=function(n){ryr(e,n);function e(t){return n.call(this,{code:t,units:$c.METERS,extent:nyr,global:!0,worldExtent:iyr,getPointResolution:function(r,i){return r/Q0r(i[1]/_k)}})||this}return e}(ew),W2e=[new xC("EPSG:3857"),new xC("EPSG:102100"),new xC("EPSG:102113"),new xC("EPSG:900913"),new xC("http://www.opengis.net/def/crs/EPSG/0/3857"),new xC("http://www.opengis.net/gml/srs/epsg.xml#3857")];function ayr(n,e,t){var r=n.length,i=t>1?t:2,a=e;a===void 0&&(i>2?a=n.slice():a=new Array(r));for(var o=0;o<r;o+=i){a[o]=_A*n[o]/180;var s=_k*Math.log(Math.tan(Math.PI*(+n[o+1]+90)/360));s>n6?s=n6:s<-n6&&(s=-n6),a[o+1]=s}return a}function oyr(n,e,t){var r=n.length,i=t>1?t:2,a=e;a===void 0&&(i>2?a=n.slice():a=new Array(r));for(var o=0;o<r;o+=i)a[o]=180*n[o]/_A,a[o+1]=360*Math.atan(Math.exp(n[o+1]/_k))/Math.PI-90;return a}var syr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lyr=6378137,H2e=[-180,-90,180,90],uyr=Math.PI*lyr/180,_b=function(n){syr(e,n);function e(t,r){return n.call(this,{code:t,units:$c.DEGREES,extent:H2e,axisOrientation:r,global:!0,metersPerUnit:uyr,worldExtent:H2e})||this}return e}(ew),j2e=[new _b("CRS:84"),new _b("EPSG:4326","neu"),new _b("urn:ogc:def:crs:OGC:1.3:CRS84"),new _b("urn:ogc:def:crs:OGC:2:84"),new _b("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new _b("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new _b("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],xte={};function hyr(n){return xte[n]||xte[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function cyr(n,e){xte[n]=e}var KA={};function VM(n,e,t){var r=n.getCode(),i=e.getCode();r in KA||(KA[r]={}),KA[r][i]=t}function Bje(n,e){var t;return n in KA&&e in KA[n]&&(t=KA[n][e]),t}const TO={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Ih={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};var fyr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),dyr=function(n){fyr(e,n);function e(t){var r=this,i="v"+Q9.split("-")[0],a="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.";return r=n.call(this,a)||this,r.code=t,r.name="AssertionError",r.message=a,r}return e}(Error);const oue=dyr;function ki(n,e){if(!n)throw new oue(e)}function e7(n){for(var e=Md(),t=0,r=n.length;t<r;++t)MR(e,n[t]);return e}function vyr(n,e,t){var r=Math.min.apply(null,n),i=Math.min.apply(null,e),a=Math.max.apply(null,n),o=Math.max.apply(null,e);return pm(r,i,a,o,t)}function f0(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function Gje(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function dT(n,e,t){var r,i;return e<n[0]?r=n[0]-e:n[2]<e?r=e-n[2]:r=0,t<n[1]?i=n[1]-t:n[3]<t?i=t-n[3]:i=0,r*r+i*i}function dv(n,e){return sue(n,e[0],e[1])}function vv(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function sue(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function Ste(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=e[0],s=e[1],l=Ih.UNKNOWN;return o<t?l=l|Ih.LEFT:o>i&&(l=l|Ih.RIGHT),s<r?l=l|Ih.BELOW:s>a&&(l=l|Ih.ABOVE),l===Ih.UNKNOWN&&(l=Ih.INTERSECTING),l}function Md(){return[1/0,1/0,-1/0,-1/0]}function pm(n,e,t,r,i){return i?(i[0]=n,i[1]=e,i[2]=t,i[3]=r,i):[n,e,t,r]}function xk(n){return pm(1/0,1/0,-1/0,-1/0,n)}function zje(n,e){var t=n[0],r=n[1];return pm(t,r,t,r,e)}function lue(n,e,t,r,i){var a=xk(i);return Vje(a,n,e,t,r)}function m_(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function pyr(n,e,t){return Math.abs(n[0]-e[0])<t&&Math.abs(n[2]-e[2])<t&&Math.abs(n[1]-e[1])<t&&Math.abs(n[3]-e[3])<t}function Uje(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function MR(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function Vje(n,e,t,r,i){for(;t<r;t+=i)gyr(n,e[t],e[t+1]);return n}function gyr(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function $je(n,e){var t;return t=e(kV(n)),t||(t=e(FV(n)),t)||(t=e(BV(n)),t)||(t=e(Lw(n)),t)?t:!1}function wte(n){var e=0;return Sk(n)||(e=Co(n)*lh(n)),e}function kV(n){return[n[0],n[1]]}function FV(n){return[n[2],n[1]]}function kf(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function yyr(n,e){var t;return e===TO.BOTTOM_LEFT?t=kV(n):e===TO.BOTTOM_RIGHT?t=FV(n):e===TO.TOP_LEFT?t=Lw(n):e===TO.TOP_RIGHT?t=BV(n):ki(!1,13),t}function oN(n,e,t,r,i){var a=e*r[0]/2,o=e*r[1]/2,s=Math.cos(t),l=Math.sin(t),u=a*s,h=a*l,c=o*s,f=o*l,d=n[0],v=n[1],p=d-u+f,g=d-u-f,m=d+u-f,y=d+u+f,_=v-h-c,x=v-h+c,S=v+h+c,w=v+h-c;return pm(Math.min(p,g,m,y),Math.min(_,x,S,w),Math.max(p,g,m,y),Math.max(_,x,S,w),i)}function lh(n){return n[3]-n[1]}function tm(n,e,t){var r=t||Md();return Cl(n,e)?(n[0]>e[0]?r[0]=n[0]:r[0]=e[0],n[1]>e[1]?r[1]=n[1]:r[1]=e[1],n[2]<e[2]?r[2]=n[2]:r[2]=e[2],n[3]<e[3]?r[3]=n[3]:r[3]=e[3]):xk(r),r}function Lw(n){return[n[0],n[3]]}function BV(n){return[n[2],n[3]]}function Co(n){return n[2]-n[0]}function Cl(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Sk(n){return n[2]<n[0]||n[3]<n[1]}function myr(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function _yr(n,e){var t=(n[2]-n[0])/2*(e-1),r=(n[3]-n[1])/2*(e-1);n[0]-=t,n[2]+=t,n[1]-=r,n[3]+=r}function xyr(n,e,t){var r=!1,i=Ste(n,e),a=Ste(n,t);if(i===Ih.INTERSECTING||a===Ih.INTERSECTING)r=!0;else{var o=n[0],s=n[1],l=n[2],u=n[3],h=e[0],c=e[1],f=t[0],d=t[1],v=(d-c)/(f-h),p=void 0,g=void 0;!!(a&Ih.ABOVE)&&!(i&Ih.ABOVE)&&(p=f-(d-u)/v,r=p>=o&&p<=l),!r&&!!(a&Ih.RIGHT)&&!(i&Ih.RIGHT)&&(g=d-(f-l)*v,r=g>=s&&g<=u),!r&&!!(a&Ih.BELOW)&&!(i&Ih.BELOW)&&(p=f-(d-s)/v,r=p>=o&&p<=l),!r&&!!(a&Ih.LEFT)&&!(i&Ih.LEFT)&&(g=d-(f-o)*v,r=g>=s&&g<=u)}return r}function bte(n,e,t,r){var i=[];if(r>1)for(var a=n[2]-n[0],o=n[3]-n[1],s=0;s<r;++s)i.push(n[0]+a*s/r,n[1],n[2],n[1]+o*s/r,n[2]-a*s/r,n[3],n[0],n[3]-o*s/r);else i=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]];e(i,i,2);for(var l=[],u=[],s=0,h=i.length;s<h;s+=2)l.push(i[s]),u.push(i[s+1]);return vyr(l,u,t)}function Wje(n,e){var t=e.getExtent(),r=kf(n);if(e.canWrapX()&&(r[0]<t[0]||r[0]>=t[2])){var i=Co(t),a=Math.floor((r[0]-t[0])/i),o=a*i;n[0]-=o,n[2]-=o}return n}function X2e(n,e,t){var r=t!==void 0?n.toFixed(t):""+n,i=r.indexOf(".");return i=i===-1?r.length:i,i>e?r:new Array(1+e-i).join("0")+r}function Syr(n,e){for(var t=(""+n).split("."),r=(""+e).split("."),i=0;i<Math.max(t.length,r.length);i++){var a=parseInt(t[i]||"0",10),o=parseInt(r[i]||"0",10);if(a>o)return 1;if(o>a)return-1}return 0}function wyr(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function Y2e(n,e,t){var r=bS(e+180,360)-180,i=Math.abs(3600*r),a=t||0,o=Math.pow(10,a),s=Math.floor(i/3600),l=Math.floor((i-s*3600)/60),u=i-s*3600-l*60;return u=Math.ceil(u*o)/o,u>=60&&(u=0,l+=1),l>=60&&(l=0,s+=1),s+"\xB0 "+X2e(l,2)+"\u2032 "+X2e(u,2,a)+"\u2033"+(r==0?"":" "+n.charAt(r<0?1:0))}function t7(n,e){for(var t=!0,r=n.length-1;r>=0;--r)if(n[r]!=e[r]){t=!1;break}return t}function uue(n,e){var t=Math.cos(e),r=Math.sin(e),i=n[0]*t-n[1]*r,a=n[1]*t+n[0]*r;return n[0]=i,n[1]=a,n}function byr(n,e){return n[0]*=e,n[1]*=e,n}function hue(n,e){if(e.canWrapX()){var t=Co(e.getExtent()),r=Hje(n,e,t);r&&(n[0]-=r*t)}return n}function Hje(n,e,t){var r=e.getExtent(),i=0;if(e.canWrapX()&&(n[0]<r[0]||n[0]>r[2])){var a=t||Co(r);i=Math.floor((n[0]-r[0])/a)}return i}const Kr={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};var Eyr=63710088e-1;function q2e(n,e,t){var r=t||Eyr,i=u8(n[1]),a=u8(e[1]),o=(a-i)/2,s=u8(e[0]-n[0])/2,l=Math.sin(o)*Math.sin(o)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(a);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var Ete=!0;function Tyr(n){var e=n===void 0?!0:n;Ete=!e}function cue(n,e,t){var r;if(e!==void 0){for(var i=0,a=n.length;i<a;++i)e[i]=n[i];r=e}else r=n.slice();return r}function jje(n,e,t){if(e!==void 0&&n!==e){for(var r=0,i=n.length;r<i;++r)e[r]=n[r];n=e}return n}function fue(n){cyr(n.getCode(),n),VM(n,n,cue)}function Cyr(n){n.forEach(fue)}function ya(n){return typeof n=="string"?hyr(n):n||null}function sN(n,e,t,r){n=ya(n);var i,a=n.getPointResolutionFunc();if(a){if(i=a(e,t),r&&r!==n.getUnits()){var o=n.getMetersPerUnit();o&&(i=i*o/Hp[r])}}else{var s=n.getUnits();if(s==$c.DEGREES&&!r||r==$c.DEGREES)i=e;else{var l=vue(n,ya("EPSG:4326"));if(l===jje&&s!==$c.DEGREES)i=e*n.getMetersPerUnit();else{var u=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];u=l(u,u,2);var h=q2e(u.slice(0,2),u.slice(2,4)),c=q2e(u.slice(4,6),u.slice(6,8));i=(h+c)/2}var o=r?Hp[r]:n.getMetersPerUnit();o!==void 0&&(i/=o)}}return i}function Tte(n){Cyr(n),n.forEach(function(e){n.forEach(function(t){e!==t&&VM(e,t,cue)})})}function Ayr(n,e,t,r){n.forEach(function(i){e.forEach(function(a){VM(i,a,t),VM(a,i,r)})})}function due(n,e){return n?typeof n=="string"?ya(n):n:ya(e)}function Z2e(n){return function(e,t,r){for(var i=e.length,a=r!==void 0?r:2,o=t!==void 0?t:new Array(i),s=0;s<i;s+=a){var l=n([e[s],e[s+1]]);o[s]=l[0],o[s+1]=l[1];for(var u=a-1;u>=2;--u)o[s+u]=e[s+u]}return o}}function Myr(n,e,t,r){var i=ya(n),a=ya(e);VM(i,a,Z2e(t)),VM(a,i,Z2e(r))}function Ry(n,e){if(n===e)return!0;var t=n.getUnits()===e.getUnits();if(n.getCode()===e.getCode())return t;var r=vue(n,e);return r===cue&&t}function vue(n,e){var t=n.getCode(),r=e.getCode(),i=Bje(t,r);return i||(i=jje),i}function __(n,e){var t=ya(n),r=ya(e);return vue(t,r)}function r7(n,e,t){var r=__(e,t);return r(n,void 0,n.length)}function Cte(n,e,t,r){var i=__(e,t);return bte(n,i,void 0,r)}var Iyr=null;function Lyr(){return Iyr}function Ate(n,e){return n}function c1(n,e){return Ete&&!t7(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Ete=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Xje(n,e){return n}function F1(n,e){return n}function K2e(n,e,t){return function(r){var i=r[0],a=r[1],o,s;if(n.canWrapX()){var l=n.getExtent(),u=Co(l);s=Hje(r,n,u),s&&(i=i-s*u),i=Ui(i,l[0],l[2]),a=Ui(a,l[1],l[3]),o=t([i,a])}else o=t(r);return s&&e.canWrapX()&&(o[0]+=s*Co(e.getExtent())),o}}function Pyr(){Tte(W2e),Tte(j2e),Ayr(j2e,W2e,ayr,oyr)}Pyr();var Oyr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),FY="units",xb={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},Ryr=[1,2,5],BY=25.4/.28,Dyr=function(n){Oyr(e,n);function e(t){var r=this,i=t||{},a=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=a+"-inner",r.element.className=a+" "+mk,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(FY,r.handleUnitsChanged_),r.setUnits(i.units||xb.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get(FY)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(FY,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=t.center,i=t.projection,a=this.getUnits(),o=a==xb.DEGREES?$c.DEGREES:$c.METERS,s=sN(i,t.resolution,r,o),l=this.minWidth_*(this.dpi_||BY)/BY,u=l*s,h="";if(a==xb.DEGREES){var c=Hp[$c.DEGREES];u*=c,u<c/60?(h="\u2033",s*=3600):u<c?(h="\u2032",s*=60):h="\xB0"}else a==xb.IMPERIAL?u<.9144?(h="in",s/=.0254):u<1609.344?(h="ft",s/=.3048):(h="mi",s/=1609.344):a==xb.NAUTICAL?(s/=1852,h="nm"):a==xb.METRIC?u<.001?(h="\u03BCm",s*=1e6):u<1?(h="mm",s*=1e3):u<1e3?h="m":(h="km",s/=1e3):a==xb.US?u<.9144?(h="in",s*=39.37):u<1609.344?(h="ft",s/=.30480061):(h="mi",s/=1609.3472):ki(!1,33);for(var f=3*Math.floor(Math.log(l*s)/Math.log(10)),d,v,p;;){p=Math.floor(f/3);var g=Math.pow(10,p);if(d=Ryr[(f%3+3)%3]*g,v=Math.round(d/s),isNaN(v)){this.element.style.display="none",this.renderedVisible_=!1;return}else if(v>=l)break;++f}var m;this.scaleBar_?m=this.createScaleBar(v,d,h):m=d.toFixed(p<0?-p:0)+" "+h,this.renderedHTML_!=m&&(this.innerElement_.innerHTML=m,this.renderedHTML_=m),this.renderedWidth_!=v&&(this.innerElement_.style.width=v+"px",this.renderedWidth_=v),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(t,r,i){for(var a="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),o=[],s=t/this.scaleBarSteps_,l="#ffffff",u=0;u<this.scaleBarSteps_;u++)u===0&&o.push(this.createMarker("absolute",u)),o.push('<div><div class="ol-scale-singlebar" style="width: '+s+"px;background-color: "+l+';"></div>'+this.createMarker("relative",u)+(u%2===0||this.scaleBarSteps_===2?this.createStepText(u,t,!1,r,i):"")+"</div>"),u===this.scaleBarSteps_-1&&o.push(this.createStepText(u+1,t,!0,r,i)),l==="#ffffff"?l="#000000":l="#ffffff";var h;this.scaleBarText_?h='<div class="ol-scale-text" style="width: '+t+'px;">'+a+"</div>":h="";var c='<div style="display: flex;">'+h+o.join("")+"</div>";return c},e.prototype.createMarker=function(t,r){var i=t==="absolute"?3:-10;return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+i+'px;"></div>'},e.prototype.createStepText=function(t,r,i,a,o){var s=t===0?0:Math.round(a/this.scaleBarSteps_*t*100)/100,l=s+(t===0?"":" "+o),u=t===0?-3:r/this.scaleBarSteps_*-1,h=t===0?0:r/this.scaleBarSteps_*2;return'<div class="ol-scale-step-text" style="margin-left: '+u+"px;text-align: "+(t===0?"left":"center")+"; min-width: "+h+"px;left: "+(i?r+"px":"unset")+';">'+l+"</div>"},e.prototype.getScaleForResolution=function(){var t=sN(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,$c.METERS),r=this.dpi_||BY,i=1e3/25.4;return parseFloat(t.toString())*i*r},e.prototype.render=function(t){var r=t.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}(tL);const Nyr=Dyr;class kyr extends Nyr{constructor(e){e=e||{},e.render=function(t){var r=t.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElementRepair()},super(e)}updateElementRepair(){const e=this.viewState_||this.o||this.Om;if(!e){this.renderedVisible_=this.renderedVisible_||this.j||this.yn,this.renderedVisible_&&(this.element_=this.element_||this.c,this.element.style.display="none",this.renderedVisible_=!1);return}const t=e.center,r=e.projection,i=this.getUnits(),a=i=="degrees"?"degrees":"m";let o=sN(r,e.resolution,t,a);this.minWidth_=this.minWidth_||this.v||this.Em;let s=this.minWidth_*o,l="";if(i=="degrees"){const p=Hp.degrees;s*=p,s<p/60?(l="\u2033",o*=3600):s<p?(l="\u2032",o*=60):l="\xB0"}else if(i=="imperial")s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344);else if(i=="nautical")o/=1852,l="nm";else if(i=="metric")s<.001?(l="\u03BCm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3);else if(i=="us")s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472);else throw new oue(33);var u=[1,2,5];let h=3*Math.floor(Math.log(this.minWidth_*o)/Math.log(10)),c,f,d;for(;;){d=Math.floor(h/3);const p=Math.pow(10,d);if(c=u[(h%3+3)%3]*p,f=Math.round(c/o),isNaN(f)){this.element.style.display="none",this.renderedVisible_=!1;return}else if(f>=this.minWidth_)break;++h}this.renderedHTML_=this.renderedHTML_||this.D||this.am,this.innerElement_=this.innerElement_||this.l||this.Tm,this.renderedWidth_=this.renderedWidth_||this.B||this.Am,this.renderedVisible_=this.renderedVisible_||this.j||this.yn,this.element_=this.element_||this.c;let v=c.toFixed(d<0?-d:0)+" "+l;this.renderedHTML_!=v&&(this.innerElement_.innerHTML=v,this.renderedHTML_=v),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+"px",this.renderedWidth_=f),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}}class Fyr extends tL{constructor(e){e=e||{},e.imageUrl=e.imageUrl||null,e.width=e.width||null,e.height=e.height||null,e.alt=e.alt||"SuperMap iClient",super(e),this.options=e,this.element=e.element=t.call(this);function t(){var i="ol-control-logo ol-unselectable ol-control",a=document.createElement("div");a.className=i,r.call(this,a);var o=Kat;this.options.imageUrl&&(o=this.options.imageUrl);var s=this.options.alt,l=this.options.link,u="94px",h="29px",c="width:"+u+";height:"+h+";";return this.options.imageUrl&&(u=this.options.width,h=this.options.height,c="width:"+u+";height:"+h+";",(!u||!h)&&(c="")),a.innerHTML="<a href='"+l+"' target='_blank' style='border: none;display: block;'><img src="+o+" alt='"+s+"' style='border: none;"+c+"white-space: nowrap;margin-bottom: 2px'></a>",a}function r(i){var a=document.getElementsByClassName("ol-attribution");a=a&&a[0];var o=a&&a.clientHeight||29;i.style.bottom=parseInt(o)+6+"px",i.style.right="4px",i.style.marginTop=0,i.style.marginLeft=0,i.style.marginBottom=0,i.style.marginRight=0;var s=document.createElement("style");s.type="text/css",s.innerHTML=".ol-control-logo,.ol-control-logo:hover {background-color: rgba(255,255,255,0);}",document.getElementsByTagName("head")[0].appendChild(s)}}}var J2e={"point-file":"pointFile","point-fill":"fillStyle","point-radius":"pointRadius","point-halo-radius":"pointHaloRadius","point-halo-color":"pointHaloColor","point-dx":"offsetX","point-dy":"offsetY","point-opacity":"globalAlpha","point-comp-op":"globalCompositeOperation"},GY={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","line-offset":"offset","line-comp-op":"globalCompositeOperation"},zY={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","polygon-fill":"fillStyle","polygon-dx":"offsetX","polygon-dy":"offsetY","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"},UY={CartoStyleMap:{TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-vertical-alignment":"textBaseline","text-horizontal-alignment":"textAlign","text-bold":"bold","text-weight":"fontWeight","text-name":"textName","text-halo-radius":"haloRadius","text-halo-color":"backColor","text-fill":"foreColor","text-opacity":"globalAlpha","text-dx":"offsetX","text-dy":"offsetY","text-comp-op":"globalCompositeOperation"},POINT:J2e,MULTIPOINT:J2e,LINE:GY,LINESTRING:GY,MULTILINESTRING:GY,REGION:zY,POLYGON:zY,MULTIPOLYGON:zY},ServerStyleMap:{fillBackOpaque:{canvasStyle:"",type:"bool",defaultValue:!0},lineWidth:{canvasStyle:"lineWidth",type:"number",unit:"mm",defaultValue:.1},fillBackColor:{canvasStyle:"",type:"color",defaultValue:"rgba(0,0,0,0)"},markerWidth:{canvasStyle:"",type:"number",unit:"mm",defaultValue:""},markerAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:""},fillForeColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{canvasStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},fillGradientOffsetRatioX:{canvasStyle:"",type:"number",defaultValue:0},fillGradientOffsetRatioY:{canvasStyle:"",type:"number",defaultValue:0},lineColor:{canvasStyle:"strokeStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},fillOpaqueRate:{canvasStyle:"",type:"number",defaultValue:100},markerHeight:{canvasStyle:"",type:"number",unit:"mm",defaultValue:0},fillGradientMode:{canvasStyle:"",type:"string",defaultValue:"NONE"},fillSymbolID:{canvasStyle:"",type:"number",defaultValue:0},fillGradientAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:0},markerSymbolID:{canvasStyle:"",type:"number",defaultValue:0},lineSymbolID:{canvasStyle:"",type:"number",defaultValue:0}},CartoCompOpMap:{clear:"",src:"",dst:"","src-over":"source-over","dst-over":"destination-over","src-in":"source-in","dst-in":"destination-in","src-out":"source-out","dst-out":"destination-out","src-atop":"source-atop","dst-atop":"destination-atop",xor:"xor",plus:"lighter",minus:"",multiply:"",screen:"",overlay:"",darken:"",lighten:"lighter","color-dodge":"","color-burn":"","hard-light":"","soft-light":"",difference:"",exclusion:"",contrast:"",invert:"","invert-rgb":"","grain-merge":"","grain-extract":"",hue:"",saturation:"",color:"",value:""}},Q2e={pointFile:"",pointRadius:3,pointHaloRadius:1,pointHaloColor:"#c33",offsetX:0,offsetY:0,fillStyle:"#fc0",globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},VY={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineDasharray:[],strokeOpacity:1,offset:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},$Y={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineOpacity:1,fillOpacity:1,lineDasharray:[],fillStyle:"rgba(0,0,0,0)",polygonOpacity:1,offsetX:0,offsetY:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},Byr={TEXT:{font:"10px sans-serif",textAlign:"middle",textBaseline:"center",direction:"ltr",bold:!1,haloRadius:0,backColor:"rgba(255,255,255,1)",foreColor:"rgba(0,0,0,1)",offsetX:0,offsetY:0,textHeight:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},POINT:Q2e,MULTIPOINT:Q2e,LINE:VY,LINESTRING:VY,MULTILINESTRING:VY,REGION:$Y,POLYGON:$Y,MULTIPOLYGON:$Y,SHADOW:{shadowBlur:0,shadowColor:"rgba(0,0,0,0)",shadowOffsetX:0,shadowOffsetY:0},GLOBAL:{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0}},pue=new Array(6);function Nu(){return[1,0,0,1,0,0]}function IR(n){return wk(n,1,0,0,1,0,0)}function nL(n,e){var t=n[0],r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],l=e[0],u=e[1],h=e[2],c=e[3],f=e[4],d=e[5];return n[0]=t*l+i*u,n[1]=r*l+a*u,n[2]=t*h+i*c,n[3]=r*h+a*c,n[4]=t*f+i*d+o,n[5]=r*f+a*d+s,n}function wk(n,e,t,r,i,a,o){return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n[4]=a,n[5]=o,n}function Gyr(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function ks(n,e){var t=e[0],r=e[1];return e[0]=n[0]*t+n[2]*r+n[4],e[1]=n[1]*t+n[3]*r+n[5],e}function zyr(n,e){var t=Math.cos(e),r=Math.sin(e);return nL(n,wk(pue,t,r,-r,t,0,0))}function LR(n,e,t){return nL(n,wk(pue,e,0,0,t,0,0))}function Uyr(n,e,t){return wk(n,e,0,0,t,0,0)}function Vyr(n,e,t){return nL(n,wk(pue,1,0,0,1,e,t))}function Id(n,e,t,r,i,a,o,s){var l=Math.sin(a),u=Math.cos(a);return n[0]=r*u,n[1]=i*l,n[2]=-r*l,n[3]=i*u,n[4]=o*r*u-s*r*l+e,n[5]=o*i*l+s*i*u+t,n}function bk(n,e){var t=$yr(e);ki(t!==0,32);var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5];return n[0]=o/t,n[1]=-i/t,n[2]=-a/t,n[3]=r/t,n[4]=(a*l-o*s)/t,n[5]=-(r*l-i*s)/t,n}function $yr(n){return n[0]*n[3]-n[1]*n[2]}var eTe;function gue(n){var e="matrix("+n.join(", ")+")";if(NV)return e;var t=eTe||(eTe=document.createElement("div"));return t.style.transform=e,t.style.transform}function ES(n,e,t,r,i,a){for(var o=a||[],s=0,l=e;l<t;l+=r){var u=n[l],h=n[l+1];o[s++]=i[0]*u+i[2]*h+i[4],o[s++]=i[1]*u+i[3]*h+i[5]}return a&&o.length!=s&&(o.length=s),o}function Yje(n,e,t,r,i,a,o){for(var s=o||[],l=Math.cos(i),u=Math.sin(i),h=a[0],c=a[1],f=0,d=e;d<t;d+=r){var v=n[d]-h,p=n[d+1]-c;s[f++]=h+v*l-p*u,s[f++]=c+v*u+p*l;for(var g=d+2;g<d+r;++g)s[f++]=n[g]}return o&&s.length!=f&&(s.length=f),s}function Wyr(n,e,t,r,i,a,o,s){for(var l=s||[],u=o[0],h=o[1],c=0,f=e;f<t;f+=r){var d=n[f]-u,v=n[f+1]-h;l[c++]=u+i*d,l[c++]=h+a*v;for(var p=f+2;p<f+r;++p)l[c++]=n[p]}return s&&l.length!=c&&(l.length=c),l}function Hyr(n,e,t,r,i,a,o){for(var s=o||[],l=0,u=e;u<t;u+=r){s[l++]=n[u]+i,s[l++]=n[u+1]+a;for(var h=u+2;h<u+r;++h)s[l++]=n[h]}return o&&s.length!=l&&(s.length=l),s}var jyr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),tTe=Nu(),Xyr=function(n){jyr(e,n);function e(){var t=n.call(this)||this;return t.extent_=Md(),t.extentRevision_=-1,t.simplifiedGeometryMaxMinSquaredTolerance=0,t.simplifiedGeometryRevision=0,t.simplifyTransformedInternal=O0r(function(r,i,a){if(!a)return this.getSimplifiedGeometry(i);var o=this.clone();return o.applyTransform(a),o.getSimplifiedGeometry(i)}),t}return e.prototype.simplifyTransformed=function(t,r){return this.simplifyTransformedInternal(this.getRevision(),t,r)},e.prototype.clone=function(){return ti()},e.prototype.closestPointXY=function(t,r,i,a){return ti()},e.prototype.containsXY=function(t,r){var i=this.getClosestPoint([t,r]);return i[0]===t&&i[1]===r},e.prototype.getClosestPoint=function(t,r){var i=r||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return ti()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var r=this.computeExtent(this.extent_);(isNaN(r[0])||isNaN(r[1]))&&xk(r),this.extentRevision_=this.getRevision()}return myr(this.extent_,t)},e.prototype.rotate=function(t,r){ti()},e.prototype.scale=function(t,r,i){ti()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return ti()},e.prototype.getType=function(){return ti()},e.prototype.applyTransform=function(t){ti()},e.prototype.intersectsExtent=function(t){return ti()},e.prototype.translate=function(t,r){ti()},e.prototype.transform=function(t,r){var i=ya(t),a=i.getUnits()==$c.TILE_PIXELS?function(o,s,l){var u=i.getExtent(),h=i.getWorldExtent(),c=lh(h)/lh(u);return Id(tTe,h[0],h[3],c,-c,0,0,0),ES(o,0,o.length,l,tTe,s),__(i,r)(o,s,l)}:__(i,r);return this.applyTransform(a),this},e}(kv);const vT=Xyr;var Yyr=function(){function n(){}return n.prototype.drawCustom=function(e,t,r,i){},n.prototype.drawGeometry=function(e){},n.prototype.setStyle=function(e){},n.prototype.drawCircle=function(e,t){},n.prototype.drawFeature=function(e,t){},n.prototype.drawGeometryCollection=function(e,t){},n.prototype.drawLineString=function(e,t){},n.prototype.drawMultiLineString=function(e,t){},n.prototype.drawMultiPoint=function(e,t){},n.prototype.drawMultiPolygon=function(e,t){},n.prototype.drawPoint=function(e,t){},n.prototype.drawPolygon=function(e,t){},n.prototype.drawText=function(e,t){},n.prototype.setFillStrokeStyle=function(e,t){},n.prototype.setImageStyle=function(e,t){},n.prototype.setTextStyle=function(e,t){},n}();const qje=Yyr;var qyr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Zyr=/^([a-z]*)$|^hsla?\(.*\)$/i;function Zje(n){return typeof n=="string"?n:Kje(n)}function Kyr(n){var e=document.createElement("div");if(e.style.color=n,e.style.color!==""){document.body.appendChild(e);var t=getComputedStyle(e).color;return document.body.removeChild(e),t}else return""}var Jyr=function(){var n=1024,e={},t=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(t>=n){var a=0;for(var o in e)(a++&3)===0&&(delete e[o],--t)}i=Qyr(r),e[r]=i,++t}return i}}();function n7(n){return Array.isArray(n)?n:Jyr(n)}function Qyr(n){var e,t,r,i,a;if(Zyr.exec(n)&&(n=Kyr(n)),qyr.exec(n)){var o=n.length-1,s=void 0;o<=4?s=1:s=2;var l=o===4||o===8;e=parseInt(n.substr(1+0*s,s),16),t=parseInt(n.substr(1+1*s,s),16),r=parseInt(n.substr(1+2*s,s),16),l?i=parseInt(n.substr(1+3*s,s),16):i=255,s==1&&(e=(e<<4)+e,t=(t<<4)+t,r=(r<<4)+r,l&&(i=(i<<4)+i)),a=[e,t,r,i/255]}else n.indexOf("rgba(")==0?(a=n.slice(5,-1).split(",").map(Number),rTe(a)):n.indexOf("rgb(")==0?(a=n.slice(4,-1).split(",").map(Number),a.push(1),rTe(a)):ki(!1,14);return a}function rTe(n){return n[0]=Ui(n[0]+.5|0,0,255),n[1]=Ui(n[1]+.5|0,0,255),n[2]=Ui(n[2]+.5|0,0,255),n[3]=Ui(n[3],0,1),n}function Kje(n){var e=n[0];e!=(e|0)&&(e=e+.5|0);var t=n[1];t!=(t|0)&&(t=t+.5|0);var r=n[2];r!=(r|0)&&(r=r+.5|0);var i=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+e+","+t+","+r+","+i+")"}function jy(n){return Array.isArray(n)?Kje(n):n}var Jje="10px sans-serif",K1="#000",i7="round",lN=[],uN=0,$M="round",hN=10,cN="#000",fN="center",a7="middle",pE=[0,0,0,0],dN=1,f1=new kv,emr=new eL;emr.setSize=function(){console.warn("labelCache is deprecated.")};var QC=null,Mte,Ite={},tmr=function(){var n=100,e="32px ",t=["monospace","serif"],r=t.length,i="wmytzilWMYTZIL@#/&?$%10\uF013",a,o;function s(u,h,c){for(var f=!0,d=0;d<r;++d){var v=t[d];if(o=o7(u+" "+h+" "+e+v,i),c!=v){var p=o7(u+" "+h+" "+e+c+","+v,i);f=f&&p!=o}}return!!f}function l(){for(var u=!0,h=f1.getKeys(),c=0,f=h.length;c<f;++c){var d=h[c];f1.get(d)<n&&(s.apply(this,d.split(`
`))?(QI(Ite),QC=null,Mte=void 0,f1.set(d,n)):(f1.set(d,f1.get(d)+1,!0),u=!1))}u&&(clearInterval(a),a=void 0)}return function(u){var h=Dje(u);if(!!h)for(var c=h.families,f=0,d=c.length;f<d;++f){var v=c[f],p=h.style+`
`+h.weight+`
`+v;f1.get(p)===void 0&&(f1.set(p,n,!0),s(h.style,h.weight,v)||(f1.set(p,0,!0),a===void 0&&(a=setInterval(l,32))))}}}(),rmr=function(){var n;return function(e){var t=Ite[e];if(t==null){if(NV){var r=Dje(e),i=Qje(e,"\u017Dg"),a=isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight);t=a*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);Ite[e]=t}return t}}();function Qje(n,e){return QC||(QC=Ad(1,1)),n!=Mte&&(QC.font=n,Mte=QC.font),QC.measureText(e)}function o7(n,e){return Qje(n,e).width}function nTe(n,e,t){if(e in t)return t[e];var r=o7(n,e);return t[e]=r,r}function nmr(n,e){for(var t=[],r=[],i=[],a=0,o=0,s=0,l=0,u=0,h=e.length;u<=h;u+=2){var c=e[u];if(c===`
`||u===h){a=Math.max(a,o),i.push(o),o=0,s+=l;continue}var f=e[u+1]||n.font,d=o7(f,c);t.push(d),o+=d;var v=rmr(f);r.push(v),l=Math.max(l,v)}return{width:a,height:s,widths:t,heights:r,lineWidths:i}}function imr(n,e,t,r,i,a,o,s,l,u,h){n.save(),t!==1&&(n.globalAlpha*=t),e&&n.setTransform.apply(n,e),r.contextInstructions?(n.translate(l,u),n.scale(h[0],h[1]),amr(r,n)):h[0]<0||h[1]<0?(n.translate(l,u),n.scale(h[0],h[1]),n.drawImage(r,i,a,o,s,0,0,o,s)):n.drawImage(r,i,a,o,s,l,u,o*h[0],s*h[1]),n.restore()}function amr(n,e){for(var t=n.contextInstructions,r=0,i=t.length;r<i;r+=2)Array.isArray(t[r+1])?e[t[r]].apply(e,t[r+1]):e[t[r]]=t[r+1]}const Ro={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var omr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),smr=function(n){omr(e,n);function e(){var t=n.call(this)||this;return t.layout=Ro.XY,t.stride=2,t.flatCoordinates=null,t}return e.prototype.computeExtent=function(t){return lue(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return ti()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var r=this.getSimplifiedGeometryInternal(t),i=r.getFlatCoordinates();return i.length<this.flatCoordinates.length?r:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,r){this.stride=iTe(t),this.layout=t,this.flatCoordinates=r},e.prototype.setCoordinates=function(t,r){ti()},e.prototype.setLayout=function(t,r,i){var a;if(t)a=iTe(t);else{for(var o=0;o<i;++o)if(r.length===0){this.layout=Ro.XY,this.stride=2;return}else r=r[0];a=r.length,t=lmr(a)}this.layout=t,this.stride=a},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,r){var i=this.getFlatCoordinates();if(i){var a=this.getStride();Yje(i,0,i.length,a,t,r,i),this.changed()}},e.prototype.scale=function(t,r,i){var a=r;a===void 0&&(a=t);var o=i;o||(o=kf(this.getExtent()));var s=this.getFlatCoordinates();if(s){var l=this.getStride();Wyr(s,0,s.length,l,t,a,o,s),this.changed()}},e.prototype.translate=function(t,r){var i=this.getFlatCoordinates();if(i){var a=this.getStride();Hyr(i,0,i.length,a,t,r,i),this.changed()}},e}(vT);function lmr(n){var e;return n==2?e=Ro.XY:n==3?e=Ro.XYZ:n==4&&(e=Ro.XYZM),e}function iTe(n){var e;return n==Ro.XY?e=2:n==Ro.XYZ||n==Ro.XYM?e=3:n==Ro.XYZM&&(e=4),e}function umr(n,e,t){var r=n.getFlatCoordinates();if(r){var i=n.getStride();return ES(r,0,r.length,i,e,t)}else return null}const pT=smr;var hmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cmr=function(n){hmr(e,n);function e(t,r,i,a,o,s,l){var u=n.call(this)||this;return u.context_=t,u.pixelRatio_=r,u.extent_=i,u.transform_=a,u.viewRotation_=o,u.squaredTolerance_=s,u.userTransform_=l,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=Nu(),u}return e.prototype.drawImages_=function(t,r,i,a){if(!!this.image_){var o=ES(t,r,i,a,this.transform_,this.pixelCoordinates_),s=this.context_,l=this.tmpLocalTransform_,u=s.globalAlpha;this.imageOpacity_!=1&&(s.globalAlpha=u*this.imageOpacity_);var h=this.imageRotation_;this.imageRotateWithView_&&(h+=this.viewRotation_);for(var c=0,f=o.length;c<f;c+=2){var d=o[c]-this.imageAnchorX_,v=o[c+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){var p=d+this.imageAnchorX_,g=v+this.imageAnchorY_;Id(l,p,g,1,1,h,-p,-g),s.setTransform.apply(s,l),s.translate(p,g),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.setTransform(1,0,0,1,0,0)}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,v,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(s.globalAlpha=u)}},e.prototype.drawText_=function(t,r,i,a){if(!(!this.textState_||this.text_==="")){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=ES(t,r,i,a,this.transform_,this.pixelCoordinates_),s=this.context_,l=this.textRotation_;for(this.textRotateWithView_&&(l+=this.viewRotation_);r<i;r+=a){var u=o[r]+this.textOffsetX_,h=o[r+1]+this.textOffsetY_;if(l!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){var c=Id(this.tmpLocalTransform_,u,h,1,1,l,-u,-h);s.setTransform.apply(s,c),s.translate(u,h),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&s.strokeText(this.text_,u,h),this.textFillState_&&s.fillText(this.text_,u,h)}}},e.prototype.moveToLineTo_=function(t,r,i,a,o){var s=this.context_,l=ES(t,r,i,a,this.transform_,this.pixelCoordinates_);s.moveTo(l[0],l[1]);var u=l.length;o&&(u-=2);for(var h=2;h<u;h+=2)s.lineTo(l[h],l[h+1]);return o&&s.closePath(),i},e.prototype.drawRings_=function(t,r,i,a){for(var o=0,s=i.length;o<s;++o)r=this.moveToLineTo_(t,r,i[o],a,!0);return r},e.prototype.drawCircle=function(t){if(!!Cl(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var r=umr(t,this.transform_,this.pixelCoordinates_),i=r[2]-r[0],a=r[3]-r[1],o=Math.sqrt(i*i+a*a),s=this.context_;s.beginPath(),s.arc(r[0],r[1],o,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){var r=t.getType();switch(r){case Kr.POINT:this.drawPoint(t);break;case Kr.LINE_STRING:this.drawLineString(t);break;case Kr.POLYGON:this.drawPolygon(t);break;case Kr.MULTI_POINT:this.drawMultiPoint(t);break;case Kr.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Kr.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Kr.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Kr.CIRCLE:this.drawCircle(t);break}},e.prototype.drawFeature=function(t,r){var i=r.getGeometryFunction()(t);!i||!Cl(this.extent_,i.getExtent())||(this.setStyle(r),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var r=t.getGeometriesArray(),i=0,a=r.length;i<a;++i)this.drawGeometry(r[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var r=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(r,0,r.length,i),this.text_!==""&&this.drawText_(r,0,r.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var r=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(r,0,r.length,i),this.text_!==""&&this.drawText_(r,0,r.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Cl(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,i=t.getFlatCoordinates();r.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),r.stroke()}if(this.text_!==""){var a=t.getFlatMidpoint();this.drawText_(a,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var r=t.getExtent();if(!!Cl(this.extent_,r)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,a=t.getFlatCoordinates(),o=0,s=t.getEnds(),l=t.getStride();i.beginPath();for(var u=0,h=s.length;u<h;++u)o=this.moveToLineTo_(a,o,s[u],l,!1);i.stroke()}if(this.text_!==""){var c=t.getFlatMidpoints();this.drawText_(c,0,c.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Cl(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var r=this.context_;r.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}if(this.text_!==""){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Cl(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var r=this.context_,i=t.getOrientedFlatCoordinates(),a=0,o=t.getEndss(),s=t.getStride();r.beginPath();for(var l=0,u=o.length;l<u;++l){var h=o[l];a=this.drawRings_(i,a,h,s)}this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}if(this.text_!==""){var c=t.getFlatInteriorPoints();this.drawText_(c,0,c.length,2)}}},e.prototype.setContextFillState_=function(t){var r=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,r.fillStyle=t.fillStyle):(r.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var r=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,r.lineCap=t.lineCap),r.setLineDash&&(Iw(i.lineDash,t.lineDash)||r.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,r.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,r.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,r.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,r.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,r.strokeStyle=t.strokeStyle)):(r.lineCap=t.lineCap,r.setLineDash&&(r.setLineDash(t.lineDash),r.lineDashOffset=t.lineDashOffset),r.lineJoin=t.lineJoin,r.lineWidth=t.lineWidth,r.miterLimit=t.miterLimit,r.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var r=this.context_,i=this.contextTextState_,a=t.textAlign?t.textAlign:fN;i?(i.font!=t.font&&(i.font=t.font,r.font=t.font),i.textAlign!=a&&(i.textAlign=a,r.textAlign=a),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,r.textBaseline=t.textBaseline)):(r.font=t.font,r.textAlign=a,r.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:a,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,r){var i=this;if(!t)this.fillState_=null;else{var a=t.getColor();this.fillState_={fillStyle:jy(a||K1)}}if(!r)this.strokeState_=null;else{var o=r.getColor(),s=r.getLineCap(),l=r.getLineDash(),u=r.getLineDashOffset(),h=r.getLineJoin(),c=r.getWidth(),f=r.getMiterLimit(),d=l||lN;this.strokeState_={lineCap:s!==void 0?s:i7,lineDash:this.pixelRatio_===1?d:d.map(function(v){return v*i.pixelRatio_}),lineDashOffset:(u||uN)*this.pixelRatio_,lineJoin:h!==void 0?h:$M,lineWidth:(c!==void 0?c:dN)*this.pixelRatio_,miterLimit:f!==void 0?f:hN,strokeStyle:jy(o||cN)}}},e.prototype.setImageStyle=function(t){var r;if(!t||!(r=t.getSize())){this.image_=null;return}var i=t.getAnchor(),a=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=r[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=a[0],this.imageOriginY_=a[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=r[0]*this.pixelRatio_},e.prototype.setTextStyle=function(t){if(!t)this.text_="";else{var r=t.getFill();if(!r)this.textFillState_=null;else{var i=r.getColor();this.textFillState_={fillStyle:jy(i||K1)}}var a=t.getStroke();if(!a)this.textStrokeState_=null;else{var o=a.getColor(),s=a.getLineCap(),l=a.getLineDash(),u=a.getLineDashOffset(),h=a.getLineJoin(),c=a.getWidth(),f=a.getMiterLimit();this.textStrokeState_={lineCap:s!==void 0?s:i7,lineDash:l||lN,lineDashOffset:u||uN,lineJoin:h!==void 0?h:$M,lineWidth:c!==void 0?c:dN,miterLimit:f!==void 0?f:hN,strokeStyle:jy(o||cN)}}var d=t.getFont(),v=t.getOffsetX(),p=t.getOffsetY(),g=t.getRotateWithView(),m=t.getRotation(),y=t.getScaleArray(),_=t.getText(),x=t.getTextAlign(),S=t.getTextBaseline();this.textState_={font:d!==void 0?d:Jje,textAlign:x!==void 0?x:fN,textBaseline:S!==void 0?S:a7},this.text_=_!==void 0?Array.isArray(_)?_.reduce(function(w,b,E){return w+=E%2?" ":b},""):_:"",this.textOffsetX_=v!==void 0?this.pixelRatio_*v:0,this.textOffsetY_=p!==void 0?this.pixelRatio_*p:0,this.textRotateWithView_=g!==void 0?g:!1,this.textRotation_=m!==void 0?m:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}},e}(qje);const yue=cmr,ga={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},Ai={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};var fmr=.5,eXe={Point:xmr,LineString:ymr,Polygon:wmr,MultiPoint:Smr,MultiLineString:mmr,MultiPolygon:_mr,GeometryCollection:gmr,Circle:vmr};function dmr(n,e){return parseInt(vi(n),10)-parseInt(vi(e),10)}function mue(n,e){var t=Lte(n,e);return t*t}function Lte(n,e){return fmr*n/e}function vmr(n,e,t,r,i){var a=t.getFill(),o=t.getStroke();if(a||o){var s=n.getBuilder(t.getZIndex(),ga.CIRCLE);s.setFillStrokeStyle(a,o),s.drawCircle(e,r)}var l=t.getText();if(l&&l.getText()){var u=(i||n).getBuilder(t.getZIndex(),ga.TEXT);u.setTextStyle(l),u.drawText(e,r)}}function s7(n,e,t,r,i,a,o){var s=!1,l=t.getImage();if(l){var u=l.getImageState();u==Ai.LOADED||u==Ai.ERROR?l.unlistenImageChange(i):(u==Ai.IDLE&&l.load(),u=l.getImageState(),l.listenImageChange(i),s=!0)}return pmr(n,e,t,r,a,o),s}function pmr(n,e,t,r,i,a){var o=t.getGeometryFunction()(e);if(!!o){var s=o.simplifyTransformed(r,i),l=t.getRenderer();if(l)tXe(n,s,t,e);else{var u=eXe[s.getType()];u(n,s,t,e,a)}}}function tXe(n,e,t,r){if(e.getType()==Kr.GEOMETRY_COLLECTION){for(var i=e.getGeometries(),a=0,o=i.length;a<o;++a)tXe(n,i[a],t,r);return}var s=n.getBuilder(t.getZIndex(),ga.DEFAULT);s.drawCustom(e,r,t.getRenderer(),t.getHitDetectionRenderer())}function gmr(n,e,t,r,i){var a=e.getGeometriesArray(),o,s;for(o=0,s=a.length;o<s;++o){var l=eXe[a[o].getType()];l(n,a[o],t,r,i)}}function ymr(n,e,t,r,i){var a=t.getStroke();if(a){var o=n.getBuilder(t.getZIndex(),ga.LINE_STRING);o.setFillStrokeStyle(null,a),o.drawLineString(e,r)}var s=t.getText();if(s&&s.getText()){var l=(i||n).getBuilder(t.getZIndex(),ga.TEXT);l.setTextStyle(s),l.drawText(e,r)}}function mmr(n,e,t,r,i){var a=t.getStroke();if(a){var o=n.getBuilder(t.getZIndex(),ga.LINE_STRING);o.setFillStrokeStyle(null,a),o.drawMultiLineString(e,r)}var s=t.getText();if(s&&s.getText()){var l=(i||n).getBuilder(t.getZIndex(),ga.TEXT);l.setTextStyle(s),l.drawText(e,r)}}function _mr(n,e,t,r,i){var a=t.getFill(),o=t.getStroke();if(o||a){var s=n.getBuilder(t.getZIndex(),ga.POLYGON);s.setFillStrokeStyle(a,o),s.drawMultiPolygon(e,r)}var l=t.getText();if(l&&l.getText()){var u=(i||n).getBuilder(t.getZIndex(),ga.TEXT);u.setTextStyle(l),u.drawText(e,r)}}function xmr(n,e,t,r,i){var a=t.getImage(),o=t.getText(),s;if(i&&(n=i,s=a&&o&&o.getText()?{}:void 0),a){if(a.getImageState()!=Ai.LOADED)return;var l=n.getBuilder(t.getZIndex(),ga.IMAGE);l.setImageStyle(a,s),l.drawPoint(e,r)}if(o&&o.getText()){var u=n.getBuilder(t.getZIndex(),ga.TEXT);u.setTextStyle(o,s),u.drawText(e,r)}}function Smr(n,e,t,r,i){var a=t.getImage(),o=t.getText(),s;if(i&&(n=i,s=a&&o&&o.getText()?{}:void 0),a){if(a.getImageState()!=Ai.LOADED)return;var l=n.getBuilder(t.getZIndex(),ga.IMAGE);l.setImageStyle(a,s),l.drawMultiPoint(e,r)}if(o&&o.getText()){var u=(i||n).getBuilder(t.getZIndex(),ga.TEXT);u.setTextStyle(o,s),u.drawText(e,r)}}function wmr(n,e,t,r,i){var a=t.getFill(),o=t.getStroke();if(a||o){var s=n.getBuilder(t.getZIndex(),ga.POLYGON);s.setFillStrokeStyle(a,o),s.drawPolygon(e,r)}var l=t.getText();if(l&&l.getText()){var u=(i||n).getBuilder(t.getZIndex(),ga.TEXT);u.setTextStyle(l),u.drawText(e,r)}}function bmr(n,e){var t=n.canvas,r=e||{},i=r.pixelRatio||iue,a=r.size;a&&(t.width=a[0]*i,t.height=a[1]*i,t.style.width=a[0]+"px",t.style.height=a[1]+"px");var o=[0,0,t.width,t.height],s=LR(Nu(),i,i);return new yue(n,i,o,s,0)}function rXe(n){if(!(n.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var e=n.inversePixelTransform[0],t=n.frameState,r=nL(n.inversePixelTransform.slice(),t.coordinateToPixelTransform),i=mue(t.viewState.resolution,e),a;return new yue(n.context,e,t.extent,r,t.viewState.rotation,i,a)}const ud={ADD:"add",REMOVE:"remove"};var nXe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),aTe={LENGTH:"length"},i6=function(n){nXe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.element=r,a.index=i,a}return e}(Fm),Emr=function(n){nXe(e,n);function e(t,r){var i=n.call(this)||this;i.on,i.once,i.un;var a=r||{};if(i.unique_=!!a.unique,i.array_=t||[],i.unique_)for(var o=0,s=i.array_.length;o<s;++o)i.assertUnique_(i.array_[o],o);return i.updateLength_(),i}return e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var r=0,i=t.length;r<i;++r)this.push(t[r]);return this},e.prototype.forEach=function(t){for(var r=this.array_,i=0,a=r.length;i<a;++i)t(r[i],i,r)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(aTe.LENGTH)},e.prototype.insertAt=function(t,r){this.unique_&&this.assertUnique_(r),this.array_.splice(t,0,r),this.updateLength_(),this.dispatchEvent(new i6(ud.ADD,r,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var r=this.getLength();return this.insertAt(r,t),this.getLength()},e.prototype.remove=function(t){for(var r=this.array_,i=0,a=r.length;i<a;++i)if(r[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var r=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new i6(ud.REMOVE,r,t)),r},e.prototype.setAt=function(t,r){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(r,t);var a=this.array_[t];this.array_[t]=r,this.dispatchEvent(new i6(ud.REMOVE,a,t)),this.dispatchEvent(new i6(ud.ADD,r,t))}else{for(var o=i;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,r)}},e.prototype.updateLength_=function(){this.set(aTe.LENGTH,this.array_.length)},e.prototype.assertUnique_=function(t,r){for(var i=0,a=this.array_.length;i<a;++i)if(this.array_[i]===t&&i!==r)throw new oue(58)},e}(kv);const gd=Emr;function Tmr(n,e,t,r,i){iXe(n,e,t||0,r||n.length-1,i||Cmr)}function iXe(n,e,t,r,i){for(;r>t;){if(r-t>600){var a=r-t+1,o=e-t+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1),h=Math.max(t,Math.floor(e-o*l/a+u)),c=Math.min(r,Math.floor(e+(a-o)*l/a+u));iXe(n,e,h,c,i)}var f=n[e],d=t,v=r;for(DP(n,t,e),i(n[r],f)>0&&DP(n,t,r);d<v;){for(DP(n,d,v),d++,v--;i(n[d],f)<0;)d++;for(;i(n[v],f)>0;)v--}i(n[t],f)===0?DP(n,t,v):(v++,DP(n,v,r)),v<=e&&(t=v+1),e<=v&&(r=v-1)}}function DP(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function Cmr(n,e){return n<e?-1:n>e?1:0}class aXe{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const r=[];if(!o6(e,t))return r;const i=this.toBBox,a=[];for(;t;){for(let o=0;o<t.children.length;o++){const s=t.children[o],l=t.leaf?i(s):s;o6(e,l)&&(t.leaf?r.push(s):HY(e,l)?this._all(s,r):a.push(s))}t=a.pop()}return r}collides(e){let t=this.data;if(!o6(e,t))return!1;const r=[];for(;t;){for(let i=0;i<t.children.length;i++){const a=t.children[i],o=t.leaf?this.toBBox(a):a;if(o6(e,o)){if(t.leaf||HY(e,o))return!0;r.push(a)}}t=r.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let r=0;r<e.length;r++)this.insert(e[r]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const r=this.data;this.data=t,t=r}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=eA([]),this}remove(e,t){if(!e)return this;let r=this.data;const i=this.toBBox(e),a=[],o=[];let s,l,u;for(;r||a.length;){if(r||(r=a.pop(),l=a[a.length-1],s=o.pop(),u=!0),r.leaf){const h=Amr(e,r.children,t);if(h!==-1)return r.children.splice(h,1),a.push(r),this._condense(a),this}!u&&!r.leaf&&HY(r,i)?(a.push(r),o.push(s),s=0,l=r,r=r.children[0]):l?(s++,r=l.children[s],u=!1):r=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const r=[];for(;e;)e.leaf?t.push(...e.children):r.push(...e.children),e=r.pop();return t}_build(e,t,r,i){const a=r-t+1;let o=this._maxEntries,s;if(a<=o)return s=eA(e.slice(t,r+1)),SC(s,this.toBBox),s;i||(i=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,i-1))),s=eA([]),s.leaf=!1,s.height=i;const l=Math.ceil(a/o),u=l*Math.ceil(Math.sqrt(o));oTe(e,t,r,u,this.compareMinX);for(let h=t;h<=r;h+=u){const c=Math.min(h+u-1,r);oTe(e,h,c,l,this.compareMinY);for(let f=h;f<=c;f+=l){const d=Math.min(f+l-1,c);s.children.push(this._build(e,f,d,i-1))}}return SC(s,this.toBBox),s}_chooseSubtree(e,t,r,i){for(;i.push(t),!(t.leaf||i.length-1===r);){let a=1/0,o=1/0,s;for(let l=0;l<t.children.length;l++){const u=t.children[l],h=WY(u),c=Lmr(e,u)-h;c<o?(o=c,a=h<a?h:a,s=u):c===o&&h<a&&(a=h,s=u)}t=s||t.children[0]}return t}_insert(e,t,r){const i=r?e:this.toBBox(e),a=[],o=this._chooseSubtree(i,this.data,t,a);for(o.children.push(e),AO(o,i);t>=0&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(i,a,t)}_split(e,t){const r=e[t],i=r.children.length,a=this._minEntries;this._chooseSplitAxis(r,a,i);const o=this._chooseSplitIndex(r,a,i),s=eA(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,SC(r,this.toBBox),SC(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=eA([e,t]),this.data.height=e.height+1,this.data.leaf=!1,SC(this.data,this.toBBox)}_chooseSplitIndex(e,t,r){let i,a=1/0,o=1/0;for(let s=t;s<=r-t;s++){const l=CO(e,0,s,this.toBBox),u=CO(e,s,r,this.toBBox),h=Pmr(l,u),c=WY(l)+WY(u);h<a?(a=h,i=s,o=c<o?c:o):h===a&&c<o&&(o=c,i=s)}return i||r-t}_chooseSplitAxis(e,t,r){const i=e.leaf?this.compareMinX:Mmr,a=e.leaf?this.compareMinY:Imr,o=this._allDistMargin(e,t,r,i),s=this._allDistMargin(e,t,r,a);o<s&&e.children.sort(i)}_allDistMargin(e,t,r,i){e.children.sort(i);const a=this.toBBox,o=CO(e,0,t,a),s=CO(e,r-t,r,a);let l=a6(o)+a6(s);for(let u=t;u<r-t;u++){const h=e.children[u];AO(o,e.leaf?a(h):h),l+=a6(o)}for(let u=r-t-1;u>=t;u--){const h=e.children[u];AO(s,e.leaf?a(h):h),l+=a6(s)}return l}_adjustParentBBoxes(e,t,r){for(let i=r;i>=0;i--)AO(t[i],e)}_condense(e){for(let t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():SC(e[t],this.toBBox)}}function Amr(n,e,t){if(!t)return e.indexOf(n);for(let r=0;r<e.length;r++)if(t(n,e[r]))return r;return-1}function SC(n,e){CO(n,0,n.children.length,e,n)}function CO(n,e,t,r,i){i||(i=eA(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=e;a<t;a++){const o=n.children[a];AO(i,n.leaf?r(o):o)}return i}function AO(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function Mmr(n,e){return n.minX-e.minX}function Imr(n,e){return n.minY-e.minY}function WY(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function a6(n){return n.maxX-n.minX+(n.maxY-n.minY)}function Lmr(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function Pmr(n,e){const t=Math.max(n.minX,e.minX),r=Math.max(n.minY,e.minY),i=Math.min(n.maxX,e.maxX),a=Math.min(n.maxY,e.maxY);return Math.max(0,i-t)*Math.max(0,a-r)}function HY(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function o6(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function eA(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oTe(n,e,t,r,i){const a=[e,t];for(;a.length;){if(t=a.pop(),e=a.pop(),t-e<=r)continue;const o=e+Math.ceil((t-e)/r/2)*r;Tmr(n,o,e,t,i),a.push(e,o,o,t)}}var Omr=function(){function n(e){this.rbush_=new aXe(e),this.items_={}}return n.prototype.insert=function(e,t){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(r),this.items_[vi(t)]=r},n.prototype.load=function(e,t){for(var r=new Array(t.length),i=0,a=t.length;i<a;i++){var o=e[i],s=t[i],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};r[i]=l,this.items_[vi(s)]=l}this.rbush_.load(r)},n.prototype.remove=function(e){var t=vi(e),r=this.items_[t];return delete this.items_[t],this.rbush_.remove(r)!==null},n.prototype.update=function(e,t){var r=this.items_[vi(t)],i=[r.minX,r.minY,r.maxX,r.maxY];m_(i,e)||(this.remove(t),this.insert(e,t))},n.prototype.getAll=function(){var e=this.rbush_.all();return e.map(function(t){return t.value})},n.prototype.getInExtent=function(e){var t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]},r=this.rbush_.search(t);return r.map(function(i){return i.value})},n.prototype.forEach=function(e){return this.forEach_(this.getAll(),e)},n.prototype.forEachInExtent=function(e,t){return this.forEach_(this.getInExtent(e),t)},n.prototype.forEach_=function(e,t){for(var r,i=0,a=e.length;i<a;i++)if(r=t(e[i]),r)return r;return r},n.prototype.isEmpty=function(){return v2(this.items_)},n.prototype.clear=function(){this.rbush_.clear(),this.items_={}},n.prototype.getExtent=function(e){var t=this.rbush_.toJSON();return pm(t.minX,t.minY,t.maxX,t.maxY,e)},n.prototype.concat=function(e){this.rbush_.load(e.rbush_.all());for(var t in e.items_)this.items_[t]=e.items_[t]},n}();const sTe=Omr,p2={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var Rmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Dmr=function(n){Rmr(e,n);function e(t){var r=n.call(this)||this;r.projection=ya(t.projection),r.attributions_=lTe(t.attributions),r.attributionsCollapsible_=t.attributionsCollapsible!==void 0?t.attributionsCollapsible:!0,r.loading=!1,r.state_=t.state!==void 0?t.state:p2.READY,r.wrapX_=t.wrapX!==void 0?t.wrapX:!1,r.interpolate_=!!t.interpolate,r.viewResolver=null,r.viewRejector=null;var i=r;return r.viewPromise_=new Promise(function(a,o){i.viewResolver=a,i.viewRejector=o}),r}return e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return ti()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=lTe(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(kv);function lTe(n){return n?Array.isArray(n)?function(e){return n}:typeof n=="function"?n:function(e){return[n]}:null}const _ue=Dmr,yf={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function oXe(n,e){return[[-1/0,-1/0,1/0,1/0]]}function uTe(n,e){return[n]}const qb={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};var Nmr=!1;function sXe(n,e,t,r,i,a,o){var s=new XMLHttpRequest;s.open("GET",typeof n=="function"?n(t,r,i):n,!0),e.getType()==qb.ARRAY_BUFFER&&(s.responseType="arraybuffer"),s.withCredentials=Nmr,s.onload=function(l){if(!s.status||s.status>=200&&s.status<300){var u=e.getType(),h=void 0;u==qb.JSON||u==qb.TEXT?h=s.responseText:u==qb.XML?(h=s.responseXML,h||(h=new DOMParser().parseFromString(s.responseText,"application/xml"))):u==qb.ARRAY_BUFFER&&(h=s.response),h?a(e.readFeatures(h,{extent:t,featureProjection:i}),e.readProjection(h)):o()}else o()},s.onerror=o,s.send()}function hTe(n,e){return function(t,r,i,a,o){var s=this;sXe(n,e,t,r,i,function(l,u){s.addFeatures(l),a!==void 0&&a(l)},o||d2)}}var lXe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),mx=function(n){lXe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.feature=r,a.features=i,a}return e}(Fm),kmr=function(n){lXe(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:p2.READY,wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=d2,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(ki(r.format_,7),r.loader_=hTe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:oXe;var a=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=a?new sTe:null,r.loadedExtentsRtree_=new sTe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var o,s;return Array.isArray(i.features)?s=i.features:i.features&&(o=i.features,s=o.getArray()),!a&&o===void 0&&(o=new gd(s)),s!==void 0&&r.addFeaturesInternal(s),o!==void 0&&r.bindFeaturesCollection_(o),r}return e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var r=vi(t);if(!this.addToIndex_(r,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(r,t);var i=t.getGeometry();if(i){var a=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(a,t)}else this.nullGeometryFeatures_[r]=t;this.dispatchEvent(new mx(yf.ADDFEATURE,t))},e.prototype.setupChangeEvents_=function(t,r){this.featureChangeKeys_[t]=[pa(r,Ci.CHANGE,this.handleFeatureChange_,this),pa(r,UM.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,r){var i=!0,a=r.getId();return a!==void 0&&(a.toString()in this.idIndex_?i=!1:this.idIndex_[a.toString()]=r),i&&(ki(!(t in this.uidIndex_),30),this.uidIndex_[t]=r),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var r=[],i=[],a=[],o=0,s=t.length;o<s;o++){var l=t[o],u=vi(l);this.addToIndex_(u,l)&&i.push(l)}for(var o=0,h=i.length;o<h;o++){var l=i[o],u=vi(l);this.setupChangeEvents_(u,l);var c=l.getGeometry();if(c){var f=c.getExtent();r.push(f),a.push(l)}else this.nullGeometryFeatures_[u]=l}if(this.featuresRtree_&&this.featuresRtree_.load(r,a),this.hasListener(yf.ADDFEATURE))for(var o=0,d=i.length;o<d;o++)this.dispatchEvent(new mx(yf.ADDFEATURE,i[o]))},e.prototype.bindFeaturesCollection_=function(t){var r=!1;this.addEventListener(yf.ADDFEATURE,function(i){r||(r=!0,t.push(i.feature),r=!1)}),this.addEventListener(yf.REMOVEFEATURE,function(i){r||(r=!0,t.remove(i.feature),r=!1)}),t.addEventListener(ud.ADD,function(i){r||(r=!0,this.addFeature(i.element),r=!1)}.bind(this)),t.addEventListener(ud.REMOVE,function(i){r||(r=!0,this.removeFeature(i.element),r=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var r in this.featureChangeKeys_){var i=this.featureChangeKeys_[r];i.forEach(Ms)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var a=function(l){this.removeFeatureInternal(l)}.bind(this);this.featuresRtree_.forEach(a);for(var o in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[o])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var s=new mx(yf.CLEAR);this.dispatchEvent(s),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,r){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(a){var o=a.getGeometry();if(o.intersectsCoordinate(t))return r(a)})},e.prototype.forEachFeatureInExtent=function(t,r){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,r);this.featuresCollection_&&this.featuresCollection_.forEach(r)},e.prototype.forEachFeatureIntersectingExtent=function(t,r){return this.forEachFeatureInExtent(t,function(i){var a=i.getGeometry();if(a.intersectsExtent(t)){var o=r(i);if(o)return o}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),v2(this.nullGeometryFeatures_)||em(t,Pje(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var r=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){r.push(i)}),r},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,r){var i=t[0],a=t[1],o=null,s=[NaN,NaN],l=1/0,u=[-1/0,-1/0,1/0,1/0],h=r||ZA;return this.featuresRtree_.forEachInExtent(u,function(c){if(h(c)){var f=c.getGeometry(),d=l;if(l=f.closestPointXY(i,a,s,l),l<d){o=c;var v=Math.sqrt(l);u[0]=i-v,u[1]=a-v,u[2]=i+v,u[3]=a+v}}}),o},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var r=this.idIndex_[t.toString()];return r!==void 0?r:null},e.prototype.getFeatureByUid=function(t){var r=this.uidIndex_[t];return r!==void 0?r:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var r=t.target,i=vi(r),a=r.getGeometry();if(!a)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(r),this.nullGeometryFeatures_[i]=r);else{var o=a.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,r)):this.featuresRtree_&&this.featuresRtree_.update(o,r)}var s=r.getId();if(s!==void 0){var l=s.toString();this.idIndex_[l]!==r&&(this.removeFromIdIndex_(r),this.idIndex_[l]=r)}else this.removeFromIdIndex_(r),this.uidIndex_[i]=r;this.changed(),this.dispatchEvent(new mx(yf.CHANGEFEATURE,r))},e.prototype.hasFeature=function(t){var r=t.getId();return r!==void 0?r in this.idIndex_:vi(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&v2(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0},e.prototype.loadFeatures=function(t,r,i){for(var a=this.loadedExtentsRtree_,o=this.strategy_(t,r,i),s=function(c,f){var d=o[c],v=a.forEachInExtent(d,function(p){return vv(p.extent,d)});v||(++l.loadingExtentsCount_,l.dispatchEvent(new mx(yf.FEATURESLOADSTART)),l.loader_.call(l,d,r,i,function(p){--this.loadingExtentsCount_,this.dispatchEvent(new mx(yf.FEATURESLOADEND,void 0,p))}.bind(l),function(){--this.loadingExtentsCount_,this.dispatchEvent(new mx(yf.FEATURESLOADERROR))}.bind(l)),a.insert(d,{extent:d.slice()}))},l=this,u=0,h=o.length;u<h;++u)s(u);this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),n.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(t,function(a){if(m_(a.extent,t))return i=a,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(t){if(!!t){var r=vi(t);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(t);var i=this.removeFeatureInternal(t);i&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var r=vi(t),i=this.featureChangeKeys_[r];if(!!i){i.forEach(Ms),delete this.featureChangeKeys_[r];var a=t.getId();return a!==void 0&&delete this.idIndex_[a.toString()],delete this.uidIndex_[r],this.dispatchEvent(new mx(yf.REMOVEFEATURE,t)),t}},e.prototype.removeFromIdIndex_=function(t){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){ki(this.format_,7),this.url_=t,this.setLoader(hTe(t,this.format_))},e}(_ue);const _f=kmr,jo={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var Fmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Bmr=function(n){Fmr(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un,r.background_=t.background;var i=Ao({},t);return typeof t.properties=="object"&&(delete i.properties,Ao(i,t.properties)),i[jo.OPACITY]=t.opacity!==void 0?t.opacity:1,ki(typeof i[jo.OPACITY]=="number",64),i[jo.VISIBLE]=t.visible!==void 0?t.visible:!0,i[jo.Z_INDEX]=t.zIndex,i[jo.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,i[jo.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,i[jo.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,i[jo.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,r.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var r=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return r.opacity=Ui(Math.round(this.getOpacity()*100)/100,0,1),r.visible=this.getVisible(),r.extent=this.getExtent(),r.zIndex=i===void 0&&!r.managed?1/0:i,r.maxResolution=this.getMaxResolution(),r.minResolution=Math.max(this.getMinResolution(),0),r.minZoom=this.getMinZoom(),r.maxZoom=this.getMaxZoom(),this.state_=r,r},e.prototype.getLayersArray=function(t){return ti()},e.prototype.getLayerStatesArray=function(t){return ti()},e.prototype.getExtent=function(){return this.get(jo.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(jo.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(jo.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(jo.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(jo.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(jo.OPACITY)},e.prototype.getSourceState=function(){return ti()},e.prototype.getVisible=function(){return this.get(jo.VISIBLE)},e.prototype.getZIndex=function(){return this.get(jo.Z_INDEX)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(jo.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(jo.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(jo.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(jo.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(jo.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){ki(typeof t=="number",64),this.set(jo.OPACITY,t)},e.prototype.setVisible=function(t){this.set(jo.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(jo.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),n.prototype.disposeInternal.call(this)},e}(kv);const uXe=Bmr,Tf={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var Gmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ek=function(n){Gmr(e,n);function e(t){var r=this,i=Ao({},t);delete i.source,r=n.call(this,i)||this,r.on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,t.render&&(r.render=t.render),t.map&&r.setMap(t.map),r.addChangeListener(jo.SOURCE,r.handleSourcePropertyChange_);var a=t.source?t.source:null;return r.setSource(a),r}return e.prototype.getLayersArray=function(t){var r=t||[];return r.push(this),r},e.prototype.getLayerStatesArray=function(t){var r=t||[];return r.push(this.getLayerState()),r},e.prototype.getSource=function(){return this.get(jo.SOURCE)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():p2.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ms(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=pa(t,Ci.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise(function(r){return r([])})},e.prototype.getData=function(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)},e.prototype.render=function(t,r){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,r)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(jo.MAP,t)},e.prototype.getMapInternal=function(){return this.get(jo.MAP)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ms(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ms(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=pa(t,Tf.PRECOMPOSE,function(r){var i=r,a=i.frameState.layerStatesArray,o=this.getLayerState(!1);ki(!a.some(function(s){return s.layer===o.layer}),67),a.push(o)},this),this.mapRenderKey_=pa(this,Ci.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(jo.SOURCE,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),n.prototype.disposeInternal.call(this)},e}(uXe);function l7(n,e){if(!n.visible)return!1;var t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;var r=e.zoom;return r>n.minZoom&&r<=n.maxZoom}function cTe(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]+2*e,t[1]=n[1]+2*e,t}function fTe(n){return n[0]>0&&n[1]>0}function hXe(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function nh(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}var zmr=function(){function n(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=nh(e.scale),this.displacement_=e.displacement}return n.prototype.clone=function(){var e=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},n.prototype.getOpacity=function(){return this.opacity_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getDisplacement=function(){return this.displacement_},n.prototype.getAnchor=function(){return ti()},n.prototype.getImage=function(e){return ti()},n.prototype.getHitDetectionImage=function(){return ti()},n.prototype.getPixelRatio=function(e){return 1},n.prototype.getImageState=function(){return ti()},n.prototype.getImageSize=function(){return ti()},n.prototype.getOrigin=function(){return ti()},n.prototype.getSize=function(){return ti()},n.prototype.setDisplacement=function(e){this.displacement_=e},n.prototype.setOpacity=function(e){this.opacity_=e},n.prototype.setRotateWithView=function(e){this.rotateWithView_=e},n.prototype.setRotation=function(e){this.rotation_=e},n.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=nh(e)},n.prototype.listenImageChange=function(e){ti()},n.prototype.load=function(){ti()},n.prototype.unlistenImageChange=function(e){ti()},n}();const cXe=zmr;var Umr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Vmr=function(n){Umr(e,n);function e(t){var r=this,i=t.rotateWithView!==void 0?t.rotateWithView:!1;return r=n.call(this,{opacity:1,rotateWithView:i,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0]})||this,r.canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=t.fill!==void 0?t.fill:null,r.origin_=[0,0],r.points_=t.points,r.radius_=t.radius!==void 0?t.radius:t.radius1,r.radius2_=t.radius2,r.angle_=t.angle!==void 0?t.angle:0,r.stroke_=t.stroke!==void 0?t.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var r=this.getDisplacement();return[t[0]/2-r[0],t[1]/2+r[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var r=this.canvas_[t];if(!r){var i=this.renderOptions_,a=Ad(i.size*t,i.size*t);this.draw_(i,a,t),r=a.canvas,this.canvas_[t]=r}return r},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Ai.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,r,i){if(r===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return r;var a=this.radius_,o=this.radius2_===void 0?a:this.radius2_;if(a<o){var s=a;a=o,o=s}var l=this.radius2_===void 0?this.points_:this.points_*2,u=2*Math.PI/l,h=o*Math.sin(u),c=Math.sqrt(o*o-h*h),f=a-c,d=Math.sqrt(h*h+f*f),v=d/h;if(t==="miter"&&v<=i)return v*r;var p=r/2/v,g=r/2*(f/d),m=Math.sqrt((a+p)*(a+p)+g*g),y=m-a;if(this.radius2_===void 0||t==="bevel")return y*2;var _=a*Math.sin(u),x=Math.sqrt(a*a-_*_),S=o-x,w=Math.sqrt(_*_+S*S),b=w/_;if(b<=i){var E=b*r/2-o-a;return 2*Math.max(y,E)}return y*2},e.prototype.createRenderOptions=function(){var t=$M,r=0,i=null,a=0,o,s=0;this.stroke_&&(o=this.stroke_.getColor(),o===null&&(o=cN),o=jy(o),s=this.stroke_.getWidth(),s===void 0&&(s=dN),i=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=$M),r=this.stroke_.getMiterLimit(),r===void 0&&(r=hN));var l=this.calculateLineJoinSize_(t,s,r),u=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*u+l);return{strokeStyle:o,strokeWidth:s,size:h,lineDash:i,lineDashOffset:a,lineJoin:t,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,r,i){if(r.scale(i,i),r.translate(t.size/2,t.size/2),this.createPath_(r),this.fill_){var a=this.fill_.getColor();a===null&&(a=K1),r.fillStyle=jy(a),r.fill()}this.stroke_&&(r.strokeStyle=t.strokeStyle,r.lineWidth=t.strokeWidth,r.setLineDash&&t.lineDash&&(r.setLineDash(t.lineDash),r.lineDashOffset=t.lineDashOffset),r.lineJoin=t.lineJoin,r.miterLimit=t.miterLimit,r.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var r=this.fill_.getColor(),i=0;if(typeof r=="string"&&(r=n7(r)),r===null?i=1:Array.isArray(r)&&(i=r.length===4?r[3]:1),i===0){var a=Ad(t.size,t.size);this.hitDetectionCanvas_=a.canvas,this.drawHitDetectionCanvas_(t,a)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var r=this.points_,i=this.radius_;if(r===1/0)t.arc(0,0,i,0,2*Math.PI);else{var a=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(r*=2);for(var o=this.angle_-Math.PI/2,s=2*Math.PI/r,l=0;l<r;l++){var u=o+l*s,h=l%2===0?i:a;t.lineTo(h*Math.cos(u),h*Math.sin(u))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,r){r.translate(t.size/2,t.size/2),this.createPath_(r),r.fillStyle=K1,r.fill(),this.stroke_&&(r.strokeStyle=t.strokeStyle,r.lineWidth=t.strokeWidth,t.lineDash&&(r.setLineDash(t.lineDash),r.lineDashOffset=t.lineDashOffset),r.lineJoin=t.lineJoin,r.miterLimit=t.miterLimit,r.stroke())},e}(cXe);const u7=Vmr;var $mr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Wmr=function(n){$mr(e,n);function e(t){var r=t||{};return n.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:r.scale!==void 0?r.scale:1,rotation:r.rotation!==void 0?r.rotation:0,rotateWithView:r.rotateWithView!==void 0?r.rotateWithView:!1,displacement:r.displacement!==void 0?r.displacement:[0,0]})||this}return e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(u7);const rm=Wmr;var Hmr=function(){function n(e){var t=e||{};this.color_=t.color!==void 0?t.color:null}return n.prototype.clone=function(){var e=this.getColor();return new n({color:Array.isArray(e)?e.slice():e||void 0})},n.prototype.getColor=function(){return this.color_},n.prototype.setColor=function(e){this.color_=e},n}();const Ko=Hmr;var jmr=function(){function n(e){var t=e||{};this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}return n.prototype.clone=function(){var e=this.getColor();return new n({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},n.prototype.getColor=function(){return this.color_},n.prototype.getLineCap=function(){return this.lineCap_},n.prototype.getLineDash=function(){return this.lineDash_},n.prototype.getLineDashOffset=function(){return this.lineDashOffset_},n.prototype.getLineJoin=function(){return this.lineJoin_},n.prototype.getMiterLimit=function(){return this.miterLimit_},n.prototype.getWidth=function(){return this.width_},n.prototype.setColor=function(e){this.color_=e},n.prototype.setLineCap=function(e){this.lineCap_=e},n.prototype.setLineDash=function(e){this.lineDash_=e},n.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e},n.prototype.setLineJoin=function(e){this.lineJoin_=e},n.prototype.setMiterLimit=function(e){this.miterLimit_=e},n.prototype.setWidth=function(e){this.width_=e},n}();const es=jmr;var fXe=function(){function n(e){var t=e||{};this.geometry_=null,this.geometryFunction_=dTe,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}return n.prototype.clone=function(){var e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new n({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},n.prototype.getRenderer=function(){return this.renderer_},n.prototype.setRenderer=function(e){this.renderer_=e},n.prototype.setHitDetectionRenderer=function(e){this.hitDetectionRenderer_=e},n.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},n.prototype.getGeometry=function(){return this.geometry_},n.prototype.getGeometryFunction=function(){return this.geometryFunction_},n.prototype.getFill=function(){return this.fill_},n.prototype.setFill=function(e){this.fill_=e},n.prototype.getImage=function(){return this.image_},n.prototype.setImage=function(e){this.image_=e},n.prototype.getStroke=function(){return this.stroke_},n.prototype.setStroke=function(e){this.stroke_=e},n.prototype.getText=function(){return this.text_},n.prototype.setText=function(e){this.text_=e},n.prototype.getZIndex=function(){return this.zIndex_},n.prototype.setGeometry=function(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=dTe,this.geometry_=e},n.prototype.setZIndex=function(e){this.zIndex_=e},n}();function Xmr(n){var e;if(typeof n=="function")e=n;else{var t;if(Array.isArray(n))t=n;else{ki(typeof n.getZIndex=="function",41);var r=n;t=[r]}e=function(){return t}}return e}var jY=null;function Ymr(n,e){if(!jY){var t=new Ko({color:"rgba(255,255,255,0.4)"}),r=new es({color:"#3399CC",width:1.25});jY=[new fXe({image:new rm({fill:t,stroke:r,radius:5}),fill:t,stroke:r})]}return jY}function dTe(n){return n.getGeometry()}const So=fXe;var qmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),vTe={RENDER_ORDER:"renderOrder"},Zmr=function(n){qmr(e,n);function e(t){var r=this,i=t||{},a=Ao({},i);return delete a.style,delete a.renderBuffer,delete a.updateWhileAnimating,delete a.updateWhileInteracting,r=n.call(this,a)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(t){return n.prototype.getFeatures.call(this,t)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(vTe.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new aXe(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(vTe.RENDER_ORDER,t)},e.prototype.setStyle=function(t){this.style_=t!==void 0?t:Ymr,this.styleFunction_=t===null?void 0:Xmr(this.style_),this.changed()},e}(Ek);const GV=Zmr;var Tk={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},s6=[Tk.FILL],hS=[Tk.STROKE],gE=[Tk.BEGIN_PATH],pTe=[Tk.CLOSE_PATH];const yi=Tk;function cS(n,e,t,r,i){for(var a=i!==void 0?i:[],o=0,s=e;s<t;s+=r)a[o++]=n.slice(s,s+r);return a.length=o,a}function vN(n,e,t,r,i){for(var a=i!==void 0?i:[],o=0,s=0,l=t.length;s<l;++s){var u=t[s];a[o++]=cS(n,e,u,r,a[o]),e=u}return a.length=o,a}function Pte(n,e,t,r,i){for(var a=i!==void 0?i:[],o=0,s=0,l=t.length;s<l;++s){var u=t[s];a[o++]=vN(n,e,u,r,a[o]),e=u[u.length-1]}return a.length=o,a}var Kmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Jmr=function(n){Kmr(e,n);function e(t,r,i,a){var o=n.call(this)||this;return o.tolerance=t,o.maxExtent=r,o.pixelRatio=a,o.maxLineWidth=0,o.resolution=i,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return e.prototype.applyPixelRatio=function(t){var r=this.pixelRatio;return r==1?t:t.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(t,r){for(var i=this.getBufferedMaxExtent(),a=this.tmpCoordinate_,o=this.coordinates,s=o.length,l=0,u=t.length;l<u;l+=r)a[0]=t[l],a[1]=t[l+1],dv(i,a)&&(o[s++]=a[0],o[s++]=a[1]);return s},e.prototype.appendFlatLineCoordinates=function(t,r,i,a,o,s){var l=this.coordinates,u=l.length,h=this.getBufferedMaxExtent();s&&(r+=a);var c=t[r],f=t[r+1],d=this.tmpCoordinate_,v=!0,p,g,m;for(p=r+a;p<i;p+=a)d[0]=t[p],d[1]=t[p+1],m=Ste(h,d),m!==g?(v&&(l[u++]=c,l[u++]=f,v=!1),l[u++]=d[0],l[u++]=d[1]):m===Ih.INTERSECTING?(l[u++]=d[0],l[u++]=d[1],v=!1):v=!0,c=d[0],f=d[1],g=m;return(o&&v||p===r+a)&&(l[u++]=c,l[u++]=f),u},e.prototype.drawCustomCoordinates_=function(t,r,i,a,o){for(var s=0,l=i.length;s<l;++s){var u=i[s],h=this.appendFlatLineCoordinates(t,r,u,a,!1,!1);o.push(h),r=u}return r},e.prototype.drawCustom=function(t,r,i,a){this.beginGeometry(t,r);var o=t.getType(),s=t.getStride(),l=this.coordinates.length,u,h,c,f,d;switch(o){case Kr.MULTI_POLYGON:u=t.getOrientedFlatCoordinates(),f=[];var v=t.getEndss();d=0;for(var p=0,g=v.length;p<g;++p){var m=[];d=this.drawCustomCoordinates_(u,d,v[p],s,m),f.push(m)}this.instructions.push([yi.CUSTOM,l,f,t,i,Pte]),this.hitDetectionInstructions.push([yi.CUSTOM,l,f,t,a||i,Pte]);break;case Kr.POLYGON:case Kr.MULTI_LINE_STRING:c=[],u=o==Kr.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(u,0,t.getEnds(),s,c),this.instructions.push([yi.CUSTOM,l,c,t,i,vN]),this.hitDetectionInstructions.push([yi.CUSTOM,l,c,t,a||i,vN]);break;case Kr.LINE_STRING:case Kr.CIRCLE:u=t.getFlatCoordinates(),h=this.appendFlatLineCoordinates(u,0,u.length,s,!1,!1),this.instructions.push([yi.CUSTOM,l,h,t,i,cS]),this.hitDetectionInstructions.push([yi.CUSTOM,l,h,t,a||i,cS]);break;case Kr.MULTI_POINT:u=t.getFlatCoordinates(),h=this.appendFlatPointCoordinates(u,s),h>l&&(this.instructions.push([yi.CUSTOM,l,h,t,i,cS]),this.hitDetectionInstructions.push([yi.CUSTOM,l,h,t,a||i,cS]));break;case Kr.POINT:u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),h=this.coordinates.length,this.instructions.push([yi.CUSTOM,l,h,t,i]),this.hitDetectionInstructions.push([yi.CUSTOM,l,h,t,a||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(t,r){this.beginGeometryInstruction1_=[yi.BEGIN_GEOMETRY,r,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[yi.BEGIN_GEOMETRY,r,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var r,i=t.length,a,o,s=-1;for(r=0;r<i;++r)a=t[r],o=a[0],o==yi.END_GEOMETRY?s=r:o==yi.BEGIN_GEOMETRY&&(a[2]=r,L0r(this.hitDetectionInstructions,s,r),s=-1)},e.prototype.setFillStrokeStyle=function(t,r){var i=this.state;if(t){var a=t.getColor();i.fillStyle=jy(a||K1)}else i.fillStyle=void 0;if(r){var o=r.getColor();i.strokeStyle=jy(o||cN);var s=r.getLineCap();i.lineCap=s!==void 0?s:i7;var l=r.getLineDash();i.lineDash=l?l.slice():lN;var u=r.getLineDashOffset();i.lineDashOffset=u||uN;var h=r.getLineJoin();i.lineJoin=h!==void 0?h:$M;var c=r.getWidth();i.lineWidth=c!==void 0?c:dN;var f=r.getMiterLimit();i.miterLimit=f!==void 0?f:hN,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var r=t.fillStyle,i=[yi.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[yi.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,r){var i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,r){var i=t.strokeStyle,a=t.lineCap,o=t.lineDash,s=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=a||o!=t.currentLineDash&&!Iw(t.currentLineDash,o)||t.currentLineDashOffset!=s||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=h)&&(i!==void 0&&r.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=a,t.currentLineDash=o,t.currentLineDashOffset=s,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=h)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[yi.END_GEOMETRY,t];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Gje(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;f0(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(qje);const Ck=Jmr;var Qmr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),e1r=function(n){Qmr(e,n);function e(t,r,i,a){var o=n.call(this,t,r,i,a)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return e.prototype.drawPoint=function(t,r){if(!!this.image_){this.beginGeometry(t,r);var i=t.getFlatCoordinates(),a=t.getStride(),o=this.coordinates.length,s=this.appendFlatPointCoordinates(i,a);this.instructions.push([yi.DRAW_IMAGE,o,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([yi.DRAW_IMAGE,o,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(t,r){if(!!this.image_){this.beginGeometry(t,r);var i=t.getFlatCoordinates(),a=t.getStride(),o=this.coordinates.length,s=this.appendFlatPointCoordinates(i,a);this.instructions.push([yi.DRAW_IMAGE,o,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([yi.DRAW_IMAGE,o,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,n.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,r){var i=t.getAnchor(),a=t.getSize(),o=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),l=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=s,this.height_=a[1],this.opacity_=t.getOpacity(),this.originX_=l[0]*this.imagePixelRatio_,this.originY_=l[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=a[0],this.declutterImageWithText_=r},e}(Ck);const t1r=e1r;var r1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),n1r=function(n){r1r(e,n);function e(t,r,i,a){return n.call(this,t,r,i,a)||this}return e.prototype.drawFlatCoordinates_=function(t,r,i,a){var o=this.coordinates.length,s=this.appendFlatLineCoordinates(t,r,i,a,!1,!1),l=[yi.MOVE_TO_LINE_TO,o,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(t,r){var i=this.state,a=i.strokeStyle,o=i.lineWidth;if(!(a===void 0||o===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,r),this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,lN,uN],gE);var s=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(hS),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(t,r){var i=this.state,a=i.strokeStyle,o=i.lineWidth;if(!(a===void 0||o===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,r),this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],gE);for(var s=t.getEnds(),l=t.getFlatCoordinates(),u=t.getStride(),h=0,c=0,f=s.length;c<f;++c)h=this.drawFlatCoordinates_(l,h,s[c],u);this.hitDetectionInstructions.push(hS),this.endGeometry(r)}},e.prototype.finish=function(){var t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(hS),this.reverseHitDetectionInstructions(),this.state=null,n.prototype.finish.call(this)},e.prototype.applyStroke=function(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(hS),t.lastStroke=this.coordinates.length),t.lastStroke=0,n.prototype.applyStroke.call(this,t),this.instructions.push(gE)},e}(Ck);const i1r=n1r;function xue(n,e,t,r,i,a,o){var s=(t-e)/r;if(s<3){for(;e<t;e+=r)a[o++]=n[e],a[o++]=n[e+1];return o}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,t-r],h=0;u.length>0;){for(var c=u.pop(),f=u.pop(),d=0,v=n[f],p=n[f+1],g=n[c],m=n[c+1],y=f+r;y<c;y+=r){var _=n[y],x=n[y+1],S=kje(_,x,v,p,g,m);S>d&&(h=y,d=S)}d>i&&(l[(h-e)/r]=1,f+r<h&&u.push(f,h),h+r<c&&u.push(h,c))}for(var y=0;y<s;++y)l[y]&&(a[o++]=n[e+y*r],a[o++]=n[e+y*r+1]);return o}function a1r(n,e,t,r,i,a,o,s){for(var l=0,u=t.length;l<u;++l){var h=t[l];o=xue(n,e,h,r,i,a,o),s.push(o),e=h}return o}function Vb(n,e){return e*Math.round(n/e)}function o1r(n,e,t,r,i,a,o){if(e==t)return o;var s=Vb(n[e],i),l=Vb(n[e+1],i);e+=r,a[o++]=s,a[o++]=l;var u,h;do if(u=Vb(n[e],i),h=Vb(n[e+1],i),e+=r,e==t)return a[o++]=u,a[o++]=h,o;while(u==s&&h==l);for(;e<t;){var c=Vb(n[e],i),f=Vb(n[e+1],i);if(e+=r,!(c==u&&f==h)){var d=u-s,v=h-l,p=c-s,g=f-l;if(d*g==v*p&&(d<0&&p<d||d==p||d>0&&p>d)&&(v<0&&g<v||v==g||v>0&&g>v)){u=c,h=f;continue}a[o++]=u,a[o++]=h,s=u,l=h,u=c,h=f}}return a[o++]=u,a[o++]=h,o}function dXe(n,e,t,r,i,a,o,s){for(var l=0,u=t.length;l<u;++l){var h=t[l];o=o1r(n,e,h,r,i,a,o),s.push(o),e=h}return o}function s1r(n,e,t,r,i,a,o,s){for(var l=0,u=t.length;l<u;++l){var h=t[l],c=[];o=dXe(n,e,h,r,i,a,o,c),s.push(c),e=h[h.length-1]}return o}var l1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),u1r=function(n){l1r(e,n);function e(t,r,i,a){return n.call(this,t,r,i,a)||this}return e.prototype.drawFlatCoordinatess_=function(t,r,i,a){var o=this.state,s=o.fillStyle!==void 0,l=o.strokeStyle!==void 0,u=i.length;this.instructions.push(gE),this.hitDetectionInstructions.push(gE);for(var h=0;h<u;++h){var c=i[h],f=this.coordinates.length,d=this.appendFlatLineCoordinates(t,r,c,a,!0,!l),v=[yi.MOVE_TO_LINE_TO,f,d];this.instructions.push(v),this.hitDetectionInstructions.push(v),l&&(this.instructions.push(pTe),this.hitDetectionInstructions.push(pTe)),r=c}return s&&(this.instructions.push(s6),this.hitDetectionInstructions.push(s6)),l&&(this.instructions.push(hS),this.hitDetectionInstructions.push(hS)),r},e.prototype.drawCircle=function(t,r){var i=this.state,a=i.fillStyle,o=i.strokeStyle;if(!(a===void 0&&o===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,r),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([yi.SET_FILL_STYLE,K1]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var s=t.getFlatCoordinates(),l=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,l,!1,!1);var h=[yi.CIRCLE,u];this.instructions.push(gE,h),this.hitDetectionInstructions.push(gE,h),i.fillStyle!==void 0&&(this.instructions.push(s6),this.hitDetectionInstructions.push(s6)),i.strokeStyle!==void 0&&(this.instructions.push(hS),this.hitDetectionInstructions.push(hS)),this.endGeometry(r)}},e.prototype.drawPolygon=function(t,r){var i=this.state,a=i.fillStyle,o=i.strokeStyle;if(!(a===void 0&&o===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,r),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([yi.SET_FILL_STYLE,K1]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var s=t.getEnds(),l=t.getOrientedFlatCoordinates(),u=t.getStride();this.drawFlatCoordinatess_(l,0,s,u),this.endGeometry(r)}},e.prototype.drawMultiPolygon=function(t,r){var i=this.state,a=i.fillStyle,o=i.strokeStyle;if(!(a===void 0&&o===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(t,r),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([yi.SET_FILL_STYLE,K1]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([yi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var s=t.getEndss(),l=t.getOrientedFlatCoordinates(),u=t.getStride(),h=0,c=0,f=s.length;c<f;++c)h=this.drawFlatCoordinatess_(l,h,s[c],u);this.endGeometry(r)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(t!==0)for(var r=this.coordinates,i=0,a=r.length;i<a;++i)r[i]=Vb(r[i],t);return n.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state,r=t.fillStyle;r!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)},e}(Ck);const gTe=u1r,vXe={POINT:"point",LINE:"line"};function h1r(n,e,t,r,i){var a=t,o=t,s=0,l=0,u=t,h,c,f,d,v,p,g,m,y,_;for(c=t;c<r;c+=i){var x=e[c],S=e[c+1];v!==void 0&&(y=x-v,_=S-p,d=Math.sqrt(y*y+_*_),g!==void 0&&(l+=f,h=Math.acos((g*y+m*_)/(f*d)),h>n&&(l>s&&(s=l,a=u,o=c),l=0,u=c-i)),f=d,g=y,m=_),v=x,p=S}return l+=d,l>s?[u,c]:[a,o]}var c1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),h7={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},f1r=function(n){c1r(e,n);function e(t,r,i,a){var o=n.call(this,t,r,i,a)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return e.prototype.finish=function(){var t=n.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},e.prototype.drawText=function(t,r){var i=this.textFillState_,a=this.textStrokeState_,o=this.textState_;if(!(this.text_===""||!o||!i&&!a)){var s=this.coordinates,l=s.length,u=t.getType(),h=null,c=t.getStride();if(o.placement===vXe.LINE&&(u==Kr.LINE_STRING||u==Kr.MULTI_LINE_STRING||u==Kr.POLYGON||u==Kr.MULTI_POLYGON)){if(!Cl(this.getBufferedMaxExtent(),t.getExtent()))return;var f=void 0;if(h=t.getFlatCoordinates(),u==Kr.LINE_STRING)f=[h.length];else if(u==Kr.MULTI_LINE_STRING)f=t.getEnds();else if(u==Kr.POLYGON)f=t.getEnds().slice(0,1);else if(u==Kr.MULTI_POLYGON){var d=t.getEndss();f=[];for(var v=0,p=d.length;v<p;++v)f.push(d[v][0])}this.beginGeometry(t,r);for(var g=o.textAlign,m=0,y=void 0,_=0,x=f.length;_<x;++_){if(g==null){var S=h1r(o.maxAngle,h,m,f[_],c);m=S[0],y=S[1]}else y=f[_];for(var v=m;v<y;v+=c)s.push(h[v],h[v+1]);var w=s.length;m=f[_],this.drawChars_(l,w),l=w}this.endGeometry(r)}else{var b=o.overflow?null:[];switch(u){case Kr.POINT:case Kr.MULTI_POINT:h=t.getFlatCoordinates();break;case Kr.LINE_STRING:h=t.getFlatMidpoint();break;case Kr.CIRCLE:h=t.getCenter();break;case Kr.MULTI_LINE_STRING:h=t.getFlatMidpoints(),c=2;break;case Kr.POLYGON:h=t.getFlatInteriorPoint(),o.overflow||b.push(h[2]/this.resolution),c=3;break;case Kr.MULTI_POLYGON:var E=t.getFlatInteriorPoints();h=[];for(var v=0,p=E.length;v<p;v+=3)o.overflow||b.push(E[v+2]/this.resolution),h.push(E[v],E[v+1]);if(h.length===0)return;c=2;break}var w=this.appendFlatPointCoordinates(h,c);if(w===l)return;if(b&&(w-l)/2!==h.length/c){var T=l/2;b=b.filter(function(W,z){var V=s[(T+z)*2]===h[z*c]&&s[(T+z)*2+1]===h[z*c+1];return V||--T,V})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,r);var C=o.padding;if(C!=pE&&(o.scale[0]<0||o.scale[1]<0)){var A=o.padding[0],M=o.padding[1],I=o.padding[2],R=o.padding[3];o.scale[0]<0&&(M=-M,R=-R),o.scale[1]<0&&(A=-A,I=-I),C=[A,M,I,R]}var k=this.pixelRatio;this.instructions.push([yi.DRAW_IMAGE,l,w,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,C==pE?pE:C.map(function(W){return W*k}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,b]);var D=1/k;this.hitDetectionInstructions.push([yi.DRAW_IMAGE,l,w,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[D,D],NaN,this.declutterImageWithText_,C,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,b]),this.endGeometry(r)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,r=this.textState_,i=this.textFillState_,a=this.strokeKey_;t&&(a in this.strokeStates||(this.strokeStates[a]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var o=this.textKey_;o in this.textStates||(this.textStates[o]={font:r.font,textAlign:r.textAlign||fN,textBaseline:r.textBaseline||a7,scale:r.scale});var s=this.fillKey_;i&&(s in this.fillStates||(this.fillStates[s]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,r){var i=this.textStrokeState_,a=this.textState_,o=this.strokeKey_,s=this.textKey_,l=this.fillKey_;this.saveTextStates_();var u=this.pixelRatio,h=h7[a.textBaseline],c=this.textOffsetY_*u,f=this.text_,d=i?i.lineWidth*Math.abs(a.scale[0])/2:0;this.instructions.push([yi.DRAW_CHARS,t,r,h,a.overflow,l,a.maxAngle,u,c,o,d*u,f,s,1]),this.hitDetectionInstructions.push([yi.DRAW_CHARS,t,r,h,a.overflow,l,a.maxAngle,1,c,o,d,f,s,1/u])},e.prototype.setTextStyle=function(t,r){var i,a,o;if(!t)this.text_="";else{var s=t.getFill();s?(a=this.textFillState_,a||(a={},this.textFillState_=a),a.fillStyle=jy(s.getColor()||K1)):(a=null,this.textFillState_=a);var l=t.getStroke();if(!l)o=null,this.textStrokeState_=o;else{o=this.textStrokeState_,o||(o={},this.textStrokeState_=o);var u=l.getLineDash(),h=l.getLineDashOffset(),c=l.getWidth(),f=l.getMiterLimit();o.lineCap=l.getLineCap()||i7,o.lineDash=u?u.slice():lN,o.lineDashOffset=h===void 0?uN:h,o.lineJoin=l.getLineJoin()||$M,o.lineWidth=c===void 0?dN:c,o.miterLimit=f===void 0?hN:f,o.strokeStyle=jy(l.getColor()||cN)}i=this.textState_;var d=t.getFont()||Jje;tmr(d);var v=t.getScaleArray();i.overflow=t.getOverflow(),i.font=d,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||a7,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||pE,i.scale=v===void 0?[1,1]:v;var p=t.getOffsetX(),g=t.getOffsetY(),m=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=p===void 0?0:p,this.textOffsetY_=g===void 0?0:g,this.textRotateWithView_=m===void 0?!1:m,this.textRotation_=y===void 0?0:y,this.strokeKey_=o?(typeof o.strokeStyle=="string"?o.strokeStyle:vi(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=a?typeof a.fillStyle=="string"?a.fillStyle:"|"+vi(a.fillStyle):""}this.declutterImageWithText_=r},e}(Ck);const d1r=f1r;var v1r={Circle:gTe,Default:Ck,Image:t1r,LineString:i1r,Polygon:gTe,Text:d1r},p1r=function(){function n(e,t,r,i){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=i,this.resolution_=r,this.buildersByZIndex_={}}return n.prototype.finish=function(){var e={};for(var t in this.buildersByZIndex_){e[t]=e[t]||{};var r=this.buildersByZIndex_[t];for(var i in r){var a=r[i].finish();e[t][i]=a}}return e},n.prototype.getBuilder=function(e,t){var r=e!==void 0?e.toString():"0",i=this.buildersByZIndex_[r];i===void 0&&(i={},this.buildersByZIndex_[r]=i);var a=i[t];if(a===void 0){var o=v1r[t];a=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[t]=a}return a},n}();const c7=p1r;var g1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),y1r=function(n){g1r(e,n);function e(t){var r=n.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=t,r.declutterExecutorGroup=null,r}return e.prototype.getFeatures=function(t){return ti()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return ti()},e.prototype.renderFrame=function(t,r){return ti()},e.prototype.loadedTileCallback=function(t,r,i){t[r]||(t[r]={}),t[r][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,r,i){return function(a,o){var s=this.loadedTileCallback.bind(this,i,a);return t.forEachLoadedTile(r,a,o,s)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o){},e.prototype.getDataAtPixel=function(t,r,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){var r=t.target;r.getState()===Ai.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var r=t.getState();return r!=Ai.LOADED&&r!=Ai.ERROR&&t.addEventListener(Ci.CHANGE,this.boundHandleImageChange_),r==Ai.IDLE&&(t.load(),r=t.getState()),r==Ai.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==p2.READY&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,n.prototype.disposeInternal.call(this)},e}(fT);const pXe=y1r;var m1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_1r=function(n){m1r(e,n);function e(t,r,i,a){var o=n.call(this,t)||this;return o.inversePixelTransform=r,o.frameState=i,o.context=a,o}return e}(Fm);const PR=_1r;var x1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),MO=null;function S1r(){var n=document.createElement("canvas");n.width=1,n.height=1,MO=n.getContext("2d")}var w1r=function(n){x1r(e,n);function e(t){var r=n.call(this,t)||this;return r.container=null,r.renderedResolution,r.tempTransform=Nu(),r.pixelTransform=Nu(),r.inversePixelTransform=Nu(),r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return e.prototype.getImageData=function(t,r,i){MO||S1r(),MO.clearRect(0,0,1,1);var a;try{MO.drawImage(t,r,i,1,1,0,0,1,1),a=MO.getImageData(0,0,1,1).data}catch{return null}return a},e.prototype.getBackground=function(t){var r=this.getLayer(),i=r.getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0},e.prototype.useContainer=function(t,r,i,a){var o=this.getLayer().getClassName(),s,l;if(t&&t.className===o&&t.style.opacity===""&&i===1&&(!a||t.style.backgroundColor&&Iw(n7(t.style.backgroundColor),n7(a)))){var u=t.firstElementChild;u instanceof HTMLCanvasElement&&(l=u.getContext("2d"))}if(l&&l.canvas.style.transform===r?(this.container=t,this.context=l,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){s=document.createElement("div"),s.className=o;var h=s.style;h.position="absolute",h.width="100%",h.height="100%",a&&(h.backgroundColor=a),l=Ad();var u=l.canvas;s.appendChild(u),h=u.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=s,this.context=l}},e.prototype.clipUnrotated=function(t,r,i){var a=Lw(i),o=BV(i),s=FV(i),l=kV(i);ks(r.coordinateToPixelTransform,a),ks(r.coordinateToPixelTransform,o),ks(r.coordinateToPixelTransform,s),ks(r.coordinateToPixelTransform,l);var u=this.inversePixelTransform;ks(u,a),ks(u,o),ks(u,s),ks(u,l),t.save(),t.beginPath(),t.moveTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(l[0]),Math.round(l[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,r,i){var a=this.getLayer();if(a.hasListener(t)){var o=new PR(t,this.inversePixelTransform,i,r);a.dispatchEvent(o)}},e.prototype.preRender=function(t,r){this.frameState=r,this.dispatchRenderEvent_(Tf.PRERENDER,t,r)},e.prototype.postRender=function(t,r){this.dispatchRenderEvent_(Tf.POSTRENDER,t,r)},e.prototype.getRenderTransform=function(t,r,i,a,o,s,l){var u=o/2,h=s/2,c=a/r,f=-c,d=-t[0]+l,v=-t[1];return Id(this.tempTransform,u,h,c,f,-i,d,v)},e.prototype.getDataAtPixel=function(t,r,i){var a=ks(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer(),l=s.getExtent();if(l){var u=ks(r.pixelToCoordinateTransform,t.slice());if(!dv(l,u))return null}var h=Math.round(a[0]),c=Math.round(a[1]),f=this.pixelContext_;if(!f){var d=document.createElement("canvas");d.width=1,d.height=1,f=d.getContext("2d"),this.pixelContext_=f}f.clearRect(0,0,1,1);var v;try{f.drawImage(o.canvas,h,c,1,1,0,0,1,1),v=f.getImageData(0,0,1,1).data}catch(p){return p.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):v}return v[3]===0?null:v},e.prototype.disposeInternal=function(){delete this.frameState,n.prototype.disposeInternal.call(this)},e}(pXe);const Sue=w1r;function b1r(n,e,t,r,i,a,o,s,l,u,h,c){var f=n[e],d=n[e+1],v=0,p=0,g=0,m=0;function y(){v=f,p=d,e+=r,f=n[e],d=n[e+1],m+=g,g=Math.sqrt((f-v)*(f-v)+(d-p)*(d-p))}do y();while(e<t-r&&m+g<a);for(var _=g===0?0:(a-m)/g,x=S1(v,f,_),S=S1(p,d,_),w=e-r,b=m,E=a+s*l(u,i,h);e<t-r&&m+g<E;)y();_=g===0?0:(E-m)/g;var T=S1(v,f,_),C=S1(p,d,_),A;if(c){var M=[x,S,T,C];Yje(M,0,4,2,c,M,M),A=M[0]>M[2]}else A=x>T;var I=Math.PI,R=[],k=w+r===e;e=w,g=0,m=b,f=n[e],d=n[e+1];var D;if(k){y(),D=Math.atan2(d-p,f-v),A&&(D+=D>0?-I:I);var G=(T+x)/2,W=(C+S)/2;return R[0]=[G,W,(E-a)/2,D,i],R}for(var z=0,V=i.length;z<V;){y();var q=Math.atan2(d-p,f-v);if(A&&(q+=q>0?-I:I),D!==void 0){var Y=q-D;if(Y+=Y>I?-2*I:Y<-I?2*I:0,Math.abs(Y)>o)return null}D=q;for(var le=z,j=0;z<V;++z){var Q=A?V-z-1:z,ie=s*l(u,i[Q],h);if(e+r<t&&m+g<a+j+ie/2)break;j+=ie}if(z!==le){var oe=A?i.substring(V-le,V-z):i.substring(le,z);_=g===0?0:(a+j/2-m)/g;var G=S1(v,f,_),W=S1(p,d,_);R.push([G,W,j/2,q,oe]),a+=j}}return R}function gXe(n,e,t,r){for(var i=n[e],a=n[e+1],o=0,s=e+r;s<t;s+=r){var l=n[s],u=n[s+1];o+=Math.sqrt((l-i)*(l-i)+(u-a)*(u-a)),i=l,a=u}return o}var wC=Md(),_x=[],a1=[],o1=[],xx=[];function yTe(n){return n[3].declutterBox}var E1r=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function mTe(n,e){return(e==="start"||e==="end")&&!E1r.test(n)&&(e=e==="start"?"left":"right"),h7[e]}function T1r(n,e,t){return t>0&&n.push(`
`,""),n.push(e,""),n}var C1r=function(){function n(e,t,r,i){this.overlaps=r,this.pixelRatio=t,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Nu(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return n.prototype.createLabel=function(e,t,r,i){var a=e+t+r+i;if(this.labels_[a])return this.labels_[a];var o=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,l=this.textStates[t],u=this.pixelRatio,h=[l.scale[0]*u,l.scale[1]*u],c=Array.isArray(e),f=mTe(c?e[0]:e,l.textAlign||fN),d=i&&o.lineWidth?o.lineWidth:0,v=c?e:e.split(`
`).reduce(T1r,[]),p=nmr(l,v),g=p.width,m=p.height,y=p.widths,_=p.heights,x=p.lineWidths,S=g+d,w=[],b=(S+2)*h[0],E=(m+d)*h[1],T={width:b<0?Math.floor(b):Math.ceil(b),height:E<0?Math.floor(E):Math.ceil(E),contextInstructions:w};if((h[0]!=1||h[1]!=1)&&w.push("scale",h),i){w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",d),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit);var C=NV?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;C.prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset))}r&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var A=.5-f,M=f*S+A*d,I=[],R=[],k=0,D=0,G=0,W=0,z,V=0,q=v.length;V<q;V+=2){var Y=v[V];if(Y===`
`){D+=k,k=0,M=f*S+A*d,++W;continue}var le=v[V+1]||l.font;le!==z&&(i&&I.push("font",le),r&&R.push("font",le),z=le),k=Math.max(k,_[G]);var j=[Y,M+A*y[G]+f*(y[G]-x[W]),.5*(d+k)+D];M+=y[G],i&&I.push("strokeText",j),r&&R.push("fillText",j),++G}return Array.prototype.push.apply(w,I),Array.prototype.push.apply(w,R),this.labels_[a]=T,T},n.prototype.replayTextBackground_=function(e,t,r,i,a,o,s){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,a),e.lineTo.apply(e,t),o&&(this.alignFill_=o[2],this.fill_(e)),s&&(this.setStrokeStyle_(e,s),e.stroke())},n.prototype.calculateImageOrLabelDimensions_=function(e,t,r,i,a,o,s,l,u,h,c,f,d,v,p,g){s*=f[0],l*=f[1];var m=r-s,y=i-l,_=a+u>e?e-u:a,x=o+h>t?t-h:o,S=v[3]+_*f[0]+v[1],w=v[0]+x*f[1]+v[2],b=m-v[3],E=y-v[0];(p||c!==0)&&(_x[0]=b,xx[0]=b,_x[1]=E,a1[1]=E,a1[0]=b+S,o1[0]=a1[0],o1[1]=E+w,xx[1]=o1[1]);var T;return c!==0?(T=Id(Nu(),r,i,1,1,c,-r,-i),ks(T,_x),ks(T,a1),ks(T,o1),ks(T,xx),pm(Math.min(_x[0],a1[0],o1[0],xx[0]),Math.min(_x[1],a1[1],o1[1],xx[1]),Math.max(_x[0],a1[0],o1[0],xx[0]),Math.max(_x[1],a1[1],o1[1],xx[1]),wC)):pm(Math.min(b,b+S),Math.min(E,E+w),Math.max(b,b+S),Math.max(E,E+w),wC),d&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:_,drawImageH:x,originX:u,originY:h,declutterBox:{minX:wC[0],minY:wC[1],maxX:wC[2],maxY:wC[3],value:g},canvasTransform:T,scale:f}},n.prototype.replayImageOrLabel_=function(e,t,r,i,a,o,s){var l=!!(o||s),u=i.declutterBox,h=e.canvas,c=s?s[2]*i.scale[0]/2:0,f=u.minX-c<=h.width/t&&u.maxX+c>=0&&u.minY-c<=h.height/t&&u.maxY+c>=0;return f&&(l&&this.replayTextBackground_(e,_x,a1,o1,xx,o,s),imr(e,i.canvasTransform,a,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},n.prototype.fill_=function(e){if(this.alignFill_){var t=ks(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(t[0]%r,t[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},n.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.setLineDash&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},n.prototype.drawLabelWithPointPlacement_=function(e,t,r,i){var a=this.textStates[t],o=this.createLabel(e,t,i,r),s=this.strokeStates[r],l=this.pixelRatio,u=mTe(Array.isArray(e)?e[0]:e,a.textAlign||fN),h=h7[a.textBaseline||a7],c=s&&s.lineWidth?s.lineWidth:0,f=o.width/l-2*a.scale[0],d=u*f+2*(.5-u)*c,v=h*o.height/l+2*(.5-h)*c;return{label:o,anchorX:d,anchorY:v}},n.prototype.execute_=function(e,t,r,i,a,o,s,l){var u;this.pixelCoordinates_&&Iw(r,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=ES(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Gyr(this.renderedTransform_,r));for(var h=0,c=i.length,f=0,d,v,p,g,m,y,_,x,S,w,b,E,T=0,C=0,A=null,M=null,I=this.coordinateCache_,R=this.viewRotation_,k=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,D={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:R},G=this.instructions!=i||this.overlaps?0:200,W,z,V,q;h<c;){var Y=i[h],le=Y[0];switch(le){case yi.BEGIN_GEOMETRY:W=Y[1],q=Y[3],W.getGeometry()?s!==void 0&&!Cl(s,q.getExtent())?h=Y[2]+1:++h:h=Y[2];break;case yi.BEGIN_PATH:T>G&&(this.fill_(e),T=0),C>G&&(e.stroke(),C=0),!T&&!C&&(e.beginPath(),g=NaN,m=NaN),++h;break;case yi.CIRCLE:f=Y[1];var j=u[f],Q=u[f+1],ie=u[f+2],oe=u[f+3],se=ie-j,me=oe-Q,Ce=Math.sqrt(se*se+me*me);e.moveTo(j+Ce,Q),e.arc(j,Q,Ce,0,2*Math.PI,!0),++h;break;case yi.CLOSE_PATH:e.closePath(),++h;break;case yi.CUSTOM:f=Y[1],d=Y[2];var Le=Y[3],re=Y[4],yt=Y.length==6?Y[5]:void 0;D.geometry=Le,D.feature=W,h in I||(I[h]=[]);var je=I[h];yt?yt(u,f,d,2,je):(je[0]=u[f],je[1]=u[f+1],je.length=2),re(je,D),++h;break;case yi.DRAW_IMAGE:f=Y[1],d=Y[2],x=Y[3],v=Y[4],p=Y[5];var st=Y[6],Nt=Y[7],Zt=Y[8],qe=Y[9],ur=Y[10],Dt=Y[11],ft=Y[12],Oe=Y[13],J=Y[14];if(!x&&Y.length>=19){S=Y[18],w=Y[19],b=Y[20],E=Y[21];var We=this.drawLabelWithPointPlacement_(S,w,b,E);x=We.label,Y[3]=x;var Tt=Y[22];v=(We.anchorX-Tt)*this.pixelRatio,Y[4]=v;var Qe=Y[23];p=(We.anchorY-Qe)*this.pixelRatio,Y[5]=p,st=x.height,Y[6]=st,Oe=x.width,Y[13]=Oe}var zt=void 0;Y.length>24&&(zt=Y[24]);var mt=void 0,wt=void 0,pt=void 0;Y.length>16?(mt=Y[15],wt=Y[16],pt=Y[17]):(mt=pE,wt=!1,pt=!1),ur&&k?Dt+=R:!ur&&!k&&(Dt-=R);for(var ar=0;f<d;f+=2)if(!(zt&&zt[ar++]<Oe/this.pixelRatio)){var kt=this.calculateImageOrLabelDimensions_(x.width,x.height,u[f],u[f+1],Oe,st,v,p,Zt,qe,Dt,ft,a,mt,wt||pt,W),Dr=[e,t,x,kt,Nt,wt?A:null,pt?M:null],Sr=void 0,jr=void 0;if(l&&J){var pn=d-f;if(!J[pn]){J[pn]=Dr;continue}if(Sr=J[pn],delete J[pn],jr=yTe(Sr),l.collides(jr))continue}l&&l.collides(kt.declutterBox)||(Sr&&(l&&l.insert(jr),this.replayImageOrLabel_.apply(this,Sr)),l&&l.insert(kt.declutterBox),this.replayImageOrLabel_.apply(this,Dr))}++h;break;case yi.DRAW_CHARS:var Jn=Y[1],Rn=Y[2],hi=Y[3],yn=Y[4];E=Y[5];var Oi=Y[6],oi=Y[7],Gi=Y[8];b=Y[9];var ws=Y[10];S=Y[11],w=Y[12];var Sl=[Y[13],Y[13]],Os=this.textStates[w],no=Os.font,vo=[Os.scale[0]*oi,Os.scale[1]*oi],No=void 0;no in this.widths_?No=this.widths_[no]:(No={},this.widths_[no]=No);var Jo=gXe(u,Jn,Rn,2),Lo=Math.abs(vo[0])*nTe(no,S,No);if(yn||Lo<=Jo){var hs=this.textStates[w].textAlign,Rs=(Jo-Lo)*h7[hs],Pn=b1r(u,Jn,Rn,2,S,Rs,Oi,Math.abs(vo[0]),nTe,no,No,k?0:this.viewRotation_);e:if(Pn){var mo=[],ue=void 0,xe=void 0,ce=void 0,pe=void 0,we=void 0;if(b)for(ue=0,xe=Pn.length;ue<xe;++ue){we=Pn[ue],ce=we[4],pe=this.createLabel(ce,w,"",b),v=we[2]+(vo[0]<0?-ws:ws),p=hi*pe.height+(.5-hi)*2*ws*vo[1]/vo[0]-Gi;var kt=this.calculateImageOrLabelDimensions_(pe.width,pe.height,we[0],we[1],pe.width,pe.height,v,p,0,0,we[3],Sl,!1,pE,!1,W);if(l&&l.collides(kt.declutterBox))break e;mo.push([e,t,pe,kt,1,null,null])}if(E)for(ue=0,xe=Pn.length;ue<xe;++ue){we=Pn[ue],ce=we[4],pe=this.createLabel(ce,w,E,""),v=we[2],p=hi*pe.height-Gi;var kt=this.calculateImageOrLabelDimensions_(pe.width,pe.height,we[0],we[1],pe.width,pe.height,v,p,0,0,we[3],Sl,!1,pE,!1,W);if(l&&l.collides(kt.declutterBox))break e;mo.push([e,t,pe,kt,1,null,null])}l&&l.load(mo.map(yTe));for(var Me=0,nt=mo.length;Me<nt;++Me)this.replayImageOrLabel_.apply(this,mo[Me])}}++h;break;case yi.END_GEOMETRY:if(o!==void 0){W=Y[1];var It=o(W,q);if(It)return It}++h;break;case yi.FILL:G?T++:this.fill_(e),++h;break;case yi.MOVE_TO_LINE_TO:for(f=Y[1],d=Y[2],z=u[f],V=u[f+1],y=z+.5|0,_=V+.5|0,(y!==g||_!==m)&&(e.moveTo(z,V),g=y,m=_),f+=2;f<d;f+=2)z=u[f],V=u[f+1],y=z+.5|0,_=V+.5|0,(f==d-2||y!==g||_!==m)&&(e.lineTo(z,V),g=y,m=_);++h;break;case yi.SET_FILL_STYLE:A=Y,this.alignFill_=Y[2],T&&(this.fill_(e),T=0,C&&(e.stroke(),C=0)),e.fillStyle=Y[1],++h;break;case yi.SET_STROKE_STYLE:M=Y,C&&(e.stroke(),C=0),this.setStrokeStyle_(e,Y),++h;break;case yi.STROKE:G?C++:e.stroke(),++h;break;default:++h;break}}T&&this.fill_(e),C&&e.stroke()},n.prototype.execute=function(e,t,r,i,a,o){this.viewRotation_=i,this.execute_(e,t,r,this.instructions,a,void 0,void 0,o)},n.prototype.executeHitDetection=function(e,t,r,i,a){return this.viewRotation_=r,this.execute_(e,1,t,this.hitDetectionInstructions,!0,i,a)},n}();const A1r=C1r;var XY=[ga.POLYGON,ga.CIRCLE,ga.LINE_STRING,ga.IMAGE,ga.TEXT,ga.DEFAULT],M1r=function(){function n(e,t,r,i,a,o){this.maxExtent_=e,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Nu(),this.createExecutors_(a)}return n.prototype.clip=function(e,t){var r=this.getClipCoords(t);e.beginPath(),e.moveTo(r[0],r[1]),e.lineTo(r[2],r[3]),e.lineTo(r[4],r[5]),e.lineTo(r[6],r[7]),e.clip()},n.prototype.createExecutors_=function(e){for(var t in e){var r=this.executorsByZIndex_[t];r===void 0&&(r={},this.executorsByZIndex_[t]=r);var i=e[t];for(var a in i){var o=i[a];r[a]=new A1r(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},n.prototype.hasExecutors=function(e){for(var t in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[t],i=0,a=e.length;i<a;++i)if(e[i]in r)return!0;return!1},n.prototype.forEachFeatureAtCoordinate=function(e,t,r,i,a,o){i=Math.round(i);var s=i*2+1,l=Id(this.hitDetectionTransform_,i+.5,i+.5,1/t,-1/t,-r,-e[0],-e[1]),u=!this.hitDetectionContext_;u&&(this.hitDetectionContext_=Ad(s,s));var h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):u||h.clearRect(0,0,s,s);var c;this.renderBuffer_!==void 0&&(c=Md(),MR(c,e),f0(c,t*(this.renderBuffer_+i),c));var f=I1r(i),d;function v(w,b){for(var E=h.getImageData(0,0,s,s).data,T=0,C=f.length;T<C;T++)if(E[f[T]]>0){if(!o||d!==ga.IMAGE&&d!==ga.TEXT||o.indexOf(w)!==-1){var A=(f[T]-3)/4,M=i-A%s,I=i-(A/s|0),R=a(w,b,M*M+I*I);if(R)return R}h.clearRect(0,0,s,s);break}}var p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(f2);var g,m,y,_,x;for(g=p.length-1;g>=0;--g){var S=p[g].toString();for(y=this.executorsByZIndex_[S],m=XY.length-1;m>=0;--m)if(d=XY[m],_=y[d],_!==void 0&&(x=_.executeHitDetection(h,l,r,v,c),x))return x}},n.prototype.getClipCoords=function(e){var t=this.maxExtent_;if(!t)return null;var r=t[0],i=t[1],a=t[2],o=t[3],s=[r,i,r,o,a,o,a,i];return ES(s,0,8,2,e,s),s},n.prototype.isEmpty=function(){return v2(this.executorsByZIndex_)},n.prototype.execute=function(e,t,r,i,a,o,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(f2),this.maxExtent_&&(e.save(),this.clip(e,r));var u=o||XY,h,c,f,d,v,p;for(s&&l.reverse(),h=0,c=l.length;h<c;++h){var g=l[h].toString();for(v=this.executorsByZIndex_[g],f=0,d=u.length;f<d;++f){var m=u[f];p=v[m],p!==void 0&&p.execute(e,t,r,i,a,s)}}this.maxExtent_&&e.restore()},n}(),YY={};function I1r(n){if(YY[n]!==void 0)return YY[n];for(var e=n*2+1,t=n*n,r=new Array(t+1),i=0;i<=n;++i)for(var a=0;a<=n;++a){var o=i*i+a*a;if(o>t)break;var s=r[o];s||(s=[],r[o]=s),s.push(((n+i)*e+(n+a))*4+3),i>0&&s.push(((n-i)*e+(n+a))*4+3),a>0&&(s.push(((n+i)*e+(n-a))*4+3),i>0&&s.push(((n-i)*e+(n-a))*4+3))}for(var l=[],i=0,u=r.length;i<u;++i)r[i]&&l.push.apply(l,r[i]);return YY[n]=l,l}const f7=M1r,Gs={ANIMATING:0,INTERACTING:1},Ux={FRACTION:"fraction",PIXELS:"pixels"},ep={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var L1r=function(){function n(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return n.prototype.clear=function(){this.cache_={},this.cacheSize_=0},n.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},n.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var t in this.cache_){var r=this.cache_[t];(e++&3)===0&&!r.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},n.prototype.get=function(e,t,r){var i=_Te(e,t,r);return i in this.cache_?this.cache_[i]:null},n.prototype.set=function(e,t,r,i){var a=_Te(e,t,r);this.cache_[a]=i,++this.cacheSize_},n.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},n}();function _Te(n,e,t){var r=t?Zje(t):"null";return e+":"+n+":"+r}var d7=new L1r,P1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),O1r=function(n){P1r(e,n);function e(t,r,i,a){var o=n.call(this)||this;return o.extent=t,o.pixelRatio_=i,o.resolution=r,o.state=a,o}return e.prototype.changed=function(){this.dispatchEvent(Ci.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return ti()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){ti()},e}(eL);const wue=O1r;var R1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),D1r=function(n){R1r(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,i,Ai.IDLE)||this;return l.src_=a,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.state=Ai.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ai.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=lh(this.extent)/this.image_.height),this.state=Ai.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Ai.IDLE||this.state==Ai.ERROR)&&(this.state=Ai.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=bue(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=lh(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(wue);function bue(n,e,t){var r=n,i=!0,a=!1,o=!1,s=[J9(r,Ci.LOAD,function(){o=!0,a||e()})];return r.src&&H0r?(a=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(o?e():t())})):s.push(J9(r,Ci.ERROR,t)),function(){i=!1,s.forEach(Ms)}}const N1r=D1r;var k1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),NP=null,F1r=function(n){k1r(e,n);function e(t,r,i,a,o,s){var l=n.call(this)||this;return l.hitDetectionImage_=null,l.image_=t||new Image,a!==null&&(l.image_.crossOrigin=a),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=o,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Ai.LOADED){NP||(NP=Ad(1,1)),NP.drawImage(this.image_,0,0);try{NP.getImageData(0,0,1,1),this.tainted_=!1}catch{NP=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Ci.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Ai.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Ai.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],r=this.size_[1],i=Ad(t,r);i.fillRect(0,0,t,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ai.IDLE){this.imageState_=Ai.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=bue(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==Ai.LOADED)){var r=document.createElement("canvas");this.canvas_[t]=r,r.width=Math.ceil(this.image_.width*t),r.height=Math.ceil(this.image_.height*t);var i=r.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=Zje(this.color_),i.fillRect(0,0,r.width/t,r.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var a=i.getImageData(0,0,r.width,r.height),o=a.data,s=this.color_[0]/255,l=this.color_[1]/255,u=this.color_[2]/255,h=this.color_[3],c=0,f=o.length;c<f;c+=4)o[c]*=s,o[c+1]*=l,o[c+2]*=u,o[c+3]*=h;i.putImageData(a,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(eL);function B1r(n,e,t,r,i,a){var o=d7.get(e,r,a);return o||(o=new F1r(n,e,t,r,i,a),d7.set(e,r,a,o)),o}var G1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),z1r=function(n){G1r(e,n);function e(t){var r=this,i=t||{},a=i.opacity!==void 0?i.opacity:1,o=i.rotation!==void 0?i.rotation:0,s=i.scale!==void 0?i.scale:1,l=i.rotateWithView!==void 0?i.rotateWithView:!1;r=n.call(this,{opacity:a,rotation:o,scale:s,displacement:i.displacement!==void 0?i.displacement:[0,0],rotateWithView:l})||this,r.anchor_=i.anchor!==void 0?i.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=i.anchorOrigin!==void 0?i.anchorOrigin:ep.TOP_LEFT,r.anchorXUnits_=i.anchorXUnits!==void 0?i.anchorXUnits:Ux.FRACTION,r.anchorYUnits_=i.anchorYUnits!==void 0?i.anchorYUnits:Ux.FRACTION,r.crossOrigin_=i.crossOrigin!==void 0?i.crossOrigin:null;var u=i.img!==void 0?i.img:null;r.imgSize_=i.imgSize;var h=i.src;ki(!(h!==void 0&&u),4),ki(!u||u&&r.imgSize_,5),(h===void 0||h.length===0)&&u&&(h=u.src||vi(u)),ki(h!==void 0&&h.length>0,6);var c=i.src!==void 0?Ai.IDLE:Ai.LOADED;return r.color_=i.color!==void 0?n7(i.color):null,r.iconImage_=B1r(u,h,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,c,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:ep.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==Ux.FRACTION||this.anchorYUnits_==Ux.FRACTION){if(!r)return null;t=this.anchor_.slice(),this.anchorXUnits_==Ux.FRACTION&&(t[0]*=r[0]),this.anchorYUnits_==Ux.FRACTION&&(t[1]*=r[1])}if(this.anchorOrigin_!=ep.TOP_LEFT){if(!r)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==ep.TOP_RIGHT||this.anchorOrigin_==ep.BOTTOM_RIGHT)&&(t[0]=-t[0]+r[0]),(this.anchorOrigin_==ep.BOTTOM_LEFT||this.anchorOrigin_==ep.BOTTOM_RIGHT)&&(t[1]=-t[1]+r[1])}this.normalizedAnchor_=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=ep.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;t=t.slice(),(this.offsetOrigin_==ep.TOP_RIGHT||this.offsetOrigin_==ep.BOTTOM_RIGHT)&&(t[0]=i[0]-r[0]-t[0]),(this.offsetOrigin_==ep.BOTTOM_LEFT||this.offsetOrigin_==ep.BOTTOM_RIGHT)&&(t[1]=i[1]-r[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(Ci.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Ci.CHANGE,t)},e}(cXe);const yy=z1r;var U1r="#333",V1r=function(){function n(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=nh(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Ko({color:U1r}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:vXe.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}return n.prototype.clone=function(){var e=this.getScale();return new n({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},n.prototype.getOverflow=function(){return this.overflow_},n.prototype.getFont=function(){return this.font_},n.prototype.getMaxAngle=function(){return this.maxAngle_},n.prototype.getPlacement=function(){return this.placement_},n.prototype.getOffsetX=function(){return this.offsetX_},n.prototype.getOffsetY=function(){return this.offsetY_},n.prototype.getFill=function(){return this.fill_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getStroke=function(){return this.stroke_},n.prototype.getText=function(){return this.text_},n.prototype.getTextAlign=function(){return this.textAlign_},n.prototype.getTextBaseline=function(){return this.textBaseline_},n.prototype.getBackgroundFill=function(){return this.backgroundFill_},n.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},n.prototype.getPadding=function(){return this.padding_},n.prototype.setOverflow=function(e){this.overflow_=e},n.prototype.setFont=function(e){this.font_=e},n.prototype.setMaxAngle=function(e){this.maxAngle_=e},n.prototype.setOffsetX=function(e){this.offsetX_=e},n.prototype.setOffsetY=function(e){this.offsetY_=e},n.prototype.setPlacement=function(e){this.placement_=e},n.prototype.setRotateWithView=function(e){this.rotateWithView_=e},n.prototype.setFill=function(e){this.fill_=e},n.prototype.setRotation=function(e){this.rotation_=e},n.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=nh(e!==void 0?e:1)},n.prototype.setStroke=function(e){this.stroke_=e},n.prototype.setText=function(e){this.text_=e},n.prototype.setTextAlign=function(e){this.textAlign_=e},n.prototype.setTextBaseline=function(e){this.textBaseline_=e},n.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},n.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},n.prototype.setPadding=function(e){this.padding_=e},n}();const J1=V1r;var uv=.5;function yXe(n,e,t,r,i,a,o){var s=n[0]*uv,l=n[1]*uv,u=Ad(s,l);u.imageSmoothingEnabled=!1;for(var h=u.canvas,c=new yue(u,uv,i,null,o),f=t.length,d=Math.floor((256*256*256-1)/f),v={},p=1;p<=f;++p){var g=t[p-1],m=g.getStyleFunction()||r;if(!!r){var y=m(g,a);if(!!y){Array.isArray(y)||(y=[y]);for(var _=p*d,x="#"+("000000"+_.toString(16)).slice(-6),S=0,w=y.length;S<w;++S){var b=y[S],E=b.getGeometryFunction()(g);if(!(!E||!Cl(i,E.getExtent()))){var T=b.clone(),C=T.getFill();C&&C.setColor(x);var A=T.getStroke();A&&(A.setColor(x),A.setLineDash(null)),T.setText(void 0);var M=b.getImage();if(M&&M.getOpacity()!==0){var I=M.getImageSize();if(!I)continue;var R=Ad(I[0],I[1],void 0,{alpha:!1}),k=R.canvas;R.fillStyle=x,R.fillRect(0,0,k.width,k.height),T.setImage(new yy({img:k,imgSize:I,anchor:M.getAnchor(),anchorXUnits:Ux.PIXELS,anchorYUnits:Ux.PIXELS,offset:M.getOrigin(),opacity:1,size:M.getSize(),scale:M.getScale(),rotation:M.getRotation(),rotateWithView:M.getRotateWithView()}))}var D=T.getZIndex()||0,G=v[D];G||(G={},v[D]=G,G[Kr.POLYGON]=[],G[Kr.CIRCLE]=[],G[Kr.LINE_STRING]=[],G[Kr.POINT]=[]),G[E.getType().replace("Multi","")].push(E,T)}}}}}for(var W=Object.keys(v).map(Number).sort(f2),p=0,z=W.length;p<z;++p){var G=v[W[p]];for(var V in G)for(var q=G[V],S=0,w=q.length;S<w;S+=2){c.setStyle(q[S+1]);for(var Y=0,le=e.length;Y<le;++Y)c.setTransform(e[Y]),c.drawGeometry(q[S])}}return u.getImageData(0,0,h.width,h.height)}function mXe(n,e,t){var r=[];if(t){var i=Math.floor(Math.round(n[0])*uv),a=Math.floor(Math.round(n[1])*uv),o=(Ui(i,0,t.width-1)+Ui(a,0,t.height-1)*t.width)*4,s=t.data[o],l=t.data[o+1],u=t.data[o+2],h=u+256*(l+256*s),c=Math.floor((256*256*256-1)/e.length);h&&h%c===0&&r.push(e[h/c-1])}return r}var $1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),W1r=function(n){$1r(e,n);function e(t){var r=n.call(this,t)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=Md(),r.wrappedRenderedExtent_=Md(),r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r}return e.prototype.renderWorlds=function(t,r,i){var a=r.extent,o=r.viewState,s=o.center,l=o.resolution,u=o.projection,h=o.rotation,c=u.getExtent(),f=this.getLayer().getSource(),d=r.pixelRatio,v=r.viewHints,p=!(v[Gs.ANIMATING]||v[Gs.INTERACTING]),g=this.context,m=Math.round(r.size[0]*d),y=Math.round(r.size[1]*d),_=f.getWrapX()&&u.canWrapX(),x=_?Co(c):null,S=_?Math.ceil((a[2]-c[2])/x)+1:1,w=_?Math.floor((a[0]-c[0])/x):0;do{var b=this.getRenderTransform(s,l,h,d,m,y,w*x);t.execute(g,1,b,h,p,void 0,i)}while(++w<S)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,r){var i=t.pixelRatio,a=t.layerStatesArray[t.layerIndex];Uyr(this.pixelTransform,1/i,1/i),bk(this.inversePixelTransform,this.pixelTransform);var o=gue(this.pixelTransform);this.useContainer(r,o,a.opacity,this.getBackground(t));var s=this.context,l=s.canvas,u=this.replayGroup_,h=this.declutterExecutorGroup;if((!u||u.isEmpty())&&(!h||h.isEmpty()))return null;var c=Math.round(t.size[0]*i),f=Math.round(t.size[1]*i);l.width!=c||l.height!=f?(l.width=c,l.height=f,l.style.transform!==o&&(l.style.transform=o)):this.containerReused||s.clearRect(0,0,c,f),this.preRender(s,t);var d=t.viewState;d.projection;var v=!1,p=!0;if(a.extent&&this.clipping){var g=F1(a.extent);p=Cl(g,t.extent),v=p&&!vv(g,t.extent),v&&this.clipUnrotated(s,t,g)}p&&this.renderWorlds(u,t),v&&s.restore(),this.postRender(s,t);var m=Nje(a.opacity),y=this.container;return m!==y.style.opacity&&(y.style.opacity=m),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];ks(this.pixelTransform,i);var a=this.renderedCenter_,o=this.renderedResolution_,s=this.renderedRotation_,l=this.renderedProjection_,u=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],f=i[0]*uv,d=i[1]*uv;c.push(this.getRenderTransform(a,o,s,uv,f,d,0).slice());var v=h.getSource(),p=l.getExtent();if(v.getWrapX()&&l.canWrapX()&&!vv(p,u)){for(var g=u[0],m=Co(p),y=0,_=void 0;g<p[0];)--y,_=m*y,c.push(this.getRenderTransform(a,o,s,uv,f,d,_).slice()),g+=m;for(y=0,g=u[2];g>p[2];)++y,_=m*y,c.push(this.getRenderTransform(a,o,s,uv,f,d,_).slice()),g-=m}this.hitDetectionImageData_=yXe(i,c,this.renderedFeatures_,h.getStyleFunction(),u,o,s)}r(mXe(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o){var s=this;if(!!this.replayGroup_){var l=r.viewState.resolution,u=r.viewState.rotation,h=this.getLayer(),c={},f=function(p,g,m){var y=vi(p),_=c[y];if(_){if(_!==!0&&m<_.distanceSq){if(m===0)return c[y]=!0,o.splice(o.lastIndexOf(_),1),a(p,h,g);_.geometry=g,_.distanceSq=m}}else{if(m===0)return c[y]=!0,a(p,h,g);o.push(c[y]={feature:p,layer:h,geometry:g,distanceSq:m,callback:a})}},d,v=[this.replayGroup_];return this.declutterExecutorGroup&&v.push(this.declutterExecutorGroup),v.some(function(p){return d=p.forEachFeatureAtCoordinate(t,l,u,i,f,p===s.declutterExecutorGroup&&r.declutterTree?r.declutterTree.all().map(function(g){return g.value}):null)}),d}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var r=this.getLayer(),i=r.getSource();if(!i)return!1;var a=t.viewHints[Gs.ANIMATING],o=t.viewHints[Gs.INTERACTING],s=r.getUpdateWhileAnimating(),l=r.getUpdateWhileInteracting();if(!this.dirty_&&!s&&a||!l&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var u=t.extent,h=t.viewState,c=h.projection,f=h.resolution,d=t.pixelRatio,v=r.getRevision(),p=r.getRenderBuffer(),g=r.getRenderOrder();g===void 0&&(g=dmr);var m=h.center.slice(),y=f0(u,p*f),_=y.slice(),x=[y.slice()],S=c.getExtent();if(i.getWrapX()&&c.canWrapX()&&!vv(S,t.extent)){var w=Co(S),b=Math.max(Co(y)/2,w);y[0]=S[0]-b,y[2]=S[2]+b,hue(m,c);var E=Wje(x[0],c);E[0]<S[0]&&E[2]<S[2]?x.push([E[0]+w,E[1],E[2]+w,E[3]]):E[0]>S[0]&&E[2]>S[2]&&x.push([E[0]-w,E[1],E[2]-w,E[3]])}if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==v&&this.renderedRenderOrder_==g&&vv(this.wrappedRenderedExtent_,y))return Iw(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var T=new c7(Lte(f,d),y,f,d),C;this.getLayer().getDeclutter()&&(C=new c7(Lte(f,d),y,f,d));for(var A,M,I,M=0,I=x.length;M<I;++M)i.loadFeatures(x[M],f,c);var R=mue(f,d),k=function(V){var q,Y=V.getStyleFunction()||r.getStyleFunction();if(Y&&(q=Y(V,f)),q){var le=this.renderFeature(V,R,q,T,A,C);this.dirty_=this.dirty_||le}}.bind(this),D=Xje(y),G=i.getFeaturesInExtent(D);g&&G.sort(g);for(var M=0,I=G.length;M<I;++M)k(G[M]);this.renderedFeatures_=G;var W=T.finish(),z=new f7(y,f,d,i.getOverlaps(),W,r.getRenderBuffer());return C&&(this.declutterExecutorGroup=new f7(y,f,d,i.getOverlaps(),C.finish(),r.getRenderBuffer())),this.renderedResolution_=f,this.renderedRevision_=v,this.renderedRenderOrder_=g,this.renderedExtent_=_,this.wrappedRenderedExtent_=y,this.renderedCenter_=m,this.renderedProjection_=c,this.replayGroup_=z,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,r,i,a,o,s){if(!i)return!1;var l=!1;if(Array.isArray(i))for(var u=0,h=i.length;u<h;++u)l=s7(a,t,i[u],r,this.boundHandleStyleImageChange_,o,s)||l;else l=s7(a,t,i,r,this.boundHandleStyleImageChange_,o,s);return l},e}(Sue);const H1r=W1r;var j1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),X1r=function(n){j1r(e,n);function e(t){return n.call(this,t)||this}return e.prototype.createRenderer=function(){return new H1r(this)},e}(GV);const Sy=X1r;var Y1r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),q1r=function(n){Y1r(e,n);function e(t){var r=n.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){var i=t;r.setGeometry(i)}else{var a=t;r.setProperties(a)}return r}return e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var i=this.getStyle();return i&&t.setStyle(i),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Ms(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=pa(t,Ci.CHANGE,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?Z1r(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(kv);function Z1r(n){if(typeof n=="function")return n;var e;if(Array.isArray(n))e=n;else{ki(typeof n.getZIndex=="function",41);var t=n;e=[t]}return function(){return e}}const d0=q1r,br={getOlVersion(){if(B0r&&Q9)return Q9.split(".")[0];if(window&&window.ol){if(window.ol.util)return"6";if(window.ol.WebGLMap)return"5"}return"4"},toGeoJSON(n){return n?new uh().toGeoJSON(n):null},toSuperMapGeometry(n){return!n||!n.type?null:new uh().read(n,"FeatureCollection")[0].geometry},resolutionToScale(n,e,t){const r=39.37007874015748,i=gB(t);return 1/(n*e*r*i)},toSuperMapBounds(n){return new po(n[0],n[1],n[2],n[3])},toProcessingParam(n){if(n.length<1)return"";const e={},t=[];for(let r=0;r<n.length;r++){const i={x:n[r][0],y:n[r][1]};t.push(i)}return t.push(t[0]),e.type="REGION",e.points=t,e},scaleToResolution(n,e,t){const r=39.37007874015748,i=gB(t);return 1/(n*e*r*i)},getMeterPerMapUnit:gB,isArray:K1r,Csv2GeoJSON(n,e){e=e||{titles:["lon","lat"],latitudeTitle:"lat",longitudeTitle:"lon",fieldSeparator:",",lineSeparator:`
`,deleteDoubleQuotes:!0,firstLineTitles:!1};const r=[];if(typeof n=="string"){let o=e.titles;if(e.firstLineTitles){if(n=n.split(e.lineSeparator),n.length<2)return;o=n[0],n.splice(0,1),n=n.join(e.lineSeparator),o=o.trim().split(e.fieldSeparator);for(let s=0;s<o.length;s++)o[s]=i(o[s]);e.titles=o}for(let s=0;s<o.length;s++){let l=o[s].toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"_");(l===""||l==="_")&&(l=`prop-${s}`),r[s]=l}n=a(n)}return n;function i(o){return e.deleteDoubleQuotes&&(o=o.trim().replace(/^"/,"").replace(/"$/,"")),o}function a(o){const s={};s.type="FeatureCollection",s.features=[];const l=e.titles;o=o.split(e.lineSeparator);for(let u=0;u<o.length;u++){const h=o[u].trim().split(e.fieldSeparator),c=parseFloat(h[l.indexOf(e.longitudeTitle)]),f=parseFloat(h[l.indexOf(e.latitudeTitle)]),d=c<180&&c>-180&&f<90&&f>-90;if(!(h.length===l.length&&d))continue;const v={};v.type="Feature",v.geometry={},v.properties={},v.geometry.type="Point",v.geometry.coordinates=[c,f];for(let p=0;p<l.length;p++)l[p]!==e.latitudeTitle&&l[p]!==e.longitudeTitle&&(v.properties[r[p]]=i(h[p]));s.features.push(v)}return s}},createCanvasContext2D(n,e){const t=document.createElement("CANVAS");return n&&(t.width=n),e&&(t.height=e),t.getContext("2d")},supportWebGL2(){const n=document.createElement("canvas");return Boolean(n&&n.getContext("webgl2"))},isString:_Xe,isObject(n){return Object.prototype.toString.call(n)==="[object Object]"},trim(n=""){return n.replace(/(^\s*)|(\s*$)/g,"")},newGuid(n){let e=n||32,t="";for(let r=1;r<e;r++){let i=Math.floor(Math.random()*16).toString(16);t+=i}return t},isNumber(n){if(n==="")return!1;let e=Number(n);return e===0?!0:!isNaN(e)},isMatchAdministrativeName:STe,getHighestMatchAdministration(n,e){let t=n.filter(a=>STe(a.properties.Name,e)),r=0,i=null;return t.forEach(a=>{let o=0;Array.from(new Set(a.properties.Name.split(""))).forEach(s=>{e.includes(s)&&o++}),o>r&&(r=o,i=a)}),i},setMask(n,e){if(!e||!((e instanceof d0?e.getGeometry():e)instanceof vT)&&["MultiPolygon","Polygon"].indexOf(e.getType())<0)return;const r=e instanceof d0?e:new d0(e),i=new So({fill:new Ko({color:"black"})}),a=new Sy({source:new _f({features:[r],wrapX:!1})}),o=function(l){const u=rXe(l);l.context.globalCompositeOperation="destination-in",a.getSource().forEachFeature(function(h){u.drawFeature(h,i),l.context.globalCompositeOperation="source-over"})},s=Array.isArray(n)?n:[n];xTe(s),s.forEach(l=>{l.classNameBak_=l.className_,l.className_=`ol_mask_layer_${l.ol_uid}`,l.clipRender=o,l.extentBak_=l.getExtent(),l.setExtent(a.getSource().getExtent()),l.on("postrender",o),l.changed()})},unsetMask:xTe,getZoomByResolution(n,e){return Not(n,e)},scalesToResolutions(n,e,t,r,i,a){return Dot(n,e,t,r,i)},getProjection(n,e){let t=ya(`EPSG:${n.epsgCode}`);return n.type=="PCS_NON_EARTH"&&(t=new ew({extent:e,units:"m",code:"0"})),t||console.error(`The projection of EPSG:${n.epsgCode} is missing, please register the projection of EPSG:${n.epsgCode} first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection`),t}};function _Xe(n){return typeof n=="string"&&n.constructor===String}function K1r(n){return Object.prototype.toString.call(n)==="[object Array]"}function xTe(n){const e=Array.isArray(n)?n:[n];for(let t=0;t<e.length;t++){const r=e[t];!r.clipRender||(r.un("postrender",r.clipRender),r.className_=r.classNameBak_,r.setExtent(r.extentBak),delete r.classNameBak_,delete r.clipRender,delete r.extentBak_,r.changed())}}function STe(n,e){if(_Xe(e)){let t=n.substr(0,2);return t==="\u5F20\u5BB6"&&(t=n.substr(0,3)),!!e.match(new RegExp(t))}return!1}var kP=function(n){return n&&n.Math===Math&&n},xl=kP(typeof globalThis=="object"&&globalThis)||kP(typeof window=="object"&&window)||kP(typeof self=="object"&&self)||kP(typeof at=="object"&&at)||kP(typeof at=="object"&&at)||function(){return this}()||Function("return this")(),Ak={},Yl=function(n){try{return!!n()}catch{return!0}},J1r=Yl,V0=!J1r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Q1r=Yl,zV=!Q1r(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")}),e_r=zV,l6=Function.prototype.call,Sc=e_r?l6.bind(l6):function(){return l6.apply(l6,arguments)},xXe={},SXe={}.propertyIsEnumerable,wXe=Object.getOwnPropertyDescriptor,t_r=wXe&&!SXe.call({1:2},1);xXe.f=t_r?function(e){var t=wXe(this,e);return!!t&&t.enumerable}:SXe;var Eue=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},bXe=zV,EXe=Function.prototype,Ote=EXe.call,r_r=bXe&&EXe.bind.bind(Ote,Ote),ql=bXe?r_r:function(n){return function(){return Ote.apply(n,arguments)}},TXe=ql,n_r=TXe({}.toString),i_r=TXe("".slice),gT=function(n){return i_r(n_r(n),8,-1)},a_r=ql,o_r=Yl,s_r=gT,qY=Object,l_r=a_r("".split),CXe=o_r(function(){return!qY("z").propertyIsEnumerable(0)})?function(n){return s_r(n)==="String"?l_r(n,""):qY(n)}:qY,UV=function(n){return n==null},u_r=UV,h_r=TypeError,$0=function(n){if(u_r(n))throw new h_r("Can't call method on "+n);return n},c_r=CXe,f_r=$0,Mk=function(n){return c_r(f_r(n))},ZY=typeof document=="object"&&document.all,yu=typeof ZY>"u"&&ZY!==void 0?function(n){return typeof n=="function"||n===ZY}:function(n){return typeof n=="function"},d_r=yu,Ud=function(n){return typeof n=="object"?n!==null:d_r(n)},KY=xl,v_r=yu,p_r=function(n){return v_r(n)?n:void 0},yT=function(n,e){return arguments.length<2?p_r(KY[n]):KY[n]&&KY[n][e]},g_r=ql,VV=g_r({}.isPrototypeOf),y_r=xl,wTe=y_r.navigator,bTe=wTe&&wTe.userAgent,Ik=bTe?String(bTe):"",AXe=xl,JY=Ik,ETe=AXe.process,TTe=AXe.Deno,CTe=ETe&&ETe.versions||TTe&&TTe.version,ATe=CTe&&CTe.v8,Xg,v7;ATe&&(Xg=ATe.split("."),v7=Xg[0]>0&&Xg[0]<4?1:+(Xg[0]+Xg[1]));!v7&&JY&&(Xg=JY.match(/Edge\/(\d+)/),(!Xg||Xg[1]>=74)&&(Xg=JY.match(/Chrome\/(\d+)/),Xg&&(v7=+Xg[1])));var Tue=v7,MTe=Tue,m_r=Yl,__r=xl,x_r=__r.String,MXe=!!Object.getOwnPropertySymbols&&!m_r(function(){var n=Symbol("symbol detection");return!x_r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&MTe&&MTe<41}),S_r=MXe,IXe=S_r&&!Symbol.sham&&typeof Symbol.iterator=="symbol",w_r=yT,b_r=yu,E_r=VV,T_r=IXe,C_r=Object,LXe=T_r?function(n){return typeof n=="symbol"}:function(n){var e=w_r("Symbol");return b_r(e)&&E_r(e.prototype,C_r(n))},A_r=String,$V=function(n){try{return A_r(n)}catch{return"Object"}},M_r=yu,I_r=$V,L_r=TypeError,j_=function(n){if(M_r(n))return n;throw new L_r(I_r(n)+" is not a function")},P_r=j_,O_r=UV,iL=function(n,e){var t=n[e];return O_r(t)?void 0:P_r(t)},QY=Sc,eq=yu,tq=Ud,R_r=TypeError,D_r=function(n,e){var t,r;if(e==="string"&&eq(t=n.toString)&&!tq(r=QY(t,n))||eq(t=n.valueOf)&&!tq(r=QY(t,n))||e!=="string"&&eq(t=n.toString)&&!tq(r=QY(t,n)))return r;throw new R_r("Can't convert object to primitive value")},WV={exports:{}},ITe=xl,N_r=Object.defineProperty,Cue=function(n,e){try{N_r(ITe,n,{value:e,configurable:!0,writable:!0})}catch{ITe[n]=e}return e},k_r=xl,F_r=Cue,LTe="__core-js_shared__",PTe=WV.exports=k_r[LTe]||F_r(LTe,{});(PTe.versions||(PTe.versions=[])).push({version:"3.43.0",mode:"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",source:"https://github.com/zloirock/core-js"});var OTe=WV.exports,Aue=function(n,e){return OTe[n]||(OTe[n]=e||{})},B_r=$0,G_r=Object,HV=function(n){return G_r(B_r(n))},z_r=ql,U_r=HV,V_r=z_r({}.hasOwnProperty),W0=Object.hasOwn||function(e,t){return V_r(U_r(e),t)},$_r=ql,W_r=0,H_r=Math.random(),j_r=$_r(1.1 .toString),PXe=function(n){return"Symbol("+(n===void 0?"":n)+")_"+j_r(++W_r+H_r,36)},X_r=xl,Y_r=Aue,RTe=W0,q_r=PXe,Z_r=MXe,K_r=IXe,xA=X_r.Symbol,rq=Y_r("wks"),J_r=K_r?xA.for||xA:xA&&xA.withoutSetter||q_r,Jh=function(n){return RTe(rq,n)||(rq[n]=Z_r&&RTe(xA,n)?xA[n]:J_r("Symbol."+n)),rq[n]},Q_r=Sc,DTe=Ud,NTe=LXe,exr=iL,txr=D_r,rxr=Jh,nxr=TypeError,ixr=rxr("toPrimitive"),axr=function(n,e){if(!DTe(n)||NTe(n))return n;var t=exr(n,ixr),r;if(t){if(e===void 0&&(e="default"),r=Q_r(t,n,e),!DTe(r)||NTe(r))return r;throw new nxr("Can't convert object to primitive value")}return e===void 0&&(e="number"),txr(n,e)},oxr=axr,sxr=LXe,OXe=function(n){var e=oxr(n,"string");return sxr(e)?e:e+""},lxr=xl,kTe=Ud,Rte=lxr.document,uxr=kTe(Rte)&&kTe(Rte.createElement),jV=function(n){return uxr?Rte.createElement(n):{}},hxr=V0,cxr=Yl,fxr=jV,RXe=!hxr&&!cxr(function(){return Object.defineProperty(fxr("div"),"a",{get:function(){return 7}}).a!==7}),dxr=V0,vxr=Sc,pxr=xXe,gxr=Eue,yxr=Mk,mxr=OXe,_xr=W0,xxr=RXe,FTe=Object.getOwnPropertyDescriptor;Ak.f=dxr?FTe:function(e,t){if(e=yxr(e),t=mxr(t),xxr)try{return FTe(e,t)}catch{}if(_xr(e,t))return gxr(!vxr(pxr.f,e,t),e[t])};var X_={},Sxr=V0,wxr=Yl,DXe=Sxr&&wxr(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),bxr=Ud,Exr=String,Txr=TypeError,Xf=function(n){if(bxr(n))return n;throw new Txr(Exr(n)+" is not an object")},Cxr=V0,Axr=RXe,Mxr=DXe,u6=Xf,BTe=OXe,Ixr=TypeError,nq=Object.defineProperty,Lxr=Object.getOwnPropertyDescriptor,iq="enumerable",aq="configurable",oq="writable";X_.f=Cxr?Mxr?function(e,t,r){if(u6(e),t=BTe(t),u6(r),typeof e=="function"&&t==="prototype"&&"value"in r&&oq in r&&!r[oq]){var i=Lxr(e,t);i&&i[oq]&&(e[t]=r.value,r={configurable:aq in r?r[aq]:i[aq],enumerable:iq in r?r[iq]:i[iq],writable:!1})}return nq(e,t,r)}:nq:function(e,t,r){if(u6(e),t=BTe(t),u6(r),Axr)try{return nq(e,t,r)}catch{}if("get"in r||"set"in r)throw new Ixr("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Pxr=V0,Oxr=X_,Rxr=Eue,Lk=Pxr?function(n,e,t){return Oxr.f(n,e,Rxr(1,t))}:function(n,e,t){return n[e]=t,n},Mue={exports:{}},Dte=V0,Dxr=W0,NXe=Function.prototype,Nxr=Dte&&Object.getOwnPropertyDescriptor,Iue=Dxr(NXe,"name"),kxr=Iue&&function(){}.name==="something",Fxr=Iue&&(!Dte||Dte&&Nxr(NXe,"name").configurable),XV={EXISTS:Iue,PROPER:kxr,CONFIGURABLE:Fxr},Bxr=ql,Gxr=yu,Nte=WV.exports,zxr=Bxr(Function.toString);Gxr(Nte.inspectSource)||(Nte.inspectSource=function(n){return zxr(n)});var Lue=Nte.inspectSource,Uxr=xl,Vxr=yu,GTe=Uxr.WeakMap,$xr=Vxr(GTe)&&/native code/.test(String(GTe)),Wxr=Aue,Hxr=PXe,zTe=Wxr("keys"),Pue=function(n){return zTe[n]||(zTe[n]=Hxr(n))},Oue={},jxr=$xr,kXe=xl,Xxr=Ud,Yxr=Lk,sq=W0,lq=WV.exports,qxr=Pue,Zxr=Oue,UTe="Object already initialized",kte=kXe.TypeError,Kxr=kXe.WeakMap,p7,pN,g7,Jxr=function(n){return g7(n)?pN(n):p7(n,{})},Qxr=function(n){return function(e){var t;if(!Xxr(e)||(t=pN(e)).type!==n)throw new kte("Incompatible receiver, "+n+" required");return t}};if(jxr||lq.state){var hy=lq.state||(lq.state=new Kxr);hy.get=hy.get,hy.has=hy.has,hy.set=hy.set,p7=function(n,e){if(hy.has(n))throw new kte(UTe);return e.facade=n,hy.set(n,e),e},pN=function(n){return hy.get(n)||{}},g7=function(n){return hy.has(n)}}else{var bC=qxr("state");Zxr[bC]=!0,p7=function(n,e){if(sq(n,bC))throw new kte(UTe);return e.facade=n,Yxr(n,bC,e),e},pN=function(n){return sq(n,bC)?n[bC]:{}},g7=function(n){return sq(n,bC)}}var YV={set:p7,get:pN,has:g7,enforce:Jxr,getterFor:Qxr},Rue=ql,eSr=Yl,tSr=yu,h6=W0,Fte=V0,rSr=XV.CONFIGURABLE,nSr=Lue,FXe=YV,iSr=FXe.enforce,aSr=FXe.get,VTe=String,h8=Object.defineProperty,oSr=Rue("".slice),sSr=Rue("".replace),lSr=Rue([].join),uSr=Fte&&!eSr(function(){return h8(function(){},"length",{value:8}).length!==8}),hSr=String(String).split("String"),cSr=Mue.exports=function(n,e,t){oSr(VTe(e),0,7)==="Symbol("&&(e="["+sSr(VTe(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!h6(n,"name")||rSr&&n.name!==e)&&(Fte?h8(n,"name",{value:e,configurable:!0}):n.name=e),uSr&&t&&h6(t,"arity")&&n.length!==t.arity&&h8(n,"length",{value:t.arity});try{t&&h6(t,"constructor")&&t.constructor?Fte&&h8(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch{}var r=iSr(n);return h6(r,"source")||(r.source=lSr(hSr,typeof e=="string"?e:"")),n};Function.prototype.toString=cSr(function(){return tSr(this)&&aSr(this).source||nSr(this)},"toString");var fSr=yu,dSr=X_,vSr=Mue.exports,pSr=Cue,mT=function(n,e,t,r){r||(r={});var i=r.enumerable,a=r.name!==void 0?r.name:e;if(fSr(t)&&vSr(t,a,r),r.global)i?n[e]=t:pSr(e,t);else{try{r.unsafe?n[e]&&(i=!0):delete n[e]}catch{}i?n[e]=t:dSr.f(n,e,{value:t,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return n},BXe={},gSr=Math.ceil,ySr=Math.floor,mSr=Math.trunc||function(e){var t=+e;return(t>0?ySr:gSr)(t)},_Sr=mSr,qV=function(n){var e=+n;return e!==e||e===0?0:_Sr(e)},xSr=qV,SSr=Math.max,wSr=Math.min,bSr=function(n,e){var t=xSr(n);return t<0?SSr(t+e,0):wSr(t,e)},ESr=qV,TSr=Math.min,aL=function(n){var e=ESr(n);return e>0?TSr(e,9007199254740991):0},CSr=aL,Due=function(n){return CSr(n.length)},ASr=Mk,MSr=bSr,ISr=Due,$Te=function(n){return function(e,t,r){var i=ASr(e),a=ISr(i);if(a===0)return!n&&-1;var o=MSr(r,a),s;if(n&&t!==t){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((n||o in i)&&i[o]===t)return n||o||0;return!n&&-1}},GXe={includes:$Te(!0),indexOf:$Te(!1)},LSr=ql,uq=W0,PSr=Mk,OSr=GXe.indexOf,RSr=Oue,WTe=LSr([].push),zXe=function(n,e){var t=PSr(n),r=0,i=[],a;for(a in t)!uq(RSr,a)&&uq(t,a)&&WTe(i,a);for(;e.length>r;)uq(t,a=e[r++])&&(~OSr(i,a)||WTe(i,a));return i},Nue=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],DSr=zXe,NSr=Nue,kSr=NSr.concat("length","prototype");BXe.f=Object.getOwnPropertyNames||function(e){return DSr(e,kSr)};var UXe={};UXe.f=Object.getOwnPropertySymbols;var FSr=yT,BSr=ql,GSr=BXe,zSr=UXe,USr=Xf,VSr=BSr([].concat),$Sr=FSr("Reflect","ownKeys")||function(e){var t=GSr.f(USr(e)),r=zSr.f;return r?VSr(t,r(e)):t},HTe=W0,WSr=$Sr,HSr=Ak,jSr=X_,XSr=function(n,e,t){for(var r=WSr(e),i=jSr.f,a=HSr.f,o=0;o<r.length;o++){var s=r[o];!HTe(n,s)&&!(t&&HTe(t,s))&&i(n,s,a(e,s))}},YSr=Yl,qSr=yu,ZSr=/#|\.prototype\./,Pk=function(n,e){var t=JSr[KSr(n)];return t===ewr?!0:t===QSr?!1:qSr(e)?YSr(e):!!e},KSr=Pk.normalize=function(n){return String(n).replace(ZSr,".").toLowerCase()},JSr=Pk.data={},QSr=Pk.NATIVE="N",ewr=Pk.POLYFILL="P",VXe=Pk,c6=xl,twr=Ak.f,rwr=Lk,nwr=mT,iwr=Cue,awr=XSr,owr=VXe,Yf=function(n,e){var t=n.target,r=n.global,i=n.stat,a,o,s,l,u,h;if(r?o=c6:i?o=c6[t]||iwr(t,{}):o=c6[t]&&c6[t].prototype,o)for(s in e){if(u=e[s],n.dontCallGetSet?(h=twr(o,s),l=h&&h.value):l=o[s],a=owr(r?s:t+(i?".":"#")+s,n.forced),!a&&l!==void 0){if(typeof u==typeof l)continue;awr(u,l)}(n.sham||l&&l.sham)&&rwr(u,"sham",!0),nwr(o,s,u,n)}},FP=xl,swr=Ik,lwr=gT,f6=function(n){return swr.slice(0,n.length)===n},$Xe=function(){return f6("Bun/")?"BUN":f6("Cloudflare-Workers")?"CLOUDFLARE":f6("Deno/")?"DENO":f6("Node.js/")?"NODE":FP.Bun&&typeof Bun.version=="string"?"BUN":FP.Deno&&typeof Deno.version=="object"?"DENO":lwr(FP.process)==="process"?"NODE":FP.window&&FP.document?"BROWSER":"REST"}(),uwr=$Xe,ZV=uwr==="NODE",hwr=xl,cwr=hwr,fwr=ql,dwr=j_,vwr=function(n,e,t){try{return fwr(dwr(Object.getOwnPropertyDescriptor(n,e)[t]))}catch{}},pwr=Ud,gwr=function(n){return pwr(n)||n===null},ywr=gwr,mwr=String,_wr=TypeError,xwr=function(n){if(ywr(n))return n;throw new _wr("Can't set "+mwr(n)+" as a prototype")},Swr=vwr,wwr=Ud,bwr=$0,Ewr=xwr,WXe=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,e={},t;try{t=Swr(Object.prototype,"__proto__","set"),t(e,[]),n=e instanceof Array}catch{}return function(i,a){return bwr(i),Ewr(a),wwr(i)&&(n?t(i,a):i.__proto__=a),i}}():void 0),Twr=X_.f,Cwr=W0,Awr=Jh,jTe=Awr("toStringTag"),KV=function(n,e,t){n&&!t&&(n=n.prototype),n&&!Cwr(n,jTe)&&Twr(n,jTe,{configurable:!0,value:e})},XTe=Mue.exports,Mwr=X_,Iwr=function(n,e,t){return t.get&&XTe(t.get,e,{getter:!0}),t.set&&XTe(t.set,e,{setter:!0}),Mwr.f(n,e,t)},Lwr=yT,Pwr=Iwr,Owr=Jh,Rwr=V0,YTe=Owr("species"),Dwr=function(n){var e=Lwr(n);Rwr&&e&&!e[YTe]&&Pwr(e,YTe,{configurable:!0,get:function(){return this}})},Nwr=VV,kwr=TypeError,Fwr=function(n,e){if(Nwr(e,n))return n;throw new kwr("Incorrect invocation")},Bwr=Jh,Gwr=Bwr("toStringTag"),HXe={};HXe[Gwr]="z";var zwr=String(HXe)==="[object z]",Uwr=zwr,Vwr=yu,c8=gT,$wr=Jh,Wwr=$wr("toStringTag"),Hwr=Object,jwr=c8(function(){return arguments}())==="Arguments",Xwr=function(n,e){try{return n[e]}catch{}},kue=Uwr?c8:function(n){var e,t,r;return n===void 0?"Undefined":n===null?"Null":typeof(t=Xwr(e=Hwr(n),Wwr))=="string"?t:jwr?c8(e):(r=c8(e))==="Object"&&Vwr(e.callee)?"Arguments":r},Ywr=ql,qwr=Yl,jXe=yu,Zwr=kue,Kwr=yT,Jwr=Lue,XXe=function(){},YXe=Kwr("Reflect","construct"),Fue=/^\s*(?:class|function)\b/,Qwr=Ywr(Fue.exec),ebr=!Fue.test(XXe),BP=function(e){if(!jXe(e))return!1;try{return YXe(XXe,[],e),!0}catch{return!1}},qXe=function(e){if(!jXe(e))return!1;switch(Zwr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ebr||!!Qwr(Fue,Jwr(e))}catch{return!0}};qXe.sham=!0;var tbr=!YXe||qwr(function(){var n;return BP(BP.call)||!BP(Object)||!BP(function(){n=!0})||n})?qXe:BP,rbr=tbr,nbr=$V,ibr=TypeError,abr=function(n){if(rbr(n))return n;throw new ibr(nbr(n)+" is not a constructor")},qTe=Xf,obr=abr,sbr=UV,lbr=Jh,ubr=lbr("species"),ZXe=function(n,e){var t=qTe(n).constructor,r;return t===void 0||sbr(r=qTe(t)[ubr])?e:obr(r)},hbr=zV,KXe=Function.prototype,ZTe=KXe.apply,KTe=KXe.call,JXe=typeof Reflect=="object"&&Reflect.apply||(hbr?KTe.bind(ZTe):function(){return KTe.apply(ZTe,arguments)}),cbr=gT,fbr=ql,JV=function(n){if(cbr(n)==="Function")return fbr(n)},JTe=JV,dbr=j_,vbr=zV,pbr=JTe(JTe.bind),Bue=function(n,e){return dbr(n),e===void 0?n:vbr?pbr(n,e):function(){return n.apply(e,arguments)}},gbr=yT,QXe=gbr("document","documentElement"),ybr=ql,mbr=ybr([].slice),_br=TypeError,xbr=function(n,e){if(n<e)throw new _br("Not enough arguments");return n},Sbr=Ik,eYe=/(?:ipad|iphone|ipod).*applewebkit/i.test(Sbr),pv=xl,wbr=JXe,bbr=Bue,QTe=yu,Ebr=W0,tYe=Yl,eCe=QXe,Tbr=mbr,tCe=jV,Cbr=xbr,Abr=eYe,Mbr=ZV,Bte=pv.setImmediate,Gte=pv.clearImmediate,Ibr=pv.process,hq=pv.Dispatch,Lbr=pv.Function,rCe=pv.MessageChannel,Pbr=pv.String,cq=0,OR={},nCe="onreadystatechange",gN,Sb,fq,dq;tYe(function(){gN=pv.location});var Gue=function(n){if(Ebr(OR,n)){var e=OR[n];delete OR[n],e()}},vq=function(n){return function(){Gue(n)}},iCe=function(n){Gue(n.data)},aCe=function(n){pv.postMessage(Pbr(n),gN.protocol+"//"+gN.host)};(!Bte||!Gte)&&(Bte=function(e){Cbr(arguments.length,1);var t=QTe(e)?e:Lbr(e),r=Tbr(arguments,1);return OR[++cq]=function(){wbr(t,void 0,r)},Sb(cq),cq},Gte=function(e){delete OR[e]},Mbr?Sb=function(n){Ibr.nextTick(vq(n))}:hq&&hq.now?Sb=function(n){hq.now(vq(n))}:rCe&&!Abr?(fq=new rCe,dq=fq.port2,fq.port1.onmessage=iCe,Sb=bbr(dq.postMessage,dq)):pv.addEventListener&&QTe(pv.postMessage)&&!pv.importScripts&&gN&&gN.protocol!=="file:"&&!tYe(aCe)?(Sb=aCe,pv.addEventListener("message",iCe,!1)):nCe in tCe("script")?Sb=function(n){eCe.appendChild(tCe("script"))[nCe]=function(){eCe.removeChild(this),Gue(n)}}:Sb=function(n){setTimeout(vq(n),0)});var rYe={set:Bte,clear:Gte},oCe=xl,Obr=V0,Rbr=Object.getOwnPropertyDescriptor,Dbr=function(n){if(!Obr)return oCe[n];var e=Rbr(oCe,n);return e&&e.value},nYe=function(){this.head=null,this.tail=null};nYe.prototype={add:function(n){var e={item:n,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var n=this.head;if(n){var e=this.head=n.next;return e===null&&(this.tail=null),n.item}}};var iYe=nYe,Nbr=Ik,kbr=/ipad|iphone|ipod/i.test(Nbr)&&typeof Pebble<"u",Fbr=Ik,Bbr=/web0s(?!.*chrome)/i.test(Fbr),WM=xl,Gbr=Dbr,sCe=Bue,pq=rYe.set,zbr=iYe,Ubr=eYe,Vbr=kbr,$br=Bbr,gq=ZV,lCe=WM.MutationObserver||WM.WebKitMutationObserver,uCe=WM.document,hCe=WM.process,d6=WM.Promise,zte=Gbr("queueMicrotask"),EC,yq,mq,v6,cCe;if(!zte){var p6=new zbr,g6=function(){var n,e;for(gq&&(n=hCe.domain)&&n.exit();e=p6.get();)try{e()}catch(t){throw p6.head&&EC(),t}n&&n.enter()};!Ubr&&!gq&&!$br&&lCe&&uCe?(yq=!0,mq=uCe.createTextNode(""),new lCe(g6).observe(mq,{characterData:!0}),EC=function(){mq.data=yq=!yq}):!Vbr&&d6&&d6.resolve?(v6=d6.resolve(void 0),v6.constructor=d6,cCe=sCe(v6.then,v6),EC=function(){cCe(g6)}):gq?EC=function(){hCe.nextTick(g6)}:(pq=sCe(pq,WM),EC=function(){pq(g6)}),zte=function(n){p6.head||EC(),p6.add(n)}}var Wbr=zte,Hbr=function(n,e){try{arguments.length===1?console.error(n):console.error(n,e)}catch{}},zue=function(n){try{return{error:!1,value:n()}}catch(e){return{error:!0,value:e}}},jbr=xl,QV=jbr.Promise,Xbr=xl,RR=QV,Ybr=yu,qbr=VXe,Zbr=Lue,Kbr=Jh,fCe=$Xe,_q=Tue;RR&&RR.prototype;var Jbr=Kbr("species"),Ute=!1,aYe=Ybr(Xbr.PromiseRejectionEvent),Qbr=qbr("Promise",function(){var n=Zbr(RR),e=n!==String(RR);if(!e&&_q===66)return!0;if(!_q||_q<51||!/native code/.test(n)){var t=new RR(function(a){a(1)}),r=function(a){a(function(){},function(){})},i=t.constructor={};if(i[Jbr]=r,Ute=t.then(function(){})instanceof r,!Ute)return!0}return!e&&(fCe==="BROWSER"||fCe==="DENO")&&!aYe}),Ok={CONSTRUCTOR:Qbr,REJECTION_EVENT:aYe,SUBCLASSING:Ute},oL={},dCe=j_,eEr=TypeError,tEr=function(n){var e,t;this.promise=new n(function(r,i){if(e!==void 0||t!==void 0)throw new eEr("Bad Promise constructor");e=r,t=i}),this.resolve=dCe(e),this.reject=dCe(t)};oL.f=function(n){return new tEr(n)};var rEr=Yf,y7=ZV,tw=xl,nEr=cwr,HM=Sc,vCe=mT,pCe=WXe,iEr=KV,aEr=Dwr,oEr=j_,f8=yu,sEr=Ud,lEr=Fwr,uEr=ZXe,oYe=rYe.set,Uue=Wbr,hEr=Hbr,cEr=zue,fEr=iYe,sYe=YV,m7=QV,Vue=Ok,lYe=oL,e$="Promise",uYe=Vue.CONSTRUCTOR,dEr=Vue.REJECTION_EVENT,vEr=Vue.SUBCLASSING,xq=sYe.getterFor(e$),pEr=sYe.set,tA=m7&&m7.prototype,Zb=m7,y6=tA,hYe=tw.TypeError,Vte=tw.document,$ue=tw.process,$te=lYe.f,gEr=$te,yEr=!!(Vte&&Vte.createEvent&&tw.dispatchEvent),cYe="unhandledrejection",mEr="rejectionhandled",gCe=0,fYe=1,_Er=2,Wue=1,dYe=2,m6,yCe,vYe,mCe,pYe=function(n){var e;return sEr(n)&&f8(e=n.then)?e:!1},gYe=function(n,e){var t=e.value,r=e.state===fYe,i=r?n.ok:n.fail,a=n.resolve,o=n.reject,s=n.domain,l,u,h;try{i?(r||(e.rejection===dYe&&SEr(e),e.rejection=Wue),i===!0?l=t:(s&&s.enter(),l=i(t),s&&(s.exit(),h=!0)),l===n.promise?o(new hYe("Promise-chain cycle")):(u=pYe(l))?HM(u,l,a,o):a(l)):o(t)}catch(c){s&&!h&&s.exit(),o(c)}},yYe=function(n,e){n.notified||(n.notified=!0,Uue(function(){for(var t=n.reactions,r;r=t.get();)gYe(r,n);n.notified=!1,e&&!n.rejection&&xEr(n)}))},mYe=function(n,e,t){var r,i;yEr?(r=Vte.createEvent("Event"),r.promise=e,r.reason=t,r.initEvent(n,!1,!0),tw.dispatchEvent(r)):r={promise:e,reason:t},!dEr&&(i=tw["on"+n])?i(r):n===cYe&&hEr("Unhandled promise rejection",t)},xEr=function(n){HM(oYe,tw,function(){var e=n.facade,t=n.value,r=_Ce(n),i;if(r&&(i=cEr(function(){y7?$ue.emit("unhandledRejection",t,e):mYe(cYe,e,t)}),n.rejection=y7||_Ce(n)?dYe:Wue,i.error))throw i.value})},_Ce=function(n){return n.rejection!==Wue&&!n.parent},SEr=function(n){HM(oYe,tw,function(){var e=n.facade;y7?$ue.emit("rejectionHandled",e):mYe(mEr,e,n.value)})},SA=function(n,e,t){return function(r){n(e,r,t)}},JA=function(n,e,t){n.done||(n.done=!0,t&&(n=t),n.value=e,n.state=_Er,yYe(n,!0))},Wte=function(n,e,t){if(!n.done){n.done=!0,t&&(n=t);try{if(n.facade===e)throw new hYe("Promise can't be resolved itself");var r=pYe(e);r?Uue(function(){var i={done:!1};try{HM(r,e,SA(Wte,i,n),SA(JA,i,n))}catch(a){JA(i,a,n)}}):(n.value=e,n.state=fYe,yYe(n,!1))}catch(i){JA({done:!1},i,n)}}};if(uYe&&(Zb=function(e){lEr(this,y6),oEr(e),HM(m6,this);var t=xq(this);try{e(SA(Wte,t),SA(JA,t))}catch(r){JA(t,r)}},y6=Zb.prototype,m6=function(e){pEr(this,{type:e$,done:!1,notified:!1,parent:!1,reactions:new fEr,rejection:!1,state:gCe,value:null})},m6.prototype=vCe(y6,"then",function(e,t){var r=xq(this),i=$te(uEr(this,Zb));return r.parent=!0,i.ok=f8(e)?e:!0,i.fail=f8(t)&&t,i.domain=y7?$ue.domain:void 0,r.state===gCe?r.reactions.add(i):Uue(function(){gYe(i,r)}),i.promise}),yCe=function(){var n=new m6,e=xq(n);this.promise=n,this.resolve=SA(Wte,e),this.reject=SA(JA,e)},lYe.f=$te=function(n){return n===Zb||n===vYe?new yCe(n):gEr(n)},f8(m7)&&tA!==Object.prototype)){mCe=tA.then,vEr||vCe(tA,"then",function(e,t){var r=this;return new Zb(function(i,a){HM(mCe,r,i,a)}).then(e,t)},{unsafe:!0});try{delete tA.constructor}catch{}pCe&&pCe(tA,y6)}rEr({global:!0,constructor:!0,wrap:!0,forced:uYe},{Promise:Zb});vYe=nEr.Promise;iEr(Zb,e$,!1);aEr(e$);var Rk={},wEr=Jh,bEr=Rk,EEr=wEr("iterator"),TEr=Array.prototype,CEr=function(n){return n!==void 0&&(bEr.Array===n||TEr[EEr]===n)},AEr=kue,xCe=iL,MEr=UV,IEr=Rk,LEr=Jh,PEr=LEr("iterator"),_Ye=function(n){if(!MEr(n))return xCe(n,PEr)||xCe(n,"@@iterator")||IEr[AEr(n)]},OEr=Sc,REr=j_,DEr=Xf,NEr=$V,kEr=_Ye,FEr=TypeError,BEr=function(n,e){var t=arguments.length<2?kEr(n):e;if(REr(t))return DEr(OEr(t,n));throw new FEr(NEr(n)+" is not iterable")},GEr=Sc,SCe=Xf,zEr=iL,UEr=function(n,e,t){var r,i;SCe(n);try{if(r=zEr(n,"return"),!r){if(e==="throw")throw t;return t}r=GEr(r,n)}catch(a){i=!0,r=a}if(e==="throw")throw t;if(i)throw r;return SCe(r),t},VEr=Bue,$Er=Sc,WEr=Xf,HEr=$V,jEr=CEr,XEr=Due,wCe=VV,YEr=BEr,qEr=_Ye,bCe=UEr,ZEr=TypeError,d8=function(n,e){this.stopped=n,this.result=e},ECe=d8.prototype,xYe=function(n,e,t){var r=t&&t.that,i=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),o=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),l=VEr(e,r),u,h,c,f,d,v,p,g=function(y){return u&&bCe(u,"normal"),new d8(!0,y)},m=function(y){return i?(WEr(y),s?l(y[0],y[1],g):l(y[0],y[1])):s?l(y,g):l(y)};if(a)u=n.iterator;else if(o)u=n;else{if(h=qEr(n),!h)throw new ZEr(HEr(n)+" is not iterable");if(jEr(h)){for(c=0,f=XEr(n);f>c;c++)if(d=m(n[c]),d&&wCe(ECe,d))return d;return new d8(!1)}u=YEr(n,h)}for(v=a?n.next:u.next;!(p=$Er(v,u)).done;){try{d=m(p.value)}catch(y){bCe(u,"throw",y)}if(typeof d=="object"&&d&&wCe(ECe,d))return d}return new d8(!1)},KEr=Jh,SYe=KEr("iterator"),wYe=!1;try{var JEr=0,TCe={next:function(){return{done:!!JEr++}},return:function(){wYe=!0}};TCe[SYe]=function(){return this},Array.from(TCe,function(){throw 2})}catch{}var QEr=function(n,e){try{if(!e&&!wYe)return!1}catch{return!1}var t=!1;try{var r={};r[SYe]=function(){return{next:function(){return{done:t=!0}}}},n(r)}catch{}return t},e2r=QV,t2r=QEr,r2r=Ok.CONSTRUCTOR,bYe=r2r||!t2r(function(n){e2r.all(n).then(void 0,function(){})}),n2r=Yf,i2r=Sc,a2r=j_,o2r=oL,s2r=zue,l2r=xYe,u2r=bYe;n2r({target:"Promise",stat:!0,forced:u2r},{all:function(e){var t=this,r=o2r.f(t),i=r.resolve,a=r.reject,o=s2r(function(){var s=a2r(t.resolve),l=[],u=0,h=1;l2r(e,function(c){var f=u++,d=!1;h++,i2r(s,t,c).then(function(v){d||(d=!0,l[f]=v,--h||i(l))},a)}),--h||i(l)});return o.error&&a(o.value),r.promise}});var h2r=Yf,c2r=Ok.CONSTRUCTOR,Hte=QV,f2r=yT,d2r=yu,v2r=mT,CCe=Hte&&Hte.prototype;h2r({target:"Promise",proto:!0,forced:c2r,real:!0},{catch:function(n){return this.then(void 0,n)}});if(d2r(Hte)){var ACe=f2r("Promise").prototype.catch;CCe.catch!==ACe&&v2r(CCe,"catch",ACe,{unsafe:!0})}var p2r=Yf,g2r=Sc,y2r=j_,m2r=oL,_2r=zue,x2r=xYe,S2r=bYe;p2r({target:"Promise",stat:!0,forced:S2r},{race:function(e){var t=this,r=m2r.f(t),i=r.reject,a=_2r(function(){var o=y2r(t.resolve);x2r(e,function(s){g2r(o,t,s).then(r.resolve,i)})});return a.error&&i(a.value),r.promise}});var w2r=Yf,b2r=oL,E2r=Ok.CONSTRUCTOR;w2r({target:"Promise",stat:!0,forced:E2r},{reject:function(e){var t=b2r.f(this),r=t.reject;return r(e),t.promise}});var T2r=Xf,C2r=Ud,A2r=oL,M2r=function(n,e){if(T2r(n),C2r(e)&&e.constructor===n)return e;var t=A2r.f(n),r=t.resolve;return r(e),t.promise},I2r=Yf,L2r=yT,P2r=Ok.CONSTRUCTOR,O2r=M2r;L2r("Promise");I2r({target:"Promise",stat:!0,forced:P2r},{resolve:function(e){return O2r(this,e)}});var R2r=kue,D2r=String,Bm=function(n){if(R2r(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return D2r(n)},N2r=Xf,EYe=function(){var n=N2r(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e},Hue=Yl,k2r=xl,jue=k2r.RegExp,Xue=Hue(function(){var n=jue("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),F2r=Xue||Hue(function(){return!jue("a","y").sticky}),B2r=Xue||Hue(function(){var n=jue("^r","gy");return n.lastIndex=2,n.exec("str")!==null}),TYe={BROKEN_CARET:B2r,MISSED_STICKY:F2r,UNSUPPORTED_Y:Xue},CYe={},G2r=zXe,z2r=Nue,U2r=Object.keys||function(e){return G2r(e,z2r)},V2r=V0,$2r=DXe,W2r=X_,H2r=Xf,j2r=Mk,X2r=U2r;CYe.f=V2r&&!$2r?Object.defineProperties:function(e,t){H2r(e);for(var r=j2r(t),i=X2r(t),a=i.length,o=0,s;a>o;)W2r.f(e,s=i[o++],r[s]);return e};var Y2r=Xf,q2r=CYe,MCe=Nue,Z2r=Oue,K2r=QXe,J2r=jV,Q2r=Pue,ICe=">",LCe="<",jte="prototype",Xte="script",AYe=Q2r("IE_PROTO"),Sq=function(){},MYe=function(n){return LCe+Xte+ICe+n+LCe+"/"+Xte+ICe},PCe=function(n){n.write(MYe("")),n.close();var e=n.parentWindow.Object;return n=null,e},eTr=function(){var n=J2r("iframe"),e="java"+Xte+":",t;return n.style.display="none",K2r.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(MYe("document.F=Object")),t.close(),t.F},_6,v8=function(){try{_6=new ActiveXObject("htmlfile")}catch{}v8=typeof document<"u"?document.domain&&_6?PCe(_6):eTr():PCe(_6);for(var n=MCe.length;n--;)delete v8[jte][MCe[n]];return v8()};Z2r[AYe]=!0;var Yue=Object.create||function(e,t){var r;return e!==null?(Sq[jte]=Y2r(e),r=new Sq,Sq[jte]=null,r[AYe]=e):r=v8(),t===void 0?r:q2r.f(r,t)},tTr=Yl,rTr=xl,nTr=rTr.RegExp,iTr=tTr(function(){var n=nTr(".","s");return!(n.dotAll&&n.test(`
`)&&n.flags==="s")}),aTr=Yl,oTr=xl,sTr=oTr.RegExp,lTr=aTr(function(){var n=sTr("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"}),wA=Sc,t$=ql,uTr=Bm,hTr=EYe,cTr=TYe,fTr=Aue,dTr=Yue,vTr=YV.get,pTr=iTr,gTr=lTr,yTr=fTr("native-string-replace",String.prototype.replace),_7=RegExp.prototype.exec,Yte=_7,mTr=t$("".charAt),_Tr=t$("".indexOf),xTr=t$("".replace),wq=t$("".slice),qte=function(){var n=/a/,e=/b*/g;return wA(_7,n,"a"),wA(_7,e,"a"),n.lastIndex!==0||e.lastIndex!==0}(),IYe=cTr.BROKEN_CARET,Zte=/()??/.exec("")[1]!==void 0,STr=qte||Zte||IYe||pTr||gTr;STr&&(Yte=function(e){var t=this,r=vTr(t),i=uTr(e),a=r.raw,o,s,l,u,h,c,f;if(a)return a.lastIndex=t.lastIndex,o=wA(Yte,a,i),t.lastIndex=a.lastIndex,o;var d=r.groups,v=IYe&&t.sticky,p=wA(hTr,t),g=t.source,m=0,y=i;if(v&&(p=xTr(p,"y",""),_Tr(p,"g")===-1&&(p+="g"),y=wq(i,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&mTr(i,t.lastIndex-1)!==`
`)&&(g="(?: "+g+")",y=" "+y,m++),s=new RegExp("^(?:"+g+")",p)),Zte&&(s=new RegExp("^"+g+"$(?!\\s)",p)),qte&&(l=t.lastIndex),u=wA(_7,v?s:t,y),v?u?(u.input=wq(u.input,m),u[0]=wq(u[0],m),u.index=t.lastIndex,t.lastIndex+=u[0].length):t.lastIndex=0:qte&&u&&(t.lastIndex=t.global?u.index+u[0].length:l),Zte&&u&&u.length>1&&wA(yTr,u[0],s,function(){for(h=1;h<arguments.length-2;h++)arguments[h]===void 0&&(u[h]=void 0)}),u&&d)for(u.groups=c=dTr(null),h=0;h<d.length;h++)f=d[h],c[f[0]]=u[f[1]];return u});var que=Yte,wTr=Yf,OCe=que;wTr({target:"RegExp",proto:!0,forced:/./.exec!==OCe},{exec:OCe});var RCe=Sc,DCe=mT,bTr=que,NCe=Yl,LYe=Jh,ETr=Lk,TTr=LYe("species"),bq=RegExp.prototype,Zue=function(n,e,t,r){var i=LYe(n),a=!NCe(function(){var u={};return u[i]=function(){return 7},""[n](u)!==7}),o=a&&!NCe(function(){var u=!1,h=/a/;return n==="split"&&(h={},h.constructor={},h.constructor[TTr]=function(){return h},h.flags="",h[i]=/./[i]),h.exec=function(){return u=!0,null},h[i](""),!u});if(!a||!o||t){var s=/./[i],l=e(i,""[n],function(u,h,c,f,d){var v=h.exec;return v===bTr||v===bq.exec?a&&!d?{done:!0,value:RCe(s,h,c,f)}:{done:!0,value:RCe(u,c,h,f)}:{done:!1}});DCe(String.prototype,n,l[0]),DCe(bq,i,l[1])}r&&ETr(bq[i],"sham",!0)},Kue=ql,CTr=qV,ATr=Bm,MTr=$0,ITr=Kue("".charAt),kCe=Kue("".charCodeAt),LTr=Kue("".slice),FCe=function(n){return function(e,t){var r=ATr(MTr(e)),i=CTr(t),a=r.length,o,s;return i<0||i>=a?n?"":void 0:(o=kCe(r,i),o<55296||o>56319||i+1===a||(s=kCe(r,i+1))<56320||s>57343?n?ITr(r,i):o:n?LTr(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},PTr={codeAt:FCe(!1),charAt:FCe(!0)},OTr=PTr.charAt,Jue=function(n,e,t){return e+(t?OTr(n,e).length:1)},RTr=xl,DTr=Yl,BCe=RTr.RegExp,NTr=!DTr(function(){var n=!0;try{BCe(".","d")}catch{n=!1}var e={},t="",r=n?"dgimsy":"gimsy",i=function(l,u){Object.defineProperty(e,l,{get:function(){return t+=u,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};n&&(a.hasIndices="d");for(var o in a)i(o,a[o]);var s=Object.getOwnPropertyDescriptor(BCe.prototype,"flags").get.call(e);return s!==r||t!==r}),kTr={correct:NTr},FTr=Sc,BTr=W0,GTr=VV,GCe=kTr,zTr=EYe,UTr=RegExp.prototype,Que=GCe.correct?function(n){return n.flags}:function(n){return!GCe.correct&&GTr(UTr,n)&&!BTr(n,"flags")?FTr(zTr,n):n.flags},zCe=Sc,VTr=Xf,$Tr=yu,WTr=gT,HTr=que,jTr=TypeError,ehe=function(n,e){var t=n.exec;if($Tr(t)){var r=zCe(t,n,e);return r!==null&&VTr(r),r}if(WTr(n)==="RegExp")return zCe(HTr,n,e);throw new jTr("RegExp#exec called on incompatible receiver")},XTr=Sc,YTr=ql,qTr=Zue,ZTr=Xf,KTr=Ud,JTr=aL,x6=Bm,QTr=$0,eCr=iL,tCr=Jue,rCr=Que,UCe=ehe,VCe=YTr("".indexOf);qTr("match",function(n,e,t){return[function(i){var a=QTr(this),o=KTr(i)?eCr(i,n):void 0;return o?XTr(o,i,a):new RegExp(i)[n](x6(a))},function(r){var i=ZTr(this),a=x6(r),o=t(e,i,a);if(o.done)return o.value;var s=x6(rCr(i));if(VCe(s,"g")===-1)return UCe(i,a);var l=VCe(s,"u")!==-1;i.lastIndex=0;for(var u=[],h=0,c;(c=UCe(i,a))!==null;){var f=x6(c[0]);u[h]=f,f===""&&(i.lastIndex=tCr(a,JTr(i.lastIndex),l)),h++}return h===0?null:u}]});var the=ql,nCr=HV,iCr=Math.floor,Eq=the("".charAt),aCr=the("".replace),Tq=the("".slice),oCr=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,sCr=/\$([$&'`]|\d{1,2})/g,lCr=function(n,e,t,r,i,a){var o=t+n.length,s=r.length,l=sCr;return i!==void 0&&(i=nCr(i),l=oCr),aCr(a,l,function(u,h){var c;switch(Eq(h,0)){case"$":return"$";case"&":return n;case"`":return Tq(e,0,t);case"'":return Tq(e,o);case"<":c=i[Tq(h,1,-1)];break;default:var f=+h;if(f===0)return u;if(f>s){var d=iCr(f/10);return d===0?u:d<=s?r[d-1]===void 0?Eq(h,1):r[d-1]+Eq(h,1):u}c=r[f-1]}return c===void 0?"":c})},uCr=JXe,$Ce=Sc,r$=ql,hCr=Zue,cCr=Yl,fCr=Xf,dCr=yu,vCr=Ud,pCr=qV,gCr=aL,wb=Bm,yCr=$0,mCr=Jue,_Cr=iL,xCr=lCr,SCr=Que,wCr=ehe,bCr=Jh,Kte=bCr("replace"),ECr=Math.max,TCr=Math.min,CCr=r$([].concat),Cq=r$([].push),S6=r$("".indexOf),WCe=r$("".slice),ACr=function(n){return n===void 0?n:String(n)},MCr=function(){return"a".replace(/./,"$0")==="$0"}(),HCe=function(){return/./[Kte]?/./[Kte]("a","$0")==="":!1}(),ICr=!cCr(function(){var n=/./;return n.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(n,"$<a>")!=="7"});hCr("replace",function(n,e,t){var r=HCe?"$":"$0";return[function(a,o){var s=yCr(this),l=vCr(a)?_Cr(a,Kte):void 0;return l?$Ce(l,a,s,o):$Ce(e,wb(s),a,o)},function(i,a){var o=fCr(this),s=wb(i);if(typeof a=="string"&&S6(a,r)===-1&&S6(a,"$<")===-1){var l=t(e,o,s,a);if(l.done)return l.value}var u=dCr(a);u||(a=wb(a));var h=wb(SCr(o)),c=S6(h,"g")!==-1,f;c&&(f=S6(h,"u")!==-1,o.lastIndex=0);for(var d=[],v;v=wCr(o,s),!(v===null||(Cq(d,v),!c));){var p=wb(v[0]);p===""&&(o.lastIndex=mCr(s,gCr(o.lastIndex),f))}for(var g="",m=0,y=0;y<d.length;y++){v=d[y];for(var _=wb(v[0]),x=ECr(TCr(pCr(v.index),s.length),0),S=[],w,b=1;b<v.length;b++)Cq(S,ACr(v[b]));var E=v.groups;if(u){var T=CCr([_],S,x,s);E!==void 0&&Cq(T,E),w=wb(uCr(a,void 0,T))}else w=xCr(_,s,x,S,E,a);x>=m&&(g+=WCe(s,m,x)+w,m=x+_.length)}return g+WCe(s,m)}]},!ICr||!MCr||HCe);var LCr=Ud,PCr=gT,OCr=Jh,RCr=OCr("match"),DCr=function(n){var e;return LCr(n)&&((e=n[RCr])!==void 0?!!e:PCr(n)==="RegExp")},NCr=DCr,kCr=TypeError,rhe=function(n){if(NCr(n))throw new kCr("The method doesn't accept regular expressions");return n},FCr=Jh,BCr=FCr("match"),nhe=function(n){var e=/./;try{"/./"[n](e)}catch{try{return e[BCr]=!1,"/./"[n](e)}catch{}}return!1},GCr=Yf,zCr=JV,UCr=Ak.f,VCr=aL,jCe=Bm,$Cr=rhe,WCr=$0,HCr=nhe,jCr=zCr("".slice),XCr=Math.min,PYe=HCr("startsWith"),YCr=!PYe&&!!function(){var n=UCr(String.prototype,"startsWith");return n&&!n.writable}();GCr({target:"String",proto:!0,forced:!YCr&&!PYe},{startsWith:function(e){var t=jCe(WCr(this));$Cr(e);var r=VCr(XCr(arguments.length>1?arguments[1]:void 0,t.length)),i=jCe(e);return jCr(t,r,r+i.length)===i}});var qCr=Jh,ZCr=Yue,KCr=X_.f,Jte=qCr("unscopables"),Qte=Array.prototype;Qte[Jte]===void 0&&KCr(Qte,Jte,{configurable:!0,value:ZCr(null)});var JCr=function(n){Qte[Jte][n]=!0},QCr=Yl,eAr=!QCr(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype}),tAr=W0,rAr=yu,nAr=HV,iAr=Pue,aAr=eAr,XCe=iAr("IE_PROTO"),ere=Object,oAr=ere.prototype,OYe=aAr?ere.getPrototypeOf:function(n){var e=nAr(n);if(tAr(e,XCe))return e[XCe];var t=e.constructor;return rAr(t)&&e instanceof t?t.prototype:e instanceof ere?oAr:null},sAr=Yl,lAr=yu,uAr=Ud,YCe=OYe,hAr=mT,cAr=Jh,tre=cAr("iterator"),RYe=!1,g2,Aq,Mq;[].keys&&(Mq=[].keys(),"next"in Mq?(Aq=YCe(YCe(Mq)),Aq!==Object.prototype&&(g2=Aq)):RYe=!0);var fAr=!uAr(g2)||sAr(function(){var n={};return g2[tre].call(n)!==n});fAr&&(g2={});lAr(g2[tre])||hAr(g2,tre,function(){return this});var DYe={IteratorPrototype:g2,BUGGY_SAFARI_ITERATORS:RYe},dAr=DYe.IteratorPrototype,vAr=Yue,pAr=Eue,gAr=KV,yAr=Rk,mAr=function(){return this},_Ar=function(n,e,t,r){var i=e+" Iterator";return n.prototype=vAr(dAr,{next:pAr(+!r,t)}),gAr(n,i,!1),yAr[i]=mAr,n},xAr=Yf,SAr=Sc,NYe=XV,wAr=yu,bAr=_Ar,qCe=OYe,ZCe=WXe,EAr=KV,TAr=Lk,Iq=mT,CAr=Jh,AAr=Rk,kYe=DYe,MAr=NYe.PROPER,IAr=NYe.CONFIGURABLE,KCe=kYe.IteratorPrototype,w6=kYe.BUGGY_SAFARI_ITERATORS,GP=CAr("iterator"),JCe="keys",zP="values",QCe="entries",LAr=function(){return this},PAr=function(n,e,t,r,i,a,o){bAr(t,e,r);var s=function(m){if(m===i&&f)return f;if(!w6&&m&&m in h)return h[m];switch(m){case JCe:return function(){return new t(this,m)};case zP:return function(){return new t(this,m)};case QCe:return function(){return new t(this,m)}}return function(){return new t(this)}},l=e+" Iterator",u=!1,h=n.prototype,c=h[GP]||h["@@iterator"]||i&&h[i],f=!w6&&c||s(i),d=e==="Array"&&h.entries||c,v,p,g;if(d&&(v=qCe(d.call(new n)),v!==Object.prototype&&v.next&&(qCe(v)!==KCe&&(ZCe?ZCe(v,KCe):wAr(v[GP])||Iq(v,GP,LAr)),EAr(v,l,!0))),MAr&&i===zP&&c&&c.name!==zP&&(IAr?TAr(h,"name",zP):(u=!0,f=function(){return SAr(c,this)})),i)if(p={values:s(zP),keys:a?f:s(JCe),entries:s(QCe)},o)for(g in p)(w6||u||!(g in h))&&Iq(h,g,p[g]);else xAr({target:e,proto:!0,forced:w6||u},p);return h[GP]!==f&&Iq(h,GP,f,{name:i}),AAr[e]=f,p},OAr=function(n,e){return{value:n,done:e}},RAr=Mk,ihe=JCr,eAe=Rk,FYe=YV,DAr=X_.f,NAr=PAr,b6=OAr,kAr=V0,BYe="Array Iterator",FAr=FYe.set,BAr=FYe.getterFor(BYe),GAr=NAr(Array,"Array",function(n,e){FAr(this,{type:BYe,target:RAr(n),index:0,kind:e})},function(){var n=BAr(this),e=n.target,t=n.index++;if(!e||t>=e.length)return n.target=null,b6(void 0,!0);switch(n.kind){case"keys":return b6(t,!1);case"values":return b6(e[t],!1)}return b6([t,e[t]],!1)},"values"),tAe=eAe.Arguments=eAe.Array;ihe("keys");ihe("values");ihe("entries");if(kAr&&tAe.name!=="values")try{DAr(tAe,"name",{value:"values"})}catch{}var zAr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},UAr=jV,Lq=UAr("span").classList,rAe=Lq&&Lq.constructor&&Lq.constructor.prototype,VAr=rAe===Object.prototype?void 0:rAe,nAe=xl,GYe=zAr,$Ar=VAr,IO=GAr,iAe=Lk,WAr=KV,HAr=Jh,Pq=HAr("iterator"),Oq=IO.values,zYe=function(n,e){if(n){if(n[Pq]!==Oq)try{iAe(n,Pq,Oq)}catch{n[Pq]=Oq}if(WAr(n,e,!0),GYe[e]){for(var t in IO)if(n[t]!==IO[t])try{iAe(n,t,IO[t])}catch{n[t]=IO[t]}}}};for(var Rq in GYe)zYe(nAe[Rq]&&nAe[Rq].prototype,Rq);zYe($Ar,"DOMTokenList");var jAr=j_,XAr=HV,YAr=CXe,qAr=Due,aAe=TypeError,oAe="Reduce of empty array with no initial value",sAe=function(n){return function(e,t,r,i){var a=XAr(e),o=YAr(a),s=qAr(a);if(jAr(t),s===0&&r<2)throw new aAe(oAe);var l=n?s-1:0,u=n?-1:1;if(r<2)for(;;){if(l in o){i=o[l],l+=u;break}if(l+=u,n?l<0:s<=l)throw new aAe(oAe)}for(;n?l>=0:s>l;l+=u)l in o&&(i=t(i,o[l],l,a));return i}},ZAr={left:sAe(!1),right:sAe(!0)},KAr=Yl,UYe=function(n,e){var t=[][n];return!!t&&KAr(function(){t.call(null,e||function(){return 1},1)})},JAr=Yf,QAr=ZAr.left,eMr=UYe,lAe=Tue,tMr=ZV,rMr=!tMr&&lAe>79&&lAe<83,nMr=rMr||!eMr("reduce");JAr({target:"Array",proto:!0,forced:nMr},{reduce:function(e){var t=arguments.length;return QAr(this,e,t,t>1?arguments[1]:void 0)}});var iMr=Yf,aMr=JV,oMr=Ak.f,sMr=aL,uAe=Bm,lMr=rhe,uMr=$0,hMr=nhe,cMr=aMr("".slice),fMr=Math.min,VYe=hMr("endsWith"),dMr=!VYe&&!!function(){var n=oMr(String.prototype,"endsWith");return n&&!n.writable}();iMr({target:"String",proto:!0,forced:!dMr&&!VYe},{endsWith:function(e){var t=uAe(uMr(this));lMr(e);var r=arguments.length>1?arguments[1]:void 0,i=t.length,a=r===void 0?i:fMr(sMr(r),i),o=uAe(e);return cMr(t,a-o.length,a)===o}});var Dq=Sc,$Ye=ql,vMr=Zue,pMr=Xf,gMr=Ud,yMr=$0,mMr=ZXe,_Mr=Jue,xMr=aL,hAe=Bm,SMr=iL,cAe=ehe,wMr=TYe,bMr=Yl,TC=wMr.UNSUPPORTED_Y,EMr=4294967295,TMr=Math.min,Nq=$Ye([].push),kq=$Ye("".slice),CMr=!bMr(function(){var n=/(?:)/,e=n.exec;n.exec=function(){return e.apply(this,arguments)};var t="ab".split(n);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),fAe="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;vMr("split",function(n,e,t){var r="0".split(void 0,0).length?function(i,a){return i===void 0&&a===0?[]:Dq(e,this,i,a)}:e;return[function(a,o){var s=yMr(this),l=gMr(a)?SMr(a,n):void 0;return l?Dq(l,a,s,o):Dq(r,hAe(s),a,o)},function(i,a){var o=pMr(this),s=hAe(i);if(!fAe){var l=t(r,o,s,a,r!==e);if(l.done)return l.value}var u=mMr(o,RegExp),h=o.unicode,c=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(TC?"g":"y"),f=new u(TC?"^(?:"+o.source+")":o,c),d=a===void 0?EMr:a>>>0;if(d===0)return[];if(s.length===0)return cAe(f,s)===null?[s]:[];for(var v=0,p=0,g=[];p<s.length;){f.lastIndex=TC?0:p;var m=cAe(f,TC?kq(s,p):s),y;if(m===null||(y=TMr(xMr(f.lastIndex+(TC?p:0)),s.length))===v)p=_Mr(s,p,h);else{if(Nq(g,kq(s,v,p)),g.length===d)return g;for(var _=1;_<=m.length-1;_++)if(Nq(g,m[_]),g.length===d)return g;p=v=y}}return Nq(g,kq(s,v)),g}]},fAe||!CMr,TC);var QA={exports:{}},LO={exports:{}};(function(){var n,e,t,r,i,a;typeof performance<"u"&&performance!==null&&performance.now?LO.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(LO.exports=function(){return(n()-i)/1e6},e=process.hrtime,n=function(){var o;return o=e(),o[0]*1e9+o[1]},r=n(),a=process.uptime()*1e9,i=r-a):Date.now?(LO.exports=function(){return Date.now()-t},t=Date.now()):(LO.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(at);var AMr=LO.exports,Q1=typeof window>"u"?at:window,E6=["moz","webkit"],eM="AnimationFrame",jM=Q1["request"+eM],yN=Q1["cancel"+eM]||Q1["cancelRequest"+eM];for(var UP=0;!jM&&UP<E6.length;UP++)jM=Q1[E6[UP]+"Request"+eM],yN=Q1[E6[UP]+"Cancel"+eM]||Q1[E6[UP]+"CancelRequest"+eM];if(!jM||!yN){var Fq=0,dAe=0,bb=[],MMr=1e3/60;jM=function(n){if(bb.length===0){var e=AMr(),t=Math.max(0,MMr-(e-Fq));Fq=t+e,setTimeout(function(){var r=bb.slice(0);bb.length=0;for(var i=0;i<r.length;i++)if(!r[i].cancelled)try{r[i].callback(Fq)}catch(a){setTimeout(function(){throw a},0)}},Math.round(t))}return bb.push({handle:++dAe,callback:n,cancelled:!1}),dAe},yN=function(n){for(var e=0;e<bb.length;e++)bb[e].handle===n&&(bb[e].cancelled=!0)}}QA.exports=function(n){return jM.call(Q1,n)};QA.exports.cancel=function(){yN.apply(Q1,arguments)};QA.exports.polyfill=function(n){n||(n=Q1),n.requestAnimationFrame=jM,n.cancelAnimationFrame=yN};var WYe=`
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,IMr=ql,LMr=$0,PMr=Bm,rre=WYe,vAe=IMr("".replace),OMr=RegExp("^["+rre+"]+"),RMr=RegExp("(^|[^"+rre+"])["+rre+"]+$"),Bq=function(n){return function(e){var t=PMr(LMr(e));return n&1&&(t=vAe(t,OMr,"")),n&2&&(t=vAe(t,RMr,"$1")),t}},DMr={start:Bq(1),end:Bq(2),trim:Bq(3)},NMr=XV.PROPER,kMr=Yl,pAe=WYe,gAe="\u200B\x85\u180E",FMr=function(n){return kMr(function(){return!!pAe[n]()||gAe[n]()!==gAe||NMr&&pAe[n].name!==n})},BMr=Yf,GMr=DMr.trim,zMr=FMr;BMr({target:"String",proto:!0,forced:zMr("trim")},{trim:function(){return GMr(this)}});var nre=function(n){this.ok=!1,this.alpha=1,n.charAt(0)=="#"&&(n=n.substr(1,6)),n=n.replace(/ /g,""),n=n.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};n=e[n]||n;for(var t=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3]),parseFloat(l[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],r=0;r<t.length;r++){var i=t[r].re,a=t[r].process,o=i.exec(n);if(o){var s=a(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var l=this.r.toString(16),u=this.g.toString(16),h=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+l+u+h},this.getHelpXML=function(){for(var l=new Array,u=0;u<t.length;u++)for(var h=t[u].example,c=0;c<h.length;c++)l[l.length]=h[c];for(var f in e)l[l.length]=f;var d=document.createElement("ul");d.setAttribute("id","rgbcolor-examples");for(var u=0;u<l.length;u++)try{var v=document.createElement("li"),p=new RGBColor(l[u]),g=document.createElement("div");g.style.cssText="margin: 3px; border: 1px solid black; background:"+p.toHex()+"; color:"+p.toHex(),g.appendChild(document.createTextNode("test"));var m=document.createTextNode(" "+l[u]+" -> "+p.toRGB()+" -> "+p.toHex());v.appendChild(g),v.appendChild(m),d.appendChild(v)}catch{}return d}},UMr=Yf,VMr=JV,$Mr=GXe.indexOf,WMr=UYe,ire=VMr([].indexOf),HYe=!!ire&&1/ire([1],1,-0)<0,HMr=HYe||!WMr("indexOf");UMr({target:"Array",proto:!0,forced:HMr},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return HYe?ire(this,e,t)||0:$Mr(this,e,t)}});var jMr=Yf,XMr=ql,YMr=rhe,qMr=$0,yAe=Bm,ZMr=nhe,KMr=XMr("".indexOf);jMr({target:"String",proto:!0,forced:!ZMr("includes")},{includes:function(e){return!!~KMr(yAe(qMr(this)),yAe(YMr(e)),arguments.length>1?arguments[1]:void 0)}});var JMr=gT,QMr=Array.isArray||function(e){return JMr(e)==="Array"},eIr=Yf,tIr=ql,rIr=QMr,nIr=tIr([].reverse),mAe=[1,2];eIr({target:"Array",proto:!0,forced:String(mAe)===String(mAe.reverse())},{reverse:function(){return rIr(this)&&(this.length=this.length),nIr(this)}});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var jYe=function(n,e){return(jYe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(n,e)};function XYe(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}jYe(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function iIr(n){var e="";Array.isArray(n)||(n=[n]);for(var t=0;t<n.length;t++){var r=n[t];if(r.type===_r.CLOSE_PATH)e+="z";else if(r.type===_r.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===_r.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===_r.MOVE_TO)e+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===_r.LINE_TO)e+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===_r.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===_r.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===_r.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===_r.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==_r.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+t+".");e+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return e}function are(n,e){var t=n[0],r=n[1];return[t*Math.cos(e)-r*Math.sin(e),t*Math.sin(e)+r*Math.cos(e)]}function Rg(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=0;t<n.length;t++)if(typeof n[t]!="number")throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof n[t]+" == typeof "+n[t]);return!0}var Vx=Math.PI;function Gq(n,e,t){n.lArcFlag=n.lArcFlag===0?0:1,n.sweepFlag=n.sweepFlag===0?0:1;var r=n.rX,i=n.rY,a=n.x,o=n.y;r=Math.abs(n.rX),i=Math.abs(n.rY);var s=are([(e-a)/2,(t-o)/2],-n.xRot/180*Vx),l=s[0],u=s[1],h=Math.pow(l,2)/Math.pow(r,2)+Math.pow(u,2)/Math.pow(i,2);1<h&&(r*=Math.sqrt(h),i*=Math.sqrt(h)),n.rX=r,n.rY=i;var c=Math.pow(r,2)*Math.pow(u,2)+Math.pow(i,2)*Math.pow(l,2),f=(n.lArcFlag!==n.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-c)/c)),d=r*u/i*f,v=-i*l/r*f,p=are([d,v],n.xRot/180*Vx);n.cX=p[0]+(e+a)/2,n.cY=p[1]+(t+o)/2,n.phi1=Math.atan2((u-v)/i,(l-d)/r),n.phi2=Math.atan2((-u-v)/i,(-l-d)/r),n.sweepFlag===0&&n.phi2>n.phi1&&(n.phi2-=2*Vx),n.sweepFlag===1&&n.phi2<n.phi1&&(n.phi2+=2*Vx),n.phi1*=180/Vx,n.phi2*=180/Vx}function _Ae(n,e,t){Rg(n,e,t);var r=n*n+e*e-t*t;if(0>r)return[];if(r===0)return[[n*t/(n*n+e*e),e*t/(n*n+e*e)]];var i=Math.sqrt(r);return[[(n*t+e*i)/(n*n+e*e),(e*t-n*i)/(n*n+e*e)],[(n*t-e*i)/(n*n+e*e),(e*t+n*i)/(n*n+e*e)]]}var Tu,s1=Math.PI/180;function xAe(n,e,t){return(1-t)*n+t*e}function SAe(n,e,t,r){return n+Math.cos(r/180*Vx)*e+Math.sin(r/180*Vx)*t}function wAe(n,e,t,r){var i=1e-6,a=e-n,o=t-e,s=3*a+3*(r-t)-6*o,l=6*(o-a),u=3*a;return Math.abs(s)<i?[-u/l]:function(h,c,f){f===void 0&&(f=1e-6);var d=h*h/4-c;if(d<-f)return[];if(d<=f)return[-h/2];var v=Math.sqrt(d);return[-h/2-v,-h/2+v]}(l/s,u/s,i)}function bAe(n,e,t,r,i){var a=1-i;return n*(a*a*a)+e*(3*a*a*i)+t*(3*a*i*i)+r*(i*i*i)}(function(n){function e(){return i(function(s,l,u){return s.relative&&(s.x1!==void 0&&(s.x1+=l),s.y1!==void 0&&(s.y1+=u),s.x2!==void 0&&(s.x2+=l),s.y2!==void 0&&(s.y2+=u),s.x!==void 0&&(s.x+=l),s.y!==void 0&&(s.y+=u),s.relative=!1),s})}function t(){var s=NaN,l=NaN,u=NaN,h=NaN;return i(function(c,f,d){return c.type&_r.SMOOTH_CURVE_TO&&(c.type=_r.CURVE_TO,s=isNaN(s)?f:s,l=isNaN(l)?d:l,c.x1=c.relative?f-s:2*f-s,c.y1=c.relative?d-l:2*d-l),c.type&_r.CURVE_TO?(s=c.relative?f+c.x2:c.x2,l=c.relative?d+c.y2:c.y2):(s=NaN,l=NaN),c.type&_r.SMOOTH_QUAD_TO&&(c.type=_r.QUAD_TO,u=isNaN(u)?f:u,h=isNaN(h)?d:h,c.x1=c.relative?f-u:2*f-u,c.y1=c.relative?d-h:2*d-h),c.type&_r.QUAD_TO?(u=c.relative?f+c.x1:c.x1,h=c.relative?d+c.y1:c.y1):(u=NaN,h=NaN),c})}function r(){var s=NaN,l=NaN;return i(function(u,h,c){if(u.type&_r.SMOOTH_QUAD_TO&&(u.type=_r.QUAD_TO,s=isNaN(s)?h:s,l=isNaN(l)?c:l,u.x1=u.relative?h-s:2*h-s,u.y1=u.relative?c-l:2*c-l),u.type&_r.QUAD_TO){s=u.relative?h+u.x1:u.x1,l=u.relative?c+u.y1:u.y1;var f=u.x1,d=u.y1;u.type=_r.CURVE_TO,u.x1=((u.relative?0:h)+2*f)/3,u.y1=((u.relative?0:c)+2*d)/3,u.x2=(u.x+2*f)/3,u.y2=(u.y+2*d)/3}else s=NaN,l=NaN;return u})}function i(s){var l=0,u=0,h=NaN,c=NaN;return function(f){if(isNaN(h)&&!(f.type&_r.MOVE_TO))throw new Error("path must start with moveto");var d=s(f,l,u,h,c);return f.type&_r.CLOSE_PATH&&(l=h,u=c),f.x!==void 0&&(l=f.relative?l+f.x:f.x),f.y!==void 0&&(u=f.relative?u+f.y:f.y),f.type&_r.MOVE_TO&&(h=l,c=u),d}}function a(s,l,u,h,c,f){return Rg(s,l,u,h,c,f),i(function(d,v,p,g){var m=d.x1,y=d.x2,_=d.relative&&!isNaN(g),x=d.x!==void 0?d.x:_?0:v,S=d.y!==void 0?d.y:_?0:p;function w(Y){return Y*Y}d.type&_r.HORIZ_LINE_TO&&l!==0&&(d.type=_r.LINE_TO,d.y=d.relative?0:p),d.type&_r.VERT_LINE_TO&&u!==0&&(d.type=_r.LINE_TO,d.x=d.relative?0:v),d.x!==void 0&&(d.x=d.x*s+S*u+(_?0:c)),d.y!==void 0&&(d.y=x*l+d.y*h+(_?0:f)),d.x1!==void 0&&(d.x1=d.x1*s+d.y1*u+(_?0:c)),d.y1!==void 0&&(d.y1=m*l+d.y1*h+(_?0:f)),d.x2!==void 0&&(d.x2=d.x2*s+d.y2*u+(_?0:c)),d.y2!==void 0&&(d.y2=y*l+d.y2*h+(_?0:f));var b=s*h-l*u;if(d.xRot!==void 0&&(s!==1||l!==0||u!==0||h!==1))if(b===0)delete d.rX,delete d.rY,delete d.xRot,delete d.lArcFlag,delete d.sweepFlag,d.type=_r.LINE_TO;else{var E=d.xRot*Math.PI/180,T=Math.sin(E),C=Math.cos(E),A=1/w(d.rX),M=1/w(d.rY),I=w(C)*A+w(T)*M,R=2*T*C*(A-M),k=w(T)*A+w(C)*M,D=I*h*h-R*l*h+k*l*l,G=R*(s*h+l*u)-2*(I*u*h+k*s*l),W=I*u*u-R*s*u+k*s*s,z=(Math.atan2(G,D-W)+Math.PI)%Math.PI/2,V=Math.sin(z),q=Math.cos(z);d.rX=Math.abs(b)/Math.sqrt(D*w(q)+G*V*q+W*w(V)),d.rY=Math.abs(b)/Math.sqrt(D*w(V)-G*V*q+W*w(q)),d.xRot=180*z/Math.PI}return d.sweepFlag!==void 0&&0>b&&(d.sweepFlag=+!d.sweepFlag),d})}function o(){return function(s){var l={};for(var u in s)l[u]=s[u];return l}}n.ROUND=function(s){function l(u){return Math.round(u*s)/s}return s===void 0&&(s=1e13),Rg(s),function(u){return u.x1!==void 0&&(u.x1=l(u.x1)),u.y1!==void 0&&(u.y1=l(u.y1)),u.x2!==void 0&&(u.x2=l(u.x2)),u.y2!==void 0&&(u.y2=l(u.y2)),u.x!==void 0&&(u.x=l(u.x)),u.y!==void 0&&(u.y=l(u.y)),u.rX!==void 0&&(u.rX=l(u.rX)),u.rY!==void 0&&(u.rY=l(u.rY)),u}},n.TO_ABS=e,n.TO_REL=function(){return i(function(s,l,u){return s.relative||(s.x1!==void 0&&(s.x1-=l),s.y1!==void 0&&(s.y1-=u),s.x2!==void 0&&(s.x2-=l),s.y2!==void 0&&(s.y2-=u),s.x!==void 0&&(s.x-=l),s.y!==void 0&&(s.y-=u),s.relative=!0),s})},n.NORMALIZE_HVZ=function(s,l,u){return s===void 0&&(s=!0),l===void 0&&(l=!0),u===void 0&&(u=!0),i(function(h,c,f,d,v){if(isNaN(d)&&!(h.type&_r.MOVE_TO))throw new Error("path must start with moveto");return l&&h.type&_r.HORIZ_LINE_TO&&(h.type=_r.LINE_TO,h.y=h.relative?0:f),u&&h.type&_r.VERT_LINE_TO&&(h.type=_r.LINE_TO,h.x=h.relative?0:c),s&&h.type&_r.CLOSE_PATH&&(h.type=_r.LINE_TO,h.x=h.relative?d-c:d,h.y=h.relative?v-f:v),h.type&_r.ARC&&(h.rX===0||h.rY===0)&&(h.type=_r.LINE_TO,delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag),h})},n.NORMALIZE_ST=t,n.QT_TO_C=r,n.INFO=i,n.SANITIZE=function(s){s===void 0&&(s=0),Rg(s);var l=NaN,u=NaN,h=NaN,c=NaN;return i(function(f,d,v,p,g){var m=Math.abs,y=!1,_=0,x=0;if(f.type&_r.SMOOTH_CURVE_TO&&(_=isNaN(l)?0:d-l,x=isNaN(u)?0:v-u),f.type&(_r.CURVE_TO|_r.SMOOTH_CURVE_TO)?(l=f.relative?d+f.x2:f.x2,u=f.relative?v+f.y2:f.y2):(l=NaN,u=NaN),f.type&_r.SMOOTH_QUAD_TO?(h=isNaN(h)?d:2*d-h,c=isNaN(c)?v:2*v-c):f.type&_r.QUAD_TO?(h=f.relative?d+f.x1:f.x1,c=f.relative?v+f.y1:f.y2):(h=NaN,c=NaN),f.type&_r.LINE_COMMANDS||f.type&_r.ARC&&(f.rX===0||f.rY===0||!f.lArcFlag)||f.type&_r.CURVE_TO||f.type&_r.SMOOTH_CURVE_TO||f.type&_r.QUAD_TO||f.type&_r.SMOOTH_QUAD_TO){var S=f.x===void 0?0:f.relative?f.x:f.x-d,w=f.y===void 0?0:f.relative?f.y:f.y-v;_=isNaN(h)?f.x1===void 0?_:f.relative?f.x:f.x1-d:h-d,x=isNaN(c)?f.y1===void 0?x:f.relative?f.y:f.y1-v:c-v;var b=f.x2===void 0?0:f.relative?f.x:f.x2-d,E=f.y2===void 0?0:f.relative?f.y:f.y2-v;m(S)<=s&&m(w)<=s&&m(_)<=s&&m(x)<=s&&m(b)<=s&&m(E)<=s&&(y=!0)}return f.type&_r.CLOSE_PATH&&m(d-p)<=s&&m(v-g)<=s&&(y=!0),y?[]:f})},n.MATRIX=a,n.ROTATE=function(s,l,u){l===void 0&&(l=0),u===void 0&&(u=0),Rg(s,l,u);var h=Math.sin(s),c=Math.cos(s);return a(c,h,-h,c,l-l*c+u*h,u-l*h-u*c)},n.TRANSLATE=function(s,l){return l===void 0&&(l=0),Rg(s,l),a(1,0,0,1,s,l)},n.SCALE=function(s,l){return l===void 0&&(l=s),Rg(s,l),a(s,0,0,l,0,0)},n.SKEW_X=function(s){return Rg(s),a(1,0,Math.atan(s),1,0,0)},n.SKEW_Y=function(s){return Rg(s),a(1,Math.atan(s),0,1,0,0)},n.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Rg(s),a(-1,0,0,1,s,0)},n.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Rg(s),a(1,0,0,-1,0,s)},n.A_TO_C=function(){return i(function(s,l,u){return _r.ARC===s.type?function(h,c,f){var d,v,p,g;h.cX||Gq(h,c,f);for(var m=Math.min(h.phi1,h.phi2),y=Math.max(h.phi1,h.phi2)-m,_=Math.ceil(y/90),x=new Array(_),S=c,w=f,b=0;b<_;b++){var E=xAe(h.phi1,h.phi2,b/_),T=xAe(h.phi1,h.phi2,(b+1)/_),C=T-E,A=4/3*Math.tan(C*s1/4),M=[Math.cos(E*s1)-A*Math.sin(E*s1),Math.sin(E*s1)+A*Math.cos(E*s1)],I=M[0],R=M[1],k=[Math.cos(T*s1),Math.sin(T*s1)],D=k[0],G=k[1],W=[D+A*Math.sin(T*s1),G-A*Math.cos(T*s1)],z=W[0],V=W[1];x[b]={relative:h.relative,type:_r.CURVE_TO};var q=function(Y,le){var j=are([Y*h.rX,le*h.rY],h.xRot),Q=j[0],ie=j[1];return[h.cX+Q,h.cY+ie]};d=q(I,R),x[b].x1=d[0],x[b].y1=d[1],v=q(z,V),x[b].x2=v[0],x[b].y2=v[1],p=q(D,G),x[b].x=p[0],x[b].y=p[1],h.relative&&(x[b].x1-=S,x[b].y1-=w,x[b].x2-=S,x[b].y2-=w,x[b].x-=S,x[b].y-=w),S=(g=[x[b].x,x[b].y])[0],w=g[1]}return x}(s,s.relative?0:l,s.relative?0:u):s})},n.ANNOTATE_ARCS=function(){return i(function(s,l,u){return s.relative&&(l=0,u=0),_r.ARC===s.type&&Gq(s,l,u),s})},n.CLONE=o,n.CALCULATE_BOUNDS=function(){var s=function(f){var d={};for(var v in f)d[v]=f[v];return d},l=e(),u=r(),h=t(),c=i(function(f,d,v){var p=h(u(l(s(f))));function g(V){V>c.maxX&&(c.maxX=V),V<c.minX&&(c.minX=V)}function m(V){V>c.maxY&&(c.maxY=V),V<c.minY&&(c.minY=V)}if(p.type&_r.DRAWING_COMMANDS&&(g(d),m(v)),p.type&_r.HORIZ_LINE_TO&&g(p.x),p.type&_r.VERT_LINE_TO&&m(p.y),p.type&_r.LINE_TO&&(g(p.x),m(p.y)),p.type&_r.CURVE_TO){g(p.x),m(p.y);for(var y=0,_=wAe(d,p.x1,p.x2,p.x);y<_.length;y++)0<(z=_[y])&&1>z&&g(bAe(d,p.x1,p.x2,p.x,z));for(var x=0,S=wAe(v,p.y1,p.y2,p.y);x<S.length;x++)0<(z=S[x])&&1>z&&m(bAe(v,p.y1,p.y2,p.y,z))}if(p.type&_r.ARC){g(p.x),m(p.y),Gq(p,d,v);for(var w=p.xRot/180*Math.PI,b=Math.cos(w)*p.rX,E=Math.sin(w)*p.rX,T=-Math.sin(w)*p.rY,C=Math.cos(w)*p.rY,A=p.phi1<p.phi2?[p.phi1,p.phi2]:-180>p.phi2?[p.phi2+360,p.phi1+360]:[p.phi2,p.phi1],M=A[0],I=A[1],R=function(V){var q=V[0],Y=V[1],le=180*Math.atan2(Y,q)/Math.PI;return le<M?le+360:le},k=0,D=_Ae(T,-b,0).map(R);k<D.length;k++)(z=D[k])>M&&z<I&&g(SAe(p.cX,b,T,z));for(var G=0,W=_Ae(C,-E,0).map(R);G<W.length;G++){var z;(z=W[G])>M&&z<I&&m(SAe(p.cY,E,C,z))}}return f});return c.minX=1/0,c.maxX=-1/0,c.minY=1/0,c.maxY=-1/0,c}})(Tu||(Tu={}));var Mg,YYe=function(){function n(){}return n.prototype.round=function(e){return this.transform(Tu.ROUND(e))},n.prototype.toAbs=function(){return this.transform(Tu.TO_ABS())},n.prototype.toRel=function(){return this.transform(Tu.TO_REL())},n.prototype.normalizeHVZ=function(e,t,r){return this.transform(Tu.NORMALIZE_HVZ(e,t,r))},n.prototype.normalizeST=function(){return this.transform(Tu.NORMALIZE_ST())},n.prototype.qtToC=function(){return this.transform(Tu.QT_TO_C())},n.prototype.aToC=function(){return this.transform(Tu.A_TO_C())},n.prototype.sanitize=function(e){return this.transform(Tu.SANITIZE(e))},n.prototype.translate=function(e,t){return this.transform(Tu.TRANSLATE(e,t))},n.prototype.scale=function(e,t){return this.transform(Tu.SCALE(e,t))},n.prototype.rotate=function(e,t,r){return this.transform(Tu.ROTATE(e,t,r))},n.prototype.matrix=function(e,t,r,i,a,o){return this.transform(Tu.MATRIX(e,t,r,i,a,o))},n.prototype.skewX=function(e){return this.transform(Tu.SKEW_X(e))},n.prototype.skewY=function(e){return this.transform(Tu.SKEW_Y(e))},n.prototype.xSymmetry=function(e){return this.transform(Tu.X_AXIS_SYMMETRY(e))},n.prototype.ySymmetry=function(e){return this.transform(Tu.Y_AXIS_SYMMETRY(e))},n.prototype.annotateArcs=function(){return this.transform(Tu.ANNOTATE_ARCS())},n}(),aIr=function(n){return n===" "||n===" "||n==="\r"||n===`
`},EAe=function(n){return"0".charCodeAt(0)<=n.charCodeAt(0)&&n.charCodeAt(0)<="9".charCodeAt(0)},oIr=function(n){function e(){var t=n.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return XYe(e,n),e.prototype.finish=function(t){if(t===void 0&&(t=[]),this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,r){var i=this;r===void 0&&(r=[]);for(var a=function(c){r.push(c),i.curArgs.length=0,i.canParseCommandOrComma=!0},o=0;o<t.length;o++){var s=t[o],l=!(this.curCommandType!==_r.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),u=EAe(s)&&(this.curNumber==="0"&&s==="0"||l);if(!EAe(s)||u)if(s!=="e"&&s!=="E")if(s!=="-"&&s!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(s!=="."||this.curNumberHasExp||this.curNumberHasDecimal||l){if(this.curNumber&&this.curCommandType!==-1){var h=Number(this.curNumber);if(isNaN(h))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===_r.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>h)throw new SyntaxError('Expected positive number, got "'+h+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(h),this.curArgs.length===sIr[this.curCommandType]&&(_r.HORIZ_LINE_TO===this.curCommandType?a({type:_r.HORIZ_LINE_TO,relative:this.curCommandRelative,x:h}):_r.VERT_LINE_TO===this.curCommandType?a({type:_r.VERT_LINE_TO,relative:this.curCommandRelative,y:h}):this.curCommandType===_r.MOVE_TO||this.curCommandType===_r.LINE_TO||this.curCommandType===_r.SMOOTH_QUAD_TO?(a({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_r.MOVE_TO===this.curCommandType&&(this.curCommandType=_r.LINE_TO)):this.curCommandType===_r.CURVE_TO?a({type:_r.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_r.SMOOTH_CURVE_TO?a({type:_r.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_r.QUAD_TO?a({type:_r.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_r.ARC&&a({type:_r.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!aIr(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(u)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=_r.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=_r.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=_r.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=_r.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=_r.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=_r.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=_r.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=_r.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=_r.ARC,this.curCommandRelative=s==="a"}else r.push({type:_r.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var a=0,o=Object.getPrototypeOf(this).parse.call(this,r);a<o.length;a++){var s=o[a],l=t(s);Array.isArray(l)?i.push.apply(i,l):i.push(l)}return i}}})},e}(YYe),_r=function(n){function e(t){var r=n.call(this)||this;return r.commands=typeof t=="string"?e.parse(t):t,r}return XYe(e,n),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=Tu.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var r=[],i=0,a=this.commands;i<a.length;i++){var o=t(a[i]);Array.isArray(o)?r.push.apply(r,o):r.push(o)}return this.commands=r,this},e.encode=function(t){return iIr(t)},e.parse=function(t){var r=new oIr,i=[];return r.parse(t,i),r.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(YYe),sIr=((Mg={})[_r.MOVE_TO]=2,Mg[_r.LINE_TO]=2,Mg[_r.HORIZ_LINE_TO]=1,Mg[_r.VERT_LINE_TO]=1,Mg[_r.CLOSE_PATH]=0,Mg[_r.QUAD_TO]=4,Mg[_r.SMOOTH_QUAD_TO]=2,Mg[_r.CURVE_TO]=6,Mg[_r.SMOOTH_CURVE_TO]=4,Mg[_r.ARC]=7,Mg),lIr=XV.PROPER,uIr=mT,hIr=Xf,TAe=Bm,cIr=Yl,fIr=Que,ahe="toString",qYe=RegExp.prototype,ZYe=qYe[ahe],dIr=cIr(function(){return ZYe.call({source:"a",flags:"b"})!=="/a/b"}),vIr=lIr&&ZYe.name!==ahe;(dIr||vIr)&&uIr(qYe,ahe,function(){var e=hIr(this),t=TAe(e.source),r=TAe(fIr(e));return"/"+t+"/"+r},{unsafe:!0});function p8(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?p8=function(e){return typeof e}:p8=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p8(n)}function pIr(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}var gIr=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],yIr=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function mIr(n,e,t,r,i){if(typeof n=="string"&&(n=document.getElementById(n)),!n||p8(n)!=="object"||!("getContext"in n))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=n.getContext("2d");try{return a.getImageData(e,t,r,i)}catch(o){throw new Error("unable to access image data: "+o)}}function _Ir(n,e,t,r,i,a){if(!(isNaN(a)||a<1)){a|=0;var o=mIr(n,e,t,r,i);o=xIr(o,e,t,r,i,a),n.getContext("2d").putImageData(o,e,t)}}function xIr(n,e,t,r,i,a){for(var o=n.data,s=2*a+1,l=r-1,u=i-1,h=a+1,c=h*(h+1)/2,f=new CAe,d=f,v,p=1;p<s;p++)d=d.next=new CAe,p===h&&(v=d);d.next=f;for(var g=null,m=null,y=0,_=0,x=gIr[a],S=yIr[a],w=0;w<i;w++){d=f;for(var b=o[_],E=o[_+1],T=o[_+2],C=o[_+3],A=0;A<h;A++)d.r=b,d.g=E,d.b=T,d.a=C,d=d.next;for(var M=0,I=0,R=0,k=0,D=h*b,G=h*E,W=h*T,z=h*C,V=c*b,q=c*E,Y=c*T,le=c*C,j=1;j<h;j++){var Q=_+((l<j?l:j)<<2),ie=o[Q],oe=o[Q+1],se=o[Q+2],me=o[Q+3],Ce=h-j;V+=(d.r=ie)*Ce,q+=(d.g=oe)*Ce,Y+=(d.b=se)*Ce,le+=(d.a=me)*Ce,M+=ie,I+=oe,R+=se,k+=me,d=d.next}g=f,m=v;for(var Le=0;Le<r;Le++){var re=le*x>>>S;if(o[_+3]=re,re!==0){var yt=255/re;o[_]=(V*x>>>S)*yt,o[_+1]=(q*x>>>S)*yt,o[_+2]=(Y*x>>>S)*yt}else o[_]=o[_+1]=o[_+2]=0;V-=D,q-=G,Y-=W,le-=z,D-=g.r,G-=g.g,W-=g.b,z-=g.a;var je=Le+a+1;je=y+(je<l?je:l)<<2,M+=g.r=o[je],I+=g.g=o[je+1],R+=g.b=o[je+2],k+=g.a=o[je+3],V+=M,q+=I,Y+=R,le+=k,g=g.next;var st=m,Nt=st.r,Zt=st.g,qe=st.b,ur=st.a;D+=Nt,G+=Zt,W+=qe,z+=ur,M-=Nt,I-=Zt,R-=qe,k-=ur,m=m.next,_+=4}y+=r}for(var Dt=0;Dt<r;Dt++){_=Dt<<2;var ft=o[_],Oe=o[_+1],J=o[_+2],We=o[_+3],Tt=h*ft,Qe=h*Oe,zt=h*J,mt=h*We,wt=c*ft,pt=c*Oe,ar=c*J,kt=c*We;d=f;for(var Dr=0;Dr<h;Dr++)d.r=ft,d.g=Oe,d.b=J,d.a=We,d=d.next;for(var Sr=r,jr=0,pn=0,Jn=0,Rn=0,hi=1;hi<=a;hi++){_=Sr+Dt<<2;var yn=h-hi;wt+=(d.r=ft=o[_])*yn,pt+=(d.g=Oe=o[_+1])*yn,ar+=(d.b=J=o[_+2])*yn,kt+=(d.a=We=o[_+3])*yn,Rn+=ft,jr+=Oe,pn+=J,Jn+=We,d=d.next,hi<u&&(Sr+=r)}_=Dt,g=f,m=v;for(var Oi=0;Oi<i;Oi++){var oi=_<<2;o[oi+3]=We=kt*x>>>S,We>0?(We=255/We,o[oi]=(wt*x>>>S)*We,o[oi+1]=(pt*x>>>S)*We,o[oi+2]=(ar*x>>>S)*We):o[oi]=o[oi+1]=o[oi+2]=0,wt-=Tt,pt-=Qe,ar-=zt,kt-=mt,Tt-=g.r,Qe-=g.g,zt-=g.b,mt-=g.a,oi=Dt+((oi=Oi+h)<u?oi:u)*r<<2,wt+=Rn+=g.r=o[oi],pt+=jr+=g.g=o[oi+1],ar+=pn+=g.b=o[oi+2],kt+=Jn+=g.a=o[oi+3],g=g.next,Tt+=ft=m.r,Qe+=Oe=m.g,zt+=J=m.b,mt+=We=m.a,Rn-=ft,jr-=Oe,pn-=J,Jn-=We,m=m.next,_+=r}}return n}var CAe=function n(){pIr(this,n),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function sL(n){return n.replace(/(?!\u3000)\s+/gm," ")}function SIr(n){return n.replace(/^[\n \t]+/,"")}function wIr(n){return n.replace(/[\n \t]+$/,"")}function xv(n){var e=(n||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var bIr=/^[A-Z-]+$/;function EIr(n){return bIr.test(n)?n.toLowerCase():n}function KYe(n){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(n)||[];return e[2]||e[3]||e[4]}function TIr(n){if(!n.startsWith("rgb"))return n;var e=3,t=n.replace(/\d+(\.\d+)?/g,(r,i)=>e--&&i?String(Math.round(parseFloat(r))):r);return t}var CIr=/(\[[^\]]+\])/g,AIr=/(#[^\s+>~.[:]+)/g,MIr=/(\.[^\s+>~.[:]+)/g,IIr=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,LIr=/(:[\w-]+\([^)]*\))/gi,PIr=/(:[^\s+>~.[:]+)/g,OIr=/([^\s+>~.[:]+)/g;function Eb(n,e){var t=e.exec(n);return t?[n.replace(e," "),t.length]:[n,0]}function RIr(n){var e=[0,0,0],t=n.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[t,r]=Eb(t,CIr),e[1]+=r,[t,r]=Eb(t,AIr),e[0]+=r,[t,r]=Eb(t,MIr),e[1]+=r,[t,r]=Eb(t,IIr),e[2]+=r,[t,r]=Eb(t,LIr),e[1]+=r,[t,r]=Eb(t,PIr),e[1]+=r,t=t.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[t,r]=Eb(t,OIr),e[2]+=r,e.join("")}var tM=1e-8;function AAe(n){return Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2))}function ore(n,e){return(n[0]*e[0]+n[1]*e[1])/(AAe(n)*AAe(e))}function MAe(n,e){return(n[0]*e[1]<n[1]*e[0]?-1:1)*Math.acos(ore(n,e))}function IAe(n){return n*n*n}function LAe(n){return 3*n*n*(1-n)}function PAe(n){return 3*n*(1-n)*(1-n)}function OAe(n){return(1-n)*(1-n)*(1-n)}function RAe(n){return n*n}function DAe(n){return 2*n*(1-n)}function NAe(n){return(1-n)*(1-n)}class jn{constructor(e,t,r){this.document=e,this.name=t,this.value=r,this.isNormalizedColor=!1}static empty(e){return new jn(e,"EMPTY","")}split(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:t,name:r}=this;return sL(this.getString()).trim().split(e).map(i=>new jn(t,r,i))}hasValue(e){var{value:t}=this;return t!==null&&t!==""&&(e||t!==0)&&typeof t<"u"}isString(e){var{value:t}=this,r=typeof t=="string";return!r||!e?r:e.test(t)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,r=parseFloat(t);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=TIr(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:a}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(r);default:{var o=this.getNumber();return t&&o<1?o*a.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,t);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?jn.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var t=this.getColor(),r=t.length,i=0,a=0;a<r&&(t[a]===","&&i++,i!==3);a++);if(e.hasValue()&&this.isString()&&i!==3){var o=new nre(t);o.ok&&(o.alpha=e.getNumber(),t=o.toRGBA())}return new jn(this.document,this.name,t)}}jn.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class DIr{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class su{constructor(e,t){this.x=e,this.y=t}static parse(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[r=t,i=t]=xv(e);return new su(r,i)}static parseScale(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=t,i=r]=xv(e);return new su(r,i)}static parsePath(e){for(var t=xv(e),r=t.length,i=[],a=0;a<r;a+=2)i.push(new su(t[a],t[a+1]));return i}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:r}=this,i=t*e[0]+r*e[2]+e[4],a=t*e[1]+r*e[3]+e[5];this.x=i,this.y=a}}class NIr{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:r}=this,i=e.ctx.canvas;i.onclick=t,i.onmousemove=r,this.working=!0}}stop(){if(!!this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(!!this.working){var{screen:e,events:t,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),t.forEach((a,o)=>{for(var{run:s}=a,l=r[o];l;)s(l),l=l.parent}),this.events=[],this.eventElements=[]}}checkPath(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((a,o)=>{var{x:s,y:l}=a;!i[o]&&t.isPointInPath&&t.isPointInPath(s,l)&&(i[o]=e)})}}checkBoundingBox(e,t){if(!(!this.working||!t)){var{events:r,eventElements:i}=this;r.forEach((a,o)=>{var{x:s,y:l}=a;!i[o]&&t.isPointInBox(s,l)&&(i[o]=e)})}}mapXY(e,t){for(var{window:r,ctx:i}=this.screen,a=new su(e,t),o=i.canvas;o;)a.x-=o.offsetLeft,a.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(a.x+=r.scrollX),r.scrollY&&(a.y+=r.scrollY),a}onClick(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var JYe=typeof window<"u"?window:null,QYe=typeof fetch<"u"?fetch.bind(void 0):null;class n${constructor(e){var{fetch:t=QYe,window:r=JYe}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new DIr,this.mouse=new NIr(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(t=>t());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:r,aspectRatio:i,width:a,desiredWidth:o,height:s,desiredHeight:l,minX:u=0,minY:h=0,refX:c,refY:f,clip:d=!1,clipX:v=0,clipY:p=0}=e,g=sL(i).replace(/^defer\s/,""),[m,y]=g.split(" "),_=m||"xMidYMid",x=y||"meet",S=a/o,w=s/l,b=Math.min(S,w),E=Math.max(S,w),T=o,C=l;x==="meet"&&(T*=b,C*=b),x==="slice"&&(T*=E,C*=E);var A=new jn(t,"refX",c),M=new jn(t,"refY",f),I=A.hasValue()&&M.hasValue();if(I&&r.translate(-b*A.getPixels("x"),-b*M.getPixels("y")),d){var R=b*v,k=b*p;r.beginPath(),r.moveTo(R,k),r.lineTo(a,k),r.lineTo(a,s),r.lineTo(R,s),r.closePath(),r.clip()}if(!I){var D=x==="meet"&&b===w,G=x==="slice"&&E===w,W=x==="meet"&&b===S,z=x==="slice"&&E===S;_.startsWith("xMid")&&(D||G)&&r.translate(a/2-T/2,0),_.endsWith("YMid")&&(W||z)&&r.translate(0,s/2-C/2),_.startsWith("xMax")&&(D||G)&&r.translate(a-T,0),_.endsWith("YMax")&&(W||z)&&r.translate(0,s-C)}switch(!0){case _==="none":r.scale(S,w);break;case x==="meet":r.scale(b,b);break;case x==="slice":r.scale(E,E);break}r.translate(-u,-h)}start(e){var{enableRedraw:t=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:a=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:l,scaleHeight:u,offsetX:h,offsetY:c}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:f,mouse:d}=this,v=1e3/f;if(this.frameDuration=v,this.readyPromise=new Promise(_=>{this.resolveReady=_}),this.isReady()&&this.render(e,a,o,l,u,h,c),!!t){var p=Date.now(),g=p,m=0,y=()=>{p=Date.now(),m=p-g,m>=v&&(g=p-m%v,this.shouldUpdate(i,s)&&(this.render(e,a,o,l,u,h,c),d.runEvents())),this.intervalId=QA.exports(y)};r||d.start(),this.intervalId=QA.exports(y)}}stop(){this.intervalId&&(QA.exports.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((a,o)=>o.update(r)||a,!1);if(i)return!0}return!!(typeof t=="function"&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,r,i,a,o,s){var{CLIENT_WIDTH:l,CLIENT_HEIGHT:u,viewPort:h,ctx:c,isFirstRender:f}=this,d=c.canvas;h.clear(),d.width&&d.height?h.setCurrent(d.width,d.height):h.setCurrent(l,u);var v=e.getStyle("width"),p=e.getStyle("height");!t&&(f||typeof i!="number"&&typeof a!="number")&&(v.hasValue()&&(d.width=v.getPixels("x"),d.style&&(d.style.width="".concat(d.width,"px"))),p.hasValue()&&(d.height=p.getPixels("y"),d.style&&(d.style.height="".concat(d.height,"px"))));var g=d.clientWidth||d.width,m=d.clientHeight||d.height;if(t&&v.hasValue()&&p.hasValue()&&(g=v.getPixels("x"),m=p.getPixels("y")),h.setCurrent(g,m),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof a=="number"){var y=xv(e.getAttribute("viewBox").getString()),_=0,x=0;if(typeof i=="number"){var S=e.getStyle("width");S.hasValue()?_=S.getPixels("x")/i:isNaN(y[2])||(_=y[2]/i)}if(typeof a=="number"){var w=e.getStyle("height");w.hasValue()?x=w.getPixels("y")/a:isNaN(y[3])||(x=y[3]/a)}_||(_=x),x||(x=_),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(a);var b=e.getStyle("transform",!0,!0);b.setValue("".concat(b.getString()," scale(").concat(1/_,", ").concat(1/x,")"))}r||c.clearRect(0,0,g,m),e.render(c),f&&(this.isFirstRender=!1)}}n$.defaultWindow=JYe;n$.defaultFetch=QYe;var{defaultFetch:kIr}=n$,FIr=typeof DOMParser<"u"?DOMParser:null;class zq{constructor(){var{fetch:e=kIr,DOMParser:t=FIr}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return Vc(function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)})()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return Vc(function*(){var r=yield t.fetch(e),i=yield r.text();return t.parseFromString(i)})()}}class BIr{constructor(e,t){this.type="translate",this.point=null,this.point=su.parse(t)}apply(e){var{x:t,y:r}=this.point;e.translate(t||0,r||0)}unapply(e){var{x:t,y:r}=this.point;e.translate(-1*t||0,-1*r||0)}applyToPoint(e){var{x:t,y:r}=this.point;e.applyTransform([1,0,0,1,t||0,r||0])}}class GIr{constructor(e,t,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=xv(t);this.angle=new jn(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:t,cy:r,originX:i,originY:a,angle:o}=this,s=t+i.getPixels("x"),l=r+a.getPixels("y");e.translate(s,l),e.rotate(o.getRadians()),e.translate(-s,-l)}unapply(e){var{cx:t,cy:r,originX:i,originY:a,angle:o}=this,s=t+i.getPixels("x"),l=r+a.getPixels("y");e.translate(s,l),e.rotate(-1*o.getRadians()),e.translate(-s,-l)}applyToPoint(e){var{cx:t,cy:r,angle:i}=this,a=i.getRadians();e.applyTransform([1,0,0,1,t||0,r||0]),e.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]),e.applyTransform([1,0,0,1,-t||0,-r||0])}}class zIr{constructor(e,t,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=su.parseScale(t);(i.x===0||i.y===0)&&(i.x=tM,i.y=tM),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:t,y:r},originX:i,originY:a}=this,o=i.getPixels("x"),s=a.getPixels("y");e.translate(o,s),e.scale(t,r||t),e.translate(-o,-s)}unapply(e){var{scale:{x:t,y:r},originX:i,originY:a}=this,o=i.getPixels("x"),s=a.getPixels("y");e.translate(o,s),e.scale(1/t,1/r||t),e.translate(-o,-s)}applyToPoint(e){var{x:t,y:r}=this.scale;e.applyTransform([t||0,0,0,r||0,0,0])}}class eqe{constructor(e,t,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=xv(t),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:t,originY:r,matrix:i}=this,a=t.getPixels("x"),o=r.getPixels("y");e.translate(a,o),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-a,-o)}unapply(e){var{originX:t,originY:r,matrix:i}=this,a=i[0],o=i[2],s=i[4],l=i[1],u=i[3],h=i[5],c=0,f=0,d=1,v=1/(a*(u*d-h*f)-o*(l*d-h*c)+s*(l*f-u*c)),p=t.getPixels("x"),g=r.getPixels("y");e.translate(p,g),e.transform(v*(u*d-h*f),v*(h*c-l*d),v*(s*f-o*d),v*(a*d-s*c),v*(o*h-s*u),v*(s*l-a*h)),e.translate(-p,-g)}applyToPoint(e){e.applyTransform(this.matrix)}}class tqe extends eqe{constructor(e,t,r){super(e,t,r),this.type="skew",this.angle=null,this.angle=new jn(e,"angle",t)}}class UIr extends tqe{constructor(e,t,r){super(e,t,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class VIr extends tqe{constructor(e,t,r){super(e,t,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function $Ir(n){return sL(n).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function WIr(n){var[e,t]=n.split("(");return[e.trim(),t.trim().replace(")","")]}class y2{constructor(e,t,r){this.document=e,this.transforms=[];var i=$Ir(t);i.forEach(a=>{if(a!=="none"){var[o,s]=WIr(a),l=y2.transformTypes[o];typeof l<"u"&&this.transforms.push(new l(this.document,s,r))}})}static fromElement(e,t){var r=t.getStyle("transform",!1,!0),[i,a=i]=t.getStyle("transform-origin",!1,!0).split(),o=[i,a];return r.hasValue()?new y2(e,r.getString(),o):null}apply(e){for(var{transforms:t}=this,r=t.length,i=0;i<r;i++)t[i].apply(e)}unapply(e){for(var{transforms:t}=this,r=t.length,i=r-1;i>=0;i--)t[i].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,r=t.length,i=0;i<r;i++)t[i].applyToPoint(e)}}y2.transformTypes={translate:BIr,rotate:GIr,scale:zIr,matrix:eqe,skewX:UIr,skewY:VIr};class il{constructor(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=t,this.captureTextNodes=r,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!t||t.nodeType!==1)){if(Array.from(t.attributes).forEach(s=>{var l=EIr(s.nodeName);this.attributes[l]=new jn(e,l,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(!!s){var[l,u]=s.split(":").map(h=>h.trim());this.styles[l]=new jn(e,l,u)}})}var{definitions:a}=e,o=this.getAttribute("id");o.hasValue()&&(a[o.getString()]||(a[o.getString()]=this)),Array.from(t.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var l=e.createTextNode(s);l.getText().length>0&&this.addChild(l)}})}}getAttribute(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&t){var i=new jn(this.document,e,"");return this.attributes[e]=i,i}return r||jn.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return jn.empty(this.document)}getStyle(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var a=this.getAttribute(e);if(a!=null&&a.hasValue())return this.styles[e]=a,a;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(e);if(s!=null&&s.hasValue())return s}}if(t){var l=new jn(this.document,e,"");return this.styles[e]=l,l}return i||jn.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=y2.fromElement(this.document,this);t&&t.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(t=>{t.render(e)})}addChild(e){var t=e instanceof il?e:this.document.createElement(e);t.parent=this,il.ignoreChildTypes.includes(t.type)||this.children.push(t)}matchesSelector(e){var t,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(t=r.getAttribute)===null||t===void 0?void 0:t.call(r,"class");return!i||i===""?!1:i.split(" ").some(a=>".".concat(a)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],a=t[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),a>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=a)}}}removeStyles(e,t){var r=t.reduce((i,a)=>{var o=e.getStyle(a);if(!o.hasValue())return i;var s=o.getString();return o.setValue(""),[...i,[a,s]]},[]);return r}restoreStyles(e,t){t.forEach(r=>{var[i,a]=r;e.getStyle(i,!0).setValue(a)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}}il.ignoreChildTypes=["title"];class HIr extends il{constructor(e,t,r){super(e,t,r)}}function jIr(n){var e=n.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function XIr(n){return typeof process>"u"?n:n.trim().split(",").map(jIr).join(",")}function YIr(n){if(!n)return"";var e=n.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function qIr(n){if(!n)return"";var e=n.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class Lf{constructor(e,t,r,i,a,o){var s=o?typeof o=="string"?Lf.parse(o):o:{};this.fontFamily=a||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=t||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r="",i="",a="",o="",s="",l=sL(e).trim().split(" "),u={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return l.forEach(h=>{switch(!0){case(!u.fontStyle&&Lf.styles.includes(h)):h!=="inherit"&&(r=h),u.fontStyle=!0;break;case(!u.fontVariant&&Lf.variants.includes(h)):h!=="inherit"&&(i=h),u.fontStyle=!0,u.fontVariant=!0;break;case(!u.fontWeight&&Lf.weights.includes(h)):h!=="inherit"&&(a=h),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0;break;case!u.fontSize:h!=="inherit"&&([o]=h.split("/")),u.fontStyle=!0,u.fontVariant=!0,u.fontWeight=!0,u.fontSize=!0;break;default:h!=="inherit"&&(s+=h)}}),new Lf(r,i,a,o,s,t)}toString(){return[YIr(this.fontStyle),this.fontVariant,qIr(this.fontWeight),this.fontSize,XIr(this.fontFamily)].join(" ").trim()}}Lf.styles="normal|italic|oblique|inherit";Lf.variants="normal|small-caps|inherit";Lf.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class H0{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.addPoint(e,t),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(!!e){var{x1:t,y1:r,x2:i,y2:a}=e;this.addPoint(t,r),this.addPoint(i,a)}}sumCubic(e,t,r,i,a){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*a}bezierCurveAdd(e,t,r,i,a){var o=6*t-12*r+6*i,s=-3*t+9*r-9*i+3*a,l=3*r-3*t;if(s===0){if(o===0)return;var u=-l/o;0<u&&u<1&&(e?this.addX(this.sumCubic(u,t,r,i,a)):this.addY(this.sumCubic(u,t,r,i,a)));return}var h=Math.pow(o,2)-4*l*s;if(!(h<0)){var c=(-o+Math.sqrt(h))/(2*s);0<c&&c<1&&(e?this.addX(this.sumCubic(c,t,r,i,a)):this.addY(this.sumCubic(c,t,r,i,a)));var f=(-o-Math.sqrt(h))/(2*s);0<f&&f<1&&(e?this.addX(this.sumCubic(f,t,r,i,a)):this.addY(this.sumCubic(f,t,r,i,a)))}}addBezierCurve(e,t,r,i,a,o,s,l){this.addPoint(e,t),this.addPoint(s,l),this.bezierCurveAdd(!0,e,r,a,s),this.bezierCurveAdd(!1,t,i,o,l)}addQuadraticCurve(e,t,r,i,a,o){var s=e+.6666666666666666*(r-e),l=t+2/3*(i-t),u=s+1/3*(a-e),h=l+1/3*(o-t);this.addBezierCurve(e,t,s,u,l,h,a,o)}isPointInBox(e,t){var{x1:r,y1:i,x2:a,y2:o}=this;return r<=e&&e<=a&&i<=t&&t<=o}}class Wi extends _r{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new su(0,0),this.control=new su(0,0),this.current=new su(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new su(this.command[e],this.command[t]);return this.makeAbsolute(r)}getAsControlPoint(e,t){var r=this.getPoint(e,t);return this.control=r,r}getAsCurrentPoint(e,t){var r=this.getPoint(e,t);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==_r.CURVE_TO&&e!==_r.SMOOTH_CURVE_TO&&e!==_r.QUAD_TO&&e!==_r.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:r},control:{x:i,y:a}}=this,o=new su(2*t-i,2*r-a);return o}makeAbsolute(e){if(this.command.relative){var{x:t,y:r}=this.current;e.x+=t,e.y+=r}return e}addMarker(e,t,r){var{points:i,angles:a}=this;r&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,r=0;r<t;r++)if(!e[r]){for(var i=r+1;i<t;i++)if(e[i]){e[r]=e[i];break}}return e}}class _T extends il{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var r=t.getStyle("opacity",!1,!0);r.hasValue(!0)&&(e*=r.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!t){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var l=r.getColor();l!=="inherit"&&(e.fillStyle=l==="none"?"rgba(0,0,0,0)":l)}if(i.hasValue()){var u=new jn(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=u}if(a.isUrlDefinition()){var h=a.getFillStyleDefinition(this,o);h&&(e.strokeStyle=h)}else if(a.hasValue()){a.getString()==="currentColor"&&a.setValue(this.getStyle("color").getColor());var c=a.getString();c!=="inherit"&&(e.strokeStyle=c==="none"?"rgba(0,0,0,0)":c)}if(o.hasValue()){var f=new jn(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=f}var d=this.getStyle("stroke-width");if(d.hasValue()){var v=d.getPixels();e.lineWidth=v||tM}var p=this.getStyle("stroke-linecap"),g=this.getStyle("stroke-linejoin"),m=this.getStyle("stroke-miterlimit"),y=this.getStyle("stroke-dasharray"),_=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(e.lineCap=p.getString()),g.hasValue()&&(e.lineJoin=g.getString()),m.hasValue()&&(e.miterLimit=m.getNumber()),y.hasValue()&&y.getString()!=="none"){var x=xv(y.getString());typeof e.setLineDash<"u"?e.setLineDash(x):typeof e.webkitLineDash<"u"?e.webkitLineDash=x:typeof e.mozDash<"u"&&!(x.length===1&&x[0]===0)&&(e.mozDash=x);var S=_.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=S:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=S:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=S)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var w=this.getStyle("font"),b=this.getStyle("font-style"),E=this.getStyle("font-variant"),T=this.getStyle("font-weight"),C=this.getStyle("font-size"),A=this.getStyle("font-family"),M=new Lf(b.getString(),E.getString(),T.getString(),C.hasValue()?"".concat(C.getPixels(!0),"px"):"",A.getString(),Lf.parse(w.getString(),e.font));b.setValue(M.fontStyle),E.setValue(M.fontVariant),T.setValue(M.fontWeight),C.setValue(M.fontSize),A.setValue(M.fontFamily),e.font=M.toString(),C.isPixels()&&(this.document.emSize=C.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class ns extends _T{constructor(e,t,r){super(e,t,r),this.type="path",this.pathParser=null,this.pathParser=new Wi(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,r=new H0;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case Wi.MOVE_TO:this.pathM(e,r);break;case Wi.LINE_TO:this.pathL(e,r);break;case Wi.HORIZ_LINE_TO:this.pathH(e,r);break;case Wi.VERT_LINE_TO:this.pathV(e,r);break;case Wi.CURVE_TO:this.pathC(e,r);break;case Wi.SMOOTH_CURVE_TO:this.pathS(e,r);break;case Wi.QUAD_TO:this.pathQ(e,r);break;case Wi.SMOOTH_QUAD_TO:this.pathT(e,r);break;case Wi.ARC:this.pathA(e,r);break;case Wi.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),r=e.getMarkerAngles(),i=t.map((a,o)=>[a,r[o]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");e.fillStyle!==""&&(t.getString("inherit")!=="inherit"?e.fill(t.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,a=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(a.isUrlDefinition()){var l=a.getDefinition(),[u,h]=r[0];l.render(e,u,h)}if(o.isUrlDefinition())for(var c=o.getDefinition(),f=1;f<i;f++){var[d,v]=r[f];c.render(e,d,v)}if(s.isUrlDefinition()){var p=s.getDefinition(),[g,m]=r[i];p.render(e,g,m)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(e,t){var{pathParser:r}=this,{point:i}=ns.pathM(r),{x:a,y:o}=i;r.addMarker(i),t.addPoint(a,o),e&&e.moveTo(a,o)}static pathL(e){var{current:t}=e,r=e.getAsCurrentPoint();return{current:t,point:r}}pathL(e,t){var{pathParser:r}=this,{current:i,point:a}=ns.pathL(r),{x:o,y:s}=a;r.addMarker(a,i),t.addPoint(o,s),e&&e.lineTo(o,s)}static pathH(e){var{current:t,command:r}=e,i=new su((r.relative?t.x:0)+r.x,t.y);return e.current=i,{current:t,point:i}}pathH(e,t){var{pathParser:r}=this,{current:i,point:a}=ns.pathH(r),{x:o,y:s}=a;r.addMarker(a,i),t.addPoint(o,s),e&&e.lineTo(o,s)}static pathV(e){var{current:t,command:r}=e,i=new su(t.x,(r.relative?t.y:0)+r.y);return e.current=i,{current:t,point:i}}pathV(e,t){var{pathParser:r}=this,{current:i,point:a}=ns.pathV(r),{x:o,y:s}=a;r.addMarker(a,i),t.addPoint(o,s),e&&e.lineTo(o,s)}static pathC(e){var{current:t}=e,r=e.getPoint("x1","y1"),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:r,controlPoint:i,currentPoint:a}}pathC(e,t){var{pathParser:r}=this,{current:i,point:a,controlPoint:o,currentPoint:s}=ns.pathC(r);r.addMarker(s,o,a),t.addBezierCurve(i.x,i.y,a.x,a.y,o.x,o.y,s.x,s.y),e&&e.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y)}static pathS(e){var{current:t}=e,r=e.getReflectedControlPoint(),i=e.getAsControlPoint("x2","y2"),a=e.getAsCurrentPoint();return{current:t,point:r,controlPoint:i,currentPoint:a}}pathS(e,t){var{pathParser:r}=this,{current:i,point:a,controlPoint:o,currentPoint:s}=ns.pathS(r);r.addMarker(s,o,a),t.addBezierCurve(i.x,i.y,a.x,a.y,o.x,o.y,s.x,s.y),e&&e.bezierCurveTo(a.x,a.y,o.x,o.y,s.x,s.y)}static pathQ(e){var{current:t}=e,r=e.getAsControlPoint("x1","y1"),i=e.getAsCurrentPoint();return{current:t,controlPoint:r,currentPoint:i}}pathQ(e,t){var{pathParser:r}=this,{current:i,controlPoint:a,currentPoint:o}=ns.pathQ(r);r.addMarker(o,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,o.x,o.y),e&&e.quadraticCurveTo(a.x,a.y,o.x,o.y)}static pathT(e){var{current:t}=e,r=e.getReflectedControlPoint();e.control=r;var i=e.getAsCurrentPoint();return{current:t,controlPoint:r,currentPoint:i}}pathT(e,t){var{pathParser:r}=this,{current:i,controlPoint:a,currentPoint:o}=ns.pathT(r);r.addMarker(o,a,a),t.addQuadraticCurve(i.x,i.y,a.x,a.y,o.x,o.y),e&&e.quadraticCurveTo(a.x,a.y,o.x,o.y)}static pathA(e){var{current:t,command:r}=e,{rX:i,rY:a,xRot:o,lArcFlag:s,sweepFlag:l}=r,u=o*(Math.PI/180),h=e.getAsCurrentPoint(),c=new su(Math.cos(u)*(t.x-h.x)/2+Math.sin(u)*(t.y-h.y)/2,-Math.sin(u)*(t.x-h.x)/2+Math.cos(u)*(t.y-h.y)/2),f=Math.pow(c.x,2)/Math.pow(i,2)+Math.pow(c.y,2)/Math.pow(a,2);f>1&&(i*=Math.sqrt(f),a*=Math.sqrt(f));var d=(s===l?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(a,2)-Math.pow(i,2)*Math.pow(c.y,2)-Math.pow(a,2)*Math.pow(c.x,2))/(Math.pow(i,2)*Math.pow(c.y,2)+Math.pow(a,2)*Math.pow(c.x,2)));isNaN(d)&&(d=0);var v=new su(d*i*c.y/a,d*-a*c.x/i),p=new su((t.x+h.x)/2+Math.cos(u)*v.x-Math.sin(u)*v.y,(t.y+h.y)/2+Math.sin(u)*v.x+Math.cos(u)*v.y),g=MAe([1,0],[(c.x-v.x)/i,(c.y-v.y)/a]),m=[(c.x-v.x)/i,(c.y-v.y)/a],y=[(-c.x-v.x)/i,(-c.y-v.y)/a],_=MAe(m,y);return ore(m,y)<=-1&&(_=Math.PI),ore(m,y)>=1&&(_=0),{currentPoint:h,rX:i,rY:a,sweepFlag:l,xAxisRotation:u,centp:p,a1:g,ad:_}}pathA(e,t){var{pathParser:r}=this,{currentPoint:i,rX:a,rY:o,sweepFlag:s,xAxisRotation:l,centp:u,a1:h,ad:c}=ns.pathA(r),f=1-s?1:-1,d=h+f*(c/2),v=new su(u.x+a*Math.cos(d),u.y+o*Math.sin(d));if(r.addMarkerAngle(v,d-f*Math.PI/2),r.addMarkerAngle(i,d-f*Math.PI),t.addPoint(i.x,i.y),e&&!isNaN(h)&&!isNaN(c)){var p=a>o?a:o,g=a>o?1:a/o,m=a>o?o/a:1;e.translate(u.x,u.y),e.rotate(l),e.scale(g,m),e.arc(0,0,p,h,h+c,Boolean(1-s)),e.scale(1/g,1/m),e.rotate(-l),e.translate(-u.x,-u.y)}}static pathZ(e){e.current=e.start}pathZ(e,t){ns.pathZ(this.pathParser),e&&t.x1!==t.x2&&t.y1!==t.y2&&e.closePath()}}class rqe extends ns{constructor(e,t,r){super(e,t,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class rw extends _T{constructor(e,t,r){super(e,t,new.target===rw?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach((r,i)=>{var a=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(a):t=a}),t}getFontSize(){var{document:e,parent:t}=this,r=Lf.parse(e.ctx.font).fontSize,i=t.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var t=this.getFontSize();return new H0(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,r){var i=t[r],a=null;if(e.isArabic){var o=t.length,s=t[r-1],l=t[r+1],u="isolated";if((r===0||s===" ")&&r<o-1&&l!==" "&&(u="terminal"),r>0&&s!==" "&&r<o-1&&l!==" "&&(u="medial"),r>0&&s!==" "&&(r===o-1||l===" ")&&(u="initial"),typeof e.glyphs[i]<"u"){var h=e.glyphs[i];a=h instanceof rqe?h:h[u]}}else a=e.glyphs[i];return a||(a=e.missingGlyph),a}getText(){return""}getTextFromNode(e){var t=e||this.node,r=Array.from(t.parentNode.childNodes),i=r.indexOf(t),a=r.length-1,o=sL(t.textContent||"");return i===0&&(o=SIr(o)),i===a&&(o=wIr(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:t,parent:r}=this,i=this.getText(),a=r.getStyle("font-family").getDefinition();if(a){for(var{unitsPerEm:o}=a.fontFace,s=Lf.parse(t.ctx.font),l=r.getStyle("font-size").getNumber(s.fontSize),u=r.getStyle("font-style").getString(s.fontStyle),h=l/o,c=a.isRTL?i.split("").reverse().join(""):i,f=xv(r.getAttribute("dx").getString()),d=c.length,v=0;v<d;v++){var p=this.getGlyph(a,c,v);e.translate(this.x,this.y),e.scale(h,-h);var g=e.lineWidth;e.lineWidth=e.lineWidth*o/l,u==="italic"&&e.transform(1,0,.4,1,0,0),p.render(e),u==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=g,e.scale(1/h,-1/h),e.translate(-this.x,-this.y),this.x+=l*(p.horizAdvX||a.horizAdvX)/o,typeof f[v]<"u"&&!isNaN(f[v])&&(this.x+=f[v])}return}var{x:m,y}=this;e.fillStyle&&e.fillText(i,m,y),e.strokeStyle&&e.strokeText(i,m,y)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),r=!1,i=0;t==="start"&&!r||t==="end"&&r?i=e.x-this.minX:t==="end"&&!r||t==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var a=this.textChunkStart;a<this.leafTexts.length;a++)this.leafTexts[a].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((t,r)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,r,i){var a=r.children[i];a.children.length>0?a.children.forEach((o,s)=>{t.adjustChildCoordinatesRecursiveCore(e,t,a,s)}):this.adjustChildCoordinates(e,t,r,i)}adjustChildCoordinates(e,t,r,i){var a=r.children[i];if(typeof a.measureText!="function")return a;e.save(),a.setContext(e,!0);var o=a.getAttribute("x"),s=a.getAttribute("y"),l=a.getAttribute("dx"),u=a.getAttribute("dy"),h=a.getStyle("font-family").getDefinition(),c=Boolean(h)&&h.isRTL;i===0&&(o.hasValue()||o.setValue(a.getInheritedAttribute("x")),s.hasValue()||s.setValue(a.getInheritedAttribute("y")),l.hasValue()||l.setValue(a.getInheritedAttribute("dx")),u.hasValue()||u.setValue(a.getInheritedAttribute("dy")));var f=a.measureText(e);return c&&(t.x-=f),o.hasValue()?(t.applyAnchoring(),a.x=o.getPixels("x"),l.hasValue()&&(a.x+=l.getPixels("x"))):(l.hasValue()&&(t.x+=l.getPixels("x")),a.x=t.x),t.x=a.x,c||(t.x+=f),s.hasValue()?(a.y=s.getPixels("y"),u.hasValue()&&(a.y+=u.getPixels("y"))):(u.hasValue()&&(t.y+=u.getPixels("y")),a.y=t.y),t.y=a.y,t.leafTexts.push(a),t.minX=Math.min(t.minX,a.x,a.x+f),t.maxX=Math.max(t.maxX,a.x,a.x+f),a.clearContext(e),e.restore(),a}getChildBoundingBox(e,t,r,i){var a=r.children[i];if(typeof a.getBoundingBox!="function")return null;var o=a.getBoundingBox(e);return o?(a.children.forEach((s,l)=>{var u=t.getChildBoundingBox(e,t,a,l);o.addBoundingBox(u)}),o):null}renderChild(e,t,r,i){var a=r.children[i];a.render(e),a.children.forEach((o,s)=>{t.renderChild(e,t,a,s)})}measureText(e){var{measureCache:t}=this;if(~t)return t;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var a=this.getFontSize(),o=i.isRTL?t.split("").reverse().join(""):t,s=xv(r.getAttribute("dx").getString()),l=o.length,u=0,h=0;h<l;h++){var c=this.getGlyph(i,o,h);u+=(c.horizAdvX||i.horizAdvX)*a/i.fontFace.unitsPerEm,typeof s[h]<"u"&&!isNaN(s[h])&&(u+=s[h])}return u}if(!e.measureText)return t.length*10;e.save(),this.setContext(e,!0);var{width:f}=e.measureText(t);return this.clearContext(e),e.restore(),f}getInheritedAttribute(e){for(var t=this;t instanceof rw&&t.isFirstChild();){var r=t.parent.getAttribute(e);if(r.hasValue(!0))return r.getValue("0");t=t.parent}return null}}class i$ extends rw{constructor(e,t,r){super(e,t,new.target===i$?!0:r),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class ZIr extends i${constructor(){super(...arguments),this.type="textNode"}}class Dk extends _T{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:r}=this,{screen:i,window:a}=r,o=e.canvas;if(i.setDefaults(e),o.style&&typeof e.font<"u"&&a&&typeof a.getComputedStyle<"u"){e.font=a.getComputedStyle(o).getPropertyValue("font");var s=new jn(r,"fontSize",Lf.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:l,height:u}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var h=this.getAttribute("refX"),c=this.getAttribute("refY"),f=this.getAttribute("viewBox"),d=f.hasValue()?xv(f.getString()):null,v=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",p=0,g=0,m=0,y=0;d&&(p=d[0],g=d[1]),this.root||(l=this.getStyle("width").getPixels("x"),u=this.getStyle("height").getPixels("y"),this.type==="marker"&&(m=p,y=g,p=0,g=0)),i.viewPort.setCurrent(l,u),this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),d&&(l=d[2],u=d[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:l,height:i.viewPort.height,desiredHeight:u,minX:p,minY:g,refX:h.getValue(),refY:c.getValue(),clip:v,clipX:m,clipY:y}),d&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(l,u))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),a=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),l=i.getNumber(0),u=a.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),a.setValue(t),o.hasValue()||o.setValue("0 0 ".concat(l||e," ").concat(u||t)),s.hasValue()){var c=this.getStyle("width"),f=this.getStyle("height");c.hasValue()&&c.setValue("".concat(e,"px")),f.hasValue()&&f.setValue("".concat(t,"px"))}}}class nqe extends ns{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),a=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),l=o.getPixels("x"),u=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(u=l),s.hasValue()&&!o.hasValue()&&(l=u),l=Math.min(l,i/2),u=Math.min(u,a/2),e){var h=4*((Math.sqrt(2)-1)/3);e.beginPath(),a>0&&i>0&&(e.moveTo(t+l,r),e.lineTo(t+i-l,r),e.bezierCurveTo(t+i-l+h*l,r,t+i,r+u-h*u,t+i,r+u),e.lineTo(t+i,r+a-u),e.bezierCurveTo(t+i,r+a-u+h*u,t+i-l+h*l,r+a,t+i-l,r+a),e.lineTo(t+l,r+a),e.bezierCurveTo(t+l-h*l,r+a,t,r+a-u+h*u,t,r+a-u),e.lineTo(t,r+u),e.bezierCurveTo(t,r+u-h*u,t+l-h*l,r,t+l,r),e.closePath())}return new H0(t,r,t+i,r+a)}getMarkers(){return null}}class KIr extends ns{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,r,i,0,Math.PI*2,!1),e.closePath()),new H0(t-i,r-i,t+i,r+i)}getMarkers(){return null}}class JIr extends ns{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(a+r,o),e.bezierCurveTo(a+r,o+t*i,a+t*r,o+i,a,o+i),e.bezierCurveTo(a-t*r,o+i,a-r,o+t*i,a-r,o),e.bezierCurveTo(a-r,o-t*i,a-t*r,o-i,a,o-i),e.bezierCurveTo(a+t*r,o-i,a+r,o-t*i,a+r,o),e.closePath()),new H0(a-r,o-i,a+r,o+i)}getMarkers(){return null}}class QIr extends ns{constructor(){super(...arguments),this.type="line"}getPoints(){return[new su(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new su(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:r},{x:i,y:a}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,r),e.lineTo(i,a)),new H0(t,r,i,a)}getMarkers(){var[e,t]=this.getPoints(),r=e.angleTo(t);return[[e,r],[t,r]]}}class iqe extends ns{constructor(e,t,r){super(e,t,r),this.type="polyline",this.points=[],this.points=su.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:r,y:i}]=t,a=new H0(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach(o=>{var{x:s,y:l}=o;a.addPoint(s,l),e&&e.lineTo(s,l)}),a}getMarkers(){var{points:e}=this,t=e.length-1,r=[];return e.forEach((i,a)=>{a!==t&&r.push([i,i.angleTo(e[a+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class eLr extends iqe{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),t}}class tLr extends il{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,r){var i=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),o=new Dk(this.document,null);o.attributes.viewBox=new jn(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new jn(this.document,"width","".concat(i,"px")),o.attributes.height=new jn(this.document,"height","".concat(a,"px")),o.attributes.transform=new jn(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(i,a),l=s.getContext("2d"),u=this.getAttribute("x"),h=this.getAttribute("y");u.hasValue()&&h.hasValue()&&l.translate(u.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var f=-1;f<=1;f++)l.save(),o.attributes.x=new jn(this.document,"x",c*s.width),o.attributes.y=new jn(this.document,"y",f*s.height),o.render(l),l.restore();var d=e.createPattern(s,"repeat");return d}}class rLr extends il{constructor(){super(...arguments),this.type="marker"}render(e,t,r){if(!!t){var{x:i,y:a}=t,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,a),o==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var l=new Dk(this.document,null);l.type=this.type,l.attributes.viewBox=new jn(this.document,"viewBox",this.getAttribute("viewBox").getValue()),l.attributes.refX=new jn(this.document,"refX",this.getAttribute("refX").getValue()),l.attributes.refY=new jn(this.document,"refY",this.getAttribute("refY").getValue()),l.attributes.width=new jn(this.document,"width",this.getAttribute("markerWidth").getValue()),l.attributes.height=new jn(this.document,"height",this.getAttribute("markerHeight").getValue()),l.attributes.overflow=new jn(this.document,"overflow",this.getAttribute("overflow").getValue()),l.attributes.fill=new jn(this.document,"fill",this.getAttribute("fill").getColor("black")),l.attributes.stroke=new jn(this.document,"stroke",this.getAttribute("stroke").getValue("none")),l.children=this.children,l.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-r),e.translate(-i,-a)}}}class nLr extends il{constructor(){super(...arguments),this.type="defs"}render(){}}class ohe extends _T{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new H0;return this.children.forEach(r=>{t.addBoundingBox(r.getBoundingBox(e))}),t}}class aqe extends il{constructor(e,t,r){super(e,t,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:a}=this;a.forEach(o=>{o.type==="stop"&&i.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:a}=i,o=this.getGradient(e,t);if(!o)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach(g=>{o.addColorStop(g.offset,this.addParentOpacity(r,g.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:l,viewPort:u}=s.screen,[h]=u.viewPorts,c=new nqe(s,null);c.attributes.x=new jn(s,"x",-l/3),c.attributes.y=new jn(s,"y",-l/3),c.attributes.width=new jn(s,"width",l),c.attributes.height=new jn(s,"height",l);var f=new ohe(s,null);f.attributes.transform=new jn(s,"transform",this.getAttribute("gradientTransform").getValue()),f.children=[c];var d=new Dk(s,null);d.attributes.x=new jn(s,"x",0),d.attributes.y=new jn(s,"y",0),d.attributes.width=new jn(s,"width",h.width),d.attributes.height=new jn(s,"height",h.height),d.children=[f];var v=s.createCanvas(h.width,h.height),p=v.getContext("2d");return p.fillStyle=o,d.render(p),p.createPattern(v,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())})}addParentOpacity(e,t){if(e.hasValue()){var r=new jn(this.document,"color",t);return r.addOpacity(e).getColor()}return t}}class iLr extends aqe{constructor(e,t,r){super(e,t,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=r?t.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),l=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===s&&o===l?null:e.createLinearGradient(a,o,s,l)}}class aLr extends aqe{constructor(e,t,r){super(e,t,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var r=this.getGradientUnits()==="objectBoundingBox",i=t.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=a,l=o;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(l=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,l,h,a,o,u)}}class oLr extends il{constructor(e,t,r){super(e,t,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),a=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),a.hasValue()&&(o=o.addOpacity(a)),this.offset=i,this.color=o.getColor()}}class she extends il{constructor(e,t,r){super(e,t,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new jn(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:r,to:i}=this.getProgress(),a=r.getNumber()+(i.getNumber()-r.getNumber())*t;return e==="%"&&(a*=100),"".concat(a).concat(e)}update(e){var{parent:t}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var a=!1;if(this.begin<this.duration){var o=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var l=s.getString();o="".concat(l,"(").concat(o,")")}r.setValue(o),a=!0}return a}getProgress(){var{document:e,values:t}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var i=r.progress*(t.getValue().length-1),a=Math.floor(i),o=Math.ceil(i);r.from=new jn(e,"from",parseFloat(t.getValue()[a])),r.to=new jn(e,"to",parseFloat(t.getValue()[o])),r.progress=(i-a)/(o-a)}else r.from=this.from,r.to=this.to;return r}}class sLr extends she{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:r}=this.getProgress(),i=new nre(t.getColor()),a=new nre(r.getColor());if(i.ok&&a.ok){var o=i.r+(a.r-i.r)*e,s=i.g+(a.g-i.g)*e,l=i.b+(a.b-i.b)*e;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(s),", ").concat(Math.floor(l),")")}return this.getAttribute("from").getColor()}}class lLr extends she{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:r}=this.getProgress(),i=xv(t.getString()),a=xv(r.getString()),o=i.map((s,l)=>{var u=a[l];return s+(u-s)*e}).join(" ");return o}}class uLr extends il{constructor(e,t,r){super(e,t,r),this.type="font",this.glyphs={},this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:a}=this;for(var o of a)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var l=o;l.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[l.unicode]>"u"&&(this.glyphs[l.unicode]={}),this.glyphs[l.unicode][l.arabicForm]=l):this.glyphs[l.unicode]=l;break}}}render(){}}class hLr extends il{constructor(e,t,r){super(e,t,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class cLr extends ns{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class fLr extends rw{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}}class dLr extends rw{constructor(e,t,r){super(e,t,r),this.type="a";var{childNodes:i}=t,a=i[0],o=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(a):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:r,y:i}=this,{mouse:a}=t.screen,o=new jn(t,"fontSize",Lf.parse(t.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new H0(r,i-o.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new ohe(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function kAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function T6(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kAe(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kAe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class vLr extends rw{constructor(e,t,r){super(e,t,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach(r=>{var{type:i,points:a}=r;switch(i){case Wi.LINE_TO:e&&e.lineTo(a[0],a[1]);break;case Wi.MOVE_TO:e&&e.moveTo(a[0],a[1]);break;case Wi.CURVE_TO:e&&e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case Wi.QUAD_TO:e&&e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case Wi.ARC:{var[o,s,l,u,h,c,f,d]=a,v=l>u?l:u,p=l>u?1:l/u,g=l>u?u/l:1;e&&(e.translate(o,s),e.rotate(f),e.scale(p,g),e.arc(0,0,v,h,h+c,Boolean(1-d)),e.scale(1/p,1/g),e.rotate(-f),e.translate(-o,-s));break}case Wi.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,a=e.fillStyle;t==="underline"&&e.beginPath(),i.forEach((o,s)=>{var{p0:l,p1:u,rotation:h,text:c}=o;e.save(),e.translate(l.x,l.y),e.rotate(h),e.fillStyle&&e.fillText(c,0,0),e.strokeStyle&&e.strokeText(c,0,0),e.restore(),t==="underline"&&(s===0&&e.moveTo(l.x,l.y+r/8),e.lineTo(u.x,u.y+r/5))}),t==="underline"&&(e.lineWidth=r/20,e.strokeStyle=a,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,r,i,a,o,s,l,u){var h=o,c=this.measureText(e,l);l===" "&&t==="justify"&&r<i&&(c+=(i-r)/a),u>-1&&(h+=this.getLetterSpacingAt(u));var f=this.textHeight/20,d=this.getEquidistantPointOnPath(h,f,0),v=this.getEquidistantPointOnPath(h+c,f,0),p={p0:d,p1:v},g=d&&v?Math.atan2(v.y-d.y,v.x-d.x):0;if(s){var m=Math.cos(Math.PI/2+g)*s,y=Math.cos(-g)*s;p.p0=T6(T6({},d),{},{x:d.x+m,y:d.y+y}),p.p1=T6(T6({},v),{},{x:v.x+m,y:v.y+y})}return h+=c,{offset:h,segment:p,rotation:g}}measureText(e,t){var{measuresCache:r}=this,i=t||this.getText();if(r.has(i))return r.get(i);var a=this.measureTargetText(e,i);return r.set(i,a),a}setTextData(e){if(!this.glyphInfo){var t=this.getText(),r=t.split(""),i=t.split(" ").length-1,a=this.parent.getAttribute("dx").split().map(x=>x.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),l=this.getStyle("letter-spacing"),u=this.parent.getStyle("letter-spacing"),h=0;!l.hasValue()||l.getValue()==="inherit"?h=u.getPixels():l.hasValue()&&l.getValue()!=="initial"&&l.getValue()!=="unset"&&(h=l.getPixels());var c=[],f=t.length;this.letterSpacingCache=c;for(var d=0;d<f;d++)c.push(typeof a[d]<"u"?a[d]:h);var v=c.reduce((x,S,w)=>w===0?0:x+S||0,0),p=this.measureText(e),g=Math.max(p+v,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var m=this.getPathLength(),y=this.getStyle("startOffset").getNumber(0)*m,_=0;(s==="middle"||s==="center")&&(_=-g/2),(s==="end"||s==="right")&&(_=-g),_+=y,r.forEach((x,S)=>{var{offset:w,segment:b,rotation:E}=this.findSegmentToFitChar(e,s,g,m,i,_,o,x,S);_=w,!(!b.p0||!b.p1)&&this.glyphInfo.push({text:r[S],p0:b.p0,p1:b.p1,rotation:E})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,a=i?i.x:0,o=i?i.y:0,s=r.next(),l=s.type,u=[];switch(s.type){case Wi.MOVE_TO:this.pathM(r,u);break;case Wi.LINE_TO:l=this.pathL(r,u);break;case Wi.HORIZ_LINE_TO:l=this.pathH(r,u);break;case Wi.VERT_LINE_TO:l=this.pathV(r,u);break;case Wi.CURVE_TO:this.pathC(r,u);break;case Wi.SMOOTH_CURVE_TO:l=this.pathS(r,u);break;case Wi.QUAD_TO:this.pathQ(r,u);break;case Wi.SMOOTH_QUAD_TO:l=this.pathT(r,u);break;case Wi.ARC:u=this.pathA(r);break;case Wi.CLOSE_PATH:ns.pathZ(r);break}s.type!==Wi.CLOSE_PATH?t.push({type:l,points:u,start:{x:a,y:o},pathLength:this.calcLength(a,o,l,u)}):t.push({type:Wi.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:r,y:i}=ns.pathM(e).point;t.push(r,i)}pathL(e,t){var{x:r,y:i}=ns.pathL(e).point;return t.push(r,i),Wi.LINE_TO}pathH(e,t){var{x:r,y:i}=ns.pathH(e).point;return t.push(r,i),Wi.LINE_TO}pathV(e,t){var{x:r,y:i}=ns.pathV(e).point;return t.push(r,i),Wi.LINE_TO}pathC(e,t){var{point:r,controlPoint:i,currentPoint:a}=ns.pathC(e);t.push(r.x,r.y,i.x,i.y,a.x,a.y)}pathS(e,t){var{point:r,controlPoint:i,currentPoint:a}=ns.pathS(e);return t.push(r.x,r.y,i.x,i.y,a.x,a.y),Wi.CURVE_TO}pathQ(e,t){var{controlPoint:r,currentPoint:i}=ns.pathQ(e);t.push(r.x,r.y,i.x,i.y)}pathT(e,t){var{controlPoint:r,currentPoint:i}=ns.pathT(e);return t.push(r.x,r.y,i.x,i.y),Wi.QUAD_TO}pathA(e){var{rX:t,rY:r,sweepFlag:i,xAxisRotation:a,centp:o,a1:s,ad:l}=ns.pathA(e);return i===0&&l>0&&(l-=2*Math.PI),i===1&&l<0&&(l+=2*Math.PI),[o.x,o.y,t,r,s,l,a,i]}calcLength(e,t,r,i){var a=0,o=null,s=null,l=0;switch(r){case Wi.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case Wi.CURVE_TO:for(a=0,o=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=this.getPointOnCubicBezier(l,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case Wi.QUAD_TO:for(a=0,o=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=this.getPointOnQuadraticBezier(l,e,t,i[0],i[1],i[2],i[3]),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return a;case Wi.ARC:{a=0;var u=i[4],h=i[5],c=i[4]+h,f=Math.PI/180;if(Math.abs(u-c)<f&&(f=Math.abs(u-c)),o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),h<0)for(l=u-f;l>c;l-=f)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(l=u+f;l<c;l+=f)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),a+=this.getLineLength(o.x,o.y,s.x,s.y),a}}return 0}getPointOnLine(e,t,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,l=(a-r)/(i-t+tM),u=Math.sqrt(e*e/(1+l*l));i<t&&(u*=-1);var h=l*u,c=null;if(i===t)c={x:o,y:s+h};else if((s-r)/(o-t+tM)===l)c={x:o+u,y:s+h};else{var f=0,d=0,v=this.getLineLength(t,r,i,a);if(v<tM)return null;var p=(o-t)*(i-t)+(s-r)*(a-r);p/=v*v,f=t+p*(i-t),d=r+p*(a-r);var g=this.getLineLength(o,s,f,d),m=Math.sqrt(e*e-g*g);u=Math.sqrt(m*m/(1+l*l)),i<t&&(u*=-1),h=l*u,c={x:f+u,y:d+h}}return c}getPointOnPath(e){var t=this.getPathLength(),r=0,i=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:a}=this;for(var o of a){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5<e)){r+=o.pathLength;continue}var s=e-r,l=0;switch(o.type){case Wi.LINE_TO:i=this.getPointOnLine(s,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case Wi.ARC:{var u=o.points[4],h=o.points[5],c=o.points[4]+h;if(l=u+s/o.pathLength*h,h<0&&l<c||h>=0&&l>c)break;i=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],l,o.points[6]);break}case Wi.CURVE_TO:l=s/o.pathLength,l>1&&(l=1),i=this.getPointOnCubicBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case Wi.QUAD_TO:l=s/o.pathLength,l>1&&(l=1),i=this.getPointOnQuadraticBezier(l,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(i)return i;break}return null}getLineLength(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,t)=>t.pathLength>0?e+t.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,t,r,i,a,o,s,l,u){var h=l*IAe(e)+o*LAe(e)+i*PAe(e)+t*OAe(e),c=u*IAe(e)+s*LAe(e)+a*PAe(e)+r*OAe(e);return{x:h,y:c}}getPointOnQuadraticBezier(e,t,r,i,a,o,s){var l=o*RAe(e)+i*DAe(e)+t*NAe(e),u=s*RAe(e)+a*DAe(e)+r*NAe(e);return{x:l,y:u}}getPointOnEllipticalArc(e,t,r,i,a,o){var s=Math.cos(o),l=Math.sin(o),u={x:r*Math.cos(a),y:i*Math.sin(a)};return{x:e+(u.x*s-u.y*l),y:t+(u.x*l+u.y*s)}}buildEquidistantCache(e,t){var r=this.getPathLength(),i=t||.25,a=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==i){this.equidistantCache={step:a,precision:i,points:[]};for(var o=0,s=0;s<=r;s+=i){var l=this.getPointOnPath(s),u=this.getPointOnPath(s+i);!l||!u||(o+=this.getLineLength(l.x,l.y,u.x,u.y),o>=a&&(this.equidistantCache.points.push({x:l.x,y:l.y,distance:s}),o-=a))}}}getEquidistantPointOnPath(e,t,r){if(this.buildEquidistantCache(t,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var pLr=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class gLr extends _T{constructor(e,t,r){super(e,t,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(!!i){var a=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),a?this.loadSvg(i):this.loadImage(i),this.isSvg=a}}loadImage(e){var t=this;return Vc(function*(){try{var r=yield t.document.createImage(e);t.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}t.loaded=!0})()}loadSvg(e){var t=this;return Vc(function*(){var r=pLr.exec(e);if(r){var i=r[5];r[4]==="base64"?t.image=atob(i):t.image=decodeURIComponent(i)}else try{var a=yield t.document.fetch(e),o=yield a.text();t.image=o}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}t.loaded=!0})()}renderChildren(e){var{document:t,image:r,loaded:i}=this,a=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!l)){if(e.save(),e.translate(a,o),this.isSvg){var u=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:l});u.document.documentElement.parent=this,u.render()}else{var h=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:h.width,height:l,desiredHeight:h.height}),this.loaded&&(typeof h.complete>"u"||h.complete)&&e.drawImage(h,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new H0(e,t,e+r,t+i)}}class yLr extends _T{constructor(){super(...arguments),this.type="symbol"}render(e){}}class mLr{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var r=this;return Vc(function*(){try{var{document:i}=r,a=yield i.canvg.parser.load(t),o=a.getElementsByTagName("font");Array.from(o).forEach(s=>{var l=i.createElement(s);i.definitions[e]=l})}catch(s){console.error('Error while loading font "'.concat(t,'":'),s)}r.loaded=!0})()}}class oqe extends il{constructor(e,t,r){super(e,t,r),this.type="style";var i=sL(Array.from(t.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),a=i.split("}");a.forEach(o=>{var s=o.trim();if(!!s){var l=s.split("{"),u=l[0].split(","),h=l[1].split(";");u.forEach(c=>{var f=c.trim();if(!!f){var d=e.styles[f]||{};if(h.forEach(g=>{var m=g.indexOf(":"),y=g.substr(0,m).trim(),_=g.substr(m+1,g.length-m).trim();y&&_&&(d[y]=new jn(e,y,_))}),e.styles[f]=d,e.stylesSpecificity[f]=RIr(f),f==="@font-face"){var v=d["font-family"].getString().replace(/"|'/g,""),p=d.src.getString().split(",");p.forEach(g=>{if(g.indexOf('format("svg")')>0){var m=KYe(g);m&&new mLr(e).load(v,m)}})}}})}})}}oqe.parseExternalUrl=KYe;class _Lr extends _T{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new Dk(t,null),i.attributes.viewBox=new jn(t,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new jn(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new jn(t,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new jn(t,"opacity",this.calculateOpacity())),i.type==="svg"){var a=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);a.hasValue()&&(i.attributes.width=new jn(t,"width",a.getString())),o.hasValue()&&(i.attributes.height=new jn(t,"height",o.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return y2.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function C6(n,e,t,r,i,a){return n[t*r*4+e*4+a]}function A6(n,e,t,r,i,a,o){n[t*r*4+e*4+a]=o}function Eu(n,e,t){var r=n[e];return r*t}function l1(n,e,t,r){return e+Math.cos(n)*t+Math.sin(n)*r}class sqe extends il{constructor(e,t,r){super(e,t,r),this.type="feColorMatrix";var i=xv(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var a=i[0];i=[.213+.787*a,.715-.715*a,.072-.072*a,0,0,.213-.213*a,.715+.285*a,.072-.072*a,0,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=i[0]*Math.PI/180;i=[l1(o,.213,.787,-.213),l1(o,.715,-.715,-.715),l1(o,.072,-.072,.928),0,0,l1(o,.213,-.213,.143),l1(o,.715,.285,.14),l1(o,.072,-.072,-.283),0,0,l1(o,.213,-.213,-.787),l1(o,.715,-.715,.715),l1(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,r,i,a){for(var{includeOpacity:o,matrix:s}=this,l=e.getImageData(0,0,i,a),u=0;u<a;u++)for(var h=0;h<i;h++){var c=C6(l.data,h,u,i,a,0),f=C6(l.data,h,u,i,a,1),d=C6(l.data,h,u,i,a,2),v=C6(l.data,h,u,i,a,3),p=Eu(s,0,c)+Eu(s,1,f)+Eu(s,2,d)+Eu(s,3,v)+Eu(s,4,1),g=Eu(s,5,c)+Eu(s,6,f)+Eu(s,7,d)+Eu(s,8,v)+Eu(s,9,1),m=Eu(s,10,c)+Eu(s,11,f)+Eu(s,12,d)+Eu(s,13,v)+Eu(s,14,1),y=Eu(s,15,c)+Eu(s,16,f)+Eu(s,17,d)+Eu(s,18,v)+Eu(s,19,1);o&&(p=0,g=0,m=0,y*=v/255),A6(l.data,h,u,i,a,0,p),A6(l.data,h,u,i,a,1,g),A6(l.data,h,u,i,a,2,m),A6(l.data,h,u,i,a,3,y)}e.clearRect(0,0,i,a),e.putImageData(l,0,0)}}class a$ extends il{constructor(){super(...arguments),this.type="mask"}apply(e,t){var{document:r}=this,i=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!o&&!s){var l=new H0;this.children.forEach(v=>{l.addBoundingBox(v.getBoundingBox(e))}),i=Math.floor(l.x1),a=Math.floor(l.y1),o=Math.floor(l.width),s=Math.floor(l.height)}var u=this.removeStyles(t,a$.ignoreStyles),h=r.createCanvas(i+o,a+s),c=h.getContext("2d");r.screen.setDefaults(c),this.renderChildren(c),new sqe(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(c,0,0,i+o,a+s);var f=r.createCanvas(i+o,a+s),d=f.getContext("2d");r.screen.setDefaults(d),t.render(d),d.globalCompositeOperation="destination-in",d.fillStyle=c.createPattern(h,"no-repeat"),d.fillRect(0,0,i+o,a+s),e.fillStyle=d.createPattern(f,"no-repeat"),e.fillRect(0,0,i+o,a+s),this.restoreStyles(t,u)}render(e){}}a$.ignoreStyles=["mask","transform","clip-path"];var FAe=()=>{};class xLr extends il{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:a}=e;r&&(r.beginPath=FAe,r.closePath=FAe),Reflect.apply(i,e,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=y2.fromElement(t,o)),s&&s.apply(e),o.path(e),r&&(r.closePath=a),s&&s.unapply(e)}}),Reflect.apply(a,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=a)}render(e){}}class o$ extends il{constructor(){super(...arguments),this.type="filter"}apply(e,t){var{document:r,children:i}=this,a=t.getBoundingBox(e);if(!!a){var o=0,s=0;i.forEach(m=>{var y=m.extraFilterDistance||0;o=Math.max(o,y),s=Math.max(s,y)});var l=Math.floor(a.width),u=Math.floor(a.height),h=l+2*o,c=u+2*s;if(!(h<1||c<1)){var f=Math.floor(a.x),d=Math.floor(a.y),v=this.removeStyles(t,o$.ignoreStyles),p=r.createCanvas(h,c),g=p.getContext("2d");r.screen.setDefaults(g),g.translate(-f+o,-d+s),t.render(g),i.forEach(m=>{typeof m.apply=="function"&&m.apply(g,0,0,h,c)}),e.drawImage(p,0,0,h,c,f-o,d-s,h,c),this.restoreStyles(t,v)}}}render(e){}}o$.ignoreStyles=["filter","transform","clip-path"];class SLr extends il{constructor(e,t,r){super(e,t,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,r,i,a){}}class wLr extends il{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,r,i,a){}}class bLr extends il{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,r,i,a){}}class ELr extends il{constructor(e,t,r){super(e,t,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,r,i,a){var{document:o,blurRadius:s}=this,l=o.window?o.window.document.body:null,u=e.canvas;u.id=o.getUniqueId(),l&&(u.style.display="none",l.appendChild(u)),_Ir(u,t,r,i,a,s),l&&l.removeChild(u)}}class TLr extends il{constructor(){super(...arguments),this.type="title"}}class CLr extends il{constructor(){super(...arguments),this.type="desc"}}var ALr={svg:Dk,rect:nqe,circle:KIr,ellipse:JIr,line:QIr,polyline:iqe,polygon:eLr,path:ns,pattern:tLr,marker:rLr,defs:nLr,linearGradient:iLr,radialGradient:aLr,stop:oLr,animate:she,animateColor:sLr,animateTransform:lLr,font:uLr,"font-face":hLr,"missing-glyph":cLr,glyph:rqe,text:rw,tspan:i$,tref:fLr,a:dLr,textPath:vLr,image:gLr,g:ohe,symbol:yLr,style:oqe,use:_Lr,mask:a$,clipPath:xLr,filter:o$,feDropShadow:SLr,feMorphology:wLr,feComposite:bLr,feColorMatrix:sqe,feGaussianBlur:ELr,title:TLr,desc:CLr};function BAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function MLr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?BAe(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):BAe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ILr(n,e){var t=document.createElement("canvas");return t.width=n,t.height=e,t}function LLr(n){return sre.apply(this,arguments)}function sre(){return sre=Vc(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=document.createElement("img");return e&&(t.crossOrigin="Anonymous"),new Promise((r,i)=>{t.onload=()=>{r(t)},t.onerror=(a,o,s,l,u)=>{i(u)},t.src=n})}),sre.apply(this,arguments)}class TS{constructor(e){var{rootEmSize:t=12,emSize:r=12,createCanvas:i=TS.createCanvas,createImage:a=TS.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=t,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(a,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return typeof t=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(e){var t=e.nodeName.replace(/^[^:]+:/,""),r=TS.elementTypes[t];return typeof r<"u"?new r(this,e):new HIr(this,e)}createTextNode(e){return new ZIr(this,e)}setViewBox(e){this.screen.setViewBox(MLr({document:this},e))}}TS.createCanvas=ILr;TS.createImage=LLr;TS.elementTypes=ALr;function GAe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?GAe(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):GAe(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class bA{constructor(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new zq(r),this.screen=new n$(e,r),this.options=r;var i=new TS(this,r),a=i.createDocumentElement(t);this.document=i,this.documentElement=a}static from(e,t){var r=arguments;return Vc(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},a=new zq(i),o=yield a.parse(t);return new bA(e,o,i)})()}static fromString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new zq(r),a=i.parseFromString(t);return new bA(e,a,r)}fork(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bA.from(e,t,Tb(Tb({},this.options),r))}forkString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return bA.fromString(e,t,Tb(Tb({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return Vc(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};t.start(Tb({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield t.ready(),t.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:t,screen:r,options:i}=this;r.start(t,Tb(Tb({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,t,r)}}var lqe=8,CC=lqe*2;const u1=1e-7;class ts{static getValidStyleFromLayerInfo(e,t,r){var i=t.getGeometry().getType().toUpperCase(),a=e.layerStyle,o=this.getDefaultStyle(i);if((i==="POINT"||i==="MULTIPOINT")&&!t.getProperties().textStyle&&e.type!=="LABEL"&&!t.getProperties().TEXT_FEATURE_CONTENT){if(a){var s={transparent:!0,resourceType:"SYMBOLMARKER",picWidth:Math.ceil(a.markerSize*eE*Ii.mm)||13,picHeight:Math.ceil(a.markerSize*eE*Ii.mm)||13,style:JSON.stringify(a)},l=H.urlAppend(r+"/symbol.png",H.getParameterString(s));return o.pointFile=l,new So({image:new yy({src:o.pointFile})})}return this.toOLPointStyle(o)}else if((i==="POINT"||i==="MULTIPOINT")&&(t.getProperties().textStyle||e.type==="LABEL"||t.getProperties().TEXT_STYLE_INFO)){if(o=this.getDefaultStyle("TEXT"),t.getProperties().textStyle&&(a=t.getProperties().textStyle),t.getProperties().TEXT_STYLE_INFO&&(a=JSON.parse(t.getProperties().TEXT_STYLE_INFO).textStyle),a&&a!=="{}"){var u="";o.fontStyle=a.italic?"italic":"normal",o.fontWeight=a.bold?a.fontWeight:"normal";var h=a.fontHeight*eE*Ii.mm*.85;o.fontSize=h+"px",a.fontName.indexOf("@")?u=a.fontName.replace(/@/g,""):u=a.fontName,o.fontFamily=u,o.textHeight=h;var c=a.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/,"");o.textAlign=c.toLowerCase();var f=a.align.replace(/LEFT|RIGHT|CENTER/,"");f==="BASELINE"&&(f="alphabetic"),o.textBaseline=f.toLowerCase(),o.haloRadius=a.outline?a.outlineWidth:0,o.backColor="rgba("+a.backColor.red+","+a.backColor.green+","+a.backColor.blue+",1)",o.foreColor="rgba("+a.foreColor.red+","+a.foreColor.green+","+a.foreColor.blue+",1)",o.rotation=a.rotation}var d;if(t.getProperties().textStyle&&t.getProperties().texts&&(d=t.getProperties().texts[0]),e.type==="LABEL"){var v=e.textField;if(v&&v.indexOf(".")){var p=v.split(".");v=p&&p.length>0&&p[p.length-1]}d=t.getProperties().attributes?t.getProperties().attributes[v]:t.getProperties()[v]}return t.getProperties().TEXT_FEATURE_CONTENT&&(d=t.getProperties().TEXT_FEATURE_CONTENT),d?this.toOLTextStyle(o,d):this.toOLPointStyle(this.getDefaultStyle("POINT"))}else if(a){var g=a.fillSymbolID>7?0:a.fillSymbolID,m=a.lineSymbolID>5?0:a.lineSymbolID;for(var y in a){var _=UY.ServerStyleMap[y],x=_.canvasStyle;if(x&&x!=""){var S;switch(_.type){case"number":S=a[y],_.unit&&(S=S*eE*Ii[_.unit]*2.5),o[x]=S;break;case"color":var w=a[y],b=a.fillBackColor,E=1;if(x==="fillStyle")if(g===0||g===1)E=1-g,S="rgba("+w.red+","+w.green+","+w.blue+","+E+")";else try{var T=document.createElement("canvas");T.height=8,T.width=8;var C=T.getContext("2d"),A=new Image;this.layer&&this.layer.fillImages&&C.drawImage(this.layer.fillImages["System "+g],0,0);for(var M=C.getImageData(0,0,T.width,T.height),I=M.data,R=0,k=I.length;R<k;R+=4){var D=I[R],G=I[R+1],W=I[R+2];D<225&&G<225&&W<225?(I[R]=w.red,I[R+1]=w.green,I[R+2]=w.blue):b&&(I[R]=b.red,I[R+1]=b.green,I[R+2]=b.blue)}C.putImageData(M,0,0),A.src=T.toDataURL(),this.context&&(S=this.context.createPattern(A,"repeat"))}catch(V){throw Error(V.message)}else if(x==="strokeStyle"){if(m===0||m===5)E=m===0?1:0;else{var z=[1,0];switch(m){case 1:z=[9.7,3.7];break;case 2:z=[3.7,3.7];break;case 3:z=[9.7,3.7,2.3,3.7];break;case 4:z=[9.7,3.7,2.3,3.7,2.3,3.7];break}o.lineDasharray=z}S="rgba("+w.red+","+w.green+","+w.blue+","+E+")"}o[x]=S;break}}}}if(i==="LINESTRING"||i==="MULTILINESTRING")return this.toOLLineStyle(o);if(i==="POLYGON"||i==="MULTIPOLYGON")return this.toOLPolygonStyle(o)}static getStyleFromCarto(e,t,r,i,a,o){var s=i.getGeometry().getType().toUpperCase(),l={},u=this.getDefaultStyle(s);l.FEATUREID=i.getProperties().id,l.SCALE=t;var h=i.getProperties().type==="TEXT"?"TEXT":s,c=UY.CartoStyleMap[h],f,d;if(r)for(var v=0,p=r.length;v<p;v++){var g=r[v],m=c[g.property],y=g.getValue(l,e,!0);if(y!==null&&m)if(m==="fontSize")a&&(y*=.8),f=y+"px",u.fontSize=f;else if(m==="fontName")d=y,u.fontName=d;else{if(m==="globalCompositeOperation"){if(y=UY.CartoCompOpMap[y],!y)continue}else a&&m==="pointFile"&&(y=o+"/tileFeature/symbols/"+y.replace(/(___)/gi,"@"),y=y.replace(/(__0__0__)/gi,"__8__8__"));m==="lineWidth"&&y<1&&(y=Math.ceil(y)),u[m]=y}}if(i.getProperties().type==="TEXT"){var _;if(i.getProperties().texts&&(_=i.getProperties().texts[0]),_==null&&u.textName){var x=u.textName.substring(1,u.textName.length-1);if(_=i.getProperties().attributes?i.getProperties().attributes[x]:i.getProperties()[x],_!=null){var S=i.getProperties().texts||[];S.push(_),i.setProperties({texts:S})}}return this.toOLTextStyle(u,_)}if(s==="POINT"||s==="MULTIPOINT")return this.toOLPointStyle(u);if(s==="LINESTRING"||s==="MULTILINESTRING")return this.toOLLineStyle(u);if(s==="POLYGON"||s==="MULTIPOLYGON")return this.toOLPolygonStyle(u)}static toOLPointStyle(e){return e.pointFile!==""?new So({image:new yy({src:e.pointFile})}):new So({image:new rm({radius:e.pointRadius,fill:new Ko({color:e.fillStyle}),stroke:new es({color:e.pointHaloColor,width:e.pointHaloRadius})})})}static toOLLineStyle(e){return new So({stroke:new es({color:e.strokeStyle,width:e.lineWidth,lineCap:e.lineCap,lineDash:e.lineDasharray,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,miterLimit:e.miterLimit})})}static toOLPolygonStyle(e){var t=new Ko({color:e.fillStyle}),r=new es({color:e.strokeStyle,width:e.lineWidth,lineCap:e.lineCap,lineDash:e.lineDasharray,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,miterLimit:e.miterLimit});return new So({fill:t,stroke:r})}static toOLTextStyle(e,t){return new So({text:new J1({font:(e.fontStyle||"")+" "+(e.fontWeight||"")+" "+(e.fontSize||"")+" "+e.fontFamily,text:t,textAlign:e.textAlign,textBaseline:e.textBaseline,fill:new Ko({color:e.foreColor}),stroke:new es({color:e.backColor}),offsetX:e.offsetX,offsetY:e.offsetY})})}static dashStyle(e,t){if(!e)return[];var r=e.strokeWidth*t,i=e.strokeDashstyle||e.lineDash;switch(i){case"solid":return[0];case"dot":return[1,4*r];case"dash":return[4*r,4*r];case"dashdot":return[4*r,4*r,1,4*r];case"longdash":return[8*r,4*r];case"longdashdot":return[8*r,4*r,1,4*r];default:return i?H.isArray(i)?i:(i=ad.trim(i).replace(/\s+/g,","),i.replace(/\[|\]/gi,"").split(",")):[]}}static getStyleFromiPortalMarker(e){return e.indexOf("./")==0?null:new So({image:new yy({src:e,opacity:1,size:[48,43],anchor:[.5,1]})})}static getStyleFromiPortalStyle(e,t,r){var i=r?JSON.parse(r):null,a=this;if(t==="Point"||t==="MultiPoint"){var o=i||e.pointStyle;return o.externalGraphic?o.externalGraphic.indexOf("./")==0?null:new So({image:new yy({src:o.externalGraphic,opacity:o.graphicOpacity,size:[o.graphicWidth,o.graphicHeight]})}):new So({image:new rm({fill:new Ko({color:a.hexToRgba(o.fillColor,o.fillOpacity)}),stroke:new es({color:a.hexToRgba(o.strokeColor,o.strokeOpacity),lineCap:o.strokeLineCap,lineDash:this.dashStyle(o,1),width:o.strokeWidth}),radius:o.pointRadius})})}if(t==="LineString"||t==="MultiLineString"||t==="Box"){var s=i||e.lineStyle;return new So({stroke:new es({color:a.hexToRgba(s.strokeColor,s.strokeOpacity),lineCap:s.strokeLineCap,lineDash:this.dashStyle(s,1),width:s.strokeWidth})})}if(t==="Polygon"||t==="MultiPolygon"){var l=i||e.polygonStyle;return new So({fill:new Ko({color:a.hexToRgba(l.fillColor,l.fillOpacity)}),stroke:new es({color:a.hexToRgba(l.strokeColor,l.strokeOpacity),lineCap:l.strokeLineCap,lineDash:this.dashStyle(l,1),width:l.strokeWidth})})}}static hexToRgba(e,t){var r=[],i=[];if(e=e.replace(/#/,""),e.length==3){var a=[];for(let o=0;o<3;o++)a.push(e.charAt(o)+e.charAt(o));e=a.join("")}for(let o=0;o<6;o+=2)r[o]="0x"+e.substr(o,2),i.push(parseInt(Number(r[o])));return i.push(t),"rgba("+i.join(",")+")"}static getDefaultStyle(e){var t={},r=Byr[e];for(var i in r){var a=r[i];t[i]=a}return t}static async toOpenLayersStyle(e,t){e=e||this.getDefaultStyle();let r=new So,i,a,o,{fillColor:s,fillOpacity:l,strokeColor:u,strokeWidth:h,strokeOpacity:c,radius:f,lineCap:d,src:v,scale:p,offsetX:g,offsetY:m,anchor:y}=e,_=this.hexToRgb(s);_&&_.push(l);let x=this.hexToRgb(u);if(x&&x.push(c),t==="POINT")v?/.+(\.svg$)/.test(v)?(this.svgDiv||(this.svgDiv=document.createElement("div"),document.body.appendChild(this.svgDiv)),await this.getCanvasFromSVG(v,this.svgDiv,S=>{i=new yy({img:S,scale:f/S.width,imgSize:[S.width,S.height],anchor:[.5,.5]})})):i=new yy({src:v,scale:p,anchor:y}):i=new rm({radius:f,fill:new Ko({color:_}),stroke:new es({width:h||u1,color:x}),displacement:this.getCircleDisplacement(f,g,m)}),r.setImage(i);else if(t==="LINE"||t==="LINESTRING"||t==="MULTILINESTRING"||t==="LINEARRING")o=new es({width:h||u1,color:x,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),r.setStroke(o);else if(t==="POLYGON"||t==="MULTIPOLYGON"||t==="REGION")a=new Ko({color:_}),o=new es({width:h||u1,color:x,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),r.setFill(a),r.setStroke(o);else{let S=this.getCanvas(e);i=new yy({img:S.canvas,imgSize:[S.width,S.height],scale:1,anchor:[.5,.5]}),r.setImage(i)}return r}static getIconAnchor(e=.5,t=.5){return[e,t]}static getCircleDisplacement(e,t=0,r=0){const i=e*t,a=e*r;return[i,-a]}static getTextOffset(e,t=0,r=0){const i=e.substr(0,e.length-2)/2;return{x:i*t,y:i*r}}static getCanvas(e){let t;e.canvas?document.querySelector("#"+e.canvas)?t=document.getElemntById(e.canvas):t=this.createCanvas(e):(t=this.createCanvas(e),e.canvas=t.id),t.style.display="none";var r=t.getContext("2d");let i=Number(e.font.replace(/[^0-9]/ig,"")),a=e.text.split(`\r
`),o=a.length;r.font=e.font;let s=this.drawRect(r,e,a,i,t);return this.positionY=lqe,o>1?a.forEach(function(l,u){u!==0&&(this.positionY=this.positionY+i),this.canvasTextAutoLine(l,e,r,i,s.width)},this):this.canvasTextAutoLine(a[0],e,r,i,s.width),{canvas:t,width:s.width,height:s.height}}static createCanvas(e){let t=document.createElement("div");document.body.appendChild(t);let r=document.createElement("canvas");return r.id=e.canvas?e.canvas:"textCanvas"+br.newGuid(8),t.appendChild(r),r}static drawRect(e,t,r,i,a){let o=t.backgroundFill,s=t.maxWidth-CC,l,u=0,h=0,c=[];return r.forEach(function(f){let d="",v;h++;for(var p=0;p<f.length;p++){let g=d+f[p],y=e.measureText(g).width;y>s&&p>0||f[p]===`
`?(d=f[p],h++,v=!0):(d=g,l=y)}v?c.push(s):c.push(l)},this),l=this.getCanvasWidth(c,s),u=h*i,u+=CC,a.width=l,a.height=u,e.fillStyle=o,e.fillRect(0,0,l,u),{width:l,height:u}}static getCanvasWidth(e,t){let r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a>=t)return t+CC;a>r&&(r=a)}return r+CC}static canvasTextAutoLine(e,t,r,i,a){r.font=t.font;let o=t.textAlign,s=this.getPositionX(o,a),l=e.split(""),u="",h=t.fillColor,c=t.maxWidth-CC;for(var f=0;f<l.length;f++){let d=u+l[f];r.measureText(d).width>c&&f>0||l[f]===`
`?(r.fillStyle=h,r.textAlign=o,r.textBaseline="top",r.fillText(u,s,this.positionY),u=l[f],this.positionY+=i):u=d}r.fillStyle=h,r.textAlign=o,r.textBaseline="top",r.fillText(u,s,this.positionY)}static getPositionX(e,t){let r,i=t-CC;switch(e){case"center":r=i/2;break;case"right":r=i;break;default:r=8;break}return r}static hexToRgb(e){if(!!e){var t=e.replace("#","").split(""),r=[t[0]+t[1],t[2]+t[3],t[4]+t[5]];return r=r.map(function(i){return parseInt(i,16)}),r}}static formatRGB(e){let t;return e.length===3?(t="rgb(",e.forEach(function(r,i){i===2?t+=r:t+=r+","})):(t="rgba(",e.forEach(function(r,i){i===3?t+=r:t+=r+","})),t+=")",t}static async getCanvasFromSVG(e,t,r){const i=window.canvg&&window.canvg.default?window.canvg.default:bA;let a=document.createElement("canvas");a.id="dataviz-canvas-"+br.newGuid(8),a.style.display="none",t.appendChild(a);try{const o=a.getContext("2d");if((await i.from(o,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:()=>!1})).start(),a.width>300||a.height>300)return;r(a)}catch{return}}static stopCanvg(){this.canvgsV.forEach(e=>e.stop()),this.canvgsV=[]}static getMarkerDefaultStyle(e,t){let r;switch(e){case"POINT":r={src:`${t}apps/dataviz/static/imgs/markers/mark_red.png`,scale:1,anchor:[.5,1]};break;case"LINE":case"LINESTRING":case"MULTILINESTRING":r={strokeColor:"#3498db",strokeOpacity:1,strokeWidth:5,lineCap:"round",lineDash:"solid"};break;case"REGION":case"POLYGON":case"MULTIPOLYGON":r={fillColor:"#1abd9c",fillOpacity:1,strokeColor:"#3498db",strokeOpacity:1,strokeWidth:3,lineCap:"round",lineDash:"solid"};break}return r}static async getOpenlayersStyle(e,t,r){let i;return e.type==="BASIC_POINT"?i=await this.toOpenLayersStyle(e,t):e.type==="SYMBOL_POINT"?i=this.getSymbolStyle(e,r):e.type==="SVG_POINT"?i=await this.getSVGStyle(e):e.type==="IMAGE_POINT"&&(i=this.getImageStyle(e)),i}static getSymbolStyle(e,t){let r="";e.unicode&&(r=String.fromCharCode(parseInt(e.unicode.replace(/^&#x/,""),16)));let i=ts.hexToRgb(e.fillColor);i.push(e.fillOpacity);let a=ts.hexToRgb(e.strokeColor);a.push(e.strokeOpacity);let o=t?2*e.radius+"px":e.fontSize;const{offsetX:s,offsetY:l,rotation:u=0}=e,h=ts.getTextOffset(o,s,l);return new So({text:new J1({text:r,font:o+" supermapol-icons",placement:"point",textAlign:"center",fill:new Ko({color:i}),backgroundFill:new Ko({color:[0,0,0,0]}),stroke:new es({width:e.strokeWidth||1e-6,color:a}),offsetX:h.x,offsetY:h.y,rotation:u})})}static async getSVGStyle(e){let t,r=this;r.svgDiv||(r.svgDiv=document.createElement("div"),document.body.appendChild(r.svgDiv));const{url:i,radius:a,offsetX:o,offsetY:s,fillOpacity:l,rotation:u}=e;let h=this.getIconAnchor(o,s);return await ts.getCanvasFromSVG(i,r.svgDiv,function(c){t=new So({image:new yy({img:r.setColorToCanvas(c,e),scale:2*a/c.width,imgSize:[c.width,c.height],anchor:h||[.5,.5],opacity:l,anchorOrigin:"bottom-right",rotation:u})})}),t}static setColorToCanvas(e,t){let r=e.getContext("2d"),i=ts.hexToRgb(t.fillColor);i&&i.push(t.fillOpacity);let a=ts.hexToRgb(t.strokeColor);return a&&a.push(t.strokeOpacity),r.fillStyle=ts.formatRGB(i),r.fill(),r.strokeStyle=ts.formatRGB(a),r.lineWidth=t.strokeWidth,r.stroke(),e}static getImageStyle(e){let t=e.imageInfo.size,r=2*e.radius/t.w,i=e.imageInfo,a=i.img;(!a||!a.src)&&(a=new Image,a.src=i.url);const{offsetX:o,offsetY:s,rotation:l}=e;let u=this.getIconAnchor(o,s);return new So({image:new yy({img:a,scale:r,imgSize:[t.w,t.h],anchor:u||[.5,.5],anchorOrigin:"bottom-right",rotation:l})})}static getRoadPath(e,t){const{strokeWidth:r=u1,lineCap:i,strokeColor:a,strokeOpacity:o}=e;let s=this.hexToRgb(a);s&&s.push(o);var l=new So({stroke:new es({width:r||u1,color:s,lineCap:i||"round",lineDash:[0]})});const{strokeColor:u}=t;let h=this.hexToRgb(u);h&&h.push(o);let c=t.strokeWidth||(r===0?u1:r+2);var f=new So({stroke:new es({width:c,color:h,lineCap:i||"round",lineDash:[0]})});return[f,l]}static getPathway(e,t){let{strokeWidth:r=u1,strokeColor:i,strokeOpacity:a}=e;const o=(d=>[d,d+r*2])(4*r),s="square";let l=this.hexToRgb(i);l&&l.push(a);var u=new So({stroke:new es({width:r*.5||u1,color:l,lineCap:s,lineDash:o})});const{strokeColor:h}=t;let c=this.hexToRgb(h);c&&c.push(a);var f=new So({stroke:new es({width:r||u1,color:c,lineCap:s})});return[f,u]}}var PLr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),OLr=function(n){PLr(e,n);function e(t){var r=n.call(this)||this;return r.map_=t,r}return e.prototype.dispatchRenderEvent=function(t,r){ti()},e.prototype.calculateMatrices2D=function(t){var r=t.viewState,i=t.coordinateToPixelTransform,a=t.pixelToCoordinateTransform;Id(i,t.size[0]/2,t.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),bk(a,i)},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o,s,l,u){var h,c=r.viewState;function f(k,D,G,W){return o.call(s,D,k?G:null,W)}var d=c.projection,v=hue(t.slice(),d),p=[[0,0]];if(d.canWrapX()&&a){var g=d.getExtent(),m=Co(g);p.push([-m,0],[m,0])}for(var y=r.layerStatesArray,_=y.length,x=[],S=[],w=0;w<p.length;w++)for(var b=_-1;b>=0;--b){var E=y[b],T=E.layer;if(T.hasRenderer()&&l7(E,c)&&l.call(u,T)){var C=T.getRenderer(),A=T.getSource();if(C&&A){var M=A.getWrapX()?v:t,I=f.bind(null,E.managed);S[0]=M[0]+p[w][0],S[1]=M[1]+p[w][1],h=C.forEachFeatureAtCoordinate(S,r,i,I,x)}if(h)return h}}if(x.length!==0){var R=1/x.length;return x.forEach(function(k,D){return k.distanceSq+=D*R}),x.sort(function(k,D){return k.distanceSq-D.distanceSq}),x.some(function(k){return h=k.callback(k.feature,k.layer,k.geometry)}),h}},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){return ti()},e.prototype.hasFeatureAtCoordinate=function(t,r,i,a,o,s){var l=this.forEachFeatureAtCoordinate(t,r,i,a,ZA,this,o,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){ti()},e.prototype.scheduleExpireIconCache=function(t){d7.canExpireCache()&&t.postRenderFunctions.push(RLr)},e}(PV);function RLr(n,e){d7.expire()}const DLr=OLr;var NLr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kLr=function(n){NLr(e,n);function e(t){var r=n.call(this,t)||this;r.fontChangeListenerKey_=pa(f1,UM.PROPERTYCHANGE,t.redrawText.bind(t)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=mk+" ol-layers";var a=t.getViewport();return a.insertBefore(r.element_,a.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(t,r){var i=this.getMap();if(i.hasListener(t)){var a=new PR(t,void 0,r);i.dispatchEvent(a)}},e.prototype.disposeInternal=function(){Ms(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),n.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Tf.PRECOMPOSE,t);var r=t.layerStatesArray.sort(function(d,v){return d.zIndex-v.zIndex}),i=t.viewState;this.children_.length=0;for(var a=[],o=null,s=0,l=r.length;s<l;++s){var u=r[s];t.layerIndex=s;var h=u.layer,c=h.getSourceState();if(!l7(u,i)||c!=p2.READY&&c!=p2.UNDEFINED){h.unrender();continue}var f=h.render(t,o);!f||(f!==o&&(this.children_.push(f),o=f),"getDeclutter"in h&&a.push(h))}for(var s=a.length-1;s>=0;--s)a[s].renderDeclutter(t);X0r(this.element_,this.children_),this.dispatchRenderEvent(Tf.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},e.prototype.forEachLayerAtPixel=function(t,r,i,a,o){for(var s=r.viewState,l=r.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var c=l[h],f=c.layer;if(f.hasRenderer()&&l7(c,s)&&o(f)){var d=f.getRenderer(),v=d.getDataAtPixel(t,r,i);if(v){var p=a(f,v);if(p)return p}}}},e}(DLr);const FLr=kLr;var uqe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),$x=function(n){uqe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.layer=r,i}return e}(Fm),Uq={LAYERS:"layers"},BLr=function(n){uqe(e,n);function e(t){var r=this,i=t||{},a=Ao({},i);delete a.layers;var o=i.layers;return r=n.call(this,a)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(Uq.LAYERS,r.handleLayersChanged_),o?Array.isArray(o)?o=new gd(o.slice(),{unique:!0}):ki(typeof o.getArray=="function",43):o=new gd(void 0,{unique:!0}),r.setLayers(o),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Ms),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(pa(t,ud.ADD,this.handleLayersAdd_,this),pa(t,ud.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(Ms);QI(this.listenerKeys_);for(var i=t.getArray(),a=0,o=i.length;a<o;a++){var s=i[a];this.registerLayerListeners_(s),this.dispatchEvent(new $x("addlayer",s))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[pa(t,UM.PROPERTYCHANGE,this.handleLayerChange_,this),pa(t,Ci.CHANGE,this.handleLayerChange_,this)];t instanceof e&&r.push(pa(t,"addlayer",this.handleLayerGroupAdd_,this),pa(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[vi(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new $x("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new $x("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var r=t.element;this.registerLayerListeners_(r),this.dispatchEvent(new $x("addlayer",r)),this.changed()},e.prototype.handleLayersRemove_=function(t){var r=t.element,i=vi(r);this.listenerKeys_[i].forEach(Ms),delete this.listenerKeys_[i],this.dispatchEvent(new $x("removelayer",r)),this.changed()},e.prototype.getLayers=function(){return this.get(Uq.LAYERS)},e.prototype.setLayers=function(t){var r=this.getLayers();if(r)for(var i=r.getArray(),a=0,o=i.length;a<o;++a)this.dispatchEvent(new $x("removelayer",i[a]));this.set(Uq.LAYERS,t)},e.prototype.getLayersArray=function(t){var r=t!==void 0?t:[];return this.getLayers().forEach(function(i){i.getLayersArray(r)}),r},e.prototype.getLayerStatesArray=function(t){var r=t!==void 0?t:[],i=r.length;this.getLayers().forEach(function(h){h.getLayerStatesArray(r)});var a=this.getLayerState(),o=a.zIndex;!t&&a.zIndex===void 0&&(o=0);for(var s=i,l=r.length;s<l;s++){var u=r[s];u.opacity*=a.opacity,u.visible=u.visible&&a.visible,u.maxResolution=Math.min(u.maxResolution,a.maxResolution),u.minResolution=Math.max(u.minResolution,a.minResolution),u.minZoom=Math.max(u.minZoom,a.minZoom),u.maxZoom=Math.min(u.maxZoom,a.maxZoom),a.extent!==void 0&&(u.extent!==void 0?u.extent=tm(u.extent,a.extent):u.extent=a.extent),u.zIndex===void 0&&(u.zIndex=o)}return r},e.prototype.getSourceState=function(){return p2.READY},e}(uXe);const Nk=BLr;var GLr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),zLr=function(n){GLr(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.map=r,a.frameState=i!==void 0?i:null,a}return e}(Fm);const rA=zLr;var ULr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),VLr=function(n){ULr(e,n);function e(t,r,i,a,o){var s=n.call(this,t,r,o)||this;return s.originalEvent=i,s.pixel_=null,s.coordinate_=null,s.dragging=a!==void 0?a:!1,s}return Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){n.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){n.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(rA);const Ox=VLr,Zs={SINGLECLICK:"singleclick",CLICK:Ci.CLICK,DBLCLICK:Ci.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},lre={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var $Lr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),WLr=function(n){$Lr(e,n);function e(t,r){var i=n.call(this,t)||this;i.map_=t,i.clickTimeoutId_,i.emulateClicks_=!1,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=r===void 0?1:r,i.down_=null;var a=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=a,i.pointerdownListenerKey_=pa(a,lre.POINTERDOWN,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=pa(a,lre.POINTERMOVE,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(Ci.TOUCHMOVE,i.boundHandleTouchMove_,Rje?{passive:!1}:!1),i}return e.prototype.emulateClick_=function(t){var r=new Ox(Zs.CLICK,this.map_,t);this.dispatchEvent(r),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,r=new Ox(Zs.DBLCLICK,this.map_,t),this.dispatchEvent(r)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var i=new Ox(Zs.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var r=t;r.type==Zs.POINTERUP||r.type==Zs.POINTERCANCEL?delete this.trackedTouches_[r.pointerId]:r.type==Zs.POINTERDOWN&&(this.trackedTouches_[r.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var r=new Ox(Zs.POINTERUP,this.map_,t);this.dispatchEvent(r),this.emulateClicks_&&!r.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_===0&&(this.dragListenerKeys_.forEach(Ms),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return t.button===0},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=this.activePointers_===0,this.updateActivePointers_(t);var r=new Ox(Zs.POINTERDOWN,this.map_,t);this.dispatchEvent(r),this.down_={};for(var i in t){var a=t[i];this.down_[i]=typeof a=="function"?d2:a}if(this.dragListenerKeys_.length===0){var o=this.map_.getOwnerDocument();this.dragListenerKeys_.push(pa(o,Zs.POINTERMOVE,this.handlePointerMove_,this),pa(o,Zs.POINTERUP,this.handlePointerUp_,this),pa(this.element_,Zs.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==o&&this.dragListenerKeys_.push(pa(this.element_.getRootNode(),Zs.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var r=new Ox(Zs.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(r)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var r=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Ox(t.type,this.map_,t,r))},e.prototype.handleTouchMove_=function(t){var r=this.originalPointerMoveEvent_;(!r||r.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ms(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Ci.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ms(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ms),this.dragListenerKeys_.length=0,this.element_=null,n.prototype.disposeInternal.call(this)},e}(eL);const HLr=WLr,Pc={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var x7=1/0,jLr=function(){function n(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,QI(this.queuedElements_)},n.prototype.dequeue=function(){var e=this.elements_,t=this.priorities_,r=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},n.prototype.enqueue=function(e){ki(!(this.keyFunction_(e)in this.queuedElements_),31);var t=this.priorityFunction_(e);return t!=x7?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(e){return e*2+1},n.prototype.getRightChildIndex_=function(e){return e*2+2},n.prototype.getParentIndex_=function(e){return e-1>>1},n.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},n.prototype.isEmpty=function(){return this.elements_.length===0},n.prototype.isKeyQueued=function(e){return e in this.queuedElements_},n.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},n.prototype.siftUp_=function(e){for(var t=this.elements_,r=this.priorities_,i=t.length,a=t[e],o=r[e],s=e;e<i>>1;){var l=this.getLeftChildIndex_(e),u=this.getRightChildIndex_(e),h=u<i&&r[u]<r[l]?u:l;t[e]=t[h],r[e]=r[h],e=h}t[e]=a,r[e]=o,this.siftDown_(s,e)},n.prototype.siftDown_=function(e,t){for(var r=this.elements_,i=this.priorities_,a=r[t],o=i[t];t>e;){var s=this.getParentIndex_(t);if(i[s]>o)r[t]=r[s],i[t]=i[s],t=s;else break}r[t]=a,i[t]=o},n.prototype.reprioritize=function(){var e=this.priorityFunction_,t=this.elements_,r=this.priorities_,i=0,a=t.length,o,s,l;for(s=0;s<a;++s)o=t[s],l=e(o),l==x7?delete this.queuedElements_[this.keyFunction_(o)]:(r[i]=l,t[i++]=o);t.length=i,r.length=i,this.heapify_()},n}();const XLr=jLr,Xr={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};var YLr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),qLr=function(n){YLr(e,n);function e(t,r){var i=n.call(this,function(a){return t.apply(null,a)},function(a){return a[0].getKey()})||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=r,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return e.prototype.enqueue=function(t){var r=n.prototype.enqueue.call(this,t);if(r){var i=t[0];i.addEventListener(Ci.CHANGE,this.boundHandleTileChange_)}return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var r=t.target,i=r.getState();if(i===Xr.LOADED||i===Xr.ERROR||i===Xr.EMPTY){r.removeEventListener(Ci.CHANGE,this.boundHandleTileChange_);var a=r.getKey();a in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[a],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,r){for(var i=0,a,o,s;this.tilesLoading_<t&&i<r&&this.getCount()>0;)o=this.dequeue()[0],s=o.getKey(),a=o.getState(),a===Xr.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,o.load())},e}(XLr);const ZLr=qLr;function KLr(n,e,t,r,i){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return x7;var a=n.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}const Ig={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var JLr=42,lhe=256;function zAe(n,e,t){return function(r,i,a,o,s){if(!!r){if(!i&&!e)return r;var l=e?0:a[0]*i,u=e?0:a[1]*i,h=s?s[0]:0,c=s?s[1]:0,f=n[0]+l/2+h,d=n[2]-l/2+h,v=n[1]+u/2+c,p=n[3]-u/2+c;f>d&&(f=(d+f)/2,d=f),v>p&&(v=(p+v)/2,p=v);var g=Ui(r[0],f,d),m=Ui(r[1],v,p);if(o&&t&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,f-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-d)/y),m+=-y*Math.log(1+Math.max(0,v-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-p)/y)}return[g,m]}}}function QLr(n){return n}function uhe(n,e,t,r){var i=Co(e)/t[0],a=lh(e)/t[1];return r?Math.min(n,Math.max(i,a)):Math.min(n,Math.min(i,a))}function hhe(n,e,t){var r=Math.min(n,e),i=50;return r*=Math.log(1+i*Math.max(0,n/e-1))/i+1,t&&(r=Math.max(r,t),r/=Math.log(1+i*Math.max(0,t/n-1))/i+1),Ui(r,t/2,e*2)}function ePr(n,e,t,r){return function(i,a,o,s){if(i!==void 0){var l=n[0],u=n[n.length-1],h=t?uhe(l,t,o,r):l;if(s){var c=e!==void 0?e:!0;return c?hhe(i,h,u):Ui(i,u,h)}var f=Math.min(h,i),d=Math.floor(OV(n,f,a));return n[d]>h&&d<n.length-1?n[d+1]:n[d]}else return}}function tPr(n,e,t,r,i,a){return function(o,s,l,u){if(o!==void 0){var h=i?uhe(e,i,l,a):e,c=t!==void 0?t:0;if(u){var f=r!==void 0?r:!0;return f?hhe(o,h,c):Ui(o,c,h)}var d=1e-9,v=Math.ceil(Math.log(e/h)/Math.log(n)-d),p=-s*(.5-d)+.5,g=Math.min(h,o),m=Math.floor(Math.log(e/g)/Math.log(n)+p),y=Math.max(v,m),_=e/Math.pow(n,y);return Ui(_,c,h)}else return}}function UAe(n,e,t,r,i){return function(a,o,s,l){if(a!==void 0){var u=r?uhe(n,r,s,i):n,h=t!==void 0?t:!0;return!h||!l?Ui(a,e,u):hhe(a,u,e)}else return}}function che(n){if(n!==void 0)return 0}function VAe(n){if(n!==void 0)return n}function rPr(n){var e=2*Math.PI/n;return function(t,r){if(r)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t}}function nPr(n){var e=n||u8(5);return function(t,r){if(r)return t;if(t!==void 0)return Math.abs(t)<=e?0:t}}function hqe(n){return Math.pow(n,3)}function lL(n){return 1-hqe(1-n)}function iPr(n){return 3*n*n-2*n*n*n}function aPr(n){return n}function $Ae(n,e,t,r,i,a,o){var s=n[e],l=n[e+1],u=n[t]-s,h=n[t+1]-l,c;if(u===0&&h===0)c=e;else{var f=((i-s)*u+(a-l)*h)/(u*u+h*h);if(f>1)c=t;else if(f>0){for(var d=0;d<r;++d)o[d]=S1(n[e+d],n[t+d],f);o.length=r;return}else c=e}for(var d=0;d<r;++d)o[d]=n[c+d];o.length=r}function fhe(n,e,t,r,i){var a=n[e],o=n[e+1];for(e+=r;e<t;e+=r){var s=n[e],l=n[e+1],u=VE(a,o,s,l);u>i&&(i=u),a=s,o=l}return i}function dhe(n,e,t,r,i){for(var a=0,o=t.length;a<o;++a){var s=t[a];i=fhe(n,e,s,r,i),e=s}return i}function oPr(n,e,t,r,i){for(var a=0,o=t.length;a<o;++a){var s=t[a];i=dhe(n,e,s,r,i),e=s[s.length-1]}return i}function vhe(n,e,t,r,i,a,o,s,l,u,h){if(e==t)return u;var c,f;if(i===0)if(f=VE(o,s,n[e],n[e+1]),f<u){for(c=0;c<r;++c)l[c]=n[e+c];return l.length=r,f}else return u;for(var d=h||[NaN,NaN],v=e+r;v<t;)if($Ae(n,v-r,v,r,o,s,d),f=VE(o,s,d[0],d[1]),f<u){for(u=f,c=0;c<r;++c)l[c]=d[c];l.length=r,v+=r}else v+=r*Math.max((Math.sqrt(f)-Math.sqrt(u))/i|0,1);if(a&&($Ae(n,t-r,e,r,o,s,d),f=VE(o,s,d[0],d[1]),f<u)){for(u=f,c=0;c<r;++c)l[c]=d[c];l.length=r}return u}function phe(n,e,t,r,i,a,o,s,l,u,h){for(var c=h||[NaN,NaN],f=0,d=t.length;f<d;++f){var v=t[f];u=vhe(n,e,v,r,i,a,o,s,l,u,c),e=v}return u}function sPr(n,e,t,r,i,a,o,s,l,u,h){for(var c=h||[NaN,NaN],f=0,d=t.length;f<d;++f){var v=t[f];u=phe(n,e,v,r,i,a,o,s,l,u,c),e=v[v.length-1]}return u}function lPr(n,e,t,r){for(var i=0,a=t.length;i<a;++i)n[e++]=t[i];return e}function s$(n,e,t,r){for(var i=0,a=t.length;i<a;++i)for(var o=t[i],s=0;s<r;++s)n[e++]=o[s];return e}function ghe(n,e,t,r,i){for(var a=i||[],o=0,s=0,l=t.length;s<l;++s){var u=s$(n,e,t[s],r);a[o++]=u,e=u}return a.length=o,a}function uPr(n,e,t,r,i){for(var a=i||[],o=0,s=0,l=t.length;s<l;++s){var u=ghe(n,e,t[s],r,a[o]);a[o++]=u,e=u[u.length-1]}return a.length=o,a}function cqe(n,e,t,r){for(var i=0,a=n[t-r],o=n[t-r+1];e<t;e+=r){var s=n[e],l=n[e+1];i+=o*s-a*l,a=s,o=l}return i/2}function fqe(n,e,t,r){for(var i=0,a=0,o=t.length;a<o;++a){var s=t[a];i+=cqe(n,e,s,r),e=s}return i}function hPr(n,e,t,r){for(var i=0,a=0,o=t.length;a<o;++a){var s=t[a];i+=fqe(n,e,s,r),e=s[s.length-1]}return i}var cPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),fPr=function(n){cPr(e,n);function e(t,r){var i=n.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,r!==void 0&&!Array.isArray(t[0])?i.setFlatCoordinates(r,t):i.setCoordinates(t,r),i}return e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,r,i,a){return a<dT(this.getExtent(),t,r)?a:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fhe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),vhe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,r,i,a))},e.prototype.getArea=function(){return cqe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return cS(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=xue(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,Ro.XY)},e.prototype.getType=function(){return Kr.LINEAR_RING},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=s$(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pT);const WAe=fPr;var dPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),vPr=function(n){dPr(e,n);function e(t,r){var i=n.call(this)||this;return i.setCoordinates(t,r),i}return e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){var o=this.flatCoordinates,s=VE(t,r,o[0],o[1]);if(s<a){for(var l=this.stride,u=0;u<l;++u)i[u]=o[u];return i.length=l,s}else return a},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return zje(this.flatCoordinates,t)},e.prototype.getType=function(){return Kr.POINT},e.prototype.intersectsExtent=function(t){return sue(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=lPr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pT);const Qs=vPr;function pPr(n,e,t,r,i){var a=$je(i,function(o){return!yE(n,e,t,r,o[0],o[1])});return!a}function yE(n,e,t,r,i,a){for(var o=0,s=n[t-r],l=n[t-r+1];e<t;e+=r){var u=n[e],h=n[e+1];l<=a?h>a&&(u-s)*(a-l)-(i-s)*(h-l)>0&&o++:h<=a&&(u-s)*(a-l)-(i-s)*(h-l)<0&&o--,s=u,l=h}return o!==0}function yhe(n,e,t,r,i,a){if(t.length===0||!yE(n,e,t[0],r,i,a))return!1;for(var o=1,s=t.length;o<s;++o)if(yE(n,t[o-1],t[o],r,i,a))return!1;return!0}function gPr(n,e,t,r,i,a){if(t.length===0)return!1;for(var o=0,s=t.length;o<s;++o){var l=t[o];if(yhe(n,e,l,r,i,a))return!0;e=l[l.length-1]}return!1}function mhe(n,e,t,r,i,a,o){for(var s,l,u,h,c,f,d,v=i[a+1],p=[],g=0,m=t.length;g<m;++g){var y=t[g];for(h=n[y-r],f=n[y-r+1],s=e;s<y;s+=r)c=n[s],d=n[s+1],(v<=f&&d<=v||f<=v&&v<=d)&&(u=(v-f)/(d-f)*(c-h)+h,p.push(u)),h=c,f=d}var _=NaN,x=-1/0;for(p.sort(f2),h=p[0],s=1,l=p.length;s<l;++s){c=p[s];var S=Math.abs(c-h);S>x&&(u=(h+c)/2,yhe(n,e,t,r,u,v)&&(_=u,x=S)),h=c}return isNaN(_)&&(_=i[a]),o?(o.push(_,v,x),o):[_,v,x]}function dqe(n,e,t,r,i){for(var a=[],o=0,s=t.length;o<s;++o){var l=t[o];a=mhe(n,e,l,r,i,2*o,a),e=l[l.length-1]}return a}function vqe(n,e,t,r,i){var a;for(e+=r;e<t;e+=r)if(a=i(n.slice(e-r,e),n.slice(e,e+r)),a)return a;return!1}function l$(n,e,t,r,i){var a=Vje(Md(),n,e,t,r);return Cl(i,a)?vv(i,a)||a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:vqe(n,e,t,r,function(o,s){return xyr(i,o,s)}):!1}function yPr(n,e,t,r,i){for(var a=0,o=t.length;a<o;++a){if(l$(n,e,t[a],r,i))return!0;e=t[a]}return!1}function mPr(n,e,t,r,i){return!!(l$(n,e,t,r,i)||yE(n,e,t,r,i[0],i[1])||yE(n,e,t,r,i[0],i[3])||yE(n,e,t,r,i[2],i[1])||yE(n,e,t,r,i[2],i[3]))}function pqe(n,e,t,r,i){if(!mPr(n,e,t[0],r,i))return!1;if(t.length===1)return!0;for(var a=1,o=t.length;a<o;++a)if(pPr(n,t[a-1],t[a],r,i)&&!l$(n,t[a-1],t[a],r,i))return!1;return!0}function _Pr(n,e,t,r,i){for(var a=0,o=t.length;a<o;++a){var s=t[a];if(pqe(n,e,s,r,i))return!0;e=s[s.length-1]}return!1}function xPr(n,e,t,r){for(;e<t-r;){for(var i=0;i<r;++i){var a=n[e+i];n[e+i]=n[t-r+i],n[t-r+i]=a}e+=r,t-=r}}function _he(n,e,t,r){for(var i=0,a=n[t-r],o=n[t-r+1];e<t;e+=r){var s=n[e],l=n[e+1];i+=(s-a)*(l+o),a=s,o=l}return i===0?void 0:i>0}function gqe(n,e,t,r,i){for(var a=i!==void 0?i:!1,o=0,s=t.length;o<s;++o){var l=t[o],u=_he(n,e,l,r);if(o===0){if(a&&u||!a&&!u)return!1}else if(a&&!u||!a&&u)return!1;e=l}return!0}function SPr(n,e,t,r,i){for(var a=0,o=t.length;a<o;++a){var s=t[a];if(!gqe(n,e,s,r,i))return!1;s.length&&(e=s[s.length-1])}return!0}function ure(n,e,t,r,i){for(var a=i!==void 0?i:!1,o=0,s=t.length;o<s;++o){var l=t[o],u=_he(n,e,l,r),h=o===0?a&&u||!a&&!u:a&&!u||!a&&u;h&&xPr(n,e,l,r),e=l}return e}function HAe(n,e,t,r,i){for(var a=0,o=t.length;a<o;++a)e=ure(n,e,t[a],r,i);return e}function wPr(n,e){for(var t=[],r=0,i=0,a=0,o=e.length;a<o;++a){var s=e[a];if(!_he(n,r,s,2))t.push(e.slice(i,a+1));else{if(t.length===0)continue;t[t.length-1].push(e[i])}i=a+1,r=s}return t}var bPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),yqe=function(n){bPr(e,n);function e(t,r,i){var a=n.call(this)||this;return a.ends_=[],a.flatInteriorPointRevision_=-1,a.flatInteriorPoint_=null,a.maxDelta_=-1,a.maxDeltaRevision_=-1,a.orientedRevision_=-1,a.orientedFlatCoordinates_=null,r!==void 0&&i?(a.setFlatCoordinates(r,t),a.ends_=i):a.setCoordinates(t,r),a}return e.prototype.appendLinearRing=function(t){this.flatCoordinates?em(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){return a<dT(this.getExtent(),t,r)?a:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(dhe(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),phe(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,r,i,a))},e.prototype.containsXY=function(t,r){return yhe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,r)},e.prototype.getArea=function(){return fqe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var r;return t!==void 0?(r=this.getOrientedFlatCoordinates().slice(),ure(r,0,this.ends_,this.stride,t)):r=this.flatCoordinates,vN(r,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=kf(this.getExtent());this.flatInteriorPoint_=mhe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Qs(this.getFlatInteriorPoint(),Ro.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new WAe(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,r=this.flatCoordinates,i=this.ends_,a=[],o=0,s=0,l=i.length;s<l;++s){var u=i[s],h=new WAe(r.slice(o,u),t);a.push(h),o=u}return a},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;gqe(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ure(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=dXe(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,i),new e(r,Ro.XY,i)},e.prototype.getType=function(){return Kr.POLYGON},e.prototype.intersectsExtent=function(t){return pqe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=ghe(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()},e}(pT);const m2=yqe;function jAe(n){var e=n[0],t=n[1],r=n[2],i=n[3],a=[e,t,e,i,r,i,r,t,e,t];return new yqe(a,Ro.XY,[a.length])}var EPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Vq=0,TPr=function(n){EPr(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=Ao({},t);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=due(i.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,i.projection&&Tyr(),i.center&&(i.center=c1(i.center,r.projection_)),i.extent&&(i.extent=F1(i.extent,r.projection_)),r.applyOptions_(i),r}return e.prototype.applyOptions_=function(t){var r=Ao({},t);for(var i in Ig)delete r[i];this.setProperties(r,!0);var a=APr(t);this.maxResolution_=a.maxResolution,this.minResolution_=a.minResolution,this.zoomFactor_=a.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=a.minZoom;var o=CPr(t),s=a.constraint,l=MPr(t);this.constraints_={center:o,resolution:s,rotation:l},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var r=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var a=t||[0,0,0,0];r=r||[0,0,0,0];var o=this.getResolution(),s=o/2*(a[3]-r[3]+r[1]-a[1]),l=o/2*(a[0]-r[0]+r[2]-a[2]);this.setCenterInternal([i[0]+s,i[1]-l])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var r=this.getProperties();return r.resolution!==void 0?r.resolution=this.getResolution():r.zoom=this.getZoom(),r.center=this.getCenterInternal(),r.rotation=this.getRotation(),Ao({},r,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var r=new Array(arguments.length),i=0;i<r.length;++i){var a=arguments[i];a.center&&(a=Ao({},a),a.center=c1(a.center,this.getProjection())),a.anchor&&(a=Ao({},a),a.anchor=c1(a.anchor,this.getProjection())),r[i]=a}this.animateInternal.apply(this,r)},e.prototype.animateInternal=function(t){var r=arguments.length,i;r>1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var a=0;a<r&&!this.isDef();++a){var o=arguments[a];o.center&&this.setCenterInternal(o.center),o.zoom!==void 0?this.setZoom(o.zoom):o.resolution&&this.setResolution(o.resolution),o.rotation!==void 0&&this.setRotation(o.rotation)}if(a===r){i&&M6(i,!0);return}for(var s=Date.now(),l=this.targetCenter_.slice(),u=this.targetResolution_,h=this.targetRotation_,c=[];a<r;++a){var f=arguments[a],d={start:s,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||iPr,callback:i};if(f.center&&(d.sourceCenter=l,d.targetCenter=f.center.slice(),l=d.targetCenter),f.zoom!==void 0?(d.sourceResolution=u,d.targetResolution=this.getResolutionForZoom(f.zoom),u=d.targetResolution):f.resolution&&(d.sourceResolution=u,d.targetResolution=f.resolution,u=d.targetResolution),f.rotation!==void 0){d.sourceRotation=h;var v=bS(f.rotation-h+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=h+v,h=d.targetRotation}IPr(d)?d.complete=!0:s+=d.duration,c.push(d)}this.animations_.push(c),this.setHint(Gs.ANIMATING,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[Gs.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[Gs.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Gs.ANIMATING,-this.hints_[Gs.ANIMATING]);for(var t,r=0,i=this.animations_.length;r<i;++r){var a=this.animations_[r];if(a[0].callback&&M6(a[0].callback,!1),!t)for(var o=0,s=a.length;o<s;++o){var l=a[o];if(!l.complete){t=l.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!!this.getAnimating()){for(var t=Date.now(),r=!1,i=this.animations_.length-1;i>=0;--i){for(var a=this.animations_[i],o=!0,s=0,l=a.length;s<l;++s){var u=a[s];if(!u.complete){var h=t-u.start,c=u.duration>0?h/u.duration:1;c>=1?(u.complete=!0,c=1):o=!1;var f=u.easing(c);if(u.sourceCenter){var d=u.sourceCenter[0],v=u.sourceCenter[1],p=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=d+f*(p-d),y=v+f*(g-v);this.targetCenter_=[m,y]}if(u.sourceResolution&&u.targetResolution){var _=f===1?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){var x=this.getViewportSize_(this.getRotation()),S=this.constraints_.resolution(_,0,x,!0);this.targetCenter_=this.calculateCenterZoom(S,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var w=f===1?bS(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){var b=this.constraints_.rotation(w,!0);this.targetCenter_=this.calculateCenterRotate(b,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=w}if(this.applyTargetState_(!0),r=!0,!u.complete)break}}if(o){this.animations_[i]=null,this.setHint(Gs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=a[0].callback;E&&M6(E,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,r){var i,a=this.getCenterInternal();return a!==void 0&&(i=[a[0]-r[0],a[1]-r[1]],uue(i,t-this.getRotation()),wyr(i,r)),i},e.prototype.calculateCenterZoom=function(t,r){var i,a=this.getCenterInternal(),o=this.getResolution();if(a!==void 0&&o!==void 0){var s=r[0]-t*(r[0]-a[0])/o,l=r[1]-t*(r[1]-a[1])/o;i=[s,l]}return i},e.prototype.getViewportSize_=function(t){var r=this.viewportSize_;if(t){var i=r[0],a=r[1];return[Math.abs(i*Math.cos(t))+Math.abs(a*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(a*Math.cos(t))]}else return r},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&Ate(t,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ig.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var r=this.calculateExtentInternal(t);return Xje(r,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var r=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();ki(i,1);var a=this.getResolution();ki(a!==void 0,2);var o=this.getRotation();return ki(o!==void 0,3),oN(i,a,o,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ig.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,r){return this.getResolutionForExtentInternal(F1(t,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(t,r){var i=r||this.getViewportSizeMinusPadding_(),a=Co(t)/i[0],o=lh(t)/i[1];return Math.max(a,o)},e.prototype.getResolutionForValueFunction=function(t){var r=t||2,i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/Math.log(r);return function(s){var l=i/Math.pow(r,s*o);return l}},e.prototype.getRotation=function(){return this.get(Ig.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var r=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),a=this.minResolution_,o=Math.log(i/a)/r;return function(s){var l=Math.log(i/s)/r/o;return l}},e.prototype.getViewportSizeMinusPadding_=function(t){var r=this.getViewportSize_(t),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var t=this.getProjection(),r=this.getResolution(),i=this.getRotation(),a=this.getCenterInternal(),o=this.padding_;if(o){var s=this.getViewportSizeMinusPadding_();a=$q(a,this.getViewportSize_(),[s[0]/2+o[3],s[1]/2+o[0]],r,i)}return{center:a.slice(0),projection:t!==void 0?t:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,r=this.getResolution();return r!==void 0&&(t=this.getZoomForResolution(r)),t},e.prototype.getZoomForResolution=function(t){var r=this.minZoom_||0,i,a;if(this.resolutions_){var o=OV(this.resolutions_,t,1);r=o,i=this.resolutions_[o],o==this.resolutions_.length-1?a=2:a=i/this.resolutions_[o+1]}else i=this.maxResolution_,a=this.zoomFactor_;return r+Math.log(i/t)/Math.log(a)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=Ui(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Ui(t-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,r){var i;if(ki(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){ki(!Sk(t),25);var a=F1(t,this.getProjection());i=jAe(a)}else if(t.getType()===Kr.CIRCLE){var a=F1(t.getExtent(),this.getProjection());i=jAe(a),i.rotate(this.getRotation(),kf(a))}else{var o=Lyr();o?i=t.clone().transform(o,this.getProjection()):i=t}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(t){for(var r=this.getRotation(),i=Math.cos(r),a=Math.sin(-r),o=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,c=-1/0,f=0,d=o.length;f<d;f+=s){var v=o[f]*i-o[f+1]*a,p=o[f]*a+o[f+1]*i;l=Math.min(l,v),u=Math.min(u,p),h=Math.max(h,v),c=Math.max(c,p)}return[l,u,h,c]},e.prototype.fitInternal=function(t,r){var i=r||{},a=i.size;a||(a=this.getViewportSizeMinusPadding_());var o=i.padding!==void 0?i.padding:[0,0,0,0],s=i.nearest!==void 0?i.nearest:!1,l;i.minResolution!==void 0?l=i.minResolution:i.maxZoom!==void 0?l=this.getResolutionForZoom(i.maxZoom):l=0;var u=this.rotatedExtentForGeometry(t),h=this.getResolutionForExtentInternal(u,[a[0]-o[1]-o[3],a[1]-o[0]-o[2]]);h=isNaN(h)?l:Math.max(h,l),h=this.getConstrainedResolution(h,s?0:1);var c=this.getRotation(),f=Math.sin(c),d=Math.cos(c),v=kf(u);v[0]+=(o[1]-o[3])/2*h,v[1]+=(o[0]-o[2])/2*h;var p=v[0]*d-v[1]*f,g=v[1]*d+v[0]*f,m=this.getConstrainedCenter([p,g],h),y=i.callback?i.callback:d2;i.duration!==void 0?this.animateInternal({resolution:h,center:m,duration:i.duration,easing:i.easing},y):(this.targetResolution_=h,this.targetCenter_=m,this.applyTargetState_(!1,!0),M6(y,!0))},e.prototype.centerOn=function(t,r,i){this.centerOnInternal(c1(t,this.getProjection()),r,i)},e.prototype.centerOnInternal=function(t,r,i){this.setCenterInternal($q(t,r,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,r,i,a){var o,s=this.padding_;if(s&&t){var l=this.getViewportSizeMinusPadding_(-i),u=$q(t,a,[l[0]/2+s[3],l[1]/2+s[0]],r,i);o=[t[0]-u[0],t[1]-u[1]]}return o},e.prototype.isDef=function(){return!!this.getCenterInternal()&&this.getResolution()!==void 0},e.prototype.adjustCenter=function(t){var r=Ate(this.targetCenter_,this.getProjection());this.setCenter([r[0]+t[0],r[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var r=this.targetCenter_;this.setCenterInternal([r[0]+t[0],r[1]+t[1]])},e.prototype.adjustResolution=function(t,r){var i=r&&c1(r,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,r){var i=this.getAnimating()||this.getInteracting(),a=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,a,i);r&&(this.targetCenter_=this.calculateCenterZoom(o,r)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,r){this.adjustResolution(Math.pow(this.zoomFactor_,-t),r)},e.prototype.adjustRotation=function(t,r){r&&(r=c1(r,this.getProjection())),this.adjustRotationInternal(t,r)},e.prototype.adjustRotationInternal=function(t,r){var i=this.getAnimating()||this.getInteracting(),a=this.constraints_.rotation(this.targetRotation_+t,i);r&&(this.targetCenter_=this.calculateCenterRotate(a,r)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t&&c1(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,r){return this.hints_[t]+=r,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,r){var i=this.getAnimating()||this.getInteracting()||r,a=this.constraints_.rotation(this.targetRotation_,i),o=this.getViewportSize_(a),s=this.constraints_.resolution(this.targetResolution_,0,o,i),l=this.constraints_.center(this.targetCenter_,s,o,i,this.calculateCenterShift(this.targetCenter_,s,a,o));this.get(Ig.ROTATION)!==a&&this.set(Ig.ROTATION,a),this.get(Ig.RESOLUTION)!==s&&(this.set(Ig.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),(!l||!this.get(Ig.CENTER)||!t7(this.get(Ig.CENTER),l))&&this.set(Ig.CENTER,l),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,r,i){var a=t!==void 0?t:200,o=r||0,s=this.constraints_.rotation(this.targetRotation_),l=this.getViewportSize_(s),u=this.constraints_.resolution(this.targetResolution_,o,l),h=this.constraints_.center(this.targetCenter_,u,l,!1,this.calculateCenterShift(this.targetCenter_,u,s,l));if(a===0&&!this.cancelAnchor_){this.targetResolution_=u,this.targetRotation_=s,this.targetCenter_=h,this.applyTargetState_();return}var c=i||(a===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==u||this.getRotation()!==s||!this.getCenterInternal()||!t7(this.getCenterInternal(),h))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:h,resolution:u,duration:a,easing:lL,anchor:c}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Gs.INTERACTING,1)},e.prototype.endInteraction=function(t,r,i){var a=i&&c1(i,this.getProjection());this.endInteractionInternal(t,r,a)},e.prototype.endInteractionInternal=function(t,r,i){this.setHint(Gs.INTERACTING,-1),this.resolveConstraints(t,r,i)},e.prototype.getConstrainedCenter=function(t,r){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,r||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,r){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,r))},e.prototype.getConstrainedResolution=function(t,r){var i=r||0,a=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,a)},e}(kv);function M6(n,e){setTimeout(function(){n(e)},0)}function CPr(n){if(n.extent!==void 0){var e=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return zAe(n.extent,n.constrainOnlyCenter,e)}var t=due(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&t.isGlobal()){var r=t.getExtent().slice();return r[0]=-1/0,r[2]=1/0,zAe(r,!1,!1)}return QLr}function APr(n){var e,t,r,i=28,a=2,o=n.minZoom!==void 0?n.minZoom:Vq,s=n.maxZoom!==void 0?n.maxZoom:i,l=n.zoomFactor!==void 0?n.zoomFactor:a,u=n.multiWorld!==void 0?n.multiWorld:!1,h=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,c=n.showFullExtent!==void 0?n.showFullExtent:!1,f=due(n.projection,"EPSG:3857"),d=f.getExtent(),v=n.constrainOnlyCenter,p=n.extent;if(!u&&!p&&f.isGlobal()&&(v=!1,p=d),n.resolutions!==void 0){var g=n.resolutions;t=g[o],r=g[s]!==void 0?g[s]:g[g.length-1],n.constrainResolution?e=ePr(g,h,!v&&p,c):e=UAe(t,r,h,!v&&p,c)}else{var m=d?Math.max(Co(d),lh(d)):360*Hp[$c.DEGREES]/f.getMetersPerUnit(),y=m/lhe/Math.pow(a,Vq),_=y/Math.pow(a,i-Vq);t=n.maxResolution,t!==void 0?o=0:t=y/Math.pow(l,o),r=n.minResolution,r===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?r=t/Math.pow(l,s):r=y/Math.pow(l,s):r=_),s=o+Math.floor(Math.log(t/r)/Math.log(l)),r=t/Math.pow(l,s-o),n.constrainResolution?e=tPr(l,t,r,h,!v&&p,c):e=UAe(t,r,h,!v&&p,c)}return{constraint:e,maxResolution:t,minResolution:r,minZoom:o,zoomFactor:l}}function MPr(n){var e=n.enableRotation!==void 0?n.enableRotation:!0;if(e){var t=n.constrainRotation;return t===void 0||t===!0?nPr():t===!1?VAe:typeof t=="number"?rPr(t):VAe}else return che}function IPr(n){return!(n.sourceCenter&&n.targetCenter&&!t7(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function $q(n,e,t,r,i){var a=Math.cos(-i),o=Math.sin(-i),s=n[0]*a-n[1]*o,l=n[1]*a+n[0]*o;s+=(e[0]/2-t[0])*r,l+=(t[1]-e[1]/2)*r,o=-o;var u=s*a-l*o,h=l*a+s*o;return[u,h]}const Lp=TPr;var LPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function mqe(n){if(n instanceof Ek){n.setMapInternal(null);return}n instanceof Nk&&n.getLayers().forEach(mqe)}function _qe(n,e){if(n instanceof Ek){n.setMapInternal(e);return}if(n instanceof Nk)for(var t=n.getLayers().getArray(),r=0,i=t.length;r<i;++r)_qe(t[r],e)}var PPr=function(n){LPr(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=OPr(t);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,r.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:iue,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=Nu(),r.pixelToCoordinateTransform_=Nu(),r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=t.moveTolerance,r.keyboardEventTarget_=i.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=i.controls||new gd,r.interactions=i.interactions||new gd,r.overlays_=i.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new ZLr(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Pc.LAYERGROUP,r.handleLayerGroupChanged_),r.addChangeListener(Pc.VIEW,r.handleViewChanged_),r.addChangeListener(Pc.SIZE,r.handleSizeChanged_),r.addChangeListener(Pc.TARGET,r.handleTargetChanged_),r.setProperties(i.values);var a=r;return t.view&&!(t.view instanceof Lp)&&t.view.then(function(o){a.setView(new Lp(o))}),r.controls.addEventListener(ud.ADD,function(o){o.element.setMap(this)}.bind(r)),r.controls.addEventListener(ud.REMOVE,function(o){o.element.setMap(null)}.bind(r)),r.interactions.addEventListener(ud.ADD,function(o){o.element.setMap(this)}.bind(r)),r.interactions.addEventListener(ud.REMOVE,function(o){o.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(ud.ADD,function(o){this.addOverlayInternal_(o.element)}.bind(r)),r.overlays_.addEventListener(ud.REMOVE,function(o){var s=o.element,l=s.getId();l!==void 0&&delete this.overlayIdIndex_[l.toString()],o.element.setMap(null)}.bind(r)),r.controls.forEach(function(o){o.setMap(this)}.bind(r)),r.interactions.forEach(function(o){o.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){var r=this.getLayerGroup().getLayers();r.push(t)},e.prototype.handleLayerAdd_=function(t){_qe(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var r=t.getId();r!==void 0&&(this.overlayIdIndex_[r.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),n.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,r,i){if(!(!this.frameState_||!this.renderer_)){var a=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};var o=i.hitTolerance!==void 0?i.hitTolerance:0,s=i.layerFilter!==void 0?i.layerFilter:ZA,l=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(a,this.frameState_,o,l,r,null,s,null)}},e.prototype.getFeaturesAtPixel=function(t,r){var i=[];return this.forEachFeatureAtPixel(t,function(a){i.push(a)},r),i},e.prototype.getAllLayers=function(){var t=[];function r(i){i.forEach(function(a){a instanceof Nk?r(a.getLayers()):t.push(a)})}return r(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,r,i){if(!(!this.frameState_||!this.renderer_)){var a=i||{},o=a.hitTolerance!==void 0?a.hitTolerance:0,s=a.layerFilter||ZA;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,r,s)}},e.prototype.hasFeatureAtPixel=function(t,r){if(!this.frameState_||!this.renderer_)return!1;var i=this.getCoordinateFromPixelInternal(t);r=r!==void 0?r:{};var a=r.layerFilter!==void 0?r.layerFilter:ZA,o=r.hitTolerance!==void 0?r.hitTolerance:0,s=r.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,s,a,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var r=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-r.left,i.clientY-r.top]},e.prototype.getTarget=function(){return this.get(Pc.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return t!==void 0?typeof t=="string"?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Ate(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var r=this.frameState_;return r?ks(r.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var r=this.overlayIdIndex_[t.toString()];return r!==void 0?r:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Pc.LAYERGROUP)},e.prototype.setLayers=function(t){var r=this.getLayerGroup();if(t instanceof gd){r.setLayers(t);return}var i=r.getLayers();i.clear(),i.extend(t)},e.prototype.getLayers=function(){var t=this.getLayerGroup().getLayers();return t},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),r=0,i=t.length;r<i;++r){var a=t[r];if(!!a.visible){var o=a.layer.getRenderer();if(o&&!o.ready)return!0;var s=a.layer.getSource();if(s&&s.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var r=c1(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(r)},e.prototype.getPixelFromCoordinateInternal=function(t){var r=this.frameState_;return r?ks(r.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Pc.SIZE)},e.prototype.getView=function(){return this.get(Pc.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,r,i,a){return KLr(this.frameState_,t,r,i,a)},e.prototype.handleBrowserEvent=function(t,r){var i=r||t.type,a=new Ox(i,this,t);this.handleMapBrowserEvent(a)},e.prototype.handleMapBrowserEvent=function(t){if(!!this.frameState_){var r=t.originalEvent,i=r.type;if(i===lre.POINTERDOWN||i===Ci.WHEEL||i===Ci.KEYDOWN){var a=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():a,s=r.target;if(this.overlayContainerStopEvent_.contains(s)||!(o===a?a.documentElement:o).contains(s))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1)for(var l=this.getInteractions().getArray().slice(),u=l.length-1;u>=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var c=h.handleEvent(t);if(!c||t.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var t=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,a=i;if(t){var o=t.viewHints;if(o[Gs.ANIMATING]||o[Gs.INTERACTING]){var s=Date.now()-t.time>8;i=s?0:8,a=s?0:2}}r.getTilesLoading()<i&&(r.reprioritize(),r.loadMoreTiles(i,a))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(Tf.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Tf.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new rA(Px.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new rA(Px.LOADSTART,this,t))));for(var l=this.postRenderFunctions_,u=0,h=l.length;u<h;++u)l[u](this,t);l.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,r=this.targetChangeHandlerKeys_.length;t<r;++t)Ms(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(Ci.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Ci.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,_te(this.viewport_)}var i=this.getTargetElement();if(!i)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{i.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new HLr(this,this.moveTolerance_);for(var a in Zs)this.mapBrowserEventHandler_.addEventListener(Zs[a],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Ci.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Ci.WHEEL,this.boundHandleBrowserEvent_,Rje?{passive:!1}:!1);var o=this.getOwnerDocument().defaultView,s=this.keyboardEventTarget_?this.keyboardEventTarget_:i;this.targetChangeHandlerKeys_=[pa(s,Ci.KEYDOWN,this.handleBrowserEvent,this),pa(s,Ci.KEYPRESS,this.handleBrowserEvent,this),pa(o,Ci.RESIZE,this.updateSize,this)]}this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Ms(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ms(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=pa(t,UM.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=pa(t,Ci.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ms),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new $x("addlayer",t)),this.layerGroupPropertyListenerKeys_=[pa(t,UM.PROPERTYCHANGE,this.render,this),pa(t,Ci.CHANGE,this.render,this),pa(t,"addlayer",this.handleLayerAdd_,this),pa(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),r=0,i=t.length;r<i;++r){var a=t[r].layer;a.hasRenderer()&&a.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){var r=this.getLayerGroup().getLayers();return r.remove(t)},e.prototype.handleLayerRemove_=function(t){mqe(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var r=this,i=this.getSize(),a=this.getView(),o=this.frameState_,s=null;if(i!==void 0&&fTe(i)&&a&&a.isDef()){var l=a.getHints(this.frameState_?this.frameState_.viewHints:void 0),u=a.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:oN(u.center,u.resolution,u.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:u,viewHints:l,wantedTiles:{},mapId:vi(this),renderTargets:{}},u.nextCenter&&u.nextResolution){var h=isNaN(u.nextRotation)?u.rotation:u.nextRotation;s.nextExtent=oN(u.nextCenter,u.nextResolution,h,i)}}if(this.frameState_=s,this.renderer_.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),o){var c=!this.previousExtent_||!Sk(this.previousExtent_)&&!m_(s.extent,this.previousExtent_);c&&(this.dispatchEvent(new rA(Px.MOVESTART,this,o)),this.previousExtent_=xk(this.previousExtent_))}var f=this.previousExtent_&&!s.viewHints[Gs.ANIMATING]&&!s.viewHints[Gs.INTERACTING]&&!m_(s.extent,this.previousExtent_);f&&(this.dispatchEvent(new rA(Px.MOVEEND,this,s)),Gje(s.extent,this.previousExtent_))}this.dispatchEvent(new rA(Px.POSTRENDER,this,s)),this.renderComplete_=this.hasListener(Px.LOADSTART)||this.hasListener(Px.LOADEND)||this.hasListener(Tf.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){r.postRenderTimeoutHandle_=void 0,r.handlePostRender()},0))},e.prototype.setLayerGroup=function(t){var r=this.getLayerGroup();r&&this.handleLayerRemove_(new $x("removelayer",r)),this.set(Pc.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(Pc.SIZE,t)},e.prototype.setTarget=function(t){this.set(Pc.TARGET,t)},e.prototype.setView=function(t){if(!t||t instanceof Lp){this.set(Pc.VIEW,t);return}this.set(Pc.VIEW,new Lp);var r=this;t.then(function(i){r.setView(new Lp(i))})},e.prototype.updateSize=function(){var t=this.getTargetElement(),r=void 0;if(t){var i=getComputedStyle(t),a=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),o=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(a)&&!isNaN(o)&&(r=[a,o],!fTe(r)&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(r),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var r=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(r=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(r)}},e}(kv);function OPr(n){var e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);var t={},r=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Nk({layers:n.layers});t[Pc.LAYERGROUP]=r,t[Pc.TARGET]=n.target,t[Pc.VIEW]=n.view instanceof Lp?n.view:new Lp;var i;n.controls!==void 0&&(Array.isArray(n.controls)?i=new gd(n.controls.slice()):(ki(typeof n.controls.getArray=="function",47),i=n.controls));var a;n.interactions!==void 0&&(Array.isArray(n.interactions)?a=new gd(n.interactions.slice()):(ki(typeof n.interactions.getArray=="function",48),a=n.interactions));var o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new gd(n.overlays.slice()):(ki(typeof n.overlays.getArray=="function",49),o=n.overlays):o=new gd,{controls:i,interactions:a,keyboardEventTarget:e,overlays:o,values:t}}const RPr=PPr;var DPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),NPr=function(n){DPr(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.ulElement_=document.createElement("ul"),r.collapsed_=i.collapsed!==void 0?i.collapsed:!0,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=i.collapsible!==void 0,r.collapsible_=i.collapsible!==void 0?i.collapsible:!0,r.collapsible_||(r.collapsed_=!1);var a=i.className!==void 0?i.className:"ol-attribution",o=i.tipLabel!==void 0?i.tipLabel:"Attributions",s=i.expandClassName!==void 0?i.expandClassName:a+"-expand",l=i.collapseLabel!==void 0?i.collapseLabel:"\u203A",u=i.collapseClassName!==void 0?i.collapseClassName:a+"-collapse";typeof l=="string"?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=l,r.collapseLabel_.className=u):r.collapseLabel_=l;var h=i.label!==void 0?i.label:"i";typeof h=="string"?(r.label_=document.createElement("span"),r.label_.textContent=h,r.label_.className=s):r.label_=h;var c=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(c),r.toggleButton_.addEventListener(Ci.CLICK,r.handleClick_.bind(r),!1);var f=a+" "+mk+" "+aue+(r.collapsed_&&r.collapsible_?" "+V2e:"")+(r.collapsible_?"":" ol-uncollapsible"),d=r.element;return d.className=f,d.appendChild(r.toggleButton_),d.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return e.prototype.collectSourceAttributions_=function(t){for(var r={},i=[],a=!0,o=t.layerStatesArray,s=0,l=o.length;s<l;++s){var u=o[s];if(!!l7(u,t.viewState)){var h=u.layer.getSource();if(!!h){var c=h.getAttributions();if(!!c){var f=c(t);if(!!f)if(a=a&&h.getAttributionsCollapsible()!==!1,Array.isArray(f))for(var d=0,v=f.length;d<v;++d)f[d]in r||(i.push(f[d]),r[f[d]]=!0);else f in r||(i.push(f),r[f]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(a),i},e.prototype.updateElement_=function(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=this.collectSourceAttributions_(t),i=r.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Iw(r,this.renderedAttributions_)){j0r(this.ulElement_);for(var a=0,o=r.length;a<o;++a){var s=document.createElement("li");s.innerHTML=r[a],this.ulElement_.appendChild(s)}this.renderedAttributions_=r}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(V2e),this.collapsed_?U2e(this.collapseLabel_,this.label_):U2e(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(tL);const kPr=NPr;var FPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),BPr=function(n){FPr(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var a=i.className!==void 0?i.className:"ol-rotate",o=i.label!==void 0?i.label:"\u21E7",s=i.compassClassName!==void 0?i.compassClassName:"ol-compass";r.label_=null,typeof o=="string"?(r.label_=document.createElement("span"),r.label_.className=s,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(s));var l=i.tipLabel?i.tipLabel:"Reset rotation",u=document.createElement("button");u.className=a+"-reset",u.setAttribute("type","button"),u.title=l,u.appendChild(r.label_),u.addEventListener(Ci.CLICK,r.handleClick_.bind(r),!1);var h=a+" "+mk+" "+aue,c=r.element;return c.className=h,c.appendChild(u),r.callResetNorth_=i.resetNorth?i.resetNorth:void 0,r.duration_=i.duration!==void 0?i.duration:250,r.autoHide_=i.autoHide!==void 0?i.autoHide:!0,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(e6),r}return e.prototype.handleClick_=function(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap(),r=t.getView();if(!!r){var i=r.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:lL}):r.setRotation(0))}},e.prototype.render=function(t){var r=t.frameState;if(!!r){var i=r.viewState.rotation;if(i!=this.rotation_){var a="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(e6);!o&&i===0?this.element.classList.add(e6):o&&i!==0&&this.element.classList.remove(e6)}this.label_.style.transform=a}this.rotation_=i}},e}(tL);const GPr=BPr;var zPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),UPr=function(n){zPr(e,n);function e(t){var r=this,i=t||{};r=n.call(this,{element:document.createElement("div"),target:i.target})||this;var a=i.className!==void 0?i.className:"ol-zoom",o=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:a+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:a+"-out",u=i.zoomInLabel!==void 0?i.zoomInLabel:"+",h=i.zoomOutLabel!==void 0?i.zoomOutLabel:"\u2013",c=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",f=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof u=="string"?document.createTextNode(u):u),d.addEventListener(Ci.CLICK,r.handleClick_.bind(r,o),!1);var v=document.createElement("button");v.className=l,v.setAttribute("type","button"),v.title=f,v.appendChild(typeof h=="string"?document.createTextNode(h):h),v.addEventListener(Ci.CLICK,r.handleClick_.bind(r,-o),!1);var p=a+" "+mk+" "+aue,g=r.element;return g.className=p,g.appendChild(d),g.appendChild(v),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(t,r){r.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var r=this.getMap(),i=r.getView();if(!!i){var a=i.getZoom();if(a!==void 0){var o=i.getConstrainedZoom(a+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:lL})):i.setZoom(o)}}},e}(tL);const VPr=UPr;function $Pr(n){var e=n||{},t=new gd,r=e.zoom!==void 0?e.zoom:!0;r&&t.push(new VPr(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&t.push(new GPr(e.rotateOptions));var a=e.attribution!==void 0?e.attribution:!0;return a&&t.push(new kPr(e.attributionOptions)),t}const XAe={ACTIVE:"active"};var WPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),HPr=function(n){WPr(e,n);function e(t){var r=n.call(this)||this;return r.on,r.once,r.un,t&&t.handleEvent&&(r.handleEvent=t.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(XAe.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(XAe.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(kv);function jPr(n,e,t){var r=n.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:aPr,center:n.getConstrainedCenter(i)})}}function xhe(n,e,t,r){var i=n.getZoom();if(i!==void 0){var a=n.getConstrainedZoom(i+e),o=n.getResolutionForZoom(a);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:r!==void 0?r:250,easing:lL})}}const kk=HPr;var XPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),YPr=function(n){XPr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Zs.DBLCLICK){var i=t.originalEvent,a=t.map,o=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=a.getView();xhe(l,s,o,this.duration_),i.preventDefault(),r=!0}return!r},e}(kk);const qPr=YPr;var ZPr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),KPr=function(n){ZPr(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Zs.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Zs.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Zs.POINTERDOWN){var a=this.handleDownEvent(t);this.handlingDownUpSequence=a,r=this.stopDown(a)}else t.type==Zs.POINTERMOVE&&this.handleMoveEvent(t);return!r},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(JPr(t)){var r=t.originalEvent,i=r.pointerId.toString();t.type==Zs.POINTERUP?delete this.trackedPointers_[i]:t.type==Zs.POINTERDOWN?this.trackedPointers_[i]=r:i in this.trackedPointers_&&(this.trackedPointers_[i]=r),this.targetPointers=Pje(this.trackedPointers_)}},e}(kk);function She(n){for(var e=n.length,t=0,r=0,i=0;i<e;i++)t+=n[i].clientX,r+=n[i].clientY;return[t/e,r/e]}function JPr(n){var e=n.type;return e===Zs.POINTERDOWN||e===Zs.POINTERDRAG||e===Zs.POINTERUP}const uL=KPr;function hre(n){var e=arguments;return function(t){for(var r=!0,i=0,a=e.length;i<a&&(r=r&&e[i](t),!!r);++i);return r}}var QPr=function(n){var e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},eOr=function(n){var e=n.map.getTargetElement(),t=n.map.getOwnerDocument().activeElement;return e.contains(t)},xqe=function(n){return n.map.getTargetElement().hasAttribute("tabindex")?eOr(n):!0},tOr=ZA,Sqe=function(n){var e=n.originalEvent;return e.button==0&&!($0r&&W0r&&e.ctrlKey)},wqe=function(n){var e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},rOr=function(n){var e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},bqe=function(n){var e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"},Wq=function(n){var e=n.originalEvent;return ki(e!==void 0,56),e.pointerType=="mouse"},nOr=function(n){var e=n.originalEvent;return ki(e!==void 0,56),e.isPrimary&&e.button===0},iOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),aOr=function(n){iOr(e,n);function e(t){var r=n.call(this,{stopDown:RV})||this,i=t||{};r.kinetic_=i.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var a=i.condition?i.condition:hre(wqe,nOr);return r.condition_=i.onFocusOnly?hre(xqe,a):a,r.noKinetic_=!1,r}return e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var r=this.targetPointers,i=She(r);if(r.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var a=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],o=t.map,s=o.getView();byr(a,s.getResolution()),uue(a,s.getRotation()),s.adjustCenterInternal(a)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=r.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var r=t.map,i=r.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var a=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),s=i.getCenterInternal(),l=r.getPixelFromCoordinateInternal(s),u=r.getCoordinateFromPixelInternal([l[0]-a*Math.cos(o),l[1]-a*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(u),duration:500,easing:lL})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var r=t.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(uL);const oOr=aOr;var sOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lOr=function(n){sOr(e,n);function e(t){var r=this,i=t||{};return r=n.call(this,{stopDown:RV})||this,r.condition_=i.condition?i.condition:QPr,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){if(!!Wq(t)){var r=t.map,i=r.getView();if(i.getConstraints().rotation!==che){var a=r.getSize(),o=t.pixel,s=Math.atan2(a[1]/2-o[1],o[0]-a[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(t){if(!Wq(t))return!0;var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(t){if(!Wq(t))return!1;if(Sqe(t)&&this.condition_(t)){var r=t.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(uL);const uOr=lOr;var hOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cOr=function(n){hOr(e,n);function e(t){var r=n.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+t,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,r=this.endPixel_,i="px",a=this.element_.style;a.left=Math.min(t[0],r[0])+i,a.top=Math.min(t[1],r[1])+i,a.width=Math.abs(r[0]-t[0])+i,a.height=Math.abs(r[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,r){this.startPixel_=t,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,r=this.endPixel_,i=[t,[t[0],r[1]],r,[r[0],t[1]]],a=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);a[4]=a[0].slice(),this.geometry_?this.geometry_.setCoordinates([a]):this.geometry_=new m2([a])},e.prototype.getGeometry=function(){return this.geometry_},e}(PV);const fOr=cOr;var Eqe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),I6={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Hq=function(n){Eqe(e,n);function e(t,r,i){var a=n.call(this,t)||this;return a.coordinate=r,a.mapBrowserEvent=i,a}return e}(Fm),dOr=function(n){Eqe(e,n);function e(t){var r=n.call(this)||this;r.on,r.once,r.un;var i=t||{};return r.box_=new fOr(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:Sqe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(t,r,i){var a=i[0]-r[0],o=i[1]-r[1];return a*a+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Hq(I6.BOXDRAG,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var r=this.boxEndCondition_(t,this.startPixel_,t.pixel);return r&&this.onBoxEnd(t),this.dispatchEvent(new Hq(r?I6.BOXEND:I6.BOXCANCEL,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Hq(I6.BOXSTART,t.coordinate,t)),!0):!1},e.prototype.onBoxEnd=function(t){},e}(uL);const vOr=dOr;var pOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),gOr=function(n){pOr(e,n);function e(t){var r=this,i=t||{},a=i.condition?i.condition:rOr;return r=n.call(this,{condition:a,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(t){var r=this.getMap(),i=r.getView(),a=this.getGeometry();if(this.out_){var o=i.rotatedExtentForGeometry(a),s=i.getResolutionForExtentInternal(o),l=i.getResolution()/s;a=a.clone(),a.scale(l*l)}i.fitInternal(a,{duration:this.duration_,easing:lL})},e}(vOr);const yOr=gOr,Cb={LEFT:37,UP:38,RIGHT:39,DOWN:40};var mOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_Or=function(n){mOr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.defaultCondition_=function(a){return wqe(a)&&bqe(a)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Ci.KEYDOWN){var i=t.originalEvent,a=i.keyCode;if(this.condition_(t)&&(a==Cb.DOWN||a==Cb.LEFT||a==Cb.RIGHT||a==Cb.UP)){var o=t.map,s=o.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;a==Cb.DOWN?h=-l:a==Cb.LEFT?u=-l:a==Cb.RIGHT?u=l:h=l;var c=[u,h];uue(c,s.getRotation()),jPr(s,c,this.duration_),i.preventDefault(),r=!0}}return!r},e}(kk);const xOr=_Or;var SOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),wOr=function(n){SOr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.condition_=i.condition?i.condition:bqe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(t){var r=!1;if(t.type==Ci.KEYDOWN||t.type==Ci.KEYPRESS){var i=t.originalEvent,a=i.charCode;if(this.condition_(t)&&(a=="+".charCodeAt(0)||a=="-".charCodeAt(0))){var o=t.map,s=a=="+".charCodeAt(0)?this.delta_:-this.delta_,l=o.getView();xhe(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(kk);const bOr=wOr;var EOr=function(){function n(e,t,r){this.decay_=e,this.minVelocity_=t,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return n.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},n.prototype.update=function(e,t){this.points_.push(e,t,Date.now())},n.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;for(var r=t-3;r>0&&this.points_[r+2]>e;)r-=3;var i=this.points_[t+2]-this.points_[r+2];if(i<1e3/60)return!1;var a=this.points_[t]-this.points_[r],o=this.points_[t+1]-this.points_[r+1];return this.angle_=Math.atan2(o,a),this.initialVelocity_=Math.sqrt(a*a+o*o)/i,this.initialVelocity_>this.minVelocity_},n.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},n.prototype.getAngle=function(){return this.angle_},n}();const TOr=EOr;var COr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),jq={TRACKPAD:"trackpad",WHEEL:"wheel"},AOr=function(n){COr(e,n);function e(t){var r=this,i=t||{};r=n.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var a=i.condition?i.condition:tOr;return r.condition_=i.onFocusOnly?hre(xqe,a):a,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap().getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var r=t.type;if(r!==Ci.WHEEL)return!0;var i=t.map,a=t.originalEvent;a.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var o;if(t.type==Ci.WHEEL&&(o=a.deltaY,z0r&&a.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=iue),a.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?jq.TRACKPAD:jq.WHEEL);var l=i.getView();if(this.mode_===jq.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=o;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),u),!1},e.prototype.handleWheelZoom_=function(t){var r=t.getView();r.getAnimating()&&r.cancelAnimations();var i=-Ui(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),xhe(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(kk);const Tqe=AOr;var MOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),IOr=function(n){MOr(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=RV),r=n.call(this,a)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(t){var r=0,i=this.targetPointers[0],a=this.targetPointers[1],o=Math.atan2(a.clientY-i.clientY,a.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=o-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=o;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==che){var h=l.getViewport().getBoundingClientRect(),c=She(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(c),this.rotating_&&(l.render(),u.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(uL);const LOr=IOr;var POr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),OOr=function(n){POr(e,n);function e(t){var r=this,i=t||{},a=i;return a.stopDown||(a.stopDown=RV),r=n.call(this,a)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(t){var r=1,i=this.targetPointers[0],a=this.targetPointers[1],o=i.clientX-a.clientX,s=i.clientY-a.clientY,l=Math.sqrt(o*o+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();r!=1&&(this.lastScaleDelta_=r);var c=u.getViewport().getBoundingClientRect(),f=She(this.targetPointers);f[0]-=c.left,f[1]-=c.top,this.anchor_=u.getCoordinateFromPixelInternal(f),u.render(),h.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var r=t.map,i=r.getView(),a=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,a),!1}else return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var r=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(uL);const ROr=OOr;function S7(n,e,t,r,i,a,o){var s,l,u=(t-e)/r;if(u===1)s=e;else if(u===2)s=e,l=i;else if(u!==0){for(var h=n[e],c=n[e+1],f=0,d=[0],v=e+r;v<t;v+=r){var p=n[v],g=n[v+1];f+=Math.sqrt((p-h)*(p-h)+(g-c)*(g-c)),d.push(f),h=p,c=g}var m=i*f,y=I0r(d,m);y<0?(l=(m-d[-y-2])/(d[-y-1]-d[-y-2]),s=e+(-y-2)*r):s=e+y*r}for(var _=o>1?o:2,x=a||new Array(_),v=0;v<_;++v)x[v]=s===void 0?NaN:l===void 0?n[s+v]:S1(n[s+v],n[s+r+v],l);return x}function cre(n,e,t,r,i,a){if(t==e)return null;var o;if(i<n[e+r-1])return a?(o=n.slice(e,e+r),o[r-1]=i,o):null;if(n[t-1]<i)return a?(o=n.slice(t-r,t),o[r-1]=i,o):null;if(i==n[e+r-1])return n.slice(e,e+r);for(var s=e/r,l=t/r;s<l;){var u=s+l>>1;i<n[(u+1)*r-1]?l=u:s=u+1}var h=n[s*r-1];if(i==h)return n.slice((s-1)*r,(s-1)*r+r);var c=n[(s+1)*r-1],f=(i-h)/(c-h);o=[];for(var d=0;d<r-1;++d)o.push(S1(n[(s-1)*r+d],n[s*r+d],f));return o.push(i),o}function DOr(n,e,t,r,i,a,o){if(o)return cre(n,e,t[t.length-1],r,i,a);var s;if(i<n[r-1])return a?(s=n.slice(0,r),s[r-1]=i,s):null;if(n[n.length-1]<i)return a?(s=n.slice(n.length-r),s[r-1]=i,s):null;for(var l=0,u=t.length;l<u;++l){var h=t[l];if(e!=h){if(i<n[e+r-1])return null;if(i<=n[h-1])return cre(n,e,h,r,i,!1);e=h}}return null}var NOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kOr=function(n){NOr(e,n);function e(t,r){var i=n.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,r!==void 0&&!Array.isArray(t[0])?i.setFlatCoordinates(r,t):i.setCoordinates(t,r),i}return e.prototype.appendCoordinate=function(t){this.flatCoordinates?em(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){return a<dT(this.getExtent(),t,r)?a:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fhe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),vhe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,r,i,a))},e.prototype.forEachSegment=function(t){return vqe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,r){if(this.layout!=Ro.XYM&&this.layout!=Ro.XYZM)return null;var i=r!==void 0?r:!1;return cre(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return cS(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,r){return S7(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,this.stride)},e.prototype.getLength=function(){return gXe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=xue(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,Ro.XY)},e.prototype.getType=function(){return Kr.LINE_STRING},e.prototype.intersectsExtent=function(t){return l$(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=s$(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pT);const gm=kOr;var FOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),BOr=function(n){FOr(e,n);function e(t,r,i){var a=n.call(this)||this;if(a.ends_=[],a.maxDelta_=-1,a.maxDeltaRevision_=-1,Array.isArray(t[0]))a.setCoordinates(t,r);else if(r!==void 0&&i)a.setFlatCoordinates(r,t),a.ends_=i;else{for(var o=a.getLayout(),s=t,l=[],u=[],h=0,c=s.length;h<c;++h){var f=s[h];h===0&&(o=f.getLayout()),em(l,f.getFlatCoordinates()),u.push(l.length)}a.setFlatCoordinates(o,l),a.ends_=u}return a}return e.prototype.appendLineString=function(t){this.flatCoordinates?em(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){return a<dT(this.getExtent(),t,r)?a:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(dhe(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),phe(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,r,i,a))},e.prototype.getCoordinateAtM=function(t,r,i){if(this.layout!=Ro.XYM&&this.layout!=Ro.XYZM||this.flatCoordinates.length===0)return null;var a=r!==void 0?r:!1,o=i!==void 0?i:!1;return DOr(this.flatCoordinates,0,this.ends_,this.stride,t,a,o)},e.prototype.getCoordinates=function(){return vN(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new gm(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,r=this.ends_,i=this.layout,a=[],o=0,s=0,l=r.length;s<l;++s){var u=r[s],h=new gm(t.slice(o,u),i);a.push(h),o=u}return a},e.prototype.getFlatMidpoints=function(){for(var t=[],r=this.flatCoordinates,i=0,a=this.ends_,o=this.stride,s=0,l=a.length;s<l;++s){var u=a[s],h=S7(r,i,u,o,.5);em(t,h),i=u}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=a1r(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,i),new e(r,Ro.XY,i)},e.prototype.getType=function(){return Kr.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return yPr(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=ghe(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()},e}(pT);const Cqe=BOr;var GOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),zOr=function(n){GOr(e,n);function e(t,r){var i=n.call(this)||this;return r&&!Array.isArray(t[0])?i.setFlatCoordinates(r,t):i.setCoordinates(t,r),i}return e.prototype.appendPoint=function(t){this.flatCoordinates?em(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){if(a<dT(this.getExtent(),t,r))return a;for(var o=this.flatCoordinates,s=this.stride,l=0,u=o.length;l<u;l+=s){var h=VE(t,r,o[l],o[l+1]);if(h<a){a=h;for(var c=0;c<s;++c)i[c]=o[l+c];i.length=s}}return a},e.prototype.getCoordinates=function(){return cS(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var r=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||r<=t?null:new Qs(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,r=this.layout,i=this.stride,a=[],o=0,s=t.length;o<s;o+=i){var l=new Qs(t.slice(o,o+i),r);a.push(l)}return a},e.prototype.getType=function(){return Kr.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var r=this.flatCoordinates,i=this.stride,a=0,o=r.length;a<o;a+=i){var s=r[a],l=r[a+1];if(sue(t,s,l))return!0}return!1},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=s$(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pT);const whe=zOr;function Aqe(n,e,t,r){for(var i=[],a=Md(),o=0,s=t.length;o<s;++o){var l=t[o];a=lue(n,e,l[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),e=l[l.length-1]}return i}var UOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),VOr=function(n){UOr(e,n);function e(t,r,i){var a=n.call(this)||this;if(a.endss_=[],a.flatInteriorPointsRevision_=-1,a.flatInteriorPoints_=null,a.maxDelta_=-1,a.maxDeltaRevision_=-1,a.orientedRevision_=-1,a.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){for(var o=a.getLayout(),s=t,l=[],u=[],h=0,c=s.length;h<c;++h){var f=s[h];h===0&&(o=f.getLayout());for(var d=l.length,v=f.getEnds(),p=0,g=v.length;p<g;++p)v[p]+=d;em(l,f.getFlatCoordinates()),u.push(v)}r=o,t=l,i=u}return r!==void 0&&i?(a.setFlatCoordinates(r,t),a.endss_=i):a.setCoordinates(t,r),a}return e.prototype.appendPolygon=function(t){var r;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),r=t.getEnds().slice(),this.endss_.push();else{var i=this.flatCoordinates.length;em(this.flatCoordinates,t.getFlatCoordinates()),r=t.getEnds().slice();for(var a=0,o=r.length;a<o;++a)r[a]+=i}this.endss_.push(r),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),i=0;i<t;++i)r[i]=this.endss_[i].slice();var a=new e(this.flatCoordinates.slice(),this.layout,r);return a.applyProperties(this),a},e.prototype.closestPointXY=function(t,r,i,a){return a<dT(this.getExtent(),t,r)?a:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(oPr(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sPr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,r,i,a))},e.prototype.containsXY=function(t,r){return gPr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,r)},e.prototype.getArea=function(){return hPr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var r;return t!==void 0?(r=this.getOrientedFlatCoordinates().slice(),HAe(r,0,this.endss_,this.stride,t)):r=this.flatCoordinates,Pte(r,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Aqe(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=dqe(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new whe(this.getFlatInteriorPoints().slice(),Ro.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;SPr(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=HAe(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],i=[];return r.length=s1r(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,i),new e(r,Ro.XY,i)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var r;if(t===0)r=0;else{var i=this.endss_[t-1];r=i[i.length-1]}var a=this.endss_[t].slice(),o=a[a.length-1];if(r!==0)for(var s=0,l=a.length;s<l;++s)a[s]-=r;return new m2(this.flatCoordinates.slice(r,o),this.layout,a)},e.prototype.getPolygons=function(){for(var t=this.layout,r=this.flatCoordinates,i=this.endss_,a=[],o=0,s=0,l=i.length;s<l;++s){var u=i[s].slice(),h=u[u.length-1];if(o!==0)for(var c=0,f=u.length;c<f;++c)u[c]-=o;var d=new m2(r.slice(o,h),t,u);a.push(d),o=h}return a},e.prototype.getType=function(){return Kr.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return _Pr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,r){this.setLayout(r,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=uPr(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{var a=i[i.length-1];this.flatCoordinates.length=a.length===0?0:a[a.length-1]}this.changed()},e}(pT);const Mqe=VOr;function $Or(n){var e=n||{},t=new gd,r=new TOr(-.005,.05,100),i=e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0;i&&t.push(new uOr);var a=e.doubleClickZoom!==void 0?e.doubleClickZoom:!0;a&&t.push(new qPr({delta:e.zoomDelta,duration:e.zoomDuration}));var o=e.dragPan!==void 0?e.dragPan:!0;o&&t.push(new oOr({onFocusOnly:e.onFocusOnly,kinetic:r}));var s=e.pinchRotate!==void 0?e.pinchRotate:!0;s&&t.push(new LOr);var l=e.pinchZoom!==void 0?e.pinchZoom:!0;l&&t.push(new ROr({duration:e.zoomDuration}));var u=e.keyboard!==void 0?e.keyboard:!0;u&&(t.push(new xOr),t.push(new bOr({delta:e.zoomDelta,duration:e.zoomDuration})));var h=e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0;h&&t.push(new Tqe({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration}));var c=e.shiftDragZoom!==void 0?e.shiftDragZoom:!0;return c&&t.push(new yOr({duration:e.zoomDuration})),t}var WOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),HOr=function(n){WOr(e,n);function e(t){return t=Ao({},t),t.controls||(t.controls=$Pr()),t.interactions||(t.interactions=$Or({onFocusOnly:!0})),n.call(this,t)||this}return e.prototype.createRenderer=function(){return new FLr(this)},e}(RPr);const EA=HOr;(function(){const n=function(e,t,r,i,a,o){e instanceof Nk?e.getLayers().forEach(function(s){n(s,t,r,i,a,o)}):e.getSource()._forEachFeatureAtCoordinate&&e.getSource()._forEachFeatureAtCoordinate(t,r,s=>{i(s,e)},a,o)};EA.prototype.forEachFeatureAtPixelDefault=EA.prototype.forEachFeatureAtPixel,EA.prototype.forEachFeatureAtPixel=EA.prototype.Tc=function(e,t,r,i){const a=r&&r.layerFilter?r.layerFilter:()=>!0,o=this.getLayers().getArray(),s=this.getView().getResolution(),l=this.getCoordinateFromPixel(e);for(let u=0;u<o.length;u++){const h=o[u];h.getVisible()&&a.call(null,h)&&n(h,l,s,t,e,i)}return this.forEachFeatureAtPixelDefault(e,t,r)}})();var jOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),XOr=function(n){jOr(e,n);function e(t,r,i){var a=n.call(this)||this,o=i||{};return a.tileCoord=t,a.state=r,a.interimTile=null,a.key="",a.transition_=o.transition===void 0?250:o.transition,a.transitionStarts_={},a.interpolate=!!o.interpolate,a}return e.prototype.changed=function(){this.dispatchEvent(Ci.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Xr.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,r=this;do{if(t.getState()==Xr.LOADED){t.interimTile=null;break}else t.getState()==Xr.LOADING?r=t:t.getState()==Xr.IDLE?r.interimTile=t.interimTile:r=t;t=r.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Xr.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){ti()},e.prototype.getAlpha=function(t,r){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(!i)i=r,this.transitionStarts_[t]=i;else if(i===-1)return 1;var a=r-i+1e3/60;return a>=this.transition_?1:hqe(a/this.transition_)},e.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(eL);const u$=XOr;var YOr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),qOr=function(n){YOr(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,s)||this;return l.crossOrigin_=a,l.src_=i,l.key=i,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.tileLoadFunction_=o,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Xr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xr.ERROR,this.unlistenImage_(),this.image_=ZOr(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Xr.LOADED:this.state=Xr.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xr.ERROR&&(this.state=Xr.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xr.IDLE&&(this.state=Xr.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=bue(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(u$);function ZOr(){var n=Ad(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Iqe=qOr;var Lqe=.5,my=!0,KOr=10,YAe=.25,JOr=function(){function n(e,t,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;var s={},l=__(this.targetProj_,this.sourceProj_);this.transformInv_=function(_){var x=_[0]+"/"+_[1];return s[x]||(s[x]=l(_)),s[x]},this.maxSourceExtent_=i,this.errorThresholdSquared_=a*a,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Co(i)==Co(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Co(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Co(this.targetProj_.getExtent()):null;var u=Lw(r),h=BV(r),c=FV(r),f=kV(r),d=this.transformInv_(u),v=this.transformInv_(h),p=this.transformInv_(c),g=this.transformInv_(f),m=KOr+(o?Math.max(0,Math.ceil(eyr(wte(r)/(o*o*256*256)))):0);if(this.addQuad_(u,h,c,f,d,v,p,g,m),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(_,x,S){y=Math.min(y,_.source[0][0],_.source[1][0],_.source[2][0])}),this.triangles_.forEach(function(_){if(Math.max(_.source[0][0],_.source[1][0],_.source[2][0])-y>this.sourceWorldWidth_/2){var x=[[_.source[0][0],_.source[0][1]],[_.source[1][0],_.source[1][1]],[_.source[2][0],_.source[2][1]]];x[0][0]-y>this.sourceWorldWidth_/2&&(x[0][0]-=this.sourceWorldWidth_),x[1][0]-y>this.sourceWorldWidth_/2&&(x[1][0]-=this.sourceWorldWidth_),x[2][0]-y>this.sourceWorldWidth_/2&&(x[2][0]-=this.sourceWorldWidth_);var S=Math.min(x[0][0],x[1][0],x[2][0]),w=Math.max(x[0][0],x[1][0],x[2][0]);w-S<this.sourceWorldWidth_/2&&(_.source=x)}}.bind(this))}s={}}return n.prototype.addTriangle_=function(e,t,r,i,a,o){this.triangles_.push({source:[i,a,o],target:[e,t,r]})},n.prototype.addQuad_=function(e,t,r,i,a,o,s,l,u){var h=e7([a,o,s,l]),c=this.sourceWorldWidth_?Co(h)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&c>.5&&c<1,v=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var p=e7([e,t,r,i]),g=Co(p)/this.targetWorldWidth_;v=g>YAe||v}!d&&this.sourceProj_.isGlobal()&&c&&(v=c>YAe||v)}if(!(!v&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Cl(h,this.maxSourceExtent_))){var m=0;if(!v&&(!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)v=!0;else if(m=(!isFinite(a[0])||!isFinite(a[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!v){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],_=this.transformInv_(y),x=void 0;if(d){var S=(bS(a[0],f)+bS(s[0],f))/2;x=S-bS(_[0],f)}else x=(a[0]+s[0])/2-_[0];var w=(a[1]+s[1])/2-_[1],b=x*x+w*w;v=b>this.errorThresholdSquared_}if(v){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var E=[(t[0]+r[0])/2,(t[1]+r[1])/2],T=this.transformInv_(E),C=[(i[0]+e[0])/2,(i[1]+e[1])/2],A=this.transformInv_(C);this.addQuad_(e,t,E,C,a,o,T,A,u-1),this.addQuad_(C,E,r,i,A,T,s,l,u-1)}else{var M=[(e[0]+t[0])/2,(e[1]+t[1])/2],I=this.transformInv_(M),R=[(r[0]+i[0])/2,(r[1]+i[1])/2],k=this.transformInv_(R);this.addQuad_(e,M,R,i,a,I,k,l,u-1),this.addQuad_(M,t,r,R,I,o,s,k,u-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(e,r,i,a,s,l),(m&14)==0&&this.addTriangle_(e,r,t,a,s,o),m&&((m&13)==0&&this.addTriangle_(t,i,e,o,l,a),(m&7)==0&&this.addTriangle_(t,i,r,o,l,s))}},n.prototype.calculateSourceExtent=function(){var e=Md();return this.triangles_.forEach(function(t,r,i){var a=t.source;MR(e,a[0]),MR(e,a[1]),MR(e,a[2])}),e},n.prototype.getTriangles=function(){return this.triangles_},n}();const Pqe=JOr;var w7={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Oqe={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Xq;function qAe(n,e,t,r,i){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(r,i),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,r)+1,Math.max(t,i)),n.restore()}function Yq(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function QOr(){if(Xq===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",qAe(n,4,5,4,0),qAe(n,4,5,0,5);var e=n.getImageData(0,0,3,3).data;Xq=Yq(e,0)||Yq(e,4)||Yq(e,8)}return Xq}function b7(n,e,t,r){var i=r7(t,e,n),a=sN(e,r,t),o=e.getMetersPerUnit();o!==void 0&&(a*=o);var s=n.getMetersPerUnit();s!==void 0&&(a/=s);var l=n.getExtent();if(!l||dv(l,i)){var u=sN(n,a,i)/a;isFinite(u)&&u>0&&(a/=u)}return a}function eRr(n,e,t,r){var i=kf(t),a=b7(n,e,i,r);return(!isFinite(a)||a<=0)&&$je(t,function(o){return a=b7(n,e,o,r),isFinite(a)&&a>0}),a}function Rqe(n,e,t,r,i,a,o,s,l,u,h,c){var f=Ad(Math.round(t*n),Math.round(t*e));if(c||Ao(f,w7),l.length===0)return f.canvas;f.scale(t,t);function d(x){return Math.round(x*t)/t}f.globalCompositeOperation="lighter";var v=Md();l.forEach(function(x,S,w){Uje(v,x.extent)});var p=Co(v),g=lh(v),m=Ad(Math.round(t*p/r),Math.round(t*g/r));c||Ao(m,w7);var y=t/r;l.forEach(function(x,S,w){var b=x.extent[0]-v[0],E=-(x.extent[3]-v[3]),T=Co(x.extent),C=lh(x.extent);x.image.width>0&&x.image.height>0&&m.drawImage(x.image,u,u,x.image.width-2*u,x.image.height-2*u,b*y,E*y,T*y,C*y)});var _=Lw(o);return s.getTriangles().forEach(function(x,S,w){var b=x.source,E=x.target,T=b[0][0],C=b[0][1],A=b[1][0],M=b[1][1],I=b[2][0],R=b[2][1],k=d((E[0][0]-_[0])/a),D=d(-(E[0][1]-_[1])/a),G=d((E[1][0]-_[0])/a),W=d(-(E[1][1]-_[1])/a),z=d((E[2][0]-_[0])/a),V=d(-(E[2][1]-_[1])/a),q=T,Y=C;T=0,C=0,A-=q,M-=Y,I-=q,R-=Y;var le=[[A,M,0,0,G-k],[I,R,0,0,z-k],[0,0,A,M,W-D],[0,0,I,R,V-D]],j=tyr(le);if(!!j){if(f.save(),f.beginPath(),QOr()||!c){f.moveTo(G,W);for(var Q=4,ie=k-G,oe=D-W,se=0;se<Q;se++)f.lineTo(G+d((se+1)*ie/Q),W+d(se*oe/(Q-1))),se!=Q-1&&f.lineTo(G+d((se+1)*ie/Q),W+d((se+1)*oe/(Q-1)));f.lineTo(z,V)}else f.moveTo(G,W),f.lineTo(k,D),f.lineTo(z,V);f.clip(),f.transform(j[0],j[2],j[1],j[3],k,D),f.translate(v[0]-q,v[3]-Y),f.scale(r/t,-r/t),f.drawImage(m.canvas,0,0),f.restore()}}),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,s.getTriangles().forEach(function(x,S,w){var b=x.target,E=(b[0][0]-_[0])/a,T=-(b[0][1]-_[1])/a,C=(b[1][0]-_[0])/a,A=-(b[1][1]-_[1])/a,M=(b[2][0]-_[0])/a,I=-(b[2][1]-_[1])/a;f.beginPath(),f.moveTo(C,A),f.lineTo(E,T),f.lineTo(M,I),f.closePath(),f.stroke()}),f.restore()),f.canvas}var tRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),rRr=function(n){tRr(e,n);function e(t,r,i,a,o,s,l,u,h,c,f,d){var v=n.call(this,o,Xr.IDLE,{interpolate:!!d})||this;v.renderEdges_=f!==void 0?f:!1,v.pixelRatio_=l,v.gutter_=u,v.canvas_=null,v.sourceTileGrid_=r,v.targetTileGrid_=a,v.wrappedTileCoord_=s||o,v.sourceTiles_=[],v.sourcesListenerKeys_=null,v.sourceZ_=0;var p=a.getTileCoordExtent(v.wrappedTileCoord_),g=v.targetTileGrid_.getExtent(),m=v.sourceTileGrid_.getExtent(),y=g?tm(p,g):p;if(wte(y)===0)return v.state=Xr.EMPTY,v;var _=t.getExtent();_&&(m?m=tm(m,_):m=_);var x=a.getResolution(v.wrappedTileCoord_[0]),S=eRr(t,i,y,x);if(!isFinite(S)||S<=0)return v.state=Xr.EMPTY,v;var w=c!==void 0?c:Lqe;if(v.triangulation_=new Pqe(t,i,y,m,S*w,x),v.triangulation_.getTriangles().length===0)return v.state=Xr.EMPTY,v;v.sourceZ_=r.getZForResolution(S);var b=v.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(b[1]=Ui(b[1],m[1],m[3]),b[3]=Ui(b[3],m[1],m[3])):b=tm(b,m)),!wte(b))v.state=Xr.EMPTY;else{for(var E=r.getTileRangeForExtentAndZ(b,v.sourceZ_),T=E.minX;T<=E.maxX;T++)for(var C=E.minY;C<=E.maxY;C++){var A=h(v.sourceZ_,T,C,l);A&&v.sourceTiles_.push(A)}v.sourceTiles_.length===0&&(v.state=Xr.EMPTY)}return v}return e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(h,c,f){h&&h.getState()==Xr.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(h.tileCoord),image:h.getImage()})}.bind(this)),this.sourceTiles_.length=0,t.length===0)this.state=Xr.ERROR;else{var r=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(r),a=typeof i=="number"?i:i[0],o=typeof i=="number"?i:i[1],s=this.targetTileGrid_.getResolution(r),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Rqe(a,o,this.pixelRatio_,l,this.sourceTileGrid_.getExtent(),s,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Xr.LOADED}this.changed()},e.prototype.load=function(){if(this.state==Xr.IDLE){this.state=Xr.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(r,i,a){var o=r.getState();if(o==Xr.IDLE||o==Xr.LOADING){t++;var s=pa(r,Ci.CHANGE,function(l){var u=r.getState();(u==Xr.LOADED||u==Xr.ERROR||u==Xr.EMPTY)&&(Ms(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(s)}}.bind(this)),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(r,i,a){var o=r.getState();o==Xr.IDLE&&r.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ms),this.sourcesListenerKeys_=null},e}(u$);const Dqe=rRr;var nRr=function(){function n(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return n.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},n.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},n.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},n.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},n.prototype.forEach=function(e){for(var t=this.oldest_;t;)e(t.value_,t.key_,this),t=t.newer},n.prototype.get=function(e,t){var r=this.entries_[e];return ki(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},n.prototype.remove=function(e){var t=this.entries_[e];return ki(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},n.prototype.getCount=function(){return this.count_},n.prototype.getKeys=function(){var e=new Array(this.count_),t=0,r;for(r=this.newest_;r;r=r.older)e[t++]=r.key_;return e},n.prototype.getValues=function(){var e=new Array(this.count_),t=0,r;for(r=this.newest_;r;r=r.older)e[t++]=r.value_;return e},n.prototype.peekLast=function(){return this.oldest_.value_},n.prototype.peekLastKey=function(){return this.oldest_.key_},n.prototype.peekFirstKey=function(){return this.newest_.key_},n.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},n.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},n.prototype.set=function(e,t){ki(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},n.prototype.setSize=function(e){this.highWaterMark=e},n}();const iRr=nRr;function ZAe(n,e,t,r){return r!==void 0?(r[0]=n,r[1]=e,r[2]=t,r):[n,e,t]}function hL(n,e,t){return n+"/"+e+"/"+t}function Nqe(n){return hL(n[0],n[1],n[2])}function aRr(n){var e=n.substring(n.lastIndexOf("/")+1,n.length).split(",").map(Number),t=e[0],r=e[1],i=e[2];return hL(t,r,i)}function kqe(n){return n.split("/").map(Number)}function Fqe(n){return(n[1]<<n[0])+n[2]}function oRr(n,e){var t=n[0],r=n[1],i=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;var a=e.getFullTileRange(t);return a?a.containsXY(r,i):!0}var sRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lRr=function(n){sRr(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.expireCache=function(t){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),r=kqe(t),i=r[0];this.forEach(function(a){a.tileCoord[0]!==i&&(this.remove(Nqe(a.tileCoord)),a.release())}.bind(this))}},e}(iRr);const bhe=lRr,qq={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var Bqe=function(){function n(e,t,r,i){this.minX=e,this.maxX=t,this.minY=r,this.maxY=i}return n.prototype.contains=function(e){return this.containsXY(e[1],e[2])},n.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},n.prototype.containsXY=function(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY},n.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},n.prototype.extend=function(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},n}();function AC(n,e,t,r,i){return i!==void 0?(i.minX=n,i.maxX=e,i.minY=t,i.maxY=r,i):new Bqe(n,e,t,r)}const Gqe=Bqe;var uRr=[0,0,0],Sx=5,hRr=function(){function n(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ki(P0r(this.resolutions_,function(o,s){return s-o},!0),17);var t;if(!e.origins){for(var r=0,i=this.resolutions_.length-1;r<i;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,ki(this.origins_.length==this.resolutions_.length,20));var a=e.extent;a!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Lw(a)),ki(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,ki(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:lhe,ki(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=a!==void 0?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(o,s){var l=new Gqe(Math.min(0,o[0]),Math.max(o[0]-1,-1),Math.min(0,o[1]),Math.max(o[1]-1,-1));if(a){var u=this.getTileRangeForExtentAndZ(a,s);l.minX=Math.max(u.minX,l.minX),l.maxX=Math.min(u.maxX,l.maxX),l.minY=Math.max(u.minY,l.minY),l.maxY=Math.min(u.maxY,l.maxY)}return l},this):a&&this.calculateTileRanges_(a)}return n.prototype.forEachTileCoord=function(e,t,r){for(var i=this.getTileRangeForExtentAndZ(e,t),a=i.minX,o=i.maxX;a<=o;++a)for(var s=i.minY,l=i.maxY;s<=l;++s)r([t,a,s])},n.prototype.forEachTileCoordParentTileRange=function(e,t,r,i){var a,o,s,l=null,u=e[0]-1;for(this.zoomFactor_===2?(o=e[1],s=e[2]):l=this.getTileCoordExtent(e,i);u>=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),s=Math.floor(s/2),a=AC(o,o,s,s,r)):a=this.getTileRangeForExtentAndZ(l,u,r),t(u,a))return!0;--u}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},n.prototype.getResolution=function(e){return this.resolutions_[e]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(e,t,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){var i=e[1]*2,a=e[2]*2;return AC(i,i+1,a,a+1,t)}var o=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e[0]+1,t)}return null},n.prototype.getTileRangeForTileCoordAndZ=function(e,t,r){if(t>this.maxZoom||t<this.minZoom)return null;var i=e[0],a=e[1],o=e[2];if(t===i)return AC(a,o,a,o,r);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,t-i),l=Math.floor(a*s),u=Math.floor(o*s);if(t<i)return AC(l,l,u,u,r);var h=Math.floor(s*(a+1))-1,c=Math.floor(s*(o+1))-1;return AC(l,h,u,c,r)}var f=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(f,t,r)},n.prototype.getTileRangeExtent=function(e,t,r){var i=this.getOrigin(e),a=this.getResolution(e),o=nh(this.getTileSize(e),this.tmpSize_),s=i[0]+t.minX*o[0]*a,l=i[0]+(t.maxX+1)*o[0]*a,u=i[1]+t.minY*o[1]*a,h=i[1]+(t.maxY+1)*o[1]*a;return pm(s,u,l,h,r)},n.prototype.getTileRangeForExtentAndZ=function(e,t,r){var i=uRr;this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,i);var a=i[1],o=i[2];return this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,i),AC(a,i[1],o,i[2],r)},n.prototype.getTileCoordCenter=function(e){var t=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=nh(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*i[0]*r,t[1]-(e[2]+.5)*i[1]*r]},n.prototype.getTileCoordExtent=function(e,t){var r=this.getOrigin(e[0]),i=this.getResolution(e[0]),a=nh(this.getTileSize(e[0]),this.tmpSize_),o=r[0]+e[1]*a[0]*i,s=r[1]-(e[2]+1)*a[1]*i,l=o+a[0]*i,u=s+a[1]*i;return pm(o,s,l,u,t)},n.prototype.getTileCoordForCoordAndResolution=function(e,t,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,r)},n.prototype.getTileCoordForXYAndResolution_=function(e,t,r,i,a){var o=this.getZForResolution(r),s=r/this.getResolution(o),l=this.getOrigin(o),u=nh(this.getTileSize(o),this.tmpSize_),h=s*(e-l[0])/r/u[0],c=s*(l[1]-t)/r/u[1];return i?(h=r6(h,Sx)-1,c=r6(c,Sx)-1):(h=t6(h,Sx),c=t6(c,Sx)),ZAe(o,h,c,a)},n.prototype.getTileCoordForXYAndZ_=function(e,t,r,i,a){var o=this.getOrigin(r),s=this.getResolution(r),l=nh(this.getTileSize(r),this.tmpSize_),u=(e-o[0])/s/l[0],h=(o[1]-t)/s/l[1];return i?(u=r6(u,Sx)-1,h=r6(h,Sx)-1):(u=t6(u,Sx),h=t6(h,Sx)),ZAe(r,u,h,a)},n.prototype.getTileCoordForCoordAndZ=function(e,t,r){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,r)},n.prototype.getTileCoordResolution=function(e){return this.resolutions_[e[0]]},n.prototype.getTileSize=function(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]},n.prototype.getFullTileRange=function(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null},n.prototype.getZForResolution=function(e,t){var r=OV(this.resolutions_,e,t||0);return Ui(r,this.minZoom,this.maxZoom)},n.prototype.calculateTileRanges_=function(e){for(var t=this.resolutions_.length,r=new Array(t),i=this.minZoom;i<t;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r},n}();const ym=hRr;function zqe(n){var e=n.getDefaultTileGrid();return e||(e=Vqe(n),n.setDefaultTileGrid(e)),e}function cRr(n,e,t){var r=e[0],i=n.getTileCoordCenter(e),a=h$(t);if(dv(a,i))return e;var o=Co(a),s=Math.ceil((a[0]-i[0])/o);return i[0]+=o*s,n.getTileCoordForCoordAndZ(i,r)}function fRr(n,e,t,r){var i=r!==void 0?r:TO.TOP_LEFT,a=Uqe(n,e,t);return new ym({extent:n,origin:yyr(n,i),resolutions:a,tileSize:t})}function Ehe(n){var e=n||{},t=e.extent||ya("EPSG:3857").getExtent(),r={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Uqe(t,e.maxZoom,e.tileSize,e.maxResolution)};return new ym(r)}function Uqe(n,e,t,r){for(var i=e!==void 0?e:JLr,a=lh(n),o=Co(n),s=nh(t!==void 0?t:lhe),l=r>0?r:Math.max(o/s[0],a/s[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Vqe(n,e,t,r){var i=h$(n);return fRr(i,e,t,r)}function h$(n){n=ya(n);var e=n.getExtent();if(!e){var t=180*Hp[$c.DEGREES]/n.getMetersPerUnit();e=pm(-t,-t,t,t)}return e}var $qe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),dRr=function(n){$qe(e,n);function e(t){var r=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate})||this;r.on,r.once,r.un,r.opaque_=t.opaque!==void 0?t.opaque:!1,r.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,r.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;var i=[256,256];return r.tileGrid&&nh(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),i),r.tileCache=new bhe(t.cacheSize||0),r.tmpSize=[0,0],r.key_=t.key||"",r.tileOptions={transition:t.transition,interpolate:t.interpolate},r.zDirection=t.zDirection?t.zDirection:0,r}return e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,r){var i=this.getTileCacheForProjection(t);i&&i.expireCache(r)},e.prototype.forEachLoadedTile=function(t,r,i,a){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var s=!0,l,u,h,c=i.minX;c<=i.maxX;++c)for(var f=i.minY;f<=i.maxY;++f)u=hL(r,c,f),h=!1,o.containsKey(u)&&(l=o.get(u),h=l.getState()===Xr.LOADED,h&&(h=a(l)!==!1)),h||(s=!1);return s},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,r,i,a,o){return ti()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:zqe(t)},e.prototype.getTileCacheForProjection=function(t){return ki(Ry(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,r,i){var a=this.getTileGridForProjection(i),o=this.getTilePixelRatio(r),s=nh(a.getTileSize(t),this.tmpSize);return o==1?s:hXe(s,o,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,r){var i=r!==void 0?r:this.getProjection(),a=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=cRr(a,t,i)),oRr(t,a)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),n.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,r){var i=this.getTileCacheForProjection(r);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,r,i,a){},e}(_ue),vRr=function(n){$qe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.tile=r,i}return e}(Fm);const pRr=dRr;function gRr(n,e){var t=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,a=/\{-y\}/g;return function(o,s,l){if(o)return n.replace(t,o[0].toString()).replace(r,o[1].toString()).replace(i,o[2].toString()).replace(a,function(){var u=o[0],h=e.getFullTileRange(u);ki(h,55);var c=h.getHeight()-o[2]-1;return c.toString()})}}function yRr(n,e){for(var t=n.length,r=new Array(t),i=0;i<t;++i)r[i]=gRr(n[i],e);return fre(r)}function fre(n){return n.length===1?n[0]:function(e,t,r){if(e){var i=Fqe(e),a=bS(i,n.length);return n[a](e,t,r)}else return}}function Wqe(n){var e=[],t=/\{([a-z])-([a-z])\}/.exec(n);if(t){var r=t[1].charCodeAt(0),i=t[2].charCodeAt(0),a=void 0;for(a=r;a<=i;++a)e.push(n.replace(t[0],String.fromCharCode(a)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){for(var o=parseInt(t[2],10),s=parseInt(t[1],10);s<=o;s++)e.push(n.replace(t[0],s.toString()));return e}return e.push(n),e}var mRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),_Rr=function(n){mRr(e,n);function e(t){var r=n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(r.tileUrlFunction=t.tileUrlFunction),r.urls=null,t.urls?r.setUrls(t.urls):t.url&&r.setUrl(t.url),r.tileLoadingKeys_={},r}return e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var r=t.target,i=vi(r),a=r.getState(),o;a==Xr.LOADING?(this.tileLoadingKeys_[i]=!0,o=qq.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],o=a==Xr.ERROR?qq.TILELOADERROR:a==Xr.LOADED?qq.TILELOADEND:void 0),o!=null&&this.dispatchEvent(new vRr(o,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,r){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof r<"u"?this.setKey(r):this.changed()},e.prototype.setUrl=function(t){var r=Wqe(t);this.urls=r,this.setUrls(r)},e.prototype.setUrls=function(t){this.urls=t;var r=t.join(`
`);this.generateTileUrlFunction_?this.setTileUrlFunction(yRr(t,this.tileGrid),r):this.setKey(r)},e.prototype.tileUrlFunction=function(t,r,i){},e.prototype.useTile=function(t,r,i){var a=hL(t,r,i);this.tileCache.containsKey(a)&&this.tileCache.get(a)},e}(pRr);const Hqe=_Rr;var xRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),SRr=function(n){xRr(e,n);function e(t){var r=this,i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;return t.interpolate!==void 0&&(i=t.interpolate),r=n.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:wRr,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:i,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this,r.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,r.tileClass=t.tileClass!==void 0?t.tileClass:Iqe,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return e.prototype.canExpireCache=function(){if(!my)return n.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,r){if(!my){n.prototype.expireCache.call(this,t,r);return}var i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?r:{});for(var a in this.tileCacheForProjection){var o=this.tileCacheForProjection[a];o.expireCache(o==i?r:{})}},e.prototype.getGutterForProjection=function(t){return my&&this.getProjection()&&t&&!Ry(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var t=n.prototype.getKey.call(this);return this.getInterpolate()||(t+=":disable-interpolation"),t},e.prototype.getOpaque=function(t){return my&&this.getProjection()&&t&&!Ry(this.getProjection(),t)?!1:n.prototype.getOpaque.call(this,t)},e.prototype.getTileGridForProjection=function(t){if(!my)return n.prototype.getTileGridForProjection.call(this,t);var r=this.getProjection();if(this.tileGrid&&(!r||Ry(r,t)))return this.tileGrid;var i=vi(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=zqe(t)),this.tileGridForProjection[i]},e.prototype.getTileCacheForProjection=function(t){if(!my)return n.prototype.getTileCacheForProjection.call(this,t);var r=this.getProjection();if(!r||Ry(r,t))return this.tileCache;var i=vi(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new bhe(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,r,i,a,o,s){var l=[t,r,i],u=this.getTileCoordForTileUrlFunction(l,o),h=u?this.tileUrlFunction(u,a,o):void 0,c=new this.tileClass(l,h!==void 0?Xr.IDLE:Xr.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=s,c.addEventListener(Ci.CHANGE,this.handleTileChange.bind(this)),c},e.prototype.getTile=function(t,r,i,a,o){var s=this.getProjection();if(!my||!s||!o||Ry(s,o))return this.getTileInternal(t,r,i,a,s||o);var l=this.getTileCacheForProjection(o),u=[t,r,i],h=void 0,c=Nqe(u);l.containsKey(c)&&(h=l.get(c));var f=this.getKey();if(h&&h.key==f)return h;var d=this.getTileGridForProjection(s),v=this.getTileGridForProjection(o),p=this.getTileCoordForTileUrlFunction(u,o),g=new Dqe(s,d,o,v,u,p,this.getTilePixelRatio(a),this.getGutter(),function(m,y,_,x){return this.getTileInternal(m,y,_,x,s)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return g.key=f,h?(g.interimTile=h,g.refreshInterimChain(),l.replace(c,g)):l.set(c,g),g},e.prototype.getTileInternal=function(t,r,i,a,o){var s=null,l=hL(t,r,i),u=this.getKey();if(!this.tileCache.containsKey(l))s=this.createTile_(t,r,i,a,o,u),this.tileCache.set(l,s);else if(s=this.tileCache.get(l),s.key!=u){var h=s;s=this.createTile_(t,r,i,a,o,u),h.getState()==Xr.IDLE?s.interimTile=h.interimTile:s.interimTile=h,s.refreshInterimChain(),this.tileCache.replace(l,s)}return s},e.prototype.setRenderReprojectionEdges=function(t){if(!(!my||this.renderReprojectionEdges_==t)){this.renderReprojectionEdges_=t;for(var r in this.tileCacheForProjection)this.tileCacheForProjection[r].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,r){if(my){var i=ya(t);if(i){var a=vi(i);a in this.tileGridForProjection||(this.tileGridForProjection[a]=r)}}},e}(Hqe);function wRr(n,e){n.getImage().src=e}const Fk=SRr;class c$ extends Fk{constructor(e){var t=e||{},r=t.attributions||"Map Data \xA9 2018 Baidu - GS(2016)2089\u53F7 - Data \xA9 \u957F\u5730\u4E07\u65B9 with <span>\xA9 SuperMap iClient</span>",i=c$.defaultTileGrid(),a=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",o=t.url!==void 0?t.url:"https://maponline{num}.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408",s=t.hidpi||(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1;o=o.replace("{styles}",s?"ph":"pl"),super({attributions:r,cacheSize:t.cacheSize,crossOrigin:a,opaque:t.opaque!==void 0?t.opaque:!0,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,projection:"EPSG:3857",wrapX:t.wrapX,tilePixelRatio:s?2:1,tileGrid:i,tileUrlFunction:u}),t.tileProxy&&(this.tileProxy=t.tileProxy);var l=this;function u(h,c,f){var d=o.replace("{num}",Math.abs((h[1]+h[2])%4)).replace("{z}",h[0].toString()).replace("{x}",h[1].toString()).replace("{y}",function(){console.log(br.getOlVersion());var v=["4","5"].indexOf(br.getOlVersion())>-1?h[2]:-h[2]-1;return v.toString()}).replace("{-y}",function(){var v=h[0],p=i.getFullTileRange(v);ki(p,55);var g=p.getHeight()+h[2];return g.toString()});return l.tileProxy&&(d=l.tileProxy+encodeURIComponent(d)),d}}static defaultTileGrid(){var e=new ym({extent:[-33554432,-33554432,33554432,33554432],resolutions:[262144,131072,65536,32768,16284,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1,.5],origin:[0,0],minZoom:3});return e}}var bRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ERr=function(n){bRr(e,n);function e(t,r,i,a,o,s,l){var u=this,h=t.getExtent(),c=r.getExtent(),f=c?tm(i,c):i,d=kf(f),v=b7(t,r,d,a),p=Lqe,g=new Pqe(t,r,f,h,v*p,a),m=g.calculateSourceExtent(),y=s(m,v,o),_=y?Ai.IDLE:Ai.EMPTY,x=y?y.getPixelRatio():1;return u=n.call(this,i,a,x,_)||this,u.targetProj_=r,u.maxSourceExtent_=h,u.triangulation_=g,u.targetResolution_=a,u.targetExtent_=i,u.sourceImage_=y,u.sourcePixelRatio_=x,u.interpolate_=l,u.canvas_=null,u.sourceListenerKey_=null,u}return e.prototype.disposeInternal=function(){this.state==Ai.LOADING&&this.unlistenSource_(),n.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Ai.LOADED){var r=Co(this.targetExtent_)/this.targetResolution_,i=lh(this.targetExtent_)/this.targetResolution_;this.canvas_=Rqe(r,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Ai.IDLE){this.state=Ai.LOADING,this.changed();var t=this.sourceImage_.getState();t==Ai.LOADED||t==Ai.ERROR?this.reproject_():(this.sourceListenerKey_=pa(this.sourceImage_,Ci.CHANGE,function(r){var i=this.sourceImage_.getState();(i==Ai.LOADED||i==Ai.ERROR)&&(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){Ms(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(wue);const TRr=ERr;var jqe=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Zq={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"},CRr=function(n){jqe(e,n);function e(t,r){var i=n.call(this,t)||this;return i.image=r,i}return e}(Fm),ARr=function(n){jqe(e,n);function e(t){var r=this,i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;return t.interpolate!==void 0&&(i=t.interpolate),r=n.call(this,{attributions:t.attributions,projection:t.projection,state:t.state,interpolate:i})||this,r.on,r.once,r.un,r.resolutions_=t.resolutions!==void 0?t.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var r=OV(this.resolutions_,t,0);t=this.resolutions_[r]}return t},e.prototype.getImage=function(t,r,i,a){var o=this.getProjection();if(!my||!o||!a||Ry(o,a))return o&&(a=o),this.getImageInternal(t,r,i,a);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Ry(this.reprojectedImage_.getProjection(),a)&&this.reprojectedImage_.getResolution()==r&&m_(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new TRr(o,a,t,r,i,function(s,l,u){return this.getImageInternal(s,l,u,o)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_},e.prototype.getImageInternal=function(t,r,i,a){return ti()},e.prototype.handleImageChange=function(t){var r=t.target,i;switch(r.getState()){case Ai.LOADING:this.loading=!0,i=Zq.IMAGELOADSTART;break;case Ai.LOADED:this.loading=!1,i=Zq.IMAGELOADEND;break;case Ai.ERROR:this.loading=!1,i=Zq.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new CRr(i,r))},e}(_ue);function MRr(n,e){n.getImage().src=e}const Xqe=ARr;var IRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),LRr=function(n){IRr(e,n);function e(t){var r=n.call(this)||this;return r.geometries_=t||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Ms),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var t=0,r=this.geometries_.length;t<r;++t)this.changeEventsKeys_.push(pa(this.geometries_[t],Ci.CHANGE,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,r,i,a){if(a<dT(this.getExtent(),t,r))return a;for(var o=this.geometries_,s=0,l=o.length;s<l;++s)a=o[s].closestPointXY(t,r,i,a);return a},e.prototype.containsXY=function(t,r){for(var i=this.geometries_,a=0,o=i.length;a<o;++a)if(i[a].containsXY(t,r))return!0;return!1},e.prototype.computeExtent=function(t){xk(t);for(var r=this.geometries_,i=0,a=r.length;i<a;++i)Uje(t,r[i].getExtent());return t},e.prototype.getGeometries=function(){return KAe(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],r=this.geometries_,i=0,a=r.length;i<a;++i)r[i].getType()===this.getType()?t=t.concat(r[i].getGeometriesArrayRecursive()):t.push(r[i]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],i=this.geometries_,a=!1,o=0,s=i.length;o<s;++o){var l=i[o],u=l.getSimplifiedGeometry(t);r.push(u),u!==l&&(a=!0)}if(a){var h=new e(null);return h.setGeometriesArray(r),h}else return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Kr.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var r=this.geometries_,i=0,a=r.length;i<a;++i)if(r[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return this.geometries_.length===0},e.prototype.rotate=function(t,r){for(var i=this.geometries_,a=0,o=i.length;a<o;++a)i[a].rotate(t,r);this.changed()},e.prototype.scale=function(t,r,i){var a=i;a||(a=kf(this.getExtent()));for(var o=this.geometries_,s=0,l=o.length;s<l;++s)o[s].scale(t,r,a);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(KAe(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var r=this.geometries_,i=0,a=r.length;i<a;++i)r[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,r){for(var i=this.geometries_,a=0,o=i.length;a<o;++a)i[a].translate(t,r);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),n.prototype.disposeInternal.call(this)},e}(vT);function KAe(n){for(var e=[],t=0,r=n.length;t<r;++t)e.push(n[t].clone());return e}const PRr=LRr;var Yqe=function(){function n(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return n.prototype.getReadOptions=function(e,t){var r;if(t){var i=t.dataProjection?ya(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()===$c.TILE_PIXELS&&(i=ya(i),i.setWorldExtent(t.extent)),r={dataProjection:i,featureProjection:t.featureProjection}}return this.adaptOptions(r)},n.prototype.adaptOptions=function(e){return Ao({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},n.prototype.getType=function(){return ti()},n.prototype.readFeature=function(e,t){return ti()},n.prototype.readFeatures=function(e,t){return ti()},n.prototype.readGeometry=function(e,t){return ti()},n.prototype.readProjection=function(e){return ti()},n.prototype.writeFeature=function(e,t){return ti()},n.prototype.writeFeatures=function(e,t){return ti()},n.prototype.writeGeometry=function(e,t){return ti()},n}();function The(n,e,t){var r=t?ya(t.featureProjection):null,i=t?ya(t.dataProjection):null,a;if(r&&i&&!Ry(r,i)?a=(e?n.clone():n).transform(e?r:i,e?i:r):a=n,e&&t&&t.decimals!==void 0){var o=Math.pow(10,t.decimals),s=function(l){for(var u=0,h=l.length;u<h;++u)l[u]=Math.round(l[u]*o)/o;return l};a===n&&(a=n.clone()),a.applyTransform(s)}return a}var ORr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),RRr=function(n){ORr(e,n);function e(){return n.call(this)||this}return e.prototype.getType=function(){return qb.JSON},e.prototype.readFeature=function(t,r){return this.readFeatureFromObject(L6(t),this.getReadOptions(t,r))},e.prototype.readFeatures=function(t,r){return this.readFeaturesFromObject(L6(t),this.getReadOptions(t,r))},e.prototype.readFeatureFromObject=function(t,r){return ti()},e.prototype.readFeaturesFromObject=function(t,r){return ti()},e.prototype.readGeometry=function(t,r){return this.readGeometryFromObject(L6(t),this.getReadOptions(t,r))},e.prototype.readGeometryFromObject=function(t,r){return ti()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(L6(t))},e.prototype.readProjectionFromObject=function(t){return ti()},e.prototype.writeFeature=function(t,r){return JSON.stringify(this.writeFeatureObject(t,r))},e.prototype.writeFeatureObject=function(t,r){return ti()},e.prototype.writeFeatures=function(t,r){return JSON.stringify(this.writeFeaturesObject(t,r))},e.prototype.writeFeaturesObject=function(t,r){return ti()},e.prototype.writeGeometry=function(t,r){return JSON.stringify(this.writeGeometryObject(t,r))},e.prototype.writeGeometryObject=function(t,r){return ti()},e}(Yqe);function L6(n){if(typeof n=="string"){var e=JSON.parse(n);return e||null}else return n!==null?n:null}const DRr=RRr;var NRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kRr=function(n){NRr(e,n);function e(t){var r=this,i=t||{};return r=n.call(this)||this,r.dataProjection=ya(i.dataProjection?i.dataProjection:"EPSG:4326"),i.featureProjection&&(r.defaultFeatureProjection=ya(i.featureProjection)),r.geometryName_=i.geometryName,r.extractGeometryName_=i.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return e.prototype.readFeatureFromObject=function(t,r){var i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};var a=dre(i.geometry,r),o=new d0;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&o.setGeometryName(i.geometry_name),o.setGeometry(a),"id"in i&&o.setId(i.id),i.properties&&o.setProperties(i.properties,!0),o},e.prototype.readFeaturesFromObject=function(t,r){var i=t,a=null;if(i.type==="FeatureCollection"){var o=t;a=[];for(var s=o.features,l=0,u=s.length;l<u;++l)a.push(this.readFeatureFromObject(s[l],r))}else a=[this.readFeatureFromObject(t,r)];return a},e.prototype.readGeometryFromObject=function(t,r){return dre(t,r)},e.prototype.readProjectionFromObject=function(t){var r=t.crs,i;return r?r.type=="name"?i=ya(r.properties.name):r.type==="EPSG"?i=ya("EPSG:"+r.properties.code):ki(!1,36):i=this.dataProjection,i},e.prototype.writeFeatureObject=function(t,r){r=this.adaptOptions(r);var i={type:"Feature",geometry:null,properties:null},a=t.getId();if(a!==void 0&&(i.id=a),!t.hasProperties())return i;var o=t.getProperties(),s=t.getGeometry();return s&&(i.geometry=vre(s,r),delete o[t.getGeometryName()]),v2(o)||(i.properties=o),i},e.prototype.writeFeaturesObject=function(t,r){r=this.adaptOptions(r);for(var i=[],a=0,o=t.length;a<o;++a)i.push(this.writeFeatureObject(t[a],r));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,r){return vre(t,this.adaptOptions(r))},e}(DRr);function dre(n,e){if(!n)return null;var t;switch(n.type){case Kr.POINT:{t=BRr(n);break}case Kr.LINE_STRING:{t=GRr(n);break}case Kr.POLYGON:{t=$Rr(n);break}case Kr.MULTI_POINT:{t=URr(n);break}case Kr.MULTI_LINE_STRING:{t=zRr(n);break}case Kr.MULTI_POLYGON:{t=VRr(n);break}case Kr.GEOMETRY_COLLECTION:{t=FRr(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return The(t,!1,e)}function FRr(n,e){var t=n.geometries.map(function(r){return dre(r,e)});return new PRr(t)}function BRr(n){return new Qs(n.coordinates)}function GRr(n){return new gm(n.coordinates)}function zRr(n){return new Cqe(n.coordinates)}function URr(n){return new whe(n.coordinates)}function VRr(n){return new Mqe(n.coordinates)}function $Rr(n){return new m2(n.coordinates)}function vre(n,e){n=The(n,!0,e);var t=n.getType(),r;switch(t){case Kr.POINT:{r=qRr(n);break}case Kr.LINE_STRING:{r=HRr(n);break}case Kr.POLYGON:{r=ZRr(n,e);break}case Kr.MULTI_POINT:{r=XRr(n);break}case Kr.MULTI_LINE_STRING:{r=jRr(n);break}case Kr.MULTI_POLYGON:{r=YRr(n,e);break}case Kr.GEOMETRY_COLLECTION:{r=WRr(n,e);break}case Kr.CIRCLE:{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return r}function WRr(n,e){var t=n.getGeometriesArray().map(function(r){var i=Ao({},e);return delete i.featureProjection,vre(r,i)});return{type:"GeometryCollection",geometries:t}}function HRr(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function jRr(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function XRr(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function YRr(n,e){var t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function qRr(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function ZRr(n,e){var t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}const jc=kRr;class KRr extends Xqe{constructor(e){if(super({attributions:e.attributions,imageSmoothing:e.imageSmoothing,projection:e.projection,resolutions:e.resolutions}),e.url===void 0)return;this.imageLoadFunction_=e.imageLoadFunction!==void 0?e.imageLoadFunction:MRr,this._image=null,this.renderedRevision_=0,this._crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this._url=e.url,this.ratio_=e.ratio!==void 0?e.ratio:1.5,e.attributions=e.attributions||"Map Data <span>\xA9 SuperMap iServer</span> with \xA9 SuperMap iClient",e.format=e.format?e.format:"png",this._layerUrl=H.urlPathAppend(e.url,"image."+e.format),this._layerUrl=xs.appendCredential(this._layerUrl);const t={},r=e.transparent!==void 0?e.transparent:!0;t.transparent=r;const i=e.cacheEnabled!==void 0?e.cacheEnabled:!0;t.cacheEnabled=i,e.layersID!==void 0&&(t.layersID=e.layersID);let a=!1;e.redirect!==void 0&&(a=e.redirect),t.redirect=a,e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.clipRegionEnabled&&e.clipRegion instanceof vT&&(e.clipRegion=br.toSuperMapGeometry(new jc().writeGeometryObject(e.clipRegion)),e.clipRegion=H.toJSON(Vo.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion)),!!e.overlapDisplayed&&e.overlapDisplayedOptions&&(t.overlapDisplayed=e.overlapDisplayed,t.overlapDisplayedOptions=e.overlapDisplayedOptions.toString()),i===!0&&e.tileversion&&(t.tileversion=e.tileversion),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),e.antialias!==void 0&&(t.antialias=e.antialias),e.markerAngleFixed!==void 0&&(t.markerAngleFixed=e.markerAngleFixed),e.textAngleFixed!==void 0&&(t.textAngleFixed=e.textAngleFixed),e.textOrientationFixed!==void 0&&(t.textOrientationFixed=e.textOrientationFixed),e.paintBackground!==void 0&&(t.paintBackground=e.paintBackground),isNaN(e.maxVisibleTextSize)||(t.maxVisibleTextSize=+e.maxVisibleTextSize),isNaN(e.minVisibleTextSize)||(t.maxVisibleTextSize=+e.minVisibleTextSize),isNaN(e.maxVisibleVertex)||(t.maxVisibleVertex=Math.round(+e.maxVisibleVertex)),this._layerUrl=H.urlAppend(this._layerUrl,H.getParameterString(t)),this.cacheEnabled=i,e.tileProxy&&(this.tileProxy=e.tileProxy)}getImageInternal(e,t,r){t=this.findNearestResolution(t);const i=t/r,a=kf(e),o=Math.ceil(Co(e)/i),s=Math.ceil(lh(e)/i),l=oN(a,i,0,[o,s]),u=Math.ceil(this.ratio_*Co(e)/i),h=Math.ceil(this.ratio_*lh(e)/i),c=oN(a,i,0,[u,h]),f=this._image;if(f&&this.renderedRevision_===this.getRevision()&&f.getResolution()===t&&f.getPixelRatio()===r&&vv(f.getExtent(),l))return f;const d=[Math.round(Co(c)/i),Math.round(lh(c)/i)],v=this._getRequestUrl(c,d);return this._image=new N1r(c,t,r,v,this._crossOrigin,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this._image.addEventListener("change",this.handleImageChange.bind(this)),this._image}_getRequestUrl(e,t){const r={width:t[0],height:t[1],viewBounds:{leftBottom:{x:e[0],y:e[1]},rightTop:{x:e[2],y:e[3]}}};this.cacheEnabled||(r._t=new Date().getTime());let i=H.urlAppend(this._layerUrl,H.getParameterString(r));return this.tileProxy&&(i=this.tileProxy+encodeURIComponent(i)),i}static optionsFromMapJSON(e,t){var r=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],i=a();function a(){var o=28,s=96,l=r[2]-r[0],u=r[3]-r[1],h=l>=u?l:u,c;h===l?c=h/t.viewer.width:c=h/t.viewer.height;var f=[],d=Wl.METER;if(t.coordUnit===Wl.DEGREE&&(d=Wl.DEGREE),t.visibleScales.length>0)for(let p=0;p<t.visibleScales.length;p++)f.push(br.scaleToResolution(t.visibleScales[p],s,d));else for(let p=0;p<o;p++)f.push(c/Math.pow(2,p));function v(p,g){return g-p}return f.sort(v)}return{url:e,resolutions:i}}}var JRr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),QRr=function(n){JRr(e,n);function e(t){var r=t||{},i=r.imageSmoothing!==void 0?r.imageSmoothing:!0;r.interpolate!==void 0&&(i=r.interpolate);var a=r.projection!==void 0?r.projection:"EPSG:3857",o=r.tileGrid!==void 0?r.tileGrid:Ehe({extent:h$(a),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return n.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:i,opaque:r.opaque,projection:a,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:r.wrapX!==void 0?r.wrapX:!0,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return e}(Fk);const E7=QRr;class eDr extends E7{constructor(e){var t=e||{},r=t.attributions||"Map Data \xA92014 SuperMap - GS(2014)6070\u53F7-data\xA9Navinfo with <span>\xA9 SuperMap iClient</span>",i=t.mapName||"quanguo",a=t.mapType||"web",o=t.url||"http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}";o=o.replace("{mapName}",i).replace("{type}",a);var s={attributions:r,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,opaque:t.opaque===void 0?!0:t.opaque,maxZoom:t.maxZoom||18,reprojectionErrorThreshold:t.reprojectionErrorThreshold,url:o,wrapX:t.wrapX};t.tileProxy&&(s.tileLoadFunction=u),super(s),t.tileProxy&&(this.tileProxy=t.tileProxy);var l=this;function u(h,c){h.getImage().src=l.tileProxy+encodeURIComponent(c)}}}const P6={KVP:"KVP",REST:"REST"};function T7(n,e){var t=[];Object.keys(e).forEach(function(i){e[i]!==null&&e[i]!==void 0&&t.push(i+"="+encodeURIComponent(e[i]))});var r=t.join("&");return n=n.replace(/[?&]$/,""),n=n.indexOf("?")===-1?n+"?":n+"&",n+r}var tDr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),rDr=function(n){tDr(e,n);function e(t){var r=n.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})||this;return r.matrixIds_=t.matrixIds,r}return e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(ym);const pre=rDr;var nDr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),iDr=function(n){nDr(e,n);function e(t){var r=this,i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);var a=t.requestEncoding!==void 0?t.requestEncoding:P6.KVP,o=t.tileGrid,s=t.urls;return s===void 0&&t.url!==void 0&&(s=Wqe(t.url)),r=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:o,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:s,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection})||this,r.version_=t.version!==void 0?t.version:"1.0.0",r.format_=t.format!==void 0?t.format:"image/jpeg",r.dimensions_=t.dimensions!==void 0?t.dimensions:{},r.layer_=t.layer,r.matrixSet_=t.matrixSet,r.style_=t.style,r.requestEncoding_=a,r.setKey(r.getKeyForDimensions_()),s&&s.length>0&&(r.tileUrlFunction=fre(s.map(r.createFromWMTSTemplate.bind(r)))),r}return e.prototype.setUrls=function(t){this.urls=t;var r=t.join(`
`);this.setTileUrlFunction(fre(t.map(this.createFromWMTSTemplate.bind(this))),r)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,r=[];for(var i in this.dimensions_)r[t++]=i+"-"+this.dimensions_[i];return r.join("/")},e.prototype.updateDimensions=function(t){Ao(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e.prototype.createFromWMTSTemplate=function(t){var r=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};r==P6.KVP&&Ao(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=r==P6.KVP?T7(t,i):t.replace(/\{(\w+?)\}/g,function(s,l){return l.toLowerCase()in i?i[l.toLowerCase()]:s});var a=this.tileGrid,o=this.dimensions_;return function(s,l,u){if(s){var h={TileMatrix:a.getMatrixId(s[0]),TileCol:s[1],TileRow:s[2]};Ao(h,o);var c=t;return r==P6.KVP?c=T7(c,h):c=c.replace(/\{(\w+?)\}/g,function(f,d){return h[d]}),c}else return}},e}(Fk);const qqe=iDr;class rM extends qqe{constructor(e){var t={vec:"cva",ter:"cta",img:"cia"},r={vec:18,ter:14,img:18},i=e||{},a=i.attributions||"Map Data <a href='http://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='http://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a> with <span>\xA9 SuperMap iClient</span>";i.layerType=i.layerType||"vec",i.layerType=i.isLabel?t[i.layerType]:i.layerType,i.matrixSet=i.projection==="EPSG:4326"||i.projection==="EPSG:4490"?"c":"w",!i.url&&!i.urls&&(i.url="http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?"),i.key&&(i.url=`${i.url}tk=${i.key}`),i.url=i.url.replace("{layer}",i.layerType).replace("{proj}",i.matrixSet);var o=i.tileGrid||rM.getTileGrid(i.projection||"EPSG:3857"),s=i.crossOrigin!==void 0?i.crossOrigin:"anonymous",l={version:i.version||"1.0.0",format:i.format||"tiles",dimensions:i.dimensions||{},layer:i.layerType,matrixSet:i.matrixSet,tileGrid:o,style:i.style||"default",attributions:a,cacheSize:i.cacheSize,crossOrigin:s,opaque:i.opaque===void 0?!0:i.opaque,maxZoom:r[i.layerType],reprojectionErrorThreshold:i.reprojectionErrorThreshold,url:i.url,urls:i.urls,projection:i.projection||"EPSG:3857",wrapX:i.wrapX};i.tileProxy&&(l.tileLoadFunction=h),super(l),i.tileProxy&&(this.tileProxy=i.tileProxy);var u=this;function h(c,f){c.getImage().src=u.tileProxy+encodeURIComponent(f)}}static getTileGrid(e){return e==="EPSG:4326"||e==="EPSG:4490"?rM.default4326TileGrid():rM.default3857TileGrid()}static default4326TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(.703125*2/Math.pow(2,r)),t.push(r);var i=new pre({extent:[-180,-90,180,90],resolutions:e,origin:[-180,90],matrixIds:t,minZoom:1});return i}static default3857TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(78271.51696402031*2/Math.pow(2,r)),t.push(r);var i=new pre({extent:[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7],resolutions:e,matrixIds:t,origin:[-200375083427892e-7,200375083427892e-7],minZoom:1});return i}}class Bp extends Fk{constructor(e){e=e||{},e.attributions=e.attributions||"Map Data <span>\xA9 SuperMap iServer</span> with <span>\xA9 SuperMap iClient</span>",e.format=e.format?e.format:"png",super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,logo:br.getOlVersion()==="4"?e.logo:null,opaque:e.opaque,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:s,wrapX:e.wrapX!==void 0?e.wrapX:!1,cacheEnabled:e.cacheEnabled,layersID:e.layersID}),e.tileProxy&&(this.tileProxy=e.tileProxy),this.options=e,this._url=e.url,this.tileSetsIndex=-1,this.tempIndex=-1,this.dpi=this.options.dpi||96;var t=this,r=H.urlPathAppend(e.url,"tileImage."+e.format);function i(){var l=this,u={};return u.redirect=e.redirect!==void 0?e.redirect:!1,u.transparent=e.transparent!==void 0?e.transparent:!0,u.cacheEnabled=e.cacheEnabled!==!1,l.cacheEnabled=u.cacheEnabled,u._cache=u.cacheEnabled,this.origin&&(u.origin=JSON.stringify({x:this.origin[0],y:this.origin[1]})),e.prjCoordSys&&(u.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(u.layersID=e.layersID.toString()),e.clipRegion instanceof vT&&(e.clipRegionEnabled=!0,e.clipRegion=br.toSuperMapGeometry(new jc().writeGeometryObject(e.clipRegion)),e.clipRegion=H.toJSON(Vo.fromGeometry(e.clipRegion)),u.clipRegionEnabled=e.clipRegionEnabled,u.clipRegion=JSON.stringify(e.clipRegion)),e.overlapDisplayed?u.overlapDisplayed=!0:(u.overlapDisplayed=!1,e.overlapDisplayedOptions&&(u.overlapDisplayedOptions=l.overlapDisplayedOptions.toString())),u.cacheEnabled&&e.tileversion&&(u.tileversion=e.tileversion.toString()),e.rasterfunction&&(u.rasterfunction=JSON.stringify(e.rasterfunction)),u}function a(){return this._paramsChanged&&(this._layerUrl=o.call(this),this._paramsChanged=!1),this._layerUrl||o.call(this)}function o(){return this.requestParams=this.requestParams||i.call(this),this._layerUrl=H.urlAppend(r,H.getParameterString(this.requestParams)),this._layerUrl=xs.appendCredential(this._layerUrl),this._layerUrl}function s(l,u,h){t.tileGrid||(e.extent?(t.tileGrid=Bp.createTileGrid(e.extent),t.resolutions&&(t.tileGrid.resolutions=t.resolutions)):(h.getCode()==="EPSG:3857"&&(t.tileGrid=Bp.createTileGrid([-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7]),t.extent=[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7]),h.getCode()==="EPSG:4326"&&(t.tileGrid=Bp.createTileGrid([-180,-90,180,90]),t.extent=[-180,-90,180,90]))),t.origin=t.tileGrid.getOrigin(0);var c=l[0],f=l[1],d=["4","5"].indexOf(br.getOlVersion())>-1?-l[2]-1:l[2],v=t.tileGrid.getResolution(c),p=t.dpi||96,g=h.getUnits()||Wl.DEGREE;(g==="degrees"||g==="degree")&&(g=Wl.DEGREE),(g==="m"||g==="meter")&&(g=Wl.METER);var m=br.resolutionToScale(v,p,g),y=nh(t.tileGrid.getTileSize(c,t.tmpSize)),_=a.call(t),x=_+encodeURI("&x="+f+"&y="+d+"&width="+y[0]+"&height="+y[1]+"&scale="+m);return t.tileProxy&&(x=t.tileProxy+encodeURIComponent(x)),t.cacheEnabled||(x+="&_t="+new Date().getTime()),x}}setTileSetsInfo(e){this.tileSets=e,br.isArray(this.tileSets)&&(this.tileSets=e[0]),this.tileSets&&(this.dispatchEvent({type:"tilesetsinfoloaded",value:{tileVersions:this.tileSets.tileVersions}}),this.changeTilesVersion())}lastTilesVersion(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()}nextTilesVersion(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()}changeTilesVersion(){var e=this;if(e.tileSets!=null&&!(e.tempIndex===e.tileSetsIndex||this.tempIndex<0)){var t=e.tileSets.tileVersions;if(t&&e.tempIndex<t.length&&e.tempIndex>=0){var r=t[e.tempIndex].name,i=e.mergeTileVersionParam(r);i&&(e.tileSetsIndex=e.tempIndex,e.dispatchEvent({type:"tileversionschanged",value:{tileVersion:t[e.tempIndex]}}))}}}updateCurrentTileSetsIndex(e){this.tempIndex=e}mergeTileVersionParam(e){return e?(this.requestParams.tileversion=e,this._paramsChanged=!0,this.refresh(),!0):!1}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var i=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top];const{visibleScales:a,bounds:o,dpi:s,coordUnit:l}=t;var u=br.scalesToResolutions(a,o,s,l);return r.tileGrid=new ym({extent:i,resolutions:u}),r}static createTileGrid(e,t,r,i,a){var o=Ehe({extent:e,maxZoom:t,minZoom:r,tileSize:i});return new ym({extent:e,minZoom:r,origin:a,resolutions:o.getResolutions(),tileSize:o.getTileSize()})}}function aDr(n){n("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),n("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),n("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),n.WGS84=n["EPSG:4326"],n["EPSG:3785"]=n["EPSG:3857"],n.GOOGLE=n["EPSG:3857"],n["EPSG:900913"]=n["EPSG:3857"],n["EPSG:102113"]=n["EPSG:3857"]}var _2=1,x2=2,nM=3,oDr=4,gre=5,JAe=6378137,sDr=6356752314e-3,QAe=.0066943799901413165,DR=484813681109536e-20,Ir=Math.PI/2,lDr=.16666666666666666,uDr=.04722222222222222,hDr=.022156084656084655,Zr=1e-10,ic=.017453292519943295,Xy=57.29577951308232,qo=Math.PI/4,mN=Math.PI*2,ou=3.14159265359,Vd={};Vd.greenwich=0;Vd.lisbon=-9.131906111111;Vd.paris=2.337229166667;Vd.bogota=-74.080916666667;Vd.madrid=-3.687938888889;Vd.rome=12.452333333333;Vd.bern=7.439583333333;Vd.jakarta=106.807719444444;Vd.ferro=-17.666666666667;Vd.brussels=4.367975;Vd.stockholm=18.058277777778;Vd.athens=23.7163375;Vd.oslo=10.722916666667;const cDr={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var eMe=/[\s_\-\/\(\)]/g;function nw(n,e){if(n[e])return n[e];for(var t=Object.keys(n),r=e.toLowerCase().replace(eMe,""),i=-1,a,o;++i<t.length;)if(a=t[i],o=a.toLowerCase().replace(eMe,""),o===r)return n[a]}function yre(n){var e={},t=n.split("+").map(function(s){return s.trim()}).filter(function(s){return s}).reduce(function(s,l){var u=l.split("=");return u.push(!0),s[u[0].toLowerCase()]=u[1],s},{}),r,i,a,o={proj:"projName",datum:"datumCode",rf:function(s){e.rf=parseFloat(s)},lat_0:function(s){e.lat0=s*ic},lat_1:function(s){e.lat1=s*ic},lat_2:function(s){e.lat2=s*ic},lat_ts:function(s){e.lat_ts=s*ic},lon_0:function(s){e.long0=s*ic},lon_1:function(s){e.long1=s*ic},lon_2:function(s){e.long2=s*ic},alpha:function(s){e.alpha=parseFloat(s)*ic},gamma:function(s){e.rectified_grid_angle=parseFloat(s)},lonc:function(s){e.longc=s*ic},x_0:function(s){e.x0=parseFloat(s)},y_0:function(s){e.y0=parseFloat(s)},k_0:function(s){e.k0=parseFloat(s)},k:function(s){e.k0=parseFloat(s)},a:function(s){e.a=parseFloat(s)},b:function(s){e.b=parseFloat(s)},r_a:function(){e.R_A=!0},zone:function(s){e.zone=parseInt(s,10)},south:function(){e.utmSouth=!0},towgs84:function(s){e.datum_params=s.split(",").map(function(l){return parseFloat(l)})},to_meter:function(s){e.to_meter=parseFloat(s)},units:function(s){e.units=s;var l=nw(cDr,s);l&&(e.to_meter=l.to_meter)},from_greenwich:function(s){e.from_greenwich=s*ic},pm:function(s){var l=nw(Vd,s);e.from_greenwich=(l||parseFloat(s))*ic},nadgrids:function(s){s==="@null"?e.datumCode="none":e.nadgrids=s},axis:function(s){var l="ewnsud";s.length===3&&l.indexOf(s.substr(0,1))!==-1&&l.indexOf(s.substr(1,1))!==-1&&l.indexOf(s.substr(2,1))!==-1&&(e.axis=s)},approx:function(){e.approx=!0}};for(r in t)i=t[r],r in o?(a=o[r],typeof a=="function"?a(i):e[a]=i):e[r]=i;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e}function xf(n){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?xf[n]=yre(arguments[1]):xf[n]=PPe(arguments[1]):xf[n]=t}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(r){Array.isArray(r)?xf.apply(e,r):xf(r)});if(typeof n=="string"){if(n in xf)return xf[n]}else"EPSG"in n?xf["EPSG:"+n.EPSG]=n:"ESRI"in n?xf["ESRI:"+n.ESRI]=n:"IAU2000"in n?xf["IAU2000:"+n.IAU2000]=n:console.log(n);return}}aDr(xf);function fDr(n){return typeof n=="string"}function dDr(n){return n in xf}var vDr=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function pDr(n){return vDr.some(function(e){return n.indexOf(e)>-1})}var gDr=["3857","900913","3785","102113"];function yDr(n){var e=nw(n,"authority");if(!!e){var t=nw(e,"epsg");return t&&gDr.indexOf(t)>-1}}function mDr(n){var e=nw(n,"extension");if(!!e)return nw(e,"proj4")}function _Dr(n){return n[0]==="+"}function xDr(n){if(fDr(n)){if(dDr(n))return xf[n];if(pDr(n)){var e=PPe(n);if(yDr(e))return xf["EPSG:3857"];var t=mDr(e);return t?yre(t):e}if(_Dr(n))return yre(n)}else return n}function tMe(n,e){n=n||{};var t,r;if(!e)return n;for(r in e)t=e[r],t!==void 0&&(n[r]=t);return n}function mm(n,e,t){var r=n*e;return t/Math.sqrt(1-r*r)}function Bk(n){return n<0?-1:1}function fn(n){return Math.abs(n)<=ou?n:n-Bk(n)*mN}function v0(n,e,t){var r=n*t,i=.5*n;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(Ir-e))/r}function _N(n,e){for(var t=.5*n,r,i,a=Ir-2*Math.atan(e),o=0;o<=15;o++)if(r=n*Math.sin(a),i=Ir-2*Math.atan(e*Math.pow((1-r)/(1+r),t))-a,a+=i,Math.abs(i)<=1e-10)return a;return-9999}function SDr(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=mm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function wDr(n){var e=n.x,t=n.y;if(t*Xy>90&&t*Xy<-90&&e*Xy>180&&e*Xy<-180)return null;var r,i;if(Math.abs(Math.abs(t)-Ir)<=Zr)return null;if(this.sphere)r=this.x0+this.a*this.k0*fn(e-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(qo+.5*t));else{var a=Math.sin(t),o=v0(this.e,t,a);r=this.x0+this.a*this.k0*fn(e-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return n.x=r,n.y=i,n}function bDr(n){var e=n.x-this.x0,t=n.y-this.y0,r,i;if(this.sphere)i=Ir-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var a=Math.exp(-t/(this.a*this.k0));if(i=_N(this.e,a),i===-9999)return null}return r=fn(this.long0+e/(this.a*this.k0)),n.x=r,n.y=i,n}var EDr=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const TDr={init:SDr,forward:wDr,inverse:bDr,names:EDr};function CDr(){}function rMe(n){return n}var ADr=["longlat","identity"];const MDr={init:CDr,forward:rMe,inverse:rMe,names:ADr};var IDr=[TDr,MDr],g8={},C7=[];function Zqe(n,e){var t=C7.length;return n.names?(C7[t]=n,n.names.forEach(function(r){g8[r.toLowerCase()]=t}),this):(console.log(e),!0)}function LDr(n){if(!n)return!1;var e=n.toLowerCase();if(typeof g8[e]<"u"&&C7[g8[e]])return C7[g8[e]]}function PDr(){IDr.forEach(Zqe)}const ODr={start:PDr,add:Zqe,get:LDr};var Pi={};Pi.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Pi.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Pi.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Pi.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Pi.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Pi.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Pi.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Pi.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Pi.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Pi.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Pi.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Pi.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Pi.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Pi.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Pi.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Pi.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Pi.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Pi.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Pi.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Pi.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Pi.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Pi.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Pi.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Pi.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Pi.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Pi.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Pi.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Pi.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Pi.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Pi.hough={a:6378270,rf:297,ellipseName:"Hough"};Pi.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Pi.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Pi.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Pi.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Pi.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Pi.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Pi.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Pi.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Pi.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Pi.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Pi.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Pi.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var RDr=Pi.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Pi.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function DDr(n,e,t,r){var i=n*n,a=e*e,o=(i-a)/i,s=0;r?(n*=1-o*(lDr+o*(uDr+o*hDr)),i=n*n,o=0):s=Math.sqrt(o);var l=(i-a)/a;return{es:o,e:s,ep2:l}}function NDr(n,e,t,r,i){if(!n){var a=nw(Pi,r);a||(a=RDr),n=a.a,e=a.b,t=a.rf}return t&&!e&&(e=(1-1/t)*n),(t===0||Math.abs(n-e)<Zr)&&(i=!0,e=n),{a:n,b:e,rf:t,sphere:i}}var Qh={};Qh.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};Qh.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};Qh.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};Qh.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};Qh.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};Qh.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};Qh.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};Qh.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"};Qh.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};Qh.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};Qh.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};Qh.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};Qh.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};Qh.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};Qh.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};Qh.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};Qh.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function kDr(n,e,t,r,i,a,o){var s={};return n===void 0||n==="none"?s.datum_type=gre:s.datum_type=oDr,e&&(s.datum_params=e.map(parseFloat),(s.datum_params[0]!==0||s.datum_params[1]!==0||s.datum_params[2]!==0)&&(s.datum_type=_2),s.datum_params.length>3&&(s.datum_params[3]!==0||s.datum_params[4]!==0||s.datum_params[5]!==0||s.datum_params[6]!==0)&&(s.datum_type=x2,s.datum_params[3]*=DR,s.datum_params[4]*=DR,s.datum_params[5]*=DR,s.datum_params[6]=s.datum_params[6]/1e6+1)),o&&(s.datum_type=nM,s.grids=o),s.a=t,s.b=r,s.es=i,s.ep2=a,s}var Kqe={};function FDr(n,e){var t=new DataView(e),r=zDr(t),i=UDr(t,r);i.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a=VDr(t,i,r),o={header:i,subgrids:a};return Kqe[n]=o,o}function BDr(n){if(n===void 0)return null;var e=n.split(",");return e.map(GDr)}function GDr(n){if(n.length===0)return null;var e=n[0]==="@";return e&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:n,mandatory:!e,grid:Kqe[n]||null,isNull:!1}}function TA(n){return n/3600*Math.PI/180}function zDr(n){var e=n.getInt32(8,!1);return e===11?!1:(e=n.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function UDr(n,e){return{nFields:n.getInt32(8,e),nSubgridFields:n.getInt32(24,e),nSubgrids:n.getInt32(40,e),shiftType:mre(n,56,56+8).trim(),fromSemiMajorAxis:n.getFloat64(120,e),fromSemiMinorAxis:n.getFloat64(136,e),toSemiMajorAxis:n.getFloat64(152,e),toSemiMinorAxis:n.getFloat64(168,e)}}function mre(n,e,t){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(e,t)))}function VDr(n,e,t){for(var r=176,i=[],a=0;a<e.nSubgrids;a++){var o=WDr(n,r,t),s=HDr(n,r,o,t),l=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),u=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);i.push({ll:[TA(o.lowerLongitude),TA(o.lowerLatitude)],del:[TA(o.longitudeInterval),TA(o.latitudeInterval)],lim:[l,u],count:o.gridNodeCount,cvs:$Dr(s)})}return i}function $Dr(n){return n.map(function(e){return[TA(e.longitudeShift),TA(e.latitudeShift)]})}function WDr(n,e,t){return{name:mre(n,e+8,e+16).trim(),parent:mre(n,e+24,e+24+8).trim(),lowerLatitude:n.getFloat64(e+72,t),upperLatitude:n.getFloat64(e+88,t),lowerLongitude:n.getFloat64(e+104,t),upperLongitude:n.getFloat64(e+120,t),latitudeInterval:n.getFloat64(e+136,t),longitudeInterval:n.getFloat64(e+152,t),gridNodeCount:n.getInt32(e+168,t)}}function HDr(n,e,t,r){for(var i=e+176,a=16,o=[],s=0;s<t.gridNodeCount;s++){var l={latitudeShift:n.getFloat32(i+s*a,r),longitudeShift:n.getFloat32(i+s*a+4,r),latitudeAccuracy:n.getFloat32(i+s*a+8,r),longitudeAccuracy:n.getFloat32(i+s*a+12,r)};o.push(l)}return o}function nm(n,e){if(!(this instanceof nm))return new nm(n);e=e||function(u){if(u)throw u};var t=xDr(n);if(typeof t!="object"){e(n);return}var r=nm.projections.get(t.projName);if(!r){e(n);return}if(t.datumCode&&t.datumCode!=="none"){var i=nw(Qh,t.datumCode);i&&(t.datum_params=t.datum_params||(i.towgs84?i.towgs84.split(","):null),t.ellps=i.ellipse,t.datumName=i.datumName?i.datumName:t.datumCode)}t.k0=t.k0||1,t.axis=t.axis||"enu",t.ellps=t.ellps||"wgs84",t.lat1=t.lat1||t.lat0;var a=NDr(t.a,t.b,t.rf,t.ellps,t.sphere),o=DDr(a.a,a.b,a.rf,t.R_A),s=BDr(t.nadgrids),l=t.datum||kDr(t.datumCode,t.datum_params,a.a,a.b,o.es,o.ep2,s);tMe(this,t),tMe(this,r),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),e(null,this)}nm.projections=ODr;nm.projections.start();function jDr(n,e){return n.datum_type!==e.datum_type||n.a!==e.a||Math.abs(n.es-e.es)>5e-11?!1:n.datum_type===_2?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]:n.datum_type===x2?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]&&n.datum_params[3]===e.datum_params[3]&&n.datum_params[4]===e.datum_params[4]&&n.datum_params[5]===e.datum_params[5]&&n.datum_params[6]===e.datum_params[6]:!0}function Jqe(n,e,t){var r=n.x,i=n.y,a=n.z?n.z:0,o,s,l,u;if(i<-Ir&&i>-1.001*Ir)i=-Ir;else if(i>Ir&&i<1.001*Ir)i=Ir;else{if(i<-Ir)return{x:-1/0,y:-1/0,z:n.z};if(i>Ir)return{x:1/0,y:1/0,z:n.z}}return r>Math.PI&&(r-=2*Math.PI),s=Math.sin(i),u=Math.cos(i),l=s*s,o=t/Math.sqrt(1-e*l),{x:(o+a)*u*Math.cos(r),y:(o+a)*u*Math.sin(r),z:(o*(1-e)+a)*s}}function Qqe(n,e,t,r){var i=1e-12,a=i*i,o=30,s,l,u,h,c,f,d,v,p,g,m,y,_,x=n.x,S=n.y,w=n.z?n.z:0,b,E,T;if(s=Math.sqrt(x*x+S*S),l=Math.sqrt(x*x+S*S+w*w),s/t<i){if(b=0,l/t<i)return E=Ir,T=-r,{x:n.x,y:n.y,z:n.z}}else b=Math.atan2(S,x);u=w/l,h=s/l,c=1/Math.sqrt(1-e*(2-e)*h*h),v=h*(1-e)*c,p=u*c,_=0;do _++,d=t/Math.sqrt(1-e*p*p),T=s*v+w*p-d*(1-e*p*p),f=e*d/(d+T),c=1/Math.sqrt(1-f*(2-f)*h*h),g=h*(1-f)*c,m=u*c,y=m*v-g*p,v=g,p=m;while(y*y>a&&_<o);return E=Math.atan(m/Math.abs(g)),{x:b,y:E,z:T}}function XDr(n,e,t){if(e===_2)return{x:n.x+t[0],y:n.y+t[1],z:n.z+t[2]};if(e===x2){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6];return{x:u*(n.x-l*n.y+s*n.z)+r,y:u*(l*n.x+n.y-o*n.z)+i,z:u*(-s*n.x+o*n.y+n.z)+a}}}function YDr(n,e,t){if(e===_2)return{x:n.x-t[0],y:n.y-t[1],z:n.z-t[2]};if(e===x2){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],h=(n.x-r)/u,c=(n.y-i)/u,f=(n.z-a)/u;return{x:h+l*c-s*f,y:-l*h+c+o*f,z:s*h-o*c+f}}}function O6(n){return n===_2||n===x2}function qDr(n,e,t){if(jDr(n,e)||n.datum_type===gre||e.datum_type===gre)return t;var r=n.a,i=n.es;if(n.datum_type===nM){var a=nMe(n,!1,t);if(a!==0)return;r=JAe,i=QAe}var o=e.a,s=e.b,l=e.es;if(e.datum_type===nM&&(o=JAe,s=sDr,l=QAe),i===l&&r===o&&!O6(n.datum_type)&&!O6(e.datum_type))return t;if(t=Jqe(t,i,r),O6(n.datum_type)&&(t=XDr(t,n.datum_type,n.datum_params)),O6(e.datum_type)&&(t=YDr(t,e.datum_type,e.datum_params)),t=Qqe(t,l,o,s),e.datum_type===nM){var u=nMe(e,!0,t);if(u!==0)return}return t}function nMe(n,e,t){if(n.grids===null||n.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var r={x:-t.x,y:t.y},i={x:Number.NaN,y:Number.NaN},a=[],o=0;o<n.grids.length;o++){var s=n.grids[o];if(a.push(s.name),s.isNull){i=r;break}if(s.mandatory,s.grid===null){if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1;continue}var l=s.grid.subgrids[0],u=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,h=l.ll[0]-u,c=l.ll[1]-u,f=l.ll[0]+(l.lim[0]-1)*l.del[0]+u,d=l.ll[1]+(l.lim[1]-1)*l.del[1]+u;if(!(c>r.y||h>r.x||d<r.y||f<r.x)&&(i=ZDr(r,e,l),!isNaN(i.x)))break}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*Xy+" "+r.y*Xy+" tried: '"+a+"'"),-1):(t.x=-i.x,t.y=i.y,0)}function ZDr(n,e,t){var r={x:Number.NaN,y:Number.NaN};if(isNaN(n.x))return r;var i={x:n.x,y:n.y};i.x-=t.ll[0],i.y-=t.ll[1],i.x=fn(i.x-Math.PI)+Math.PI;var a=iMe(i,t);if(e){if(isNaN(a.x))return r;a.x=i.x-a.x,a.y=i.y-a.y;var o=9,s=1e-12,l,u;do{if(u=iMe(a,t),isNaN(u.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:i.x-(u.x+a.x),y:i.y-(u.y+a.y)},a.x+=l.x,a.y+=l.y}while(o--&&Math.abs(l.x)>s&&Math.abs(l.y)>s);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=fn(a.x+t.ll[0]),r.y=a.y+t.ll[1]}else isNaN(a.x)||(r.x=n.x+a.x,r.y=n.y+a.y);return r}function iMe(n,e){var t={x:n.x/e.del[0],y:n.y/e.del[1]},r={x:Math.floor(t.x),y:Math.floor(t.y)},i={x:t.x-1*r.x,y:t.y-1*r.y},a={x:Number.NaN,y:Number.NaN},o;if(r.x<0||r.x>=e.lim[0]||r.y<0||r.y>=e.lim[1])return a;o=r.y*e.lim[0]+r.x;var s={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var l={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var u={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var h={x:e.cvs[o][0],y:e.cvs[o][1]},c=i.x*i.y,f=i.x*(1-i.y),d=(1-i.x)*(1-i.y),v=(1-i.x)*i.y;return a.x=d*s.x+f*l.x+v*h.x+c*u.x,a.y=d*s.y+f*l.y+v*h.y+c*u.y,a}function aMe(n,e,t){var r=t.x,i=t.y,a=t.z||0,o,s,l,u={};for(l=0;l<3;l++)if(!(e&&l===2&&t.z===void 0))switch(l===0?(o=r,"ew".indexOf(n.axis[l])!==-1?s="x":s="y"):l===1?(o=i,"ns".indexOf(n.axis[l])!==-1?s="y":s="x"):(o=a,s="z"),n.axis[l]){case"e":u[s]=o;break;case"w":u[s]=-o;break;case"n":u[s]=o;break;case"s":u[s]=-o;break;case"u":t[s]!==void 0&&(u.z=o);break;case"d":t[s]!==void 0&&(u.z=-o);break;default:return null}return u}function eZe(n){var e={x:n[0],y:n[1]};return n.length>2&&(e.z=n[2]),n.length>3&&(e.m=n[3]),e}function KDr(n){oMe(n.x),oMe(n.y)}function oMe(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function JDr(n,e){return(n.datum.datum_type===_2||n.datum.datum_type===x2||n.datum.datum_type===nM)&&e.datumCode!=="WGS84"||(e.datum.datum_type===_2||e.datum.datum_type===x2||e.datum.datum_type===nM)&&n.datumCode!=="WGS84"}function A7(n,e,t,r){var i;Array.isArray(t)?t=eZe(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var a=t.z!==void 0;if(KDr(t),n.datum&&e.datum&&JDr(n,e)&&(i=new nm("WGS84"),t=A7(n,i,t,r),n=i),r&&n.axis!=="enu"&&(t=aMe(n,!1,t)),n.projName==="longlat")t={x:t.x*ic,y:t.y*ic,z:t.z||0};else if(n.to_meter&&(t={x:t.x*n.to_meter,y:t.y*n.to_meter,z:t.z||0}),t=n.inverse(t),!t)return;if(n.from_greenwich&&(t.x+=n.from_greenwich),t=qDr(n.datum,e.datum,t),!!t)return e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*Xy,y:t.y*Xy,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),r&&e.axis!=="enu"?aMe(e,!0,t):(a||delete t.z,t)}var sMe=nm("WGS84");function Kq(n,e,t,r){var i,a,o;return Array.isArray(t)?(i=A7(n,e,t,r)||{x:NaN,y:NaN},t.length>2?typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(t.splice(3)):[i.x,i.y,t[2]].concat(t.splice(3)):[i.x,i.y].concat(t.splice(2)):[i.x,i.y]):(a=A7(n,e,t,r),o=Object.keys(t),o.length===2||o.forEach(function(s){if(typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(s==="x"||s==="y"||s==="z")return}else if(s==="x"||s==="y")return;a[s]=t[s]}),a)}function lMe(n){return n instanceof nm?n:n.oProj?n.oProj:nm(n)}function Bu(n,e,t){n=lMe(n);var r=!1,i;return typeof e>"u"?(e=n,n=sMe,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,e=n,n=sMe,r=!0),e=lMe(e),t?Kq(n,e,t):(i={forward:function(a,o){return Kq(n,e,a,o)},inverse:function(a,o){return Kq(e,n,a,o)}},r&&(i.oProj=e),i)}function XM(n,e,t){if(!(this instanceof XM))return new XM(n,e,t);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof e>"u"){var r=n.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=n,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}XM.fromMGRS=function(n){return new XM(xrt(n))};XM.prototype.toMGRS=function(n){return Srt([this.x,this.y],n)};var QDr=1,eNr=.25,uMe=.046875,hMe=.01953125,cMe=.01068115234375,tNr=.75,rNr=.46875,nNr=.013020833333333334,iNr=.007120768229166667,aNr=.3645833333333333,oNr=.005696614583333333,sNr=.3076171875;function tZe(n){var e=[];e[0]=QDr-n*(eNr+n*(uMe+n*(hMe+n*cMe))),e[1]=n*(tNr-n*(uMe+n*(hMe+n*cMe)));var t=n*n;return e[2]=t*(rNr-n*(nNr+n*iNr)),t*=n,e[3]=t*(aNr-n*oNr),e[4]=t*n*sNr,e}function f$(n,e,t,r){return t*=e,e*=e,r[0]*n-t*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var lNr=20;function rZe(n,e,t){for(var r=1/(1-e),i=n,a=lNr;a;--a){var o=Math.sin(i),s=1-e*o*o;if(s=(f$(i,o,Math.cos(i),t)-n)*(s*Math.sqrt(s))*r,i-=s,Math.abs(s)<Zr)return i}return i}function uNr(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=tZe(this.es),this.ml0=f$(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function hNr(n){var e=n.x,t=n.y,r=fn(e-this.long0),i,a,o,s=Math.sin(t),l=Math.cos(t);if(this.es){var h=l*r,c=Math.pow(h,2),f=this.ep2*Math.pow(l,2),d=Math.pow(f,2),v=Math.abs(l)>Zr?Math.tan(t):0,p=Math.pow(v,2),g=Math.pow(p,2);i=1-this.es*Math.pow(s,2),h=h/Math.sqrt(i);var m=f$(t,s,l,this.en);a=this.a*(this.k0*h*(1+c/6*(1-p+f+c/20*(5-18*p+g+14*f-58*p*f+c/42*(61+179*g-g*p-479*p)))))+this.x0,o=this.a*(this.k0*(m-this.ml0+s*r*h/2*(1+c/12*(5-p+9*f+4*d+c/30*(61+g-58*p+270*f-330*p*f+c/56*(1385+543*g-g*p-3111*p))))))+this.y0}else{var u=l*Math.sin(r);if(Math.abs(Math.abs(u)-1)<Zr)return 93;if(a=.5*this.a*this.k0*Math.log((1+u)/(1-u))+this.x0,o=l*Math.cos(r)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(o),u>=1){if(u-1>Zr)return 93;o=0}else o=Math.acos(o);t<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return n.x=a,n.y=o,n}function cNr(n){var e,t,r,i,a=(n.x-this.x0)*(1/this.a),o=(n.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,t=rZe(e,this.es,this.en),Math.abs(t)<Ir){var c=Math.sin(t),f=Math.cos(t),d=Math.abs(f)>Zr?Math.tan(t):0,v=this.ep2*Math.pow(f,2),p=Math.pow(v,2),g=Math.pow(d,2),m=Math.pow(g,2);e=1-this.es*Math.pow(c,2);var y=a*Math.sqrt(e)/this.k0,_=Math.pow(y,2);e=e*d,r=t-e*_/(1-this.es)*.5*(1-_/12*(5+3*g-9*v*g+v-4*p-_/30*(61+90*g-252*v*g+45*m+46*v-_/56*(1385+3633*g+4095*m+1574*m*g)))),i=fn(this.long0+y*(1-_/6*(1+2*g+v-_/20*(5+28*g+24*m+8*v*g+6*v-_/42*(61+662*g+1320*m+720*m*g))))/f)}else r=Ir*Bk(o),i=0;else{var s=Math.exp(a/this.k0),l=.5*(s-1/s),u=this.lat0+o/this.k0,h=Math.cos(u);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),r=Math.asin(e),o<0&&(r=-r),l===0&&h===0?i=0:i=fn(Math.atan2(l,h)+this.long0)}return n.x=i,n.y=r,n}var fNr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const y8={init:uNr,forward:hNr,inverse:cNr,names:fNr};function nZe(n){var e=Math.exp(n);return e=(e-1/e)/2,e}function Kg(n,e){n=Math.abs(n),e=Math.abs(e);var t=Math.max(n,e),r=Math.min(n,e)/(t||1);return t*Math.sqrt(1+Math.pow(r,2))}function dNr(n){var e=1+n,t=e-1;return t===0?n:n*Math.log(e)/t}function vNr(n){var e=Math.abs(n);return e=dNr(e*(1+e/(Kg(1,e)+1))),n<0?-e:e}function Che(n,e){for(var t=2*Math.cos(2*e),r=n.length-1,i=n[r],a=0,o;--r>=0;)o=-a+t*i+n[r],a=i,i=o;return e+o*Math.sin(2*e)}function pNr(n,e){for(var t=2*Math.cos(e),r=n.length-1,i=n[r],a=0,o;--r>=0;)o=-a+t*i+n[r],a=i,i=o;return Math.sin(e)*o}function gNr(n){var e=Math.exp(n);return e=(e+1/e)/2,e}function iZe(n,e,t){for(var r=Math.sin(e),i=Math.cos(e),a=nZe(t),o=gNr(t),s=2*i*o,l=-2*r*a,u=n.length-1,h=n[u],c=0,f=0,d=0,v,p;--u>=0;)v=f,p=c,f=h,c=d,h=-v+s*f-l*c+n[u],d=-p+l*f+s*c;return s=r*o,l=i*a,[s*h-l*d,s*d+l*h]}function yNr(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(y8.init.apply(this),this.forward=y8.forward,this.inverse=y8.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),e=n/(2-n),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var r=Che(this.cbg,this.lat0);this.Zb=-this.Qn*(r+pNr(this.gtu,2*r))}function mNr(n){var e=fn(n.x-this.long0),t=n.y;t=Che(this.cbg,t);var r=Math.sin(t),i=Math.cos(t),a=Math.sin(e),o=Math.cos(e);t=Math.atan2(r,o*i),e=Math.atan2(a*i,Kg(r,i*o)),e=vNr(Math.tan(e));var s=iZe(this.gtu,2*t,2*e);t=t+s[0],e=e+s[1];var l,u;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,u=1/0),n.x=l,n.y=u,n}function _Nr(n){var e=(n.x-this.x0)*(1/this.a),t=(n.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var r,i;if(Math.abs(e)<=2.623395162778){var a=iZe(this.utg,2*t,2*e);t=t+a[0],e=e+a[1],e=Math.atan(nZe(e));var o=Math.sin(t),s=Math.cos(t),l=Math.sin(e),u=Math.cos(e);t=Math.atan2(o*u,Kg(l,u*s)),e=Math.atan2(l,u*s),r=fn(e+this.long0),i=Che(this.cgb,t)}else r=1/0,i=1/0;return n.x=r,n.y=i,n}var xNr=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"];const m8={init:yNr,forward:mNr,inverse:_Nr,names:xNr};function SNr(n,e){if(n===void 0){if(n=Math.floor((fn(e)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var wNr="etmerc";function bNr(){var n=SNr(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*ic,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,m8.init.apply(this),this.forward=m8.forward,this.inverse=m8.inverse}var ENr=["Universal Transverse Mercator System","utm"];const TNr={init:bNr,names:ENr,dependsOn:wNr};function Ahe(n,e){return Math.pow((1-n)/(1+n),e)}var CNr=20;function ANr(){var n=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+qo)/(Math.pow(Math.tan(.5*this.lat0+qo),this.C)*Ahe(this.e*n,this.ratexp))}function MNr(n){var e=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+qo),this.C)*Ahe(this.e*Math.sin(t),this.ratexp))-Ir,n.x=this.C*e,n}function INr(n){for(var e=1e-14,t=n.x/this.C,r=n.y,i=Math.pow(Math.tan(.5*r+qo)/this.K,1/this.C),a=CNr;a>0&&(r=2*Math.atan(i*Ahe(this.e*Math.sin(n.y),-.5*this.e))-Ir,!(Math.abs(r-n.y)<e));--a)n.y=r;return a?(n.x=t,n.y=r,n):null}var LNr=["gauss"];const Mhe={init:ANr,forward:MNr,inverse:INr,names:LNr};function PNr(){Mhe.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function ONr(n){var e,t,r,i;return n.x=fn(n.x-this.long0),Mhe.forward.apply(this,[n]),e=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*r),n.x=i*t*Math.sin(n.x),n.y=i*(this.cosc0*e-this.sinc0*t*r),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function RNr(n){var e,t,r,i,a;if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,a=Math.sqrt(n.x*n.x+n.y*n.y)){var o=2*Math.atan2(a,this.R2);e=Math.sin(o),t=Math.cos(o),i=Math.asin(t*this.sinc0+n.y*e*this.cosc0/a),r=Math.atan2(n.x*e,a*this.cosc0*t-n.y*this.sinc0*e)}else i=this.phic0,r=0;return n.x=r,n.y=i,Mhe.inverse.apply(this,[n]),n.x=fn(n.x+this.long0),n}var DNr=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const NNr={init:PNr,forward:ONr,inverse:RNr,names:DNr};function kNr(n,e,t){return e*=t,Math.tan(.5*(Ir+n))*Math.pow((1-e)/(1+e),.5*t)}function FNr(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Zr&&(this.k0=.5*(1+Bk(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Zr&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Zr&&(this.k0=.5*this.cons*mm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/v0(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=mm(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Ir,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function BNr(n){var e=n.x,t=n.y,r=Math.sin(t),i=Math.cos(t),a,o,s,l,u,h,c=fn(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=Zr&&Math.abs(t+this.lat0)<=Zr?(n.x=NaN,n.y=NaN,n):this.sphere?(a=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(c)),n.x=this.a*a*i*Math.sin(c)+this.x0,n.y=this.a*a*(this.coslat0*r-this.sinlat0*i*Math.cos(c))+this.y0,n):(o=2*Math.atan(this.ssfn_(t,r,this.e))-Ir,l=Math.cos(o),s=Math.sin(o),Math.abs(this.coslat0)<=Zr?(u=v0(this.e,t*this.con,this.con*r),h=2*this.a*this.k0*u/this.cons,n.x=this.x0+h*Math.sin(e-this.long0),n.y=this.y0-this.con*h*Math.cos(e-this.long0),n):(Math.abs(this.sinlat0)<Zr?(a=2*this.a*this.k0/(1+l*Math.cos(c)),n.y=a*s):(a=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*l*Math.cos(c))),n.y=a*(this.cosX0*s-this.sinX0*l*Math.cos(c))+this.y0),n.x=a*l*Math.sin(c)+this.x0,n))}function GNr(n){n.x-=this.x0,n.y-=this.y0;var e,t,r,i,a,o=Math.sqrt(n.x*n.x+n.y*n.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,t=this.lat0,o<=Zr?(n.x=e,n.y=t,n):(t=Math.asin(Math.cos(s)*this.sinlat0+n.y*Math.sin(s)*this.coslat0/o),Math.abs(this.coslat0)<Zr?this.lat0>0?e=fn(this.long0+Math.atan2(n.x,-1*n.y)):e=fn(this.long0+Math.atan2(n.x,n.y)):e=fn(this.long0+Math.atan2(n.x*Math.sin(s),o*this.coslat0*Math.cos(s)-n.y*this.sinlat0*Math.sin(s))),n.x=e,n.y=t,n)}else if(Math.abs(this.coslat0)<=Zr){if(o<=Zr)return t=this.lat0,e=this.long0,n.x=e,n.y=t,n;n.x*=this.con,n.y*=this.con,r=o*this.cons/(2*this.a*this.k0),t=this.con*_N(this.e,r),e=this.con*fn(this.con*this.long0+Math.atan2(n.x,-1*n.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=Zr?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+n.y*Math.sin(i)*this.cosX0/o),e=fn(this.long0+Math.atan2(n.x*Math.sin(i),o*this.cosX0*Math.cos(i)-n.y*this.sinX0*Math.sin(i)))),t=-1*_N(this.e,Math.tan(.5*(Ir+a)));return n.x=e,n.y=t,n}var zNr=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const UNr={init:FNr,forward:BNr,inverse:GNr,names:zNr,ssfn_:kNr};function VNr(){var n=this.lat0;this.lambda0=this.long0;var e=Math.sin(n),t=this.a,r=this.rf,i=1/r,a=2*i-Math.pow(i,2),o=this.e=Math.sqrt(a);this.R=this.k0*t*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),u=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*l+this.alpha*o/2*u}function $Nr(n){var e=Math.log(Math.tan(Math.PI/4-n.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),r=-this.alpha*(e+t)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),a=this.alpha*(n.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return n.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,n.x=this.R*o+this.x0,n}function WNr(n){for(var e=n.x-this.x0,t=n.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,l=0,u=a,h=-1e3,c=0;Math.abs(u-h)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),h=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=s,n.y=u,n}var HNr=["somerc"];const jNr={init:VNr,forward:$Nr,inverse:WNr,names:HNr};var nA=1e-7;function XNr(n){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof n.PROJECTION=="object"?Object.keys(n.PROJECTION)[0]:n.PROJECTION;return"no_uoff"in n||"no_off"in n||e.indexOf(t)!==-1}function YNr(){var n,e,t,r,i,a,o,s,l,u,h=0,c,f=0,d=0,v=0,p=0,g=0,m=0;this.no_off=XNr(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),y&&(m=this.alpha),_&&(h=this.rectified_grid_angle*ic),y||_)f=this.longc;else if(d=this.long1,p=this.lat1,v=this.long2,g=this.lat2,Math.abs(p-g)<=nA||(n=Math.abs(p))<=nA||Math.abs(n-Ir)<=nA||Math.abs(Math.abs(this.lat0)-Ir)<=nA||Math.abs(Math.abs(g)-Ir)<=nA)throw new Error;var x=1-this.es;e=Math.sqrt(x),Math.abs(this.lat0)>Zr?(s=Math.sin(this.lat0),t=Math.cos(this.lat0),n=1-this.es*s*s,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*e/n,r=this.B*e/(t*Math.sqrt(n)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(v0(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=i=1),y||_?(y?(c=Math.asin(Math.sin(m)/r),_||(h=m)):(c=h,m=Math.asin(r*Math.sin(c))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(a=Math.pow(v0(this.e,p,Math.sin(p)),this.B),o=Math.pow(v0(this.e,g,Math.sin(g)),this.B),i=this.E/a,l=(o-a)/(o+a),u=this.E*this.E,u=(u-o*a)/(u+o*a),n=d-v,n<-Math.pi?v-=mN:n>Math.pi&&(v+=mN),this.lam0=fn(.5*(d+v)-Math.atan(u*Math.tan(.5*this.B*(d-v))/l)/this.B),c=Math.atan(2*Math.sin(this.B*fn(d-this.lam0))/(i-1/i)),h=m=Math.asin(r*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(m))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(qo-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(qo+i))}function qNr(n){var e={},t,r,i,a,o,s,l,u;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-Ir)>Zr){if(o=this.E/Math.pow(v0(this.e,n.y,Math.sin(n.y)),this.B),s=1/o,t=.5*(o-s),r=.5*(o+s),a=Math.sin(this.B*n.x),i=(t*this.singam-a*this.cosgam)/r,Math.abs(Math.abs(i)-1)<Zr)throw new Error;u=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*n.x),Math.abs(s)<nA?l=this.A*n.x:l=this.ArB*Math.atan2(t*this.cosgam+a*this.singam,s)}else u=n.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(e.x=l,e.y=u):(l-=this.u_0,e.x=u*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-u*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function ZNr(n){var e,t,r,i,a,o,s,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(t=n.y,e=n.x):(t=n.x*this.cosrot-n.y*this.sinrot,e=n.y*this.cosrot+n.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*t),i=.5*(r-1/r),a=.5*(r+1/r),o=Math.sin(this.BrA*e),s=(o*this.cosgam+i*this.singam)/a,Math.abs(Math.abs(s)-1)<Zr)l.x=0,l.y=s<0?-Ir:Ir;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=_N(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l}var KNr=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const JNr={init:YNr,forward:qNr,inverse:ZNr,names:KNr};function QNr(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Zr)){var n=this.b/this.a;this.e=Math.sqrt(1-n*n);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),r=mm(this.e,e,t),i=v0(this.e,this.lat1,e),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=mm(this.e,a,o),l=v0(this.e,this.lat2,a),u=v0(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Zr?this.ns=Math.log(r/s)/Math.log(i/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function e3r(n){var e=n.x,t=n.y;Math.abs(2*Math.abs(t)-Math.PI)<=Zr&&(t=Bk(t)*(Ir-2*Zr));var r=Math.abs(Math.abs(t)-Ir),i,a;if(r>Zr)i=v0(this.e,t,Math.sin(t)),a=this.a*this.f0*Math.pow(i,this.ns);else{if(r=t*this.ns,r<=0)return null;a=0}var o=this.ns*fn(e-this.long0);return n.x=this.k0*(a*Math.sin(o))+this.x0,n.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,n}function t3r(n){var e,t,r,i,a,o=(n.x-this.x0)/this.k0,s=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+s*s),t=1):(e=-Math.sqrt(o*o+s*s),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*o,t*s)),e!==0||this.ns>0){if(t=1/this.ns,r=Math.pow(e/(this.a*this.f0),t),i=_N(this.e,r),i===-9999)return null}else i=-Ir;return a=fn(l/this.ns+this.long0),n.x=a,n.y=i,n}var r3r=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const n3r={init:QNr,forward:e3r,inverse:t3r,names:r3r};function i3r(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function a3r(n){var e,t,r,i,a,o,s,l=n.x,u=n.y,h=fn(l-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),r=-h*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(r)),a=Math.asin(Math.cos(t)*Math.sin(r)/Math.cos(i)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),n.y=s*Math.cos(o)/1,n.x=s*Math.sin(o)/1,this.czech||(n.y*=-1,n.x*=-1),n}function o3r(n){var e,t,r,i,a,o,s,l,u=n.x;n.x=n.y,n.y=u,this.czech||(n.y*=-1,n.x*=-1),o=Math.sqrt(n.x*n.x+n.y*n.y),a=Math.atan2(n.y,n.x),i=a/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),t=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),n.x=this.long0-t/this.alfa,s=e,l=0;var h=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-n.y)<1e-10&&(l=1),s=n.y,h+=1;while(l===0&&h<15);return h>=15?null:n}var s3r=["Krovak","krovak"];const l3r={init:i3r,forward:a3r,inverse:o3r,names:s3r};function Rf(n,e,t,r,i){return n*i-e*Math.sin(2*i)+t*Math.sin(4*i)-r*Math.sin(6*i)}function Gk(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function zk(n){return .375*n*(1+.25*n*(1+.46875*n))}function Uk(n){return .05859375*n*n*(1+.75*n)}function Vk(n){return n*n*n*(35/3072)}function YM(n,e,t){var r=e*t;return n/Math.sqrt(1-r*r)}function cL(n){return Math.abs(n)<Ir?n:n-Bk(n)*Math.PI}function M7(n,e,t,r,i){var a,o;a=n/e;for(var s=0;s<15;s++)if(o=(n-(e*a-t*Math.sin(2*a)+r*Math.sin(4*a)-i*Math.sin(6*a)))/(e-2*t*Math.cos(2*a)+4*r*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}function u3r(){this.sphere||(this.e0=Gk(this.es),this.e1=zk(this.es),this.e2=Uk(this.es),this.e3=Vk(this.es),this.ml0=this.a*Rf(this.e0,this.e1,this.e2,this.e3,this.lat0))}function h3r(n){var e,t,r=n.x,i=n.y;if(r=fn(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(r)),t=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var a=Math.sin(i),o=Math.cos(i),s=YM(this.a,this.e,a),l=Math.tan(i)*Math.tan(i),u=r*Math.cos(i),h=u*u,c=this.es*o*o/(1-this.es),f=this.a*Rf(this.e0,this.e1,this.e2,this.e3,i);e=s*u*(1-h*l*(1/6-(8-l+8*c)*h/120)),t=f-this.ml0+s*a/o*h*(.5+(5-l+6*c)*h/24)}return n.x=e+this.x0,n.y=t+this.y0,n}function c3r(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,r,i;if(this.sphere){var a=t+this.lat0;r=Math.asin(Math.sin(a)*Math.cos(e)),i=Math.atan2(Math.tan(e),Math.cos(a))}else{var o=this.ml0/this.a+t,s=M7(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-Ir)<=Zr)return n.x=this.long0,n.y=Ir,t<0&&(n.y*=-1),n;var l=YM(this.a,this.e,Math.sin(s)),u=l*l*l/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(s),2),c=e*this.a/l,f=c*c;r=s-l*Math.tan(s)/u*c*c*(.5-(1+3*h)*c*c/24),i=c*(1-f*(h/3+(1+3*h)*h*f/15))/Math.cos(s)}return n.x=fn(i+this.long0),n.y=cL(r),n}var f3r=["Cassini","Cassini_Soldner","cass"];const d3r={init:u3r,forward:h3r,inverse:c3r,names:f3r};function CS(n,e){var t;return n>1e-7?(t=n*e,(1-n*n)*(e/(1-t*t)-.5/n*Math.log((1-t)/(1+t)))):2*e}var v3r=1,p3r=2,g3r=3,y3r=4;function m3r(){var n=Math.abs(this.lat0);if(Math.abs(n-Ir)<Zr?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(n)<Zr?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=CS(this.e,1),this.mmf=.5/(1-this.es),this.apa=A3r(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=CS(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function _3r(n){var e,t,r,i,a,o,s,l,u,h,c=n.x,f=n.y;if(c=fn(c-this.long0),this.sphere){if(a=Math.sin(f),h=Math.cos(f),r=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*r:1+this.sinph0*a+this.cosph0*h*r,t<=Zr)return null;t=Math.sqrt(2/t),e=t*h*Math.sin(c),t*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*h*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(f+this.lat0)<Zr)return null;t=qo-f*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(c),t*=r}}else{switch(s=0,l=0,u=0,r=Math.cos(c),i=Math.sin(c),a=Math.sin(f),o=CS(this.e,a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:u=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:u=1+l*r;break;case this.N_POLE:u=Ir+f,o=this.qp-o;break;case this.S_POLE:u=f-Ir,o=this.qp+o;break}if(Math.abs(u)<Zr)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),this.mode===this.OBLIQ?t=this.ymf*u*(this.cosb1*s-this.sinb1*l*r):t=(u=Math.sqrt(2/(1+l*r)))*s*this.ymf,e=this.xmf*u*l*i;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(u=Math.sqrt(o))*i,t=r*(this.mode===this.S_POLE?u:-u)):e=t=0;break}}return n.x=this.a*e+this.x0,n.y=this.a*t+this.y0,n}function x3r(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,r,i,a,o,s,l,u;if(this.sphere){var h=0,c,f=0;if(c=Math.sqrt(e*e+t*t),i=c*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(i),h=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=Zr?0:Math.asin(t*f/c),e*=f,t=h*c;break;case this.OBLIQ:i=Math.abs(c)<=Zr?this.lat0:Math.asin(h*this.sinph0+t*f*this.cosph0/c),e*=f*this.cosph0,t=(h-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:t=-t,i=Ir-i;break;case this.S_POLE:i-=Ir;break}r=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l<Zr)return n.x=this.long0,n.y=this.lat0,n;o=2*Math.asin(.5*l/this.rq),a=Math.cos(o),e*=o=Math.sin(o),this.mode===this.OBLIQ?(u=a*this.sinb1+t*o*this.cosb1/l,s=this.qp*u,t=l*this.cosb1*a-t*this.sinb1*o):(u=t*o/l,s=this.qp*u,t=l*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),s=e*e+t*t,!s)return n.x=this.long0,n.y=this.lat0,n;u=1-s/this.qp,this.mode===this.S_POLE&&(u=-u)}r=Math.atan2(e,t),i=M3r(Math.asin(u),this.apa)}return n.x=fn(this.long0+r),n.y=i,n}var S3r=.3333333333333333,w3r=.17222222222222222,b3r=.10257936507936508,E3r=.06388888888888888,T3r=.0664021164021164,C3r=.016415012942191543;function A3r(n){var e,t=[];return t[0]=n*S3r,e=n*n,t[0]+=e*w3r,t[1]=e*E3r,e*=n,t[0]+=e*b3r,t[1]+=e*T3r,t[2]=e*C3r,t}function M3r(n,e){var t=n+n;return n+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var I3r=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const L3r={init:m3r,forward:_3r,inverse:x3r,names:I3r,S_POLE:v3r,N_POLE:p3r,EQUIT:g3r,OBLIQ:y3r};function iw(n){return Math.abs(n)>1&&(n=n>1?1:-1),Math.asin(n)}function P3r(){Math.abs(this.lat1+this.lat2)<Zr||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=mm(this.e3,this.sin_po,this.cos_po),this.qs1=CS(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=mm(this.e3,this.sin_po,this.cos_po),this.qs2=CS(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=CS(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Zr?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function O3r(n){var e=n.x,t=n.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var r=CS(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,a=this.ns0*fn(e-this.long0),o=i*Math.sin(a)+this.x0,s=this.rh-i*Math.cos(a)+this.y0;return n.x=o,n.y=s,n}function R3r(n){var e,t,r,i,a,o;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),r=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),r=-1),i=0,e!==0&&(i=Math.atan2(r*n.x,r*n.y)),r=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(t=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,t)),a=fn(i/this.ns0+this.long0),n.x=a,n.y=o,n}function D3r(n,e){var t,r,i,a,o,s=iw(.5*e);if(n<Zr)return s;for(var l=n*n,u=1;u<=25;u++)if(t=Math.sin(s),r=Math.cos(s),i=n*t,a=1-i*i,o=.5*a*a/r*(e/(1-l)-t/a+.5/n*Math.log((1-i)/(1+i))),s=s+o,Math.abs(o)<=1e-7)return s;return null}var N3r=["Albers_Conic_Equal_Area","Albers","aea"];const k3r={init:P3r,forward:O3r,inverse:R3r,names:N3r,phi1z:D3r};function F3r(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function B3r(n){var e,t,r,i,a,o,s,l,u=n.x,h=n.y;return r=fn(u-this.long0),e=Math.sin(h),t=Math.cos(h),i=Math.cos(r),o=this.sin_p14*e+this.cos_p14*t*i,a=1,o>0||Math.abs(o)<=Zr?(s=this.x0+this.a*a*t*Math.sin(r)/o,l=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)/o):(s=this.x0+this.infinity_dist*t*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*i)),n.x=s,n.y=l,n}function G3r(n){var e,t,r,i,a,o;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(e=Math.sqrt(n.x*n.x+n.y*n.y))?(i=Math.atan2(e,this.rc),t=Math.sin(i),r=Math.cos(i),o=iw(r*this.sin_p14+n.y*t*this.cos_p14/e),a=Math.atan2(n.x*t,e*this.cos_p14*r-n.y*this.sin_p14*t),a=fn(this.long0+a)):(o=this.phic0,a=0),n.x=a,n.y=o,n}var z3r=["gnom"];const U3r={init:F3r,forward:B3r,inverse:G3r,names:z3r};function V3r(n,e){var t=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*Ir:Ir;for(var r=Math.asin(.5*e),i,a,o,s,l=0;l<30;l++)if(a=Math.sin(r),o=Math.cos(r),s=n*a,i=Math.pow(1-s*s,2)/(2*o)*(e/(1-n*n)-a/(1-s*s)+.5/n*Math.log((1-s)/(1+s))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function $3r(){this.sphere||(this.k0=mm(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function W3r(n){var e=n.x,t=n.y,r,i,a=fn(e-this.long0);if(this.sphere)r=this.x0+this.a*a*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var o=CS(this.e,Math.sin(t));r=this.x0+this.a*this.k0*a,i=this.y0+this.a*o*.5/this.k0}return n.x=r,n.y=i,n}function H3r(n){n.x-=this.x0,n.y-=this.y0;var e,t;return this.sphere?(e=fn(this.long0+n.x/this.a/Math.cos(this.lat_ts)),t=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(t=V3r(this.e,2*n.y*this.k0/this.a),e=fn(this.long0+n.x/(this.a*this.k0))),n.x=e,n.y=t,n}var j3r=["cea"];const X3r={init:$3r,forward:W3r,inverse:H3r,names:j3r};function Y3r(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function q3r(n){var e=n.x,t=n.y,r=fn(e-this.long0),i=cL(t-this.lat0);return n.x=this.x0+this.a*r*this.rc,n.y=this.y0+this.a*i,n}function Z3r(n){var e=n.x,t=n.y;return n.x=fn(this.long0+(e-this.x0)/(this.a*this.rc)),n.y=cL(this.lat0+(t-this.y0)/this.a),n}var K3r=["Equirectangular","Equidistant_Cylindrical","eqc"];const J3r={init:Y3r,forward:q3r,inverse:Z3r,names:K3r};var fMe=20;function Q3r(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gk(this.es),this.e1=zk(this.es),this.e2=Uk(this.es),this.e3=Vk(this.es),this.ml0=this.a*Rf(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ekr(n){var e=n.x,t=n.y,r,i,a,o=fn(e-this.long0);if(a=o*Math.sin(t),this.sphere)Math.abs(t)<=Zr?(r=this.a*o,i=-1*this.a*this.lat0):(r=this.a*Math.sin(a)/Math.tan(t),i=this.a*(cL(t-this.lat0)+(1-Math.cos(a))/Math.tan(t)));else if(Math.abs(t)<=Zr)r=this.a*o,i=-1*this.ml0;else{var s=YM(this.a,this.e,Math.sin(t))/Math.tan(t);r=s*Math.sin(a),i=this.a*Rf(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+s*(1-Math.cos(a))}return n.x=r+this.x0,n.y=i+this.y0,n}function tkr(n){var e,t,r,i,a,o,s,l,u;if(r=n.x-this.x0,i=n.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=Zr)e=fn(r/this.a+this.long0),t=0;else{o=this.lat0+i/this.a,s=r*r/this.a/this.a+o*o,l=o;var h;for(a=fMe;a;--a)if(h=Math.tan(l),u=-1*(o*(l*h+1)-l-.5*(l*l+s)*h)/((l-o)/h-1),l+=u,Math.abs(u)<=Zr){t=l;break}e=fn(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(t))}else if(Math.abs(i+this.ml0)<=Zr)t=0,e=fn(this.long0+r/this.a);else{o=(this.ml0+i)/this.a,s=r*r/this.a/this.a+o*o,l=o;var c,f,d,v,p;for(a=fMe;a;--a)if(p=this.e*Math.sin(l),c=Math.sqrt(1-p*p)*Math.tan(l),f=this.a*Rf(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),v=f/this.a,u=(o*(c*v+1)-v-.5*c*(v*v+s))/(this.es*Math.sin(2*l)*(v*v+s-2*o*v)/(4*c)+(o-v)*(c*d-2/Math.sin(2*l))-d),l-=u,Math.abs(u)<=Zr){t=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=fn(this.long0+Math.asin(r*c/this.a)/Math.sin(t))}return n.x=e,n.y=t,n}var rkr=["Polyconic","poly"];const nkr={init:Q3r,forward:ekr,inverse:tkr,names:rkr};function ikr(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function akr(n){var e,t=n.x,r=n.y,i=r-this.lat0,a=t-this.long0,o=i/DR*1e-5,s=a,l=1,u=0;for(e=1;e<=10;e++)l=l*o,u=u+this.A[e]*l;var h=u,c=s,f=1,d=0,v,p,g=0,m=0;for(e=1;e<=6;e++)v=f*h-d*c,p=d*h+f*c,f=v,d=p,g=g+this.B_re[e]*f-this.B_im[e]*d,m=m+this.B_im[e]*f+this.B_re[e]*d;return n.x=m*this.a+this.x0,n.y=g*this.a+this.y0,n}function okr(n){var e,t=n.x,r=n.y,i=t-this.x0,a=r-this.y0,o=a/this.a,s=i/this.a,l=1,u=0,h,c,f=0,d=0;for(e=1;e<=6;e++)h=l*o-u*s,c=u*o+l*s,l=h,u=c,f=f+this.C_re[e]*l-this.C_im[e]*u,d=d+this.C_im[e]*l+this.C_re[e]*u;for(var v=0;v<this.iterations;v++){var p=f,g=d,m,y,_=o,x=s;for(e=2;e<=6;e++)m=p*f-g*d,y=g*f+p*d,p=m,g=y,_=_+(e-1)*(this.B_re[e]*p-this.B_im[e]*g),x=x+(e-1)*(this.B_im[e]*p+this.B_re[e]*g);p=1,g=0;var S=this.B_re[1],w=this.B_im[1];for(e=2;e<=6;e++)m=p*f-g*d,y=g*f+p*d,p=m,g=y,S=S+e*(this.B_re[e]*p-this.B_im[e]*g),w=w+e*(this.B_im[e]*p+this.B_re[e]*g);var b=S*S+w*w;f=(_*S+x*w)/b,d=(x*S-_*w)/b}var E=f,T=d,C=1,A=0;for(e=1;e<=9;e++)C=C*E,A=A+this.D[e]*C;var M=this.lat0+A*DR*1e5,I=this.long0+T;return n.x=I,n.y=M,n}var skr=["New_Zealand_Map_Grid","nzmg"];const lkr={init:ikr,forward:akr,inverse:okr,names:skr};function ukr(){}function hkr(n){var e=n.x,t=n.y,r=fn(e-this.long0),i=this.x0+this.a*r,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return n.x=i,n.y=a,n}function ckr(n){n.x-=this.x0,n.y-=this.y0;var e=fn(this.long0+n.x/this.a),t=2.5*(Math.atan(Math.exp(.8*n.y/this.a))-Math.PI/4);return n.x=e,n.y=t,n}var fkr=["Miller_Cylindrical","mill"];const dkr={init:ukr,forward:hkr,inverse:ckr,names:fkr};var vkr=20;function pkr(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=tZe(this.es)}function gkr(n){var e,t,r=n.x,i=n.y;if(r=fn(r-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var a=this.n*Math.sin(i),o=vkr;o;--o){var s=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<Zr)break}e=this.a*this.C_x*r*(this.m+Math.cos(i)),t=this.a*this.C_y*i}else{var l=Math.sin(i),u=Math.cos(i);t=this.a*f$(i,l,u,this.en),e=this.a*r*u/Math.sqrt(1-this.es*l*l)}return n.x=e,n.y=t,n}function ykr(n){var e,t,r,i;return n.x-=this.x0,r=n.x/this.a,n.y-=this.y0,e=n.y/this.a,this.sphere?(e/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(e))),this.m?e=iw((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=iw(Math.sin(e)/this.n)),r=fn(r+this.long0),e=cL(e)):(e=rZe(n.y/this.a,this.es,this.en),i=Math.abs(e),i<Ir?(i=Math.sin(e),t=this.long0+n.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),r=fn(t)):i-Zr<Ir&&(r=this.long0)),n.x=r,n.y=e,n}var mkr=["Sinusoidal","sinu"];const _kr={init:pkr,forward:gkr,inverse:ykr,names:mkr};function xkr(){}function Skr(n){for(var e=n.x,t=n.y,r=fn(e-this.long0),i=t,a=Math.PI*Math.sin(t);;){var o=-(i+Math.sin(i)-a)/(1+Math.cos(i));if(i+=o,Math.abs(o)<Zr)break}i/=2,Math.PI/2-Math.abs(t)<Zr&&(r=0);var s=.900316316158*this.a*r*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return n.x=s,n.y=l,n}function wkr(n){var e,t;n.x-=this.x0,n.y-=this.y0,t=n.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var r=fn(this.long0+n.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var i=Math.asin(t);return n.x=r,n.y=i,n}var bkr=["Mollweide","moll"];const Ekr={init:xkr,forward:Skr,inverse:wkr,names:bkr};function Tkr(){Math.abs(this.lat1+this.lat2)<Zr||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gk(this.es),this.e1=zk(this.es),this.e2=Uk(this.es),this.e3=Vk(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=mm(this.e,this.sinphi,this.cosphi),this.ml1=Rf(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Zr?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=mm(this.e,this.sinphi,this.cosphi),this.ml2=Rf(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Rf(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Ckr(n){var e=n.x,t=n.y,r;if(this.sphere)r=this.a*(this.g-t);else{var i=Rf(this.e0,this.e1,this.e2,this.e3,t);r=this.a*(this.g-i)}var a=this.ns*fn(e-this.long0),o=this.x0+r*Math.sin(a),s=this.y0+this.rh-r*Math.cos(a);return n.x=o,n.y=s,n}function Akr(n){n.x-=this.x0,n.y=this.rh-n.y+this.y0;var e,t,r,i;this.ns>=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),e=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),e=-1);var a=0;if(t!==0&&(a=Math.atan2(e*n.x,e*n.y)),this.sphere)return i=fn(this.long0+a/this.ns),r=cL(this.g-t/this.a),n.x=i,n.y=r,n;var o=this.g-t/this.a;return r=M7(o,this.e0,this.e1,this.e2,this.e3),i=fn(this.long0+a/this.ns),n.x=i,n.y=r,n}var Mkr=["Equidistant_Conic","eqdc"];const Ikr={init:Tkr,forward:Ckr,inverse:Akr,names:Mkr};function Lkr(){this.R=this.a}function Pkr(n){var e=n.x,t=n.y,r=fn(e-this.long0),i,a;Math.abs(t)<=Zr&&(i=this.x0+this.R*r,a=this.y0);var o=iw(2*Math.abs(t/Math.PI));(Math.abs(r)<=Zr||Math.abs(Math.abs(t)-Ir)<=Zr)&&(i=this.x0,t>=0?a=this.y0+Math.PI*this.R*Math.tan(.5*o):a=this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/r-r/Math.PI),l=s*s,u=Math.sin(o),h=Math.cos(o),c=h/(u+h-1),f=c*c,d=c*(2/u-1),v=d*d,p=Math.PI*this.R*(s*(c-v)+Math.sqrt(l*(c-v)*(c-v)-(v+l)*(f-v)))/(v+l);r<0&&(p=-p),i=this.x0+p;var g=l+c;return p=Math.PI*this.R*(d*g-s*Math.sqrt((v+l)*(l+1)-g*g))/(v+l),t>=0?a=this.y0+p:a=this.y0-p,n.x=i,n.y=a,n}function Okr(n){var e,t,r,i,a,o,s,l,u,h,c,f,d;return n.x-=this.x0,n.y-=this.y0,c=Math.PI*this.R,r=n.x/c,i=n.y/c,a=r*r+i*i,o=-Math.abs(i)*(1+a),s=o-2*i*i+r*r,l=-2*o+1+2*i*i+a*a,d=i*i/l+(2*s*s*s/l/l/l-9*o*s/l/l)/27,u=(o-s*s/3/l)/l,h=2*Math.sqrt(-u/3),c=3*d/u/h,Math.abs(c)>1&&(c>=0?c=1:c=-1),f=Math.acos(c)/3,n.y>=0?t=(-h*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI:t=-(-h*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI,Math.abs(r)<Zr?e=this.long0:e=fn(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(r*r-i*i)+a*a))/2/r),n.x=e,n.y=t,n}var Rkr=["Van_der_Grinten_I","VanDerGrinten","vandg"];const Dkr={init:Lkr,forward:Pkr,inverse:Okr,names:Rkr};function Nkr(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function kkr(n){var e=n.x,t=n.y,r=Math.sin(n.y),i=Math.cos(n.y),a=fn(e-this.long0),o,s,l,u,h,c,f,d,v,p,g,m,y,_,x,S,w,b,E,T,C,A,M;return this.sphere?Math.abs(this.sin_p12-1)<=Zr?(n.x=this.x0+this.a*(Ir-t)*Math.sin(a),n.y=this.y0-this.a*(Ir-t)*Math.cos(a),n):Math.abs(this.sin_p12+1)<=Zr?(n.x=this.x0+this.a*(Ir+t)*Math.sin(a),n.y=this.y0+this.a*(Ir+t)*Math.cos(a),n):(b=this.sin_p12*r+this.cos_p12*i*Math.cos(a),S=Math.acos(b),w=S?S/Math.sin(S):1,n.x=this.x0+this.a*w*i*Math.sin(a),n.y=this.y0+this.a*w*(this.cos_p12*r-this.sin_p12*i*Math.cos(a)),n):(o=Gk(this.es),s=zk(this.es),l=Uk(this.es),u=Vk(this.es),Math.abs(this.sin_p12-1)<=Zr?(h=this.a*Rf(o,s,l,u,Ir),c=this.a*Rf(o,s,l,u,t),n.x=this.x0+(h-c)*Math.sin(a),n.y=this.y0-(h-c)*Math.cos(a),n):Math.abs(this.sin_p12+1)<=Zr?(h=this.a*Rf(o,s,l,u,Ir),c=this.a*Rf(o,s,l,u,t),n.x=this.x0+(h+c)*Math.sin(a),n.y=this.y0+(h+c)*Math.cos(a),n):(f=r/i,d=YM(this.a,this.e,this.sin_p12),v=YM(this.a,this.e,r),p=Math.atan((1-this.es)*f+this.es*d*this.sin_p12/(v*i)),g=Math.atan2(Math.sin(a),this.cos_p12*Math.tan(p)-this.sin_p12*Math.cos(a)),g===0?E=Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):Math.abs(Math.abs(g)-Math.PI)<=Zr?E=-Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):E=Math.asin(Math.sin(a)*Math.cos(p)/Math.sin(g)),m=this.e*this.sin_p12/Math.sqrt(1-this.es),y=this.e*this.cos_p12*Math.cos(g)/Math.sqrt(1-this.es),_=m*y,x=y*y,T=E*E,C=T*E,A=C*E,M=A*E,S=d*E*(1-T*x*(1-x)/6+C/8*_*(1-2*x)+A/120*(x*(4-7*x)-3*m*m*(1-7*x))-M/48*_),n.x=this.x0+S*Math.sin(g),n.y=this.y0+S*Math.cos(g),n))}function Fkr(n){n.x-=this.x0,n.y-=this.y0;var e,t,r,i,a,o,s,l,u,h,c,f,d,v,p,g,m,y,_,x,S,w,b,E;return this.sphere?(e=Math.sqrt(n.x*n.x+n.y*n.y),e>2*Ir*this.a?void 0:(t=e/this.a,r=Math.sin(t),i=Math.cos(t),a=this.long0,Math.abs(e)<=Zr?o=this.lat0:(o=iw(i*this.sin_p12+n.y*r*this.cos_p12/e),s=Math.abs(this.lat0)-Ir,Math.abs(s)<=Zr?this.lat0>=0?a=fn(this.long0+Math.atan2(n.x,-n.y)):a=fn(this.long0-Math.atan2(-n.x,n.y)):a=fn(this.long0+Math.atan2(n.x*r,e*this.cos_p12*i-n.y*this.sin_p12*r))),n.x=a,n.y=o,n)):(l=Gk(this.es),u=zk(this.es),h=Uk(this.es),c=Vk(this.es),Math.abs(this.sin_p12-1)<=Zr?(f=this.a*Rf(l,u,h,c,Ir),e=Math.sqrt(n.x*n.x+n.y*n.y),d=f-e,o=M7(d/this.a,l,u,h,c),a=fn(this.long0+Math.atan2(n.x,-1*n.y)),n.x=a,n.y=o,n):Math.abs(this.sin_p12+1)<=Zr?(f=this.a*Rf(l,u,h,c,Ir),e=Math.sqrt(n.x*n.x+n.y*n.y),d=e-f,o=M7(d/this.a,l,u,h,c),a=fn(this.long0+Math.atan2(n.x,n.y)),n.x=a,n.y=o,n):(e=Math.sqrt(n.x*n.x+n.y*n.y),g=Math.atan2(n.x,n.y),v=YM(this.a,this.e,this.sin_p12),m=Math.cos(g),y=this.e*this.cos_p12*m,_=-y*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*m/(1-this.es),S=e/v,w=S-_*(1+_)*Math.pow(S,3)/6-x*(1+3*_)*Math.pow(S,4)/24,b=1-_*w*w/2-S*w*w*w/6,p=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*m),a=fn(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(p))),E=Math.sin(p),o=Math.atan2((E-this.es*b*this.sin_p12)*Math.tan(p),E*(1-this.es)),n.x=a,n.y=o,n))}var Bkr=["Azimuthal_Equidistant","aeqd"];const Gkr={init:Nkr,forward:kkr,inverse:Fkr,names:Bkr};function zkr(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Ukr(n){var e,t,r,i,a,o,s,l,u=n.x,h=n.y;return r=fn(u-this.long0),e=Math.sin(h),t=Math.cos(h),i=Math.cos(r),o=this.sin_p14*e+this.cos_p14*t*i,a=1,(o>0||Math.abs(o)<=Zr)&&(s=this.a*a*t*Math.sin(r),l=this.y0+this.a*a*(this.cos_p14*e-this.sin_p14*t*i)),n.x=s,n.y=l,n}function Vkr(n){var e,t,r,i,a,o,s;return n.x-=this.x0,n.y-=this.y0,e=Math.sqrt(n.x*n.x+n.y*n.y),t=iw(e/this.a),r=Math.sin(t),i=Math.cos(t),o=this.long0,Math.abs(e)<=Zr?(s=this.lat0,n.x=o,n.y=s,n):(s=iw(i*this.sin_p14+n.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-Ir,Math.abs(a)<=Zr?(this.lat0>=0?o=fn(this.long0+Math.atan2(n.x,-n.y)):o=fn(this.long0-Math.atan2(-n.x,n.y)),n.x=o,n.y=s,n):(o=fn(this.long0+Math.atan2(n.x*r,e*this.cos_p14*i-n.y*this.sin_p14*r)),n.x=o,n.y=s,n))}var $kr=["ortho"];const Wkr={init:zkr,forward:Ukr,inverse:Vkr,names:$kr};var Tl={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Zo={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Hkr(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Ir-qo/2?this.face=Tl.TOP:this.lat0<=-(Ir-qo/2)?this.face=Tl.BOTTOM:Math.abs(this.long0)<=qo?this.face=Tl.FRONT:Math.abs(this.long0)<=Ir+qo?this.face=this.long0>0?Tl.RIGHT:Tl.LEFT:this.face=Tl.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function jkr(n){var e={x:0,y:0},t,r,i,a,o,s,l={value:0};if(n.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):t=n.y,r=n.x,this.face===Tl.TOP)a=Ir-t,r>=qo&&r<=Ir+qo?(l.value=Zo.AREA_0,i=r-Ir):r>Ir+qo||r<=-(Ir+qo)?(l.value=Zo.AREA_1,i=r>0?r-ou:r+ou):r>-(Ir+qo)&&r<=-qo?(l.value=Zo.AREA_2,i=r+Ir):(l.value=Zo.AREA_3,i=r);else if(this.face===Tl.BOTTOM)a=Ir+t,r>=qo&&r<=Ir+qo?(l.value=Zo.AREA_0,i=-r+Ir):r<qo&&r>=-qo?(l.value=Zo.AREA_1,i=-r):r<-qo&&r>=-(Ir+qo)?(l.value=Zo.AREA_2,i=-r-Ir):(l.value=Zo.AREA_3,i=r>0?-r+ou:-r-ou);else{var u,h,c,f,d,v,p;this.face===Tl.RIGHT?r=iM(r,+Ir):this.face===Tl.BACK?r=iM(r,+ou):this.face===Tl.LEFT&&(r=iM(r,-Ir)),f=Math.sin(t),d=Math.cos(t),v=Math.sin(r),p=Math.cos(r),u=d*p,h=d*v,c=f,this.face===Tl.FRONT?(a=Math.acos(u),i=R6(a,c,h,l)):this.face===Tl.RIGHT?(a=Math.acos(h),i=R6(a,c,-u,l)):this.face===Tl.BACK?(a=Math.acos(-u),i=R6(a,c,-h,l)):this.face===Tl.LEFT?(a=Math.acos(-h),i=R6(a,c,u,l)):(a=i=0,l.value=Zo.AREA_0)}return s=Math.atan(12/ou*(i+Math.acos(Math.sin(i)*Math.cos(qo))-Ir)),o=Math.sqrt((1-Math.cos(a))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Zo.AREA_1?s+=Ir:l.value===Zo.AREA_2?s+=ou:l.value===Zo.AREA_3&&(s+=1.5*ou),e.x=o*Math.cos(s),e.y=o*Math.sin(s),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,n.x=e.x,n.y=e.y,n}function Xkr(n){var e={lam:0,phi:0},t,r,i,a,o,s,l,u,h,c={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,r=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),t=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?c.value=Zo.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(c.value=Zo.AREA_1,t-=Ir):n.x<0&&-n.x>=Math.abs(n.y)?(c.value=Zo.AREA_2,t=t<0?t+ou:t-ou):(c.value=Zo.AREA_3,t+=Ir),h=ou/12*Math.tan(t),o=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),s=Math.atan(o),i=Math.cos(t),a=Math.tan(r),l=1-i*i*a*a*(1-Math.cos(Math.atan(1/Math.cos(s)))),l<-1?l=-1:l>1&&(l=1),this.face===Tl.TOP)u=Math.acos(l),e.phi=Ir-u,c.value===Zo.AREA_0?e.lam=s+Ir:c.value===Zo.AREA_1?e.lam=s<0?s+ou:s-ou:c.value===Zo.AREA_2?e.lam=s-Ir:e.lam=s;else if(this.face===Tl.BOTTOM)u=Math.acos(l),e.phi=u-Ir,c.value===Zo.AREA_0?e.lam=-s+Ir:c.value===Zo.AREA_1?e.lam=-s:c.value===Zo.AREA_2?e.lam=-s-Ir:e.lam=s<0?-s-ou:-s+ou;else{var f,d,v;f=l,h=f*f,h>=1?v=0:v=Math.sqrt(1-h)*Math.sin(s),h+=v*v,h>=1?d=0:d=Math.sqrt(1-h),c.value===Zo.AREA_1?(h=d,d=-v,v=h):c.value===Zo.AREA_2?(d=-d,v=-v):c.value===Zo.AREA_3&&(h=d,d=v,v=-h),this.face===Tl.RIGHT?(h=f,f=-d,d=h):this.face===Tl.BACK?(f=-f,d=-d):this.face===Tl.LEFT&&(h=f,f=d,d=-h),e.phi=Math.acos(-v)-Ir,e.lam=Math.atan2(d,f),this.face===Tl.RIGHT?e.lam=iM(e.lam,-Ir):this.face===Tl.BACK?e.lam=iM(e.lam,-ou):this.face===Tl.LEFT&&(e.lam=iM(e.lam,+Ir))}if(this.es!==0){var p,g,m;p=e.phi<0?1:0,g=Math.tan(e.phi),m=this.b/Math.sqrt(g*g+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-m*m)/(this.one_minus_f*m)),p&&(e.phi=-e.phi)}return e.lam+=this.long0,n.x=e.lam,n.y=e.phi,n}function R6(n,e,t,r){var i;return n<Zr?(r.value=Zo.AREA_0,i=0):(i=Math.atan2(e,t),Math.abs(i)<=qo?r.value=Zo.AREA_0:i>qo&&i<=Ir+qo?(r.value=Zo.AREA_1,i-=Ir):i>Ir+qo||i<=-(Ir+qo)?(r.value=Zo.AREA_2,i=i>=0?i-ou:i+ou):(r.value=Zo.AREA_3,i+=Ir)),i}function iM(n,e){var t=n+e;return t<-ou?t+=mN:t>+ou&&(t-=mN),t}var Ykr=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const qkr={init:Hkr,forward:jkr,inverse:Xkr,names:Ykr};var _re=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],PO=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],aZe=.8487,oZe=1.3523,sZe=Xy/5,Zkr=1/sZe,CA=18,I7=function(n,e){return n[0]+e*(n[1]+e*(n[2]+e*n[3]))},Kkr=function(n,e){return n[1]+e*(2*n[2]+e*3*n[3])};function Jkr(n,e,t,r){for(var i=e;r;--r){var a=n(i);if(i-=a,Math.abs(a)<t)break}return i}function Qkr(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function eFr(n){var e=fn(n.x-this.long0),t=Math.abs(n.y),r=Math.floor(t*sZe);r<0?r=0:r>=CA&&(r=CA-1),t=Xy*(t-Zkr*r);var i={x:I7(_re[r],t)*e,y:I7(PO[r],t)};return n.y<0&&(i.y=-i.y),i.x=i.x*this.a*aZe+this.x0,i.y=i.y*this.a*oZe+this.y0,i}function tFr(n){var e={x:(n.x-this.x0)/(this.a*aZe),y:Math.abs(n.y-this.y0)/(this.a*oZe)};if(e.y>=1)e.x/=_re[CA][0],e.y=n.y<0?-Ir:Ir;else{var t=Math.floor(e.y*CA);for(t<0?t=0:t>=CA&&(t=CA-1);;)if(PO[t][0]>e.y)--t;else if(PO[t+1][0]<=e.y)++t;else break;var r=PO[t],i=5*(e.y-r[0])/(PO[t+1][0]-r[0]);i=Jkr(function(a){return(I7(r,a)-e.y)/Kkr(r,a)},i,Zr,100),e.x/=I7(_re[t],i),e.y=(5*t+i)*ic,n.y<0&&(e.y=-e.y)}return e.x=fn(e.x+this.long0),e}var rFr=["Robinson","robin"];const nFr={init:Qkr,forward:eFr,inverse:tFr,names:rFr};function iFr(){this.name="geocent"}function aFr(n){var e=Jqe(n,this.es,this.a);return e}function oFr(n){var e=Qqe(n,this.es,this.a,this.b);return e}var sFr=["Geocentric","geocentric","geocent","Geocent"];const lFr={init:iFr,forward:aFr,inverse:oFr,names:sFr};var Dc={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},VP={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function uFr(){if(Object.keys(VP).forEach(function(t){if(typeof this[t]>"u")this[t]=VP[t].def;else{if(VP[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);VP[t].num&&(this[t]=parseFloat(this[t]))}VP[t].degrees&&(this[t]=this[t]*ic)}.bind(this)),Math.abs(Math.abs(this.lat0)-Ir)<Zr?this.mode=this.lat0<0?Dc.S_POLE:Dc.N_POLE:Math.abs(this.lat0)<Zr?this.mode=Dc.EQUIT:(this.mode=Dc.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(n),this.sw=Math.sin(n)}function hFr(n){n.x-=this.long0;var e=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),i,a;switch(this.mode){case Dc.OBLIQ:a=this.sinph0*e+this.cosph0*t*r;break;case Dc.EQUIT:a=t*r;break;case Dc.S_POLE:a=-e;break;case Dc.N_POLE:a=e;break}switch(a=this.pn1/(this.p-a),i=a*t*Math.sin(n.x),this.mode){case Dc.OBLIQ:a*=this.cosph0*e-this.sinph0*t*r;break;case Dc.EQUIT:a*=e;break;case Dc.N_POLE:a*=-(t*r);break;case Dc.S_POLE:a*=t*r;break}var o,s;return o=a*this.cg+i*this.sg,s=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-a*this.sg)*this.cw*s,a=o*s,n.x=i*this.a,n.y=a*this.a,n}function cFr(n){n.x/=this.a,n.y/=this.a;var e={x:n.x,y:n.y},t,r,i;i=1/(this.pn1-n.y*this.sw),t=this.pn1*n.x*i,r=this.pn1*n.y*this.cw*i,n.x=t*this.cg+r*this.sg,n.y=r*this.cg-t*this.sg;var a=Kg(n.x,n.y);if(Math.abs(a)<Zr)e.x=0,e.y=n.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case Dc.OBLIQ:e.y=Math.asin(o*this.sinph0+n.y*s*this.cosph0/a),n.y=(o-this.sinph0*Math.sin(e.y))*a,n.x*=s*this.cosph0;break;case Dc.EQUIT:e.y=Math.asin(n.y*s/a),n.y=o*a,n.x*=s;break;case Dc.N_POLE:e.y=Math.asin(o),n.y=-n.y;break;case Dc.S_POLE:e.y=-Math.asin(o);break}e.x=Math.atan2(n.x,n.y)}return n.x=e.x+this.long0,n.y=e.y,n}var fFr=["Tilted_Perspective","tpers"];const dFr={init:uFr,forward:hFr,inverse:cFr,names:fFr};function vFr(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,e=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function pFr(n){var e=n.x,t=n.y,r,i,a,o;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var s=this.radius_p/Kg(this.radius_p*Math.cos(t),Math.sin(t));if(i=s*Math.cos(e)*Math.cos(t),a=s*Math.sin(e)*Math.cos(t),o=s*Math.sin(t),(this.radius_g-i)*i-a*a-o*o*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/Kg(o,r)),n.y=this.radius_g_1*Math.atan(o/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(o/Kg(a,r)))}else this.shape==="sphere"&&(r=Math.cos(t),i=Math.cos(e)*r,a=Math.sin(e)*r,o=Math.sin(t),r=this.radius_g-i,this.flip_axis?(n.x=this.radius_g_1*Math.atan(a/Kg(o,r)),n.y=this.radius_g_1*Math.atan(o/r)):(n.x=this.radius_g_1*Math.atan(a/r),n.y=this.radius_g_1*Math.atan(o/Kg(a,r))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function gFr(n){var e=-1,t=0,r=0,i,a,o,s;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Kg(1,r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*Kg(1,t));var l=r/this.radius_p;if(i=t*t+l*l+e*e,a=2*this.radius_g*e,o=a*a-4*i*this.C,o<0)return n.x=Number.NaN,n.y=Number.NaN,n;s=(-a-Math.sqrt(o))/(2*i),e=this.radius_g+s*e,t*=s,r*=s,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+r*r)):(t=Math.tan(n.x/this.radius_g_1),r=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+t*t)),i=t*t+r*r+e*e,a=2*this.radius_g*e,o=a*a-4*i*this.C,o<0)return n.x=Number.NaN,n.y=Number.NaN,n;s=(-a-Math.sqrt(o))/(2*i),e=this.radius_g+s*e,t*=s,r*=s,n.x=Math.atan2(t,e),n.y=Math.atan(r*Math.cos(n.x)/e)}return n.x=n.x+this.long0,n}var yFr=["Geostationary Satellite View","Geostationary_Satellite","geos"];const mFr={init:vFr,forward:pFr,inverse:gFr,names:yFr};function _Fr(n){n.Proj.projections.add(y8),n.Proj.projections.add(m8),n.Proj.projections.add(TNr),n.Proj.projections.add(NNr),n.Proj.projections.add(UNr),n.Proj.projections.add(jNr),n.Proj.projections.add(JNr),n.Proj.projections.add(n3r),n.Proj.projections.add(l3r),n.Proj.projections.add(d3r),n.Proj.projections.add(L3r),n.Proj.projections.add(k3r),n.Proj.projections.add(U3r),n.Proj.projections.add(X3r),n.Proj.projections.add(J3r),n.Proj.projections.add(nkr),n.Proj.projections.add(lkr),n.Proj.projections.add(dkr),n.Proj.projections.add(_kr),n.Proj.projections.add(Ekr),n.Proj.projections.add(Ikr),n.Proj.projections.add(Dkr),n.Proj.projections.add(Gkr),n.Proj.projections.add(Wkr),n.Proj.projections.add(qkr),n.Proj.projections.add(nFr),n.Proj.projections.add(lFr),n.Proj.projections.add(dFr),n.Proj.projections.add(mFr)}Bu.defaultDatum="WGS84";Bu.Proj=nm;Bu.WGS84=new Bu.Proj("WGS84");Bu.Point=XM;Bu.toPoint=eZe;Bu.defs=xf;Bu.nadgrid=FDr;Bu.transform=A7;Bu.mgrs=wrt;Bu.version="__VERSION__";_Fr(Bu);function xFr(){const n=["(",")","\uFF08","\uFF09",",","\uFF0C"],e={};return n.forEach((t,r)=>{e[t]=`$${r}`}),e}function lZe(n){const e=xFr();for(let t in e){const r=e[t],i=new RegExp(`\\${t}`,"g");for(;i.test(n);)n=n.replace(i,r)}return n}function Jq(n,e){const r=n.replace(/&|\||>|<|=|!/g," ").split(" ").filter(a=>a);let i=n;return r.forEach(a=>{const o=e.find(s=>s===a);if(uZe(a)&&o&&(i=i.replace(o,"$"+o)),o){const s=lZe(o);i=i.replace(o,s)}}),i}function Qq(n){let e={};for(let t in n){let r=t;uZe(t)&&(r="$"+t),r=lZe(r),e[r]=n[t]}return e}function uZe(n){return/^\d/.test(n)}class hZe extends _l{constructor(e,t){super(e,t),this._queryService=new BDe(e,t)}queryByBounds(e,t,r){return e=this._processParams(e),this._queryService.queryByBounds(e,t,r)}queryByDistance(e,t,r){return e=this._processParams(e),this._queryService.queryByDistance(e,t,r)}queryBySQL(e,t,r){return e=this._processParams(e),this._queryService.queryBySQL(e,t,r)}queryByGeometry(e,t,r){return e=this._processParams(e),this._queryService.queryByGeometry(e,t,r)}_processParams(e){return e?(e.returnContent=e.returnContent==null?!0:e.returnContent,e.queryParams&&!br.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds=new po(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3])),e.geometry&&(e.geometry instanceof Qs?e.geometry=new Ki(e.geometry.getCoordinates()[0],e.geometry.getCoordinates()[1]):e.geometry=br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e.geometry)))),e):{}}}class SFr{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,r){var i=this,a=new JRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:r});return a.processAsync(e,t)}getFeaturesByBounds(e,t,r){var i=this,a=new XRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}getFeaturesByBuffer(e,t,r){var i=this,a=new YRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}getFeaturesBySQL(e,t,r){var i=this,a=new H8(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}getFeaturesByGeometry(e,t,r){var i=this,a=new ZRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}editFeatures(e,t){if(!(!e||!e.dataSourceName||!e.dataSetName)){var r=this,i=r.url,a=e.dataSourceName,o=e.dataSetName;i=H.urlPathAppend(i,"datasources/"+a+"/datasets/"+o);var s=new V8(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return s.processAsync(e,t)}}getMetadata(e,t){var r=this,i=r.url,a=e.dataSourceName,o=e.dataSetName;i=H.urlPathAppend(i,"datasources/"+a+"/datasets/"+o);var s=new V8(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return s.getMetaData(e,t)}_processFormat(e){return e||Ni.GEOJSON}}class cZe extends _l{constructor(e,t){super(e,t),this._featureService=new SFr(e,t)}getFeaturesByIDs(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByIDs(e,t,r)}getFeaturesByBounds(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByBounds(e,t,r)}getFeaturesByBuffer(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByBuffer(e,t,r)}getFeaturesBySQL(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesBySQL(e,t,r)}getFeaturesByGeometry(e,t,r){return e=this._processParams(e),this._featureService.getFeaturesByGeometry(e,t,r)}editFeatures(e,t){if(!(!e||!e.dataSourceName||!e.dataSetName)){var r=this,i=r.url,a=e.dataSourceName,o=e.dataSetName;i=H.urlPathAppend(i,"datasources/"+a+"/datasets/"+o);var s=new V8(i,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return s.processAsync(r._processParams(e),t)}}getMetadata(e,t){return this._featureService.getMetadata(e,t)}_processParams(e){if(!e)return{};var t=this;if(e.returnContent=e.returnContent==null?!0:e.returnContent,e.fromIndex=e.fromIndex?e.fromIndex:0,e.toIndex=e.toIndex?e.toIndex:-1,e.bounds&&(e.bounds=br.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry=br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e.geometry)))),e.editType&&(e.editType=e.editType.toLowerCase()),e.features){var r=[];br.isArray(e.features)?e.features.map(function(i){return r.push(t._createServerFeature(i)),i}):r.push(t._createServerFeature(e.features)),e.features=r}return e}_createServerFeature(e){var t={},r=[],i=[],a=e.getProperties();for(var o in a)o!==e.getGeometryName()&&(r.push(o),i.push(a[o]));return t.fieldNames=r,t.fieldValues=i,e.getId()&&(t.id=e.getId()),t.geometry=br.toSuperMapGeometry(new jc().writeFeatureObject(e)),t}_processFormat(e){return e||Ni.GEOJSON}}function wFr(n){let e=[];return TFr(n)&&n.length&&n.forEach(t=>{let r=t.get("attributes");r&&e.push(r)}),e}function dMe(n,e,t,r,i,a,o){bFr(n,e,r,i,t,a,o)}function vMe(n,e,t,r,i,a,o,s,l,u){const h=new Of({name:e,attributeFilter:t});r&&(h.fields=r);const c={queryParams:[h]};u&&(c.queryOption=dz.ATTRIBUTE),s&&(c.startRecord=s),l&&(c.expectCount=l),i&&(c.prjCoordSys={epsgCode:i});const f=new ZR(c);new hZe(n).queryBySQL(f,function(v){v.type==="processCompleted"?a(v):o(v)})}function bFr(n,e,t,r,i,a,o){let s=new Of({name:e.join().replace(":","@")}),l=o||1e3,u,h=[];pMe(n,s,e,0,1,1,i,a).then(c=>{u=c;let f=c.result.totalCount;if(f>1){for(let d=1;d<f;)h.push(pMe(n,s,e,d,d+l,l,i,a)),d+=l;Promise.all(h).then(d=>{d.forEach(v=>{v.type==="processCompleted"&&v.result.features&&v.result.features.features?v.result.features.features.forEach(p=>{u.result.features.features.push(p)}):u.someRequestFailed=!0}),t(u)}).catch(d=>{r(d)})}else t(c)}).catch(c=>{r(c)})}function EFr(n,e,t,r,i,a){return new VR({queryParameter:n,datasetNames:e,fromIndex:t,toIndex:r,maxFeatures:i,returnContent:!0,targetEpsgCode:a})}function pMe(n,e,t,r,i,a,o,s){return new Promise((l,u)=>{new cZe(n,o).getFeaturesBySQL(EFr(e,t,r,i,a,s),h=>{let c=h.result;h.type==="processCompleted"&&c&&c.features?l(h):u(h)})})}function TFr(n){return Object.prototype.toString.call(n)==="[object Array]"}class Ihe extends _l{constructor(e,t){t=t||{},t.projection&&(t.prjCoordSys=t.projection),super(e,t),this.dataFlow=new lRe(e,t),this.dataFlow.events.on({broadcastSocketConnected:this._defaultEvent,broadcastSocketError:this._defaultEvent,broadcastFailed:this._defaultEvent,broadcastSucceeded:this._defaultEvent,subscribeSocketConnected:this._defaultEvent,subscribeSocketError:this._defaultEvent,messageSucceeded:this._defaultEvent,setFilterParamSucceeded:this._defaultEvent,scope:this})}initBroadcast(){return this.dataFlow.initBroadcast(),this}broadcast(e){this.dataFlow.broadcast(e)}initSubscribe(){return this.dataFlow.initSubscribe(),this}setExcludeField(e){return this.dataFlow.setExcludeField(e),this.options.excludeField=e,this}setGeometry(e){return this.dataFlow.setGeometry(e),this.options.geometry=e,this}unSubscribe(){this.dataFlow.unSubscribe()}unBroadcast(){this.dataFlow.unBroadcast()}_defaultEvent(e){this.dispatchEvent({type:e.eventType||e.type,value:e})}}class CFr extends _f{constructor(e){var t=e||{};super(t),this.idField=t.idField||"id",this.dataService=new Ihe(t.ws,{geometry:t.geometry,prjCoordSys:t.prjCoordSys,excludeField:t.excludeField}).initSubscribe();var r=this;r.dataService.on("subscribeSocketConnected",function(i){r.dispatchEvent({type:"subscribeSucceeded",value:i})}),r.dataService.on("messageSucceeded",function(i){r._onMessageSuccessed(i)}),r.dataService.on("setFilterParamSucceeded",function(i){r.dispatchEvent({type:"setFilterParamSucceeded",value:i})}),this.featureCache={}}setExcludeField(e){return this.dataService.setExcludeField(e),this.excludeField=e,this}setGeometry(e){return this.dataService.setGeometry(e),this.geometry=e,this}_onMessageSuccessed(e){var t=new jc().readFeature(e.value.featureResult),r=t.get(this.idField);r!==void 0&&this.featureCache[r]?(this.featureCache[r].setGeometry(t.getGeometry()),this.featureCache[r].setProperties(t.getProperties()),this.changed()):(this.addFeature(t),this.featureCache[r]=t),this.dispatchEvent({type:"dataupdated",value:{source:this,data:t}})}}class fZe{constructor(e,t){this.geometry=e,this.attributes=t}toFeature(){var e=this.geometry;if(e instanceof vT){let t=this.attributes;t.geometry=e;let r=new d0(t);return new uh().read(new jc().writeFeature(r),"Feature")}else if(e.length===3)return e=new O_(e[0],e[1],e[2]),new sc(e,this.attributes)}}var AFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),MFr=function(n){AFr(e,n);function e(t,r,i,a,o){var s=this,l=o!==void 0?Ai.IDLE:Ai.LOADED;return s=n.call(this,t,r,i,l)||this,s.loader_=o!==void 0?o:null,s.canvas_=a,s.error_=null,s}return e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Ai.ERROR):this.state=Ai.LOADED,this.changed()},e.prototype.load=function(){this.state==Ai.IDLE&&(this.state=Ai.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(wue);const IFr=MFr;var LFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),PFr=function(n){LFr(e,n);function e(t){var r=this,i=t||{},a=i.imageSmoothing!==void 0?i.imageSmoothing:!0;return i.interpolate!==void 0&&(a=i.interpolate),r=n.call(this,{attributions:i.attributions,interpolate:a,projection:i.projection,resolutions:i.resolutions,state:i.state})||this,r.canvasFunction_=i.canvasFunction,r.canvas_=null,r.renderedRevision_=0,r.ratio_=i.ratio!==void 0?i.ratio:1.5,r}return e.prototype.getImageInternal=function(t,r,i,a){r=this.findNearestResolution(r);var o=this.canvas_;if(o&&this.renderedRevision_==this.getRevision()&&o.getResolution()==r&&o.getPixelRatio()==i&&vv(o.getExtent(),t))return o;t=t.slice(),_yr(t,this.ratio_);var s=Co(t)/r,l=lh(t)/r,u=[s*i,l*i],h=this.canvasFunction_.call(this,t,r,i,u,a);return h&&(o=new IFr(t,r,i,h)),this.canvas_=o,this.renderedRevision_=this.getRevision(),o},e}(Xqe);const d$=PFr;class fS extends d${constructor(e,t){var r=t||{};super({attributions:r.attributions||"Map Data <span>\xA9 SuperMap iServer</span> with <span>\xA9 SuperMap iClient</span>",canvasFunction:i,logo:br.getOlVersion()==="4"?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state}),this.on=this.onInternal,this.id=r.id?r.id:H.createUniqueID("themeLayer_");function i(o,s,l,u,h){var c=u[0]*l,f=u[1]*l;if(this.context||(this.context=br.createCanvasContext2D(c,f)),!this.features)return this.context.canvas;this.pixelRatio=l;var d=this.map.getSize()[0]*l,v=this.map.getSize()[1]*l;this.offset=[(c-d)/2/l,(f-v)/2/l],this.notFirst||(this.redrawThematicFeatures(o),this.notFirst=!0),this.div.id=this.id,this.div.className="themeLayer",this.div.style.width=c+"px",this.div.style.height=f+"px",this.map.getViewport().appendChild(this.div),this.renderer.resize(),this.map.getViewport().removeChild(this.div),this.themeCanvas=this.renderer.painter.root.getElementsByTagName("canvas")[0],this.themeCanvas.width=c,this.themeCanvas.height=f,this.themeCanvas.style.width=c+"px",this.themeCanvas.style.height=f+"px",this.themeCanvas.getContext("2d").clearRect(0,0,c,f);var p=this.renderer.painter._layers.hover.ctx,g=p.canvas,m=br.createCanvasContext2D(c,f);m.drawImage(g,0,0,g.width,g.height,0,0,c,f),this.redrawThematicFeatures(o);var y=this.context.canvas;return this.context.clearRect(0,0,y.width,y.height),y.width=c,y.height=f,y.style.width=c+"px",y.style.height=f+"px",this.context.drawImage(this.themeCanvas,0,0),this.context.drawImage(m.canvas,0,0),this.context.canvas}this.canvasFunctionInternal_=i,this.EVENT_TYPES=["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","added","removed","tileloaded","beforefeaturesadded","featuresadded","featuresremoved"],this.features=[],this.TFEvents=r.TFEvents||[],this.map=r.map;var a=this.map.getSize();this.div=document.createElement("div"),this.map.getViewport().appendChild(this.div),this.div.style.width=a[0]+"px",this.div.style.height=a[1]+"px",this.setOpacity(r.opacity),this.levelRenderer=new Gg,this.movingOffset=[0,0],this.renderer=this.levelRenderer.init(this.div),this.map.getViewport().removeChild(this.div),this.renderer.clear(),this.addTFEvents()}destroy(){this.EVENT_TYPES=null,this.isBaseLayer=null,this.TFEvents=null,this.destroyFeatures(),this.features=null,this.renderer&&this.renderer.dispose(),this.renderer=null,this.levelRenderer=null,this.movingOffset=null,this.currentMousePosition=null}destroyFeatures(e){var t=e==null;if(t&&(e=this.features),e){this.removeFeatures(e),Array.isArray(e)||(e=[e]);for(var r=e.length-1;r>=0;r--)e[r].destroy()}}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.div;H.modifyDOMElement(t,null,null,null,null,null,null,e),this.map!==null&&this.dispatchEvent({type:"changelayer",value:{layer:this,property:"opacity"}})}}addFeatures(e){}removeFeatures(e){var t=this;if(!!e){if(e===t.features)return t.removeAllFeatures();!H.isArray(e)&&typeof e!="function"&&(e=[e]);for(var r=[],i=0;i<t.features.length;i++){var a=t.features[i];if(e&&typeof e=="function")e(a)&&t.features.splice(i--,1);else{var o=H.indexOf(e,a);o===-1?r.push(a):t.features.splice(i--,1)}}for(var s=[],l=0,u=this.features.length;l<u;l++)a=this.features[l],s.push(a);this.features=[],this.addFeatures(s),this.renderer&&this.redrawThematicFeatures(this.map.getView().calculateExtent());var h=r.length==0;this.dispatchEvent({type:"featuresremoved",value:{features:r,succeed:h}})}}removeAllFeatures(){this.renderer&&this.renderer.clear(),this.features=[],this.dispatchEvent({type:"featuresremoved",value:{features:[],succeed:!0}})}getFeatures(e){for(var t=this.features.length,r=[],i=0;i<t;++i)(!e||e&&typeof e=="function"&&e(this.features[i]))&&r.push(this.features[i]);return r}getFeatureBy(e,t){var r=null;for(var i in this.features)if(this.features[i][e]===t){r=this.features[i];break}return r}getFeatureById(e){return this.getFeatureBy("id",e)}getFeaturesByAttribute(e,t){var r,i=[];for(var a in this.features)r=this.features[a],r&&r.attributes&&r.attributes[e]===t&&i.push(r);return i}redrawThematicFeatures(e){}onInternal(e,t){var r=t;if(this.renderer)this.renderer.on(e,r);else{var i=[];i.push(e),i.push(r),this.TFEvents.push(i)}}fire(e,t){if(!!this.offset){t=t.originalEvent;var r=this.getX(t),i=this.getY(t),a=-this.map.getView().getRotation(),o=this.map.getPixelFromCoordinate(this.map.getView().getCenter()),s=this.scale([r,i],o,this.pixelRatio),l=this.rotate(s,a,o),u=[l[0]+this.offset[0],l[1]+this.offset[1]],h=document.createEvent("Event");h.initEvent("pointermove",!0,!0),h.offsetX=u[0],h.offsetY=u[1],h.layerX=u[0],h.layerY=u[1],h.clientX=u[0],h.clientY=u[1],h.x=r,h.y=i,e==="click"&&this.renderer.handler._clickHandler(h),e==="dblclick"&&this.renderer.handler._dblclickHandler(h),e==="onmousewheel"&&this.renderer.handler._mousewheelHandler(h),e==="mousemove"&&(this.renderer.handler._mousemoveHandler(h),this.changed()),e==="onmouseout"&&this.renderer.handler._mouseoutHandler(h),e==="onmousedown"&&this.renderer.handler._mousedownHandler(h),e==="onmouseup"&&this.renderer.handler._mouseupHandler(h)}}getX(e){return typeof e.zrenderX<"u"&&e.zrenderX||typeof e.offsetX<"u"&&e.offsetX||typeof e.layerX<"u"&&e.layerX||typeof e.clientX<"u"&&e.clientX}getY(e){return typeof e.zrenderY<"u"&&e.zrenderY||typeof e.offsetY<"u"&&e.offsetY||typeof e.layerY<"u"&&e.layerY||typeof e.clientY<"u"&&e.clientY}un(e,t){var r=t;if(this.renderer)this.renderer.un(e,r);else{for(var i=this.TFEvents,a=i.length,o=[],s=0;s<a;s++){var l=i[s];l[0]===e&&l[1]===r||o.push(l)}this.TFEvents=o}}addTFEvents(){for(var e=this.TFEvents,t=e.length,r=0;r<t;r++)this.renderer.on(e[r][0],e[r][1])}getLocalXY(e){var t,r=this.map;(e instanceof Ki||e instanceof O_)&&(t=r.getPixelFromCoordinate([e.x,e.y])),e instanceof vd&&(t=r.getPixelFromCoordinate([e.lon,e.lat]));var i=-r.getView().getRotation(),a=r.getPixelFromCoordinate(r.getView().getCenter()),o=t;return this.pixelRatio&&(o=this.scale(t,a,this.pixelRatio)),t&&a&&(o=this.rotate(o,i,a)),this.offset&&o?[o[0]+this.offset[0],o[1]+this.offset[1]]:o}rotate(e,t,r){var i=Math.cos(t)*(e[0]-r[0])-Math.sin(t)*(e[1]-r[1])+r[0],a=Math.sin(t)*(e[0]-r[0])+Math.cos(t)*(e[1]-r[1])+r[1];return[i,a]}scale(e,t,r){var i=(e[0]-t[0])*r+t[0],a=(e[1]-t[1])*r+t[1];return[i,a]}toiClientFeature(e){H.isArray(e)||(e=[e]);let t=[];for(let r=0;r<e.length;r++)if(e[r]instanceof fZe){t.push(e[r].toFeature());continue}else if(e[r]instanceof d0){t.push(this._toFeature(e[r]));continue}else if(e[r]instanceof sc){t.push(e[r]);continue}else if(e[r].geometry&&e[r].geometry.parts)t.push(u3.fromJson(e[r]).toFeature());else if(["FeatureCollection","Feature","Geometry"].indexOf(e[r].type)!=-1){const i=new uh;t=t.concat(i.read(e[r]))}else throw new Error(`features[${r}]'s type is not be supported.`);return t}toFeature(e){return this.toiClientFeature(e)}_toFeature(e){let t=new jc().writeFeature(e);return new uh().read(t,"Feature")}}class _8 extends fS{constructor(e,t,r){super(e,r),this.chartsSetting=r.chartsSetting||{},this.themeFields=r.themeFields||null,this.overlayWeightField=r.overlayWeightField||null,this.isOverLay=r.isOverLay===void 0?!0:r.isOverLay,this.charts=r.charts||[],this.cache=r.cache||{},this.chartsType=t}destroy(){this.chartsType=null,this.chartsSetting=null,this.themeFields=null,this.overlayWeightField=null,this.isOverLay=null,fS.prototype.destroy.apply(this,arguments),this.charts=null,this.cache=null}setChartsType(e){this.chartsType=e,this.redraw()}addFeatures(e){var t=this.dispatchEvent({type:"beforefeaturesadded",value:{features:e}});t!==!1&&(this.features=this.toiClientFeature(e),this.renderer&&this.changed())}redrawThematicFeatures(e){this.renderer.clearAll();for(var t=this.features,r=0,i=t.length;r<i;r++){var a=t[r],o=a.geometry.getBounds();if(e){var s=new po(e[0],e[1],e[2],e[3]);if(!s.intersectsBounds(o))continue}var l=this.cache,u=a.id;if(!l[u]){l[u]=u;var h=this.createThematicFeature(a);h&&this.overlayWeightField&&a.attributes[this.overlayWeightField]&&!isNaN(a.attributes[this.overlayWeightField])&&(h.__overlayWeight=a.attributes[this.overlayWeightField]),h&&this.charts.push(h)}}this.drawCharts()}createThematicFeature(e){var t;return am[this.chartsType]&&this.themeFields&&this.chartsSetting&&(t=new am[this.chartsType](e,this,this.themeFields,this.chartsSetting)),t?(t.assembleShapes(),t):!1}drawCharts(){if(!!this.renderer){var e=this.charts;if(this.overlayWeightField&&e.sort(function(b,E){return typeof b.__overlayWeight>"u"&&typeof E.__overlayWeight>"u"?0:typeof b.__overlayWeight<"u"&&typeof E.__overlayWeight>"u"?-1:typeof b.__overlayWeight>"u"&&typeof E.__overlayWeight<"u"?1:typeof b.__overlayWeight<"u"&&typeof E.__overlayWeight<"u"?parseFloat(b.__overlayWeight)<parseFloat(E.__overlayWeight)?1:-1:0}),this.isOverLay)for(var u=[],h=this.map.getView().calculateExtent(),c=new po(h[0],h[1],h[2],h[3]),f=this.getLocalXY(new vd(c.left,c.top)),d=this.getLocalXY(new vd(c.right,c.bottom)),v=new po(f[0],d[1],d[0],f[1]),p=0,g=e.length;p<g;p++){var m=e[p],y=m.resetLocation(),_=m.chartBounds,x=[{x:_.left,y:_.top},{x:_.left,y:_.bottom},{x:_.right,y:_.bottom},{x:_.right,y:_.top},{x:_.left,y:_.top}];if(!(v&&!this.isChartInMap(v,x))){var S=!1;if(p!==0){for(let b=0;b<u.length;b++)if(this.isQuadrilateralOverLap(x,u[b])){S=!0;break}}if(!S){u.push(x);var w=m.shapes;for(let b=0,E=w.length;b<E;b++)w[b].refOriginalPosition=y,this.renderer.addShape(w[b])}}}else for(var t=0,r=e.length;t<r;t++)for(var i=e[t],a=i.resetLocation(),o=i.shapes,s=0,l=o.length;s<l;s++)o[s].refOriginalPosition=a,this.renderer.addShape(o[s]);this.renderer.render()}}getShapesByFeatureID(e){var t=[],r=this.renderer.getAllShapes();if(!e)return r;for(var i=0,a=r.length;i<a;i++){var o=r[i];o.refDataID&&e===o.refDataID&&t.push(o)}return t}isQuadrilateralOverLap(e,t){var r=e.length,i=t.length;if(r!==5||i!==5)return null;var a=!1;for(let s=0;s<r;s++)if(this.isPointInPoly(e[s],t)){a=!0;break}for(let s=0;s<i;s++)if(this.isPointInPoly(t[s],e)){a=!0;break}for(let s=0;s<r-1&&!a;s++)for(let l=0;l<i-1;l++){var o=H.lineIntersection(e[s],e[s+1],t[l],t[l+1]);if(o.CLASS_NAME==="SuperMap.Geometry.Point"){a=!0;break}}return a}isPointInPoly(e,t){for(var r=!1,i=-1,a=t.length,o=a-1;++i<a;o=i)(t[i].y<=e.y&&e.y<t[o].y||t[o].y<=e.y&&e.y<t[i].y)&&e.x<(t[o].x-t[i].x)*(e.y-t[i].y)/(t[o].y-t[i].y)+t[i].x&&(r=!r);return r}isChartInMap(e,t){for(var r=e,i=!1,a=0,o=t.length;a<o;a++){var s=t[a];if(s.x>=r.left&&s.x<=r.right&&s.y>=r.top&&s.y<=r.bottom){i=!0;break}}return i}clearCache(){this.cache={},this.charts=[]}removeFeatures(e){this.clearCache(),super.removeFeatures(e)}removeAllFeatures(){this.clearCache(),super.removeAllFeatures()}redraw(){return this.clearCache(),this.renderer?(this.redrawThematicFeatures(this.map.getView().calculateExtent()),!0):!1}clear(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}canvasFunctionInternal_(e,t,r,i,a){return fS.prototype.canvasFunctionInternal_.apply(this,arguments)}}class L7 extends u7{constructor(e){e.stroke?(e.stroke.color=e.stroke.getColor()||"#3388ff",e.stroke.width=e.stroke.getWidth()||1):e.stroke=new es({color:"#3388ff",width:1}),e.fill?e.fill.color=e.fill.getColor()||"#66ccff":e.fill=new Ko({color:"#66ccff"}),super({angle:e.angle||60,stroke:e.stroke,fill:e.fill,radius:e.radius||10,rotation:e.rotation||0}),this.count_=e.count||3,this.strokeOpacity=e.strokeOpacity||1,this.fillOpacity=e.fillOpacity||1,this._pixelRatio=window?window.devicePixelRatio:1,this._canvas=this.getImage(this._pixelRatio),this._ctx=this._canvas.getContext("2d"),this._render()}_render(){var e=0,t=this.getAngle();if(this.spaceAngle=360/this.count_-this.getAngle(),!(this.spaceAngle<0)){this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),this._ctx.translate(0,0),this._ctx.beginPath();for(var r=0;r<this.count_;r++)this._drawSector(this._ctx,this.getAnchor()[0],this.getAnchor()[1],this.getRadius(),e,t),e=t+this.spaceAngle,t=e+this.getAngle();this._fillStroke(),this._ctx.closePath()}}_drawSector(e,t,r,i,a,o){a=a/180*Math.PI,o=o/180*Math.PI,e.moveTo(t,r),e.lineTo(t+i*Math.cos(a),r+i*Math.sin(a)),e.arc(t,r,i,a,o),e.lineTo(t,r)}_fillStroke(){this.getFill()&&(this._ctx.globalAlpha=this.fillOpacity,this._ctx.fillStyle=this.getFill().color,this._ctx.fill()),this.getStroke()&&this.weight!==0&&(this._ctx.globalAlpha=this.strokeOpacity,this._ctx.lineWidth=this.getStroke().width,this._ctx.strokeStyle=this.getStroke().color,this._ctx.lineCap=this.getStroke().lineCap,this._ctx.lineJoin=this.getStroke().lineJoin,this._ctx.stroke())}getCount(){return this.count_}getSpaceAngle(){return this.spaceAngle}}class x8 extends L7{constructor(e){super(e),this.sAngle=e.sAngle,this.eAngle=e.eAngle,this._render()}_render(){this._ctx.clearRect(0,0,this.getImage().width,this.getImage().height),this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),this._ctx.translate(0,0),this._ctx.beginPath(),this._drawSector(this._ctx,this.getAnchor()[0],this.getAnchor()[1],this.getRadius(),this.sAngle,this.eAngle),this._fillStroke(),this._ctx.closePath()}getSAngle(){return this.sAngle}getEAngle(){return this.eAngle}}const OFr=()=>!1,gMe=function(){let n=document.createElement("div"),e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(let t=0;t<e.length;t++){let r=e[t];if(n.style[r]!==void 0)return r}return e[0]}();class yMe extends kv{constructor(e,t){super(),this.layer=e,this.map=e.map;let r=t||{};H.extend(this,r);let i=this.pixelRatio=window?window.devicePixelRatio:1;this.width=this.map.getSize()[0]*i,this.height=this.map.getSize()[1]*i,this.center=this.map.getView().getCenter(),this._initContainer(),this._registerEvents()}_registerEvents(){let e=this.map,t=e.getView();e.on("change:size",this._resizeEvent.bind(this),this),t.on("change:resolution",this._moveEndEvent.bind(this),this),t.on("change:center",this._moveEvent.bind(this),this),t.on("change:rotation",this._moveEndEvent.bind(this),this),e.on("moveend",this._moveEndEvent.bind(this),this)}_resizeEvent(){this._resize(),this._clearAndRedraw()}_moveEvent(){let e=this.map.getPixelFromCoordinate(this.center),t=this.map.getPixelFromCoordinate(this.map.getView().getCenter()),r=[e[0]-t[0],e[1]-t[1]];this._canvas.style[gMe]="translate("+Math.round(r[0])+"px,"+Math.round(r[1])+"px)"}_moveEndEvent(){this._canvas.style[gMe]="translate(0,0)",this.center=this.map.getView().getCenter(),this._clearAndRedraw()}_clearAndRedraw(){this._clearBuffer(),this.layer.changed()}_resize(){const e=this.map.getSize(),t=e[0]*this.pixelRatio,r=e[1]*this.pixelRatio;this._canvas.width=t,this._canvas.height=r,this._canvas.style.width=t+"px",this._canvas.style.height=r+"px"}_clearBuffer(){if(!this.deckGL)return;let e=this.deckGL.layerManager;return e&&e.context.gl.clear(e.context.gl.COLOR_BUFFER_BIT),this}getCanvas(){return this._canvas}update(e){if(e&&e.length>-1&&(this._data=e),!this._renderLayer)return;this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();let t=this._getLayerState();t.data=this._data||[],this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)}drawGraphics(e){this._data=e||(this._data?this._data:[]),this._renderLayer||this._createInnerRender(),this._clearBuffer(),this._draw()}_initContainer(){this._canvas=this._createCanvas(this.width,this.height),this._layerContainer=this.container,this._wrapper=document.createElement("div"),this._wrapper.className="deck-wrapper",this._wrapper.style.position="absolute",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.appendChild(this._canvas),this._layerContainer&&this._layerContainer.appendChild(this._wrapper)}_createCanvas(e,t){let r=document.createElement("canvas");return r.oncontextmenu=OFr,r.width=e,r.height=t,r.style.width=e+"px",r.style.height=t+"px",r}_createInnerRender(){let e=this,t=this._getLayerState(),{color:r,radius:i,opacity:a,highlightColor:o,radiusScale:s,radiusMinPixels:l,radiusMaxPixels:u,strokeWidth:h,outline:c}=t;i=this._pixelToMeter(i);let f={id:"scatter-plot",data:[],pickable:Boolean(this.onClick)||Boolean(this.onHover),autoHighlight:!0,color:r,opacity:a,radius:i,radiusScale:s,highlightColor:o,radiusMinPixels:l,radiusMaxPixels:u,strokeWidth:h,outline:c,getPosition(d){if(!d)return[0,0,0];let v=d.getGeometry(),p=v&&v.getCoordinates();return p=e._project(p),p&&[p[0],p[1],0]},getColor(d){let v=e._getLayerDefaultStyle(),p=d&&d.getStyle();return p&&p.getColor&&p.getColor()||v.color},getRadius(d){let v=e._getLayerDefaultStyle(),p=d&&d.getStyle();return p&&p.getRadius&&p.getRadius()||v.radius},updateTriggers:{getColor:[r],getRadius:[i]}};e._renderLayer=new window.DeckGL.ScatterplotLayer(f)}_getLayerDefaultStyle(){let{color:e,opacity:t,radius:r,radiusScale:i,radiusMinPixels:a,radiusMaxPixels:o,strokeWidth:s,outline:l}=this._getLayerState();return r=this._pixelToMeter(r),{color:e,opacity:t,radius:r,radiusScale:i,radiusMinPixels:a,radiusMaxPixels:o,strokeWidth:s,outline:l}}_getLayerState(){let e=this.layer.getLayerState(),r=this.map.getView().getProjection().getCode(),i=r7([e.longitude,e.latitude],r,"EPSG:4326");return e.longitude=i[0],e.latitude=i[1],e.zoom=e.zoom-1,e}_draw(){this._refreshData();let e=this._getLayerState();e.data=this._data||[];let t={};for(let r in e)t[r]=e[r];this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._canvas,this.onBeforeRender&&(t.onBeforeRender=this.onBeforeRender.bind(this)),this.onAfterRender&&(t.onAfterRender=this.onAfterRender.bind(this)),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)}_refreshData(){let e=this._data||[],t=br.isArray(e)?[].concat(e):[e];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(let r=0;r<t.length;r++)this._renderLayer.props.data.push(t[r]);this._data=this._renderLayer.props.data}_project(e){let r=this.map.getView().getProjection().getCode();return r==="EPSG:4326"?e:r7(e,r,"EPSG:4326")}_pixelToMeter(e){let t=this.map.getView(),i=t.getProjection().getUnits()||"degrees";i==="degrees"&&(i=Wl.DEGREE),i==="m"&&(i=Wl.METER);const a=t.getResolution();if(i===Wl.DEGREE){let o=a*(Math.PI*6378137/180);return e*o}else return e*a}}function RFr(n,e,t){let r=(n[0]-e[0])*t+e[0],i=(n[1]-e[1])*t+e[1];return[r,i]}class DFr extends kv{constructor(e,t){super(),this.layer=e,this.map=e.map;let r=t||{};H.extend(this,r),this.highLightStyle=this.layer.highLightStyle,this.mapWidth=this.size[0]/this.pixelRatio,this.mapHeight=this.size[1]/this.pixelRatio,this.width=this.map.getSize()[0],this.height=this.map.getSize()[1],this.context=br.createCanvasContext2D(this.mapWidth,this.mapHeight),this.context.scale(this.pixelRatio,this.pixelRatio),this.canvas=this.context.canvas,this.canvas.style.width=this.width+"px",this.canvas.style.height=this.height+"px",this._registerEvents()}_registerEvents(){this.map.on("change:size",this._resizeEvent.bind(this),this)}_resizeEvent(){this._resize(),this._clearAndRedraw()}_resize(){let e=this.map.getSize(),t=e[0],r=e[1],i=t/this.width,a=r/this.height;this.width=t,this.height=r,this.mapWidth=this.mapWidth*i,this.mapHeight=this.mapHeight*a,this.canvas.width=this.mapWidth,this.canvas.height=this.mapHeight,this.canvas.style.width=this.width+"px",this.canvas.style.height=this.height+"px"}_clearAndRedraw(){this._clearBuffer(),this.layer.changed()}update(){this.layer.changed()}_clearBuffer(){}getCanvas(){return this.canvas}drawGraphics(e){this.graphics_=e||[];let t=this.mapWidth,r=this.mapHeight,i=bmr(this.context,{size:[t,r],pixelRatio:this.pixelRatio}),a=this.layer._getDefaultStyle(),o=this,s=o.layer,l=s.map;e.map(function(u){let h=u.getStyle()||a;if(o.selected===u){let S=h;h instanceof rm?S=new rm({radius:h.getRadius(),fill:new Ko({color:"rgba(0, 153, 255, 1)"}),stroke:h.getStroke(),snapToPixel:br.getOlVersion()==="4"?h.getSnapToPixel():null}):h instanceof u7&&(S=new u7({radius:h.getRadius(),radius2:h.getRadius2(),points:h.getPoints(),angle:h.getAngle(),snapToPixel:br.getOlVersion()==="4"?h.getSnapToPixel():null,rotation:h.getRotation(),rotateWithView:h.getRotateWithView(),fill:new Ko({color:"rgba(0, 153, 255, 1)"}),stroke:h.getStroke()})),h=o.highLightStyle||S}i.setStyle(new So({image:h}));let f=u.getGeometry().getCoordinates(),d=l.getView().getCenter(),v=l.getPixelFromCoordinate(d),p=l.getView().getResolution(),g=(f[0]-d[0])/p,m=(d[1]-f[1])/p,y=[g+v[0],m+v[1]];y=RFr(y,v,1);let _=[y[0]+o.offset[0],y[1]+o.offset[1]],x=new Qs(_);return i.drawGeometry(x),u})}}class qM extends kv{constructor(e,t){super(),e instanceof vT&&(this.geometry_=e),this.attributes=t,this.setStyle()}clone(){var e=new qM;return e.setId(this.id),e.setGeometry(this.geometry_),e.setAttributes(this.attributes),e.setStyle(this.style_),e}getId(){return this.id}setId(e){this.id=e}getGeometry(){return this.geometry_}setGeometry(e){this.geometry_=e}setAttributes(e){this.attributes=e}getAttributes(){return this.attributes}getStyle(){return this.style_}setStyle(e){!this.style&&!e||(this.style_=e,this.styleFunction_=e?qM.createStyleFunction(new So({image:e})):void 0,this.changed())}getStyleFunction(){return this.styleFunction_}static createStyleFunction(e){var t;if(typeof e=="function")e.length==2?t=function(i){return e(this,i)}:t=e;else{var r;Array.isArray(e)?r=e:r=[e],t=function(){return r}}return t}destroy(){this.id=null,this.geometry_=null,this.attributes=null,this.style_=null}}var NFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),kFr=function(n){NFr(e,n);function e(t){var r=t||{};return n.call(this,r)||this}return e}(Ek);const FFr=kFr;var BFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),GFr=function(n){BFr(e,n);function e(t){var r=n.call(this,t)||this;return r.image_=null,r}return e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var r=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,a=t.viewState,o=a.resolution,s=this.getLayer().getSource(),l=t.viewHints,u=t.extent;if(r.extent!==void 0&&(u=tm(u,F1(r.extent,a.projection))),!l[Gs.ANIMATING]&&!l[Gs.INTERACTING]&&!Sk(u))if(s){var h=a.projection,c=s.getImage(u,o,i,h);c&&(this.loadImage(c)?this.image_=c:c.getState()===Ai.EMPTY&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var r=this.frameState;if(!r)return null;var i=this.getLayer(),a=ks(r.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!dv(o,a))return null;var s=this.image_.getExtent(),l=this.image_.getImage(),u=Co(s),h=Math.floor(l.width*((a[0]-s[0])/u));if(h<0||h>=l.width)return null;var c=lh(s),f=Math.floor(l.height*((s[3]-a[1])/c));return f<0||f>=l.height?null:this.getImageData(l,h,f)},e.prototype.renderFrame=function(t,r){var i=this.image_,a=i.getExtent(),o=i.getResolution(),s=i.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],u=t.pixelRatio,h=t.viewState,c=h.center,f=h.resolution,d=t.size,v=u*o/(f*s),p=Math.round(d[0]*u),g=Math.round(d[1]*u),m=h.rotation;if(m){var y=Math.round(Math.sqrt(p*p+g*g));p=y,g=y}Id(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,m,-p/2,-g/2),bk(this.inversePixelTransform,this.pixelTransform);var _=gue(this.pixelTransform);this.useContainer(r,_,l.opacity,this.getBackground(t));var x=this.context,S=x.canvas;S.width!=p||S.height!=g?(S.width=p,S.height=g):this.containerReused||x.clearRect(0,0,p,g);var w=!1,b=!0;if(l.extent){var E=F1(l.extent,h.projection);b=Cl(E,t.extent),w=b&&!vv(E,t.extent),w&&this.clipUnrotated(x,t,E)}var T=i.getImage(),C=Id(this.tempTransform,p/2,g/2,v,v,0,s*(a[0]-c[0])/o,s*(c[1]-a[3])/o);this.renderedResolution=o*u/s;var A=T.width*C[0],M=T.height*C[3];if(this.getLayer().getSource().getInterpolate()||Ao(x,w7),this.preRender(x,t),b&&A>=.5&&M>=.5){var I=C[4],R=C[5],k=l.opacity,D=void 0;k!==1&&(D=x.globalAlpha,x.globalAlpha=k),x.drawImage(T,0,0,+T.width,+T.height,Math.round(I),Math.round(R),Math.round(A),Math.round(M)),k!==1&&(x.globalAlpha=D)}return this.postRender(x,t),w&&x.restore(),Ao(x,Oqe),_!==S.style.transform&&(S.style.transform=_),this.container},e}(Sue);const zFr=GFr;var UFr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),VFr=function(n){UFr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.createRenderer=function(){return new zFr(this)},e.prototype.getData=function(t){return n.prototype.getData.call(this,t)},e}(FFr);const dZe=VFr,$Fr={color:[0,0,0,255],opacity:.8,radius:10,radiusScale:1,radiusMinPixels:0,radiusMaxPixels:Number.MAX_SAFE_INTEGER,strokeWidth:1,outline:!1},eZ=["canvas","webgl"];class v$ extends d${constructor(e){super({attributions:e.attributions,canvasFunction:r,logo:br.getOlVersion()==="4"?e.logo:null,projection:e.projection,ratio:e.ratio,resolutions:e.resolutions,state:e.state}),this.graphics=[].concat(e.graphics),this.map=e.map,H.extend(this,e),this.render=e.render||eZ[0],br.supportWebGL2()||(this.render=eZ[0]),this.highLightStyle=e.highLightStyle,this.isHighLight=typeof e.isHighLight>"u"?!0:e.isHighLight,this.hitGraphicLayer=null,this._forEachFeatureAtCoordinate=a,this._options=e;const t=this;e.onClick&&t.map.on("click",function(o){if(t.isDeckGLRender){const l=t.renderer.deckGL.pickObject({x:o.pixel[0],y:o.pixel[1]});e.onClick(l);return}const s=t.findGraphicByPixel(o,t);s&&(e.onClick(s,o),t.isHighLight&&t._highLight(s.getGeometry().getCoordinates(),new So({image:s.getStyle()}).getImage(),s,o.pixel))}),t.map.on("pointermove",function(o){if(t.isDeckGLRender){const s=t.renderer.deckGL.pickObject({x:o.pixel[0],y:o.pixel[1]});e.onHover&&e.onHover(s)}});function r(o,s,l,u,h){var c=u[0]/l,f=u[1]/l,d=t.map.getSize()[0],v=t.map.getSize()[1];t.renderer||(t.renderer=i(u,l)),t.renderer.mapWidth=c,t.renderer.mapHeight=f,t.renderer.pixelRatio=l,t.renderer.offset=[(c-d)/2,(f-v)/2];let p=this.getGraphicsInExtent(o);return t.renderer._clearBuffer(),t.renderer.selected=this.selected,t.renderer.drawGraphics(p),t.isDeckGLRender=t.renderer instanceof yMe,t.isDeckGLRender?(t.context||(t.context=br.createCanvasContext2D(c,f)),t.context.canvas):t.renderer.getCanvas()}function i(o,s){let l;if(t.render===eZ[0])l=new DFr(t,{size:o,pixelRatio:s});else{let u=H.extend({},$Fr),h=H.extend(u,{color:t.color,opacity:t.opacity,radius:t.radius,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline,onClick:t.onClick,onHover:t.onHover});h=H.extend(t,h),h.pixelRatio=s,h.container=t.map.getViewport().getElementsByClassName("ol-overlaycontainer")[0],h.onBeforeRender=function(){return!1},h.onAfterRender=function(){return!1},l=new yMe(t,h)}return l}function a(o,s,l,u,h){let c=t.getGraphicsInExtent();t._highLightClose();for(let f=c.length-1;f>=0;f--){let d=c[f].getStyle();if(!d)return;if(d instanceof x8)continue;let v=c[f].getGeometry().getCoordinates(),p=new So({image:d}).getImage(),g=!1;if(p instanceof L7&&p.getCount()===1){const m=p.getRotation()*180/Math.PI,y=Number.parseFloat(p.getAngle()),_=p.getRadius()*s;let x=null;if(y>355)x=new rm(v,_);else{const S=[];S.push(v);const w=y/8;for(let b=0;b<8;b++){const E=(m+b*w)/180*Math.PI;S.push([v[0]+_*Math.cos(E),v[1]-_*Math.sin(E)])}S.push(v),x=new m2([S])}x.intersectsCoordinate(this.map.getCoordinateFromPixel(u))&&(g=!0)}else{let m=[];m[0]=v[0]-p.getAnchor()[0]*s,m[2]=v[0]+p.getAnchor()[0]*s,m[1]=v[1]-p.getAnchor()[1]*s,m[3]=v[1]+p.getAnchor()[1]*s,dv(m,o)&&(g=!0)}if(g===!0){l&&l(c[f],h);continue}}}}findGraphicByPixel(e,t){const r=t.map.getFeaturesAtPixel(e.pixel)||[];for(let i=0;i<r.length;i++){const a=r[i];if(t.graphics.indexOf(a)>-1)return a}}setGraphics(e){this.graphics=this.graphics||[],this.graphics.length=0;let t=br.isArray(e)?[].concat(e):[e];this.graphics=[].concat(t),this.update()}addGraphics(e){this.graphics=this.graphics||[];let t=br.isArray(e)?[].concat(e):[e];this.graphics=this.graphics.concat(t),this.update()}getGraphicBy(e,t){let r=null;for(let i in this.graphics)if(this.graphics[i][e]===t){r=this.graphics[i];break}return r}getGraphicById(e){return this.getGraphicBy("id",e)}getGraphicsByAttribute(e,t){var r,i=[];for(let a in this.graphics)r=this.graphics[a],r&&r.attributes&&r.attributes[e]===t&&i.push(r);return i}removeGraphics(e=null){if(!e||e.length===0||e===this.graphics){this.graphics.length=0,this.update();return}H.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--){let r=e[t],i=H.indexOf(this.graphics,r);i!==-1&&this.graphics.splice(i,1)}this.update()}clear(){this.removeGraphics()}update(){this.renderer.update(this.graphics,this._getDefaultStyle())}_getDefaultStyle(){const e={};return this.color&&(e.fill=new Ko({color:this.toRGBA(this.color)})),this.radius&&(e.radius=this.radius),this.outline&&(e.stroke=new Ko({color:this.toRGBA(this.color),width:this.strokeWidth})),new rm(e)}toRGBA(e){return`rgba(${e[0]},${e[1]},${e[2]},${(e[3]||255)/255})`}setStyle(e){let t=this,r={color:t.color,radius:t.radius,opacity:t.opacity,highlightColor:t.highlightColor,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline};H.extend(t,H.extend(r,e)),t.update()}getLayerState(){let e=this.map,t=e.getSize()[0],r=e.getSize()[1],i=e.getView(),a=i.getCenter(),o=a[0],s=a[1],l=i.getZoom(),u=i.getMaxZoom(),c=-i.getRotation()*180/Math.PI,f={longitude:o,latitude:s,zoom:l,maxZoom:u,pitch:0,bearing:c},d={};for(let v in f)d[v]=f[v];return d.width=t,d.height=r,d.color=this.color,d.radius=this.radius,d.opacity=this.opacity,d.highlightColor=this.highlightColor,d.radiusScale=this.radiusScale,d.radiusMinPixels=this.radiusMinPixels,d.radiusMaxPixels=this.radiusMaxPixels,d.strokeWidth=this.strokeWidth,d.outline=this.outline,d}_highLightClose(){this.selected=null,this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null),this.changed()}_highLight(e,t,r,i){if(r.getStyle()instanceof L7){this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null);var a=this.map.getPixelFromCoordinate([e[0],e[1]]);i=i||[0,0];var o=Math.atan2(i[1]-a[1],i[0]-a[0])/Math.PI*180;o=o>0?o:360+o;var s=Math.ceil(o/(t.getAngle()+t.getSpaceAngle())),l=(s-1)*(t.getAngle()+t.getSpaceAngle()),u={stroke:new es({color:"#ff0000",width:1}),fill:new Ko({color:"#0099ff"}),radius:t.getRadius(),angle:t.getAngle(),eAngle:l+t.getAngle(),sAngle:l,rotation:t.getRotation()};this.highLightStyle&&this.highLightStyle instanceof x8&&(u.stroke=this.highLightStyle.getStroke(),u.fill=this.highLightStyle.getFill(),u.radius=this.highLightStyle.getRadius(),u.angle=this.highLightStyle.getAngle());var h=new qM(new Qs(e));h.setStyle(new x8(u)),this.hitGraphicLayer=new dZe({source:new v$({map:this.map,graphics:[h]})}),this.map.addLayer(this.hitGraphicLayer)}else this.selected=r,this.changed()}getGraphicsInExtent(e){var t=[];return e?(this.graphics.forEach(r=>{vv(e,r.getGeometry().getExtent())&&t.push(r)}),t):(this.graphics.forEach(r=>{t.push(r)}),t)}}class AS extends fS{constructor(e,t){super(e,t),this.cache=t.cache||{},this.cacheFields=t.cacheFields||[],this.style=t.style||{},this.maxCacheCount=t.maxCacheCount||0,this.isCustomSetMaxCacheCount=t.isCustomSetMaxCacheCount===void 0?!1:t.isCustomSetMaxCacheCount,this.nodesClipPixel=t.nodesClipPixel||2,this.isHoverAble=t.isHoverAble===void 0?!1:t.isHoverAble,this.isMultiHover=t.isMultiHover===void 0?!1:t.isMultiHover,this.isClickAble=t.isClickAble===void 0?!0:t.isClickAble,this.highlightStyle=t.highlightStyle||null,this.isAllowFeatureStyle=t.isAllowFeatureStyle===void 0?!1:t.isAllowFeatureStyle}destroy(){this.maxCacheCount=null,this.isCustomSetMaxCacheCount=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.cache=null,this.cacheFields=null,this.style=null,this.highlightStyle=null,this.isAllowFeatureStyle=null}addFeatures(e){this.dispatchEvent({type:"beforefeaturesadded",value:{features:e}}),this.features=this.toiClientFeature(e),this.isCustomSetMaxCacheCount||(this.maxCacheCount=this.features.length*5),this.renderer&&this.changed()}removeFeatures(e){this.clearCache(),fS.prototype.removeFeatures.call(this,e)}removeAllFeatures(){this.clearCache(),fS.prototype.removeAllFeatures.apply(this,arguments)}redrawThematicFeatures(e){var t=this.renderer.getHoverOne(),r=null;t&&t.refDataID&&(r=t.refDataID),this.renderer.clearAll();for(var i=this.features,a=this.cache,o=this.cacheFields,s=this.map.getView().getZoom(),l=this.maxCacheCount,u=0,h=i.length;u<h;u++){var c=i[u];if(!!c.geometry){var f=c.geometry.getBounds();if(e){var d=new po(e[0],e[1],e[2],e[3]);if(!d.intersectsBounds(f))continue}var v=c.id+"_zoom_"+s.toString(),p;if(a[v])a[v].updateAndAddShapes();else{if(p=this.createThematicFeature(i[u]),p.getShapesCount()<1)continue;if(a[v]=p,o.push(v),o.length>l){var g=o[0];o.splice(0,1),delete a[g]}}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var m=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(m)}}createThematicFeature(e){var t=H.copyAttributesWithClip(this.style);e.style&&this.isAllowFeatureStyle===!0&&(t=H.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a<i.shapes.length;a++)this.renderer.addShape(i.shapes[a]);return i}canvasFunctionInternal_(e,t,r,i,a){return fS.prototype.canvasFunctionInternal_.apply(this,arguments)}clearCache(){this.cache={},this.cacheFields=[]}clear(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()}getCacheCount(){return this.cacheFields.length}setMaxCacheCount(e){isNaN(e)||(this.maxCacheCount=e,this.isCustomSetMaxCacheCount=!0)}getShapesByFeatureID(e){var t=[],r=this.renderer.getAllShapes();if(!e)return r;for(var i=0,a=r.length;i<a;i++){var o=r[i];o.refDataID&&e===o.refDataID&&t.push(o)}return t}}class WFr extends AS{constructor(e,t){super(e,t),this.isOverLay=t.isOverLay!=null?t.isOverLay:!0,this.isAvoid=t.isAvoid!=null?t.isAvoid:!0,this.style=t.style,this.themeField=t.themeField,this.styleGroups=t.styleGroups,this.defaultStyle={fontColor:"#000000",fontOpacity:1,fontSize:"12px",fontStyle:"normal",fontWeight:"normal",labelAlign:"cm",labelXOffset:0,labelYOffset:0,labelRotation:0,fill:!1,fillColor:"#ee9900",fillOpacity:.4,stroke:!1,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",labelSelect:!0,_isGeoTextStrategyStyle:!0},this.getPxBoundsMode=0,this.labelFeatures=[]}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,super.destroy()}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a<i.shapes.length;a++)this.renderer.addShape(i.shapes[a]);return i}redrawThematicFeatures(e){if(this.features.length>0&&this.labelFeatures.length===0)for(var t=this.setLabelsStyle(this.features),r=0,i=t.length;r<i;r++)this.labelFeatures.push(t[r]);this.features=this.getDrawnLabels(this.labelFeatures),super.redrawThematicFeatures.call(this,e)}removeFeatures(e){this.labelFeatures=[],super.removeFeatures.call(this,e)}removeAllFeatures(){this.labelFeatures=[],super.removeAllFeatures.call(this,arguments)}getDrawnLabels(e){var t=[],r,i,a=[],o,s,l={labelAlign:"cm",labelXOffset:0,labelYOffset:0},u=this.map,h=u.getSize();h={x:h[0],y:h[1]};for(var c=u.getView().getZoom(),f=0,d=e.length;f<d;f++){i=e[f],i.isStyleChange&&(i=this.setStyle(i));var v=this.getLabelPxLocation(i);if(v.x>=0&&v.x<=h.x&&v.y>=0&&v.y<=h.y){if(i.style.minZoomLevel>-1&&c<=i.style.minZoomLevel||i.style.maxZoomLevel>-1&&c>i.style.maxZoomLevel)continue;var p=null;i.isStyleChange?(i.isStyleChange=null,p=this.calculateLabelBounds(i,v)):i.geometry.bsInfo.w&&i.geometry.bsInfo.h?p=this.calculateLabelBounds2(i,v):p=this.calculateLabelBounds(i,v);var g=new po(0,h.y,h.x,0),m=p.length;if(this.isAvoid){var y=this.getAvoidInfo(g,p);if(y){if(y.aspectW==="left"){i.style.labelXOffset+=y.offsetX;for(let E=0;E<m;E++)p[E].x+=y.offsetX}else if(y.aspectW==="right"){i.style.labelXOffset+=-y.offsetX;for(let E=0;E<m;E++)p[E].x+=-y.offsetX}if(y.aspectH==="top"){i.style.labelYOffset+=y.offsetY;for(let E=0;E<m;E++)p[E].y+=y.offsetY}else if(y.aspectH==="bottom"){i.style.labelYOffset+=-y.offsetY;for(let E=0;E<m;E++)p[E].y+=-y.offsetY}i.isStyleChange=!0}}if(this.isOverLay){var _=!1;if(f!=0){for(let E=0;E<a.length;E++)if(this.isQuadrilateralOverLap(p,a[E])){_=!0;break}}if(_)continue;a.push(p)}var x=[];for(let E=0;E<m-1;E++)x.push(u.getCoordinateFromPixel([p[E].x,p[E].y]));var S=new po(x[3][0],x[3][1],x[1][0],[x[1][1]]),w=S.getCenterLonLat(),b=new O_(w.lon,w.lat,i.attributes[this.themeField]);b.calculateBounds(),o=H.cloneObject(i.style),s=H.cloneObject(H.copyAttributes(o,l)),r=new sc(b,i.attributes,s),r.id=i.id,r.fid=i.fid,t.push(r)}}return t}getStyleByData(e){var t=e;if(t.style=H.copyAttributes(t.style,this.defaultStyle),this.style&&this.style.fontSize&&parseFloat(this.style.fontSize)<12&&(this.style.fontSize="12px"),t.style=H.copyAttributes(t.style,this.style),this.themeField&&this.styleGroups&&t.attributes){var r=this.themeField,i=t.attributes,a=this.styleGroups,o=!1,s=null;for(var l in i)if(r===l){o=!0,s=i[l];break}if(o){for(var u=0,h=a.length;u<h;u++)if(s>=a[u].start&&s<a[u].end){var c=a[u].style;c&&c.fontSize&&parseFloat(c.fontSize)<12&&(c.fontSize="12px"),t.style=H.copyAttributes(t.style,c)}}t.style.label=t.attributes[this.themeField]}return t.style}setLabelsStyle(e){for(var t,r=[],i=0,a=e.length;i<a;i++){var o=e[i];if(o.geometry.CLASS_NAME==="SuperMap.Geometry.GeoText")(o.geometry.bsInfo.w||o.geometry.bsInfo.h)&&(o.geometry.bsInfo.w=null,o.geometry.bsInfo.h=null,o.geometry.labelWTmp=null),t=this.setStyle(o),t.layer=this.layer,r.push(t);else return e}return r}setStyle(e){var t=e;if(t.style=H.copyAttributes(t.style,this.defaultStyle),this.style&&this.style.fontSize&&parseFloat(this.style.fontSize)<12&&(this.style.fontSize="12px"),t.style=H.copyAttributes(t.style,this.style),this.groupField&&this.styleGroups&&t.attributes){var r=this.groupField,i=t.attributes,a=this.styleGroups,o=!1,s=null;for(var l in i)if(r===l){o=!0,s=i[l];break}if(o){for(var u=0,h=a.length;u<h;u++)if(s>=a[u].start&&s<a[u].end){var c=a[u].style;c&&c.fontSize&&parseFloat(c.fontSize)<12&&(c.fontSize="12px"),t.style=H.copyAttributes(t.style,c)}}}return t.style.label=t.geometry.text,t}getLabelPxLocation(e){var t=e.geometry,r=e.style,i=t.getCentroid(),a=this.map.getPixelFromCoordinate([i.x,i.y]),o=new Qs([a[0],a[1]]);if(r.labelXOffset||r.labelYOffset){var s=isNaN(r.labelXOffset)?0:r.labelXOffset,l=isNaN(r.labelYOffset)?0:r.labelYOffset;o.translate(s,-l)}return{x:o.getCoordinates()[0],y:o.getCoordinates()[1]}}calculateLabelBounds(e,t){var r=e.geometry,i=null,a=null;if(this.getPxBoundsMode==0)i=r.getLabelPxBoundsByText(t,e.style);else if(this.getPxBoundsMode===1)a=this.getLabelInfo(e.geometry.getCentroid(),e.style),i=r.getLabelPxBoundsByLabel(t,a.w,a.h,e.style);else return null;var o=[];return e.style.labelRotation%180==0?o=[{x:i.left,y:i.top},{x:i.right,y:i.top},{x:i.right,y:i.bottom},{x:i.left,y:i.bottom},{x:i.left,y:i.top}]:o=this.rotationBounds(i,t,e.style.labelRotation),r.bounds=new po(o[1].x,o[3].y,o[2].x,o[4].y),o}calculateLabelBounds2(e,t){var r,i,a,o,s,l=e.geometry.bsInfo,u=e.style,h=H.cloneObject(t);if(u.labelAlign&&u.labelAlign!=="cm")switch(u.labelAlign){case"lt":h.x+=l.w/2,h.y+=l.h/2;break;case"lm":h.x+=l.w/2;break;case"lb":h.x+=l.w/2,h.y-=l.h/2;break;case"ct":h.y+=l.h/2;break;case"cb":h.y-=l.h/2;break;case"rt":h.x-=l.w/2,h.y+=l.h/2;break;case"rm":h.x-=l.w/2;break;case"rb":h.x-=l.w/2,h.y-=l.h/2;break}i=h.x-l.w/2,a=h.y+l.h/2,u.fontStyle&&u.fontStyle==="italic"?s=h.x+l.w/2+parseInt(parseFloat(u.fontSize)/2):s=h.x+l.w/2,o=h.y-l.h/2,r=new po(i,a,s,o);var c=[];return u.labelRotation%180==0?c=[{x:r.left,y:r.top},{x:r.right,y:r.top},{x:r.right,y:r.bottom},{x:r.left,y:r.bottom},{x:r.left,y:r.top}]:c=this.rotationBounds(r,t,u.labelRotation),e.geometry.bounds=new po(c[1].x,c[3].y,c[2].x,c[4].y),c}getLabelInfo(e,t){var r={l:"left",r:"right",t:"top",b:"bottom"},i={l:0,r:-1,t:0,b:-1};t=H.extend({fontColor:"#000000",labelAlign:"cm"},t);var a=this.getLocalXY(e),o=0;if(t.labelXOffset||t.labelYOffset){var s=isNaN(t.labelXOffset)?0:t.labelXOffset,l=isNaN(t.labelYOffset)?0:t.labelYOffset;a[0]+=s,a[1]-=l}var u=document.createElement("canvas");u.globalAlpha=0,u.lineWidth=1;var h=u.getContext("2d");h.fillStyle=t.fontColor,h.globalAlpha=t.fontOpacity||1;var c=[t.fontStyle?t.fontStyle:"normal","normal",t.fontWeight?t.fontWeight:"normal",t.fontSize?t.fontSize:"1em",t.fontFamily?t.fontFamily:"sans-serif"].join(" "),f=t.label.split(`
`),d=f.length,v,p,g;if(h.fillText){h.font=c,h.textAlign=r[t.labelAlign[0]]||"center",h.textBaseline=r[t.labelAlign[1]]||"middle",v=i[t.labelAlign[1]],v==null&&(v=-.5),p=h.measureText("Mg").height||h.measureText("xx").width,a[1]+=p*v*(d-1);for(let y=0;y<d;y++)g=h.measureText(f[y]).width,o<g&&(o=g)}else if(h.mozDrawText){h.mozTextStyle=c,v=i[t.labelAlign[1]],v==null&&(v=-.5),p=h.mozMeasureText("xx"),a[1]+=p*(1+v*d);for(let y=0;y<d;y++)g=h.measureText(f[y]).width,o<g&&(o=g)}var m={};if(o)m.w=o;else return null;return m.h=t.fontSize,m.rows=f.length,m}rotationBounds(e,t,r){var i=new Qs([e.left,e.top]),a=new Qs([e.right,e.top]),o=new Qs([e.right,e.bottom]),s=new Qs([e.left,e.bottom]),l=[];l.push(this.getRotatedLocation(i.getCoordinates()[0],i.getCoordinates()[1],t.x,t.y,r)),l.push(this.getRotatedLocation(a.getCoordinates()[0],a.getCoordinates()[1],t.x,t.y,r)),l.push(this.getRotatedLocation(o.getCoordinates()[0],o.getCoordinates()[1],t.x,t.y,r)),l.push(this.getRotatedLocation(s.getCoordinates()[0],s.getCoordinates()[1],t.x,t.y,r));for(var u=[],h=0;h<l.length;h++)u.push({x:l[h].x,y:l[h].y});return u.push({x:l[0].x,y:l[0].y}),u}getRotatedLocation(e,t,r,i,a){var o={},s,l;return t=-t,i=-i,a=-a,s=(e-r)*Math.cos(a/180*Math.PI)-(t-i)*Math.sin(a/180*Math.PI)+r,l=(e-r)*Math.sin(a/180*Math.PI)+(t-i)*Math.cos(a/180*Math.PI)+i,o.x=s,o.y=-l,o}getAvoidInfo(e,t){if(t.length!==5)return null;for(var r=[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.right,y:e.bottom},{x:e.left,y:e.bottom},{x:e.left,y:e.top}],i=!1,a=r.length,o=t.length,s=0,l=0,u="",h="",c=0;c<a-1;c++)for(var f=0;f<o-1;f++){var d=H.lineIntersection(r[c],r[c+1],t[f],t[f+1]);d.CLASS_NAME==="SuperMap.Geometry.Point"&&(v(t[f]),v(t[f+1]),i=!0)}if(i)return{aspectW:h,aspectH:u,offsetX:s,offsetY:l};return null;function v(p){if(!e.contains(p.x,p.y)){if(p.y<e.top){let g=Math.abs(e.top-p.y);g>l&&(l=g,u="top")}if(p.y>e.bottom){let g=Math.abs(p.y-e.bottom);g>l&&(l=g,u="bottom")}if(p.x<e.left){let g=Math.abs(e.left-p.x);g>s&&(s=g,h="left")}if(p.x>e.right){let g=Math.abs(p.x-e.right);g>s&&(s=g,h="right")}}}}isQuadrilateralOverLap(e,t){var r=e.length,i=t.length;if(r!==5||i!==5)return null;var a=!1;for(let l=0;l<r;l++)if(this.isPointInPoly(e[l],t)){a=!0;break}for(let l=0;l<i;l++)if(this.isPointInPoly(t[l],e)){a=!0;break}for(let l=0;l<r-1&&!a;l++)for(var o=0;o<i-1;o++){var s=H.lineIntersection(e[l],e[l+1],t[o],t[o+1]);if(s.CLASS_NAME==="SuperMap.Geometry.Point"){a=!0;break}}return a}isPointInPoly(e,t){for(var r=!1,i=-1,a=t.length,o=a-1;++i<a;o=i)(t[i].y<=e.y&&e.y<t[o].y||t[o].y<=e.y&&e.y<t[i].y)&&e.x<(t[o].x-t[i].x)*(e.y-t[i].y)/(t[o].y-t[i].y)+t[i].x&&(r=!r);return r}canvasFunctionInternal_(e,t,r,i,a){return super.canvasFunctionInternal_.apply(this,arguments)}}class HFr{constructor(e){this.options=e||{},this.enableMassClear=this.options.enableMassClear,this._map=e.map,this.paneName=this.options.paneName||"mapPane",this.context=this.options.context||"2d",this.zIndex=this.options.zIndex||2,this.mixBlendMode=this.options.mixBlendMode||null,this.width=e.width,this.height=e.height,this.initialize()}initialize(){var e=this.canvas=document.createElement("canvas");e.style.cssText="position:absolute;left:0;top:0;z-index:"+this.zIndex+";user-select:none;",e.style.mixBlendMode=this.mixBlendMode,e.className="mapvClass";var t=typeof window>"u"?{}:window,r=this.devicePixelRatio=t.devicePixelRatio||1;e.width=parseInt(this.width)*r,e.height=parseInt(this.height)*r,this.context==="2d"&&e.getContext(this.context).scale(r,r),e.style.width=this.width+"px",e.style.height=this.height+"px",this.context==="webgl"&&this.canvas.getContext(this.context).viewport(0,0,e.width,e.height)}draw(){this.options.update&&this.options.update.call(this)}resize(e,t){var r=typeof window>"u"?{}:window,i=this.devicePixelRatio=r.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=t*i,this.context==="2d"&&this.canvas.getContext("2d").scale(i,i),this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.context==="webgl"&&this.canvas.getContext(this.context).viewport(0,0,this.canvas.width,this.canvas.height)}getContainer(){return this.canvas}setZIndex(e){this.canvas.style.zIndex=e}getZIndex(){return this.zIndex}}var P7={exports:{}};(function(n,e){(function(t,r){r(e)})(at,function(t){var r="2.0.62",i=function(B){B&&B.clearRect&&B.clearRect(0,0,B.canvas.width,B.canvas.height)},a=function(B){var O=window.devicePixelRatio||1;B.canvas.width=B.canvas.width*O,B.canvas.height=B.canvas.height*O,B.canvas.style.width=B.canvas.width/O+"px",B.canvas.style.height=B.canvas.height/O+"px",B.scale(O,O)};function o(){this._subscribers={}}o.prototype.on=function(B,O){var F=this._subscribers[B];F||(F=[],this._subscribers[B]=F),F.push({callback:O})},o.prototype.off=function(B,O){var F=this._subscribers[B];if(F)for(var N=0;N<F.length;N++)F[N].callback==O&&(F.splice(N,1),N--)},o.prototype._trigger=function(B,O,F){if(B=="*")throw new Error("Cannot trigger event *");var N=[];B in this._subscribers&&(N=N.concat(this._subscribers[B])),"*"in this._subscribers&&(N=N.concat(this._subscribers["*"]));for(var U=0,X=N.length;U<X;U++){var Z=N[U];Z.callback&&Z.callback(B,O,F||null)}};var s={municipalities:[{n:"\u5317\u4EAC",g:"116.395645,39.929986|12"},{n:"\u4E0A\u6D77",g:"121.487899,31.249162|12"},{n:"\u5929\u6D25",g:"117.210813,39.14393|12"},{n:"\u91CD\u5E86",g:"106.530635,29.544606|12"}],provinces:[{n:"\u5B89\u5FBD",g:"117.216005,31.859252|8",cities:[{n:"\u5408\u80A5",g:"117.282699,31.866942|12"},{n:"\u5B89\u5E86",g:"117.058739,30.537898|13"},{n:"\u868C\u57E0",g:"117.35708,32.929499|13"},{n:"\u4EB3\u5DDE",g:"115.787928,33.871211|13"},{n:"\u5DE2\u6E56",g:"117.88049,31.608733|13"},{n:"\u6C60\u5DDE",g:"117.494477,30.660019|14"},{n:"\u6EC1\u5DDE",g:"118.32457,32.317351|13"},{n:"\u961C\u9633",g:"115.820932,32.901211|13"},{n:"\u6DEE\u5317",g:"116.791447,33.960023|13"},{n:"\u6DEE\u5357",g:"117.018639,32.642812|13"},{n:"\u9EC4\u5C71",g:"118.29357,29.734435|13"},{n:"\u516D\u5B89",g:"116.505253,31.755558|13"},{n:"\u9A6C\u978D\u5C71",g:"118.515882,31.688528|13"},{n:"\u5BBF\u5DDE",g:"116.988692,33.636772|13"},{n:"\u94DC\u9675",g:"117.819429,30.94093|14"},{n:"\u829C\u6E56",g:"118.384108,31.36602|12"},{n:"\u5BA3\u57CE",g:"118.752096,30.951642|13"}]},{n:"\u798F\u5EFA",g:"117.984943,26.050118|8",cities:[{n:"\u798F\u5DDE",g:"119.330221,26.047125|12"},{n:"\u9F99\u5CA9",g:"117.017997,25.078685|13"},{n:"\u5357\u5E73",g:"118.181883,26.643626|13"},{n:"\u5B81\u5FB7",g:"119.542082,26.656527|14"},{n:"\u8386\u7530",g:"119.077731,25.44845|13"},{n:"\u6CC9\u5DDE",g:"118.600362,24.901652|12"},{n:"\u4E09\u660E",g:"117.642194,26.270835|14"},{n:"\u53A6\u95E8",g:"118.103886,24.489231|12"},{n:"\u6F33\u5DDE",g:"117.676205,24.517065|12"}]},{n:"\u7518\u8083",g:"102.457625,38.103267|6",cities:[{n:"\u5170\u5DDE",g:"103.823305,36.064226|12"},{n:"\u767D\u94F6",g:"104.171241,36.546682|13"},{n:"\u5B9A\u897F",g:"104.626638,35.586056|13"},{n:"\u7518\u5357\u5DDE",g:"102.917442,34.992211|14"},{n:"\u5609\u5CEA\u5173",g:"98.281635,39.802397|13"},{n:"\u91D1\u660C",g:"102.208126,38.516072|13"},{n:"\u9152\u6CC9",g:"98.508415,39.741474|13"},{n:"\u4E34\u590F\u5DDE",g:"103.215249,35.598514|13"},{n:"\u9647\u5357",g:"104.934573,33.39448|14"},{n:"\u5E73\u51C9",g:"106.688911,35.55011|13"},{n:"\u5E86\u9633",g:"107.644227,35.726801|13"},{n:"\u5929\u6C34",g:"105.736932,34.584319|13"},{n:"\u6B66\u5A01",g:"102.640147,37.933172|13"},{n:"\u5F20\u6396",g:"100.459892,38.93932|13"}]},{n:"\u5E7F\u4E1C",g:"113.394818,23.408004|8",cities:[{n:"\u5E7F\u5DDE",g:"113.30765,23.120049|12"},{n:"\u6F6E\u5DDE",g:"116.630076,23.661812|13"},{n:"\u4E1C\u839E",g:"113.763434,23.043024|12"},{n:"\u4F5B\u5C71",g:"113.134026,23.035095|13"},{n:"\u6CB3\u6E90",g:"114.713721,23.757251|12"},{n:"\u60E0\u5DDE",g:"114.410658,23.11354|12"},{n:"\u6C5F\u95E8",g:"113.078125,22.575117|13"},{n:"\u63ED\u9633",g:"116.379501,23.547999|13"},{n:"\u8302\u540D",g:"110.931245,21.668226|13"},{n:"\u6885\u5DDE",g:"116.126403,24.304571|13"},{n:"\u6E05\u8FDC",g:"113.040773,23.698469|13"},{n:"\u6C55\u5934",g:"116.72865,23.383908|13"},{n:"\u6C55\u5C3E",g:"115.372924,22.778731|14"},{n:"\u97F6\u5173",g:"113.594461,24.80296|13"},{n:"\u6DF1\u5733",g:"114.025974,22.546054|12"},{n:"\u9633\u6C5F",g:"111.97701,21.871517|14"},{n:"\u4E91\u6D6E",g:"112.050946,22.937976|13"},{n:"\u6E5B\u6C5F",g:"110.365067,21.257463|13"},{n:"\u8087\u5E86",g:"112.479653,23.078663|13"},{n:"\u4E2D\u5C71",g:"113.42206,22.545178|12"},{n:"\u73E0\u6D77",g:"113.562447,22.256915|13"}]},{n:"\u5E7F\u897F",g:"108.924274,23.552255|7",cities:[{n:"\u5357\u5B81",g:"108.297234,22.806493|12"},{n:"\u767E\u8272",g:"106.631821,23.901512|13"},{n:"\u5317\u6D77",g:"109.122628,21.472718|13"},{n:"\u5D07\u5DE6",g:"107.357322,22.415455|14"},{n:"\u9632\u57CE\u6E2F",g:"108.351791,21.617398|15"},{n:"\u6842\u6797",g:"110.26092,25.262901|12"},{n:"\u8D35\u6E2F",g:"109.613708,23.103373|13"},{n:"\u6CB3\u6C60",g:"108.069948,24.699521|14"},{n:"\u8D3A\u5DDE",g:"111.552594,24.411054|14"},{n:"\u6765\u5BBE",g:"109.231817,23.741166|14"},{n:"\u67F3\u5DDE",g:"109.422402,24.329053|12"},{n:"\u94A6\u5DDE",g:"108.638798,21.97335|13"},{n:"\u68A7\u5DDE",g:"111.305472,23.485395|13"},{n:"\u7389\u6797",g:"110.151676,22.643974|14"}]},{n:"\u8D35\u5DDE",g:"106.734996,26.902826|8",cities:[{n:"\u8D35\u9633",g:"106.709177,26.629907|12"},{n:"\u5B89\u987A",g:"105.92827,26.228595|13"},{n:"\u6BD5\u8282\u5730\u533A",g:"105.300492,27.302612|14"},{n:"\u516D\u76D8\u6C34",g:"104.852087,26.591866|13"},{n:"\u94DC\u4EC1\u5730\u533A",g:"109.196161,27.726271|14"},{n:"\u9075\u4E49",g:"106.93126,27.699961|13"},{n:"\u9ED4\u897F\u5357\u5DDE",g:"104.900558,25.095148|11"},{n:"\u9ED4\u4E1C\u5357\u5DDE",g:"107.985353,26.583992|11"},{n:"\u9ED4\u5357\u5DDE",g:"107.523205,26.264536|11"}]},{n:"\u6D77\u5357",g:"109.733755,19.180501|9",cities:[{n:"\u6D77\u53E3",g:"110.330802,20.022071|13"},{n:"\u767D\u6C99",g:"109.358586,19.216056|12"},{n:"\u4FDD\u4EAD",g:"109.656113,18.597592|12"},{n:"\u660C\u6C5F",g:"109.0113,19.222483|12"},{n:"\u510B\u5DDE",g:"109.413973,19.571153|13"},{n:"\u6F84\u8FC8",g:"109.996736,19.693135|13"},{n:"\u4E1C\u65B9",g:"108.85101,18.998161|13"},{n:"\u5B9A\u5B89",g:"110.32009,19.490991|13"},{n:"\u743C\u6D77",g:"110.414359,19.21483|13"},{n:"\u743C\u4E2D",g:"109.861849,19.039771|12"},{n:"\u4E50\u4E1C",g:"109.062698,18.658614|12"},{n:"\u4E34\u9AD8",g:"109.724101,19.805922|13"},{n:"\u9675\u6C34",g:"109.948661,18.575985|12"},{n:"\u4E09\u4E9A",g:"109.522771,18.257776|12"},{n:"\u5C6F\u660C",g:"110.063364,19.347749|13"},{n:"\u4E07\u5B81",g:"110.292505,18.839886|13"},{n:"\u6587\u660C",g:"110.780909,19.750947|13"},{n:"\u4E94\u6307\u5C71",g:"109.51775,18.831306|13"}]},{n:"\u6CB3\u5317",g:"115.661434,38.61384|7",cities:[{n:"\u77F3\u5BB6\u5E84",g:"114.522082,38.048958|12"},{n:"\u4FDD\u5B9A",g:"115.49481,38.886565|13"},{n:"\u6CA7\u5DDE",g:"116.863806,38.297615|13"},{n:"\u627F\u5FB7",g:"117.933822,40.992521|14"},{n:"\u90AF\u90F8",g:"114.482694,36.609308|13"},{n:"\u8861\u6C34",g:"115.686229,37.746929|13"},{n:"\u5ECA\u574A",g:"116.703602,39.518611|13"},{n:"\u79E6\u7687\u5C9B",g:"119.604368,39.945462|12"},{n:"\u5510\u5C71",g:"118.183451,39.650531|13"},{n:"\u90A2\u53F0",g:"114.520487,37.069531|13"},{n:"\u5F20\u5BB6\u53E3",g:"114.893782,40.811188|13"}]},{n:"\u6CB3\u5357",g:"113.486804,34.157184|7",cities:[{n:"\u90D1\u5DDE",g:"113.649644,34.75661|12"},{n:"\u5B89\u9633",g:"114.351807,36.110267|12"},{n:"\u9E64\u58C1",g:"114.29777,35.755426|13"},{n:"\u7126\u4F5C",g:"113.211836,35.234608|13"},{n:"\u5F00\u5C01",g:"114.351642,34.801854|13"},{n:"\u6D1B\u9633",g:"112.447525,34.657368|12"},{n:"\u6F2F\u6CB3",g:"114.046061,33.576279|13"},{n:"\u5357\u9633",g:"112.542842,33.01142|13"},{n:"\u5E73\u9876\u5C71",g:"113.300849,33.745301|13"},{n:"\u6FEE\u9633",g:"115.026627,35.753298|12"},{n:"\u4E09\u95E8\u5CE1",g:"111.181262,34.78332|13"},{n:"\u5546\u4E18",g:"115.641886,34.438589|13"},{n:"\u65B0\u4E61",g:"113.91269,35.307258|13"},{n:"\u4FE1\u9633",g:"114.085491,32.128582|13"},{n:"\u8BB8\u660C",g:"113.835312,34.02674|13"},{n:"\u5468\u53E3",g:"114.654102,33.623741|13"},{n:"\u9A7B\u9A6C\u5E97",g:"114.049154,32.983158|13"}]},{n:"\u9ED1\u9F99\u6C5F",g:"128.047414,47.356592|6",cities:[{n:"\u54C8\u5C14\u6EE8",g:"126.657717,45.773225|12"},{n:"\u5927\u5E86",g:"125.02184,46.596709|12"},{n:"\u5927\u5174\u5B89\u5CAD\u5730\u533A",g:"124.196104,51.991789|10"},{n:"\u9E64\u5C97",g:"130.292472,47.338666|13"},{n:"\u9ED1\u6CB3",g:"127.50083,50.25069|14"},{n:"\u9E21\u897F",g:"130.941767,45.32154|13"},{n:"\u4F73\u6728\u65AF",g:"130.284735,46.81378|12"},{n:"\u7261\u4E39\u6C5F",g:"129.608035,44.588521|13"},{n:"\u4E03\u53F0\u6CB3",g:"131.019048,45.775005|14"},{n:"\u9F50\u9F50\u54C8\u5C14",g:"123.987289,47.3477|13"},{n:"\u53CC\u9E2D\u5C71",g:"131.171402,46.655102|13"},{n:"\u7EE5\u5316",g:"126.989095,46.646064|13"},{n:"\u4F0A\u6625",g:"128.910766,47.734685|14"}]},{n:"\u6E56\u5317",g:"112.410562,31.209316|8",cities:[{n:"\u6B66\u6C49",g:"114.3162,30.581084|12"},{n:"\u9102\u5DDE",g:"114.895594,30.384439|14"},{n:"\u6069\u65BD",g:"109.517433,30.308978|14"},{n:"\u9EC4\u5188",g:"114.906618,30.446109|14"},{n:"\u9EC4\u77F3",g:"115.050683,30.216127|13"},{n:"\u8346\u95E8",g:"112.21733,31.042611|13"},{n:"\u8346\u5DDE",g:"112.241866,30.332591|12"},{n:"\u6F5C\u6C5F",g:"112.768768,30.343116|13"},{n:"\u795E\u519C\u67B6\u6797\u533A",g:"110.487231,31.595768|13"},{n:"\u5341\u5830",g:"110.801229,32.636994|13"},{n:"\u968F\u5DDE",g:"113.379358,31.717858|13"},{n:"\u5929\u95E8",g:"113.12623,30.649047|13"},{n:"\u4ED9\u6843",g:"113.387448,30.293966|13"},{n:"\u54B8\u5B81",g:"114.300061,29.880657|13"},{n:"\u8944\u9633",g:"112.176326,32.094934|12"},{n:"\u5B5D\u611F",g:"113.935734,30.927955|13"},{n:"\u5B9C\u660C",g:"111.310981,30.732758|13"}]},{n:"\u6E56\u5357",g:"111.720664,27.695864|7",cities:[{n:"\u957F\u6C99",g:"112.979353,28.213478|12"},{n:"\u5E38\u5FB7",g:"111.653718,29.012149|12"},{n:"\u90F4\u5DDE",g:"113.037704,25.782264|13"},{n:"\u8861\u9633",g:"112.583819,26.898164|13"},{n:"\u6000\u5316",g:"109.986959,27.557483|13"},{n:"\u5A04\u5E95",g:"111.996396,27.741073|13"},{n:"\u90B5\u9633",g:"111.461525,27.236811|13"},{n:"\u6E58\u6F6D",g:"112.935556,27.835095|13"},{n:"\u6E58\u897F\u5DDE",g:"109.745746,28.317951|14"},{n:"\u76CA\u9633",g:"112.366547,28.588088|13"},{n:"\u6C38\u5DDE",g:"111.614648,26.435972|13"},{n:"\u5CB3\u9633",g:"113.146196,29.378007|13"},{n:"\u5F20\u5BB6\u754C",g:"110.48162,29.124889|13"},{n:"\u682A\u6D32",g:"113.131695,27.827433|13"}]},{n:"\u6C5F\u82CF",g:"119.368489,33.013797|8",cities:[{n:"\u5357\u4EAC",g:"118.778074,32.057236|12"},{n:"\u5E38\u5DDE",g:"119.981861,31.771397|12"},{n:"\u6DEE\u5B89",g:"119.030186,33.606513|12"},{n:"\u8FDE\u4E91\u6E2F",g:"119.173872,34.601549|12"},{n:"\u5357\u901A",g:"120.873801,32.014665|12"},{n:"\u82CF\u5DDE",g:"120.619907,31.317987|12"},{n:"\u5BBF\u8FC1",g:"118.296893,33.95205|13"},{n:"\u6CF0\u5DDE",g:"119.919606,32.476053|13"},{n:"\u65E0\u9521",g:"120.305456,31.570037|12"},{n:"\u5F90\u5DDE",g:"117.188107,34.271553|12"},{n:"\u76D0\u57CE",g:"120.148872,33.379862|12"},{n:"\u626C\u5DDE",g:"119.427778,32.408505|13"},{n:"\u9547\u6C5F",g:"119.455835,32.204409|13"}]},{n:"\u6C5F\u897F",g:"115.676082,27.757258|7",cities:[{n:"\u5357\u660C",g:"115.893528,28.689578|12"},{n:"\u629A\u5DDE",g:"116.360919,27.954545|13"},{n:"\u8D63\u5DDE",g:"114.935909,25.845296|13"},{n:"\u5409\u5B89",g:"114.992039,27.113848|13"},{n:"\u666F\u5FB7\u9547",g:"117.186523,29.303563|12"},{n:"\u4E5D\u6C5F",g:"115.999848,29.71964|13"},{n:"\u840D\u4E61",g:"113.859917,27.639544|13"},{n:"\u4E0A\u9976",g:"117.955464,28.457623|13"},{n:"\u65B0\u4F59",g:"114.947117,27.822322|13"},{n:"\u5B9C\u6625",g:"114.400039,27.81113|13"},{n:"\u9E70\u6F6D",g:"117.03545,28.24131|13"}]},{n:"\u5409\u6797",g:"126.262876,43.678846|7",cities:[{n:"\u957F\u6625",g:"125.313642,43.898338|12"},{n:"\u767D\u57CE",g:"122.840777,45.621086|13"},{n:"\u767D\u5C71",g:"126.435798,41.945859|13"},{n:"\u5409\u6797",g:"126.564544,43.871988|12"},{n:"\u8FBD\u6E90",g:"125.133686,42.923303|13"},{n:"\u56DB\u5E73",g:"124.391382,43.175525|12"},{n:"\u677E\u539F",g:"124.832995,45.136049|13"},{n:"\u901A\u5316",g:"125.94265,41.736397|13"},{n:"\u5EF6\u8FB9",g:"129.485902,42.896414|13"}]},{n:"\u8FBD\u5B81",g:"122.753592,41.6216|8",cities:[{n:"\u6C88\u9633",g:"123.432791,41.808645|12"},{n:"\u978D\u5C71",g:"123.007763,41.118744|13"},{n:"\u672C\u6EAA",g:"123.778062,41.325838|12"},{n:"\u671D\u9633",g:"120.446163,41.571828|13"},{n:"\u5927\u8FDE",g:"121.593478,38.94871|12"},{n:"\u4E39\u4E1C",g:"124.338543,40.129023|12"},{n:"\u629A\u987A",g:"123.92982,41.877304|12"},{n:"\u961C\u65B0",g:"121.660822,42.01925|14"},{n:"\u846B\u82A6\u5C9B",g:"120.860758,40.74303|13"},{n:"\u9526\u5DDE",g:"121.147749,41.130879|13"},{n:"\u8FBD\u9633",g:"123.172451,41.273339|14"},{n:"\u76D8\u9526",g:"122.073228,41.141248|13"},{n:"\u94C1\u5CAD",g:"123.85485,42.299757|13"},{n:"\u8425\u53E3",g:"122.233391,40.668651|13"}]},{n:"\u5185\u8499\u53E4",g:"114.415868,43.468238|5",cities:[{n:"\u547C\u548C\u6D69\u7279",g:"111.660351,40.828319|12"},{n:"\u963F\u62C9\u5584\u76DF",g:"105.695683,38.843075|14"},{n:"\u5305\u5934",g:"109.846239,40.647119|12"},{n:"\u5DF4\u5F66\u6DD6\u5C14",g:"107.423807,40.76918|12"},{n:"\u8D64\u5CF0",g:"118.930761,42.297112|12"},{n:"\u9102\u5C14\u591A\u65AF",g:"109.993706,39.81649|12"},{n:"\u547C\u4F26\u8D1D\u5C14",g:"119.760822,49.201636|12"},{n:"\u901A\u8FBD",g:"122.260363,43.633756|12"},{n:"\u4E4C\u6D77",g:"106.831999,39.683177|13"},{n:"\u4E4C\u5170\u5BDF\u5E03",g:"113.112846,41.022363|12"},{n:"\u9521\u6797\u90ED\u52D2\u76DF",g:"116.02734,43.939705|11"},{n:"\u5174\u5B89\u76DF",g:"122.048167,46.083757|11"}]},{n:"\u5B81\u590F",g:"106.155481,37.321323|8",cities:[{n:"\u94F6\u5DDD",g:"106.206479,38.502621|12"},{n:"\u56FA\u539F",g:"106.285268,36.021523|13"},{n:"\u77F3\u5634\u5C71",g:"106.379337,39.020223|13"},{n:"\u5434\u5FE0",g:"106.208254,37.993561|14"},{n:"\u4E2D\u536B",g:"105.196754,37.521124|14"}]},{n:"\u9752\u6D77",g:"96.202544,35.499761|7",cities:[{n:"\u897F\u5B81",g:"101.767921,36.640739|12"},{n:"\u679C\u6D1B\u5DDE",g:"100.223723,34.480485|11"},{n:"\u6D77\u4E1C\u5730\u533A",g:"102.085207,36.51761|11"},{n:"\u6D77\u5317\u5DDE",g:"100.879802,36.960654|11"},{n:"\u6D77\u5357\u5DDE",g:"100.624066,36.284364|11"},{n:"\u6D77\u897F\u5DDE",g:"97.342625,37.373799|11"},{n:"\u9EC4\u5357\u5DDE",g:"102.0076,35.522852|11"},{n:"\u7389\u6811\u5DDE",g:"97.013316,33.00624|14"}]},{n:"\u5C71\u4E1C",g:"118.527663,36.09929|8",cities:[{n:"\u6D4E\u5357",g:"117.024967,36.682785|12"},{n:"\u6EE8\u5DDE",g:"117.968292,37.405314|12"},{n:"\u4E1C\u8425",g:"118.583926,37.487121|12"},{n:"\u5FB7\u5DDE",g:"116.328161,37.460826|12"},{n:"\u83CF\u6CFD",g:"115.46336,35.26244|13"},{n:"\u6D4E\u5B81",g:"116.600798,35.402122|13"},{n:"\u83B1\u829C",g:"117.684667,36.233654|13"},{n:"\u804A\u57CE",g:"115.986869,36.455829|12"},{n:"\u4E34\u6C82",g:"118.340768,35.072409|12"},{n:"\u9752\u5C9B",g:"120.384428,36.105215|12"},{n:"\u65E5\u7167",g:"119.50718,35.420225|12"},{n:"\u6CF0\u5B89",g:"117.089415,36.188078|13"},{n:"\u5A01\u6D77",g:"122.093958,37.528787|13"},{n:"\u6F4D\u574A",g:"119.142634,36.716115|12"},{n:"\u70DF\u53F0",g:"121.309555,37.536562|12"},{n:"\u67A3\u5E84",g:"117.279305,34.807883|13"},{n:"\u6DC4\u535A",g:"118.059134,36.804685|12"}]},{n:"\u5C71\u897F",g:"112.515496,37.866566|7",cities:[{n:"\u592A\u539F",g:"112.550864,37.890277|12"},{n:"\u957F\u6CBB",g:"113.120292,36.201664|12"},{n:"\u5927\u540C",g:"113.290509,40.113744|12"},{n:"\u664B\u57CE",g:"112.867333,35.499834|13"},{n:"\u664B\u4E2D",g:"112.738514,37.693362|13"},{n:"\u4E34\u6C7E",g:"111.538788,36.099745|13"},{n:"\u5415\u6881",g:"111.143157,37.527316|14"},{n:"\u6714\u5DDE",g:"112.479928,39.337672|13"},{n:"\u5FFB\u5DDE",g:"112.727939,38.461031|12"},{n:"\u9633\u6CC9",g:"113.569238,37.869529|13"},{n:"\u8FD0\u57CE",g:"111.006854,35.038859|13"}]},{n:"\u9655\u897F",g:"109.503789,35.860026|7",cities:[{n:"\u897F\u5B89",g:"108.953098,34.2778|12"},{n:"\u5B89\u5EB7",g:"109.038045,32.70437|13"},{n:"\u5B9D\u9E21",g:"107.170645,34.364081|12"},{n:"\u6C49\u4E2D",g:"107.045478,33.081569|13"},{n:"\u5546\u6D1B",g:"109.934208,33.873907|13"},{n:"\u94DC\u5DDD",g:"108.968067,34.908368|13"},{n:"\u6E2D\u5357",g:"109.483933,34.502358|13"},{n:"\u54B8\u9633",g:"108.707509,34.345373|13"},{n:"\u5EF6\u5B89",g:"109.50051,36.60332|13"},{n:"\u6986\u6797",g:"109.745926,38.279439|12"}]},{n:"\u56DB\u5DDD",g:"102.89916,30.367481|7",cities:[{n:"\u6210\u90FD",g:"104.067923,30.679943|12"},{n:"\u963F\u575D\u5DDE",g:"102.228565,31.905763|15"},{n:"\u5DF4\u4E2D",g:"106.757916,31.869189|14"},{n:"\u8FBE\u5DDE",g:"107.494973,31.214199|14"},{n:"\u5FB7\u9633",g:"104.402398,31.13114|13"},{n:"\u7518\u5B5C\u5DDE",g:"101.969232,30.055144|15"},{n:"\u5E7F\u5B89",g:"106.63572,30.463984|13"},{n:"\u5E7F\u5143",g:"105.819687,32.44104|13"},{n:"\u4E50\u5C71",g:"103.760824,29.600958|13"},{n:"\u51C9\u5C71\u5DDE",g:"102.259591,27.892393|14"},{n:"\u6CF8\u5DDE",g:"105.44397,28.89593|14"},{n:"\u5357\u5145",g:"106.105554,30.800965|13"},{n:"\u7709\u5C71",g:"103.84143,30.061115|13"},{n:"\u7EF5\u9633",g:"104.705519,31.504701|12"},{n:"\u5185\u6C5F",g:"105.073056,29.599462|13"},{n:"\u6500\u679D\u82B1",g:"101.722423,26.587571|14"},{n:"\u9042\u5B81",g:"105.564888,30.557491|12"},{n:"\u96C5\u5B89",g:"103.009356,29.999716|13"},{n:"\u5B9C\u5BBE",g:"104.633019,28.769675|13"},{n:"\u8D44\u9633",g:"104.63593,30.132191|13"},{n:"\u81EA\u8D21",g:"104.776071,29.359157|13"}]},{n:"\u897F\u85CF",g:"89.137982,31.367315|6",cities:[{n:"\u62C9\u8428",g:"91.111891,29.662557|13"},{n:"\u963F\u91CC\u5730\u533A",g:"81.107669,30.404557|11"},{n:"\u660C\u90FD\u5730\u533A",g:"97.185582,31.140576|15"},{n:"\u6797\u829D\u5730\u533A",g:"94.349985,29.666941|11"},{n:"\u90A3\u66F2\u5730\u533A",g:"92.067018,31.48068|14"},{n:"\u65E5\u5580\u5219\u5730\u533A",g:"88.891486,29.269023|14"},{n:"\u5C71\u5357\u5730\u533A",g:"91.750644,29.229027|11"}]},{n:"\u65B0\u7586",g:"85.614899,42.127001|6",cities:[{n:"\u4E4C\u9C81\u6728\u9F50",g:"87.564988,43.84038|12"},{n:"\u963F\u62C9\u5C14",g:"81.291737,40.61568|13"},{n:"\u963F\u514B\u82CF\u5730\u533A",g:"80.269846,41.171731|12"},{n:"\u963F\u52D2\u6CF0\u5730\u533A",g:"88.137915,47.839744|13"},{n:"\u5DF4\u97F3\u90ED\u695E",g:"86.121688,41.771362|12"},{n:"\u535A\u5C14\u5854\u62C9\u5DDE",g:"82.052436,44.913651|11"},{n:"\u660C\u5409\u5DDE",g:"87.296038,44.007058|13"},{n:"\u54C8\u5BC6\u5730\u533A",g:"93.528355,42.858596|13"},{n:"\u548C\u7530\u5730\u533A",g:"79.930239,37.116774|13"},{n:"\u5580\u4EC0\u5730\u533A",g:"75.992973,39.470627|12"},{n:"\u514B\u62C9\u739B\u4F9D",g:"84.88118,45.594331|13"},{n:"\u514B\u5B5C\u52D2\u82CF\u5DDE",g:"76.137564,39.750346|11"},{n:"\u77F3\u6CB3\u5B50",g:"86.041865,44.308259|13"},{n:"\u5854\u57CE\u5730\u533A",g:"82.974881,46.758684|12"},{n:"\u56FE\u6728\u8212\u514B",g:"79.198155,39.889223|13"},{n:"\u5410\u9C81\u756A\u5730\u533A",g:"89.181595,42.96047|13"},{n:"\u4E94\u5BB6\u6E20",g:"87.565449,44.368899|13"},{n:"\u4F0A\u7281\u5DDE",g:"81.297854,43.922248|11"}]},{n:"\u4E91\u5357",g:"101.592952,24.864213|7",cities:[{n:"\u6606\u660E",g:"102.714601,25.049153|12"},{n:"\u4FDD\u5C71",g:"99.177996,25.120489|13"},{n:"\u695A\u96C4\u5DDE",g:"101.529382,25.066356|13"},{n:"\u5927\u7406\u5DDE",g:"100.223675,25.5969|14"},{n:"\u5FB7\u5B8F\u5DDE",g:"98.589434,24.44124|14"},{n:"\u8FEA\u5E86\u5DDE",g:"99.713682,27.831029|14"},{n:"\u7EA2\u6CB3\u5DDE",g:"103.384065,23.367718|11"},{n:"\u4E3D\u6C5F",g:"100.229628,26.875351|13"},{n:"\u4E34\u6CA7",g:"100.092613,23.887806|14"},{n:"\u6012\u6C5F\u5DDE",g:"98.859932,25.860677|14"},{n:"\u666E\u6D31",g:"100.980058,22.788778|14"},{n:"\u66F2\u9756",g:"103.782539,25.520758|12"},{n:"\u662D\u901A",g:"103.725021,27.340633|13"},{n:"\u6587\u5C71",g:"104.089112,23.401781|14"},{n:"\u897F\u53CC\u7248\u7EB3",g:"100.803038,22.009433|13"},{n:"\u7389\u6EAA",g:"102.545068,24.370447|13"}]},{n:"\u6D59\u6C5F",g:"119.957202,29.159494|8",cities:[{n:"\u676D\u5DDE",g:"120.219375,30.259244|12"},{n:"\u6E56\u5DDE",g:"120.137243,30.877925|12"},{n:"\u5609\u5174",g:"120.760428,30.773992|13"},{n:"\u91D1\u534E",g:"119.652576,29.102899|12"},{n:"\u4E3D\u6C34",g:"119.929576,28.4563|13"},{n:"\u5B81\u6CE2",g:"121.579006,29.885259|12"},{n:"\u8862\u5DDE",g:"118.875842,28.95691|12"},{n:"\u7ECD\u5174",g:"120.592467,30.002365|13"},{n:"\u53F0\u5DDE",g:"121.440613,28.668283|13"},{n:"\u6E29\u5DDE",g:"120.690635,28.002838|12"},{n:"\u821F\u5C71",g:"122.169872,30.03601|13"}]}],other:[{n:"\u9999\u6E2F",g:"114.186124,22.293586|11"},{n:"\u6FB3\u95E8",g:"113.557519,22.204118|13"},{n:"\u53F0\u6E7E",g:"120.961454,23.80406|8"}]};function l(B){var O=B.split("|");return O[0]=O[0].split(","),{lng:parseFloat(O[0][0]),lat:parseFloat(O[0][1])}}var u={getProvinceNameByCityName:function(O){for(var F=s.provinces,N=0;N<F.length;N++)for(var U=F[N].n,X=F[N].cities,Z=0;Z<X.length;Z++)if(X[Z].n==O)return U;return null},getCenterByCityName:function(O){O=O.replace("\u5E02","");for(var F=0;F<s.municipalities.length;F++)if(s.municipalities[F].n==O)return l(s.municipalities[F].g);for(var F=0;F<s.other.length;F++)if(s.other[F].n==O)return l(s.other[F].g);for(var N=s.provinces,F=0;F<N.length;F++){if(N[F].n==O)return l(N[F].g);for(var U=N[F].cities,X=0;X<U.length;X++)if(U[X].n==O)return l(U[X].g)}return null}},h=function(B,O){if(!(B instanceof O))throw new TypeError("Cannot call a class as a function")},c=function(){function B(O,F){for(var N=0;N<F.length;N++){var U=F[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(O,U.key,U)}}return function(O,F,N){return F&&B(O.prototype,F),N&&B(O,N),O}}(),f=function B(O,F,N){O===null&&(O=Function.prototype);var U=Object.getOwnPropertyDescriptor(O,F);if(U===void 0){var X=Object.getPrototypeOf(O);return X===null?void 0:B(X,F,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},d=function(B,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);B.prototype=Object.create(O&&O.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(B,O):B.__proto__=O)},v=function(B,O){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:B},p=function(){function B(O,F){var N=[],U=!0,X=!1,Z=void 0;try{for(var Ae=O[Symbol.iterator](),Re;!(U=(Re=Ae.next()).done)&&(N.push(Re.value),!(F&&N.length===F));U=!0);}catch(Be){X=!0,Z=Be}finally{try{!U&&Ae.return&&Ae.return()}finally{if(X)throw Z}}return N}return function(O,F){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return B(O,F);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function g(B,O){o.bind(this)(),this._options=O||{},this._data=[],B&&this.add(B)}g.prototype=Object.create(o.prototype),g.prototype.add=function(B,O){if(Array.isArray(B)){for(var F=0,N=B.length;F<N;F++)if(B[F]){if(B[F].time&&B[F].time.length==14&&B[F].time.substr(0,2)=="20"){var U=B[F].time;B[F].time=new Date(U.substr(0,4)+"-"+U.substr(4,2)+"-"+U.substr(6,2)+" "+U.substr(8,2)+":"+U.substr(10,2)+":"+U.substr(12,2)).getTime()}this._data.push(B[F])}}else if(B instanceof Object)this._data.push(B);else throw new Error("Unknown dataType");this._dataCache=JSON.parse(JSON.stringify(this._data))},g.prototype.reset=function(){this._data=JSON.parse(JSON.stringify(this._dataCache))},g.prototype.get=function(B){B=B||{};var O=this._data;if(B.filter){for(var F=[],N=0;N<O.length;N++)B.filter(O[N])&&F.push(O[N]);O=F}return B.transferCoordinate&&(O=this.transferCoordinate(O,B.transferCoordinate,B.fromColumn,B.toColumn)),O},g.prototype.set=function(B){this._set(B),this._trigger("change")},g.prototype._set=function(B){this.clear(),this.add(B)},g.prototype.clear=function(B){this._data=[]},g.prototype.remove=function(B){},g.prototype.update=function(B,O){for(var F=this._data,N=0;N<F.length;N++)if(O){var U=!0;for(var X in O)F[N][X]!=O[X]&&(U=!1);U&&B&&B(F[N])}else B&&B(F[N]);this._dataCache=JSON.parse(JSON.stringify(this._data)),this._trigger("change")},g.prototype.transferCoordinate=function(B,O,F,N){N=N||"_coordinates",F=F||"coordinates";for(var U=0;U<B.length;U++){var X=B[U].geometry,Z=X[F];switch(X.type){case"Point":X[N]=O(Z);break;case"LineString":for(var Re=[],Ae=0;Ae<Z.length;Ae++)Re.push(O(Z[Ae]));X[N]=Re;break;case"MultiLineString":case"Polygon":var Re=Xe(Z);X[N]=Re;break;case"MultiPolygon":for(var Re=[],Be=0;Be<Z.length;Be++){var Je=Z[Be],Je=Xe(Je);Re.push(Je)}X[N]=Re;break}}function Xe(_t){for(var rt=[],Ht=0;Ht<_t.length;Ht++){for(var Yt=_t[Ht],ne=[],ye=0;ye<Yt.length;ye++)ne.push(O(Yt[ye]));rt.push(ne)}return rt}return B},g.prototype.initGeometry=function(B){B?this._data.forEach(function(O){O.geometry=B(O)}):this._data.forEach(function(O){if(!O.geometry){if(O.lng&&O.lat)O.geometry={type:"Point",coordinates:[O.lng,O.lat]};else if(O.city){var F=u.getCenterByCityName(O.city);F&&(O.geometry={type:"Point",coordinates:[F.lng,F.lat]})}}})},g.prototype.getMax=function(B){var O=this._data;if(!(!O||O.length<=0)){for(var F=parseFloat(O[0][B]),N=1;N<O.length;N++){var U=parseFloat(O[N][B]);U>F&&(F=U)}return F}},g.prototype.getSum=function(B){var O=this._data;if(!(!O||O.length<=0)){for(var F=0,N=0;N<O.length;N++)O[N][B]&&(F+=parseFloat(O[N][B]));return F}},g.prototype.getMin=function(B){var O=this._data;if(!(!O||O.length<=0)){for(var F=parseFloat(O[0][B]),N=1;N<O.length;N++){var U=parseFloat(O[N][B]);U<F&&(F=U)}return F}},g.prototype.getUnique=function(B){var N=this._data;if(!(!N||N.length<=0)){for(var O={},F=1;F<N.length;F++)O[N[F][B]]=!0;var N=[];for(var U in O)N.push(U);return N}};function m(B,O,F){var N=60*F+30,U=Math.PI/180*N;return[B.x+O*Math.cos(U),B.y+O*Math.sin(U)]}function y(B,O,F,N){for(var U=0;U<6;U++){var X=m({x:O,y:F},N,U);B.lineTo(X[0],X[1])}}var _={drawDataSet:function(O,F,N){for(var U=F instanceof g?F.get():F,X=0,Z=U.length;X<Z;X++){var Ae=U[X];this.draw(O,Ae,N)}},draw:function(O,F,N){var U=F.geometry.type,X=F.geometry._coordinates||F.geometry.coordinates,Z=F.symbol||N.symbol||"circle";switch(U){case"Point":var Ae=F._size||F.size||N._size||N.size||5;Z==="circle"?(N.bigData==="Point"&&O.moveTo(X[0],X[1]),O.arc(X[0],X[1],Ae,0,Math.PI*2)):Z==="rect"?O.rect(X[0]-Ae/2,X[1]-Ae/2,Ae,Ae):Z==="honeycomb"&&y(O,X[0],X[1],Ae);break;case"LineString":this.drawLineString(O,X);break;case"MultiLineString":for(var Re=0;Re<X.length;Re++){var Be=X[Re];this.drawLineString(O,Be)}break;case"Polygon":this.drawPolygon(O,X);break;case"MultiPolygon":for(var Re=0;Re<X.length;Re++){var Je=X[Re];if(this.drawPolygon(O,Je),N.multiPolygonDraw){var Xe=N.multiPolygonDraw();if(Xe)return Xe}}break;default:console.error("type"+U+"is not support now!");break}},drawLineString:function(O,F){for(var N=0;N<F.length;N++){var U=F[N][0],X=F[N][1];N==0?O.moveTo(U,X):O.lineTo(U,X)}},drawPolygon:function(O,F){O.beginPath();for(var N=0;N<F.length;N++){var U=F[N];O.moveTo(U[0][0],U[0][1]);for(var X=1;X<U.length;X++)O.lineTo(U[X][0],U[X][1]);O.lineTo(U[0][0],U[0][1]),O.closePath()}}},x={draw:function(O,F,N){var U=F instanceof g?F.get():F;O.save();for(var X in N)O[X]=N[X];if(N.bigData){O.save(),O.beginPath();for(var Z=0,Ae=U.length;Z<Ae;Z++){var Re=U[Z];_.draw(O,Re,N)}var Be=N.bigData;Be=="Point"||Be=="Polygon"||Be=="MultiPolygon"?(O.fill(),O.lineDash&&O.setLineDash(O.lineDash),Re.lineDash&&O.setLineDash(Re.lineDash),(Re.strokeStyle||N.strokeStyle)&&N.lineWidth&&O.stroke()):(Be=="LineString"||Be=="MultiLineString")&&O.stroke(),O.restore()}else for(var Z=0,Ae=U.length;Z<Ae;Z++){var Re=U[Z];O.save(),(Re.fillStyle||Re._fillStyle)&&(O.fillStyle=Re.fillStyle||Re._fillStyle),(Re.strokeStyle||Re._strokeStyle)&&(O.strokeStyle=Re.strokeStyle||Re._strokeStyle),O.lineDash&&O.setLineDash(O.lineDash),Re.lineDash&&O.setLineDash(Re.lineDash);var Be=Re.geometry.type;O.beginPath(),N.multiPolygonDraw=function(){O.fill(),(Re.strokeStyle||N.strokeStyle)&&N.lineWidth&&O.stroke()},_.draw(O,Re,N),Be=="Point"||Be=="Polygon"||Be=="MultiPolygon"?(O.fill(),(Re.strokeStyle||N.strokeStyle)&&N.lineWidth&&O.stroke()):(Be=="LineString"||Be=="MultiLineString")&&((Re.lineWidth||Re._lineWidth)&&(O.lineWidth=Re.lineWidth||Re._lineWidth),O.stroke()),O.restore()}O.restore()}};function S(B,O){var F;if(!(typeof document>"u")){var F=document.createElement("canvas");B&&(F.width=B),O&&(F.height=O)}return F}function w(B){B=B||{},this.gradient=B.gradient||{.25:"rgba(0, 0, 255, 1)",.55:"rgba(0, 255, 0, 1)",.85:"rgba(255, 255, 0, 1)",1:"rgba(255, 0, 0, 1)"},this.maxSize=B.maxSize||35,this.minSize=B.minSize||0,this.max=B.max||100,this.min=B.min||0,this.initPalette()}w.prototype.setMax=function(B){this.max=B||100},w.prototype.setMin=function(B){this.min=B||0},w.prototype.setMaxSize=function(B){this.maxSize=B||35},w.prototype.setMinSize=function(B){this.minSize=B||0},w.prototype.initPalette=function(){var B=this.gradient,O=new S(256,1),F=this.paletteCtx=O.getContext("2d"),N=F.createLinearGradient(0,0,256,1);for(var U in B)N.addColorStop(parseFloat(U),B[U]);F.fillStyle=N,F.fillRect(0,0,256,1)},w.prototype.getColor=function(B){var O=this.getImageData(B);return"rgba("+O[0]+", "+O[1]+", "+O[2]+", "+O[3]/256+")"},w.prototype.getImageData=function(B){var O=this.paletteCtx.getImageData(0,0,256,1).data;if(B===void 0)return O;var F=this.max,N=this.min;B>F&&(B=F),B<N&&(B=N);var U=Math.floor((B-N)/(F-N)*(256-1))*4;return[O[U],O[U+1],O[U+2],O[U+3]]},w.prototype.getSize=function(B){var O=0,F=this.max,N=this.min,U=this.maxSize,X=this.minSize;if(B>F&&(B=F),B<N&&(B=N),F>N)O=X+(B-N)/(F-N)*(U-X);else return U;return O},w.prototype.getLegend=function(B){var O=this.gradient,F=B.width||20,N=B.height||180,U=new S(F,N),X=U.getContext("2d"),Z=X.createLinearGradient(0,N,0,0);for(var Ae in O)Z.addColorStop(parseFloat(Ae),O[Ae]);return X.fillStyle=Z,X.fillRect(0,0,F,N),U};var b=typeof window>"u"?{}:window,E=b.devicePixelRatio||1;function T(B){var O=B/2,F=B+O,N=1e4,U=new S(F*2,F*2),X=U.getContext("2d");return X.shadowBlur=O,X.shadowColor="black",X.shadowOffsetX=X.shadowOffsetY=N,X.beginPath(),X.arc(F-N,F-N,B,0,Math.PI*2,!0),X.closePath(),X.fill(),U}function C(B,O,F){var N=A(F),U=M(F),X=N-U,Je=F.range||null,Z=0,Ae=1024;Je&&Je.length===2&&(Z=(Je[0]-U)/X*1024),Je&&Je.length===2&&(Ae=(Je[1]-U)/X*1024);for(var Re=F.maxOpacity||.8,Be=F.minOpacity||0,Je=F.range,Xe=3,_t=B.length,rt;Xe<_t;Xe+=4)rt=B[Xe]*4,B[Xe]/256>Re&&(B[Xe]=256*Re),B[Xe]/256<Be&&(B[Xe]=256*Be),rt&&rt>=Z&&rt<=Ae?(B[Xe-3]=O[rt],B[Xe-2]=O[rt+1],B[Xe-1]=O[rt+2]):B[Xe]=0}function A(B){var O=B.max||100;return O}function M(B){var O=B.min||0;return O}function I(B,O,F){var N=A(F),U=M(F),X=F._size;X==null&&(X=F.size,X==null&&(X=13));var Z=new w({gradient:F.gradient,max:N,min:U}),Ae=T(X),Re=Ae.width/2,Be=Ae.height/2,Je=O,Xe={};Je.forEach(function(Ht,Yt){var ne=Ht.count===void 0?1:Ht.count,ye=Math.min(1,ne/N).toFixed(2);Xe[ye]=Xe[ye]||[],Xe[ye].push(Ht)});for(var _t in Xe)if(!isNaN(_t)){var rt=Xe[_t];B.beginPath(),F.withoutAlpha||(B.globalAlpha=_t),B.strokeStyle=Z.getColor(_t*N),rt.forEach(function(Ht,Yt){if(!!Ht.geometry){var ne=Ht.geometry._coordinates||Ht.geometry.coordinates,ye=Ht.geometry.type;if(ye==="Point"){var Ue=Ht.count===void 0?1:Ht.count;B.globalAlpha=Ue/N,B.drawImage(Ae,ne[0]-Re,ne[1]-Be)}else if(ye==="LineString"){var Ue=Ht.count===void 0?1:Ht.count;B.globalAlpha=Ue/N,B.beginPath(),_.draw(B,Ht,F),B.stroke()}}})}}function R(B,O,F){if(!(B.canvas.width<=0||B.canvas.height<=0)){var N=F.strength||.3;B.strokeStyle="rgba(0,0,0,"+N+")";var U=new S(B.canvas.width,B.canvas.height),X=U.getContext("2d");X.scale(E,E),F=F||{};var Z=O instanceof g?O.get():O;B.save();var Ae=new w({gradient:F.gradient});if(I(X,Z,F),!F.absolute){var Re=X.getImageData(0,0,B.canvas.width,B.canvas.height);C(Re.data,Ae.getImageData(),F),B.putImageData(Re,0,0),B.restore()}Ae=null,U=null}}var k={draw:R},D={draw:function(O,F,N){O.save();var U=F instanceof g?F.get():F,X={},Z=N._size||N.size||50,Ae="enableCluster"in N?N.enableCluster:!0,Re=N.offset||{x:0,y:0},Be=new w({min:N.min||0,max:N.max||100,gradient:N.gradient});if(Ae){for(var Ht=0;Ht<U.length;Ht++){var Xe=U[Ht].geometry._coordinates||U[Ht].geometry.coordinates,_t=Math.floor((Xe[0]-Re.x)/Z)+","+Math.floor((Xe[1]-Re.y)/Z);X[_t]||(X[_t]=0),X[_t]+=~~(U[Ht].count||1)}for(var Yt in X)Yt=Yt.split(","),O.beginPath(),O.rect(Yt[0]*Z+.5+Re.x,Yt[1]*Z+.5+Re.y,Z,Z),O.fillStyle=Be.getColor(X[Yt]),O.fill(),N.strokeStyle&&N.lineWidth&&O.stroke()}else{for(var Je=0;Je<U.length;Je++){var Xe=U[Je].geometry._coordinates||U[Je].geometry.coordinates,_t=Xe.join(",");X[_t]=U[Je].count||1}for(var rt in X)rt=rt.split(","),O.beginPath(),O.rect(+rt[0]-Z/2,+rt[1]-Z/2,Z,Z),O.fillStyle=Be.getColor(X[rt]),O.fill(),N.strokeStyle&&N.lineWidth&&O.stroke()}if(N.label&&N.label.show!==!1){O.fillStyle=N.label.fillStyle||"white",N.label.font&&(O.font=N.label.font),N.label.shadowColor&&(O.shadowColor=N.label.shadowColor),N.label.shadowBlur&&(O.shadowBlur=N.label.shadowBlur);for(var _t in X){_t=_t.split(",");var ne=X[_t],ye=O.measureText(ne).width;Ae?O.fillText(ne,_t[0]*Z+.5+Re.x+Z/2-ye/2,_t[1]*Z+.5+Re.y+Z/2+5):O.fillText(ne,+_t[0]-ye/2,+_t[1]+5)}}O.restore()}};function G(B,O,F){var N=60*F+30,U=Math.PI/180*N;return[B.x+O*Math.cos(U),B.y+O*Math.sin(U)]}var W={draw:function(O,F,N){O.save();var U=F instanceof g?F.get():F;for(var X in N)O[X]=N[X];var Z=N.offset||{x:10,y:10},Ae=N._size||N.size||40;Ae=Ae/2/Math.sin(Math.PI/3);for(var Re=Ae*2*Math.sin(Math.PI/3),Be=Ae*1.5,Je={},Xe=0;Xe<U.length;Xe++){var _t=U[Xe].geometry._coordinates||U[Xe].geometry.coordinates,rt=(_t[1]-Z.y)/Be,Ht=Math.round(rt),Yt=(_t[0]-Z.x)/Re-(Ht&1?.5:0),ne=Math.round(Yt),ye=rt-Ht;if(Math.abs(ye)*3>1){var Ue=Yt-ne,Bt=ne+(Yt<ne?-1:1)/2,$t=Ht+(rt<Ht?-1:1),ee=Yt-Bt,Se=rt-$t;Ue*Ue+ye*ye>ee*ee+Se*Se&&(ne=Bt+(Ht&1?1:-1)/2,Ht=$t)}var Ze=ne+"-"+Ht,Ct=Je[Ze];Ct?Ct.push(U[Xe]):(Ct=Je[Ze]=[U[Xe]],Ct.i=ne,Ct.j=Ht,Ct.x=(ne+(Ht&1?1/2:0))*Re,Ct.y=Ht*Be)}var vr=new w({max:N.max||100,maxSize:Ae,gradient:N.gradient});for(var X in Je){var Cr=Je[X];O.beginPath();for(var Jr=0;Jr<6;Jr++){var nn=G({x:Cr.x+Z.x,y:Cr.y+Z.y},Ae,Jr);O.lineTo(nn[0],nn[1])}O.closePath();for(var Dn=0,Xe=0;Xe<Cr.length;Xe++)Dn+=Cr[Xe].count||1;Cr.count=Dn,O.fillStyle=vr.getColor(Dn),O.fill(),N.strokeStyle&&N.lineWidth&&O.stroke()}if(N.label&&N.label.show!==!1){O.fillStyle=N.label.fillStyle||"white",N.label.font&&(O.font=N.label.font),N.label.shadowColor&&(O.shadowColor=N.label.shadowColor),N.label.shadowBlur&&(O.shadowBlur=N.label.shadowBlur);for(var X in Je){var Cr=Je[X],si=Cr.count;si<0?si=si.toFixed(2):si=~~si;var An=O.measureText(si).width;O.fillText(si,Cr.x+Z.x-An/2,Cr.y+Z.y+5)}}O.restore()}};function z(B,O,F){var N=B.createShader(F);return B.shaderSource(N,O),B.compileShader(N),N}function V(B,O,F){var N=z(B,O,B.VERTEX_SHADER),U=z(B,F,B.FRAGMENT_SHADER),X=B.createProgram();return B.attachShader(X,N),B.attachShader(X,U),B.linkProgram(X),B.useProgram(X),X}function q(B){var O=document.createElement("canvas"),F=O.getContext("2d");return O.width=1,O.height=1,F.fillStyle=B,F.fillRect(0,0,1,1),F.getImageData(0,0,1,1).data}var Y=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),le=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");function j(B,O,F){if(!!O){var N=V(B,Y,le);B.enable(B.BLEND),B.blendFunc(B.SRC_ALPHA,B.ONE),B.clear(B.COLOR_BUFFER_BIT);var U=B.canvas.width/2,X=B.canvas.height/2,Z=B.createBuffer();B.bindBuffer(B.ARRAY_BUFFER,Z);var Ae=B.getAttribLocation(N,"a_Position");B.vertexAttribPointer(Ae,2,B.FLOAT,!1,0,0),B.enableVertexAttribArray(Ae);var Re=B.getUniformLocation(N,"u_FragColor"),Be=q(F.strokeStyle||"red");B.uniform4f(Re,Be[0]/255,Be[1]/255,Be[2]/255,Be[3]/255),B.lineWidth(F.lineWidth||1);for(var Je=0,Xe=O.length;Je<Xe;Je++){for(var _t=O[Je].geometry._coordinates,rt=[],Ht=0;Ht<_t.length;Ht++){var Yt=_t[Ht],ne=(Yt[0]-U)/U,ye=(X-Yt[1])/X;rt.push(ne,ye)}var Ue=new Float32Array(rt);B.bufferData(B.ARRAY_BUFFER,Ue,B.STATIC_DRAW),B.drawArrays(B.LINE_STRIP,0,_t.length)}}}var Q={draw:j},ie=["attribute vec4 a_Position;","attribute float a_PointSize;","void main() {","gl_Position = a_Position;","gl_PointSize = a_PointSize;","}"].join(""),oe=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");function se(B,O,F){if(!!O){var N=V(B,ie,oe),U=B.getAttribLocation(N,"a_Position"),X=B.getAttribLocation(N,"a_PointSize"),Z=B.getUniformLocation(N,"u_FragColor");B.clear(B.COLOR_BUFFER_BIT);for(var Ae=B.canvas.width/2,Re=B.canvas.height/2,Be=[],Je=0,Xe=0;Xe<O.length;Xe++){var _t=O[Xe].geometry._coordinates,rt=(_t[0]-Ae)/Ae,Ht=(Re-_t[1])/Re;rt<-1||rt>1||Ht<-1||Ht>1||(Be.push(rt,Ht),Je++)}var Yt=new Float32Array(Be),ne=Je,ye=B.createBuffer();B.bindBuffer(B.ARRAY_BUFFER,ye),B.bufferData(B.ARRAY_BUFFER,Yt,B.STATIC_DRAW),B.vertexAttribPointer(U,2,B.FLOAT,!1,0,0),B.enableVertexAttribArray(U),B.vertexAttrib1f(X,F._size);var Ue=q(F.fillStyle||"red");B.uniform4f(Z,Ue[0]/255,Ue[1]/255,Ue[2]/255,Ue[3]/255),B.drawArrays(B.POINTS,0,ne)}}var me={draw:se};function Ce(B,O,F){F=F||2;var N=O&&O.length,U=N?O[0]*F:B.length,X=Le(B,0,U,F,!0),Z=[];if(!X)return Z;var Ae,Re,Be,Je,Xe,_t,rt;if(N&&(X=qe(B,O,X,F)),B.length>80*F){Ae=Be=B[0],Re=Je=B[1];for(var Ht=F;Ht<U;Ht+=F)Xe=B[Ht],_t=B[Ht+1],Xe<Ae&&(Ae=Xe),_t<Re&&(Re=_t),Xe>Be&&(Be=Xe),_t>Je&&(Je=_t);rt=Math.max(Be-Ae,Je-Re)}return yt(X,Z,F,Ae,Re,rt),Z}function Le(B,O,F,N,U){var X,Z;if(U===Rn(B,O,F,N)>0)for(X=O;X<F;X+=N)Z=jr(X,B[X],B[X+1],Z);else for(X=F-N;X>=O;X-=N)Z=jr(X,B[X],B[X+1],Z);return Z&&wt(Z,Z.next)&&(pn(Z),Z=Z.next),Z}function re(B,O){if(!B)return B;O||(O=B);var F=B,N;do if(N=!1,!F.steiner&&(wt(F,F.next)||mt(F.prev,F,F.next)===0)){if(pn(F),F=O=F.prev,F===F.next)return null;N=!0}else F=F.next;while(N||F!==O);return O}function yt(B,O,F,N,U,X,Z){if(!!B){!Z&&X&&Oe(B,N,U,X);for(var Ae=B,Re,Be;B.prev!==B.next;){if(Re=B.prev,Be=B.next,X?st(B,N,U,X):je(B)){O.push(Re.i/F),O.push(B.i/F),O.push(Be.i/F),pn(B),B=Be.next,Ae=Be.next;continue}if(B=Be,B===Ae){Z?Z===1?(B=Nt(B,O,F),yt(B,O,F,N,U,X,2)):Z===2&&Zt(B,O,F,N,U,X):yt(re(B),O,F,N,U,X,1);break}}}}function je(B){var O=B.prev,F=B,N=B.next;if(mt(O,F,N)>=0)return!1;for(var U=B.next.next;U!==B.prev;){if(Qe(O.x,O.y,F.x,F.y,N.x,N.y,U.x,U.y)&&mt(U.prev,U,U.next)>=0)return!1;U=U.next}return!0}function st(B,O,F,N){var U=B.prev,X=B,Z=B.next;if(mt(U,X,Z)>=0)return!1;for(var Ae=U.x<X.x?U.x<Z.x?U.x:Z.x:X.x<Z.x?X.x:Z.x,Re=U.y<X.y?U.y<Z.y?U.y:Z.y:X.y<Z.y?X.y:Z.y,Be=U.x>X.x?U.x>Z.x?U.x:Z.x:X.x>Z.x?X.x:Z.x,Je=U.y>X.y?U.y>Z.y?U.y:Z.y:X.y>Z.y?X.y:Z.y,Xe=We(Ae,Re,O,F,N),_t=We(Be,Je,O,F,N),rt=B.nextZ;rt&&rt.z<=_t;){if(rt!==B.prev&&rt!==B.next&&Qe(U.x,U.y,X.x,X.y,Z.x,Z.y,rt.x,rt.y)&&mt(rt.prev,rt,rt.next)>=0)return!1;rt=rt.nextZ}for(rt=B.prevZ;rt&&rt.z>=Xe;){if(rt!==B.prev&&rt!==B.next&&Qe(U.x,U.y,X.x,X.y,Z.x,Z.y,rt.x,rt.y)&&mt(rt.prev,rt,rt.next)>=0)return!1;rt=rt.prevZ}return!0}function Nt(B,O,F){var N=B;do{var U=N.prev,X=N.next.next;!wt(U,X)&&pt(U,N,N.next,X)&&kt(U,X)&&kt(X,U)&&(O.push(U.i/F),O.push(N.i/F),O.push(X.i/F),pn(N),pn(N.next),N=B=X),N=N.next}while(N!==B);return N}function Zt(B,O,F,N,U,X){var Z=B;do{for(var Ae=Z.next.next;Ae!==Z.prev;){if(Z.i!==Ae.i&&zt(Z,Ae)){var Re=Sr(Z,Ae);Z=re(Z,Z.next),Re=re(Re,Re.next),yt(Z,O,F,N,U,X),yt(Re,O,F,N,U,X);return}Ae=Ae.next}Z=Z.next}while(Z!==B)}function qe(B,O,F,N){var U=[],X,Z,Ae,Re,Be;for(X=0,Z=O.length;X<Z;X++)Ae=O[X]*N,Re=X<Z-1?O[X+1]*N:B.length,Be=Le(B,Ae,Re,N,!1),Be===Be.next&&(Be.steiner=!0),U.push(Tt(Be));for(U.sort(ur),X=0;X<U.length;X++)Dt(U[X],F),F=re(F,F.next);return F}function ur(B,O){return B.x-O.x}function Dt(B,O){if(O=ft(B,O),O){var F=Sr(O,B);re(F,F.next)}}function ft(B,O){var F=O,N=B.x,U=B.y,X=-1/0,Z;do{if(U<=F.y&&U>=F.next.y){var Ae=F.x+(U-F.y)*(F.next.x-F.x)/(F.next.y-F.y);if(Ae<=N&&Ae>X){if(X=Ae,Ae===N){if(U===F.y)return F;if(U===F.next.y)return F.next}Z=F.x<F.next.x?F:F.next}}F=F.next}while(F!==O);if(!Z)return null;if(N===X)return Z.prev;var Re=Z,Be=Z.x,Je=Z.y,Xe=1/0,_t;for(F=Z.next;F!==Re;)N>=F.x&&F.x>=Be&&Qe(U<Je?N:X,U,Be,Je,U<Je?X:N,U,F.x,F.y)&&(_t=Math.abs(U-F.y)/(N-F.x),(_t<Xe||_t===Xe&&F.x>Z.x)&&kt(F,B)&&(Z=F,Xe=_t)),F=F.next;return Z}function Oe(B,O,F,N){var U=B;do U.z===null&&(U.z=We(U.x,U.y,O,F,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,J(U)}function J(B){var O,F,N,U,X,Z,Ae,Re,Be=1;do{for(F=B,B=null,X=null,Z=0;F;){for(Z++,N=F,Ae=0,O=0;O<Be&&(Ae++,N=N.nextZ,!!N);O++);for(Re=Be;Ae>0||Re>0&&N;)Ae===0?(U=N,N=N.nextZ,Re--):Re===0||!N||F.z<=N.z?(U=F,F=F.nextZ,Ae--):(U=N,N=N.nextZ,Re--),X?X.nextZ=U:B=U,U.prevZ=X,X=U;F=N}X.nextZ=null,Be*=2}while(Z>1);return B}function We(B,O,F,N,U){return B=32767*(B-F)/U,O=32767*(O-N)/U,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function Tt(B){var O=B,F=B;do O.x<F.x&&(F=O),O=O.next;while(O!==B);return F}function Qe(B,O,F,N,U,X,Z,Ae){return(U-Z)*(O-Ae)-(B-Z)*(X-Ae)>=0&&(B-Z)*(N-Ae)-(F-Z)*(O-Ae)>=0&&(F-Z)*(X-Ae)-(U-Z)*(N-Ae)>=0}function zt(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!ar(B,O)&&kt(B,O)&&kt(O,B)&&Dr(B,O)}function mt(B,O,F){return(O.y-B.y)*(F.x-O.x)-(O.x-B.x)*(F.y-O.y)}function wt(B,O){return B.x===O.x&&B.y===O.y}function pt(B,O,F,N){return wt(B,O)&&wt(F,N)||wt(B,N)&&wt(F,O)?!0:mt(B,O,F)>0!=mt(B,O,N)>0&&mt(F,N,B)>0!=mt(F,N,O)>0}function ar(B,O){var F=B;do{if(F.i!==B.i&&F.next.i!==B.i&&F.i!==O.i&&F.next.i!==O.i&&pt(F,F.next,B,O))return!0;F=F.next}while(F!==B);return!1}function kt(B,O){return mt(B.prev,B,B.next)<0?mt(B,O,B.next)>=0&&mt(B,B.prev,O)>=0:mt(B,O,B.prev)<0||mt(B,B.next,O)<0}function Dr(B,O){var F=B,N=!1,U=(B.x+O.x)/2,X=(B.y+O.y)/2;do F.y>X!=F.next.y>X&&U<(F.next.x-F.x)*(X-F.y)/(F.next.y-F.y)+F.x&&(N=!N),F=F.next;while(F!==B);return N}function Sr(B,O){var F=new Jn(B.i,B.x,B.y),N=new Jn(O.i,O.x,O.y),U=B.next,X=O.prev;return B.next=O,O.prev=B,F.next=U,U.prev=F,N.next=F,F.prev=N,X.next=N,N.prev=X,N}function jr(B,O,F,N){var U=new Jn(B,O,F);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function pn(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function Jn(B,O,F){this.i=B,this.x=O,this.y=F,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ce.deviation=function(B,O,F,N){var U=O&&O.length,X=U?O[0]*F:B.length,Z=Math.abs(Rn(B,0,X,F));if(U)for(var Ae=0,Re=O.length;Ae<Re;Ae++){var Be=O[Ae]*F,Je=Ae<Re-1?O[Ae+1]*F:B.length;Z-=Math.abs(Rn(B,Be,Je,F))}var Xe=0;for(Ae=0;Ae<N.length;Ae+=3){var _t=N[Ae]*F,rt=N[Ae+1]*F,Ht=N[Ae+2]*F;Xe+=Math.abs((B[_t]-B[Ht])*(B[rt+1]-B[_t+1])-(B[_t]-B[rt])*(B[Ht+1]-B[_t+1]))}return Z===0&&Xe===0?0:Math.abs((Xe-Z)/Z)};function Rn(B,O,F,N){for(var U=0,X=O,Z=F-N;X<F;X+=N)U+=(B[Z]-B[X])*(B[X+1]+B[Z+1]),Z=X;return U}Ce.flatten=function(B){for(var O=B[0][0].length,F={vertices:[],holes:[],dimensions:O},N=0,U=0;U<B.length;U++){for(var X=0;X<B[U].length;X++)for(var Z=0;Z<O;Z++)F.vertices.push(B[U][X][Z]);U>0&&(N+=B[U-1].length,F.holes.push(N))}return F};var hi=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),yn=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");function Oi(B,O,F){if(!!O){B.clear(B.COLOR_BUFFER_BIT),B.viewport(0,0,B.canvas.width,B.canvas.height);var N=V(B,hi,yn);B.enable(B.BLEND),B.blendFunc(B.SRC_ALPHA,B.ONE);var U=B.canvas.width/2,X=B.canvas.height/2;B.bindBuffer(B.ARRAY_BUFFER,B.createBuffer()),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,B.createBuffer());var Z=B.getAttribLocation(N,"a_Position");B.vertexAttribPointer(Z,2,B.FLOAT,!1,0,0),B.enableVertexAttribArray(Z);var Ae=B.getUniformLocation(N,"u_FragColor"),Re=q(F.fillStyle||"red");B.uniform4f(Ae,Re[0]/255,Re[1]/255,Re[2]/255,Re[3]/255),B.lineWidth(F.lineWidth||1);for(var Be=[],Je=[],Xe=65536,_t=0,rt=0,Ht=O.length;rt<Ht;rt++){var Yt=Ce.flatten(O[rt].geometry._coordinates||O[rt].geometry.coordinates),ne=Yt.vertices;_t=Be.length/2;for(var ye=0;ye<ne.length;ye+=2)ne[ye]=(ne[ye]-U)/U,ne[ye+1]=(X-ne[ye+1])/X;(Be.length+ne.length)/2>Xe&&(B.bufferData(B.ARRAY_BUFFER,new Float32Array(Be),B.STATIC_DRAW),B.bufferData(B.ELEMENT_ARRAY_BUFFER,new Uint16Array(Je),B.STATIC_DRAW),B.drawElements(B.TRIANGLES,Je.length,B.UNSIGNED_SHORT,0),Be.length=0,Je.length=0,_t=0);for(var ye=0;ye<ne.length;ye++)Be.push(ne[ye]);for(var Ue=Ce(ne,Yt.holes,Yt.dimensions),ye=0;ye<Ue.length;ye++)Je.push(Ue[ye]+_t)}B.bufferData(B.ARRAY_BUFFER,new Float32Array(Be),B.STATIC_DRAW),B.bufferData(B.ELEMENT_ARRAY_BUFFER,new Uint16Array(Je),B.STATIC_DRAW),B.drawElements(B.TRIANGLES,Je.length,B.UNSIGNED_SHORT,0),B.bindBuffer(B.ARRAY_BUFFER,null),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,null)}}var oi={draw:Oi},Gi={draw:function(O,F,N){var U=F instanceof g?F.get():F;U.length>0&&(U[0].geometry.type=="LineString"?Q.draw(O,U,N):U[0].geometry.type=="Polygon"||U[0].geometry.type=="MultiPolygon"?oi.draw(O,U,N):me.draw(O,U,N))}};function ws(B,O){O=O||{};for(var F=[],N=0;N<B.length-1;N++){var U=Sl(B[N],B[N+1],O.count);U&&U.length>0&&(F=F.concat(U))}return F}function Sl(B,O,Ae){if(!B||!O)return null;var N=function(vr){return 1-2*vr+vr*vr},U=function(vr){return 2*vr-2*vr*vr},X=function(vr){return vr*vr},Z=[],Ae=Ae||40,Re,Be,Je,Xe,_t,rt,Ht=0,Yt=0;if(typeof O>"u"){typeof Z<"u"&&(Z=[]);return}var ne=parseFloat(B.lat),ye=parseFloat(O.lat),Ue=parseFloat(B.lng),Bt=parseFloat(O.lng);for(Bt>Ue&&parseFloat(Bt-Ue)>180&&Ue<0&&(Ue=parseFloat(180+180+Ue),Bt=parseFloat(180+180+Bt)),rt=0,ye==ne?(Re=0,Be=Ue-Bt):Bt==Ue?(Re=Math.PI/2,Be=ne-ye):(Re=Math.atan((ye-ne)/(Bt-Ue)),Be=(ye-ne)/Math.sin(Re)),rt==0&&(rt=Re+Math.PI/5),Je=Be/2,_t=Je*Math.cos(rt)+Ue,Xe=Je*Math.sin(rt)+ne,Ht=0;Ht<Ae+1;Ht++){var $t=Ue*N(Yt)+_t*U(Yt)+Bt*X(Yt),ee=ne*N(Yt)+Xe*U(Yt)+ye*X(Yt),Se=B.lng,Ze=O.lng;Z.push([Se<0&&Ze>0?$t-360:$t,ee]),Yt=Yt+1/Ae}return Z}var Os={getPoints:ws},no=function(){var O={},F=[],N=[],U=[],X=.1,Z=.1,Ae=1,Re=2,Be=6,Je=70,Xe=.6666667,_t=.6,rt=1e-8;function Ht(Ft,nr){return Ft.x*nr.x+Ft.y*nr.y}function Yt(Ft){return{x:O[Ft.target].x-O[Ft.source].x,y:O[Ft.target].y-O[Ft.source].y}}function ne(Ft){return Math.sqrt(Math.pow(O[Ft.source].x-O[Ft.target].x,2)+Math.pow(O[Ft.source].y-O[Ft.target].y,2))}function ye(Ft){return Math.sqrt(Math.pow(Ft.source.x-Ft.target.x,2)+Math.pow(Ft.source.y-Ft.target.y,2))}function Ue(Ft){var nr=(O[Ft.source].x+O[Ft.target].x)/2,Wn=(O[Ft.source].y+O[Ft.target].y)/2;return{x:nr,y:Wn}}function Bt(Ft){for(var nr=0,Wn=1;Wn<U[Ft].length;Wn++){var Zi=$t(U[Ft][Wn],U[Ft][Wn-1]);nr+=Zi}return nr}function $t(Ft,nr){return Math.sqrt(Math.pow(Ft.x-nr.x,2)+Math.pow(Ft.y-nr.y,2))}function ee(Ft,nr){var Wn=Math.sqrt((nr.target.x-nr.source.x)*(nr.target.x-nr.source.x)+(nr.target.y-nr.source.y)*(nr.target.y-nr.source.y)),Zi=((nr.source.y-Ft.y)*(nr.source.y-nr.target.y)-(nr.source.x-Ft.x)*(nr.target.x-nr.source.x))/(Wn*Wn);return{x:nr.source.x+Zi*(nr.target.x-nr.source.x),y:nr.source.y+Zi*(nr.target.y-nr.source.y)}}function Se(){for(var Ft=0;Ft<F.length;Ft++)U[Ft]=[]}function Ze(){for(var Ft=0;Ft<F.length;Ft++)N[Ft]=[]}function Ct(Ft){for(var nr=[],Wn=0;Wn<Ft.length;Wn++)O[Ft[Wn].source].x!=O[Ft[Wn].target].x&&O[Ft[Wn].source].y!=O[Ft[Wn].target].y&&nr.push(Ft[Wn]);return nr}function vr(Ft,nr,Wn){var Zi=U[Ft][nr-1],Ts=U[Ft][nr+1],ko=U[Ft][nr],Fo=Zi.x-ko.x+Ts.x-ko.x,Su=Zi.y-ko.y+Ts.y-ko.y;return Fo*=Wn,Su*=Wn,{x:Fo,y:Su}}function Cr(Ft,nr,Wn){for(var Zi={x:0,y:0},Ts=N[Ft],ko=0;ko<Ts.length;ko++){var Fo={x:U[Ts[ko]][nr].x-U[Ft][nr].x,y:U[Ts[ko]][nr].y-U[Ft][nr].y};if(Math.abs(Fo.x)>rt||Math.abs(Fo.y)>rt){var Su=1/Math.pow(ye({source:U[Ts[ko]][nr],target:U[Ft][nr]}),1);Zi.x+=Fo.x*Su,Zi.y+=Fo.y*Su}}return Zi}function Jr(Ft,nr,Wn){for(var Zi=X/(ne(F[Ft])*(nr+1)),Ts=[{x:0,y:0}],ko=1;ko<nr+1;ko++){var Fo={x:0,y:0},Su=vr(Ft,ko,Zi),Jf=Cr(Ft,ko);Fo.x=Wn*(Su.x+Jf.x),Fo.y=Wn*(Su.y+Jf.y),Ts.push(Fo)}return Ts.push({x:0,y:0}),Ts}function nn(Ft){for(var nr=0;nr<F.length;nr++)if(Ft==1)U[nr].push(O[F[nr].source]),U[nr].push(Ue(F[nr])),U[nr].push(O[F[nr].target]);else{var Wn=Bt(nr),Zi=Wn/(Ft+1),Ts=Zi,ko=[];ko.push(O[F[nr].source]);for(var Fo=1;Fo<U[nr].length;Fo++){for(var Su=$t(U[nr][Fo],U[nr][Fo-1]);Su>Ts;){var Jf=Ts/Su,xg=U[nr][Fo-1].x,sF=U[nr][Fo-1].y;xg+=Jf*(U[nr][Fo].x-U[nr][Fo-1].x),sF+=Jf*(U[nr][Fo].y-U[nr][Fo-1].y),ko.push({x:xg,y:sF}),Su-=Ts,Ts=Zi}Ts-=Su}ko.push(O[F[nr].target]),U[nr]=ko}}function Dn(Ft,nr){var Wn=Math.abs(Ht(Yt(Ft),Yt(nr))/(ne(Ft)*ne(nr)));return Wn}function si(Ft,nr){var Wn=(ne(Ft)+ne(nr))/2,Zi=2/(Wn/Math.min(ne(Ft),ne(nr))+Math.max(ne(Ft),ne(nr))/Wn);return Zi}function An(Ft,nr){var Wn=(ne(Ft)+ne(nr))/2,Zi={x:(O[Ft.source].x+O[Ft.target].x)/2,y:(O[Ft.source].y+O[Ft.target].y)/2},Ts={x:(O[nr.source].x+O[nr.target].x)/2,y:(O[nr.source].y+O[nr.target].y)/2},ko=Wn/(Wn+$t(Zi,Ts));return ko}function qi(Ft,nr){var Wn=ee(O[nr.source],{source:O[Ft.source],target:O[Ft.target]}),Zi=ee(O[nr.target],{source:O[Ft.source],target:O[Ft.target]}),Ts={x:(Wn.x+Zi.x)/2,y:(Wn.y+Zi.y)/2},ko={x:(O[Ft.source].x+O[Ft.target].x)/2,y:(O[Ft.source].y+O[Ft.target].y)/2},Fo=Math.max(0,1-2*$t(ko,Ts)/$t(Wn,Zi));return Fo}function _o(Ft,nr){return Math.min(qi(Ft,nr),qi(nr,Ft))}function cs(Ft,nr){var Wn=Dn(Ft,nr)*si(Ft,nr)*An(Ft,nr)*_o(Ft,nr);return Wn}function wl(Ft,nr){return cs(Ft,nr)>=_t}function xu(){for(var Ft=0;Ft<F.length-1;Ft++)for(var nr=Ft+1;nr<F.length;nr++)Ft!=nr&&wl(F[Ft],F[nr])&&(N[Ft].push(nr),N[nr].push(Ft))}var fa=function(){var nr=Z,Wn=Je,Zi=Ae;Se(),Ze(),nn(Zi),xu();for(var Ts=0;Ts<Be;Ts++){for(var ko=0;ko<Wn;ko++){for(var Fo=[],Su=0;Su<F.length;Su++)Fo[Su]=Jr(Su,Zi,nr);for(var Jf=0;Jf<F.length;Jf++)for(var xg=0;xg<Zi+1;xg++)U[Jf][xg].x+=Fo[Jf][xg].x,U[Jf][xg].y+=Fo[Jf][xg].y}nr=nr/2,Zi=Zi*2,Wn=Xe*Wn,nn(Zi)}return U};return fa.nodes=function(Ft){return arguments.length==0?O:(O=Ft,fa)},fa.edges=function(Ft){return arguments.length==0?F:(F=Ct(Ft),fa)},fa.bundling_stiffness=function(Ft){return arguments.length==0?X:(X=Ft,fa)},fa.step_size=function(Ft){return arguments.length==0?Z:(Z=Ft,fa)},fa.cycles=function(Ft){return arguments.length==0?Be:(Be=Ft,fa)},fa.iterations=function(Ft){return arguments.length==0?Je:(Je=Ft,fa)},fa.iterations_rate=function(Ft){return arguments.length==0?Xe:(Xe=Ft,fa)},fa.subdivision_points_seed=function(Ft){return arguments.length==0?P:(P=Ft,fa)},fa.subdivision_rate=function(Ft){return arguments.length==0?Re:(Re=Ft,fa)},fa.compatbility_threshold=function(Ft){return arguments.length==0?compatbility_threshold:(_t=Ft,fa)},fa};function vo(B){this.splitList=B||{other:1}}vo.prototype.get=function(B){var O=this.splitList,F=O.other;for(var N in O)if(B==N){F=O[N];break}return F},vo.prototype.generateByDataSet=function(B,O){var F=O||["rgba(255, 255, 0, 0.8)","rgba(253, 98, 104, 0.8)","rgba(255, 146, 149, 0.8)","rgba(255, 241, 193, 0.8)","rgba(110, 176, 253, 0.8)","rgba(52, 139, 251, 0.8)","rgba(17, 102, 252, 0.8)"],N=B.get();this.splitList={};for(var U=0,X=0;X<N.length&&(this.splitList[N[X].count]===void 0&&(this.splitList[N[X].count]=F[U],U++),!(U>=F.length-1));X++);this.splitList.other=F[F.length-1]},vo.prototype.getLegend=function(B){var O=this.splitList,F=document.createElement("div");F.style.cssText="background:#fff; padding: 5px; border: 1px solid #ccc;";var N="";for(var U in O)N+='<div style="line-height: 19px;" value="'+U+'"><span style="vertical-align: -2px; display: inline-block; width: 30px;height: 19px;background:'+O[U]+';"></span><span style="margin-left: 3px;">'+U+"<span></div>";return F.innerHTML=N,F};function No(B){this.splitList=B||[{start:0,value:"red"}]}No.prototype.get=function(B){for(var O=this.splitList,F=!1,N=0;N<O.length;N++)if((O[N].start===void 0||O[N].start!==void 0&&B>=O[N].start)&&(O[N].end===void 0||O[N].end!==void 0&&B<O[N].end)){F=O[N].value;break}return F},No.prototype.generateByDataSet=function(B){var O=B.getMin("count"),F=B.getMax("count");this.generateByMinMax(O,F)},No.prototype.generateByMinMax=function(B,O){var F=["rgba(255, 255, 0, 0.8)","rgba(253, 98, 104, 0.8)","rgba(255, 146, 149, 0.8)","rgba(255, 241, 193, 0.8)","rgba(110, 176, 253, 0.8)","rgba(52, 139, 251, 0.8)","rgba(17, 102, 252, 0.8)"],N=Number((O-B)/7);O=Number(O);var U=Number(B);this.splitList=[];for(var X=0;U<O;)this.splitList.push({start:U,end:U+N,value:F[X]}),X++,U+=N},No.prototype.getLegend=function(B){this.splitList};var Jo=function(){function B(O,F,N){if(h(this,B),!O||!F)return console.warn("id \u548C type \u4E3A\u5FC5\u586B\u9879"),!1;if(F=="baidu"){if(!BMap)return console.warn("\u8BF7\u5148\u5F15\u5165\u767E\u5EA6\u5730\u56FEJS API"),!1}else console.warn("\u6682\u4E0D\u652F\u6301\u4F60\u7684\u5730\u56FE\u7C7B\u578B");this.type=F;var U=N&&N.center?N.center:[106.962497,38.208726],X=N&&N.zoom?N.zoom:5,Z=this.map=new BMap.Map(O,{enableMapClick:!1});Z.centerAndZoom(new BMap.Point(U[0],U[1]),X),Z.enableScrollWheelZoom(!0),Z.setMapStyle({style:"light"})}return c(B,[{key:"addLayer",value:function(F,N){if(this.type=="baidu")return new mapv.baiduMapLayer(this.map,dataSet,N)}},{key:"getMap",value:function(){return this.map}}]),B}();function Lo(B){this.options=B||{},this.paneName=this.options.paneName||"mapPane",this.context=this.options.context||"2d",this.zIndex=this.options.zIndex||0,this.mixBlendMode=this.options.mixBlendMode||null,this.enableMassClear=this.options.enableMassClear,this._map=B.map,this._lastDrawTime=null,this.show()}var hs=typeof window>"u"?{}:window,Rs=hs.BMap||hs.BMapGL;Rs&&(Lo.prototype=new Rs.Overlay,Lo.prototype.initialize=function(B){this._map=B;var O=this.canvas=document.createElement("canvas");O.style.cssText="position:absolute;left:0;top:0;z-index:"+this.zIndex+";user-select:none;",O.style.mixBlendMode=this.mixBlendMode,this.adjustSize();var F=B.getPanes()[this.paneName];F||(F=B.getPanes().floatShadow),F.appendChild(O);var N=this;return B.addEventListener("resize",function(){N.adjustSize(),N._draw()}),B.addEventListener("update",function(){N._draw()}),this.options.updateImmediate&&setTimeout(function(){N._draw()},100),this.canvas},Lo.prototype.adjustSize=function(){var B=this._map.getSize(),O=this.canvas,F=this.devicePixelRatio=hs.devicePixelRatio||1;O.width=B.width*F,O.height=B.height*F,this.context=="2d"&&O.getContext(this.context).scale(F,F),O.style.width=B.width+"px",O.style.height=B.height+"px"},Lo.prototype.draw=function(){var B=this;this.options.updateImmediate?B._draw():(clearTimeout(B.timeoutID),B.timeoutID=setTimeout(function(){B._draw()},15))},Lo.prototype._draw=function(){var B=this._map,O=B.getSize(),F=B.getCenter();if(F){var N=B.pointToOverlayPixel(F);this.canvas.style.left=N.x-O.width/2+"px",this.canvas.style.top=N.y-O.height/2+"px",this.dispatchEvent("draw"),this.options.update&&this.options.update.call(this)}},Lo.prototype.getContainer=function(){return this.canvas},Lo.prototype.show=function(){this.canvas||this._map.addOverlay(this),this.canvas.style.display="block"},Lo.prototype.hide=function(){this.canvas.style.display="none"},Lo.prototype.setZIndex=function(B){this.zIndex=B,this.canvas.style.zIndex=this.zIndex},Lo.prototype.getZIndex=function(){return this.zIndex});var Pn=Pn||function(){var B=[];return{getAll:function(){return B},removeAll:function(){B=[]},add:function(F){B.push(F)},remove:function(F){var N=B.indexOf(F);N!==-1&&B.splice(N,1)},update:function(F,N){if(B.length===0)return!1;var U=0;for(F=F!==void 0?F:Pn.now();U<B.length;)B[U].update(F)||N?U++:B.splice(U,1);return!0}}}();typeof window>"u"&&typeof process<"u"?Pn.now=function(){var B=process.hrtime();return B[0]*1e3+B[1]/1e6}:typeof window<"u"&&window.performance!==void 0&&window.performance.now!==void 0?Pn.now=window.performance.now.bind(window.performance):Date.now!==void 0?Pn.now=Date.now:Pn.now=function(){return new Date().getTime()},Pn.Tween=function(B){var O=B,F={},N={},U={},X=1e3,Z=0,Ae,Re=!1,Be=!1,Je=0,Xe=null,_t=Pn.Easing.Linear.None,rt=Pn.Interpolation.Linear,Ht=[],Yt=null,ne=!1,ye=null,Ue=null,Bt=null;this.to=function($t,ee){return N=$t,ee!==void 0&&(X=ee),this},this.start=function($t){Pn.add(this),Be=!0,ne=!1,Xe=$t!==void 0?$t:Pn.now(),Xe+=Je;for(var ee in N){if(N[ee]instanceof Array){if(N[ee].length===0)continue;N[ee]=[O[ee]].concat(N[ee])}O[ee]!==void 0&&(F[ee]=O[ee],F[ee]instanceof Array||(F[ee]*=1),U[ee]=F[ee]||0)}return this},this.stop=function(){return Be?(Pn.remove(this),Be=!1,Bt!==null&&Bt.call(O,O),this.stopChainedTweens(),this):this},this.end=function(){return this.update(Xe+X),this},this.stopChainedTweens=function(){for(var $t=0,ee=Ht.length;$t<ee;$t++)Ht[$t].stop()},this.delay=function($t){return Je=$t,this},this.repeat=function($t){return Z=$t,this},this.repeatDelay=function($t){return Ae=$t,this},this.yoyo=function($t){return Re=$t,this},this.easing=function($t){return _t=$t,this},this.interpolation=function($t){return rt=$t,this},this.chain=function(){return Ht=arguments,this},this.onStart=function($t){return Yt=$t,this},this.onUpdate=function($t){return ye=$t,this},this.onComplete=function($t){return Ue=$t,this},this.onStop=function($t){return Bt=$t,this},this.update=function($t){var ee,Se,Ze;if($t<Xe)return!0;ne===!1&&(Yt!==null&&Yt.call(O,O),ne=!0),Se=($t-Xe)/X,Se=Se>1?1:Se,Ze=_t(Se);for(ee in N)if(F[ee]!==void 0){var Ct=F[ee]||0,vr=N[ee];vr instanceof Array?O[ee]=rt(vr,Ze):(typeof vr=="string"&&(vr.charAt(0)==="+"||vr.charAt(0)==="-"?vr=Ct+parseFloat(vr):vr=parseFloat(vr)),typeof vr=="number"&&(O[ee]=Ct+(vr-Ct)*Ze))}if(ye!==null&&ye.call(O,Ze),Se===1)if(Z>0){isFinite(Z)&&Z--;for(ee in U){if(typeof N[ee]=="string"&&(U[ee]=U[ee]+parseFloat(N[ee])),Re){var Cr=U[ee];U[ee]=N[ee],N[ee]=Cr}F[ee]=U[ee]}return Ae!==void 0?Xe=$t+Ae:Xe=$t+Je,!0}else{Ue!==null&&Ue.call(O,O);for(var Jr=0,nn=Ht.length;Jr<nn;Jr++)Ht[Jr].start(Xe+X);return!1}return!0}},Pn.Easing={Linear:{None:function(O){return O}},Quadratic:{In:function(O){return O*O},Out:function(O){return O*(2-O)},InOut:function(O){return(O*=2)<1?.5*O*O:-.5*(--O*(O-2)-1)}},Cubic:{In:function(O){return O*O*O},Out:function(O){return--O*O*O+1},InOut:function(O){return(O*=2)<1?.5*O*O*O:.5*((O-=2)*O*O+2)}},Quartic:{In:function(O){return O*O*O*O},Out:function(O){return 1- --O*O*O*O},InOut:function(O){return(O*=2)<1?.5*O*O*O*O:-.5*((O-=2)*O*O*O-2)}},Quintic:{In:function(O){return O*O*O*O*O},Out:function(O){return--O*O*O*O*O+1},InOut:function(O){return(O*=2)<1?.5*O*O*O*O*O:.5*((O-=2)*O*O*O*O+2)}},Sinusoidal:{In:function(O){return 1-Math.cos(O*Math.PI/2)},Out:function(O){return Math.sin(O*Math.PI/2)},InOut:function(O){return .5*(1-Math.cos(Math.PI*O))}},Exponential:{In:function(O){return O===0?0:Math.pow(1024,O-1)},Out:function(O){return O===1?1:1-Math.pow(2,-10*O)},InOut:function(O){return O===0?0:O===1?1:(O*=2)<1?.5*Math.pow(1024,O-1):.5*(-Math.pow(2,-10*(O-1))+2)}},Circular:{In:function(O){return 1-Math.sqrt(1-O*O)},Out:function(O){return Math.sqrt(1- --O*O)},InOut:function(O){return(O*=2)<1?-.5*(Math.sqrt(1-O*O)-1):.5*(Math.sqrt(1-(O-=2)*O)+1)}},Elastic:{In:function(O){return O===0?0:O===1?1:-Math.pow(2,10*(O-1))*Math.sin((O-1.1)*5*Math.PI)},Out:function(O){return O===0?0:O===1?1:Math.pow(2,-10*O)*Math.sin((O-.1)*5*Math.PI)+1},InOut:function(O){return O===0?0:O===1?1:(O*=2,O<1?-.5*Math.pow(2,10*(O-1))*Math.sin((O-1.1)*5*Math.PI):.5*Math.pow(2,-10*(O-1))*Math.sin((O-1.1)*5*Math.PI)+1)}},Back:{In:function(O){var F=1.70158;return O*O*((F+1)*O-F)},Out:function(O){var F=1.70158;return--O*O*((F+1)*O+F)+1},InOut:function(O){var F=2.5949095;return(O*=2)<1?.5*(O*O*((F+1)*O-F)):.5*((O-=2)*O*((F+1)*O+F)+2)}},Bounce:{In:function(O){return 1-Pn.Easing.Bounce.Out(1-O)},Out:function(O){return O<1/2.75?7.5625*O*O:O<2/2.75?7.5625*(O-=1.5/2.75)*O+.75:O<2.5/2.75?7.5625*(O-=2.25/2.75)*O+.9375:7.5625*(O-=2.625/2.75)*O+.984375},InOut:function(O){return O<.5?Pn.Easing.Bounce.In(O*2)*.5:Pn.Easing.Bounce.Out(O*2-1)*.5+.5}}},Pn.Interpolation={Linear:function(O,F){var N=O.length-1,U=N*F,X=Math.floor(U),Z=Pn.Interpolation.Utils.Linear;return F<0?Z(O[0],O[1],U):F>1?Z(O[N],O[N-1],N-U):Z(O[X],O[X+1>N?N:X+1],U-X)},Bezier:function(O,F){for(var N=0,U=O.length-1,X=Math.pow,Z=Pn.Interpolation.Utils.Bernstein,Ae=0;Ae<=U;Ae++)N+=X(1-F,U-Ae)*X(F,Ae)*O[Ae]*Z(U,Ae);return N},CatmullRom:function(O,F){var N=O.length-1,U=N*F,X=Math.floor(U),Z=Pn.Interpolation.Utils.CatmullRom;return O[0]===O[N]?(F<0&&(X=Math.floor(U=N*(1+F))),Z(O[(X-1+N)%N],O[X],O[(X+1)%N],O[(X+2)%N],U-X)):F<0?O[0]-(Z(O[0],O[0],O[1],O[1],-U)-O[0]):F>1?O[N]-(Z(O[N],O[N],O[N-1],O[N-1],U-N)-O[N]):Z(O[X?X-1:0],O[X],O[N<X+1?N:X+1],O[N<X+2?N:X+2],U-X)},Utils:{Linear:function(O,F,N){return(F-O)*N+O},Bernstein:function(O,F){var N=Pn.Interpolation.Utils.Factorial;return N(O)/N(F)/N(O-F)},Factorial:function(){var B=[1];return function(O){var F=1;if(B[O])return B[O];for(var N=O;N>1;N--)F*=N;return B[O]=F,F}}(),CatmullRom:function(O,F,N,U,X){var Z=(N-O)*.5,Ae=(U-F)*.5,Re=X*X,Be=X*Re;return(2*F-2*N+Z+Ae)*Be+(-3*F+3*N-2*Z-Ae)*Re+Z*X+F}}};function mo(B,O){var F=O[0]-B[0],N=O[1]-B[1],U=360*Math.atan(N/F)/(2*Math.PI);return O[0]<B[0]&&(U=U+180),U}var ue={},xe={draw:function(O,F,N){var U="http://huiyan.baidu.com/github/tools/gis-drawing/static/images/direction.png";N.arrow&&N.arrow.url&&(U=N.arrow.url),ue[U]||(ue[U]=null);var X=ue[U];if(!X){var Z=Array.prototype.slice.call(arguments),Ae=new Image;Ae.onload=function(){ue[U]=Ae,xe.draw.apply(null,Z)},Ae.src=U;return}var Re=F instanceof g?F.get():F;O.save();for(var Be in N)O[Be]=N[Be];for(var Je=null,Xe=0,_t=Re.length;Xe<_t;Xe++){var rt=Re[Xe];O.save(),(rt.fillStyle||rt._fillStyle)&&(O.fillStyle=rt.fillStyle||rt._fillStyle),(rt.strokeStyle||rt._strokeStyle)&&(O.strokeStyle=rt.strokeStyle||rt._strokeStyle);var Ht=rt.geometry.type;if(O.beginPath(),Ht==="LineString"){for(var Yt=rt.geometry._coordinates||rt.geometry.coordinates,ne=N.arrow.interval!==void 0?N.arrow.interval:1,ye=0;ye<Yt.length;ye+=ne)if(Yt[ye]&&Yt[ye+1]){var Ue=Yt[ye];if(Je&&ce(Ue,Je)<30)continue;O.save();var Bt=mo(Yt[ye],Yt[ye+1]);O.translate(Ue[0],Ue[1]),O.rotate(Bt*Math.PI/180),O.drawImage(X,-X.width/2/2,-X.height/2/2,X.width/2,X.height/2),O.restore(),Je=Ue}}O.restore()}O.restore()}};function ce(B,O){return Math.sqrt(Math.pow(B[0]-O[0],2)+Math.pow(B[1]-O[1],2))}var pe={draw:function(O,F,N){var U=F instanceof g?F.get():F;O.save(),O.fillStyle=N.fillStyle||"rgba(0, 0, 0, 0.5)",O.fillRect(0,0,O.canvas.width,O.canvas.height),N.multiPolygonDraw=function(){O.save(),O.clip(),i(O),O.restore()};for(var X=0,Z=U.length;X<Z;X++)O.beginPath(),_.drawDataSet(O,[U[X]],N),O.save(),O.clip(),i(O),O.restore();O.restore()}},we={},Me={},nt={draw:function(O,F,N){O.save();for(var U=F instanceof g?F.get():F,X=0;X<U.length;X++){var Z=U[X],Ae=Z.geometry._coordinates||Z.geometry.coordinates;if(O.beginPath(),Z.properties&&Z.properties.cluster){if(O.arc(Ae[0],Ae[1],Z.size,0,Math.PI*2),O.fillStyle=Z.fillStyle,O.fill(),N.label&&N.label.show!==!1){O.fillStyle=N.label.fillStyle||"white",N.label.font&&(O.font=N.label.font),N.label.shadowColor&&(O.shadowColor=N.label.shadowColor),N.label.shadowBlur&&(O.shadowBlur=N.label.shadowBlur);var Re=Z.properties.point_count,Be=O.measureText(Re).width;O.fillText(Re,Ae[0]+.5-Be/2,Ae[1]+.5+3)}}else this.drawIcon(Z,N,O)}O.restore()},drawIcon:function(O,F,N){var U=O.geometry._coordinates||O.geometry.coordinates,X=p(U,2),Z=X[0],Ae=X[1],Re=Object.assign({},F.iconOptions,O.iconOptions),Be=function(){N.beginPath(),N.arc(Z,Ae,F.size||5,0,Math.PI*2),N.fillStyle=F.fillStyle||"red",N.fill()};if(!Re.url){Be();return}var Je=Re.width,Xe=Re.height,_t=Re.offset||{x:0,y:0};Z=Z-~~Je/2+_t.x,Ae=Ae-~~Xe/2+_t.y;var rt=window.encodeURIComponent(Re.url),Ht=we[rt];Ht?Ht==="error"?Be():Je&&Xe?N.drawImage(Ht,Z,Ae,Je,Xe):N.drawImage(Ht,Z,Ae):(Me[rt]||(Me[rt]=[],It(rt,function(Yt,ne){Me[ne]&&Me[ne].forEach(function(ye){return ye(Yt)}),Me[ne]=null,we[ne]=Yt},function(Yt){Me[Yt]&&Me[Yt].forEach(function(ne){return ne("error",Yt)}),Me[Yt]=null,we[Yt]="error",Be()})),Me[rt].push(function(Yt,ne,ye,Ue){return function(Bt){Bt==="error"?Be():ye&&Ue?N.drawImage(Bt,Yt,ne,ye,Ue):N.drawImage(Bt,Yt,ne)}}(Z,Ae,Je,Xe)))}};function It(B,O,F){var N=new Image;N.onload=function(){O&&O(N,B)},N.onerror=function(){F&&F(B)},N.src=window.decodeURIComponent(B)}var ot={draw:function(O,F,N){var U=F instanceof g?F.get():F;O.save();for(var X in N)O[X]=N[X];var Z=[],Ae=N._size||N.size;Ae?O.font="bold "+Ae+"px Arial":Ae=12;var Re=N.textKey||"text";if(N.textAlign||(O.textAlign="center"),N.textBaseline||(O.textBaseline="middle"),N.avoid)for(var Be=0,Je=U.length;Be<Je;Be++){var Xe=U[Be].offset||N.offset||{x:0,y:0},_t=U[Be].geometry._coordinates||U[Be].geometry.coordinates,rt=_t[0]+Xe.x,Ht=_t[1]+Xe.y,Yt=U[Be][Re],ne=O.measureText(Yt).width,ye=rt-ne/2,Ue=Ht-Ae/2,Bt={sw:{x:ye,y:Ue+Ae},ne:{x:ye+ne,y:Ue}};ht(Z,Bt)||(Z.push(Bt),ye=ye+ne/2,Ue=Ue+Ae/2,O.fillText(Yt,ye,Ue))}else for(var Be=0,Je=U.length;Be<Je;Be++){var Xe=U[Be].offset||N.offset||{x:0,y:0},_t=U[Be].geometry._coordinates||U[Be].geometry.coordinates,rt=_t[0]+Xe.x,Ht=_t[1]+Xe.y,Yt=U[Be][Re];O.fillText(Yt,rt,Ht)}O.restore()}};function ht(B,O){for(var F=0;F<B.length;F++)if(ut(B[F],O))return!0;return!1}function ut(B,O){var F=Math.min(B.ne.x,O.ne.x),N=Math.min(B.sw.y,O.sw.y),U=Math.max(B.sw.x,O.sw.x),X=Math.max(B.ne.y,O.ne.y);return F>U&&N>X}var qt={},fr={},Wr={draw:function(O,F,N){for(var U=F instanceof g?F.get():F,X=function(){var Je=U[Z];if(Je.geometry)if(Re=Je.icon||N.icon,typeof Re=="string"){var Xe=window.encodeURIComponent(Re),_t=qt[Xe];_t?gr(_t,N,O,Je):(fr[Xe]||(fr[Xe]=[],Ar(Xe,function(rt,Ht){fr[Ht]&&fr[Ht].forEach(function(Yt){return Yt(rt)}),fr[Ht]=null,qt[Ht]=rt},function(rt){fr[rt]&&fr[rt].forEach(function(Ht){return Ht("error")}),fr[rt]=null,qt[rt]="error"})),fr[Xe].push(function(rt){gr(rt,N,O,Je)}))}else gr(Re,N,O,Je)},Z=0,Ae=U.length;Z<Ae;Z++){var Re;X()}}};function gr(B,O,F,N){F.save();var U=N.geometry._coordinates||N.geometry.coordinates,X=U[0],Z=U[1],Ae=O.offset||{x:0,y:0},Re=N.width||O._width||O.width,Be=N.height||O._height||O.height;if(X=X-~~Re/2+Ae.x,Z=Z-~~Be/2+Ae.y,typeof B=="string"){F.beginPath(),F.arc(X,Z,O.size||5,0,Math.PI*2),F.fillStyle=O.fillStyle||"red",F.fill();return}var Je=N.deg||O.deg;Je&&(F.translate(X,Z),F.rotate(Je*Math.PI/180),F.translate(-X,-Z)),O.sx&&O.sy&&O.swidth&&O.sheight&&O.width&&O.height?F.drawImage(B,O.sx,O.sy,O.swidth,O.sheight,X,Z,Re,Be):Re&&Be?F.drawImage(B,X,Z,Re,Be):F.drawImage(B,X,Z),F.restore()}function Ar(B,O,F){var N=new Image;N.onload=function(){O&&O(N,B)},N.onerror=function(){F&&F(B)},N.src=window.decodeURIComponent(B)}function $n(B,O,F,N,U,X){if(!(U-N<=F)){var Z=N+U>>1;bi(B,O,Z,N,U,X%2),$n(B,O,F,N,Z-1,X+1),$n(B,O,F,Z+1,U,X+1)}}function bi(B,O,F,N,U,X){for(;U>N;){if(U-N>600){var Z=U-N+1,Ae=F-N+1,Re=Math.log(Z),Be=.5*Math.exp(2*Re/3),Je=.5*Math.sqrt(Re*Be*(Z-Be)/Z)*(Ae-Z/2<0?-1:1),Xe=Math.max(N,Math.floor(F-Ae*Be/Z+Je)),_t=Math.min(U,Math.floor(F+(Z-Ae)*Be/Z+Je));bi(B,O,F,Xe,_t,X)}var rt=O[2*F+X],Ht=N,Yt=U;for(qa(B,O,N,F),O[2*U+X]>rt&&qa(B,O,N,U);Ht<Yt;){for(qa(B,O,Ht,Yt),Ht++,Yt--;O[2*Ht+X]<rt;)Ht++;for(;O[2*Yt+X]>rt;)Yt--}O[2*N+X]===rt?qa(B,O,N,Yt):(Yt++,qa(B,O,Yt,U)),Yt<=F&&(N=Yt+1),F<=Yt&&(U=Yt-1)}}function qa(B,O,F,N){Qo(B,F,N),Qo(O,2*F,2*N),Qo(O,2*F+1,2*N+1)}function Qo(B,O,F){var N=B[O];B[O]=B[F],B[F]=N}function Ds(B,O,F,N,U,X,Z){for(var Ae=[0,B.length-1,0],Re=[],Be,Je;Ae.length;){var Xe=Ae.pop(),_t=Ae.pop(),rt=Ae.pop();if(_t-rt<=Z){for(var Ht=rt;Ht<=_t;Ht++)Be=O[2*Ht],Je=O[2*Ht+1],Be>=F&&Be<=U&&Je>=N&&Je<=X&&Re.push(B[Ht]);continue}var Yt=Math.floor((rt+_t)/2);Be=O[2*Yt],Je=O[2*Yt+1],Be>=F&&Be<=U&&Je>=N&&Je<=X&&Re.push(B[Yt]);var ne=(Xe+1)%2;(Xe===0?F<=Be:N<=Je)&&(Ae.push(rt),Ae.push(Yt-1),Ae.push(ne)),(Xe===0?U>=Be:X>=Je)&&(Ae.push(Yt+1),Ae.push(_t),Ae.push(ne))}return Re}function af(B,O,F,N,U,X){for(var Z=[0,B.length-1,0],Ae=[],Re=U*U;Z.length;){var Be=Z.pop(),Je=Z.pop(),Xe=Z.pop();if(Je-Xe<=X){for(var _t=Xe;_t<=Je;_t++)mh(O[2*_t],O[2*_t+1],F,N)<=Re&&Ae.push(B[_t]);continue}var rt=Math.floor((Xe+Je)/2),Ht=O[2*rt],Yt=O[2*rt+1];mh(Ht,Yt,F,N)<=Re&&Ae.push(B[rt]);var ne=(Be+1)%2;(Be===0?F-U<=Ht:N-U<=Yt)&&(Z.push(Xe),Z.push(rt-1),Z.push(ne)),(Be===0?F+U>=Ht:N+U>=Yt)&&(Z.push(rt+1),Z.push(Je),Z.push(ne))}return Ae}function mh(B,O,F,N){var U=B-F,X=O-N;return U*U+X*X}var Zl=function(O){return O[0]},jd=function(O){return O[1]},Nl=function(O,F,N,U,X){F===void 0&&(F=Zl),N===void 0&&(N=jd),U===void 0&&(U=64),X===void 0&&(X=Float64Array),this.nodeSize=U,this.points=O;for(var Z=O.length<65536?Uint16Array:Uint32Array,Ae=this.ids=new Z(O.length),Re=this.coords=new X(O.length*2),Be=0;Be<O.length;Be++)Ae[Be]=Be,Re[2*Be]=F(O[Be]),Re[2*Be+1]=N(O[Be]);$n(Ae,Re,U,0,Ae.length-1,0)};Nl.prototype.range=function(O,F,N,U){return Ds(this.ids,this.coords,O,F,N,U,this.nodeSize)},Nl.prototype.within=function(O,F,N){return af(this.ids,this.coords,O,F,N,this.nodeSize)};var ec={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(O){return O}},js=function(O){this.options=Kf(Object.create(ec),O),this.trees=new Array(this.options.maxZoom+1)};js.prototype.load=function(O){var F=this.options;F.log;var N=F.minZoom,U=F.maxZoom,X=F.nodeSize;""+O.length,this.points=O;for(var Z=[],Ae=0;Ae<O.length;Ae++)!O[Ae].geometry||Z.push(dg(O[Ae],Ae));this.trees[U+1]=new Nl(Z,of,X0,X,Float32Array);for(var Re=U;Re>=N;Re--)Z=this._cluster(Z,Re),this.trees[Re]=new Nl(Z,of,X0,X,Float32Array);return this},js.prototype.getClusters=function(O,F){var N=((O[0]+180)%360+360)%360-180,U=Math.max(-90,Math.min(90,O[1])),X=O[2]===180?180:((O[2]+180)%360+360)%360-180,Z=Math.max(-90,Math.min(90,O[3]));if(O[2]-O[0]>=360)N=-180,X=180;else if(N>X){var Ae=this.getClusters([N,U,180,Z],F),Re=this.getClusters([-180,U,X,Z],F);return Ae.concat(Re)}for(var Be=this.trees[this._limitZoom(F)],Je=Be.range(vg(N),qf(Z),vg(X),qf(U)),Xe=[],_t=0,rt=Je;_t<rt.length;_t+=1){var Ht=rt[_t],Yt=Be.points[Ht];Xe.push(Yt.numPoints?Xd(Yt):this.points[Yt.index])}return Xe},js.prototype.getChildren=function(O){var F=this._getOriginId(O),N=this._getOriginZoom(O),U="No cluster with the specified id.",X=this.trees[N];if(!X)throw new Error(U);var Z=X.points[F];if(!Z)throw new Error(U);for(var Ae=this.options.radius/(this.options.extent*Math.pow(2,N-1)),Re=X.within(Z.x,Z.y,Ae),Be=[],Je=0,Xe=Re;Je<Xe.length;Je+=1){var _t=Xe[Je],rt=X.points[_t];rt.parentId===O&&Be.push(rt.numPoints?Xd(rt):this.points[rt.index])}if(Be.length===0)throw new Error(U);return Be},js.prototype.getLeaves=function(O,F,N){F=F||10,N=N||0;var U=[];return this._appendLeaves(U,O,F,N,0),U},js.prototype.getTile=function(O,F,N){var U=this.trees[this._limitZoom(O)],X=Math.pow(2,O),Z=this.options,Ae=Z.extent,Re=Z.radius,Be=Re/Ae,Je=(N-Be)/X,Xe=(N+1+Be)/X,_t={features:[]};return this._addTileFeatures(U.range((F-Be)/X,Je,(F+1+Be)/X,Xe),U.points,F,N,X,_t),F===0&&this._addTileFeatures(U.range(1-Be/X,Je,1,Xe),U.points,X,N,X,_t),F===X-1&&this._addTileFeatures(U.range(0,Je,Be/X,Xe),U.points,-1,N,X,_t),_t.features.length?_t:null},js.prototype.getClusterExpansionZoom=function(O){for(var F=this._getOriginZoom(O)-1;F<=this.options.maxZoom;){var N=this.getChildren(O);if(F++,N.length!==1)break;O=N[0].properties.cluster_id}return F},js.prototype._appendLeaves=function(O,F,N,U,X){for(var Z=this.getChildren(F),Ae=0,Re=Z;Ae<Re.length;Ae+=1){var Be=Re[Ae],Je=Be.properties;if(Je&&Je.cluster?X+Je.point_count<=U?X+=Je.point_count:X=this._appendLeaves(O,Je.cluster_id,N,U,X):X<U?X++:O.push(Be),O.length===N)break}return X},js.prototype._addTileFeatures=function(O,F,N,U,X,Z){for(var Ae=0,Re=O;Ae<Re.length;Ae+=1){var Be=Re[Ae],Je=F[Be],Xe=Je.numPoints,_t={type:1,geometry:[[Math.round(this.options.extent*(Je.x*X-N)),Math.round(this.options.extent*(Je.y*X-U))]],tags:Xe?Yd(Je):this.points[Je.index].properties},rt=void 0;Xe?rt=Je.id:this.options.generateId?rt=Je.index:this.points[Je.index].id&&(rt=this.points[Je.index].id),rt!==void 0&&(_t.id=rt),Z.features.push(_t)}},js.prototype._limitZoom=function(O){return Math.max(this.options.minZoom,Math.min(+O,this.options.maxZoom+1))},js.prototype._cluster=function(O,F){for(var N=[],U=this.options,X=U.radius,Z=U.extent,Ae=U.reduce,Re=U.minPoints,Be=X/(Z*Math.pow(2,F)),Je=0;Je<O.length;Je++){var Xe=O[Je];if(!(Xe.zoom<=F)){Xe.zoom=F;for(var _t=this.trees[F+1],rt=_t.within(Xe.x,Xe.y,Be),Ht=Xe.numPoints||1,Yt=Ht,ne=0,ye=rt;ne<ye.length;ne+=1){var Ue=ye[ne],Bt=_t.points[Ue];Bt.zoom>F&&(Yt+=Bt.numPoints||1)}if(Yt>=Re){for(var $t=Xe.x*Ht,ee=Xe.y*Ht,Se=Ae&&Ht>1?this._map(Xe,!0):null,Ze=(Je<<5)+(F+1)+this.points.length,Ct=0,vr=rt;Ct<vr.length;Ct+=1){var Cr=vr[Ct],Jr=_t.points[Cr];if(!(Jr.zoom<=F)){Jr.zoom=F;var nn=Jr.numPoints||1;$t+=Jr.x*nn,ee+=Jr.y*nn,Jr.parentId=Ze,Ae&&(Se||(Se=this._map(Xe,!0)),Ae(Se,this._map(Jr)))}}Xe.parentId=Ze,N.push(fg($t/Yt,ee/Yt,Ze,Yt,Se))}else if(N.push(Xe),Yt>1)for(var Dn=0,si=rt;Dn<si.length;Dn+=1){var An=si[Dn],qi=_t.points[An];qi.zoom<=F||(qi.zoom=F,N.push(qi))}}}return N},js.prototype._getOriginId=function(O){return O-this.points.length>>5},js.prototype._getOriginZoom=function(O){return(O-this.points.length)%32},js.prototype._map=function(O,F){if(O.numPoints)return F?Kf({},O.properties):O.properties;var N=this.points[O.index].properties,U=this.options.map(N);return F&&U===N?Kf({},U):U};function fg(B,O,F,N,U){return{x:B,y:O,zoom:1/0,id:F,parentId:-1,numPoints:N,properties:U}}function dg(B,O){var F=B.geometry.coordinates,N=F[0],U=F[1];return{x:vg(N),y:qf(U),zoom:1/0,index:O,parentId:-1}}function Xd(B){return{type:"Feature",id:B.id,properties:Yd(B),geometry:{type:"Point",coordinates:[Zf(B.x),pg(B.y)]}}}function Yd(B){var O=B.numPoints,F=O>=1e4?Math.round(O/1e3)+"k":O>=1e3?Math.round(O/100)/10+"k":O;return Kf(Kf({},B.properties),{cluster:!0,cluster_id:B.id,point_count:O,point_count_abbreviated:F})}function vg(B){return B/360+.5}function qf(B){var O=Math.sin(B*Math.PI/180),F=.5-.25*Math.log((1+O)/(1-O))/Math.PI;return F<0?0:F>1?1:F}function Zf(B){return(B-.5)*360}function pg(B){var O=(180-B*360)*Math.PI/180;return 360*Math.atan(Math.exp(O))/Math.PI-90}function Kf(B,O){for(var F in O)B[F]=O[F];return B}function of(B){return B.x}function X0(B){return B.y}typeof window<"u"&&requestAnimationFrame(Y0);function Y0(B){requestAnimationFrame(Y0),Pn.update(B)}var Kl=function(){function B(O,F,N){h(this,B),F instanceof g||(F=new g(F)),this.dataSet=F,this.map=O,N.draw==="cluster"&&this.refreshCluster(N)}return c(B,[{key:"refreshCluster",value:function(F){F=F||this.options,this.supercluster=new js({maxZoom:F.maxZoom||19,radius:F.clusterRadius||100,minPoints:F.minPoints||2,extent:F.extent||512}),this.supercluster.load(this.dataSet.get()),this.supercluster.trees.forEach(function(N){var U=0,X=1/0;N.points.forEach(function(Z){U=Math.max(Z.numPoints||0,U),X=Math.min(Z.numPoints||1/0,X)}),N.max=U,N.min=X}),this.clusterDataSet=new g}},{key:"getDefaultContextConfig",value:function(){return{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0,strokeStyle:"#000000",fillStyle:"#000000",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0)",lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,lineDashOffset:0,font:"10px sans-serif",textAlign:"start",textBaseline:"alphabetic"}}},{key:"initDataRange",value:function(F){var N=this;if(N.intensity=new w({maxSize:N.options.maxSize,minSize:N.options.minSize,gradient:N.options.gradient,max:N.options.max||this.dataSet.getMax("count")}),N.category=new vo(N.options.splitList),N.choropleth=new No(N.options.splitList),N.options.splitList===void 0&&N.category.generateByDataSet(this.dataSet,N.options.color),N.options.splitList===void 0){var U=N.options.min||this.dataSet.getMin("count"),X=N.options.max||this.dataSet.getMax("count");N.choropleth.generateByMinMax(U,X)}}},{key:"getLegend",value:function(F){this.options.draw;var N=this;if(N.options.draw=="intensity"||N.options.draw=="heatmap")return this.intensity.getLegend(F);if(N.options.draw=="category")return this.category.getLegend(F)}},{key:"processData",value:function(F){var N=this,U=N.options.draw;if(U=="bubble"||U=="intensity"||U=="category"||U=="choropleth"||U=="simple")for(var X=0;X<F.length;X++){var Z=F[X];N.options.draw=="bubble"?F[X]._size=N.intensity.getSize(Z.count):F[X]._size=void 0;var Ae="_fillStyle";(F[X].geometry.type==="LineString"||N.options.styleType==="stroke")&&(Ae="_strokeStyle"),N.options.draw=="intensity"?F[X][Ae]=N.intensity.getColor(Z.count):N.options.draw=="category"?F[X][Ae]=N.category.get(Z.count):N.options.draw=="choropleth"&&(F[X][Ae]=N.choropleth.get(Z.count))}}},{key:"isEnabledTime",value:function(){var F=this.options.animation,N=F&&F.enabled!==!1;return N}},{key:"argCheck",value:function(F){F.draw=="heatmap"&&F.strokeStyle&&console.warn("[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]")}},{key:"drawContext",value:function(F,N,U,X){var Z=this;switch(Z.options.draw){case"heatmap":k.draw(F,N,Z.options);break;case"grid":case"cluster":case"honeycomb":Z.options.offset={x:X.x,y:X.y},Z.options.draw==="grid"?D.draw(F,N,Z.options):Z.options.draw==="cluster"?nt.draw(F,N,Z.options):W.draw(F,N,Z.options);break;case"text":ot.draw(F,N,Z.options);break;case"icon":Wr.draw(F,N,Z.options);break;case"clip":pe.draw(F,N,Z.options);break;default:Z.options.context=="webgl"?Gi.draw(Z.canvasLayer.canvas.getContext("webgl"),N,Z.options):x.draw(F,N,Z.options)}Z.options.arrow&&Z.options.arrow.show!==!1&&xe.draw(F,N,Z.options)}},{key:"isPointInPath",value:function(U,N){var U=this.canvasLayer.canvas.getContext(this.context),X;this.options.draw==="cluster"&&(!this.options.maxClusterZoom||this.options.maxClusterZoom>=this.getZoom())?X=this.clusterDataSet.get():X=this.dataSet.get();for(var Z=0;Z<X.length;Z++){U.beginPath();var Ae=this.options,Re=N.x*this.canvasLayer.devicePixelRatio,Be=N.y*this.canvasLayer.devicePixelRatio;Ae.multiPolygonDraw=function(){if(U.isPointInPath(Re,Be))return X[Z]},_.draw(U,X[Z],Ae);var Je=X[Z].geometry&&X[Z].geometry.type;if(Je.indexOf("LineString")>-1){if(U.isPointInStroke&&U.isPointInStroke(Re,Be))return X[Z]}else if(U.isPointInPath(Re,Be))return X[Z]}}},{key:"getClusterPoints",value:function(F){var N=this;if(F.type!=="Feature")return[];var U=this.supercluster.getChildren(F.id);return U.map(function(X){return X.type==="Feature"?N.getClusterPoints(X):X}).flat()}},{key:"clickEvent",value:function(F,N){if(!!this.options.methods){var U=this.isPointInPath(this.getContext(),F);if(U){if(this.options.draw==="cluster"){var X=this.getClusterPoints(U);U.children=X}this.options.methods.click(U,N)}else this.options.methods.click(null,N)}}},{key:"mousemoveEvent",value:function(F,N){if(!!this.options.methods){var U=this.isPointInPath(this.getContext(),F);if(U){if(this.options.draw==="cluster"){var X=this.getClusterPoints(U);U.children=X}this.options.methods.mousemove(U,N)}else this.options.methods.mousemove(null,N)}}},{key:"tapEvent",value:function(F,N){if(!!this.options.methods){var U=this.isPointInPath(this.getContext(),F);if(U){if(this.options.draw==="cluster"){var X=this.getClusterPoints(U);U.children=X}this.options.methods.tap(U,N)}else this.options.methods.tap(null,N)}}},{key:"update",value:function(F,N){var U=this,X=F.options,Z=U.options;for(var Ae in X)Z[Ae]=X[Ae];U.init(Z),N!==!1&&U.draw()}},{key:"setOptions",value:function(F){var N=this;N.dataSet.reset(),N.init(F),N.draw()}},{key:"set",value:function(F){var N=this,U=this.getContext(),X=this.getDefaultContextConfig();for(var Z in X)U[Z]=X[Z];N.init(F.options),N.draw()}},{key:"destroy",value:function(){this.unbindEvent(),this.hide()}},{key:"initAnimator",value:function(){var F=this,N=F.options.animation;if(F.options.draw=="time"||F.isEnabledTime()){N.stepsRange||(N.stepsRange={start:this.dataSet.getMin("time")||0,end:this.dataSet.getMax("time")||0}),this.steps={step:N.stepsRange.start},F.animator=new Pn.Tween(this.steps).onUpdate(function(){F._canvasUpdate(this.step)}).repeat(1/0),this.addAnimatorEvent();var U=N.duration*1e3||5e3;F.animator.to({step:N.stepsRange.end},U),F.animator.start()}else F.animator&&F.animator.stop()}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var F=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=F.stepsRange.start,this.animator.stop())}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator&&this.animator.start()}}]),B}(),sf=typeof window>"u"?{}:window,mu=sf.BMap||sf.BMapGL,bs=function(B){d(O,B);function O(F,N,U){h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));X.map=F,X.options=U||{},X.dataSet=N;var Z=new Lo({map:F,zIndex:X.options.zIndex,update:X._canvasUpdate.bind(X)});X.init(X.options),X.canvasLayer=Z,X.transferToMercator();var Ae=X;return N.on("change",function(){Ae.transferToMercator(),Z.draw()}),X.ctx=Z.canvas.getContext("2d"),X.start(),X}return c(O,[{key:"draw",value:function(){this.canvasLayer.draw()}},{key:"init",value:function(N){var U=this;U.options=N,this.initDataRange(N),this.context=U.options.context||"2d",U.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(U.options.zIndex),U.options.max&&this.intensity.setMax(U.options.max),U.options.min&&this.intensity.setMin(U.options.min),this.initAnimator()}},{key:"transferToMercator",value:function(){var N=this.map,U=N.getMapType(),X;if(U.getProjection?X=U.getProjection():X={lngLatToPoint:function(Re){var Be=N.lnglatToMercator(Re.lng,Re.lat);return{x:Be[0],y:Be[1]}}},this.options.coordType!=="bd09mc"){var Z=this.dataSet.get();Z=this.dataSet.transferCoordinate(Z,function(Ae){var Re=X.lngLatToPoint({lng:Ae[0],lat:Ae[1]});return[Re.x,Re.y]},"coordinates","coordinates_mercator"),this.dataSet._set(Z)}}},{key:"_canvasUpdate",value:function(){var N=this.ctx;if(!!N){var U=this.map,X,Z;U.getMapType().getProjection?(X=U.getMapType().getProjection(),Z=X.lngLatToPoint(U.getCenter())):(Z={x:U.getCenter().lng,y:U.getCenter().lat},Z.x>-180&&Z.x<180&&(Z=U.lnglatToMercator(Z.x,Z.y),Z={x:Z[0],y:Z[1]}),X={lngLatToPoint:function(Xe){var _t=U.lnglatToMercator(Xe.lng,Xe.lat);return{x:_t[0],y:_t[1]}}});var Ae;X.getZoomUnits?Ae=X.getZoomUnits(U.getZoom()):Ae=Math.pow(2,18-U.getZoom());var Re=new mu.Pixel(Z.x-U.getSize().width/2*Ae,Z.y+U.getSize().height/2*Ae);i(N);var Be={fromColumn:this.options.coordType=="bd09mc"?"coordinates":"coordinates_mercator",transferCoordinate:function(Xe){if(!!Xe){var _t=(Xe[0]-Re.x)/Ae,rt=(Re.y-Xe[1])/Ae;return[_t,rt]}}};this.data=this.dataSet.get(Be),this.processData(this.data),this.drawAnimation()}}},{key:"drawAnimation",value:function(){var N=this.ctx,U=this.data;if(!!U){N.save(),N.globalCompositeOperation="destination-out",N.fillStyle="rgba(0, 0, 0, .1)",N.fillRect(0,0,N.canvas.width,N.canvas.height),N.restore(),N.save(),this.options.shadowColor&&(N.shadowColor=this.options.shadowColor),this.options.shadowBlur&&(N.shadowBlur=this.options.shadowBlur),this.options.globalAlpha&&(N.globalAlpha=this.options.globalAlpha),this.options.globalCompositeOperation&&(N.globalCompositeOperation=this.options.globalCompositeOperation);for(var X=this.options,Z=0;Z<U.length;Z++)if(U[Z].geometry.type==="Point"){N.beginPath();var Ae=U[Z].size||this.options.size,Re=U[Z].minSize||this.options.minSize||0;U[Z]._size===void 0&&(U[Z]._size=Re),N.arc(U[Z].geometry._coordinates[0],U[Z].geometry._coordinates[1],U[Z]._size,0,Math.PI*2,!0),N.closePath(),U[Z]._size++,U[Z]._size>Ae&&(U[Z]._size=Re),N.lineWidth=1,N.strokeStyle=U[Z].strokeStyle||U[Z]._strokeStyle||X.strokeStyle||"yellow",N.stroke();var Be=U[Z].fillStyle||U[Z]._fillStyle||X.fillStyle;Be&&(N.fillStyle=Be,N.fill())}else if(U[Z].geometry.type==="LineString"){N.beginPath();var Je=U[Z].size||this.options.size||5,Re=U[Z].minSize||this.options.minSize||0;U[Z]._index===void 0&&(U[Z]._index=0);var Xe=U[Z]._index;N.arc(U[Z].geometry._coordinates[Xe][0],U[Z].geometry._coordinates[Xe][1],Je,0,Math.PI*2,!0),N.closePath(),U[Z]._index++,U[Z]._index>=U[Z].geometry._coordinates.length&&(U[Z]._index=0);var _t=U[Z].strokeStyle||X.strokeStyle,Be=U[Z].fillStyle||X.fillStyle||"yellow";N.fillStyle=Be,N.fill(),_t&&X.lineWidth&&(N.lineWidth=X.lineWidth||1,N.strokeStyle=_t,N.stroke())}N.restore()}}},{key:"animate",value:function(){this.drawAnimation();var N=this.options.animateTime||100;this.timeout=setTimeout(this.animate.bind(this),N)}},{key:"start",value:function(){this.stop(),this.animate()}},{key:"stop",value:function(){clearTimeout(this.timeout)}},{key:"unbindEvent",value:function(){}},{key:"hide",value:function(){this.canvasLayer.hide(),this.stop()}},{key:"show",value:function(){this.start()}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"destroy",value:function(){this.stop(),this.unbindEvent(),this.clearData(),this.map.removeOverlay(this.canvasLayer),this.canvasLayer=null}}]),O}(Kl),lf=typeof window>"u"?{}:window,gg=lf.BMap||lf.BMapGL,Wm=function(B){d(O,B);function O(F,N,U){h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U)),Z=X;U=U||{},X.clickEvent=X.clickEvent.bind(X),X.mousemoveEvent=X.mousemoveEvent.bind(X),X.tapEvent=X.tapEvent.bind(X),Z.init(U),Z.argCheck(U),Z.transferToMercator();var Ae=X.canvasLayer=new Lo({map:F,context:X.context,updateImmediate:U.updateImmediate,paneName:U.paneName,mixBlendMode:U.mixBlendMode,enableMassClear:U.enableMassClear,zIndex:U.zIndex,update:function(){Z._canvasUpdate()}});return N.on("change",function(){Z.transferToMercator(),U.draw==="cluster"&&Z.refreshCluster(),Ae.draw()}),X}return c(O,[{key:"clickEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,U,N)}},{key:"mousemoveEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"tapEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"tapEvent",this).call(this,U,N)}},{key:"bindEvent",value:function(N){this.unbindEvent();var U=this.map,X=0,Z=this;this.options.methods&&(this.options.methods.click&&(U.setDefaultCursor("default"),U.addEventListener("click",this.clickEvent)),this.options.methods.mousemove&&U.addEventListener("mousemove",this.mousemoveEvent),"ontouchend"in window.document&&this.options.methods.tap&&(U.addEventListener("touchstart",function(Ae){X=new Date}),U.addEventListener("touchend",function(Ae){new Date-X<300&&Z.tapEvent(Ae)})))}},{key:"unbindEvent",value:function(N){var U=this.map;this.options.methods&&(this.options.methods.click&&U.removeEventListener("click",this.clickEvent),this.options.methods.mousemove&&U.removeEventListener("mousemove",this.mousemoveEvent))}},{key:"transferToMercator",value:function(N){N||(N=this.dataSet);var U=this.map,X=U.getMapType(),Z;if(X.getProjection?Z=X.getProjection():Z={lngLatToPoint:function(Be){var Je=U.lnglatToMercator(Be.lng,Be.lat);return{x:Je[0],y:Je[1]}}},this.options.coordType!=="bd09mc"){var Ae=N.get();Ae=N.transferCoordinate(Ae,function(Re){if(Re[0]<-180||Re[0]>180||Re[1]<-90||Re[1]>90)return Re;var Be=Z.lngLatToPoint({lng:Re[0],lat:Re[1]});return[Be.x,Be.y]},"coordinates","coordinates_mercator"),N._set(Ae)}}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(N){if(!!this.canvasLayer){var U=this,X=this.options.animation,Z=this.canvasLayer._map,Ae,Re;Z.getMapType().getProjection?(Ae=Z.getMapType().getProjection(),Re=Ae.lngLatToPoint(Z.getCenter())):(Re={x:Z.getCenter().lng,y:Z.getCenter().lat},Re.x>-180&&Re.x<180&&(Re=Z.lnglatToMercator(Re.x,Re.y),Re={x:Re[0],y:Re[1]}),Ae={lngLatToPoint:function(nn){var Dn=Z.lnglatToMercator(nn.lng,nn.lat);return{x:Dn[0],y:Dn[1]}}});var Be;Ae.getZoomUnits?Be=Ae.getZoomUnits(Z.getZoom()):Be=Math.pow(2,18-Z.getZoom());var Je=new gg.Pixel(Re.x-Z.getSize().width/2*Be,Re.y+Z.getSize().height/2*Be),Xe=this.getContext();if(this.isEnabledTime()){if(N===void 0){i(Xe);return}this.context=="2d"&&(Xe.save(),Xe.globalCompositeOperation="destination-out",Xe.fillStyle="rgba(0, 0, 0, .1)",Xe.fillRect(0,0,Xe.canvas.width,Xe.canvas.height),Xe.restore())}else i(Xe);if(this.context=="2d")for(var _t in this.options)Xe[_t]=this.options[_t];else Xe.clear(Xe.COLOR_BUFFER_BIT);if(!(this.options.minZoom&&Z.getZoom()<this.options.minZoom||this.options.maxZoom&&Z.getZoom()>this.options.maxZoom)){var rt=1;this.context!="2d"&&(rt=this.canvasLayer.devicePixelRatio);var Ht={fromColumn:this.options.coordType=="bd09mc"?"coordinates":"coordinates_mercator",transferCoordinate:function(nn){var Dn=(nn[0]-Je.x)/Be*rt,si=(Je.y-nn[1])/Be*rt;return[Dn,si]}};N!==void 0&&(Ht.filter=function(Jr){var nn=X.trails||10;return!!(N&&Jr.time>N-nn&&Jr.time<N)});var Yt,ne=this.getZoom();if(this.options.draw==="cluster"&&(!this.options.maxClusterZoom||this.options.maxClusterZoom>=ne)){var ye=this.map.getBounds(),Ue=ye.getNorthEast(),Bt=ye.getSouthWest(),$t=this.supercluster.getClusters([Bt.lng,Bt.lat,Ue.lng,Ue.lat],ne);this.pointCountMax=this.supercluster.trees[ne].max,this.pointCountMin=this.supercluster.trees[ne].min;var ee={},Se=null,Ze=null;this.pointCountMax===this.pointCountMin?(Se=this.options.fillStyle,Ze=this.options.minSize||8):ee=new w({min:this.pointCountMin,max:this.pointCountMax,minSize:this.options.minSize||8,maxSize:this.options.maxSize||30,gradient:this.options.gradient});for(var Ct=0;Ct<$t.length;Ct++){var vr=$t[Ct];vr.properties&&vr.properties.cluster_id?($t[Ct].size=Ze||ee.getSize(vr.properties.point_count),$t[Ct].fillStyle=Se||ee.getColor(vr.properties.point_count)):$t[Ct].size=U.options.size}this.clusterDataSet.set($t),this.transferToMercator(this.clusterDataSet),Yt=U.clusterDataSet.get(Ht)}else Yt=U.dataSet.get(Ht);this.processData(Yt);var Cr=Z.pointToPixel(new gg.Point(0,0));U.options.unit=="m"?(U.options.size&&(U.options._size=U.options.size/Be),U.options.width&&(U.options._width=U.options.width/Be),U.options.height&&(U.options._height=U.options.height/Be)):(U.options._size=U.options.size,U.options._height=U.options.height,U.options._width=U.options.width),this.drawContext(Xe,Yt,U.options,Cr),U.options.updateCallback&&U.options.updateCallback(N)}}}},{key:"init",value:function(N){var U=this;U.options=N,this.initDataRange(N),this.context=U.options.context||"2d",U.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(U.options.zIndex),U.options.max&&this.intensity.setMax(U.options.max),U.options.min&&this.intensity.setMin(U.options.min),this.initAnimator(),this.bindEvent()}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"addAnimatorEvent",value:function(){this.map.addEventListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addEventListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer),this.bindEvent()}},{key:"hide",value:function(){this.unbindEvent(),this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){this.canvasLayer&&this.canvasLayer.draw()}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"destroy",value:function(){this.unbindEvent(),this.clearData(),this.map.removeOverlay(this.canvasLayer),this.canvasLayer=null}}]),O}(Kl);function ho(B){this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=ho.DEFAULT_PANE_NAME_,this.updateHandler_=null,this.resizeHandler_=null,this.topLeft_=null,this.centerListener_=null,this.resizeListener_=null,this.needsResize_=!0,this.requestAnimationFrameId_=null;var O=document.createElement("canvas");O.style.position="absolute",O.style.top=0,O.style.left=0,O.style.pointerEvents="none",this.canvas=O,this.canvasCssWidth_=300,this.canvasCssHeight_=150,this.resolutionScale_=1;function F(N,U){return function(){U.apply(N)}}this.repositionFunction_=F(this,this.repositionCanvas_),this.resizeFunction_=F(this,this.resize_),this.requestUpdateFunction_=F(this,this.update_),B&&this.setOptions(B)}var Es=typeof window>"u"?{}:window;Es.google&&Es.google.maps&&(ho.prototype=new google.maps.OverlayView,ho.DEFAULT_PANE_NAME_="overlayLayer",ho.CSS_TRANSFORM_=function(){for(var B=document.createElement("div"),O=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],F=0;F<O.length;F++){var N=O[F];if(B.style[N]!==void 0)return N}return O[0]}(),ho.prototype.requestAnimFrame_=Es.requestAnimationFrame||Es.webkitRequestAnimationFrame||Es.mozRequestAnimationFrame||Es.oRequestAnimationFrame||Es.msRequestAnimationFrame||function(B){return Es.setTimeout(B,1e3/60)},ho.prototype.cancelAnimFrame_=Es.cancelAnimationFrame||Es.webkitCancelAnimationFrame||Es.mozCancelAnimationFrame||Es.oCancelAnimationFrame||Es.msCancelAnimationFrame||function(B){},ho.prototype.setOptions=function(B){B.animate!==void 0&&this.setAnimate(B.animate),B.paneName!==void 0&&this.setPaneName(B.paneName),B.updateHandler!==void 0&&this.setUpdateHandler(B.updateHandler),B.resizeHandler!==void 0&&this.setResizeHandler(B.resizeHandler),B.resolutionScale!==void 0&&this.setResolutionScale(B.resolutionScale),B.map!==void 0&&this.setMap(B.map)},ho.prototype.setAnimate=function(B){this.isAnimated_=!!B,this.isAnimated_&&this.scheduleUpdate()},ho.prototype.isAnimated=function(){return this.isAnimated_},ho.prototype.setPaneName=function(B){this.paneName_=B,this.setPane_()},ho.prototype.getPaneName=function(){return this.paneName_},ho.prototype.setPane_=function(){if(!!this.isAdded_){var B=this.getPanes();if(!B[this.paneName_])throw new Error('"'+this.paneName_+'" is not a valid MapPane name.');B[this.paneName_].appendChild(this.canvas)}},ho.prototype.setResizeHandler=function(B){this.resizeHandler_=B},ho.prototype.setResolutionScale=function(B){typeof B=="number"&&(this.resolutionScale_=B,this.resize_())},ho.prototype.setUpdateHandler=function(B){this.updateHandler_=B},ho.prototype.onAdd=function(){this.isAdded_||(this.isAdded_=!0,this.setPane_(),this.resizeListener_=google.maps.event.addListener(this.getMap(),"resize",this.resizeFunction_),this.centerListener_=google.maps.event.addListener(this.getMap(),"center_changed",this.repositionFunction_),this.resize_(),this.repositionCanvas_())},ho.prototype.onRemove=function(){!this.isAdded_||(this.isAdded_=!1,this.topLeft_=null,this.canvas.parentElement.removeChild(this.canvas),this.centerListener_&&(google.maps.event.removeListener(this.centerListener_),this.centerListener_=null),this.resizeListener_&&(google.maps.event.removeListener(this.resizeListener_),this.resizeListener_=null),this.requestAnimationFrameId_&&(this.cancelAnimFrame_.call(Es,this.requestAnimationFrameId_),this.requestAnimationFrameId_=null))},ho.prototype.resize_=function(){if(!!this.isAdded_){var B=this.getMap(),O=B.getDiv().offsetWidth,F=B.getDiv().offsetHeight,N=O*this.resolutionScale_,U=F*this.resolutionScale_,X=this.canvas.width,Z=this.canvas.height;(X!==N||Z!==U)&&(this.canvas.width=N,this.canvas.height=U,this.needsResize_=!0,this.scheduleUpdate()),(this.canvasCssWidth_!==O||this.canvasCssHeight_!==F)&&(this.canvasCssWidth_=O,this.canvasCssHeight_=F,this.canvas.style.width=O+"px",this.canvas.style.height=F+"px")}},ho.prototype.draw=function(){this.repositionCanvas_()},ho.prototype.repositionCanvas_=function(){var B=this.getMap(),O=B.getBounds().getNorthEast().lat(),F=B.getCenter(),N=Math.pow(2,B.getZoom()),U=F.lng()-this.canvasCssWidth_*180/(256*N);this.topLeft_=new google.maps.LatLng(O,U);var X=this.getProjection(),Z=X.fromLatLngToDivPixel(F),Ae=-Math.round(this.canvasCssWidth_/2-Z.x),Re=-Math.round(this.canvasCssHeight_/2-Z.y);this.canvas.style[ho.CSS_TRANSFORM_]="translate("+Ae+"px,"+Re+"px)",this.scheduleUpdate()},ho.prototype.update_=function(){this.requestAnimationFrameId_=null,this.isAdded_&&(this.isAnimated_&&this.scheduleUpdate(),this.needsResize_&&this.resizeHandler_&&(this.needsResize_=!1,this.resizeHandler_()),this.updateHandler_&&this.updateHandler_())},ho.prototype.getTopLeft=function(){return this.topLeft_},ho.prototype.scheduleUpdate=function(){this.isAdded_&&!this.requestAnimationFrameId_&&(this.requestAnimationFrameId_=this.requestAnimFrame_.call(Es,this.requestUpdateFunction_))});var q0=function(B){d(O,B);function O(F,N,U){h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U)),Z=X;U=U||{},Z.init(U),Z.argCheck(U);var Ae={map:F,animate:!1,updateHandler:function(){Z._canvasUpdate()},resolutionScale};return X.canvasLayer=new ho(Ae),X.clickEvent=X.clickEvent.bind(X),X.mousemoveEvent=X.mousemoveEvent.bind(X),X.bindEvent(),X}return c(O,[{key:"clickEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,U,N)}},{key:"mousemoveEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"bindEvent",value:function(N){var U=this.map;this.options.methods&&(this.options.methods.click&&(U.setDefaultCursor("default"),U.addListener("click",this.clickEvent)),this.options.methods.mousemove&&U.addListener("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(N){var U=this.map;this.options.methods&&(this.options.methods.click&&U.removeListener("click",this.clickEvent),this.options.methods.mousemove&&U.removeListener("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(N){if(!!this.canvasLayer){var U=this,X=U.options.animation,Z=this.getContext();if(U.isEnabledTime()){if(N===void 0){i(Z);return}this.context=="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else i(Z);if(this.context=="2d")for(var Ae in U.options)Z[Ae]=U.options[Ae];else Z.clear(Z.COLOR_BUFFER_BIT);if(!(U.options.minZoom&&Re.getZoom()<U.options.minZoom||U.options.maxZoom&&Re.getZoom()>U.options.maxZoom)){var Je=1;this.context!="2d"&&(Je=this.canvasLayer.devicePixelRatio);var Re=this.map,Be=Re.getProjection(),Je=Math.pow(2,Re.zoom)*resolutionScale,Xe=Be.fromLatLngToPoint(this.canvasLayer.getTopLeft()),_t={transferCoordinate:function(Ue){var Bt=new google.maps.LatLng(Ue[1],Ue[0]),$t=Be.fromLatLngToPoint(Bt),ee={x:($t.x-Xe.x)*Je,y:($t.y-Xe.y)*Je};return[ee.x,ee.y]}};N!==void 0&&(_t.filter=function(ye){var Ue=X.trails||10;return!!(N&&ye.time>N-Ue&&ye.time<N)});var rt=U.dataSet.get(_t);this.processData(rt);var Ht=new google.maps.LatLng(0,0),Yt=Be.fromLatLngToPoint(Ht),ne={x:(Yt.x-Xe.x)*Je,y:(Yt.y-Xe.y)*Je};U.options.unit=="m"&&U.options.size?U.options._size=U.options.size/zoomUnit:U.options._size=U.options.size,this.drawContext(Z,new g(rt),U.options,ne),U.options.updateCallback&&U.options.updateCallback(N)}}}},{key:"init",value:function(N){var U=this;U.options=N,this.initDataRange(N),this.context=U.options.context||"2d",U.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(U.options.zIndex),this.initAnimator()}},{key:"addAnimatorEvent",value:function(){this.map.addListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer)}},{key:"hide",value:function(){this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){self.canvasLayer.draw()}}]),O}(Kl),tc=void 0;if(typeof maptalks<"u"){tc=function(B){d(O,B);function O(F,N,U){h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,U));return X.options_=U,X.dataSet=N,X._initBaseLayer(U),X}return c(O,[{key:"_initBaseLayer",value:function(N){var U=this,X=this.baseLayer=new Kl(null,this.dataSet,N);U.init(N),X.argCheck(N)}},{key:"clickEvent",value:function(N){if(!!this.baseLayer){var U=N.containerPoint;this.baseLayer.clickEvent(U,N.domEvent)}}},{key:"mousemoveEvent",value:function(N){if(!!this.baseLayer){var U=N.containerPoint;this.baseLayer.mousemoveEvent(U,N.domEvent)}}},{key:"getEvents",value:function(){return{click:this.clickEvent,mousemove:this.mousemoveEvent}}},{key:"init",value:function(N){var U=this.baseLayer;U.options=N,U.initDataRange(N),U.context=U.options.context||"2d",U.initAnimator()}},{key:"addAnimatorEvent",value:function(){this.map.addListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addListener("moveend",this.animatorMoveendEvent.bind(this))}}]),O}(maptalks.Layer);var Xs=function(B){d(O,B);function O(){return h(this,O),v(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return c(O,[{key:"needToRedraw",value:function(){var N=this.layer.baseLayer;return N.isEnabledTime()?!0:f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"needToRedraw",this).call(this)}},{key:"draw",value:function(){var N=this.layer.baseLayer;(!this.canvas||!N.isEnabledTime()||this._shouldClear)&&(this.prepareCanvas(),this._shouldClear=!1),this._update(this.gl||this.context,this._mapvFrameTime),delete this._mapvFrameTime,this.completeRender()}},{key:"drawOnInteracting",value:function(){this.draw(),this._shouldClear=!1}},{key:"onSkipDrawOnInteracting",value:function(){this._shouldClear=!0}},{key:"_canvasUpdate",value:function(N){this.setToRedraw(),this._mapvFrameTime=N}},{key:"_update",value:function(N,U){if(!!this.canvas){var X=this.layer.baseLayer,Z=X.options.animation,Ae=this.getMap();if(X.isEnabledTime()){if(U===void 0){i(N);return}X.context=="2d"&&(N.save(),N.globalCompositeOperation="destination-out",N.fillStyle="rgba(0, 0, 0, .1)",N.fillRect(0,0,N.canvas.width,N.canvas.height),N.restore())}else i(N);if(X.context=="2d")for(var Re in X.options)N[Re]=X.options[Re];else N.clear(N.COLOR_BUFFER_BIT);var Be=1,Je=new maptalks.Coordinate(0,0),Xe={fromColumn:X.options.coordType==="bd09mc"?"coordinates_mercator":"coordinates",transferCoordinate:function(ne){Je.x=ne[0],Je.y=ne[1];var ye=Ae.coordToContainerPoint(Je)._multi(Be).toArray();return ye}};U!==void 0&&(Xe.filter=function(Yt){var ne=Z.trails||10;return!!(U&&Yt.time>U-ne&&Yt.time<U)});var _t=X.dataSet.get(Xe);X.processData(_t),X.options.unit=="m"?(X.options.size&&(X.options._size=X.options.size/zoomUnit),X.options.width&&(X.options._width=X.options.width/zoomUnit),X.options.height&&(X.options._height=X.options.height/zoomUnit)):(X.options._size=X.options.size,X.options._height=X.options.height,X.options._width=X.options.width);var rt=new maptalks.Point(0,0),Ht=Ae._pointToContainerPoint(rt)._multi(Be);X.drawContext(N,_t,X.options,Ht),X.options.updateCallback&&X.options.updateCallback(U)}}},{key:"createCanvas",value:function(){if(!this.canvas){var N=this.getMap(),U=N.getSize(),X=N.getDevicePixelRatio?N.getDevicePixelRatio():maptalks.Browser.retina?2:1,Z=X*U.width,Ae=X*U.height;this.canvas=maptalks.Canvas.createCanvas(Z,Ae,N.CanvasClass);var Re=this.layer.baseLayer.context;if(Re==="2d")this.context=this.canvas.getContext("2d"),this.layer.options.globalCompositeOperation&&(this.context.globalCompositeOperation=this.layer.options.globalCompositeOperation),this.layer.baseLayer.options.draw!=="heatmap"&&X!==1&&this.context.scale(X,X);else{var Be={alpha:!0,preserveDrawingBuffer:!0,antialias:!1};this.gl=this.canvas.getContext("webgl",Be)}this.onCanvasCreate(),this._bindToMapv(),this.layer.fire("canvascreate",{context:this.context,gl:this.gl})}}},{key:"_bindToMapv",value:function(){var N=this.layer.baseLayer,U=this.getMap();this.devicePixelRatio=U.getDevicePixelRatio?U.getDevicePixelRatio():maptalks.Browser.retina?2:1,N.canvasLayer=this,N._canvasUpdate=this._canvasUpdate.bind(this),N.getContext=function(){var X=self.getRenderer();return X.gl||X.context}}}]),O}(maptalks.renderer.CanvasRenderer);tc.registerRenderer("canvas",Xs)}var Hm=tc,zv=function(O,F,N){if(typeof document<"u"){var U=document.createElement("canvas");return U.width=O,U.height=F,U}else return new N(O,F)},bc=function(B){d(O,B);function O(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,N=arguments[1],U=arguments[2];h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));return X.options=U,X.canvasLayer={canvas:null,devicePixelRatio:window.devicePixelRatio},X.layer_=null,X.initDataRange(U),X.initAnimator(),X.onEvents(),F.on("complete",function(){this.init(F,U),this.argCheck(U)},X),X}return c(O,[{key:"init",value:function(N,U){if(N)this.map=N,this.context=this.options.context||"2d",this.getCanvasLayer();else throw new Error("not map object")}},{key:"_canvasUpdate",value:function(N){this.render(this.canvasLayer.canvas,N)}},{key:"render",value:function(N,U){if(!!N){var X=this.map,Z=N.getContext(this.context),Ae=this.options.animation;if(this.isEnabledTime()){if(U===void 0)return i(Z),this;this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else i(Z);if(this.context==="2d")for(var Re in this.options)Z[Re]=this.options[Re];else Z.clear(Z.COLOR_BUFFER_BIT);var Be={transferCoordinate:function(_t){var rt=X.lngLatToContainer(new AMap.LngLat(_t[0],_t[1]));return[rt.x,rt.y]}};U!==void 0&&(Be.filter=function(Xe){var _t=Ae.trails||10;return!!(U&&Xe.time>U-_t&&Xe.time<U)});var Je=this.dataSet.get(Be);return this.processData(Je),this.options.unit==="m"?(this.options.size&&(this.options._size=this.options.size/zoomUnit),this.options.width&&(this.options._width=this.options.width/zoomUnit),this.options.height&&(this.options._height=this.options.height/zoomUnit)):(this.options._size=this.options.size,this.options._height=this.options.height,this.options._width=this.options.width),this.drawContext(Z,new g(Je),this.options,{x:0,y:0}),this.options.updateCallback&&this.options.updateCallback(U),this}}},{key:"getCanvasLayer",value:function(){if(!this.canvasLayer.canvas&&!this.layer_){var N=this.canvasFunction(),U=this.map.getBounds();this.layer_=new AMap.CanvasLayer({canvas:N,bounds:this.options.bounds||U,zooms:this.options.zooms||[0,22]}),this.layer_.setMap(this.map),this.map.on("mapmove",this.canvasFunction,this),this.map.on("zoomchange",this.canvasFunction,this)}}},{key:"canvasFunction",value:function(){var N=[this.map.getSize().width,this.map.getSize().height],U=N[0],X=N[1];if(!this.canvasLayer.canvas)this.canvasLayer.canvas=zv(U,X);else{this.canvasLayer.canvas.width=U,this.canvasLayer.canvas.height=X;var Z=this.map.getBounds();this.layer_&&this.layer_.setBounds(this.options.bounds||Z)}return this.render(this.canvasLayer.canvas),this.canvasLayer.canvas}},{key:"removeLayer",value:function(){!this.map||(this.unEvents(),this.map.removeLayer(this.layer_),delete this.map,delete this.layer_,delete this.canvasLayer.canvas)}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"clickEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,U,N)}},{key:"mousemoveEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"addAnimatorEvent",value:function(){this.map.on("movestart",this.animatorMovestartEvent,this),this.map.on("moveend",this.animatorMoveendEvent,this)}},{key:"onEvents",value:function(){var N=this.map;this.unEvents(),this.options.methods&&(this.options.methods.click&&N.on("click",this.clickEvent,this),this.options.methods.mousemove&&N.on("mousemove",this.mousemoveEvent,this))}},{key:"unEvents",value:function(){var N=this.map;this.options.methods&&(this.options.methods.click&&N.off("click",this.clickEvent,this),this.options.methods.mousemove&&N.off("mousemove",this.mousemoveEvent,this))}}]),O}(Kl),yg=function(O,F){if(typeof document<"u"){var N=document.createElement("canvas");return N.width=O,N.height=F,N}},uf=function(B){d(O,B);function O(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,N=arguments[1],U=arguments[2];h(this,O);var X=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));return X.options=U,X.canvasLayer={canvas:null,devicePixelRatio:window.devicePixelRatio},X.layer_=null,X.previousCursor_=void 0,X.init(F,U),X.argCheck(U),X}return c(O,[{key:"init",value:function(N,U){if(N&&N instanceof ol.Map)this.$Map=N,this.context=this.options.context||"2d",this.getCanvasLayer(),this.initDataRange(U),this.initAnimator(),this.onEvents();else throw new Error("not map object")}},{key:"_canvasUpdate",value:function(N){this.render(this.canvasLayer.canvas,N)}},{key:"render",value:function(N,U){var X=this.$Map,Z=N.getContext(this.context),Ae=this.options.animation,Re=this.options.hasOwnProperty("projection")?this.options.projection:"EPSG:4326",Be=this.$Map.getView().getProjection().getCode();if(this.isEnabledTime()){if(U===void 0)return i(Z),this;this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else i(Z);if(this.context==="2d")for(var Je in this.options)Z[Je]=this.options[Je];else Z.clear(Z.COLOR_BUFFER_BIT);var Xe={};Xe.transferCoordinate=Re===Be?function(rt){return X.getPixelFromCoordinate(rt)}:function(rt){return X.getPixelFromCoordinate(ol.proj.transform(rt,Re,Be))},U!==void 0&&(Xe.filter=function(rt){var Ht=Ae.trails||10;return!!(U&&rt.time>U-Ht&&rt.time<U)});var _t=this.dataSet.get(Xe);return this.processData(_t),this.options.unit==="m"?(this.options.size&&(this.options._size=this.options.size/zoomUnit),this.options.width&&(this.options._width=this.options.width/zoomUnit),this.options.height&&(this.options._height=this.options.height/zoomUnit)):(this.options._size=this.options.size,this.options._height=this.options.height,this.options._width=this.options.width),this.drawContext(Z,new g(_t),this.options,{x:0,y:0}),this.options.updateCallback&&this.options.updateCallback(U),this}},{key:"getCanvasLayer",value:function(){if(!this.canvasLayer.canvas&&!this.layer_){var N=this.getMapExtent();this.layer_=new ol.layer.Image({layerName:this.options.layerName,minResolution:this.options.minResolution,maxResolution:this.options.maxResolution,zIndex:this.options.zIndex,extent:N,source:new ol.source.ImageCanvas({canvasFunction:this.canvasFunction.bind(this),projection:this.$Map.getView().getProjection().getCode(),ratio:this.options.hasOwnProperty("ratio")?this.options.ratio:1})}),this.$Map.addLayer(this.layer_),this.$Map.un("precompose",this.reRender,this),this.$Map.on("precompose",this.reRender,this)}}},{key:"reRender",value:function(){if(!!this.layer_){var N=this.getMapExtent();this.layer_.setExtent(N)}}},{key:"canvasFunction",value:function(N,U,X,Z,Ae){return this.canvasLayer.canvas?(this.canvasLayer.canvas.width=Z[0],this.canvasLayer.canvas.height=Z[1]):this.canvasLayer.canvas=yg(Z[0],Z[1]),this.render(this.canvasLayer.canvas),this.canvasLayer.canvas}},{key:"getMapExtent",value:function(){var N=this.$Map.getSize();return this.$Map.getView().calculateExtent(N)}},{key:"addTo",value:function(N){this.init(N,this.options)}},{key:"removeLayer",value:function(){!this.$Map||(this.unEvents(),this.$Map.un("precompose",this.reRender,this),this.$Map.removeLayer(this.layer_),delete this.$Map,delete this.layer_,delete this.canvasLayer.canvas)}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"clickEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,{x:U[0],y:U[1]},N)}},{key:"mousemoveEvent",value:function(N){var U=N.pixel;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,{x:U[0],y:U[1]},N)}},{key:"addAnimatorEvent",value:function(){this.$Map.on("movestart",this.animatorMovestartEvent,this),this.$Map.on("moveend",this.animatorMoveendEvent,this)}},{key:"onEvents",value:function(){var N=this.$Map;this.unEvents(),this.options.methods&&(this.options.methods.click&&N.on("click",this.clickEvent,this),this.options.methods.mousemove&&N.on("pointermove",this.mousemoveEvent,this))}},{key:"unEvents",value:function(){var N=this.$Map;this.options.methods&&(this.options.methods.click&&N.un("click",this.clickEvent,this),this.options.methods.pointermove&&N.un("pointermove",this.mousemoveEvent,this))}},{key:"setDefaultCursor",value:function(N,U){if(!!this.$Map){var X=this.$Map.getTargetElement();U?X.style.cursor!==N&&(this.previousCursor_=X.style.cursor,X.style.cursor=N):this.previousCursor_!==void 0&&(X.style.cursor=this.previousCursor_,this.previousCursor_=void 0)}}},{key:"show",value:function(){this.$Map.addLayer(this.layer_)}},{key:"hide",value:function(){this.$Map.removeLayer(this.layer_)}}]),O}(Kl),Ec=function(B){d(O,B);function O(F,N,U,X){h(this,O);var Z=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,U,X));if(!Kl)return v(Z);var Ae=Z;return X=X||{},Ae.init(X),Ae.argCheck(X),Z.canvasLayer=N,Z.clickEvent=Z.clickEvent.bind(Z),Z.mousemoveEvent=Z.mousemoveEvent.bind(Z),Z._moveStartEvent=Z.moveStartEvent.bind(Z),Z._moveEndEvent=Z.moveEndEvent.bind(Z),Z._zoomStartEvent=Z.zoomStartEvent.bind(Z),Z.bindEvent(),Z}return c(O,[{key:"clickEvent",value:function(N){var U=this.map.containerPointToLayerPoint([0,0]),X=this.devicePixelRatio=this.canvasLayer.devicePixelRatio=window.devicePixelRatio,Z=N.layerPoint;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,L.point((Z.x-U.x)/X,(Z.y-U.y)/X),N)}},{key:"mousemoveEvent",value:function(N){var U=N.layerPoint;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"bindEvent",value:function(){var N=this.map;this.options.methods&&(this.options.methods.click&&N.on("click",this.clickEvent),this.options.methods.mousemove&&N.on("mousemove",this.mousemoveEvent)),this.map.on("movestart",this._moveStartEvent),this.map.on("moveend",this._moveEndEvent),this.map.on("zoomstart",this._zoomStartEvent)}},{key:"destroy",value:function(){this.unbindEvent(),this.clearData(),this.animator&&this.animator.stop(),this.animator=null,this.canvasLayer=null}},{key:"unbindEvent",value:function(){var N=this.map;this.options.methods&&(this.options.methods.click&&N.off("click",this.clickEvent),this.options.methods.mousemove&&N.off("mousemove",this.mousemoveEvent)),this.map.off("movestart",this._moveStartEvent),this.map.off("moveend",this._moveEndEvent),this.map.off("zoomstart",this._zoomStartEvent)}},{key:"getContext",value:function(){return this.canvasLayer.getCanvas().getContext(this.context)}},{key:"addData",value:function(N,U){var X=N;N&&N.get&&(X=N.get()),this.dataSet.add(X),this.update({options:U})}},{key:"update",value:function(N){var U=N||{},X=U.data;X&&X.get&&(X=X.get()),X!=null&&this.dataSet.set(X),f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"update",this).call(this,{options:U.options})}},{key:"getData",value:function(){return this.dataSet}},{key:"removeData",value:function(N){if(!!this.dataSet){var U=this.dataSet.get({filter:function(Z){return N!=null&&typeof N=="function"?!N(Z):!0}});this.dataSet.set(U),this.update({options:null})}}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"_canvasUpdate",value:function(N){if(!!this.canvasLayer){var U=this,X=U.options.animation,Z=this.getContext(),Ae=this.map;if(U.isEnabledTime()){if(N===void 0){this.clear(Z);return}this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else this.clear(Z);if(this.context==="2d")for(var Re in U.options)Z[Re]=U.options[Re];else Z.clear(Z.COLOR_BUFFER_BIT);if(!(U.options.minZoom&&Ae.getZoom()<U.options.minZoom||U.options.maxZoom&&Ae.getZoom()>U.options.maxZoom)){var Be=Ae.getBounds(),Je=Be.getEast()-Be.getWest(),Xe=Be.getNorth()-Be.getSouth(),_t=Ae.getSize(),rt=Je/_t.x,Ht=Xe/_t.y,Yt=this.canvasLayer.getTopLeft(),ne=Ae.latLngToContainerPoint(Yt),ye={transferCoordinate:function(Se){var Ze;U.context==="2d"?Ze=Ae.latLngToContainerPoint(L.latLng(Se[1],Se[0])):Ze={x:(Se[0]-Yt.lng)/rt,y:(Yt.lat-Se[1])/Ht};var Ct={x:Ze.x-ne.x,y:Ze.y-ne.y};return[Ct.x,Ct.y]}};N!==void 0&&(ye.filter=function(ee){var Se=X.trails||10;return N&&ee.time>N-Se&&ee.time<N});var Ue=U.dataSet.get(ye);this.processData(Ue),U.options._size=U.options.size;var Bt=Ae.latLngToContainerPoint(L.latLng(0,0)),$t={x:Bt.x-ne.x,y:Bt.y-ne.y};this.drawContext(Z,Ue,U.options,$t),U.options.updateCallback&&U.options.updateCallback(N)}}}},{key:"init",value:function(N){var U=this;U.options=N,this.initDataRange(N),this.context=U.options.context||"2d",U.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(U.options.zIndex),this.initAnimator()}},{key:"addAnimatorEvent",value:function(){}},{key:"moveStartEvent",value:function(){var N=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=N.stepsRange.start,this._hide())}},{key:"moveEndEvent",value:function(){this.canvasLayer.draw(),this._show()}},{key:"zoomStartEvent",value:function(){this._hide()}},{key:"clear",value:function(N){N&&N.clearRect&&N.clearRect(0,0,N.canvas.width,N.canvas.height)}},{key:"_hide",value:function(){this.canvasLayer.canvas.style.display="none"}},{key:"_show",value:function(){this.canvasLayer.canvas.style.display="block"}},{key:"draw",value:function(){this.canvasLayer.draw()}}]),O}(Kl),mg;if(typeof L<"u"){var Uv=L.Layer.extend({options:{attributionPrefix:null,attribution:""},initialize:function(O,F,N){N=N||{},this.dataSet=O||{},this.mapVOptions=F||{},this.render=this.render.bind(this),L.Util.setOptions(this,N),this.options.attributionPrefix&&(this.options.attribution=this.options.attributionPrefix+this.options.attribution),this.canvas=this._createCanvas(),L.stamp(this)},onAdd:function(O){this._map=O;var F=this.getPane(),N=this.container=L.DomUtil.create("div","leaflet-layer leaflet-zoom-animated",F);N.appendChild(this.canvas);var U=O.getSize();N.style.width=U.x+"px",N.style.height=U.y+"px",this.renderer=new Ec(O,this,this.dataSet,this.mapVOptions),this.draw(),this.fire("loaded")},onRemove:function(){L.DomUtil.remove(this.container),this.renderer.destroy()},addData:function(O,F){this.renderer.addData(O,F)},update:function(O){this.renderer.update(O)},getData:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet},removeData:function(O){this.renderer&&this.renderer.removeData(O)},clearData:function(){this.renderer.clearData()},draw:function(){return this._reset()},setZIndex:function(O){this.canvas.style.zIndex=O},render:function(){this.renderer._canvasUpdate()},getCanvas:function(){return this.canvas},getContainer:function(){return this.container},getTopLeft:function(){var O=this._map,F;if(O){var N=O.getBounds();F=N.getNorthWest()}return F},_createCanvas:function(){var O=document.createElement("canvas");O.style.position="absolute",O.style.top=0+"px",O.style.left=0+"px",O.style.pointerEvents="none",O.style.zIndex=this.options.zIndex||600;var F=typeof window>"u"?{}:window,N=this.devicePixelRatio=F.devicePixelRatio;return(!this.mapVOptions.context||this.mapVOptions.context==="2d")&&O.getContext("2d").scale(N,N),O},_resize:function(){var O=this.canvas;if(!!O){var F=this._map,N=F.getSize();O.width=N.x,O.height=N.y,O.style.width=N.x+"px",O.style.height=N.y+"px";var U=F.getBounds(),X=F.latLngToLayerPoint(U.getNorthWest());L.DomUtil.setPosition(O,X)}},_reset:function(){this._resize(),this._render()},redraw:function(){this._resize(),this._render()},_render:function(){this.render()}});mg=function(O,F,N){return new Uv(O,F,N)}}var _h=mg,Vv=function(B){d(O,B);function O(F,N,U,X){h(this,O);var Z=v(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,F,N,U));return Kl?(Z.map=F,Z.scene=F.scene,Z.dataSet=N,U=U||{},Z.init(U),Z.argCheck(U),Z.initDevicePixelRatio(),Z.canvasLayer=X,Z.stopAniamation=!1,Z.animation=U.animation,Z.clickEvent=Z.clickEvent.bind(Z),Z.mousemoveEvent=Z.mousemoveEvent.bind(Z),Z.bindEvent(),Z):v(Z)}return c(O,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"clickEvent",value:function(N){var U=N.point;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"clickEvent",this).call(this,U,N)}},{key:"mousemoveEvent",value:function(N){var U=N.point;f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"mousemoveEvent",this).call(this,U,N)}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var N=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=N.stepsRange.start)}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator}},{key:"bindEvent",value:function(){this.map,this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}},{key:"unbindEvent",value:function(){var N=this.map;this.options.methods&&(this.options.methods.click&&N.off("click",this.clickEvent),this.options.methods.mousemove&&N.off("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"init",value:function(N){this.options=N,this.initDataRange(N),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"_canvasUpdate",value:function(N){this.map;var U=this.scene;if(this.canvasLayer&&!this.stopAniamation){var X=this.options.animation,Z=this.getContext();if(this.isEnabledTime()){if(N===void 0)return void this.clear(Z);this.context==="2d"&&(Z.save(),Z.globalCompositeOperation="destination-out",Z.fillStyle="rgba(0, 0, 0, .1)",Z.fillRect(0,0,Z.canvas.width,Z.canvas.height),Z.restore())}else this.clear(Z);if(this.context==="2d")for(var Ae in this.options)Z[Ae]=this.options[Ae];else Z.clear(Z.COLOR_BUFFER_BIT);var Re={transferCoordinate:function(_t){var rt=Cesium.Cartesian3.fromDegrees(_t[0],_t[1]),Ht=Cesium.SceneTransforms.wgs84ToWindowCoordinates(U,rt);return Ht==null?[-1,-1]:[Ht.x,Ht.y]}};N!==void 0&&(Re.filter=function(Xe){var _t=X.trails||10;return!!(N&&Xe.time>N-_t&&Xe.time<N)});var Be=this.dataSet.get(Re);this.processData(Be),this.options.unit=="m"&&this.options.size,this.options._size=this.options.size;var Je=Cesium.SceneTransforms.wgs84ToWindowCoordinates(U,Cesium.Cartesian3.fromDegrees(0,0));this.drawContext(Z,new g(Be),this.options,Je),this.options.updateCallback&&this.options.updateCallback(N)}}},{key:"updateData",value:function(N,U){var X=N;X&&X.get&&(X=X.get()),X!=null&&this.dataSet.set(X),f(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"update",this).call(this,{options:U})}},{key:"addData",value:function(N,U){var X=N;N&&N.get&&(X=N.get()),this.dataSet.add(X),this.update({options:U})}},{key:"getData",value:function(){return this.dataSet}},{key:"removeData",value:function(N){if(this.dataSet){var U=this.dataSet.get({filter:function(Z){return N==null||typeof N!="function"||!N(Z)}});this.dataSet.set(U),this.update({options:null})}}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"draw",value:function(){this.canvasLayer.draw()}},{key:"clear",value:function(N){N&&N.clearRect&&N.clearRect(0,0,N.canvas.width,N.canvas.height)}}]),O}(Kl),hf;if(typeof Cesium<"u"){var _u=0;Cesium;var $v=function(){function B(O,F,N,U){if(h(this,B),this.map=O,this.scene=O.scene,this.mapvBaseLayer=new Vv(O,F,N,this),this.mapVOptions=N,this.initDevicePixelRatio(),this.canvas=this._createCanvas(),this.render=this.render.bind(this),U)this.container=U;else{var X=O.container.querySelector(".cesium-viewer-cesiumWidgetContainer");this.container=X||O.container}this.addInnerContainer(),this.bindEvent(),this._reset()}return c(B,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"addInnerContainer",value:function(){this.container.appendChild(this.canvas)}},{key:"bindEvent",value:function(){var F=this;this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.scene.camera.moveStart.addEventListener(this.innerMoveStart,this),this.scene.camera.moveEnd.addEventListener(this.innerMoveEnd,this);var N=new Cesium.ScreenSpaceEventHandler(this.scene.canvas);N.setInputAction(function(U){F.innerMoveEnd()},Cesium.ScreenSpaceEventType.LEFT_UP),N.setInputAction(function(U){F.innerMoveEnd()},Cesium.ScreenSpaceEventType.MIDDLE_UP),this.handler=N}},{key:"unbindEvent",value:function(){this.scene.camera.moveStart.removeEventListener(this.innerMoveStart,this),this.scene.camera.moveEnd.removeEventListener(this.innerMoveEnd,this),this.scene.postRender.removeEventListener(this._reset,this),this.handler&&(this.handler.destroy(),this.handler=null)}},{key:"moveStartEvent",value:function(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMovestartEvent(),this.scene.postRender.addEventListener(this._reset,this))}},{key:"moveEndEvent",value:function(){this.mapvBaseLayer&&(this.scene.postRender.removeEventListener(this._reset,this),this.mapvBaseLayer.animatorMoveendEvent(),this._reset())}},{key:"zoomStartEvent",value:function(){this._unvisiable()}},{key:"zoomEndEvent",value:function(){this._unvisiable()}},{key:"addData",value:function(F,N){this.mapvBaseLayer!=null&&this.mapvBaseLayer.addData(F,N)}},{key:"updateData",value:function(F,N){this.mapvBaseLayer!=null&&this.mapvBaseLayer.updateData(F,N)}},{key:"getData",value:function(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}},{key:"removeData",value:function(F){this.mapvBaseLayer!=null&&this.mapvBaseLayer&&this.mapvBaseLayer.removeData(F)}},{key:"removeAllData",value:function(){this.mapvBaseLayer!=null&&this.mapvBaseLayer.clearData()}},{key:"_visiable",value:function(){return this.canvas.style.display="block",this}},{key:"_unvisiable",value:function(){return this.canvas.style.display="none",this}},{key:"_createCanvas",value:function(){var F=document.createElement("canvas");F.id=this.mapVOptions.layerid||"mapv"+_u++,F.style.position="absolute",F.style.top="0px",F.style.left="0px",F.style.pointerEvents="none",F.style.zIndex=this.mapVOptions.zIndex||0,F.width=parseInt(this.map.canvas.width),F.height=parseInt(this.map.canvas.height),F.style.width=this.map.canvas.style.width,F.style.height=this.map.canvas.style.height;var N=this.devicePixelRatio;return this.mapVOptions.context=="2d"&&F.getContext(this.mapVOptions.context).scale(N,N),F}},{key:"_reset",value:function(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()}},{key:"draw",value:function(){this._reset()}},{key:"show",value:function(){this._visiable()}},{key:"hide",value:function(){this._unvisiable()}},{key:"destroy",value:function(){this.remove()}},{key:"remove",value:function(){this.mapvBaseLayer!=null&&(this.removeAllData(),this.mapvBaseLayer.clear(this.mapvBaseLayer.getContext()),this.mapvBaseLayer=void 0,this.canvas.parentElement.removeChild(this.canvas))}},{key:"update",value:function(F){F!=null&&this.updateData(F.data,F.options)}},{key:"resizeCanvas",value:function(){if(this.canvas!=null&&this.canvas!=null){var F=this.canvas;F.style.position="absolute",F.style.top="0px",F.style.left="0px",F.width=parseInt(this.map.canvas.width),F.height=parseInt(this.map.canvas.height),F.style.width=this.map.canvas.style.width,F.style.height=this.map.canvas.style.height}}},{key:"fixPosition",value:function(){}},{key:"onResize",value:function(){}},{key:"render",value:function(){this.mapvBaseLayer!=null&&this.mapvBaseLayer._canvasUpdate()}}]),B}();hf=function(O,F,N,U){return new $v(O,F,N,U)}}var _g=hf,Te={getDataSet:function(O){var F=[],N=O.features;if(N)for(var U=0;U<N.length;U++){var X=N[U],Z=X.geometry,Ae=X.properties,Re={};for(var Be in Ae)Re[Be]=Ae[Be];Re.geometry=Z,F.push(Re)}return new g(F)}},gt={CSVToArray:function(O,F){F=F||",";for(var N=new RegExp("(\\"+F+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+F+"\\r\\n]*))","gi"),U=[[]],X=null;X=N.exec(O);){var Z=X[1];Z.length&&Z!==F&&U.push([]);var Ae;X[2]?Ae=X[2].replace(new RegExp('""',"g"),'"'):Ae=X[3],U[U.length-1].push(Ae)}return U},getDataSet:function(O,F){for(var N=this.CSVToArray(O,F||","),U=[],X=N[0],Z=1;Z<N.length-1;Z++){for(var Ae=N[Z],Re={},Be=0;Be<Ae.length;Be++){var Je=Ae[Be];X[Be]=="geometry"&&(Je=JSON.parse(Je)),Re[X[Be]]=Je}U.push(Re)}return new g(U)}};t.version=r,t.canvasClear=i,t.canvasResolutionScale=a,t.canvasDrawSimple=x,t.canvasDrawHeatmap=k,t.canvasDrawGrid=D,t.canvasDrawHoneycomb=W,t.webglDrawSimple=Gi,t.webglDrawPoint=me,t.webglDrawLine=Q,t.webglDrawPolygon=oi,t.utilCityCenter=u,t.utilCurve=Os,t.utilForceEdgeBundling=no,t.utilDataRangeIntensity=w,t.utilDataRangeCategory=vo,t.utilDataRangeChoropleth=No,t.Map=Jo,t.baiduMapCanvasLayer=Lo,t.baiduMapAnimationLayer=bs,t.baiduMapLayer=Wm,t.googleMapCanvasLayer=ho,t.googleMapLayer=q0,t.MaptalksLayer=Hm,t.AMapLayer=bc,t.OpenlayersLayer=uf,t.leafletMapLayer=_h,t.cesiumMapLayer=_g,t.DataSet=g,t.geojson=Te,t.csv=gt,Object.defineProperty(t,"__esModule",{value:!0})})})(P7,P7.exports);var jFr=P7.exports.baiduMapLayer?P7.exports.baiduMapLayer.__proto__:Function;class XFr extends jFr{constructor(e,t,r,i,a,o){super(e,t,r),this.dataSet=t,this.mapWidth=i,this.mapHeight=a;var s=this;r=r||{},this.source=o,s.animator=null,s.map=e,s.init(r),s.argCheck(r),this.canvasLayer=new HFr({map:e,context:this.context,paneName:r.paneName,mixBlendMode:r.mixBlendMode,enableMassClear:r.enableMassClear,zIndex:r.zIndex,width:i,height:a,update:function(){s._canvasUpdate()}}),this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),e.on("movestart",this.moveStartEvent.bind(this)),e.on("moveend",this.moveEndEvent.bind(this)),e.getView().on("change:center",this.zoomEvent.bind(this)),e.getView().on("change:size",this.sizeEvent.bind(this)),e.on("pointerdrag",this.dragEvent.bind(this)),this.bindEvent()}init(e){var t=this;t.options=e,this.initDataRange(e),this.context=t.options.context||"2d",t.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(t.options.zIndex),this.initAnimator()}clickEvent(e){var t=e.pixel;super.clickEvent({x:t[0]+this.offset[0],y:t[1]+this.offset[1]},e)}mousemoveEvent(e){var t=e.pixel;super.mousemoveEvent({x:t[0],y:t[1]},e)}dragEvent(){this.clear(this.getContext())}zoomEvent(){this.clear(this.getContext())}sizeEvent(){this.canvasLayer.resize()}moveStartEvent(){var e=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=e.stepsRange.start)}moveEndEvent(){this.canvasLayer.draw()}bindEvent(){var e=this,t=e.map;e.options.methods&&(e.options.methods.click&&t.on("click",e.clickEvent),e.options.methods.mousemove&&(e.pointerInteraction=new uL,e.pointerInteraction.handleMoveEvent_=function(r){e.mousemoveEvent(r)},t.addInteraction(e.pointerInteraction)))}unbindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.un("click",this.clickEvent),this.options.methods.mousemove&&e.removeInteraction(this.pointerInteraction))}addData(e,t){var r=e;e&&e.get&&(r=e.get()),this.dataSet.add(r),this.update({options:t})}update(e){var t=e||{},r=t.data;r&&r.get&&(r=r.get()),r!=null&&this.dataSet.set(r),super.update({options:t.options})}draw(){this.canvasLayer.draw()}getData(){return this.dataSet}removeData(e){if(!!this.dataSet){var t=this.dataSet.get({filter:function(r){return e!=null&&typeof e=="function"?!e(r):!0}});this.dataSet.set(t),this.update({options:null})}}clearData(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}_canvasUpdate(e){if(!this.canvasLayer)return;var t=this,r=t.options.animation,i=t.map,a=t.canvasLayer.canvas.getContext(t.context);if(t.isEnabledTime()){if(e===void 0){t.clear(a);return}(!t.context||t.context==="2d")&&(a.save(),a.globalCompositeOperation="destination-out",a.fillStyle="rgba(0, 0, 0, .1)",a.fillRect(0,0,a.canvas.width,a.canvas.height),a.restore())}else this.clear(a);if(!t.context||t.context==="2d")for(var o in t.options)a[o]=t.options[o];else a.clear(a.COLOR_BUFFER_BIT);var s=i.getView().calculateExtent(),l=i.getPixelFromCoordinate([s[0],s[3]]);t._mapCenter=i.getView().getCenter(),t._mapCenterPx=i.getPixelFromCoordinate(t._mapCenter),t._reselutions=i.getView().getResolution(),t._rotation=-i.getView().getRotation();var u=t._reselutions,h=1;if(this.context!="2d"){var c=typeof window>"u"?{}:window,f=c.devicePixelRatio||1;h=f}var d={transferCoordinate:function(m){var y=(m[0]-t._mapCenter[0])/t._reselutions,_=(t._mapCenter[1]-m[1])/t._reselutions,x=[y+t._mapCenterPx[0],_+t._mapCenterPx[1]];return x=v(x,t._mapCenterPx,1),[(x[0]+t.offset[0])*h,(x[1]+t.offset[1])*h]}};function v(m,y,_){var x=(m[0]-y[0])*_+y[0],S=(m[1]-y[1])*_+y[1];return[x,S]}e!==void 0&&(d.filter=function(m){var y=r.trails||10;return e&&m.time>e-y&&m.time<e}),t.isEnabledTime()&&!t.notFirst&&(t.canvasLayer.resize(t.mapWidth,t.mapHeight),t.notFirst=!0);var p=t.dataSet.get(d);t.processData(p),t.options.unit==="m"?(t.options.size&&(t.options._size=t.options.size/u),t.options.width&&(t.options._width=t.options.width/u),t.options.height&&(t.options._height=t.options.height/u)):(t.options._size=t.options.size,t.options._height=t.options.height,t.options._width=t.options.width);var g=i.getPixelFromCoordinate([0,0]);g=[g[0]-l[0],g[1]-l[1]],this.drawContext(a,p,t.options,{x:g[0],y:g[1]}),t.isEnabledTime()&&this.source.changed(),t.options.updateCallback&&t.options.updateCallback(e)}isEnabledTime(){var e=this.options.animation;return e&&e.enabled!==!1}argCheck(e){e.draw==="heatmap"&&e.strokeStyle&&console.warn("[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]")}getContext(){return this.canvasLayer.canvas.getContext(this.context)}clear(e){e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}}class YFr extends d${constructor(e){var t=e||{};super({attributions:t.attributions||"\xA9 2018 \u767E\u5EA6 MapV with <span>\xA9 SuperMap iClient</span>",canvasFunction:r,logo:br.getOlVersion()==="4"?t.logo:null,projection:t.projection,ratio:t.ratio,resolutions:t.resolutions,state:t.state}),this.map=e.map,this.dataSet=e.dataSet,this.mapvOptions=e.mapvOptions;function r(i,a,o,s,l){var u=s[0]/o,h=s[1]/o,c=this.map.getSize()[0],f=this.map.getSize()[1];this.layer||(this.layer=new XFr(this.map,this.dataSet,this.mapvOptions,u,h,this)),this.layer.pixelRatio=o,this.layer.offset=[(u-c)/2,(h-f)/2],this.rotate?this.rotate!==this.map.getView().getRotation()&&(this.layer.canvasLayer.resize(u,h),this.rotate=this.map.getView().getRotation()):this.rotate=this.map.getView().getRotation();var d=this.layer.canvasLayer.canvas;this.layer.isEnabledTime()||(this.layer.canvasLayer.resize(u,h),this.layer.canvasLayer.draw()),this.context||(this.context=br.createCanvasContext2D(u,h));var v=this.context.canvas;return this.context.clearRect(0,0,v.width,v.height),v.width=s[0],v.height=s[1],v.style.width=s[0]+"px",v.style.height=s[1]+"px",this.context.drawImage(d,0,0),(this.resolution!==a||JSON.stringify(this.extent)!==JSON.stringify(i))&&(this.resolution=a,this.extent=i),this.context.canvas}}addData(e,t){this.layer.addData(e,t)}getData(){return this.layer&&(this.dataSet=this.layer.getData()),this.dataSet}removeData(e){this.layer&&this.layer.removeData(e)}clearData(){this.layer.clearData()}update(e){this.layer.update(e),this.changed()}}class qFr extends AS{constructor(e,t){super(e,t),this.style=t.style,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle,this.themeField=t.themeField,this.styleGroups=t.styleGroups}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,AS.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a<i.shapes.length;a++)this.renderer.addShape(i.shapes[a]);return i}getStyleByData(e){var t={},r=e;if(t=H.copyAttributesWithClip(t,this.style),this.themeField&&this.styleGroups&&this.styleGroups.length>0&&r.attributes){var i=this.themeField,a=r.attributes,o=this.styleGroups,s=!1,l=null;for(var u in a)if(i===u){s=!0,l=a[u];break}if(s){for(var h=0,c=o.length;h<c;h++)if(l>=o[h].start&&l<o[h].end){var f=o[h].style;t=H.copyAttributesWithClip(t,f)}}}return r.style&&this.isAllowFeatureStyle===!0&&(t=H.copyAttributesWithClip(r.style)),t}canvasFunctionInternal_(e,t,r,i,a){return AS.prototype.canvasFunctionInternal_.apply(this,arguments)}}class ZFr extends _8{constructor(e,t,r){super(e,t,r),this.symbolType=t,this.symbolSetting=r.symbolSetting,this.themeField=r.themeField}destroy(){this.symbolType=null,this.symbolSetting=null,this.themeField=null,_8.prototype.destroy.apply(this,arguments)}setSymbolType(e){this.symbolType=e,this.redraw()}createThematicFeature(e){var t;return am[this.symbolType]&&this.themeField&&this.symbolSetting&&(t=new am[this.symbolType](e,this,[this.themeField],this.symbolSetting)),t?(t.assembleShapes(),t):!1}canvasFunctionInternal_(e,t,r,i,a){return _8.prototype.canvasFunctionInternal_.apply(this,arguments)}}var Au=63710088e-1,p$={centimeters:Au*100,centimetres:Au*100,degrees:Au/111325,feet:Au*3.28084,inches:Au*39.37,kilometers:Au/1e3,kilometres:Au/1e3,meters:Au,metres:Au,miles:Au/1609.344,millimeters:Au*1e3,millimetres:Au*1e3,nauticalmiles:Au/1852,radians:1,yards:Au*1.0936},vZe={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Au,yards:1.0936133},O7={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function fu(n,e,t){t===void 0&&(t={});var r={type:"Feature"};return(t.id===0||t.id)&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.properties=e||{},r.geometry=n,r}function pZe(n,e,t){switch(n){case"Point":return Vi(e).geometry;case"LineString":return yo(e).geometry;case"Polygon":return Qi(e).geometry;case"MultiPoint":return $k(e).geometry;case"MultiLineString":return Pw(e).geometry;case"MultiPolygon":return Ld(e).geometry;default:throw new Error(n+" is invalid")}}function Vi(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Gu(n[0])||!Gu(n[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:n};return fu(r,e,t)}function gZe(n,e,t){return t===void 0&&(t={}),Zn(n.map(function(r){return Vi(r,e)}),t)}function Qi(n,e,t){t===void 0&&(t={});for(var r=0,i=n;r<i.length;r++){var a=i[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<a[a.length-1].length;o++)if(a[a.length-1][o]!==a[0][o])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:n};return fu(s,e,t)}function yZe(n,e,t){return t===void 0&&(t={}),Zn(n.map(function(r){return Qi(r,e)}),t)}function yo(n,e,t){if(t===void 0&&(t={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:n};return fu(r,e,t)}function mZe(n,e,t){return t===void 0&&(t={}),Zn(n.map(function(r){return yo(r,e)}),t)}function Zn(n,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function Pw(n,e,t){t===void 0&&(t={});var r={type:"MultiLineString",coordinates:n};return fu(r,e,t)}function $k(n,e,t){t===void 0&&(t={});var r={type:"MultiPoint",coordinates:n};return fu(r,e,t)}function Ld(n,e,t){t===void 0&&(t={});var r={type:"MultiPolygon",coordinates:n};return fu(r,e,t)}function Lhe(n,e,t){t===void 0&&(t={});var r={type:"GeometryCollection",geometries:n};return fu(r,e,t)}function _Ze(n,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(n*t)/t}function ZM(n,e){e===void 0&&(e="kilometers");var t=p$[e];if(!t)throw new Error(e+" units is invalid");return n*t}function S2(n,e){e===void 0&&(e="kilometers");var t=p$[e];if(!t)throw new Error(e+" units is invalid");return n/t}function R7(n,e){return aw(S2(n,e))}function w2(n){var e=n%360;return e<0&&(e+=360),e}function aw(n){var e=n%(2*Math.PI);return e*180/Math.PI}function ku(n){var e=n%360;return e*Math.PI/180}function b2(n,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("length must be a positive number");return ZM(S2(n,e),t)}function xZe(n,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("area must be a positive number");var r=O7[e];if(!r)throw new Error("invalid original units");var i=O7[t];if(!i)throw new Error("invalid final units");return n/r*i}function Gu(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Io(n){return!!n&&n.constructor===Object}function SZe(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(e){if(!Gu(e))throw new Error("bbox must only contain numbers")})}function wZe(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}const bZe=Object.freeze(Object.defineProperty({__proto__:null,earthRadius:Au,factors:p$,unitsFactors:vZe,areaFactors:O7,feature:fu,geometry:pZe,point:Vi,points:gZe,polygon:Qi,polygons:yZe,lineString:yo,lineStrings:mZe,featureCollection:Zn,multiLineString:Pw,multiPoint:$k,multiPolygon:Ld,geometryCollection:Lhe,round:_Ze,radiansToLength:ZM,lengthToRadians:S2,lengthToDegrees:R7,bearingToAzimuth:w2,radiansToDegrees:aw,degreesToRadians:ku,convertLength:b2,convertArea:xZe,isNumber:Gu,isObject:Io,validateBBox:SZe,validateId:wZe},Symbol.toStringTag,{value:"Module"}));function gl(n,e,t){if(n!==null)for(var r,i,a,o,s,l,u,h=0,c=0,f,d=n.type,v=d==="FeatureCollection",p=d==="Feature",g=v?n.features.length:1,m=0;m<g;m++){u=v?n.features[m].geometry:p?n.geometry:n,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var y=0;y<s;y++){var _=0,x=0;if(o=f?u.geometries[y]:u,o!==null){l=o.coordinates;var S=o.type;switch(h=t&&(S==="Polygon"||S==="MultiPolygon")?1:0,S){case null:break;case"Point":if(e(l,c,m,_,x)===!1)return!1;c++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(e(l[r],c,m,_,x)===!1)return!1;c++,S==="MultiPoint"&&_++}S==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(e(l[r][i],c,m,_,x)===!1)return!1;c++}S==="MultiLineString"&&_++,S==="Polygon"&&x++}S==="Polygon"&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(x=0,i=0;i<l[r].length;i++){for(a=0;a<l[r][i].length-h;a++){if(e(l[r][i][a],c,m,_,x)===!1)return!1;c++}x++}_++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(gl(o.geometries[r],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Phe(n,e,t,r){var i=t;return gl(n,function(a,o,s,l,u){o===0&&t===void 0?i=a:i=e(i,a,o,s,l,u)},r),i}function Ohe(n,e){var t;switch(n.type){case"FeatureCollection":for(t=0;t<n.features.length&&e(n.features[t].properties,t)!==!1;t++);break;case"Feature":e(n.properties,0);break}}function EZe(n,e,t){var r=t;return Ohe(n,function(i,a){a===0&&t===void 0?r=i:r=e(r,i,a)}),r}function uo(n,e){if(n.type==="Feature")e(n,0);else if(n.type==="FeatureCollection")for(var t=0;t<n.features.length&&e(n.features[t],t)!==!1;t++);}function Rhe(n,e,t){var r=t;return uo(n,function(i,a){a===0&&t===void 0?r=i:r=e(r,i,a)}),r}function KM(n){var e=[];return gl(n,function(t){e.push(t)}),e}function Pd(n,e){var t,r,i,a,o,s,l,u,h,c,f=0,d=n.type==="FeatureCollection",v=n.type==="Feature",p=d?n.features.length:1;for(t=0;t<p;t++){for(s=d?n.features[t].geometry:v?n.geometry:n,u=d?n.features[t].properties:v?n.properties:{},h=d?n.features[t].bbox:v?n.bbox:void 0,c=d?n.features[t].id:v?n.id:void 0,l=s?s.type==="GeometryCollection":!1,o=l?s.geometries.length:1,i=0;i<o;i++){if(a=l?s.geometries[i]:s,a===null){if(e(null,f,u,h,c)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(a,f,u,h,c)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<a.geometries.length;r++)if(e(a.geometries[r],f,u,h,c)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Dhe(n,e,t){var r=t;return Pd(n,function(i,a,o,s,l){a===0&&t===void 0?r=i:r=e(r,i,a,o,s,l)}),r}function fh(n,e){Pd(n,function(t,r,i,a,o){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(fu(t,i,{bbox:a,id:o}),r,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var h=t.coordinates[u],c={type:l,coordinates:h};if(e(fu(c,i),r,u)===!1)return!1}})}function TZe(n,e,t){var r=t;return fh(n,function(i,a,o){a===0&&o===0&&t===void 0?r=i:r=e(r,i,a,o)}),r}function B1(n,e){fh(n,function(t,r,i){var a=0;if(!!t.geometry){var o=t.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var s,l=0,u=0,h=0;if(gl(t,function(c,f,d,v,p){if(s===void 0||r>l||v>u||p>h){s=c,l=r,u=v,h=p,a=0;return}var g=yo([s,c],t.properties);if(e(g,r,i,p,a)===!1)return!1;a++,s=c})===!1)return!1}}})}function Nhe(n,e,t){var r=t,i=!1;return B1(n,function(a,o,s,l,u){i===!1&&t===void 0?r=a:r=e(r,a,o,s,l,u),i=!0}),r}function khe(n,e){if(!n)throw new Error("geojson is required");fh(n,function(t,r,i){if(t.geometry!==null){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(e(t,r,i,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(e(yo(o[s],t.properties),r,i,s)===!1)return!1;break}}})}function Fhe(n,e,t){var r=t;return khe(n,function(i,a,o,s){a===0&&t===void 0?r=i:r=e(r,i,a,o,s)}),r}function CZe(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.featureIndex||0,r=e.multiFeatureIndex||0,i=e.geometryIndex||0,a=e.segmentIndex||0,o=e.properties,s;switch(n.type){case"FeatureCollection":t<0&&(t=n.features.length+t),o=o||n.features[t].properties,s=n.features[t].geometry;break;case"Feature":o=o||n.properties,s=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=n;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),yo([l[a],l[a+1]],o,e);case"Polygon":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a-1),yo([l[i][a],l[i][a+1]],o,e);case"MultiLineString":return r<0&&(r=l.length+r),a<0&&(a=l[r].length+a-1),yo([l[r][a],l[r][a+1]],o,e);case"MultiPolygon":return r<0&&(r=l.length+r),i<0&&(i=l[r].length+i),a<0&&(a=l[r][i].length-a-1),yo([l[r][i][a],l[r][i][a+1]],o,e)}throw new Error("geojson is invalid")}function AZe(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.featureIndex||0,r=e.multiFeatureIndex||0,i=e.geometryIndex||0,a=e.coordIndex||0,o=e.properties,s;switch(n.type){case"FeatureCollection":t<0&&(t=n.features.length+t),o=o||n.features[t].properties,s=n.features[t].geometry;break;case"Feature":o=o||n.properties,s=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=n;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Vi(l,o,e);case"MultiPoint":return r<0&&(r=l.length+r),Vi(l[r],o,e);case"LineString":return a<0&&(a=l.length+a),Vi(l[a],o,e);case"Polygon":return i<0&&(i=l.length+i),a<0&&(a=l[i].length+a),Vi(l[i][a],o,e);case"MultiLineString":return r<0&&(r=l.length+r),a<0&&(a=l[r].length+a),Vi(l[r][a],o,e);case"MultiPolygon":return r<0&&(r=l.length+r),i<0&&(i=l[r].length+i),a<0&&(a=l[r][i].length-a),Vi(l[r][i][a],o,e)}throw new Error("geojson is invalid")}const MZe=Object.freeze(Object.defineProperty({__proto__:null,coordAll:KM,coordEach:gl,coordReduce:Phe,featureEach:uo,featureReduce:Rhe,findPoint:AZe,findSegment:CZe,flattenEach:fh,flattenReduce:TZe,geomEach:Pd,geomReduce:Dhe,lineEach:khe,lineReduce:Fhe,propEach:Ohe,propReduce:EZe,segmentEach:B1,segmentReduce:Nhe},Symbol.toStringTag,{value:"Module"}));function yl(n){var e=[1/0,1/0,-1/0,-1/0];return gl(n,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}yl.default=yl;const KFr=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"}));function Wo(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ri(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Bhe(n){if(n.length>1&&Gu(n[0])&&Gu(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return Bhe(n[0]);throw new Error("coordinates must only contain numbers")}function IZe(n,e,t){if(!e||!t)throw new Error("type and name required");if(!n||n.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.type)}function xN(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}function Y_(n,e,t){if(!n)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!n||n.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(var r=0,i=n.features;r<i.length;r++){var a=i[r];if(!a||a.type!=="Feature"||!a.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!a.geometry||a.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+a.geometry.type)}}function ls(n){return n.type==="Feature"?n.geometry:n}function zf(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}const JFr=Object.freeze(Object.defineProperty({__proto__:null,getCoord:Wo,getCoords:ri,containsNumber:Bhe,geojsonType:IZe,featureOf:xN,collectionOf:Y_,getGeom:ls,getType:zf},Symbol.toStringTag,{value:"Module"}));/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var mMe=Object.getOwnPropertySymbols,QFr=Object.prototype.hasOwnProperty,e4r=Object.prototype.propertyIsEnumerable;function t4r(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function r4r(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var r=Object.getOwnPropertyNames(e).map(function(a){return e[a]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Ghe=r4r()?Object.assign:function(n,e){for(var t,r=t4r(n),i,a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var o in t)QFr.call(t,o)&&(r[o]=t[o]);if(mMe){i=mMe(t);for(var s=0;s<i.length;s++)e4r.call(t,i[s])&&(r[i[s]]=t[i[s]])}}return r};/**
* @license GNU Affero General Public License.
* Copyright (c) 2015, 2015 Ronny Lorenz <ronny@tbi.univie.ac.at>
* v. 1.2.0
* https://github.com/RaumZeit/MarchingSquares.js
*
* MarchingSquaresJS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MarchingSquaresJS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* As additional permission under GNU Affero General Public License version 3
* section 7, third-party projects (personal or commercial) may distribute,
* include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the
* requirement that said third-party project for that reason alone becomes
* subject to any requirement of the GNU Affero General Public License version 3.
* Any modifications to MarchingSquaresJS, however, must be shared with the public
* and made available.
*
* In summary this:
* - allows you to use MarchingSquaresJS at no cost
* - allows you to use MarchingSquaresJS for both personal and commercial purposes
* - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any
* license as long as this license notice is included
* - enables you to keep the source code of your program that uses MarchingSquaresJS
* undisclosed
* - forces you to share any modifications you have made to MarchingSquaresJS,
* e.g. bug-fixes
*
* You should have received a copy of the GNU Affero General Public License
* along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
*/var _Me={successCallback:null,verbose:!1},D6={};function n4r(n,e,t){t=t||{};for(var r=Object.keys(_Me),i=0;i<r.length;i++){var a=r[i],o=t[a];o=typeof o<"u"&&o!==null?o:_Me[a],D6[a]=o}D6.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+e);var s=o4r(i4r(n,e));return typeof D6.successCallback=="function"&&D6.successCallback(s),s}function Po(n,e,t){return(n-e)/(t-e)}function i4r(n,e){for(var t=n.length-1,r=n[0].length-1,i={rows:t,cols:r,cells:[]},a=0;a<t;++a){i.cells[a]=[];for(var o=0;o<r;++o){var s=0,l=n[a+1][o],u=n[a+1][o+1],h=n[a][o+1],c=n[a][o];if(!(isNaN(l)||isNaN(u)||isNaN(h)||isNaN(c))){s|=l>=e?8:0,s|=u>=e?4:0,s|=h>=e?2:0,s|=c>=e?1:0;var f=!1;if(s===5||s===10){var d=(l+u+h+c)/4;s===5&&d<e?(s=10,f=!0):s===10&&d<e&&(s=5,f=!0)}if(s!==0&&s!==15){var v,p,g,m;v=p=g=m=.5,s===1?(g=1-Po(e,l,c),p=1-Po(e,h,c)):s===2?(p=Po(e,c,h),m=1-Po(e,u,h)):s===3?(g=1-Po(e,l,c),m=1-Po(e,u,h)):s===4?(v=Po(e,l,u),m=Po(e,h,u)):s===5?(v=Po(e,l,u),m=Po(e,h,u),p=1-Po(e,h,c),g=1-Po(e,l,c)):s===6?(p=Po(e,c,h),v=Po(e,l,u)):s===7?(g=1-Po(e,l,c),v=Po(e,l,u)):s===8?(g=Po(e,c,l),v=1-Po(e,u,l)):s===9?(p=1-Po(e,h,c),v=1-Po(e,u,l)):s===10?(v=1-Po(e,u,l),m=1-Po(e,u,h),p=Po(e,c,h),g=Po(e,c,l)):s===11?(v=1-Po(e,u,l),m=1-Po(e,u,h)):s===12?(g=Po(e,c,l),m=Po(e,h,u)):s===13?(p=1-Po(e,h,c),m=Po(e,h,u)):s===14?(g=Po(e,c,l),p=Po(e,c,h)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+s),i.cells[a][o]={cval:s,flipped:f,top:v,right:m,bottom:p,left:g}}}}}return i}function a4r(n){return n.cval===5||n.cval===10}function LZe(n){return n.cval===0||n.cval===15}function xMe(n){!LZe(n)&&n.cval!==5&&n.cval!==10&&(n.cval=15)}function tZ(n,e){if(e==="top")return[n.top,1];if(e==="bottom")return[n.bottom,0];if(e==="right")return[1,n.right];if(e==="left")return[0,n.left]}function o4r(n){var e=[],t=0,r=1e-7;return n.cells.forEach(function(i,a){i.forEach(function(o,s){if(typeof o<"u"&&!a4r(o)&&!LZe(o)){var l=s4r(n.cells,a,s),u=!1;if(l.info==="mergeable"){for(var h=l.path[l.path.length-1][0],c=l.path[l.path.length-1][1],f=t-1;f>=0;f--)if(Math.abs(e[f][0][0]-h)<=r&&Math.abs(e[f][0][1]-c)<=r){for(var d=l.path.length-2;d>=0;--d)e[f].unshift(l.path[d]);u=!0;break}}u||(e[t++]=l.path)}})}),e}function s4r(n,e,t){var r=n.length,i=[],a=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],o=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],s,l,u=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"],h=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],d,c=n[e][t],f=c.cval,d=u[f],v=tZ(c,d);i.push([t+v[0],e+v[1]]),d=h[f],v=tZ(c,d),i.push([t+v[0],e+v[1]]),xMe(c);for(var p=t+a[f],g=e+o[f],m=f;p>=0&&g>=0&&g<r&&(p!=t||g!=e)&&(c=n[g][p],!(typeof c>"u"));){if(f=c.cval,f===0||f===15)return{path:i,info:"mergeable"};d=h[f],s=a[f],l=o[f],(f===5||f===10)&&(f===5?c.flipped?o[m]===-1?(d="left",s=-1,l=0):(d="right",s=1,l=0):a[m]===-1&&(d="bottom",s=0,l=-1):f===10&&(c.flipped?a[m]===-1?(d="top",s=0,l=1):(d="bottom",s=0,l=-1):o[m]===1&&(d="left",s=-1,l=0))),v=tZ(c,d),i.push([p+v[0],g+v[1]]),xMe(c),p+=s,g+=l,m=f}return{path:i,info:"closed"}}function l4r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.zProperty||"elevation",r=e.flip,i=e.flags;Y_(n,"Point","input must contain Points");for(var a=u4r(n,r),o=[],s=0;s<a.length;s++){for(var l=a[s],u=[],h=0;h<l.length;h++){var c=l[h];c.properties[t]?u.push(c.properties[t]):u.push(0),i===!0&&(c.properties.matrixPosition=[s,h])}o.push(u)}return o}function u4r(n,e){var t={};uo(n,function(a){var o=ri(a)[1];t[o]||(t[o]=[]),t[o].push(a)});var r=Object.keys(t).map(function(a){var o=t[a],s=o.sort(function(l,u){return ri(l)[0]-ri(u)[0]});return s}),i=r.sort(function(a,o){return e?ri(a[0])[1]-ri(o[0])[1]:ri(o[0])[1]-ri(a[0])[1]});return i}function h4r(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.zProperty||"elevation",i=t.commonProperties||{},a=t.breaksProperties||[];if(Y_(n,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!Io(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(a))throw new Error("breaksProperties must be an Array");var o=l4r(n,{zProperty:r,flip:!0}),s=c4r(o,e,r,i,a),l=f4r(s,o,n);return Zn(l)}function c4r(n,e,t,r,i){for(var a=[],o=1;o<e.length;o++){var s=+e[o],l=Ghe({},r,i[o]);l[t]=s;var u=Pw(n4r(n,s),l);a.push(u)}return a}function f4r(n,e,t){var r=yl(t),i=r[2]-r[0],a=r[3]-r[1],o=r[0],s=r[1],l=e[0].length-1,u=e.length-1,h=i/l,c=a/u,f=function(d){d[0]=d[0]*h+o,d[1]=d[1]*c+s};return n.forEach(function(d){gl(d,f)}),n}var zhe={exports:{}},PZe={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(at,function(){function t(y,_,x,S,w){(function b(E,T,C,A,M){for(;A>C;){if(A-C>600){var I=A-C+1,R=T-C+1,k=Math.log(I),D=.5*Math.exp(2*k/3),G=.5*Math.sqrt(k*D*(I-D)/I)*(R-I/2<0?-1:1),W=Math.max(C,Math.floor(T-R*D/I+G)),z=Math.min(A,Math.floor(T+(I-R)*D/I+G));b(E,T,W,z,M)}var V=E[T],q=C,Y=A;for(r(E,C,T),M(E[A],V)>0&&r(E,C,A);q<Y;){for(r(E,q,Y),q++,Y--;M(E[q],V)<0;)q++;for(;M(E[Y],V)>0;)Y--}M(E[C],V)===0?r(E,C,Y):r(E,++Y,A),Y<=T&&(C=Y+1),T<=Y&&(A=Y-1)}})(y,_,x||0,S||y.length-1,w||i)}function r(y,_,x){var S=y[_];y[_]=y[x],y[x]=S}function i(y,_){return y<_?-1:y>_?1:0}var a=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,x){if(!x)return _.indexOf(y);for(var S=0;S<_.length;S++)if(x(y,_[S]))return S;return-1}function s(y,_){l(y,0,y.children.length,_,y)}function l(y,_,x,S,w){w||(w=g(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var b=_;b<x;b++){var E=y.children[b];u(w,y.leaf?S(E):E)}return w}function u(y,_){return y.minX=Math.min(y.minX,_.minX),y.minY=Math.min(y.minY,_.minY),y.maxX=Math.max(y.maxX,_.maxX),y.maxY=Math.max(y.maxY,_.maxY),y}function h(y,_){return y.minX-_.minX}function c(y,_){return y.minY-_.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function d(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,_){return y.minX<=_.minX&&y.minY<=_.minY&&_.maxX<=y.maxX&&_.maxY<=y.maxY}function p(y,_){return _.minX<=y.maxX&&_.minY<=y.maxY&&_.maxX>=y.minX&&_.maxY>=y.minY}function g(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(y,_,x,S,w){for(var b=[_,x];b.length;)if(!((x=b.pop())-(_=b.pop())<=S)){var E=_+Math.ceil((x-_)/S/2)*S;t(y,E,_,x,w),b.push(_,E,E,x)}}return a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(y){var _=this.data,x=[];if(!p(y,_))return x;for(var S=this.toBBox,w=[];_;){for(var b=0;b<_.children.length;b++){var E=_.children[b],T=_.leaf?S(E):E;p(y,T)&&(_.leaf?x.push(E):v(y,T)?this._all(E,x):w.push(E))}_=w.pop()}return x},a.prototype.collides=function(y){var _=this.data;if(!p(y,_))return!1;for(var x=[];_;){for(var S=0;S<_.children.length;S++){var w=_.children[S],b=_.leaf?this.toBBox(w):w;if(p(y,b)){if(_.leaf||v(y,b))return!0;x.push(w)}}_=x.pop()}return!1},a.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var _=0;_<y.length;_++)this.insert(y[_]);return this}var x=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var S=this.data;this.data=x,x=S}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},a.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},a.prototype.clear=function(){return this.data=g([]),this},a.prototype.remove=function(y,_){if(!y)return this;for(var x,S,w,b=this.data,E=this.toBBox(y),T=[],C=[];b||T.length;){if(b||(b=T.pop(),S=T[T.length-1],x=C.pop(),w=!0),b.leaf){var A=o(y,b.children,_);if(A!==-1)return b.children.splice(A,1),T.push(b),this._condense(T),this}w||b.leaf||!v(b,E)?S?(x++,b=S.children[x],w=!1):b=null:(T.push(b),C.push(x),x=0,S=b,b=b.children[0])}return this},a.prototype.toBBox=function(y){return y},a.prototype.compareMinX=function(y,_){return y.minX-_.minX},a.prototype.compareMinY=function(y,_){return y.minY-_.minY},a.prototype.toJSON=function(){return this.data},a.prototype.fromJSON=function(y){return this.data=y,this},a.prototype._all=function(y,_){for(var x=[];y;)y.leaf?_.push.apply(_,y.children):x.push.apply(x,y.children),y=x.pop();return _},a.prototype._build=function(y,_,x,S){var w,b=x-_+1,E=this._maxEntries;if(b<=E)return s(w=g(y.slice(_,x+1)),this.toBBox),w;S||(S=Math.ceil(Math.log(b)/Math.log(E)),E=Math.ceil(b/Math.pow(E,S-1))),(w=g([])).leaf=!1,w.height=S;var T=Math.ceil(b/E),C=T*Math.ceil(Math.sqrt(E));m(y,_,x,C,this.compareMinX);for(var A=_;A<=x;A+=C){var M=Math.min(A+C-1,x);m(y,A,M,T,this.compareMinY);for(var I=A;I<=M;I+=T){var R=Math.min(I+T-1,M);w.children.push(this._build(y,I,R,S-1))}}return s(w,this.toBBox),w},a.prototype._chooseSubtree=function(y,_,x,S){for(;S.push(_),!_.leaf&&S.length-1!==x;){for(var w=1/0,b=1/0,E=void 0,T=0;T<_.children.length;T++){var C=_.children[T],A=f(C),M=(I=y,R=C,(Math.max(R.maxX,I.maxX)-Math.min(R.minX,I.minX))*(Math.max(R.maxY,I.maxY)-Math.min(R.minY,I.minY))-A);M<b?(b=M,w=A<w?A:w,E=C):M===b&&A<w&&(w=A,E=C)}_=E||_.children[0]}var I,R;return _},a.prototype._insert=function(y,_,x){var S=x?y:this.toBBox(y),w=[],b=this._chooseSubtree(S,this.data,_,w);for(b.children.push(y),u(b,S);_>=0&&w[_].children.length>this._maxEntries;)this._split(w,_),_--;this._adjustParentBBoxes(S,w,_)},a.prototype._split=function(y,_){var x=y[_],S=x.children.length,w=this._minEntries;this._chooseSplitAxis(x,w,S);var b=this._chooseSplitIndex(x,w,S),E=g(x.children.splice(b,x.children.length-b));E.height=x.height,E.leaf=x.leaf,s(x,this.toBBox),s(E,this.toBBox),_?y[_-1].children.push(E):this._splitRoot(x,E)},a.prototype._splitRoot=function(y,_){this.data=g([y,_]),this.data.height=y.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(y,_,x){for(var S,w,b,E,T,C,A,M=1/0,I=1/0,R=_;R<=x-_;R++){var k=l(y,0,R,this.toBBox),D=l(y,R,x,this.toBBox),G=(w=k,b=D,E=void 0,T=void 0,C=void 0,A=void 0,E=Math.max(w.minX,b.minX),T=Math.max(w.minY,b.minY),C=Math.min(w.maxX,b.maxX),A=Math.min(w.maxY,b.maxY),Math.max(0,C-E)*Math.max(0,A-T)),W=f(k)+f(D);G<M?(M=G,S=R,I=W<I?W:I):G===M&&W<I&&(I=W,S=R)}return S||x-_},a.prototype._chooseSplitAxis=function(y,_,x){var S=y.leaf?this.compareMinX:h,w=y.leaf?this.compareMinY:c;this._allDistMargin(y,_,x,S)<this._allDistMargin(y,_,x,w)&&y.children.sort(S)},a.prototype._allDistMargin=function(y,_,x,S){y.children.sort(S);for(var w=this.toBBox,b=l(y,0,_,w),E=l(y,x-_,x,w),T=d(b)+d(E),C=_;C<x-_;C++){var A=y.children[C];u(b,y.leaf?w(A):A),T+=d(b)}for(var M=x-_-1;M>=_;M--){var I=y.children[M];u(E,y.leaf?w(I):I),T+=d(E)}return T},a.prototype._adjustParentBBoxes=function(y,_,x){for(var S=x;S>=0;S--)u(_[S],y)},a.prototype._condense=function(y){for(var _=y.length-1,x=void 0;_>=0;_--)y[_].children.length===0?_>0?(x=y[_-1].children).splice(x.indexOf(y[_]),1):this.clear():s(y[_],this.toBBox)},a})})(PZe);class d4r{constructor(e=[],t=v4r){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,i=t[e];for(;e>0;){const a=e-1>>1,o=t[a];if(r(i,o)>=0)break;t[e]=o,e=a}t[e]=i}_down(e){const{data:t,compare:r}=this,i=this.length>>1,a=t[e];for(;e<i;){let o=(e<<1)+1,s=t[o];const l=o+1;if(l<this.length&&r(t[l],s)<0&&(o=l,s=t[l]),r(s,a)>=0)break;t[e]=s,e=o}t[e]=a}}function v4r(n,e){return n<e?-1:n>e?1:0}const p4r=Object.freeze(Object.defineProperty({__proto__:null,default:d4r},Symbol.toStringTag,{value:"Module"})),g4r=Nd(p4r);var g$={exports:{}},y4r=function(e,t,r,i){var a=e[0],o=e[1],s=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=(i-r)/2,u=0,h=l-1;u<l;h=u++){var c=t[r+u*2+0],f=t[r+u*2+1],d=t[r+h*2+0],v=t[r+h*2+1],p=f>o!=v>o&&a<(d-c)*(o-f)/(v-f)+c;p&&(s=!s)}return s},m4r=function(e,t,r,i){var a=e[0],o=e[1],s=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=i-r,u=0,h=l-1;u<l;h=u++){var c=t[u+r][0],f=t[u+r][1],d=t[h+r][0],v=t[h+r][1],p=f>o!=v>o&&a<(d-c)*(o-f)/(v-f)+c;p&&(s=!s)}return s},OZe=y4r,RZe=m4r;g$.exports=function(e,t,r,i){return t.length>0&&Array.isArray(t[0])?RZe(e,t,r,i):OZe(e,t,r,i)};g$.exports.nested=RZe;g$.exports.flat=OZe;var xre={exports:{}};(function(n,e){(function(t,r){r(e)})(at,function(t){const i=33306690738754706e-32;function a(p,g,m,y,_){let x,S,w,b,E=g[0],T=y[0],C=0,A=0;T>E==T>-E?(x=E,E=g[++C]):(x=T,T=y[++A]);let M=0;if(C<p&&A<m)for(T>E==T>-E?(w=x-((S=E+x)-E),E=g[++C]):(w=x-((S=T+x)-T),T=y[++A]),x=S,w!==0&&(_[M++]=w);C<p&&A<m;)T>E==T>-E?(w=x-((S=x+E)-(b=S-x))+(E-b),E=g[++C]):(w=x-((S=x+T)-(b=S-x))+(T-b),T=y[++A]),x=S,w!==0&&(_[M++]=w);for(;C<p;)w=x-((S=x+E)-(b=S-x))+(E-b),E=g[++C],x=S,w!==0&&(_[M++]=w);for(;A<m;)w=x-((S=x+T)-(b=S-x))+(T-b),T=y[++A],x=S,w!==0&&(_[M++]=w);return x===0&&M!==0||(_[M++]=x),M}function o(p){return new Float64Array(p)}const s=33306690738754716e-32,l=22204460492503146e-32,u=11093356479670487e-47,h=o(4),c=o(8),f=o(12),d=o(16),v=o(4);t.orient2d=function(p,g,m,y,_,x){const S=(g-x)*(m-_),w=(p-_)*(y-x),b=S-w;if(S===0||w===0||S>0!=w>0)return b;const E=Math.abs(S+w);return Math.abs(b)>=s*E?b:-function(T,C,A,M,I,R,k){let D,G,W,z,V,q,Y,le,j,Q,ie,oe,se,me,Ce,Le,re,yt;const je=T-I,st=A-I,Nt=C-R,Zt=M-R;V=(Ce=(le=je-(Y=(q=134217729*je)-(q-je)))*(Q=Zt-(j=(q=134217729*Zt)-(q-Zt)))-((me=je*Zt)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=Nt-(Y=(q=134217729*Nt)-(q-Nt)))*(Q=st-(j=(q=134217729*st)-(q-st)))-((Le=Nt*st)-Y*j-le*j-Y*Q))),h[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),h[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,h[2]=oe-(yt-V)+(ie-V),h[3]=yt;let qe=function(J,We){let Tt=We[0];for(let Qe=1;Qe<J;Qe++)Tt+=We[Qe];return Tt}(4,h),ur=l*k;if(qe>=ur||-qe>=ur||(D=T-(je+(V=T-je))+(V-I),W=A-(st+(V=A-st))+(V-I),G=C-(Nt+(V=C-Nt))+(V-R),z=M-(Zt+(V=M-Zt))+(V-R),D===0&&G===0&&W===0&&z===0)||(ur=u*k+i*Math.abs(qe),(qe+=je*z+Zt*D-(Nt*W+st*G))>=ur||-qe>=ur))return qe;V=(Ce=(le=D-(Y=(q=134217729*D)-(q-D)))*(Q=Zt-(j=(q=134217729*Zt)-(q-Zt)))-((me=D*Zt)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=G-(Y=(q=134217729*G)-(q-G)))*(Q=st-(j=(q=134217729*st)-(q-st)))-((Le=G*st)-Y*j-le*j-Y*Q))),v[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),v[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,v[2]=oe-(yt-V)+(ie-V),v[3]=yt;const Dt=a(4,h,4,v,c);V=(Ce=(le=je-(Y=(q=134217729*je)-(q-je)))*(Q=z-(j=(q=134217729*z)-(q-z)))-((me=je*z)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=Nt-(Y=(q=134217729*Nt)-(q-Nt)))*(Q=W-(j=(q=134217729*W)-(q-W)))-((Le=Nt*W)-Y*j-le*j-Y*Q))),v[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),v[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,v[2]=oe-(yt-V)+(ie-V),v[3]=yt;const ft=a(Dt,c,4,v,f);V=(Ce=(le=D-(Y=(q=134217729*D)-(q-D)))*(Q=z-(j=(q=134217729*z)-(q-z)))-((me=D*z)-Y*j-le*j-Y*Q))-(ie=Ce-(re=(le=G-(Y=(q=134217729*G)-(q-G)))*(Q=W-(j=(q=134217729*W)-(q-W)))-((Le=G*W)-Y*j-le*j-Y*Q))),v[0]=Ce-(ie+V)+(V-re),V=(se=me-((oe=me+ie)-(V=oe-me))+(ie-V))-(ie=se-Le),v[1]=se-(ie+V)+(V-Le),V=(yt=oe+ie)-oe,v[2]=oe-(yt-V)+(ie-V),v[3]=yt;const Oe=a(ft,f,4,v,d);return d[Oe-1]}(p,g,m,y,_,x,E)},t.orient2dfast=function(p,g,m,y,_,x){return(g-x)*(m-_)-(p-_)*(y-x)},Object.defineProperty(t,"__esModule",{value:!0})})})(xre,xre.exports);var SMe=PZe.exports,S8=g4r,_4r=g$.exports,x4r=xre.exports.orient2d;S8.default&&(S8=S8.default);zhe.exports=DZe;zhe.exports.default=DZe;function DZe(n,e,t){e=Math.max(0,e===void 0?2:e),t=t||0;var r=T4r(n),i=new SMe(16);i.toBBox=function(y){return{minX:y[0],minY:y[1],maxX:y[0],maxY:y[1]}},i.compareMinX=function(y,_){return y[0]-_[0]},i.compareMinY=function(y,_){return y[1]-_[1]},i.load(n);for(var a=[],o=0,s;o<r.length;o++){var l=r[o];i.remove(l),s=EMe(l,s),a.push(s)}var u=new SMe(16);for(o=0;o<a.length;o++)u.insert(rZ(a[o]));for(var h=e*e,c=t*t;a.length;){var f=a.shift(),d=f.p,v=f.next.p,p=nZ(d,v);if(!(p<c)){var g=p/h;l=S4r(i,f.prev.p,d,v,f.next.next.p,g,u),l&&Math.min(nZ(l,d),nZ(l,v))<=g&&(a.push(f),a.push(EMe(l,f)),i.remove(l),u.remove(f),u.insert(rZ(f)),u.insert(rZ(f.next)))}}f=s;var m=[];do m.push(f.p),f=f.next;while(f!==s);return m.push(f.p),m}function S4r(n,e,t,r,i,a,o){for(var s=new S8([],w4r),l=n.data;l;){for(var u=0;u<l.children.length;u++){var h=l.children[u],c=l.leaf?iZ(h,t,r):b4r(t,r,h);c>a||s.push({node:h,dist:c})}for(;s.length&&!s.peek().node.children;){var f=s.pop(),d=f.node,v=iZ(d,e,t),p=iZ(d,r,i);if(f.dist<v&&f.dist<p&&bMe(t,d,o)&&bMe(r,d,o))return d}l=s.pop(),l&&(l=l.node)}return null}function w4r(n,e){return n.dist-e.dist}function b4r(n,e,t){if(wMe(n,t)||wMe(e,t))return 0;var r=N6(n[0],n[1],e[0],e[1],t.minX,t.minY,t.maxX,t.minY);if(r===0)return 0;var i=N6(n[0],n[1],e[0],e[1],t.minX,t.minY,t.minX,t.maxY);if(i===0)return 0;var a=N6(n[0],n[1],e[0],e[1],t.maxX,t.minY,t.maxX,t.maxY);if(a===0)return 0;var o=N6(n[0],n[1],e[0],e[1],t.minX,t.maxY,t.maxX,t.maxY);return o===0?0:Math.min(r,i,a,o)}function wMe(n,e){return n[0]>=e.minX&&n[0]<=e.maxX&&n[1]>=e.minY&&n[1]<=e.maxY}function bMe(n,e,t){for(var r=Math.min(n[0],e[0]),i=Math.min(n[1],e[1]),a=Math.max(n[0],e[0]),o=Math.max(n[1],e[1]),s=t.search({minX:r,minY:i,maxX:a,maxY:o}),l=0;l<s.length;l++)if(E4r(s[l].p,s[l].next.p,n,e))return!1;return!0}function AA(n,e,t){return x4r(n[0],n[1],e[0],e[1],t[0],t[1])}function E4r(n,e,t,r){return n!==r&&e!==t&&AA(n,e,t)>0!=AA(n,e,r)>0&&AA(t,r,n)>0!=AA(t,r,e)>0}function rZ(n){var e=n.p,t=n.next.p;return n.minX=Math.min(e[0],t[0]),n.minY=Math.min(e[1],t[1]),n.maxX=Math.max(e[0],t[0]),n.maxY=Math.max(e[1],t[1]),n}function T4r(n){for(var e=n[0],t=n[0],r=n[0],i=n[0],a=0;a<n.length;a++){var o=n[a];o[0]<e[0]&&(e=o),o[0]>r[0]&&(r=o),o[1]<t[1]&&(t=o),o[1]>i[1]&&(i=o)}var s=[e,t,r,i],l=s.slice();for(a=0;a<n.length;a++)_4r(n[a],s)||l.push(n[a]);return A4r(l)}function EMe(n,e){var t={p:n,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(t.next=e.next,t.prev=e,e.next.prev=t,e.next=t):(t.prev=t,t.next=t),t}function nZ(n,e){var t=n[0]-e[0],r=n[1]-e[1];return t*t+r*r}function iZ(n,e,t){var r=e[0],i=e[1],a=t[0]-r,o=t[1]-i;if(a!==0||o!==0){var s=((n[0]-r)*a+(n[1]-i)*o)/(a*a+o*o);s>1?(r=t[0],i=t[1]):s>0&&(r+=a*s,i+=o*s)}return a=n[0]-r,o=n[1]-i,a*a+o*o}function N6(n,e,t,r,i,a,o,s){var l=t-n,u=r-e,h=o-i,c=s-a,f=n-i,d=e-a,v=l*l+u*u,p=l*h+u*c,g=h*h+c*c,m=l*f+u*d,y=h*f+c*d,_=v*g-p*p,x,S,w,b,E=_,T=_;_===0?(S=0,E=1,b=y,T=g):(S=p*y-g*m,b=v*y-p*m,S<0?(S=0,b=y,T=g):S>E&&(S=E,b=y+p,T=g)),b<0?(b=0,-m<0?S=0:-m>v?S=E:(S=-m,E=v)):b>T&&(b=T,-m+p<0?S=0:-m+p>v?S=E:(S=-m+p,E=v)),x=S===0?0:S/E,w=b===0?0:b/T;var C=(1-x)*n+x*t,A=(1-x)*e+x*r,M=(1-w)*i+w*o,I=(1-w)*a+w*s,R=M-C,k=I-A;return R*R+k*k}function C4r(n,e){return n[0]===e[0]?n[1]-e[1]:n[0]-e[0]}function A4r(n){n.sort(C4r);for(var e=[],t=0;t<n.length;t++){for(;e.length>=2&&AA(e[e.length-2],e[e.length-1],n[t])<=0;)e.pop();e.push(n[t])}for(var r=[],i=n.length-1;i>=0;i--){for(;r.length>=2&&AA(r[r.length-2],r[r.length-1],n[i])<=0;)r.pop();r.push(n[i])}return r.pop(),e.pop(),e.concat(r)}function NZe(n,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(gl(n,function(i){t.push([i[0],i[1]])}),!t.length)return null;var r=zhe.exports(t,e.concavity);return r.length>3?Qi([r]):null}function ss(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Wo(n),i=ls(e),a=i.type,o=e.bbox,s=i.coordinates;if(o&&M4r(r,o)===!1)return!1;a==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(TMe(r,s[u][0],t.ignoreBoundary)){for(var h=!1,c=1;c<s[u].length&&!h;)TMe(r,s[u][c],!t.ignoreBoundary)&&(h=!0),c++;h||(l=!0)}return l}function TMe(n,e,t){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,a=e.length-1;i<e.length;a=i++){var o=e[i][0],s=e[i][1],l=e[a][0],u=e[a][1],h=n[1]*(o-l)+s*(l-n[0])+u*(n[0]-o)===0&&(o-n[0])*(l-n[0])<=0&&(s-n[1])*(u-n[1])<=0;if(h)return!t;var c=s>n[1]!=u>n[1]&&n[0]<(l-o)*(n[1]-s)/(u-s)+o;c&&(r=!r)}return r}function M4r(n,e){return e[0]<=n[0]&&e[1]<=n[1]&&e[2]>=n[0]&&e[3]>=n[1]}function Sre(n,e){var t=[];return uo(n,function(r){var i=!1;if(r.geometry.type==="Point")Pd(e,function(o){ss(r,o)&&(i=!0)}),i&&t.push(r);else if(r.geometry.type==="MultiPoint"){var a=[];Pd(e,function(o){gl(r,function(s){ss(s,o)&&(i=!0,a.push(s))})}),i&&t.push($k(a))}else throw new Error("Input geometry must be a Point or MultiPoint")}),Zn(t)}function Mo(n,e,t){t===void 0&&(t={});var r=Wo(n),i=Wo(e),a=ku(i[1]-r[1]),o=ku(i[0]-r[0]),s=ku(r[1]),l=ku(i[1]),u=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(s)*Math.cos(l);return ZM(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),t.units)}function kZe(n,e){var t=!1;return Zn(P4r(n.features.map(function(r){var i={x:r.geometry.coordinates[0],y:r.geometry.coordinates[1]};return e?i.z=r.properties[e]:r.geometry.coordinates.length===3&&(t=!0,i.z=r.geometry.coordinates[2]),i})).map(function(r){var i=[r.a.x,r.a.y],a=[r.b.x,r.b.y],o=[r.c.x,r.c.y],s={};return t?(i.push(r.a.z),a.push(r.b.z),o.push(r.c.z)):s={a:r.a.z,b:r.b.z,c:r.c.z},Qi([[i,a,o,i]],s)}))}var CMe=function(){function n(e,t,r){this.a=e,this.b=t,this.c=r;var i=t.x-e.x,a=t.y-e.y,o=r.x-e.x,s=r.y-e.y,l=i*(e.x+t.x)+a*(e.y+t.y),u=o*(e.x+r.x)+s*(e.y+r.y),h=2*(i*(r.y-t.y)-a*(r.x-t.x)),c,f;this.x=(s*l-a*u)/h,this.y=(i*u-o*l)/h,c=this.x-e.x,f=this.y-e.y,this.r=c*c+f*f}return n}();function I4r(n,e){return e.x-n.x}function L4r(n){var e=n.length,t,r,i,a,o;e:for(;e;)for(r=n[--e],t=n[--e],i=e;i;)if(o=n[--i],a=n[--i],t===a&&r===o||t===o&&r===a){n.splice(e,2),n.splice(i,2),e-=2;continue e}}function P4r(n){if(n.length<3)return[];n.sort(I4r);for(var e=n.length-1,t=n[e].x,r=n[0].x,i=n[e].y,a=i,o=1e-12,s,l,u,h,c,f;e--;)n[e].y<i&&(i=n[e].y),n[e].y>a&&(a=n[e].y);var d=r-t,v=a-i,p=d>v?d:v,g=(r+t)*.5,m=(a+i)*.5,y=[new CMe({__sentinel:!0,x:g-20*p,y:m-p},{__sentinel:!0,x:g,y:m+20*p},{__sentinel:!0,x:g+20*p,y:m-p})],_=[],x=[],S;for(e=n.length;e--;){for(x.length=0,S=y.length;S--;){if(d=n[e].x-y[S].x,d>0&&d*d>y[S].r){_.push(y[S]),y.splice(S,1);continue}v=n[e].y-y[S].y,!(d*d+v*v>y[S].r)&&(x.push(y[S].a,y[S].b,y[S].b,y[S].c,y[S].c,y[S].a),y.splice(S,1))}for(L4r(x),S=x.length;S;)l=x[--S],s=x[--S],u=n[e],h=l.x-s.x,c=l.y-s.y,f=2*(h*(u.y-l.y)-c*(u.x-l.x)),Math.abs(f)>o&&y.push(new CMe(s,l,u))}for(Array.prototype.push.apply(_,y),e=_.length;e--;)(_[e].a.__sentinel||_[e].b.__sentinel||_[e].c.__sentinel)&&_.splice(e,1);return _}function Xh(n){if(!n)throw new Error("geojson is required");switch(n.type){case"Feature":return FZe(n);case"FeatureCollection":return O4r(n);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Uhe(n);default:throw new Error("unknown GeoJSON type")}}function FZe(n){var e={type:"Feature"};return Object.keys(n).forEach(function(t){switch(t){case"type":case"properties":case"geometry":return;default:e[t]=n[t]}}),e.properties=BZe(n.properties),e.geometry=Uhe(n.geometry),e}function BZe(n){var e={};return n&&Object.keys(n).forEach(function(t){var r=n[t];typeof r=="object"?r===null?e[t]=null:Array.isArray(r)?e[t]=r.map(function(i){return i}):e[t]=BZe(r):e[t]=r}),e}function O4r(n){var e={type:"FeatureCollection"};return Object.keys(n).forEach(function(t){switch(t){case"type":case"features":return;default:e[t]=n[t]}}),e.features=n.features.map(function(t){return FZe(t)}),e}function Uhe(n){var e={type:n.type};return n.bbox&&(e.bbox=n.bbox),n.type==="GeometryCollection"?(e.geometries=n.geometries.map(function(t){return Uhe(t)}),e):(e.coordinates=GZe(n.coordinates),e)}function GZe(n){var e=n;return typeof e[0]!="object"?e.slice():e.map(function(t){return GZe(t)})}function R4r(n,e){if(e===void 0&&(e={}),e=e||{},!Io(e))throw new Error("options is invalid");var t=e.mutate;if(zf(n)!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");(t===!1||t===void 0)&&(n=Xh(n));var r=[],i=Fhe(n,function(a,o){var s=D4r(a,o);return s||(r.push(a),o)});return i&&r.push(i),r.length?r.length===1?r[0]:Pw(r.map(function(a){return a.coordinates})):null}function k6(n){return n[0].toString()+","+n[1].toString()}function D4r(n,e){var t=n.geometry.coordinates,r=e.geometry.coordinates,i=k6(t[0]),a=k6(t[t.length-1]),o=k6(r[0]),s=k6(r[r.length-1]),l;if(i===s)l=r.concat(t.slice(1));else if(o===a)l=t.concat(r.slice(1));else if(i===o)l=t.slice(1).reverse().concat(r);else if(a===s)l=t.concat(r.reverse().slice(1));else return null;return yo(l)}function N4r(n){return n}function k4r(n){if(n==null)return N4r;var e,t,r=n.scale[0],i=n.scale[1],a=n.translate[0],o=n.translate[1];return function(s,l){l||(e=t=0);var u=2,h=s.length,c=new Array(h);for(c[0]=(e+=s[0])*r+a,c[1]=(t+=s[1])*i+o;u<h;)c[u]=s[u],++u;return c}}function F4r(n,e){for(var t,r=n.length,i=r-e;i<--r;)t=n[i],n[i++]=n[r],n[r]=t}function zZe(n,e){var t=k4r(n.transform),r=n.arcs;function i(h,c){c.length&&c.pop();for(var f=r[h<0?~h:h],d=0,v=f.length;d<v;++d)c.push(t(f[d],d));h<0&&F4r(c,v)}function a(h){return t(h)}function o(h){for(var c=[],f=0,d=h.length;f<d;++f)i(h[f],c);return c.length<2&&c.push(c[0]),c}function s(h){for(var c=o(h);c.length<4;)c.push(c[0]);return c}function l(h){return h.map(s)}function u(h){var c=h.type,f;switch(c){case"GeometryCollection":return{type:c,geometries:h.geometries.map(u)};case"Point":f=a(h.coordinates);break;case"MultiPoint":f=h.coordinates.map(a);break;case"LineString":f=o(h.arcs);break;case"MultiLineString":f=h.arcs.map(o);break;case"Polygon":f=l(h.arcs);break;case"MultiPolygon":f=h.arcs.map(l);break;default:return null}return{type:c,coordinates:f}}return u(e)}function B4r(n,e){var t={},r={},i={},a=[],o=-1;e.forEach(function(u,h){var c=n.arcs[u<0?~u:u],f;c.length<3&&!c[1][0]&&!c[1][1]&&(f=e[++o],e[o]=u,e[h]=f)}),e.forEach(function(u){var h=s(u),c=h[0],f=h[1],d,v;if(d=i[c])if(delete i[d.end],d.push(u),d.end=f,v=r[f]){delete r[v.start];var p=v===d?d:d.concat(v);r[p.start=d.start]=i[p.end=v.end]=p}else r[d.start]=i[d.end]=d;else if(d=r[f])if(delete r[d.start],d.unshift(u),d.start=c,v=i[c]){delete i[v.end];var g=v===d?d:v.concat(d);r[g.start=v.start]=i[g.end=d.end]=g}else r[d.start]=i[d.end]=d;else d=[u],r[d.start=c]=i[d.end=f]=d});function s(u){var h=n.arcs[u<0?~u:u],c=h[0],f;return n.transform?(f=[0,0],h.forEach(function(d){f[0]+=d[0],f[1]+=d[1]})):f=h[h.length-1],u<0?[f,c]:[c,f]}function l(u,h){for(var c in u){var f=u[c];delete h[f.start],delete f.start,delete f.end,f.forEach(function(d){t[d<0?~d:d]=1}),a.push(f)}}return l(i,r),l(r,i),e.forEach(function(u){t[u<0?~u:u]||a.push([u])}),a}function G4r(n){for(var e=-1,t=n.length,r,i=n[t-1],a=0;++e<t;)r=i,i=n[e],a+=r[0]*i[1]-r[1]*i[0];return Math.abs(a)}function z4r(n){return zZe(n,U4r.apply(this,arguments))}function U4r(n,e){var t={},r=[],i=[];e.forEach(a);function a(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(a);break;case"Polygon":o(l.arcs);break;case"MultiPolygon":l.arcs.forEach(o);break}}function o(l){l.forEach(function(u){u.forEach(function(h){(t[h=h<0?~h:h]||(t[h]=[])).push(l)})}),r.push(l)}function s(l){return G4r(zZe(n,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var u=[],h=[l];for(l._=1,i.push(u);l=h.pop();)u.push(l),l.forEach(function(c){c.forEach(function(f){t[f<0?~f:f].forEach(function(d){d._||(d._=1,h.push(d))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var u=[],h;if(l.forEach(function(p){p.forEach(function(g){g.forEach(function(m){t[m<0?~m:m].length<2&&u.push(m)})})}),u=B4r(n,u),(h=u.length)>1)for(var c=1,f=s(u[0]),d,v;c<h;++c)(d=s(u[c]))>f&&(v=u[0],u[0]=u[c],u[c]=v,f=d);return u}).filter(function(l){return l.length>0})}}var y$=Object.prototype.hasOwnProperty;function V4r(n){var e=1/0,t=1/0,r=-1/0,i=-1/0;function a(c){c!=null&&y$.call(o,c.type)&&o[c.type](c)}var o={GeometryCollection:function(c){c.geometries.forEach(a)},Point:function(c){s(c.coordinates)},MultiPoint:function(c){c.coordinates.forEach(s)},LineString:function(c){l(c.arcs)},MultiLineString:function(c){c.arcs.forEach(l)},Polygon:function(c){c.arcs.forEach(l)},MultiPolygon:function(c){c.arcs.forEach(u)}};function s(c){var f=c[0],d=c[1];f<e&&(e=f),f>r&&(r=f),d<t&&(t=d),d>i&&(i=d)}function l(c){c.forEach(s)}function u(c){c.forEach(l)}for(var h in n)a(n[h]);return r>=e&&i>=t?[e,t,r,i]:void 0}function $4r(n,e,t,r,i){arguments.length===3&&(r=Array,i=null);for(var a=new r(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),o=n-1,s=0;s<n;++s)a[s]=i;function l(c){for(var f=e(c)&o,d=a[f],v=0;d!=i;){if(t(d,c))return!0;if(++v>=n)throw new Error("full hashset");d=a[f=f+1&o]}return a[f]=c,!0}function u(c){for(var f=e(c)&o,d=a[f],v=0;d!=i;){if(t(d,c))return!0;if(++v>=n)break;d=a[f=f+1&o]}return!1}function h(){for(var c=[],f=0,d=a.length;f<d;++f){var v=a[f];v!=i&&c.push(v)}return c}return{add:l,has:u,values:h}}function Vhe(n,e,t,r,i,a){arguments.length===3&&(r=a=Array,i=null);for(var o=new r(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),s=new a(n),l=n-1,u=0;u<n;++u)o[u]=i;function h(v,p){for(var g=e(v)&l,m=o[g],y=0;m!=i;){if(t(m,v))return s[g]=p;if(++y>=n)throw new Error("full hashmap");m=o[g=g+1&l]}return o[g]=v,s[g]=p,p}function c(v,p){for(var g=e(v)&l,m=o[g],y=0;m!=i;){if(t(m,v))return s[g];if(++y>=n)throw new Error("full hashmap");m=o[g=g+1&l]}return o[g]=v,s[g]=p,p}function f(v,p){for(var g=e(v)&l,m=o[g],y=0;m!=i;){if(t(m,v))return s[g];if(++y>=n)break;m=o[g=g+1&l]}return p}function d(){for(var v=[],p=0,g=o.length;p<g;++p){var m=o[p];m!=i&&v.push(m)}return v}return{set:h,maybeSet:c,get:f,keys:d}}function Kb(n,e){return n[0]===e[0]&&n[1]===e[1]}var UZe=new ArrayBuffer(16),AMe=new Float64Array(UZe),F6=new Uint32Array(UZe);function wre(n){AMe[0]=n[0],AMe[1]=n[1];var e=F6[0]^F6[1];return e=e<<5^e>>7^F6[2]^F6[3],e&2147483647}function W4r(n){var e=n.coordinates,t=n.lines,r=n.rings,i=w(),a=new Int32Array(e.length),o=new Int32Array(e.length),s=new Int32Array(e.length),l=new Int8Array(e.length),u=0,h,c,f,d,v;for(h=0,c=e.length;h<c;++h)a[h]=o[h]=s[h]=-1;for(h=0,c=t.length;h<c;++h){var p=t[h],g=p[0],m=p[1];for(d=i[g],v=i[++g],++u,l[d]=1;++g<=m;)S(h,f=d,d=v,v=i[g]);++u,l[v]=1}for(h=0,c=e.length;h<c;++h)a[h]=-1;for(h=0,c=r.length;h<c;++h){var y=r[h],_=y[0]+1,x=y[1];for(f=i[x-1],d=i[_-1],v=i[_],S(h,f,d,v);++_<=x;)S(h,f=d,d=v,v=i[_])}function S(A,M,I,R){if(a[I]!==A){a[I]=A;var k=o[I];if(k>=0){var D=s[I];(k!==M||D!==R)&&(k!==R||D!==M)&&(++u,l[I]=1)}else o[I]=M,s[I]=R}}function w(){for(var A=Vhe(e.length*1.4,b,E,Int32Array,-1,Int32Array),M=new Int32Array(e.length),I=0,R=e.length;I<R;++I)M[I]=A.maybeSet(I,I);return M}function b(A){return wre(e[A])}function E(A,M){return Kb(e[A],e[M])}a=o=s=null;var T=$4r(u*1.4,wre,Kb),C;for(h=0,c=e.length;h<c;++h)l[C=i[h]]&&T.add(e[C]);return T}function H4r(n){var e=W4r(n),t=n.coordinates,r=n.lines,i=n.rings,a,o,s;for(o=0,s=r.length;o<s;++o)for(var l=r[o],u=l[0],h=l[1];++u<h;)e.has(t[u])&&(a={0:u,1:l[1]},l[1]=u,l=l.next=a);for(o=0,s=i.length;o<s;++o)for(var c=i[o],f=c[0],d=f,v=c[1],p=e.has(t[f]);++d<v;)e.has(t[d])&&(p?(a={0:d,1:c[1]},c[1]=d,c=c.next=a):(j4r(t,f,v,v-d),t[v]=t[f],p=!0,d=f));return n}function j4r(n,e,t,r){aZ(n,e,t),aZ(n,e,e+r),aZ(n,e+r,t)}function aZ(n,e,t){for(var r=e+(t---e>>1),i;e<r;++e,--t)i=n[e],n[e]=n[t],n[t]=i}function X4r(n){var e=n.coordinates,t=n.lines,r,i=n.rings,a,o=t.length+i.length,s,l;for(delete n.lines,delete n.rings,s=0,l=t.length;s<l;++s)for(r=t[s];r=r.next;)++o;for(s=0,l=i.length;s<l;++s)for(a=i[s];a=a.next;)++o;var u=Vhe(o*2*1.4,wre,Kb),h=n.arcs=[];for(s=0,l=t.length;s<l;++s){r=t[s];do c(r);while(r=r.next)}for(s=0,l=i.length;s<l;++s)if(a=i[s],a.next)do c(a);while(a=a.next);else f(a);function c(y){var _,x,S,w,b,E,T,C;if(S=u.get(_=e[y[0]])){for(T=0,C=S.length;T<C;++T)if(w=S[T],d(w,y)){y[0]=w[0],y[1]=w[1];return}}if(b=u.get(x=e[y[1]])){for(T=0,C=b.length;T<C;++T)if(E=b[T],v(E,y)){y[1]=E[0],y[0]=E[1];return}}S?S.push(y):u.set(_,[y]),b?b.push(y):u.set(x,[y]),h.push(y)}function f(y){var _,x,S,w,b;if(x=u.get(_=e[y[0]]))for(w=0,b=x.length;w<b;++w){if(S=x[w],p(S,y)){y[0]=S[0],y[1]=S[1];return}if(g(S,y)){y[0]=S[1],y[1]=S[0];return}}if(x=u.get(_=e[y[0]+m(y)]))for(w=0,b=x.length;w<b;++w){if(S=x[w],p(S,y)){y[0]=S[0],y[1]=S[1];return}if(g(S,y)){y[0]=S[1],y[1]=S[0];return}}x?x.push(y):u.set(_,[y]),h.push(y)}function d(y,_){var x=y[0],S=_[0],w=y[1],b=_[1];if(x-w!==S-b)return!1;for(;x<=w;++x,++S)if(!Kb(e[x],e[S]))return!1;return!0}function v(y,_){var x=y[0],S=_[0],w=y[1],b=_[1];if(x-w!==S-b)return!1;for(;x<=w;++x,--b)if(!Kb(e[x],e[b]))return!1;return!0}function p(y,_){var x=y[0],S=_[0],w=y[1],b=_[1],E=w-x;if(E!==b-S)return!1;for(var T=m(y),C=m(_),A=0;A<E;++A)if(!Kb(e[x+(A+T)%E],e[S+(A+C)%E]))return!1;return!0}function g(y,_){var x=y[0],S=_[0],w=y[1],b=_[1],E=w-x;if(E!==b-S)return!1;for(var T=m(y),C=E-m(_),A=0;A<E;++A)if(!Kb(e[x+(A+T)%E],e[b-(A+C)%E]))return!1;return!0}function m(y){for(var _=y[0],x=y[1],S=_,w=S,b=e[S];++S<x;){var E=e[S];(E[0]<b[0]||E[0]===b[0]&&E[1]<b[1])&&(w=S,b=E)}return w-_}return n}function Y4r(n){for(var e=-1,t=n.length;++e<t;){for(var r=n[e],i=0,a=1,o=r.length,s=r[0],l=s[0],u=s[1],h,c;++i<o;)s=r[i],h=s[0],c=s[1],(h!==l||c!==u)&&(r[a++]=[h-l,c-u],l=h,u=c);a===1&&(r[a++]=[0,0]),r.length=a}return n}function q4r(n){var e=-1,t=[],r=[],i=[];function a(c){c&&y$.call(o,c.type)&&o[c.type](c)}var o={GeometryCollection:function(c){c.geometries.forEach(a)},LineString:function(c){c.arcs=s(c.arcs)},MultiLineString:function(c){c.arcs=c.arcs.map(s)},Polygon:function(c){c.arcs=c.arcs.map(l)},MultiPolygon:function(c){c.arcs=c.arcs.map(u)}};function s(c){for(var f=0,d=c.length;f<d;++f)i[++e]=c[f];var v={0:e-d+1,1:e};return t.push(v),v}function l(c){for(var f=0,d=c.length;f<d;++f)i[++e]=c[f];var v={0:e-d+1,1:e};return r.push(v),v}function u(c){return c.map(l)}for(var h in n)a(n[h]);return{type:"Topology",coordinates:i,lines:t,rings:r,objects:n}}function Z4r(n){var e={},t;for(t in n)e[t]=K4r(n[t]);return e}function K4r(n){return n==null?{type:null}:(n.type==="FeatureCollection"?J4r:n.type==="Feature"?VZe:$he)(n)}function J4r(n){var e={type:"GeometryCollection",geometries:n.features.map(VZe)};return n.bbox!=null&&(e.bbox=n.bbox),e}function VZe(n){var e=$he(n.geometry),t;n.id!=null&&(e.id=n.id),n.bbox!=null&&(e.bbox=n.bbox);for(t in n.properties){e.properties=n.properties;break}return e}function $he(n){if(n==null)return{type:null};var e=n.type==="GeometryCollection"?{type:"GeometryCollection",geometries:n.geometries.map($he)}:n.type==="Point"||n.type==="MultiPoint"?{type:n.type,coordinates:n.coordinates}:{type:n.type,arcs:n.coordinates};return n.bbox!=null&&(e.bbox=n.bbox),e}function Q4r(n,e,t){var r=e[0],i=e[1],a=e[2],o=e[3],s=a-r?(t-1)/(a-r):1,l=o-i?(t-1)/(o-i):1;function u(m){return[Math.round((m[0]-r)*s),Math.round((m[1]-i)*l)]}function h(m,y){for(var _=-1,x=0,S=m.length,w=new Array(S),b,E,T,C,A;++_<S;)b=m[_],C=Math.round((b[0]-r)*s),A=Math.round((b[1]-i)*l),(C!==E||A!==T)&&(w[x++]=[E=C,T=A]);for(w.length=x;x<y;)x=w.push([w[0][0],w[0][1]]);return w}function c(m){return h(m,2)}function f(m){return h(m,4)}function d(m){return m.map(f)}function v(m){m!=null&&y$.call(p,m.type)&&p[m.type](m)}var p={GeometryCollection:function(m){m.geometries.forEach(v)},Point:function(m){m.coordinates=u(m.coordinates)},MultiPoint:function(m){m.coordinates=m.coordinates.map(u)},LineString:function(m){m.arcs=c(m.arcs)},MultiLineString:function(m){m.arcs=m.arcs.map(c)},Polygon:function(m){m.arcs=d(m.arcs)},MultiPolygon:function(m){m.arcs=m.arcs.map(d)}};for(var g in n)v(n[g]);return{scale:[1/s,1/l],translate:[r,i]}}function e5r(n,e){var t=V4r(n=Z4r(n)),r=e>0&&t&&Q4r(n,t,e),i=X4r(H4r(q4r(n))),a=i.coordinates,o=Vhe(i.arcs.length*1.4,t5r,r5r);n=i.objects,i.bbox=t,i.arcs=i.arcs.map(function(f,d){return o.set(f,d),a.slice(f[0],f[1]+1)}),delete i.coordinates,a=null;function s(f){f&&y$.call(l,f.type)&&l[f.type](f)}var l={GeometryCollection:function(f){f.geometries.forEach(s)},LineString:function(f){f.arcs=u(f.arcs)},MultiLineString:function(f){f.arcs=f.arcs.map(u)},Polygon:function(f){f.arcs=f.arcs.map(u)},MultiPolygon:function(f){f.arcs=f.arcs.map(h)}};function u(f){var d=[];do{var v=o.get(f);d.push(f[0]<f[1]?v:~v)}while(f=f.next);return d}function h(f){return f.map(u)}for(var c in n)s(n[c]);return r&&(i.transform=r,i.arcs=Y4r(i.arcs)),i}function t5r(n){var e=n[0],t=n[1],r;return t<e&&(r=e,e=t,t=r),e+31*t}function r5r(n,e){var t=n[0],r=n[1],i=e[0],a=e[1],o;return r<t&&(o=t,t=r,r=o),a<i&&(o=i,i=a,a=o),t===i&&r===a}function n5r(n,e){if(e===void 0&&(e={}),zf(n)!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");(e.mutate===!1||e.mutate===void 0)&&(n=Xh(n));var t=[];fh(n,function(a){t.push(a.geometry)});var r=e5r({geoms:Lhe(t).geometry}),i=z4r(r,r.objects.geoms.geometries);return i}function i5r(n,e){if(e===void 0&&(e={}),e=e||{},!Io(e))throw new Error("options is invalid");var t=e.mutate;if(zf(n)!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");(t===!1||t===void 0)&&(n=Xh(n));var r=a5r(n);if(!r)throw new Error("geojson must be homogenous");var i=n;switch(r){case"LineString":return R4r(i,e);case"Polygon":return n5r(i,e);default:throw new Error(r+" is not supported")}}function a5r(n){var e={};fh(n,function(r){e[r.geometry.type]=!0});var t=Object.keys(e);return t.length===1?t[0]:null}function o5r(n,e){e===void 0&&(e={});var t=e.maxEdge||1/0,r=s5r(n),i=kZe(r);if(i.features=i.features.filter(function(o){var s=o.geometry.coordinates[0][0],l=o.geometry.coordinates[0][1],u=o.geometry.coordinates[0][2],h=Mo(s,l,e),c=Mo(l,u,e),f=Mo(s,u,e);return h<=t&&c<=t&&f<=t}),i.features.length<1)return null;var a=i5r(i);return a.coordinates.length===1&&(a.coordinates=a.coordinates[0],a.type="Polygon"),fu(a)}function s5r(n){var e=[],t={};return uo(n,function(r){if(!!r.geometry){var i=r.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(t,i)||(e.push(r),t[i]=!0)}}),Zn(e)}var Wk={exports:{}},$Ze={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(at,function(){function t(o,s,l,u,h){r(o,s,l||0,u||o.length-1,h||a)}function r(o,s,l,u,h){for(;u>l;){if(u-l>600){var c=u-l+1,f=s-l+1,d=Math.log(c),v=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*v*(c-v)/c)*(f-c/2<0?-1:1),g=Math.max(l,Math.floor(s-f*v/c+p)),m=Math.min(u,Math.floor(s+(c-f)*v/c+p));r(o,s,g,m,h)}var y=o[s],_=l,x=u;for(i(o,l,s),h(o[u],y)>0&&i(o,l,u);_<x;){for(i(o,_,x),_++,x--;h(o[_],y)<0;)_++;for(;h(o[x],y)>0;)x--}h(o[l],y)===0?i(o,l,x):(x++,i(o,x,u)),x<=s&&(l=x+1),s<=x&&(u=x-1)}}function i(o,s,l){var u=o[s];o[s]=o[l],o[l]=u}function a(o,s){return o<s?-1:o>s?1:0}return t})})($Ze);Wk.exports=SN;Wk.exports.default=SN;var l5r=$Ze.exports;function SN(n,e){if(!(this instanceof SN))return new SN(n,e);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),e&&this._initFormat(e),this.clear()}SN.prototype={all:function(){return this._all(this.data,[])},search:function(n){var e=this.data,t=[],r=this.toBBox;if(!G6(n,e))return t;for(var i=[],a,o,s,l;e;){for(a=0,o=e.children.length;a<o;a++)s=e.children[a],l=e.leaf?r(s):s,G6(n,l)&&(e.leaf?t.push(s):sZ(n,l)?this._all(s,t):i.push(s));e=i.pop()}return t},collides:function(n){var e=this.data,t=this.toBBox;if(!G6(n,e))return!1;for(var r=[],i,a,o,s;e;){for(i=0,a=e.children.length;i<a;i++)if(o=e.children[i],s=e.leaf?t(o):o,G6(n,s)){if(e.leaf||sZ(n,s))return!0;r.push(o)}e=r.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var e=0,t=n.length;e<t;e++)this.insert(n[e]);return this}var r=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=r;else if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=iA([]),this},remove:function(n,e){if(!n)return this;for(var t=this.data,r=this.toBBox(n),i=[],a=[],o,s,l,u;t||i.length;){if(t||(t=i.pop(),s=i[i.length-1],o=a.pop(),u=!0),t.leaf&&(l=u5r(n,t.children,e),l!==-1))return t.children.splice(l,1),i.push(t),this._condense(i),this;!u&&!t.leaf&&sZ(t,r)?(i.push(t),a.push(o),o=0,s=t,t=t.children[0]):s?(o++,t=s.children[o],u=!1):t=null}return this},toBBox:function(n){return n},compareMinX:MMe,compareMinY:IMe,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,e){for(var t=[];n;)n.leaf?e.push.apply(e,n.children):t.push.apply(t,n.children),n=t.pop();return e},_build:function(n,e,t,r){var i=t-e+1,a=this._maxEntries,o;if(i<=a)return o=iA(n.slice(e,t+1)),MC(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=iA([]),o.leaf=!1,o.height=r;var s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a)),u,h,c,f;for(LMe(n,e,t,l,this.compareMinX),u=e;u<=t;u+=l)for(c=Math.min(u+l-1,t),LMe(n,u,c,s,this.compareMinY),h=u;h<=c;h+=s)f=Math.min(h+s-1,c),o.children.push(this._build(n,h,f,r-1));return MC(o,this.toBBox),o},_chooseSubtree:function(n,e,t,r){for(var i,a,o,s,l,u,h,c;r.push(e),!(e.leaf||r.length-1===t);){for(h=c=1/0,i=0,a=e.children.length;i<a;i++)o=e.children[i],l=oZ(o),u=h5r(n,o)-l,u<c?(c=u,h=l<h?l:h,s=o):u===c&&l<h&&(h=l,s=o);e=s||e.children[0]}return e},_insert:function(n,e,t){var r=this.toBBox,i=t?n:r(n),a=[],o=this._chooseSubtree(i,this.data,e,a);for(o.children.push(n),RO(o,i);e>=0&&a[e].children.length>this._maxEntries;)this._split(a,e),e--;this._adjustParentBBoxes(i,a,e)},_split:function(n,e){var t=n[e],r=t.children.length,i=this._minEntries;this._chooseSplitAxis(t,i,r);var a=this._chooseSplitIndex(t,i,r),o=iA(t.children.splice(a,t.children.length-a));o.height=t.height,o.leaf=t.leaf,MC(t,this.toBBox),MC(o,this.toBBox),e?n[e-1].children.push(o):this._splitRoot(t,o)},_splitRoot:function(n,e){this.data=iA([n,e]),this.data.height=n.height+1,this.data.leaf=!1,MC(this.data,this.toBBox)},_chooseSplitIndex:function(n,e,t){var r,i,a,o,s,l,u,h;for(l=u=1/0,r=e;r<=t-e;r++)i=OO(n,0,r,this.toBBox),a=OO(n,r,t,this.toBBox),o=c5r(i,a),s=oZ(i)+oZ(a),o<l?(l=o,h=r,u=s<u?s:u):o===l&&s<u&&(u=s,h=r);return h},_chooseSplitAxis:function(n,e,t){var r=n.leaf?this.compareMinX:MMe,i=n.leaf?this.compareMinY:IMe,a=this._allDistMargin(n,e,t,r),o=this._allDistMargin(n,e,t,i);a<o&&n.children.sort(r)},_allDistMargin:function(n,e,t,r){n.children.sort(r);var i=this.toBBox,a=OO(n,0,e,i),o=OO(n,t-e,t,i),s=B6(a)+B6(o),l,u;for(l=e;l<t-e;l++)u=n.children[l],RO(a,n.leaf?i(u):u),s+=B6(a);for(l=t-e-1;l>=e;l--)u=n.children[l],RO(o,n.leaf?i(u):u),s+=B6(o);return s},_adjustParentBBoxes:function(n,e,t){for(var r=t;r>=0;r--)RO(e[r],n)},_condense:function(n){for(var e=n.length-1,t;e>=0;e--)n[e].children.length===0?e>0?(t=n[e-1].children,t.splice(t.indexOf(n[e]),1)):this.clear():MC(n[e],this.toBBox)},_initFormat:function(n){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(n[0])),this.compareMinY=new Function("a","b",e.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function u5r(n,e,t){if(!t)return e.indexOf(n);for(var r=0;r<e.length;r++)if(t(n,e[r]))return r;return-1}function MC(n,e){OO(n,0,n.children.length,e,n)}function OO(n,e,t,r,i){i||(i=iA(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e,o;a<t;a++)o=n.children[a],RO(i,n.leaf?r(o):o);return i}function RO(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function MMe(n,e){return n.minX-e.minX}function IMe(n,e){return n.minY-e.minY}function oZ(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function B6(n){return n.maxX-n.minX+(n.maxY-n.minY)}function h5r(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function c5r(n,e){var t=Math.max(n.minX,e.minX),r=Math.max(n.minY,e.minY),i=Math.min(n.maxX,e.maxX),a=Math.min(n.maxY,e.maxY);return Math.max(0,i-t)*Math.max(0,a-r)}function sZ(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function G6(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function iA(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function LMe(n,e,t,r,i){for(var a=[e,t],o;a.length;)t=a.pop(),e=a.pop(),!(t-e<=r)&&(o=e+Math.ceil((t-e)/r/2)*r,l5r(n,o,e,t,i),a.push(e,o,o,t))}function f5r(n,e,t,r){var i=Wk.exports(6),a=e.features.map(function(o){var s;return{minX:o.geometry.coordinates[0],minY:o.geometry.coordinates[1],maxX:o.geometry.coordinates[0],maxY:o.geometry.coordinates[1],property:(s=o.properties)===null||s===void 0?void 0:s[t]}});return i.load(a),n.features.forEach(function(o){o.properties||(o.properties={});var s=yl(o),l=i.search({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}),u=[];l.forEach(function(h){ss([h.minX,h.minY],o)&&u.push(h.property)}),o.properties[r]=u}),n}function d5r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.mutate;if(!n)throw new Error("geojson is required");return(t===!1||t===void 0)&&(n=Xh(n)),gl(n,function(r){var i=r[0],a=r[1];r[0]=a,r[1]=i}),n}function E2(n,e){e===void 0&&(e={});var t=typeof e=="object"?e.mutate:e;if(!n)throw new Error("geojson is required");var r=zf(n),i=[];switch(r){case"LineString":i=lZ(n);break;case"MultiLineString":case"Polygon":ri(n).forEach(function(o){i.push(lZ(o))});break;case"MultiPolygon":ri(n).forEach(function(o){var s=[];o.forEach(function(l){s.push(lZ(l))}),i.push(s)});break;case"Point":return n;case"MultiPoint":var a={};ri(n).forEach(function(o){var s=o.join("-");Object.prototype.hasOwnProperty.call(a,s)||(i.push(o),a[s]=!0)});break;default:throw new Error(r+" geometry not supported")}return n.coordinates?t===!0?(n.coordinates=i,n):{type:r,coordinates:i}:t===!0?(n.geometry.coordinates=i,n):fu({type:r,coordinates:i},n.properties,{bbox:n.bbox,id:n.id})}function lZ(n){var e=ri(n);if(e.length===2&&!PMe(e[0],e[1]))return e;var t=[],r=e.length-1,i=t.length;t.push(e[0]);for(var a=1;a<r;a++){var o=t[t.length-1];e[a][0]===o[0]&&e[a][1]===o[1]||(t.push(e[a]),i=t.length,i>2&&OMe(t[i-3],t[i-1],t[i-2])&&t.splice(t.length-2,1))}if(t.push(e[e.length-1]),i=t.length,PMe(e[0],e[e.length-1])&&i<4)throw new Error("invalid polygon");return OMe(t[i-3],t[i-1],t[i-2])&&t.splice(t.length-2,1),t}function PMe(n,e){return n[0]===e[0]&&n[1]===e[1]}function OMe(n,e,t){var r=t[0],i=t[1],a=n[0],o=n[1],s=e[0],l=e[1],u=r-a,h=i-o,c=s-a,f=l-o,d=u*f-h*c;return d!==0?!1:Math.abs(c)>=Math.abs(f)?c>0?a<=r&&r<=s:s<=r&&r<=a:f>0?o<=i&&i<=l:l<=i&&i<=o}function v5r(n,e){var t=n.x-e.x,r=n.y-e.y;return t*t+r*r}function p5r(n,e,t){var r=e.x,i=e.y,a=t.x-r,o=t.y-i;if(a!==0||o!==0){var s=((n.x-r)*a+(n.y-i)*o)/(a*a+o*o);s>1?(r=t.x,i=t.y):s>0&&(r+=a*s,i+=o*s)}return a=n.x-r,o=n.y-i,a*a+o*o}function g5r(n,e){for(var t=n[0],r=[t],i,a=1,o=n.length;a<o;a++)i=n[a],v5r(i,t)>e&&(r.push(i),t=i);return t!==i&&r.push(i),r}function bre(n,e,t,r,i){for(var a=r,o,s=e+1;s<t;s++){var l=p5r(n[s],n[e],n[t]);l>a&&(o=s,a=l)}a>r&&(o-e>1&&bre(n,e,o,r,i),i.push(n[o]),t-o>1&&bre(n,o,t,r,i))}function y5r(n,e){var t=n.length-1,r=[n[0]];return bre(n,0,t,e,r),r.push(n[t]),r}function Ere(n,e,t){if(n.length<=2)return n;var r=e!==void 0?e*e:1;return n=t?n:g5r(n,r),n=y5r(n,r),n}function m5r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.tolerance!==void 0?e.tolerance:1,r=e.highQuality||!1,i=e.mutate||!1;if(!n)throw new Error("geojson is required");if(t&&t<0)throw new Error("invalid tolerance");return i!==!0&&(n=Xh(n)),Pd(n,function(a){_5r(a,t,r)}),n}function _5r(n,e,t){var r=n.type;if(r==="Point"||r==="MultiPoint")return n;E2(n,!0);var i=n.coordinates;switch(r){case"LineString":n.coordinates=RMe(i,e,t);break;case"MultiLineString":n.coordinates=i.map(function(a){return RMe(a,e,t)});break;case"Polygon":n.coordinates=DMe(i,e,t);break;case"MultiPolygon":n.coordinates=i.map(function(a){return DMe(a,e,t)})}return n}function RMe(n,e,t){return Ere(n.map(function(r){return{x:r[0],y:r[1],z:r[2]}}),e,t).map(function(r){return r.z?[r.x,r.y,r.z]:[r.x,r.y]})}function DMe(n,e,t){return n.map(function(r){var i=r.map(function(o){return{x:o[0],y:o[1]}});if(i.length<4)throw new Error("invalid polygon");for(var a=Ere(i,e,t).map(function(o){return[o.x,o.y]});!x5r(a);)e-=e*.01,a=Ere(i,e,t).map(function(o){return[o.x,o.y]});return(a[a.length-1][0]!==a[0][0]||a[a.length-1][1]!==a[0][1])&&a.push(a[0]),a})}function x5r(n){return n.length<3?!1:!(n.length===3&&n[2][0]===n[0][0]&&n[2][1]===n[0][1])}var S5r=function(){function n(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(var t=0;t<this.length-1;t++){var r=this.points[t],i=this.points[t+1];this.centers.push({x:(r.x+i.x)/2,y:(r.y+i.y)/2,z:(r.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var t=0;t<this.centers.length-1;t++){var a=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,o=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,s=this.points[t+1].z-(this.centers[t].y+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+a),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+o),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+s)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+a),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+o),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(e){var t=[],r=this.pos(0);t.push(0);for(var i=0;i<this.duration;i+=10){var a=this.pos(i),o=Math.sqrt((a.x-r.x)*(a.x-r.x)+(a.y-r.y)*(a.y-r.y)+(a.z-r.z)*(a.z-r.z));o>e&&(t.push(i),r=a)}return t},n.prototype.vector=function(e){var t=this.pos(e+10),r=this.pos(e-10);return{angle:180*Math.atan2(t.y-r.y,t.x-r.x)/3.14,speed:Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)+(r.z-t.z)*(r.z-t.z))}},n.prototype.pos=function(e){var t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);var r=t/this.duration;if(r>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*r),a=(this.length-1)*r-i;return b5r(a,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},n}();const w5r=S5r;function b5r(n,e,t,r,i){var a=E5r(n),o={x:i.x*a[0]+r.x*a[1]+t.x*a[2]+e.x*a[3],y:i.y*a[0]+r.y*a[1]+t.y*a[2]+e.y*a[3],z:i.z*a[0]+r.z*a[1]+t.z*a[2]+e.z*a[3]};return o}function E5r(n){var e=n*n,t=e*n;return[t,3*e*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function NMe(n,e){e===void 0&&(e={});for(var t=e.resolution||1e4,r=e.sharpness||.85,i=[],a=ls(n).coordinates.map(function(u){return{x:u[0],y:u[1]}}),o=new w5r({duration:t,points:a,sharpness:r}),s=function(u){var h=o.pos(u);Math.floor(u/100)%2===0&&i.push([h.x,h.y])},l=0;l<o.duration;l+=10)s(l);return s(o.duration),yo(i,e.properties)}function T5r(n,e,t,r){return n=Xh(n),e=Xh(e),uo(n,function(i){i.properties||(i.properties={}),uo(e,function(a){i.properties[r]===void 0&&ss(i,a)&&(i.properties[r]=a.properties[t])})}),n}function C5r(n,e){if(!n)throw new Error("featurecollection is required");if(e==null)throw new Error("num is required");if(typeof e!="number")throw new Error("num must be a number");var t=Zn(A5r(n.features,e));return t}function A5r(n,e){for(var t=n.slice(0),r=n.length,i=r-e,a,o;r-- >i;)o=Math.floor((r+1)*Math.random()),a=t[o],t[o]=t[r],t[r]=a;return t.slice(i)}function Whe(n,e){e===void 0&&(e={});var t=Number(n[0]),r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[t,r],s=[t,a],l=[i,a],u=[i,r];return Qi([[o,u,l,s,o]],e.properties,{bbox:n,id:e.id})}function WZe(n){return Whe(yl(n))}function HZe(n){var e=n[0],t=n[1],r=n[2],i=n[3],a=Mo(n.slice(0,2),[r,t]),o=Mo(n.slice(0,2),[e,i]);if(a>=o){var s=(t+i)/2;return[e,s-(r-e)/2,r,s+(r-e)/2]}else{var l=(e+r)/2;return[l-(i-t)/2,t,l+(i-t)/2,i]}}function _m(n,e,t,r){r===void 0&&(r={});var i=Wo(n),a=ku(i[0]),o=ku(i[1]),s=ku(t),l=S2(e,r.units),u=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(s)),h=a+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(u)),c=aw(h),f=aw(u);return Vi([c,f],r.properties)}function Hhe(n,e,t){t===void 0&&(t={});for(var r=t.steps||64,i=t.properties?t.properties:!Array.isArray(n)&&n.type==="Feature"&&n.properties?n.properties:{},a=[],o=0;o<r;o++)a.push(_m(n,e,o*-360/r,t).geometry.coordinates);return a.push(a[0]),Qi([a],i)}function x_(n,e,t){if(t===void 0&&(t={}),t.final===!0)return M5r(n,e);var r=Wo(n),i=Wo(e),a=ku(r[0]),o=ku(i[0]),s=ku(r[1]),l=ku(i[1]),u=Math.sin(o-a)*Math.cos(l),h=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(o-a);return aw(Math.atan2(u,h))}function M5r(n,e){var t=x_(e,n);return t=(t+180)%360,t}function I5r(n,e){var t=Mo(n,e),r=x_(n,e),i=_m(n,t/2,r);return i}function m$(n,e){e===void 0&&(e={});var t=yl(n),r=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Vi([r,i],e.properties,e)}function ow(n,e){e===void 0&&(e={});var t=0,r=0,i=0;return gl(n,function(a){t+=a[0],r+=a[1],i++},!0),Vi([t/i,r/i],e.properties)}function jZe(n,e){switch(e===void 0&&(e={}),zf(n)){case"Point":return Vi(Wo(n),e.properties);case"Polygon":var t=[];gl(n,function(x){t.push(x)});var r=ow(n,{properties:e.properties}),i=r.geometry.coordinates,a=0,o=0,s=0,l,u,h,c,f,d,v,p,g=t.map(function(x){return[x[0]-i[0],x[1]-i[1]]});for(l=0;l<t.length-1;l++)u=g[l],c=u[0],d=u[1],h=g[l+1],f=h[0],v=h[1],p=c*v-f*d,s+=p,a+=(c+f)*p,o+=(d+v)*p;if(s===0)return r;var m=s*.5,y=1/(6*m);return Vi([i[0]+y*a,i[1]+y*o],e.properties);default:var _=NZe(n);return _?jZe(_,{properties:e.properties}):ow(n,{properties:e.properties})}}function L5r(n){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return uo(n,function(t){var r,i,a,o;switch((o=t.geometry)===null||o===void 0?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(r=e.MultiPoint.coordinates).push.apply(r,t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(i=e.MultiLineString.coordinates).push.apply(i,t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(a=e.MultiPolygon.coordinates).push.apply(a,t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break}}),Zn(Object.keys(e).filter(function(t){return e[t].coordinates.length}).sort().map(function(t){var r={type:t,coordinates:e[t].coordinates},i={collectedProperties:e[t].properties};return fu(r,i)}))}function _$(n){var e=[];return n.type==="FeatureCollection"?uo(n,function(t){gl(t,function(r){e.push(Vi(r,t.properties))})}):gl(n,function(t){e.push(Vi(t,n.properties))}),Zn(e)}var jhe={exports:{}};jhe.exports=x$;jhe.exports.default=x$;function x$(n,e,t){t=t||2;var r=e&&e.length,i=r?e[0]*t:n.length,a=XZe(n,0,i,t,!0),o=[];if(!a||a.next===a.prev)return o;var s,l,u,h,c,f,d;if(r&&(a=N5r(n,e,a,t)),n.length>80*t){s=u=n[0],l=h=n[1];for(var v=t;v<i;v+=t)c=n[v],f=n[v+1],c<s&&(s=c),f<l&&(l=f),c>u&&(u=c),f>h&&(h=f);d=Math.max(u-s,h-l),d=d!==0?32767/d:0}return wN(a,o,t,s,l,d,0),o}function XZe(n,e,t,r,i){var a,o;if(i===Are(n,e,t,r)>0)for(a=e;a<t;a+=r)o=kMe(a,n[a],n[a+1],o);else for(a=t-r;a>=e;a-=r)o=kMe(a,n[a],n[a+1],o);return o&&S$(o,o.next)&&(EN(o),o=o.next),o}function T2(n,e){if(!n)return n;e||(e=n);var t=n,r;do if(r=!1,!t.steiner&&(S$(t,t.next)||Ll(t.prev,t,t.next)===0)){if(EN(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function wN(n,e,t,r,i,a,o){if(!!n){!o&&a&&z5r(n,r,i,a);for(var s=n,l,u;n.prev!==n.next;){if(l=n.prev,u=n.next,a?O5r(n,r,i,a):P5r(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),EN(n),n=u.next,s=u.next;continue}if(n=u,n===s){o?o===1?(n=R5r(T2(n),e,t),wN(n,e,t,r,i,a,2)):o===2&&D5r(n,e,t,r,i,a):wN(T2(n),e,t,r,i,a,1);break}}}}function P5r(n){var e=n.prev,t=n,r=n.next;if(Ll(e,t,r)>=0)return!1;for(var i=e.x,a=t.x,o=r.x,s=e.y,l=t.y,u=r.y,h=i<a?i<o?i:o:a<o?a:o,c=s<l?s<u?s:u:l<u?l:u,f=i>a?i>o?i:o:a>o?a:o,d=s>l?s>u?s:u:l>u?l:u,v=r.next;v!==e;){if(v.x>=h&&v.x<=f&&v.y>=c&&v.y<=d&&MA(i,s,a,l,o,u,v.x,v.y)&&Ll(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function O5r(n,e,t,r){var i=n.prev,a=n,o=n.next;if(Ll(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,u=o.x,h=i.y,c=a.y,f=o.y,d=s<l?s<u?s:u:l<u?l:u,v=h<c?h<f?h:f:c<f?c:f,p=s>l?s>u?s:u:l>u?l:u,g=h>c?h>f?h:f:c>f?c:f,m=Tre(d,v,e,t,r),y=Tre(p,g,e,t,r),_=n.prevZ,x=n.nextZ;_&&_.z>=m&&x&&x.z<=y;){if(_.x>=d&&_.x<=p&&_.y>=v&&_.y<=g&&_!==i&&_!==o&&MA(s,h,l,c,u,f,_.x,_.y)&&Ll(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=d&&x.x<=p&&x.y>=v&&x.y<=g&&x!==i&&x!==o&&MA(s,h,l,c,u,f,x.x,x.y)&&Ll(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=p&&_.y>=v&&_.y<=g&&_!==i&&_!==o&&MA(s,h,l,c,u,f,_.x,_.y)&&Ll(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=d&&x.x<=p&&x.y>=v&&x.y<=g&&x!==i&&x!==o&&MA(s,h,l,c,u,f,x.x,x.y)&&Ll(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function R5r(n,e,t){var r=n;do{var i=r.prev,a=r.next.next;!S$(i,a)&&YZe(i,r,r.next,a)&&bN(i,a)&&bN(a,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(a.i/t|0),EN(r),EN(r.next),r=n=a),r=r.next}while(r!==n);return T2(r)}function D5r(n,e,t,r,i,a){var o=n;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&$5r(o,s)){var l=qZe(o,s);o=T2(o,o.next),l=T2(l,l.next),wN(o,e,t,r,i,a,0),wN(l,e,t,r,i,a,0);return}s=s.next}o=o.next}while(o!==n)}function N5r(n,e,t,r){var i=[],a,o,s,l,u;for(a=0,o=e.length;a<o;a++)s=e[a]*r,l=a<o-1?e[a+1]*r:n.length,u=XZe(n,s,l,r,!1),u===u.next&&(u.steiner=!0),i.push(V5r(u));for(i.sort(k5r),a=0;a<i.length;a++)t=F5r(i[a],t);return t}function k5r(n,e){return n.x-e.x}function F5r(n,e){var t=B5r(n,e);if(!t)return e;var r=qZe(t,n);return T2(r,r.next),T2(t,t.next)}function B5r(n,e){var t=e,r=n.x,i=n.y,a=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){var s=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(s<=r&&s>a&&(a=s,o=t.x<t.next.x?t:t.next,s===r))return o}t=t.next}while(t!==e);if(!o)return null;var l=o,u=o.x,h=o.y,c=1/0,f;t=o;do r>=t.x&&t.x>=u&&r!==t.x&&MA(i<h?r:a,i,u,h,i<h?a:r,i,t.x,t.y)&&(f=Math.abs(i-t.y)/(r-t.x),bN(t,n)&&(f<c||f===c&&(t.x>o.x||t.x===o.x&&G5r(o,t)))&&(o=t,c=f)),t=t.next;while(t!==l);return o}function G5r(n,e){return Ll(n.prev,n,e.prev)<0&&Ll(e.next,n,n.next)<0}function z5r(n,e,t,r){var i=n;do i.z===0&&(i.z=Tre(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,U5r(i)}function U5r(n){var e,t,r,i,a,o,s,l,u=1;do{for(t=n,n=null,a=null,o=0;t;){for(o++,r=t,s=0,e=0;e<u&&(s++,r=r.nextZ,!!r);e++);for(l=u;s>0||l>0&&r;)s!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:n=i,i.prevZ=a,a=i;t=r}a.nextZ=null,u*=2}while(o>1);return n}function Tre(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function V5r(n){var e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function MA(n,e,t,r,i,a,o,s){return(i-o)*(e-s)>=(n-o)*(a-s)&&(n-o)*(r-s)>=(t-o)*(e-s)&&(t-o)*(a-s)>=(i-o)*(r-s)}function $5r(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!W5r(n,e)&&(bN(n,e)&&bN(e,n)&&H5r(n,e)&&(Ll(n.prev,n,e.prev)||Ll(n,e.prev,e))||S$(n,e)&&Ll(n.prev,n,n.next)>0&&Ll(e.prev,e,e.next)>0)}function Ll(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function S$(n,e){return n.x===e.x&&n.y===e.y}function YZe(n,e,t,r){var i=U6(Ll(n,e,t)),a=U6(Ll(n,e,r)),o=U6(Ll(t,r,n)),s=U6(Ll(t,r,e));return!!(i!==a&&o!==s||i===0&&z6(n,t,e)||a===0&&z6(n,r,e)||o===0&&z6(t,n,r)||s===0&&z6(t,e,r))}function z6(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function U6(n){return n>0?1:n<0?-1:0}function W5r(n,e){var t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&YZe(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function bN(n,e){return Ll(n.prev,n,n.next)<0?Ll(n,e,n.next)>=0&&Ll(n,n.prev,e)>=0:Ll(n,e,n.prev)<0||Ll(n,n.next,e)<0}function H5r(n,e){var t=n,r=!1,i=(n.x+e.x)/2,a=(n.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&i<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function qZe(n,e){var t=new Cre(n.i,n.x,n.y),r=new Cre(e.i,e.x,e.y),i=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,a.next=r,r.prev=a,r}function kMe(n,e,t,r){var i=new Cre(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function EN(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Cre(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}x$.deviation=function(n,e,t,r){var i=e&&e.length,a=i?e[0]*t:n.length,o=Math.abs(Are(n,0,a,t));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*t,h=s<l-1?e[s+1]*t:n.length;o-=Math.abs(Are(n,u,h,t))}var c=0;for(s=0;s<r.length;s+=3){var f=r[s]*t,d=r[s+1]*t,v=r[s+2]*t;c+=Math.abs((n[f]-n[v])*(n[d+1]-n[f+1])-(n[f]-n[d])*(n[v+1]-n[f+1]))}return o===0&&c===0?0:Math.abs((c-o)/o)};function Are(n,e,t,r){for(var i=0,a=e,o=t-r;a<t;a+=r)i+=(n[o]-n[a])*(n[a+1]+n[o+1]),o=a;return i}x$.flatten=function(n){for(var e=n[0][0].length,t={vertices:[],holes:[],dimensions:e},r=0,i=0;i<n.length;i++){for(var a=0;a<n[i].length;a++)for(var o=0;o<e;o++)t.vertices.push(n[i][a][o]);i>0&&(r+=n[i-1].length,t.holes.push(r))}return t};function j5r(n){if(!n.geometry||n.geometry.type!=="Polygon"&&n.geometry.type!=="MultiPolygon")throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return n.geometry.type==="Polygon"?e.features=FMe(n.geometry.coordinates):n.geometry.coordinates.forEach(function(t){e.features=e.features.concat(FMe(t))}),e}function FMe(n){var e=X5r(n),t=2,r=jhe.exports(e.vertices,e.holes,t),i=[],a=[];r.forEach(function(l,u){var h=r[u];a.push([e.vertices[h*t],e.vertices[h*t+1]])});for(var o=0;o<a.length;o+=3){var s=a.slice(o,o+3);s.push(a[o]),i.push(Qi([s]))}return i}function X5r(n){for(var e=n[0][0].length,t={vertices:[],holes:[],dimensions:e},r=0,i=0;i<n.length;i++){for(var a=0;a<n[i].length;a++)for(var o=0;o<e;o++)t.vertices.push(n[i][a][o]);i>0&&(r+=n[i-1].length,t.holes.push(r))}return t}function D7(n,e){if(!n)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var t,r=1/0,i=0;return uo(e,function(a,o){var s=Mo(n,a);s<r&&(i=o,r=s)}),t=Xh(e.features[i]),t.properties.featureIndex=i,t.properties.distanceToPoint=r,t}function C2(n){if(!n)throw new Error("geojson is required");var e=[];return fh(n,function(t){Y5r(t,e)}),Zn(e)}function Y5r(n,e){var t=[],r=n.geometry;if(r!==null){switch(r.type){case"Polygon":t=ri(r);break;case"LineString":t=[ri(r)]}t.forEach(function(i){var a=q5r(i,n.properties);a.forEach(function(o){o.id=e.length,e.push(o)})})}}function q5r(n,e){var t=[];return n.reduce(function(r,i){var a=yo([r,i],e);return a.bbox=Z5r(r,i),t.push(a),i}),t}function Z5r(n,e){var t=n[0],r=n[1],i=e[0],a=e[1],o=t<i?t:i,s=r<a?r:a,l=t>i?t:i,u=r>a?r:a;return[o,s,l,u]}var fL={exports:{}},ZZe={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(at,function(){function t(y,_,x,S,w){(function b(E,T,C,A,M){for(;A>C;){if(A-C>600){var I=A-C+1,R=T-C+1,k=Math.log(I),D=.5*Math.exp(2*k/3),G=.5*Math.sqrt(k*D*(I-D)/I)*(R-I/2<0?-1:1),W=Math.max(C,Math.floor(T-R*D/I+G)),z=Math.min(A,Math.floor(T+(I-R)*D/I+G));b(E,T,W,z,M)}var V=E[T],q=C,Y=A;for(r(E,C,T),M(E[A],V)>0&&r(E,C,A);q<Y;){for(r(E,q,Y),q++,Y--;M(E[q],V)<0;)q++;for(;M(E[Y],V)>0;)Y--}M(E[C],V)===0?r(E,C,Y):r(E,++Y,A),Y<=T&&(C=Y+1),T<=Y&&(A=Y-1)}})(y,_,x||0,S||y.length-1,w||i)}function r(y,_,x){var S=y[_];y[_]=y[x],y[x]=S}function i(y,_){return y<_?-1:y>_?1:0}var a=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,x){if(!x)return _.indexOf(y);for(var S=0;S<_.length;S++)if(x(y,_[S]))return S;return-1}function s(y,_){l(y,0,y.children.length,_,y)}function l(y,_,x,S,w){w||(w=g(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var b=_;b<x;b++){var E=y.children[b];u(w,y.leaf?S(E):E)}return w}function u(y,_){return y.minX=Math.min(y.minX,_.minX),y.minY=Math.min(y.minY,_.minY),y.maxX=Math.max(y.maxX,_.maxX),y.maxY=Math.max(y.maxY,_.maxY),y}function h(y,_){return y.minX-_.minX}function c(y,_){return y.minY-_.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function d(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,_){return y.minX<=_.minX&&y.minY<=_.minY&&_.maxX<=y.maxX&&_.maxY<=y.maxY}function p(y,_){return _.minX<=y.maxX&&_.minY<=y.maxY&&_.maxX>=y.minX&&_.maxY>=y.minY}function g(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(y,_,x,S,w){for(var b=[_,x];b.length;)if(!((x=b.pop())-(_=b.pop())<=S)){var E=_+Math.ceil((x-_)/S/2)*S;t(y,E,_,x,w),b.push(_,E,E,x)}}return a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(y){var _=this.data,x=[];if(!p(y,_))return x;for(var S=this.toBBox,w=[];_;){for(var b=0;b<_.children.length;b++){var E=_.children[b],T=_.leaf?S(E):E;p(y,T)&&(_.leaf?x.push(E):v(y,T)?this._all(E,x):w.push(E))}_=w.pop()}return x},a.prototype.collides=function(y){var _=this.data;if(!p(y,_))return!1;for(var x=[];_;){for(var S=0;S<_.children.length;S++){var w=_.children[S],b=_.leaf?this.toBBox(w):w;if(p(y,b)){if(_.leaf||v(y,b))return!0;x.push(w)}}_=x.pop()}return!1},a.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var _=0;_<y.length;_++)this.insert(y[_]);return this}var x=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var S=this.data;this.data=x,x=S}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},a.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},a.prototype.clear=function(){return this.data=g([]),this},a.prototype.remove=function(y,_){if(!y)return this;for(var x,S,w,b=this.data,E=this.toBBox(y),T=[],C=[];b||T.length;){if(b||(b=T.pop(),S=T[T.length-1],x=C.pop(),w=!0),b.leaf){var A=o(y,b.children,_);if(A!==-1)return b.children.splice(A,1),T.push(b),this._condense(T),this}w||b.leaf||!v(b,E)?S?(x++,b=S.children[x],w=!1):b=null:(T.push(b),C.push(x),x=0,S=b,b=b.children[0])}return this},a.prototype.toBBox=function(y){return y},a.prototype.compareMinX=function(y,_){return y.minX-_.minX},a.prototype.compareMinY=function(y,_){return y.minY-_.minY},a.prototype.toJSON=function(){return this.data},a.prototype.fromJSON=function(y){return this.data=y,this},a.prototype._all=function(y,_){for(var x=[];y;)y.leaf?_.push.apply(_,y.children):x.push.apply(x,y.children),y=x.pop();return _},a.prototype._build=function(y,_,x,S){var w,b=x-_+1,E=this._maxEntries;if(b<=E)return s(w=g(y.slice(_,x+1)),this.toBBox),w;S||(S=Math.ceil(Math.log(b)/Math.log(E)),E=Math.ceil(b/Math.pow(E,S-1))),(w=g([])).leaf=!1,w.height=S;var T=Math.ceil(b/E),C=T*Math.ceil(Math.sqrt(E));m(y,_,x,C,this.compareMinX);for(var A=_;A<=x;A+=C){var M=Math.min(A+C-1,x);m(y,A,M,T,this.compareMinY);for(var I=A;I<=M;I+=T){var R=Math.min(I+T-1,M);w.children.push(this._build(y,I,R,S-1))}}return s(w,this.toBBox),w},a.prototype._chooseSubtree=function(y,_,x,S){for(;S.push(_),!_.leaf&&S.length-1!==x;){for(var w=1/0,b=1/0,E=void 0,T=0;T<_.children.length;T++){var C=_.children[T],A=f(C),M=(I=y,R=C,(Math.max(R.maxX,I.maxX)-Math.min(R.minX,I.minX))*(Math.max(R.maxY,I.maxY)-Math.min(R.minY,I.minY))-A);M<b?(b=M,w=A<w?A:w,E=C):M===b&&A<w&&(w=A,E=C)}_=E||_.children[0]}var I,R;return _},a.prototype._insert=function(y,_,x){var S=x?y:this.toBBox(y),w=[],b=this._chooseSubtree(S,this.data,_,w);for(b.children.push(y),u(b,S);_>=0&&w[_].children.length>this._maxEntries;)this._split(w,_),_--;this._adjustParentBBoxes(S,w,_)},a.prototype._split=function(y,_){var x=y[_],S=x.children.length,w=this._minEntries;this._chooseSplitAxis(x,w,S);var b=this._chooseSplitIndex(x,w,S),E=g(x.children.splice(b,x.children.length-b));E.height=x.height,E.leaf=x.leaf,s(x,this.toBBox),s(E,this.toBBox),_?y[_-1].children.push(E):this._splitRoot(x,E)},a.prototype._splitRoot=function(y,_){this.data=g([y,_]),this.data.height=y.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(y,_,x){for(var S,w,b,E,T,C,A,M=1/0,I=1/0,R=_;R<=x-_;R++){var k=l(y,0,R,this.toBBox),D=l(y,R,x,this.toBBox),G=(w=k,b=D,E=void 0,T=void 0,C=void 0,A=void 0,E=Math.max(w.minX,b.minX),T=Math.max(w.minY,b.minY),C=Math.min(w.maxX,b.maxX),A=Math.min(w.maxY,b.maxY),Math.max(0,C-E)*Math.max(0,A-T)),W=f(k)+f(D);G<M?(M=G,S=R,I=W<I?W:I):G===M&&W<I&&(I=W,S=R)}return S||x-_},a.prototype._chooseSplitAxis=function(y,_,x){var S=y.leaf?this.compareMinX:h,w=y.leaf?this.compareMinY:c;this._allDistMargin(y,_,x,S)<this._allDistMargin(y,_,x,w)&&y.children.sort(S)},a.prototype._allDistMargin=function(y,_,x,S){y.children.sort(S);for(var w=this.toBBox,b=l(y,0,_,w),E=l(y,x-_,x,w),T=d(b)+d(E),C=_;C<x-_;C++){var A=y.children[C];u(b,y.leaf?w(A):A),T+=d(b)}for(var M=x-_-1;M>=_;M--){var I=y.children[M];u(E,y.leaf?w(I):I),T+=d(E)}return T},a.prototype._adjustParentBBoxes=function(y,_,x){for(var S=x;S>=0;S--)u(_[S],y)},a.prototype._condense=function(y){for(var _=y.length-1,x=void 0;_>=0;_--)y[_].children.length===0?_>0?(x=y[_-1].children).splice(x.indexOf(y[_]),1):this.clear():s(y[_],this.toBBox)},a})})(ZZe);const K5r=Nd(bZe),J5r=Nd(MZe),Q5r=Nd(KFr);var cy=ZZe.exports,KZe=K5r,JZe=J5r,IC=Q5r.default,e6r=JZe.featureEach;JZe.coordEach;KZe.polygon;var BMe=KZe.featureCollection;function QZe(n){var e=new cy(n);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:IC(t),cy.prototype.insert.call(this,t)},e.load=function(t){var r=[];return Array.isArray(t)?t.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:IC(i),r.push(i)}):e6r(t,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:IC(i),r.push(i)}),cy.prototype.load.call(this,r)},e.remove=function(t,r){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:IC(t),cy.prototype.remove.call(this,t,r)},e.clear=function(){return cy.prototype.clear.call(this)},e.search=function(t){var r=cy.prototype.search.call(this,this.toBBox(t));return BMe(r)},e.collides=function(t){return cy.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=cy.prototype.all.call(this);return BMe(t)},e.toJSON=function(){return cy.prototype.toJSON.call(this)},e.fromJSON=function(t){return cy.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var r;if(t.bbox)r=t.bbox;else if(Array.isArray(t)&&t.length===4)r=t;else if(Array.isArray(t)&&t.length===6)r=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")r=IC(t);else if(t.type==="FeatureCollection")r=IC(t);else throw new Error("invalid geojson");return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},e}fL.exports=QZe;fL.exports.default=QZe;function q_(n,e){var t={},r=[];if(n.type==="LineString"&&(n=fu(n)),e.type==="LineString"&&(e=fu(e)),n.type==="Feature"&&e.type==="Feature"&&n.geometry!==null&&e.geometry!==null&&n.geometry.type==="LineString"&&e.geometry.type==="LineString"&&n.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=GMe(n,e);return i&&r.push(i),Zn(r)}var a=fL.exports();return a.load(C2(e)),uo(C2(n),function(o){uo(a.search(o),function(s){var l=GMe(o,s);if(l){var u=ri(l).join(",");t[u]||(t[u]=!0,r.push(l))}})}),Zn(r)}function GMe(n,e){var t=ri(n),r=ri(e);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(r.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=t[0][0],a=t[0][1],o=t[1][0],s=t[1][1],l=r[0][0],u=r[0][1],h=r[1][0],c=r[1][1],f=(c-u)*(o-i)-(h-l)*(s-a),d=(h-l)*(a-u)-(c-u)*(i-l),v=(o-i)*(a-u)-(s-a)*(i-l);if(f===0)return d===0&&v===0,null;var p=d/f,g=v/f;if(p>=0&&p<=1&&g>=0&&g<=1){var m=i+p*(o-i),y=a+p*(s-a);return Vi([m,y])}return null}function G1(n,e,t){t===void 0&&(t={});var r=Vi([1/0,1/0],{dist:1/0}),i=0;return fh(n,function(a){for(var o=ri(a),s=0;s<o.length-1;s++){var l=Vi(o[s]);l.properties.dist=Mo(e,l,t);var u=Vi(o[s+1]);u.properties.dist=Mo(e,u,t);var h=Mo(l,u,t),c=Math.max(l.properties.dist,u.properties.dist),f=x_(l,u),d=_m(e,c,f+90,t),v=_m(e,c,f-90,t),p=q_(yo([d.geometry.coordinates,v.geometry.coordinates]),yo([l.geometry.coordinates,u.geometry.coordinates])),g=null;p.features.length>0&&(g=p.features[0],g.properties.dist=Mo(e,g,t),g.properties.location=i+Mo(l,g,t)),l.properties.dist<r.properties.dist&&(r=l,r.properties.index=s,r.properties.location=i),u.properties.dist<r.properties.dist&&(r=u,r.properties.index=s+1,r.properties.location=i+h),g&&g.properties.dist<r.properties.dist&&(r=g,r.properties.index=s),i+=h}}),r}function w$(n,e,t){t===void 0&&(t={});var r=Wo(n),i=Wo(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var a=t6r(r,i),o=b2(a,"meters",t.units);return o}function t6r(n,e,t){t=t===void 0?Au:Number(t);var r=t,i=n[1]*Math.PI/180,a=e[1]*Math.PI/180,o=a-i,s=Math.abs(e[0]-n[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var l=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),u=Math.abs(l)>1e-11?o/l:Math.cos(i),h=Math.sqrt(o*o+u*u*s*s),c=h*r;return c}function eKe(n,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!n)throw new Error("pt is required");if(Array.isArray(n)?n=Vi(n):n.type==="Point"?n=fu(n):xN(n,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=yo(e):e.type==="LineString"?e=fu(e):xN(e,"LineString","line");var r=1/0,i=n.geometry.coordinates;return B1(e,function(a){var o=a.geometry.coordinates[0],s=a.geometry.coordinates[1],l=r6r(i,o,s,t);l<r&&(r=l)}),b2(r,"degrees",t.units)}function r6r(n,e,t,r){var i=[t[0]-e[0],t[1]-e[1]],a=[n[0]-e[0],n[1]-e[1]],o=zMe(a,i);if(o<=0)return uZ(n,e,{method:r.method,units:"degrees"});var s=zMe(i,i);if(s<=o)return uZ(n,t,{method:r.method,units:"degrees"});var l=o/s,u=[e[0]+l*i[0],e[1]+l*i[1]];return uZ(n,u,{method:r.method,units:"degrees"})}function zMe(n,e){return n[0]*e[0]+n[1]*e[1]}function uZ(n,e,t){return t.method==="planar"?w$(n,e,t):Mo(n,e,t)}function n6r(n,e,t){t===void 0&&(t={});var r=t.units,i=t.properties||{},a=i6r(n);if(!a.features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if(zf(e)!=="LineString")throw new Error("line must be a LineString");var o=1/0,s=null;return uo(a,function(l){var u=eKe(l,e,{units:r});u<o&&(o=u,s=l)}),s&&(s.properties=Ghe({dist:o},s.properties,i)),s}function i6r(n){var e=[],t=n.geometry?n.geometry.type:n.type;switch(t){case"GeometryCollection":return Pd(n,function(r){r.type==="Point"&&e.push({type:"Feature",properties:{},geometry:r})}),{type:"FeatureCollection",features:e};case"FeatureCollection":return n.features=n.features.filter(function(r){return r.geometry.type==="Point"}),n;default:throw new Error("points must be a Point Collection")}}function a6r(n,e){var t=Wo(n),r=ls(e),i=r.coordinates,a=i[0];if(a.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var o=e.properties||{},s=o.a,l=o.b,u=o.c,h=t[0],c=t[1],f=a[0][0],d=a[0][1],v=s!==void 0?s:a[0][2],p=a[1][0],g=a[1][1],m=l!==void 0?l:a[1][2],y=a[2][0],_=a[2][1],x=u!==void 0?u:a[2][2],S=(x*(h-f)*(c-g)+v*(h-p)*(c-_)+m*(h-y)*(c-d)-m*(h-f)*(c-_)-x*(h-p)*(c-d)-v*(h-y)*(c-g))/((h-f)*(c-g)+(h-p)*(c-_)+(h-y)*(c-d)-(h-f)*(c-_)-(h-p)*(c-d)-(h-y)*(c-g));return S}function o6r(n){var e,t,r={type:"FeatureCollection",features:[]};if(n.type==="Feature"?t=n.geometry:t=n,t.type==="LineString")e=[t.coordinates];else if(t.type==="MultiLineString")e=t.coordinates;else if(t.type==="MultiPolygon")e=[].concat.apply([],t.coordinates);else if(t.type==="Polygon")e=t.coordinates;else throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");return e.forEach(function(i){e.forEach(function(a){for(var o=0;o<i.length-1;o++)for(var s=o;s<a.length-1;s++)if(!(i===a&&(Math.abs(o-s)===1||o===0&&s===i.length-2&&i[o][0]===i[i.length-1][0]&&i[o][1]===i[i.length-1][1]))){var l=s6r(i[o][0],i[o][1],i[o+1][0],i[o+1][1],a[s][0],a[s][1],a[s+1][0],a[s+1][1]);l&&r.features.push(Vi([l[0],l[1]]))}})}),r}function s6r(n,e,t,r,i,a,o,s){var l,u,h,c,f,d={x:null,y:null,onLine1:!1,onLine2:!1};return l=(s-a)*(t-n)-(o-i)*(r-e),l===0?d.x!==null&&d.y!==null?d:!1:(u=e-a,h=n-i,c=(o-i)*u-(s-a)*h,f=(t-n)*u-(r-e)*h,u=c/l,h=f/l,d.x=n+u*(t-n),d.y=e+u*(r-e),u>=0&&u<=1&&(d.onLine1=!0),h>=0&&h<=1&&(d.onLine2=!0),d.onLine1&&d.onLine2?[d.x,d.y]:!1)}function UMe(n){for(var e=l6r(n),t=m$(e),r=!1,i=0;!r&&i<e.features.length;){var a=e.features[i].geometry,o,s,l,u,h,c,f,d=!1;if(a.type==="Point")t.geometry.coordinates[0]===a.coordinates[0]&&t.geometry.coordinates[1]===a.coordinates[1]&&(r=!0);else if(a.type==="MultiPoint"){var v=!1;for(f=0;!v&&f<a.coordinates.length;)t.geometry.coordinates[0]===a.coordinates[f][0]&&t.geometry.coordinates[1]===a.coordinates[f][1]&&(r=!0,v=!0),f++}else if(a.type==="LineString")for(f=0;!d&&f<a.coordinates.length-1;)o=t.geometry.coordinates[0],s=t.geometry.coordinates[1],l=a.coordinates[f][0],u=a.coordinates[f][1],h=a.coordinates[f+1][0],c=a.coordinates[f+1][1],VMe(o,s,l,u,h,c)&&(d=!0,r=!0),f++;else if(a.type==="MultiLineString")for(var p=0;p<a.coordinates.length;){d=!1,f=0;for(var g=a.coordinates[p];!d&&f<g.length-1;)o=t.geometry.coordinates[0],s=t.geometry.coordinates[1],l=g[f][0],u=g[f][1],h=g[f+1][0],c=g[f+1][1],VMe(o,s,l,u,h,c)&&(d=!0,r=!0),f++;p++}else(a.type==="Polygon"||a.type==="MultiPolygon")&&ss(t,a)&&(r=!0);i++}if(r)return t;var m=Zn([]);for(i=0;i<e.features.length;i++)m.features=m.features.concat(_$(e.features[i]).features);return Vi(D7(t,m).geometry.coordinates)}function l6r(n){return n.type!=="FeatureCollection"?n.type!=="Feature"?Zn([fu(n)]):Zn([n]):n}function VMe(n,e,t,r,i,a){var o=Math.sqrt((i-t)*(i-t)+(a-r)*(a-r)),s=Math.sqrt((n-t)*(n-t)+(e-r)*(e-r)),l=Math.sqrt((i-n)*(i-n)+(a-e)*(a-e));return o===s+l}var $Me=6378137;function Xhe(n){return Dhe(n,function(e,t){return e+u6r(t)},0)}function u6r(n){var e=0,t;switch(n.type){case"Polygon":return WMe(n.coordinates);case"MultiPolygon":for(t=0;t<n.coordinates.length;t++)e+=WMe(n.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function WMe(n){var e=0;if(n&&n.length>0){e+=Math.abs(HMe(n[0]));for(var t=1;t<n.length;t++)e-=Math.abs(HMe(n[t]))}return e}function HMe(n){var e,t,r,i,a,o,s,l=0,u=n.length;if(u>2){for(s=0;s<u;s++)s===u-2?(i=u-2,a=u-1,o=0):s===u-1?(i=u-1,a=0,o=1):(i=s,a=s+1,o=s+2),e=n[i],t=n[a],r=n[o],l+=(hZ(r[0])-hZ(e[0]))*Math.sin(hZ(t[1]));l=l*$Me*$Me/2}return l}function hZ(n){return n*Math.PI/180}function h6r(n,e,t){t===void 0&&(t={});for(var r=ls(n),i=r.coordinates,a=0,o=0;o<i.length&&!(e>=a&&o===i.length-1);o++)if(a>=e){var s=e-a;if(s){var l=x_(i[o],i[o-1])-180,u=_m(i[o],s,l,t);return u}else return Vi(i[o])}else a+=Mo(i[o],i[o+1],t);return Vi(i[i.length-1])}function Mre(n,e){return e===void 0&&(e={}),Nhe(n,function(t,r){var i=r.geometry.coordinates;return t+Mo(i[0],i[1],e)},0)}function c6r(n,e,t){var r=ri(t);if(zf(t)!=="LineString")throw new Error("line must be a LineString");var i=G1(t,n),a=G1(t,e),o;i.properties.index<=a.properties.index?o=[i,a]:o=[a,i];for(var s=[o[0].geometry.coordinates],l=o[0].properties.index+1;l<o[1].properties.index+1;l++)s.push(r[l]);return s.push(o[1].geometry.coordinates),yo(s,t.properties)}function tKe(n,e,t,r){if(r=r||{},!Io(r))throw new Error("options is invalid");var i,a=[];if(n.type==="Feature")i=n.geometry.coordinates;else if(n.type==="LineString")i=n.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(var o=i.length,s=0,l,u,h,c=0;c<i.length&&!(e>=s&&c===i.length-1);c++){if(s>e&&a.length===0){if(l=e-s,!l)return a.push(i[c]),yo(a);u=x_(i[c],i[c-1])-180,h=_m(i[c],l,u,r),a.push(h.geometry.coordinates)}if(s>=t)return l=t-s,l?(u=x_(i[c],i[c-1])-180,h=_m(i[c],l,u,r),a.push(h.geometry.coordinates),yo(a)):(a.push(i[c]),yo(a));if(s>=e&&a.push(i[c]),c===i.length-1)return yo(a);s+=Mo(i[c],i[c+1],r)}if(s<e&&i.length===o)throw new Error("Start position is beyond line");var f=i[i.length-1];return yo([f,f])}function yd(n,e,t){t===void 0&&(t={});for(var r=Wo(n),i=ri(e),a=0;a<i.length-1;a++){var o=!1;if(t.ignoreEndVertices&&(a===0&&(o="start"),a===i.length-2&&(o="end"),a===0&&a+1===i.length-1&&(o="both")),f6r(i[a],i[a+1],r,o,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function f6r(n,e,t,r,i){var a=t[0],o=t[1],s=n[0],l=n[1],u=e[0],h=e[1],c=t[0]-s,f=t[1]-l,d=u-s,v=h-l,p=c*v-f*d;if(i!==null){if(Math.abs(p)>i)return!1}else if(p!==0)return!1;if(r){if(r==="start")return Math.abs(d)>=Math.abs(v)?d>0?s<a&&a<=u:u<=a&&a<s:v>0?l<o&&o<=h:h<=o&&o<l;if(r==="end")return Math.abs(d)>=Math.abs(v)?d>0?s<=a&&a<u:u<a&&a<=s:v>0?l<=o&&o<h:h<o&&o<=l;if(r==="both")return Math.abs(d)>=Math.abs(v)?d>0?s<a&&a<u:u<a&&a<s:v>0?l<o&&o<h:h<o&&o<l}else return Math.abs(d)>=Math.abs(v)?d>0?s<=a&&a<=u:u<=a&&a<=s:v>0?l<=o&&o<=h:h<=o&&o<=l;return!1}function rKe(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type;switch(i){case"Point":switch(a){case"MultiPoint":return d6r(t,r);case"LineString":return yd(t,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ss(t,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPoint":switch(a){case"MultiPoint":return v6r(t,r);case"LineString":return p6r(t,r);case"Polygon":case"MultiPolygon":return g6r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"LineString":return y6r(t,r);case"Polygon":case"MultiPolygon":return m6r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Polygon":case"MultiPolygon":return _6r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function d6r(n,e){var t,r=!1;for(t=0;t<e.coordinates.length;t++)if(iKe(e.coordinates[t],n.coordinates)){r=!0;break}return r}function v6r(n,e){for(var t=0;t<n.coordinates.length;t++){for(var r=!1,i=0;i<e.coordinates.length;i++)iKe(n.coordinates[t],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}function p6r(n,e){for(var t=!1,r=0;r<n.coordinates.length;r++){if(!yd(n.coordinates[r],e))return!1;t||(t=yd(n.coordinates[r],e,{ignoreEndVertices:!0}))}return t}function g6r(n,e){for(var t=!0,r=!1,i=0;i<n.coordinates.length;i++){if(r=ss(n.coordinates[1],e),!r){t=!1;break}r=ss(n.coordinates[1],e,{ignoreBoundary:!0})}return t&&r}function y6r(n,e){for(var t=0;t<n.coordinates.length;t++)if(!yd(n.coordinates[t],e))return!1;return!0}function m6r(n,e){var t=yl(e),r=yl(n);if(!nKe(t,r))return!1;for(var i=!1,a=0;a<n.coordinates.length-1;a++){if(!ss(n.coordinates[a],e))return!1;if(i||(i=ss(n.coordinates[a],e,{ignoreBoundary:!0})),!i){var o=x6r(n.coordinates[a],n.coordinates[a+1]);i=ss(o,e,{ignoreBoundary:!0})}}return i}function _6r(n,e){var t=yl(n),r=yl(e);if(!nKe(r,t))return!1;for(var i=0;i<n.coordinates[0].length;i++)if(!ss(n.coordinates[0][i],e))return!1;return!0}function nKe(n,e){return!(n[0]>e[0]||n[2]<e[2]||n[1]>e[1]||n[3]<e[3])}function iKe(n,e){return n[0]===e[0]&&n[1]===e[1]}function x6r(n,e){return[(n[0]+e[0])/2,(n[1]+e[1])/2]}function aKe(n,e,t){t===void 0&&(t={}),t.mask&&!t.units&&(t.units="kilometers");for(var r=[],i=n[0],a=n[1],o=n[2],s=n[3],l=e/Mo([i,a],[o,a],t),u=l*(o-i),h=e/Mo([i,a],[i,s],t),c=h*(s-a),f=o-i,d=s-a,v=Math.floor(f/u),p=Math.floor(d/c),g=(f-v*u)/2,m=(d-p*c)/2,y=i+g;y<=o;){for(var _=a+m;_<=s;){var x=Vi([y,_],t.properties);t.mask?rKe(x,t.mask)&&r.push(x):r.push(x),_+=c}y+=u}return Zn(r)}function oKe(n,e){e===void 0&&(e={});var t=e.precision,r=e.coordinates,i=e.mutate;if(t=t==null||isNaN(t)?6:t,r=r==null||isNaN(r)?3:r,!n)throw new Error("<geojson> is required");if(typeof t!="number")throw new Error("<precision> must be a number");if(typeof r!="number")throw new Error("<coordinates> must be a number");(i===!1||i===void 0)&&(n=JSON.parse(JSON.stringify(n)));var a=Math.pow(10,t);return gl(n,function(o){S6r(o,a,r)}),n}function S6r(n,e,t){n.length>t&&n.splice(t,n.length);for(var r=0;r<n.length;r++)n[r]=Math.round(n[r]*e)/e;return n}function Ire(n){if(!n)throw new Error("geojson is required");var e=[];return fh(n,function(t){e.push(t)}),Zn(e)}function w6r(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.units,i=t.reverse;if(!n)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var a=[];return fh(n,function(o){i&&(o.geometry.coordinates=o.geometry.coordinates.reverse()),b6r(o,e,r,function(s){a.push(s)})}),Zn(a)}function b6r(n,e,t,r){var i=Mre(n,{units:t});if(i<=e)return r(n);var a=i/e;Number.isInteger(a)||(a=Math.floor(a)+1);for(var o=0;o<a;o++){var s=tKe(n,e*o,e*(o+1),{units:t});r(s,o)}}function E6r(n,e,t){if(n.geometry.type!=="Polygon")throw new Error("The input feature must be a Polygon");t===void 0&&(t=1);var r=n.geometry.coordinates,i=[],a={};if(t){for(var o=[],s=0;s<r.length;s++)for(var l=0;l<r[s].length-1;l++)o.push(g(s,l));var u=Wk.exports();u.load(o)}for(var h=0;h<r.length;h++)for(var c=0;c<r[h].length-1;c++)if(t){var f=u.search(g(h,c));f.forEach(function(m){var y=m.ring,_=m.edge;p(h,c,y,_)})}else for(var d=0;d<r.length;d++)for(var v=0;v<r[d].length-1;v++)p(h,c,d,v);return e||(i={type:"Feature",geometry:{type:"MultiPoint",coordinates:i}}),i;function p(m,y,_,x){var S=r[m][y],w=r[m][y+1],b=r[_][x],E=r[_][x+1],T=T6r(S,w,b,E);if(T!==null){var C,A;if(w[0]!==S[0]?C=(T[0]-S[0])/(w[0]-S[0]):C=(T[1]-S[1])/(w[1]-S[1]),E[0]!==b[0]?A=(T[0]-b[0])/(E[0]-b[0]):A=(T[1]-b[1])/(E[1]-b[1]),!(C>=1||C<=0||A>=1||A<=0)){var M=T,I=!a[M];I&&(a[M]=!0),e?i.push(e(T,m,y,S,w,C,_,x,b,E,A,I)):i.push(T)}}}function g(m,y){var _=r[m][y],x=r[m][y+1],S,w,b,E;return _[0]<x[0]?(S=_[0],w=x[0]):(S=x[0],w=_[0]),_[1]<x[1]?(b=_[1],E=x[1]):(b=x[1],E=_[1]),{minX:S,minY:b,maxX:w,maxY:E,ring:m,edge:y}}}function T6r(n,e,t,r){if(DO(n,t)||DO(n,r)||DO(e,t)||DO(r,t))return null;var i=n[0],a=n[1],o=e[0],s=e[1],l=t[0],u=t[1],h=r[0],c=r[1],f=(i-o)*(u-c)-(a-s)*(l-h);if(f===0)return null;var d=((i*s-a*o)*(l-h)-(i-o)*(l*c-u*h))/f,v=((i*s-a*o)*(u-c)-(a-s)*(l*c-u*h))/f;return[d,v]}function DO(n,e){if(!n||!e||n.length!==e.length)return!1;for(var t=0,r=n.length;t<r;t++)if(n[t]instanceof Array&&e[t]instanceof Array){if(!DO(n[t],e[t]))return!1}else if(n[t]!==e[t])return!1;return!0}function C6r(n){if(n.type!="Feature")throw new Error("The input must a geojson object of type Feature");if(n.geometry===void 0||n.geometry==null)throw new Error("The input must a geojson object with a non-empty geometry");if(n.geometry.type!="Polygon")throw new Error("The input must be a geojson Polygon");for(var e=n.geometry.coordinates.length,t=[],y=0;y<e;y++){var r=n.geometry.coordinates[y];NO(r[0],r[r.length-1])||r.push(r[0]),t.push.apply(t,r.slice(0,r.length-1))}if(!M6r(t))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var i=t.length,a=E6r(n,function(j,Q,ie,oe,se,me,Ce,Le,re,yt,je,st){return[j,Q,ie,oe,se,me,Ce,Le,re,yt,je,st]}),o=a.length;if(o==0){for(var b=[],y=0;y<e;y++)b.push(Qi([n.geometry.coordinates[y]],{parent:-1,winding:A6r(n.geometry.coordinates[y])}));var z=Zn(b);return V(),q(),z}for(var s=[],l=[],y=0;y<e;y++){s.push([]);for(var u=0;u<n.geometry.coordinates[y].length-1;u++)s[y].push([new jMe(n.geometry.coordinates[y][IA(u+1,n.geometry.coordinates[y].length-1)],1,[y,u],[y,IA(u+1,n.geometry.coordinates[y].length-1)],void 0)]),l.push(new XMe(n.geometry.coordinates[y][u],[y,IA(u-1,n.geometry.coordinates[y].length-1)],[y,u],void 0,void 0,!1,!0))}for(var y=0;y<o;y++)s[a[y][1]][a[y][2]].push(new jMe(a[y][0],a[y][5],[a[y][1],a[y][2]],[a[y][6],a[y][7]],void 0)),a[y][11]&&l.push(new XMe(a[y][0],[a[y][1],a[y][2]],[a[y][6],a[y][7]],void 0,void 0,!0,!0));for(var h=l.length,y=0;y<s.length;y++)for(var u=0;u<s[y].length;u++)s[y][u].sort(function(Q,ie){return Q.param<ie.param?-1:1});for(var c=[],y=0;y<h;y++)c.push({minX:l[y].coord[0],minY:l[y].coord[1],maxX:l[y].coord[0],maxY:l[y].coord[1],index:y});var f=Wk.exports();f.load(c);for(var y=0;y<s.length;y++)for(var u=0;u<s[y].length;u++)for(var d=0;d<s[y][u].length;d++){var v;d==s[y][u].length-1?v=s[y][IA(u+1,n.geometry.coordinates[y].length-1)][0].coord:v=s[y][u][d+1].coord;var p=f.search({minX:v[0],minY:v[1],maxX:v[0],maxY:v[1]})[0];s[y][u][d].nxtIsectAlongEdgeIn=p.index}for(var y=0;y<s.length;y++)for(var u=0;u<s[y].length;u++)for(var d=0;d<s[y][u].length;d++){var v=s[y][u][d].coord,p=f.search({minX:v[0],minY:v[1],maxX:v[0],maxY:v[1]})[0],g=p.index;g<i?l[g].nxtIsectAlongRingAndEdge2=s[y][u][d].nxtIsectAlongEdgeIn:NO(l[g].ringAndEdge1,s[y][u][d].ringAndEdgeIn)?l[g].nxtIsectAlongRingAndEdge1=s[y][u][d].nxtIsectAlongEdgeIn:l[g].nxtIsectAlongRingAndEdge2=s[y][u][d].nxtIsectAlongEdgeIn}for(var m=[],y=0,u=0;u<e;u++){for(var _=y,d=0;d<n.geometry.coordinates[u].length-1;d++)l[y].coord[0]<l[_].coord[0]&&(_=y),y++;for(var x=l[_].nxtIsectAlongRingAndEdge2,d=0;d<l.length;d++)if(l[d].nxtIsectAlongRingAndEdge1==_||l[d].nxtIsectAlongRingAndEdge2==_){var S=d;break}var w=w8([l[S].coord,l[_].coord,l[x].coord],!0)?1:-1;m.push({isect:_,parent:-1,winding:w})}m.sort(function(le,j){return l[le.isect].coord>l[j.isect].coord?-1:1});for(var b=[];m.length>0;){var E=m.pop(),T=E.isect,C=E.parent,A=E.winding,M=b.length,I=[l[T].coord],R=T;if(l[T].ringAndEdge1Walkable)var k=l[T].ringAndEdge1,D=l[T].nxtIsectAlongRingAndEdge1;else var k=l[T].ringAndEdge2,D=l[T].nxtIsectAlongRingAndEdge2;for(;!NO(l[T].coord,l[D].coord);){I.push(l[D].coord);for(var G=void 0,y=0;y<m.length;y++)if(m[y].isect==D){G=y;break}if(G!=null&&m.splice(G,1),NO(k,l[D].ringAndEdge1)){if(k=l[D].ringAndEdge2,l[D].ringAndEdge2Walkable=!1,l[D].ringAndEdge1Walkable){var W={isect:D};w8([l[R].coord,l[D].coord,l[l[D].nxtIsectAlongRingAndEdge2].coord],A==1)?(W.parent=C,W.winding=-A):(W.parent=M,W.winding=A),m.push(W)}R=D,D=l[D].nxtIsectAlongRingAndEdge2}else{if(k=l[D].ringAndEdge1,l[D].ringAndEdge1Walkable=!1,l[D].ringAndEdge2Walkable){var W={isect:D};w8([l[R].coord,l[D].coord,l[l[D].nxtIsectAlongRingAndEdge1].coord],A==1)?(W.parent=C,W.winding=-A):(W.parent=M,W.winding=A),m.push(W)}R=D,D=l[D].nxtIsectAlongRingAndEdge1}}I.push(l[D].coord),b.push(Qi([I],{index:M,parent:C,winding:A,netWinding:void 0}))}var z=Zn(b);V(),q();function V(){for(var le=[],j=0;j<z.features.length;j++)z.features[j].properties.parent==-1&&le.push(j);if(le.length>1)for(var j=0;j<le.length;j++){for(var Q=-1,ie=1/0,oe=0;oe<z.features.length;oe++)le[j]!=oe&&ss(z.features[le[j]].geometry.coordinates[0][0],z.features[oe],{ignoreBoundary:!0})&&Xhe(z.features[oe])<ie&&(Q=oe);z.features[le[j]].properties.parent=Q}}function q(){for(var le=0;le<z.features.length;le++)if(z.features[le].properties.parent==-1){var j=z.features[le].properties.winding;z.features[le].properties.netWinding=j,Y(le,j)}}function Y(le,j){for(var Q=0;Q<z.features.length;Q++)if(z.features[Q].properties.parent==le){var ie=j+z.features[Q].properties.winding;z.features[Q].properties.netWinding=ie,Y(Q,ie)}}return z}var jMe=function(n,e,t,r,i){this.coord=n,this.param=e,this.ringAndEdgeIn=t,this.ringAndEdgeOut=r,this.nxtIsectAlongEdgeIn=i},XMe=function(n,e,t,r,i,a,o){this.coord=n,this.ringAndEdge1=e,this.ringAndEdge2=t,this.nxtIsectAlongRingAndEdge1=r,this.nxtIsectAlongRingAndEdge2=i,this.ringAndEdge1Walkable=a,this.ringAndEdge2Walkable=o};function w8(n,e){if(typeof e>"u"&&(e=!0),n.length!=3)throw new Error("This function requires an array of three points [x,y]");var t=(n[1][0]-n[0][0])*(n[2][1]-n[0][1])-(n[1][1]-n[0][1])*(n[2][0]-n[0][0]);return t>=0==e}function A6r(n){for(var e=0,t=0;t<n.length-1;t++)n[t][0]<n[e][0]&&(e=t);if(w8([n[IA(e-1,n.length-1)],n[e],n[IA(e+1,n.length-1)]],!0))var r=1;else var r=-1;return r}function NO(n,e){if(!n||!e||n.length!=e.length)return!1;for(var t=0,r=n.length;t<r;t++)if(n[t]instanceof Array&&e[t]instanceof Array){if(!NO(n[t],e[t]))return!1}else if(n[t]!=e[t])return!1;return!0}function IA(n,e){return(n%e+e)%e}function M6r(n){for(var e={},t=1,r=0,i=n.length;r<i;++r){if(Object.prototype.hasOwnProperty.call(e,n[r])){t=0;break}e[n[r]]=1}return t}function I6r(n){var e=[];return fh(n,function(t){t.geometry.type==="Polygon"&&uo(C6r(t),function(r){e.push(Qi(r.geometry.coordinates,t.properties))})}),Zn(e)}var YMe=Math.PI/180,qMe=180/Math.PI,TN=function(n,e){this.lon=n,this.lat=e,this.x=YMe*n,this.y=YMe*e};TN.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};TN.prototype.antipode=function(){var n=-1*this.lat,e=this.lon<0?180+this.lon:(180-this.lon)*-1;return new TN(e,n)};var sKe=function(){this.coords=[],this.length=0};sKe.prototype.move_to=function(n){this.length++,this.coords.push(n)};var Yhe=function(n){this.properties=n||{},this.geometries=[]};Yhe.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var n=[],e=0;e<this.geometries.length;e++)n.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};Yhe.prototype.wkt=function(){for(var n="",e="LINESTRING(",t=function(a){e+=a[0]+" "+a[1]+","},r=0;r<this.geometries.length;r++){if(this.geometries[r].coords.length===0)return"LINESTRING(empty)";var i=this.geometries[r].coords;i.forEach(t),n+=e.substring(0,e.length-1)+")"}return n};var qhe=function(n,e,t){if(!n||n.x===void 0||n.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new TN(n.x,n.y),this.end=new TN(e.x,e.y),this.properties=t||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,a=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(a)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+e)};qhe.prototype.interpolate=function(n){var e=Math.sin((1-n)*this.g)/Math.sin(this.g),t=Math.sin(n*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+t*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+t*Math.cos(this.end.y)*Math.sin(this.end.x),a=e*Math.sin(this.start.y)+t*Math.sin(this.end.y),o=qMe*Math.atan2(a,Math.sqrt(Math.pow(r,2)+Math.pow(i,2))),s=qMe*Math.atan2(i,r);return[s,o]};qhe.prototype.Arc=function(n,e){var t=[];if(!n||n<=2)t.push([this.start.lon,this.start.lat]),t.push([this.end.lon,this.end.lat]);else for(var r=1/(n-1),i=0;i<n;++i){var a=r*i,o=this.interpolate(a);t.push(o)}for(var s=!1,l=0,u=e&&e.offset?e.offset:10,h=180-u,c=-180+u,f=360-u,d=1;d<t.length;++d){var v=t[d-1][0],p=t[d][0],g=Math.abs(p-v);g>f&&(p>h&&v<c||v>h&&p<c)?s=!0:g>l&&(l=g)}var m=[];if(s&&l<u){var y=[];m.push(y);for(var _=0;_<t.length;++_){var x=parseFloat(t[_][0]);if(_>0&&Math.abs(x-t[_-1][0])>f){var S=parseFloat(t[_-1][0]),w=parseFloat(t[_-1][1]),b=parseFloat(t[_][0]),E=parseFloat(t[_][1]);if(S>-180&&S<c&&b===180&&_+1<t.length&&t[_-1][0]>-180&&t[_-1][0]<c){y.push([-180,t[_][1]]),_++,y.push([t[_][0],t[_][1]]);continue}else if(S>h&&S<180&&b===-180&&_+1<t.length&&t[_-1][0]>h&&t[_-1][0]<180){y.push([180,t[_][1]]),_++,y.push([t[_][0],t[_][1]]);continue}if(S<c&&b>h){var T=S;S=b,b=T;var C=w;w=E,E=C}if(S>h&&b<c&&(b+=360),S<=180&&b>=180&&S<b){var A=(180-S)/(b-S),M=A*E+(1-A)*w;y.push([t[_-1][0]>h?180:-180,M]),y=[],y.push([t[_-1][0]>h?-180:180,M]),m.push(y)}else y=[],m.push(y);y.push([x,t[_][1]])}else y.push([t[_][0],t[_][1]])}}else{var I=[];m.push(I);for(var R=0;R<t.length;++R)I.push([t[R][0],t[R][1]])}for(var k=new Yhe(this.properties),D=0;D<m.length;++D){var G=new sKe;k.geometries.push(G);for(var W=m[D],z=0;z<W.length;++z)G.move_to(W[z])}return k};function L6r(n,e,t){if(t=t||{},typeof t!="object")throw new Error("options is invalid");var r=t.properties,i=t.npoints,a=t.offset;n=Wo(n),e=Wo(e),r=r||{},i=i||100,a=a||10;var o=new qhe({x:n[0],y:n[1]},{x:e[0],y:e[1]},r),s=o.Arc(i,{offset:a});return s.json()}function P6r(n,e){if(!n)throw new Error("line is required");if(!e)throw new Error("splitter is required");var t=zf(n),r=zf(e);if(t!=="LineString")throw new Error("line must be LineString");if(r==="FeatureCollection")throw new Error("splitter cannot be a FeatureCollection");if(r==="GeometryCollection")throw new Error("splitter cannot be a GeometryCollection");var i=oKe(e,{precision:7});switch(r){case"Point":return Lre(n,i);case"MultiPoint":return ZMe(n,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return ZMe(n,q_(n,i))}}function ZMe(n,e){var t=[],r=fL.exports();return fh(e,function(i){if(t.forEach(function(s,l){s.id=l}),!t.length)t=Lre(n,i).features,t.forEach(function(s){s.bbox||(s.bbox=HZe(yl(s)))}),r.load(Zn(t));else{var a=r.search(i);if(a.features.length){var o=lKe(i,a);t=t.filter(function(s){return s.id!==o.id}),r.remove(o),uo(Lre(o,i),function(s){t.push(s),r.insert(s)})}}}),Zn(t)}function Lre(n,e){var t=[],r=ri(n)[0],i=ri(n)[n.geometry.coordinates.length-1];if(cZ(r,Wo(e))||cZ(i,Wo(e)))return Zn([n]);var a=fL.exports(),o=C2(n);a.load(o);var s=a.search(e);if(!s.features.length)return Zn([n]);var l=lKe(e,s),u=[r],h=Rhe(o,function(c,f,d){var v=ri(f)[1],p=Wo(e);return d===l.id?(c.push(p),t.push(yo(c)),cZ(p,v)?[p]:[p,v]):(c.push(v),c)},u);return h.length>1&&t.push(yo(h)),Zn(t)}function lKe(n,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var t,r=1/0;return uo(e,function(i){var a=G1(i,n),o=a.properties.dist;o<r&&(t=i,r=o)}),t}function cZ(n,e){return n[0]===e[0]&&n[1]===e[1]}function uKe(n,e,t,r,i){i===void 0&&(i={});var a=i.steps||64,o=KMe(t),s=KMe(r),l=!Array.isArray(n)&&n.type==="Feature"?n.properties:{};if(o===s)return yo(Hhe(n,e,i).geometry.coordinates[0],l);for(var u=o,h=o<s?s:s+360,c=u,f=[],d=0;c<h;)f.push(_m(n,e,c,i).geometry.coordinates),d++,c=u+d*360/a;return c>h&&f.push(_m(n,e,h,i).geometry.coordinates),yo(f,l)}function KMe(n){var e=n%360;return e<0&&(e+=360),e}function CN(n,e){e===void 0&&(e={});var t=ls(n);switch(!e.properties&&n.type==="Feature"&&(e.properties=n.properties),t.type){case"Polygon":return hKe(t,e);case"MultiPolygon":return O6r(t,e);default:throw new Error("invalid poly")}}function hKe(n,e){e===void 0&&(e={});var t=ls(n),r=t.coordinates,i=e.properties?e.properties:n.type==="Feature"?n.properties:{};return cKe(r,i)}function O6r(n,e){e===void 0&&(e={});var t=ls(n),r=t.coordinates,i=e.properties?e.properties:n.type==="Feature"?n.properties:{},a=[];return r.forEach(function(o){a.push(cKe(o,i))}),Zn(a)}function cKe(n,e){return n.length>1?Pw(n,e):yo(n[0],e)}function JMe(n,e){e===void 0&&(e={});var t,r,i,a=e.properties,o=(t=e.autoComplete)!==null&&t!==void 0?t:!0,s=(r=e.orderCoords)!==null&&r!==void 0?r:!0,l=(i=e.mutate)!==null&&i!==void 0?i:!1;switch(l||(n=Xh(n)),n.type){case"FeatureCollection":var u=[];return n.features.forEach(function(h){u.push(ri(QMe(h,{},o,s)))}),Ld(u,a);default:return QMe(n,a,o,s)}}function QMe(n,e,t,r){e=e||(n.type==="Feature"?n.properties:{});var i=ls(n),a=i.coordinates,o=i.type;if(!a.length)throw new Error("line must contain coordinates");switch(o){case"LineString":return t&&(a=eIe(a)),Qi([a],e);case"MultiLineString":var s=[],l=0;return a.forEach(function(u){if(t&&(u=eIe(u)),r){var h=R6r(yl(yo(u)));h>l?(s.unshift(u),l=h):s.push(u)}else s.push(u)}),Qi(s,e);default:throw new Error("geometry type "+o+" is not supported")}}function eIe(n){var e=n[0],t=e[0],r=e[1],i=n[n.length-1],a=i[0],o=i[1];return(t!==a||r!==o)&&n.push(e),n}function R6r(n){var e=n[0],t=n[1],r=n[2],i=n[3];return Math.abs(e-r)*Math.abs(t-i)}function D6r(n,e,t){var r=n.length,i=LA(n[0],e),a=[],o,s,l,u,h;for(t||(t=[]),o=1;o<r;o++){for(u=n[o-1],h=n[o],s=l=LA(h,e);;)if(i|s){if(i&s)break;i?(u=Pre(u,h,i,e),i=LA(u,e)):(h=Pre(u,h,s,e),s=LA(h,e))}else{a.push(u),s!==l?(a.push(h),o<r-1&&(t.push(a),a=[])):o===r-1&&a.push(h);break}i=l}return a.length&&t.push(a),t}function N6r(n,e){var t,r,i,a,o,s,l;for(r=1;r<=8;r*=2){for(t=[],i=n[n.length-1],a=!(LA(i,e)&r),o=0;o<n.length;o++)s=n[o],l=!(LA(s,e)&r),l!==a&&t.push(Pre(i,s,r,e)),l&&t.push(s),i=s,a=l;if(n=t,!n.length)break}return t}function Pre(n,e,t,r){return t&8?[n[0]+(e[0]-n[0])*(r[3]-n[1])/(e[1]-n[1]),r[3]]:t&4?[n[0]+(e[0]-n[0])*(r[1]-n[1])/(e[1]-n[1]),r[1]]:t&2?[r[2],n[1]+(e[1]-n[1])*(r[2]-n[0])/(e[0]-n[0])]:t&1?[r[0],n[1]+(e[1]-n[1])*(r[0]-n[0])/(e[0]-n[0])]:null}function LA(n,e){var t=0;return n[0]<e[0]?t|=1:n[0]>e[2]&&(t|=2),n[1]<e[1]?t|=4:n[1]>e[3]&&(t|=8),t}function k6r(n,e){var t=ls(n),r=t.type,i=n.type==="Feature"?n.properties:{},a=t.coordinates;switch(r){case"LineString":case"MultiLineString":{var o=[];return r==="LineString"&&(a=[a]),a.forEach(function(s){D6r(s,e,o)}),o.length===1?yo(o[0],i):Pw(o,i)}case"Polygon":return Qi(tIe(a,e),i);case"MultiPolygon":return Ld(a.map(function(s){return tIe(s,e)}),i);default:throw new Error("geometry "+r+" not supported")}}function tIe(n,e){for(var t=[],r=0,i=n;r<i.length;r++){var a=i[r],o=N6r(a,e);o.length>0&&((o[0][0]!==o[o.length-1][0]||o[0][1]!==o[o.length-1][1])&&o.push(o[0]),o.length>=4&&t.push(o))}return t}var rIe=Object.prototype.toString,fKe=function(e){var t=rIe.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&rIe.call(e.callee)==="[object Function]"),r},fZ,nIe;function F6r(){if(nIe)return fZ;nIe=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=fKe,i=Object.prototype.propertyIsEnumerable,a=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&e.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),c=function(f){if(typeof window>"u"||!h)return l(f);try{return l(f)}catch{return!1}};n=function(d){var v=d!==null&&typeof d=="object",p=t.call(d)==="[object Function]",g=r(d),m=v&&t.call(d)==="[object String]",y=[];if(!v&&!p&&!g)throw new TypeError("Object.keys called on a non-object");var _=o&&p;if(m&&d.length>0&&!e.call(d,0))for(var x=0;x<d.length;++x)y.push(String(x));if(g&&d.length>0)for(var S=0;S<d.length;++S)y.push(String(S));else for(var w in d)!(_&&w==="prototype")&&e.call(d,w)&&y.push(String(w));if(a)for(var b=c(d),E=0;E<s.length;++E)!(b&&s[E]==="constructor")&&e.call(d,s[E])&&y.push(s[E]);return y}}return fZ=n,fZ}var B6r=Array.prototype.slice,G6r=fKe,iIe=Object.keys,b8=iIe?function(e){return iIe(e)}:F6r(),aIe=Object.keys;b8.shim=function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=function(r){return G6r(r)?aIe(B6r.call(r)):aIe(r)})}else Object.keys=b8;return Object.keys||b8};var dKe=b8,vKe=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==i||s.enumerable!==!0)return!1}return!0},z6r=vKe,Zhe=function(){return z6r()&&!!Symbol.toStringTag},pKe=Object,gKe=Error,U6r=EvalError,V6r=RangeError,$6r=ReferenceError,yKe=SyntaxError,dL=TypeError,W6r=URIError,H6r=Math.abs,j6r=Math.floor,X6r=Math.max,Y6r=Math.min,q6r=Math.pow,Z6r=Math.round,K6r=Number.isNaN||function(e){return e!==e},J6r=K6r,Q6r=function(e){return J6r(e)||e===0?e:e<0?-1:1},eBr=Object.getOwnPropertyDescriptor,E8=eBr;if(E8)try{E8([],"length")}catch{E8=null}var vL=E8,T8=Object.defineProperty||!1;if(T8)try{T8({},"a",{value:1})}catch{T8=!1}var b$=T8,dZ,oIe;function tBr(){if(oIe)return dZ;oIe=1;var n=typeof Symbol<"u"&&Symbol,e=vKe;return dZ=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},dZ}var mKe=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,rBr=pKe,_Ke=rBr.getPrototypeOf||null,nBr="Function.prototype.bind called on incompatible ",iBr=Object.prototype.toString,aBr=Math.max,oBr="[object Function]",sIe=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var a=0;a<t.length;a+=1)r[a+e.length]=t[a];return r},sBr=function(e,t){for(var r=[],i=t||0,a=0;i<e.length;i+=1,a+=1)r[a]=e[i];return r},lBr=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},uBr=function(e){var t=this;if(typeof t!="function"||iBr.apply(t)!==oBr)throw new TypeError(nBr+t);for(var r=sBr(arguments,1),i,a=function(){if(this instanceof i){var h=t.apply(this,sIe(r,arguments));return Object(h)===h?h:this}return t.apply(e,sIe(r,arguments))},o=aBr(0,t.length-r.length),s=[],l=0;l<o;l++)s[l]="$"+l;if(i=Function("binder","return function ("+lBr(s,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var u=function(){};u.prototype=t.prototype,i.prototype=new u,u.prototype=null}return i},hBr=uBr,Hk=Function.prototype.bind||hBr,Khe=Function.prototype.call,Jhe=Function.prototype.apply,cBr=typeof Reflect<"u"&&Reflect&&Reflect.apply,fBr=Hk,dBr=Jhe,vBr=Khe,pBr=cBr,xKe=pBr||fBr.call(vBr,dBr),gBr=Hk,yBr=dL,mBr=Khe,_Br=xKe,Qhe=function(e){if(e.length<1||typeof e[0]!="function")throw new yBr("a function is required");return _Br(gBr,mBr,e)},xBr=Qhe,lIe=vL,SKe;try{SKe=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var vZ=!!SKe&&lIe&&lIe(Object.prototype,"__proto__"),wKe=Object,uIe=wKe.getPrototypeOf,SBr=vZ&&typeof vZ.get=="function"?xBr([vZ.get]):typeof uIe=="function"?function(e){return uIe(e==null?e:wKe(e))}:!1,hIe=mKe,cIe=_Ke,fIe=SBr,bKe=hIe?function(e){return hIe(e)}:cIe?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return cIe(e)}:fIe?function(e){return fIe(e)}:null,wBr=Function.prototype.call,bBr=Object.prototype.hasOwnProperty,EBr=Hk,EKe=EBr.call(wBr,bBr),Za,TBr=pKe,CBr=gKe,ABr=U6r,MBr=V6r,IBr=$6r,JM=yKe,aM=dL,LBr=W6r,PBr=H6r,OBr=j6r,RBr=X6r,DBr=Y6r,NBr=q6r,kBr=Z6r,FBr=Q6r,TKe=Function,pZ=function(n){try{return TKe('"use strict"; return ('+n+").constructor;")()}catch{}},AN=vL,BBr=b$,gZ=function(){throw new aM},GBr=AN?function(){try{return arguments.callee,gZ}catch{try{return AN(arguments,"callee").get}catch{return gZ}}}():gZ,LC=tBr()(),Ah=bKe,zBr=_Ke,UBr=mKe,CKe=Jhe,jk=Khe,aA={},VBr=typeof Uint8Array>"u"||!Ah?Za:Ah(Uint8Array),$E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Za:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Za:ArrayBuffer,"%ArrayIteratorPrototype%":LC&&Ah?Ah([][Symbol.iterator]()):Za,"%AsyncFromSyncIteratorPrototype%":Za,"%AsyncFunction%":aA,"%AsyncGenerator%":aA,"%AsyncGeneratorFunction%":aA,"%AsyncIteratorPrototype%":aA,"%Atomics%":typeof Atomics>"u"?Za:Atomics,"%BigInt%":typeof BigInt>"u"?Za:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Za:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Za:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Za:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":CBr,"%eval%":eval,"%EvalError%":ABr,"%Float16Array%":typeof Float16Array>"u"?Za:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Za:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Za:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Za:FinalizationRegistry,"%Function%":TKe,"%GeneratorFunction%":aA,"%Int8Array%":typeof Int8Array>"u"?Za:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Za:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Za:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":LC&&Ah?Ah(Ah([][Symbol.iterator]())):Za,"%JSON%":typeof JSON=="object"?JSON:Za,"%Map%":typeof Map>"u"?Za:Map,"%MapIteratorPrototype%":typeof Map>"u"||!LC||!Ah?Za:Ah(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":TBr,"%Object.getOwnPropertyDescriptor%":AN,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Za:Promise,"%Proxy%":typeof Proxy>"u"?Za:Proxy,"%RangeError%":MBr,"%ReferenceError%":IBr,"%Reflect%":typeof Reflect>"u"?Za:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Za:Set,"%SetIteratorPrototype%":typeof Set>"u"||!LC||!Ah?Za:Ah(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Za:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":LC&&Ah?Ah(""[Symbol.iterator]()):Za,"%Symbol%":LC?Symbol:Za,"%SyntaxError%":JM,"%ThrowTypeError%":GBr,"%TypedArray%":VBr,"%TypeError%":aM,"%Uint8Array%":typeof Uint8Array>"u"?Za:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Za:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Za:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Za:Uint32Array,"%URIError%":LBr,"%WeakMap%":typeof WeakMap>"u"?Za:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Za:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Za:WeakSet,"%Function.prototype.call%":jk,"%Function.prototype.apply%":CKe,"%Object.defineProperty%":BBr,"%Object.getPrototypeOf%":zBr,"%Math.abs%":PBr,"%Math.floor%":OBr,"%Math.max%":RBr,"%Math.min%":DBr,"%Math.pow%":NBr,"%Math.round%":kBr,"%Math.sign%":FBr,"%Reflect.getPrototypeOf%":UBr};if(Ah)try{null.error}catch(n){var $Br=Ah(Ah(n));$E["%Error.prototype%"]=$Br}var WBr=function n(e){var t;if(e==="%AsyncFunction%")t=pZ("async function () {}");else if(e==="%GeneratorFunction%")t=pZ("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=pZ("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Ah&&(t=Ah(i.prototype))}return $E[e]=t,t},dIe={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Xk=Hk,N7=EKe,HBr=Xk.call(jk,Array.prototype.concat),jBr=Xk.call(CKe,Array.prototype.splice),vIe=Xk.call(jk,String.prototype.replace),k7=Xk.call(jk,String.prototype.slice),XBr=Xk.call(jk,RegExp.prototype.exec),YBr=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,qBr=/\\(\\)?/g,ZBr=function(e){var t=k7(e,0,1),r=k7(e,-1);if(t==="%"&&r!=="%")throw new JM("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new JM("invalid intrinsic syntax, expected opening `%`");var i=[];return vIe(e,YBr,function(a,o,s,l){i[i.length]=s?vIe(l,qBr,"$1"):o||a}),i},KBr=function(e,t){var r=e,i;if(N7(dIe,r)&&(i=dIe[r],r="%"+i[0]+"%"),N7($E,r)){var a=$E[r];if(a===aA&&(a=WBr(r)),typeof a>"u"&&!t)throw new aM("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:a}}throw new JM("intrinsic "+e+" does not exist!")},AKe=function(e,t){if(typeof e!="string"||e.length===0)throw new aM("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new aM('"allowMissing" argument must be a boolean');if(XBr(/^%?[^%]*%?$/,e)===null)throw new JM("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=ZBr(e),i=r.length>0?r[0]:"",a=KBr("%"+i+"%",t),o=a.name,s=a.value,l=!1,u=a.alias;u&&(i=u[0],jBr(r,HBr([0,1],u)));for(var h=1,c=!0;h<r.length;h+=1){var f=r[h],d=k7(f,0,1),v=k7(f,-1);if((d==='"'||d==="'"||d==="`"||v==='"'||v==="'"||v==="`")&&d!==v)throw new JM("property names with quotes must have matching quotes");if((f==="constructor"||!c)&&(l=!0),i+="."+f,o="%"+i+"%",N7($E,o))s=$E[o];else if(s!=null){if(!(f in s)){if(!t)throw new aM("base intrinsic for "+e+" exists, but the property is not available.");return}if(AN&&h+1>=r.length){var p=AN(s,f);c=!!p,c&&"get"in p&&!("originalValue"in p.get)?s=p.get:s=s[f]}else c=N7(s,f),s=s[f];c&&!l&&($E[o]=s)}}return s},MKe=AKe,IKe=Qhe,JBr=IKe([MKe("%String.prototype.indexOf%")]),ece=function(e,t){var r=MKe(e,!!t);return typeof r=="function"&&JBr(e,".prototype.")>-1?IKe([r]):r},QBr=Zhe(),e8r=ece,Ore=e8r("Object.prototype.toString"),E$=function(e){return QBr&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ore(e)==="[object Arguments]"},LKe=function(e){return E$(e)?!0:e!==null&&typeof e=="object"&&"length"in e&&typeof e.length=="number"&&e.length>=0&&Ore(e)!=="[object Array]"&&"callee"in e&&Ore(e.callee)==="[object Function]"},t8r=function(){return E$(arguments)}();E$.isLegacyArguments=LKe;var r8r=t8r?E$:LKe,pIe=b$,n8r=yKe,PC=dL,gIe=vL,tce=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new PC("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new PC("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new PC("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new PC("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new PC("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new PC("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!gIe&&gIe(e,t);if(pIe)pIe(e,t,{configurable:o===null&&l?l.configurable:!o,enumerable:i===null&&l?l.enumerable:!i,value:r,writable:a===null&&l?l.writable:!a});else if(s||!i&&!a&&!o)e[t]=r;else throw new n8r("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Rre=b$,PKe=function(){return!!Rre};PKe.hasArrayLengthDefineBug=function(){if(!Rre)return null;try{return Rre([],"length",{value:1}).length!==1}catch{return!0}};var rce=PKe,i8r=dKe,a8r=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",o8r=Object.prototype.toString,s8r=Array.prototype.concat,yIe=tce,l8r=function(n){return typeof n=="function"&&o8r.call(n)==="[object Function]"},OKe=rce(),u8r=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!l8r(r)||!r())return}OKe?yIe(n,e,t,!0):yIe(n,e,t)},RKe=function(n,e){var t=arguments.length>2?arguments[2]:{},r=i8r(e);a8r&&(r=s8r.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)u8r(n,r[i],e[r[i]],t[r[i]])};RKe.supportsDescriptors=!!OKe;var Yk=RKe,nce={exports:{}},h8r=AKe,mIe=tce,c8r=rce(),_Ie=vL,xIe=dL,f8r=h8r("%Math.floor%"),d8r=function(e,t){if(typeof e!="function")throw new xIe("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||f8r(t)!==t)throw new xIe("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in e&&_Ie){var o=_Ie(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(a=!1)}return(i||a||!r)&&(c8r?mIe(e,"length",t,!0,!0):mIe(e,"length",t)),e},v8r=Hk,p8r=Jhe,g8r=xKe,y8r=function(){return g8r(v8r,p8r,arguments)};(function(n){var e=d8r,t=b$,r=Qhe,i=y8r;n.exports=function(o){var s=r(arguments),l=o.length-(arguments.length-1);return e(s,1+(l>0?l:0),!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(nce);var SIe=function(n){return n!==n},DKe=function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||SIe(e)&&SIe(t))},m8r=DKe,NKe=function(){return typeof Object.is=="function"?Object.is:m8r},_8r=NKe,x8r=Yk,S8r=function(){var e=_8r();return x8r(Object,{is:e},{is:function(){return Object.is!==e}}),e},w8r=Yk,b8r=nce.exports,E8r=DKe,kKe=NKe,T8r=S8r,FKe=b8r(kKe(),Object);w8r(FKe,{getPolyfill:kKe,implementation:E8r,shim:T8r});var C8r=FKe,wIe=ece,A8r=Zhe(),M8r=EKe,I8r=vL,Dre;if(A8r){var L8r=wIe("RegExp.prototype.exec"),bIe={},yZ=function(){throw bIe},EIe={toString:yZ,valueOf:yZ};typeof Symbol.toPrimitive=="symbol"&&(EIe[Symbol.toPrimitive]=yZ),Dre=function(e){if(!e||typeof e!="object")return!1;var t=I8r(e,"lastIndex"),r=t&&M8r(t,"value");if(!r)return!1;try{L8r(e,EIe)}catch(i){return i===bIe}}}else{var P8r=wIe("Object.prototype.toString"),O8r="[object RegExp]";Dre=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:P8r(e)===O8r}}var R8r=Dre,MN=function(){return typeof function(){}.name=="string"},NR=Object.getOwnPropertyDescriptor;if(NR)try{NR([],"length")}catch{NR=null}MN.functionsHaveConfigurableNames=function(){if(!MN()||!NR)return!1;var e=NR(function(){},"name");return!!e&&!!e.configurable};var D8r=Function.prototype.bind;MN.boundFunctionsHaveNames=function(){return MN()&&typeof D8r=="function"&&function(){}.bind().name!==""};var N8r=MN,TIe=tce,k8r=rce(),F8r=N8r.functionsHaveConfigurableNames(),B8r=dL,G8r=function(e,t){if(typeof e!="function")throw new B8r("`fn` is not a function");var r=arguments.length>2&&!!arguments[2];return(!r||F8r)&&(k8r?TIe(e,"name",t,!0,!0):TIe(e,"name",t)),e},z8r=G8r,U8r=dL,V8r=Object,BKe=z8r(function(){if(this==null||this!==V8r(this))throw new U8r("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),$8r=BKe,W8r=Yk.supportsDescriptors,H8r=Object.getOwnPropertyDescriptor,GKe=function(){if(W8r&&/a/mig.flags==="gim"){var e=H8r(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var t="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(r,"sticky",{get:function(){t+="y"}}),e.get.call(r),t==="dy")return e.get}}return $8r},j8r=Yk.supportsDescriptors,X8r=GKe,Y8r=vL,q8r=Object.defineProperty,Z8r=gKe,CIe=bKe,K8r=/a/,J8r=function(){if(!j8r||!CIe)throw new Z8r("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=X8r(),t=CIe(K8r),r=Y8r(t,"flags");return(!r||r.get!==e)&&q8r(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},Q8r=Yk,eGr=nce.exports,tGr=BKe,zKe=GKe,rGr=J8r,UKe=eGr(zKe());Q8r(UKe,{getPolyfill:zKe,implementation:tGr,shim:rGr});var nGr=UKe,VKe=ece,iGr=VKe("Date.prototype.getDay"),aGr=function(e){try{return iGr(e),!0}catch{return!1}},oGr=VKe("Object.prototype.toString"),sGr="[object Date]",lGr=Zhe(),uGr=function(e){return typeof e!="object"||e===null?!1:lGr?aGr(e):oGr(e)===sGr},AIe=dKe,MIe=r8r,IIe=C8r,LIe=R8r,PIe=nGr,OIe=uGr,RIe=Date.prototype.getTime;function $Ke(n,e,t){var r=t||{};return(r.strict?IIe(n,e):n===e)?!0:!n||!e||typeof n!="object"&&typeof e!="object"?r.strict?IIe(n,e):n==e:hGr(n,e,r)}function DIe(n){return n==null}function NIe(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function hGr(n,e,t){var r,i;if(typeof n!=typeof e||DIe(n)||DIe(e)||n.prototype!==e.prototype||MIe(n)!==MIe(e))return!1;var a=LIe(n),o=LIe(e);if(a!==o)return!1;if(a||o)return n.source===e.source&&PIe(n)===PIe(e);if(OIe(n)&&OIe(e))return RIe.call(n)===RIe.call(e);var s=NIe(n),l=NIe(e);if(s!==l)return!1;if(s||l){if(n.length!==e.length)return!1;for(r=0;r<n.length;r++)if(n[r]!==e[r])return!1;return!0}if(typeof n!=typeof e)return!1;try{var u=AIe(n),h=AIe(e)}catch{return!1}if(u.length!==h.length)return!1;for(u.sort(),h.sort(),r=u.length-1;r>=0;r--)if(u[r]!=h[r])return!1;for(r=u.length-1;r>=0;r--)if(i=u[r],!$Ke(n[i],e[i],t))return!1;return!0}var PA=$Ke;function WKe(n,e,t){if(t===void 0&&(t={}),t=t||{},!Io(t))throw new Error("options is invalid");var r=t.tolerance||0,i=[],a=fL.exports(),o=C2(n);a.load(o);var s;return B1(e,function(l){var u=!1;!l||(uo(a.search(l),function(h){if(u===!1){var c=ri(l).sort(),f=ri(h).sort();PA(c,f)||(r===0?yd(c[0],h)&&yd(c[1],h):G1(h,c[0]).properties.dist<=r&&G1(h,c[1]).properties.dist<=r)?(u=!0,s?s=mZ(s,l):s=l):(r===0?yd(f[0],l)&&yd(f[1],l):G1(l,f[0]).properties.dist<=r&&G1(l,f[1]).properties.dist<=r)&&(s?s=mZ(s,h):s=h)}}),u===!1&&s&&(i.push(s),s=void 0))}),s&&i.push(s),Zn(i)}function mZ(n,e){var t=ri(e),r=ri(n),i=r[0],a=r[r.length-1],o=n.geometry.coordinates;return PA(t[0],i)?o.unshift(t[1]):PA(t[0],a)?o.push(t[1]):PA(t[1],i)?o.unshift(t[0]):PA(t[1],a)&&o.push(t[0]),n}function cGr(n,e,t,r,i){if(i=i||{},!Io(i))throw new Error("options is invalid");var a=i.properties;if(!n)throw new Error("center is required");if(t==null)throw new Error("bearing1 is required");if(r==null)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if(typeof i!="object")throw new Error("options must be an object");if(kIe(t)===kIe(r))return Hhe(n,e,i);var o=ri(n),s=uKe(n,e,t,r,i),l=[[o]];return gl(s,function(u){l[0].push(u)}),l[0].push(o),Qi(l,a)}function kIe(n){var e=n%360;return e<0&&(e+=360),e}function A2(n,e,t){t===void 0&&(t={});var r;t.final?r=FIe(Wo(e),Wo(n)):r=FIe(Wo(n),Wo(e));var i=r>180?-(360-r):r;return i}function FIe(n,e){var t=ku(n[1]),r=ku(e[1]),i=ku(e[0]-n[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var a=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,a);return(aw(o)+360)%360}function QM(n,e,t,r){r===void 0&&(r={});var i=e<0,a=b2(Math.abs(e),r.units,"meters");i&&(a=-Math.abs(a));var o=Wo(n),s=fGr(o,a,t);return s[0]+=s[0]-o[0]>180?-360:o[0]-s[0]>180?360:0,Vi(s,r.properties)}function fGr(n,e,t,r){r=r===void 0?Au:Number(r);var i=e/r,a=n[0]*Math.PI/180,o=ku(n[1]),s=ku(t),l=i*Math.cos(s),u=o+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var h=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),c=Math.abs(h)>1e-11?l/h:Math.cos(o),f=i*Math.sin(s)/c,d=a+f;return[(d*180/Math.PI+540)%360-180,u*180/Math.PI]}function dGr(n,e){var t=ri(n),r=ri(e),i,a,o,s,l=yl(e),u=0,h=null;t[0]>l[0]&&t[0]<l[2]&&t[1]>l[1]&&t[1]<l[3]&&(h=D7(n,_$(e)),u=h.properties.featureIndex);var c=zf(e);switch(c){case"Polygon":i=r[0][u],a=r[0][0],h!==null&&h.geometry.coordinates[1]<t[1]&&(a=r[0][u]),s=IN(r[0][0],r[0][r[0].length-1],t);var f=BIe(r[0],t,s,o,i,a);i=f[0],a=f[1];break;case"MultiPolygon":for(var d=0,v=0,p=0,g=0;g<r[0].length;g++){d=g;for(var m=!1,y=0;y<r[0][g].length;y++){if(v=y,p===u){m=!0;break}p++}if(m)break}i=r[0][d][v],a=r[0][d][v],s=IN(r[0][0][0],r[0][0][r[0][0].length-1],t),r.forEach(function(_){var x=BIe(_[0],t,s,o,i,a);i=x[0],a=x[1]});break}return Zn([Vi(i),Vi(a)])}function BIe(n,e,t,r,i,a){for(var o=0;o<n.length;o++){var s=n[o],l=n[o+1];o===n.length-1&&(l=n[0]),r=IN(s,l,e),t<=0&&r>0?pGr(e,s,i)||(i=s):t>0&&r<=0&&(vGr(e,s,a)||(a=s)),t=r}return[i,a]}function vGr(n,e,t){return IN(n,e,t)>0}function pGr(n,e,t){return IN(n,e,t)<0}function IN(n,e,t){return(e[0]-n[0])*(t[1]-n[1])-(t[0]-n[0])*(e[1]-n[1])}function F7(n){for(var e=ri(n),t=0,r=1,i,a;r<e.length;)i=a||e[0],a=e[r],t+=(a[0]-i[0])*(a[1]+i[1]),r++;return t>0}function gGr(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.reverse||!1,r=e.mutate||!1;if(!n)throw new Error("<geojson> is required");if(typeof t!="boolean")throw new Error("<reverse> must be a boolean");if(typeof r!="boolean")throw new Error("<mutate> must be a boolean");r===!1&&(n=Xh(n));var i=[];switch(n.type){case"GeometryCollection":return Pd(n,function(a){C8(a,t)}),n;case"FeatureCollection":return uo(n,function(a){uo(C8(a,t),function(o){i.push(o)})}),Zn(i)}return C8(n,t)}function C8(n,e){var t=n.type==="Feature"?n.geometry.type:n.type;switch(t){case"GeometryCollection":return Pd(n,function(r){C8(r,e)}),n;case"LineString":return GIe(ri(n),e),n;case"Polygon":return zIe(ri(n),e),n;case"MultiLineString":return ri(n).forEach(function(r){GIe(r,e)}),n;case"MultiPolygon":return ri(n).forEach(function(r){zIe(r,e)}),n;case"Point":case"MultiPoint":return n}}function GIe(n,e){F7(n)===e&&n.reverse()}function zIe(n,e){F7(n[0])!==e&&n[0].reverse();for(var t=1;t<n.length;t++)F7(n[t])===e&&n[t].reverse()}function yGr(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.zProperty||"elevation",r=e.flip,i=e.flags;Y_(n,"Point","input must contain Points");for(var a=mGr(n,r),o=[],s=0;s<a.length;s++){for(var l=a[s],u=[],h=0;h<l.length;h++){var c=l[h];c.properties[t]?u.push(c.properties[t]):u.push(0),i===!0&&(c.properties.matrixPosition=[s,h])}o.push(u)}return o}function mGr(n,e){var t={};uo(n,function(a){var o=ri(a)[1];t[o]||(t[o]=[]),t[o].push(a)});var r=Object.keys(t).map(function(a){var o=t[a],s=o.sort(function(l,u){return ri(l)[0]-ri(u)[0]});return s}),i=r.sort(function(a,o){return e?ri(a[0])[1]-ri(o[0])[1]:ri(o[0])[1]-ri(a[0])[1]});return i}/*!
* @license GNU Affero General Public License.
* Copyright (c) 2015, 2015 Ronny Lorenz <ronny@tbi.univie.ac.at>
* v. 1.2.0
* https://github.com/RaumZeit/MarchingSquares.js
*
* MarchingSquaresJS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MarchingSquaresJS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* As additional permission under GNU Affero General Public License version 3
* section 7, third-party projects (personal or commercial) may distribute,
* include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the
* requirement that said third-party project for that reason alone becomes
* subject to any requirement of the GNU Affero General Public License version 3.
* Any modifications to MarchingSquaresJS, however, must be shared with the public
* and made available.
*
* In summary this:
* - allows you to use MarchingSquaresJS at no cost
* - allows you to use MarchingSquaresJS for both personal and commercial purposes
* - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any
* license as long as this license notice is included
* - enables you to keep the source code of your program that uses MarchingSquaresJS
* undisclosed
* - forces you to share any modifications you have made to MarchingSquaresJS,
* e.g. bug-fixes
*
* You should have received a copy of the GNU Affero General Public License
* along with MarchingSquaresJS. If not, see <http://www.gnu.org/licenses/>.
*/var UIe={successCallback:null,verbose:!1,polygons:!1},Ab={};function _Gr(n,e,t,r){r=r||{};for(var i=Object.keys(UIe),a=0;a<i.length;a++){var o=i[a],s=r[o];s=typeof s<"u"&&s!==null?s:UIe[o],Ab[o]=s}Ab.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+t)+"]");var l=JGr(n,e,t),u;return Ab.polygons?(Ab.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=i9r(l)):(Ab.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=QGr(l)),typeof Ab.successCallback=="function"&&Ab.successCallback(u),u}var lc=64,Rp=16,th=4,Rh=1,_a=[],xa=[],Sa=[],wa=[],ba=[],Ea=[],Ta=[],Ca=[],Aa=[],Ma=[],Ia=[],La=[],Pa=[],Oa=[],Ra=[],Da=[],Na=[],ka=[],Fa=[],Ba=[],Ga=[],za=[],Ua=[],Va=[];Ta[85]=Ma[85]=-1;Ca[85]=Ia[85]=0;Aa[85]=La[85]=1;Fa[85]=za[85]=1;Ba[85]=Ua[85]=0;Ga[85]=Va[85]=1;_a[85]=wa[85]=0;xa[85]=ba[85]=-1;Sa[85]=Ra[85]=0;Da[85]=Pa[85]=0;Na[85]=Oa[85]=1;Ea[85]=ka[85]=1;za[1]=za[169]=0;Ua[1]=Ua[169]=-1;Va[1]=Va[169]=0;Pa[1]=Pa[169]=-1;Oa[1]=Oa[169]=0;Ra[1]=Ra[169]=0;Ma[4]=Ma[166]=0;Ia[4]=Ia[166]=-1;La[4]=La[166]=1;Da[4]=Da[166]=1;Na[4]=Na[166]=0;ka[4]=ka[166]=0;Ta[16]=Ta[154]=0;Ca[16]=Ca[154]=1;Aa[16]=Aa[154]=1;wa[16]=wa[154]=1;ba[16]=ba[154]=0;Ea[16]=Ea[154]=1;Fa[64]=Fa[106]=0;Ba[64]=Ba[106]=1;Ga[64]=Ga[106]=0;_a[64]=_a[106]=-1;xa[64]=xa[106]=0;Sa[64]=Sa[106]=1;Fa[2]=Fa[168]=0;Ba[2]=Ba[168]=-1;Ga[2]=Ga[168]=1;za[2]=za[168]=0;Ua[2]=Ua[168]=-1;Va[2]=Va[168]=0;Pa[2]=Pa[168]=-1;Oa[2]=Oa[168]=0;Ra[2]=Ra[168]=0;Da[2]=Da[168]=-1;Na[2]=Na[168]=0;ka[2]=ka[168]=1;Ta[8]=Ta[162]=0;Ca[8]=Ca[162]=-1;Aa[8]=Aa[162]=0;Ma[8]=Ma[162]=0;Ia[8]=Ia[162]=-1;La[8]=La[162]=1;Pa[8]=Pa[162]=1;Oa[8]=Oa[162]=0;Ra[8]=Ra[162]=1;Da[8]=Da[162]=1;Na[8]=Na[162]=0;ka[8]=ka[162]=0;Ta[32]=Ta[138]=0;Ca[32]=Ca[138]=1;Aa[32]=Aa[138]=1;Ma[32]=Ma[138]=0;Ia[32]=Ia[138]=1;La[32]=La[138]=0;_a[32]=_a[138]=1;xa[32]=xa[138]=0;Sa[32]=Sa[138]=0;wa[32]=wa[138]=1;ba[32]=ba[138]=0;Ea[32]=Ea[138]=1;za[128]=za[42]=0;Ua[128]=Ua[42]=1;Va[128]=Va[42]=1;Fa[128]=Fa[42]=0;Ba[128]=Ba[42]=1;Ga[128]=Ga[42]=0;_a[128]=_a[42]=-1;xa[128]=xa[42]=0;Sa[128]=Sa[42]=1;wa[128]=wa[42]=-1;ba[128]=ba[42]=0;Ea[128]=Ea[42]=0;Ma[5]=Ma[165]=-1;Ia[5]=Ia[165]=0;La[5]=La[165]=0;za[5]=za[165]=1;Ua[5]=Ua[165]=0;Va[5]=Va[165]=0;Da[20]=Da[150]=0;Na[20]=Na[150]=1;ka[20]=ka[150]=1;wa[20]=wa[150]=0;ba[20]=ba[150]=-1;Ea[20]=Ea[150]=1;Ta[80]=Ta[90]=-1;Ca[80]=Ca[90]=0;Aa[80]=Aa[90]=1;Fa[80]=Fa[90]=1;Ba[80]=Ba[90]=0;Ga[80]=Ga[90]=1;Pa[65]=Pa[105]=0;Oa[65]=Oa[105]=1;Ra[65]=Ra[105]=0;_a[65]=_a[105]=0;xa[65]=xa[105]=-1;Sa[65]=Sa[105]=0;Ta[160]=Ta[10]=-1;Ca[160]=Ca[10]=0;Aa[160]=Aa[10]=1;Ma[160]=Ma[10]=-1;Ia[160]=Ia[10]=0;La[160]=La[10]=0;za[160]=za[10]=1;Ua[160]=Ua[10]=0;Va[160]=Va[10]=0;Fa[160]=Fa[10]=1;Ba[160]=Ba[10]=0;Ga[160]=Ga[10]=1;Da[130]=Da[40]=0;Na[130]=Na[40]=1;ka[130]=ka[40]=1;Pa[130]=Pa[40]=0;Oa[130]=Oa[40]=1;Ra[130]=Ra[40]=0;_a[130]=_a[40]=0;xa[130]=xa[40]=-1;Sa[130]=Sa[40]=0;wa[130]=wa[40]=0;ba[130]=ba[40]=-1;Ea[130]=Ea[40]=1;Ma[37]=Ma[133]=0;Ia[37]=Ia[133]=1;La[37]=La[133]=1;za[37]=za[133]=0;Ua[37]=Ua[133]=1;Va[37]=Va[133]=0;_a[37]=_a[133]=-1;xa[37]=xa[133]=0;Sa[37]=Sa[133]=0;wa[37]=wa[133]=1;ba[37]=ba[133]=0;Ea[37]=Ea[133]=0;Da[148]=Da[22]=-1;Na[148]=Na[22]=0;ka[148]=ka[22]=0;za[148]=za[22]=0;Ua[148]=Ua[22]=-1;Va[148]=Va[22]=1;Fa[148]=Fa[22]=0;Ba[148]=Ba[22]=1;Ga[148]=Ga[22]=1;wa[148]=wa[22]=-1;ba[148]=ba[22]=0;Ea[148]=Ea[22]=1;Ta[82]=Ta[88]=0;Ca[82]=Ca[88]=-1;Aa[82]=Aa[88]=1;Da[82]=Da[88]=1;Na[82]=Na[88]=0;ka[82]=ka[88]=1;Pa[82]=Pa[88]=-1;Oa[82]=Oa[88]=0;Ra[82]=Ra[88]=1;Fa[82]=Fa[88]=0;Ba[82]=Ba[88]=-1;Ga[82]=Ga[88]=0;Ta[73]=Ta[97]=0;Ca[73]=Ca[97]=1;Aa[73]=Aa[97]=0;Ma[73]=Ma[97]=0;Ia[73]=Ia[97]=-1;La[73]=La[97]=0;Pa[73]=Pa[97]=1;Oa[73]=Oa[97]=0;Ra[73]=Ra[97]=0;_a[73]=_a[97]=1;xa[73]=xa[97]=0;Sa[73]=Sa[97]=1;Ta[145]=Ta[25]=0;Ca[145]=Ca[25]=-1;Aa[145]=Aa[25]=0;Pa[145]=Pa[25]=1;Oa[145]=Oa[25]=0;Ra[145]=Ra[25]=1;za[145]=za[25]=0;Ua[145]=Ua[25]=1;Va[145]=Va[25]=1;wa[145]=wa[25]=-1;ba[145]=ba[25]=0;Ea[145]=Ea[25]=0;Ma[70]=Ma[100]=0;Ia[70]=Ia[100]=1;La[70]=La[100]=0;Da[70]=Da[100]=-1;Na[70]=Na[100]=0;ka[70]=ka[100]=1;Fa[70]=Fa[100]=0;Ba[70]=Ba[100]=-1;Ga[70]=Ga[100]=1;_a[70]=_a[100]=1;xa[70]=xa[100]=0;Sa[70]=Sa[100]=0;Ma[101]=Ma[69]=0;Ia[101]=Ia[69]=1;La[101]=La[69]=0;_a[101]=_a[69]=1;xa[101]=xa[69]=0;Sa[101]=Sa[69]=0;za[149]=za[21]=0;Ua[149]=Ua[21]=1;Va[149]=Va[21]=1;wa[149]=wa[21]=-1;ba[149]=ba[21]=0;Ea[149]=Ea[21]=0;Da[86]=Da[84]=-1;Na[86]=Na[84]=0;ka[86]=ka[84]=1;Fa[86]=Fa[84]=0;Ba[86]=Ba[84]=-1;Ga[86]=Ga[84]=1;Ta[89]=Ta[81]=0;Ca[89]=Ca[81]=-1;Aa[89]=Aa[81]=0;Pa[89]=Pa[81]=1;Oa[89]=Oa[81]=0;Ra[89]=Ra[81]=1;Ta[96]=Ta[74]=0;Ca[96]=Ca[74]=1;Aa[96]=Aa[74]=0;Ma[96]=Ma[74]=-1;Ia[96]=Ia[74]=0;La[96]=La[74]=1;Fa[96]=Fa[74]=1;Ba[96]=Ba[74]=0;Ga[96]=Ga[74]=0;_a[96]=_a[74]=1;xa[96]=xa[74]=0;Sa[96]=Sa[74]=1;Ta[24]=Ta[146]=0;Ca[24]=Ca[146]=-1;Aa[24]=Aa[146]=1;Da[24]=Da[146]=1;Na[24]=Na[146]=0;ka[24]=ka[146]=1;Pa[24]=Pa[146]=0;Oa[24]=Oa[146]=1;Ra[24]=Ra[146]=1;wa[24]=wa[146]=0;ba[24]=ba[146]=-1;Ea[24]=Ea[146]=0;Ma[6]=Ma[164]=-1;Ia[6]=Ia[164]=0;La[6]=La[164]=1;Da[6]=Da[164]=-1;Na[6]=Na[164]=0;ka[6]=ka[164]=0;za[6]=za[164]=0;Ua[6]=Ua[164]=-1;Va[6]=Va[164]=1;Fa[6]=Fa[164]=1;Ba[6]=Ba[164]=0;Ga[6]=Ga[164]=0;Pa[129]=Pa[41]=0;Oa[129]=Oa[41]=1;Ra[129]=Ra[41]=1;za[129]=za[41]=0;Ua[129]=Ua[41]=1;Va[129]=Va[41]=0;_a[129]=_a[41]=-1;xa[129]=xa[41]=0;Sa[129]=Sa[41]=0;wa[129]=wa[41]=0;ba[129]=ba[41]=-1;Ea[129]=Ea[41]=0;Da[66]=Da[104]=0;Na[66]=Na[104]=1;ka[66]=ka[104]=0;Pa[66]=Pa[104]=-1;Oa[66]=Oa[104]=0;Ra[66]=Ra[104]=1;Fa[66]=Fa[104]=0;Ba[66]=Ba[104]=-1;Ga[66]=Ga[104]=0;_a[66]=_a[104]=0;xa[66]=xa[104]=-1;Sa[66]=Sa[104]=1;Ta[144]=Ta[26]=-1;Ca[144]=Ca[26]=0;Aa[144]=Aa[26]=0;za[144]=za[26]=1;Ua[144]=Ua[26]=0;Va[144]=Va[26]=1;Fa[144]=Fa[26]=0;Ba[144]=Ba[26]=1;Ga[144]=Ga[26]=1;wa[144]=wa[26]=-1;ba[144]=ba[26]=0;Ea[144]=Ea[26]=1;Ma[36]=Ma[134]=0;Ia[36]=Ia[134]=1;La[36]=La[134]=1;Da[36]=Da[134]=0;Na[36]=Na[134]=1;ka[36]=ka[134]=0;_a[36]=_a[134]=0;xa[36]=xa[134]=-1;Sa[36]=Sa[134]=1;wa[36]=wa[134]=1;ba[36]=ba[134]=0;Ea[36]=Ea[134]=0;Ta[9]=Ta[161]=-1;Ca[9]=Ca[161]=0;Aa[9]=Aa[161]=0;Ma[9]=Ma[161]=0;Ia[9]=Ia[161]=-1;La[9]=La[161]=0;Pa[9]=Pa[161]=1;Oa[9]=Oa[161]=0;Ra[9]=Ra[161]=0;za[9]=za[161]=1;Ua[9]=Ua[161]=0;Va[9]=Va[161]=1;Ta[136]=0;Ca[136]=1;Aa[136]=1;Ma[136]=0;Ia[136]=1;La[136]=0;Da[136]=-1;Na[136]=0;ka[136]=1;Pa[136]=-1;Oa[136]=0;Ra[136]=0;za[136]=0;Ua[136]=-1;Va[136]=0;Fa[136]=0;Ba[136]=-1;Ga[136]=1;_a[136]=1;xa[136]=0;Sa[136]=0;wa[136]=1;ba[136]=0;Ea[136]=1;Ta[34]=0;Ca[34]=-1;Aa[34]=0;Ma[34]=0;Ia[34]=-1;La[34]=1;Da[34]=1;Na[34]=0;ka[34]=0;Pa[34]=1;Oa[34]=0;Ra[34]=1;za[34]=0;Ua[34]=1;Va[34]=1;Fa[34]=0;Ba[34]=1;Ga[34]=0;_a[34]=-1;xa[34]=0;Sa[34]=1;wa[34]=-1;ba[34]=0;Ea[34]=0;Ta[35]=0;Ca[35]=1;Aa[35]=1;Ma[35]=0;Ia[35]=-1;La[35]=1;Da[35]=1;Na[35]=0;ka[35]=0;Pa[35]=-1;Oa[35]=0;Ra[35]=0;za[35]=0;Ua[35]=-1;Va[35]=0;Fa[35]=0;Ba[35]=1;Ga[35]=0;_a[35]=-1;xa[35]=0;Sa[35]=1;wa[35]=1;ba[35]=0;Ea[35]=1;Ta[153]=0;Ca[153]=1;Aa[153]=1;Pa[153]=-1;Oa[153]=0;Ra[153]=0;za[153]=0;Ua[153]=-1;Va[153]=0;wa[153]=1;ba[153]=0;Ea[153]=1;Ma[102]=0;Ia[102]=-1;La[102]=1;Da[102]=1;Na[102]=0;ka[102]=0;Fa[102]=0;Ba[102]=1;Ga[102]=0;_a[102]=-1;xa[102]=0;Sa[102]=1;Ta[155]=0;Ca[155]=-1;Aa[155]=0;Pa[155]=1;Oa[155]=0;Ra[155]=1;za[155]=0;Ua[155]=1;Va[155]=1;wa[155]=-1;ba[155]=0;Ea[155]=0;Ma[103]=0;Ia[103]=1;La[103]=0;Da[103]=-1;Na[103]=0;ka[103]=1;Fa[103]=0;Ba[103]=-1;Ga[103]=1;_a[103]=1;xa[103]=0;Sa[103]=0;Ta[152]=0;Ca[152]=1;Aa[152]=1;Da[152]=-1;Na[152]=0;ka[152]=1;Pa[152]=-1;Oa[152]=0;Ra[152]=0;za[152]=0;Ua[152]=-1;Va[152]=0;Fa[152]=0;Ba[152]=-1;Ga[152]=1;wa[152]=1;ba[152]=0;Ea[152]=1;Ta[156]=0;Ca[156]=-1;Aa[156]=1;Da[156]=1;Na[156]=0;ka[156]=1;Pa[156]=-1;Oa[156]=0;Ra[156]=0;za[156]=0;Ua[156]=-1;Va[156]=0;Fa[156]=0;Ba[156]=1;Ga[156]=1;wa[156]=-1;ba[156]=0;Ea[156]=1;Ta[137]=0;Ca[137]=1;Aa[137]=1;Ma[137]=0;Ia[137]=1;La[137]=0;Pa[137]=-1;Oa[137]=0;Ra[137]=0;za[137]=0;Ua[137]=-1;Va[137]=0;_a[137]=1;xa[137]=0;Sa[137]=0;wa[137]=1;ba[137]=0;Ea[137]=1;Ta[139]=0;Ca[139]=1;Aa[139]=1;Ma[139]=0;Ia[139]=-1;La[139]=0;Pa[139]=1;Oa[139]=0;Ra[139]=0;za[139]=0;Ua[139]=1;Va[139]=0;_a[139]=-1;xa[139]=0;Sa[139]=0;wa[139]=1;ba[139]=0;Ea[139]=1;Ta[98]=0;Ca[98]=-1;Aa[98]=0;Ma[98]=0;Ia[98]=-1;La[98]=1;Da[98]=1;Na[98]=0;ka[98]=0;Pa[98]=1;Oa[98]=0;Ra[98]=1;Fa[98]=0;Ba[98]=1;Ga[98]=0;_a[98]=-1;xa[98]=0;Sa[98]=1;Ta[99]=0;Ca[99]=1;Aa[99]=0;Ma[99]=0;Ia[99]=-1;La[99]=1;Da[99]=1;Na[99]=0;ka[99]=0;Pa[99]=-1;Oa[99]=0;Ra[99]=1;Fa[99]=0;Ba[99]=-1;Ga[99]=0;_a[99]=1;xa[99]=0;Sa[99]=1;Ma[38]=0;Ia[38]=-1;La[38]=1;Da[38]=1;Na[38]=0;ka[38]=0;za[38]=0;Ua[38]=1;Va[38]=1;Fa[38]=0;Ba[38]=1;Ga[38]=0;_a[38]=-1;xa[38]=0;Sa[38]=1;wa[38]=-1;ba[38]=0;Ea[38]=0;Ma[39]=0;Ia[39]=1;La[39]=1;Da[39]=-1;Na[39]=0;ka[39]=0;za[39]=0;Ua[39]=-1;Va[39]=1;Fa[39]=0;Ba[39]=1;Ga[39]=0;_a[39]=-1;xa[39]=0;Sa[39]=1;wa[39]=1;ba[39]=0;Ea[39]=0;var ice=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},ace=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},oce=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},sce=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},lce=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},uce=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},hce=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},cce=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},xGr=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},SGr=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},wGr=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},bGr=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},EGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},TGr=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},CGr=function(){return[[0,0],[0,1],[1,1],[1,0]]},AGr=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},MGr=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},IGr=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},LGr=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},PGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},OGr=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},RGr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},DGr=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},NGr=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},kGr=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},FGr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},BGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},GGr=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},zGr=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},UGr=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},VGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},$Gr=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},WGr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},HGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},jGr=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},XGr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},YGr=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},qGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},ZGr=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},KGr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Qr=[],Yr=[],kn=[],En=[],ei=[],Yn=[],$a=[],Ya=[];En[1]=ei[1]=18;En[169]=ei[169]=18;kn[4]=Yr[4]=12;kn[166]=Yr[166]=12;Qr[16]=Ya[16]=4;Qr[154]=Ya[154]=4;Yn[64]=$a[64]=22;Yn[106]=$a[106]=22;kn[2]=Yn[2]=17;En[2]=ei[2]=18;kn[168]=Yn[168]=17;En[168]=ei[168]=18;Qr[8]=En[8]=9;Yr[8]=kn[8]=12;Qr[162]=En[162]=9;Yr[162]=kn[162]=12;Qr[32]=Ya[32]=4;Yr[32]=$a[32]=1;Qr[138]=Ya[138]=4;Yr[138]=$a[138]=1;ei[128]=Ya[128]=21;Yn[128]=$a[128]=22;ei[42]=Ya[42]=21;Yn[42]=$a[42]=22;Yr[5]=ei[5]=14;Yr[165]=ei[165]=14;kn[20]=Ya[20]=6;kn[150]=Ya[150]=6;Qr[80]=Yn[80]=11;Qr[90]=Yn[90]=11;En[65]=$a[65]=3;En[105]=$a[105]=3;Qr[160]=Yn[160]=11;Yr[160]=ei[160]=14;Qr[10]=Yn[10]=11;Yr[10]=ei[10]=14;kn[130]=Ya[130]=6;En[130]=$a[130]=3;kn[40]=Ya[40]=6;En[40]=$a[40]=3;Yr[101]=$a[101]=1;Yr[69]=$a[69]=1;ei[149]=Ya[149]=21;ei[21]=Ya[21]=21;kn[86]=Yn[86]=17;kn[84]=Yn[84]=17;Qr[89]=En[89]=9;Qr[81]=En[81]=9;Qr[96]=$a[96]=0;Yr[96]=Yn[96]=15;Qr[74]=$a[74]=0;Yr[74]=Yn[74]=15;Qr[24]=kn[24]=8;En[24]=Ya[24]=7;Qr[146]=kn[146]=8;En[146]=Ya[146]=7;Yr[6]=Yn[6]=15;kn[6]=ei[6]=16;Yr[164]=Yn[164]=15;kn[164]=ei[164]=16;En[129]=Ya[129]=7;ei[129]=$a[129]=20;En[41]=Ya[41]=7;ei[41]=$a[41]=20;kn[66]=$a[66]=2;En[66]=Yn[66]=19;kn[104]=$a[104]=2;En[104]=Yn[104]=19;Qr[144]=ei[144]=10;Yn[144]=Ya[144]=23;Qr[26]=ei[26]=10;Yn[26]=Ya[26]=23;Yr[36]=Ya[36]=5;kn[36]=$a[36]=2;Yr[134]=Ya[134]=5;kn[134]=$a[134]=2;Qr[9]=ei[9]=10;Yr[9]=En[9]=13;Qr[161]=ei[161]=10;Yr[161]=En[161]=13;Yr[37]=Ya[37]=5;ei[37]=$a[37]=20;Yr[133]=Ya[133]=5;ei[133]=$a[133]=20;kn[148]=ei[148]=16;Yn[148]=Ya[148]=23;kn[22]=ei[22]=16;Yn[22]=Ya[22]=23;Qr[82]=kn[82]=8;En[82]=Yn[82]=19;Qr[88]=kn[88]=8;En[88]=Yn[88]=19;Qr[73]=$a[73]=0;Yr[73]=En[73]=13;Qr[97]=$a[97]=0;Yr[97]=En[97]=13;Qr[145]=En[145]=9;ei[145]=Ya[145]=21;Qr[25]=En[25]=9;ei[25]=Ya[25]=21;Yr[70]=$a[70]=1;kn[70]=Yn[70]=17;Yr[100]=$a[100]=1;kn[100]=Yn[100]=17;Qr[34]=En[34]=9;Yr[34]=kn[34]=12;ei[34]=Ya[34]=21;Yn[34]=$a[34]=22;Qr[136]=Ya[136]=4;Yr[136]=$a[136]=1;kn[136]=Yn[136]=17;En[136]=ei[136]=18;Qr[35]=Ya[35]=4;Yr[35]=kn[35]=12;En[35]=ei[35]=18;Yn[35]=$a[35]=22;Qr[153]=Ya[153]=4;En[153]=ei[153]=18;Yr[102]=kn[102]=12;Yn[102]=$a[102]=22;Qr[155]=En[155]=9;ei[155]=Ya[155]=23;Yr[103]=$a[103]=1;kn[103]=Yn[103]=17;Qr[152]=Ya[152]=4;kn[152]=Yn[152]=17;En[152]=ei[152]=18;Qr[156]=kn[156]=8;En[156]=ei[156]=18;Yn[156]=Ya[156]=23;Qr[137]=Ya[137]=4;Yr[137]=$a[137]=1;En[137]=ei[137]=18;Qr[139]=Ya[139]=4;Yr[139]=En[139]=13;ei[139]=$a[139]=20;Qr[98]=En[98]=9;Yr[98]=kn[98]=12;Yn[98]=$a[98]=22;Qr[99]=$a[99]=0;Yr[99]=kn[99]=12;En[99]=Yn[99]=19;Yr[38]=kn[38]=12;ei[38]=Ya[38]=21;Yn[38]=$a[38]=22;Yr[39]=Ya[39]=5;kn[39]=ei[39]=16;Yn[39]=$a[39]=22;var zr=[];zr[1]=zr[169]=ice;zr[4]=zr[166]=ace;zr[16]=zr[154]=oce;zr[64]=zr[106]=sce;zr[168]=zr[2]=lce;zr[162]=zr[8]=uce;zr[138]=zr[32]=hce;zr[42]=zr[128]=cce;zr[5]=zr[165]=xGr;zr[20]=zr[150]=SGr;zr[80]=zr[90]=wGr;zr[65]=zr[105]=bGr;zr[160]=zr[10]=EGr;zr[130]=zr[40]=TGr;zr[85]=CGr;zr[101]=zr[69]=AGr;zr[149]=zr[21]=MGr;zr[86]=zr[84]=IGr;zr[89]=zr[81]=LGr;zr[96]=zr[74]=PGr;zr[24]=zr[146]=OGr;zr[6]=zr[164]=RGr;zr[129]=zr[41]=DGr;zr[66]=zr[104]=NGr;zr[144]=zr[26]=kGr;zr[36]=zr[134]=FGr;zr[9]=zr[161]=BGr;zr[37]=zr[133]=GGr;zr[148]=zr[22]=zGr;zr[82]=zr[88]=UGr;zr[73]=zr[97]=VGr;zr[145]=zr[25]=$Gr;zr[70]=zr[100]=WGr;zr[34]=function(n){return[cce(n),uce(n)]};zr[35]=HGr;zr[136]=function(n){return[hce(n),lce(n)]};zr[153]=function(n){return[oce(n),ice(n)]};zr[102]=function(n){return[ace(n),sce(n)]};zr[155]=jGr;zr[103]=XGr;zr[152]=function(n){return[oce(n),lce(n)]};zr[156]=YGr;zr[137]=function(n){return[hce(n),ice(n)]};zr[139]=qGr;zr[98]=function(n){return[uce(n),sce(n)]};zr[99]=ZGr;zr[38]=function(n){return[ace(n),cce(n)]};zr[39]=KGr;function he(n,e,t){return(n-e)/(t-e)}function _Z(n){return n.constructor.toString().indexOf("Array")>-1}function JGr(n,e,t){for(var r=n.length-1,i=n[0].length-1,a={rows:r,cols:i,cells:[]},o=e+Math.abs(t),s=0;s<r;++s){a.cells[s]=[];for(var l=0;l<i;++l){var u=0,h=n[s+1][l],c=n[s+1][l+1],f=n[s][l+1],d=n[s][l];if(!(isNaN(h)||isNaN(c)||isNaN(f)||isNaN(d))){u|=h<e?0:h>o?128:64,u|=c<e?0:c>o?32:16,u|=f<e?0:f>o?8:4,u|=d<e?0:d>o?2:1;var v=+u,p=0;if(u===17||u===18||u===33||u===34||u===38||u===68||u===72||u===98||u===102||u===132||u===136||u===137||u===152||u===153){var g=(h+c+f+d)/4;p=g>o?2:g<e?0:1,u===34?p===1?u=35:p===0&&(u=136):u===136?p===1?(u=35,p=4):p===0&&(u=34):u===17?p===1?(u=155,p=4):p===0&&(u=153):u===68?p===1?(u=103,p=4):p===0&&(u=102):u===153?p===1&&(u=155):u===102?p===1&&(u=103):u===152?p<2&&(u=156,p=1):u===137?p<2&&(u=139,p=1):u===98?p<2&&(u=99,p=1):u===38?p<2&&(u=39,p=1):u===18?p>0?(u=156,p=4):u=152:u===33?p>0?(u=139,p=4):u=137:u===72?p>0?(u=99,p=4):u=98:u===132&&(p>0?(u=39,p=4):u=38)}if(u!=0&&u!=170){var m,y,_,x,S,w,b,E;m=y=_=x=S=w=b=E=.5;var T=[];u===1?(_=1-he(e,f,d),E=1-he(e,h,d),T.push(En[u])):u===169?(_=he(o,d,f),E=he(o,d,h),T.push(En[u])):u===4?(w=1-he(e,c,f),x=he(e,d,f),T.push(Yr[u])):u===166?(w=he(o,f,c),x=1-he(o,f,d),T.push(Yr[u])):u===16?(S=he(e,f,c),y=he(e,h,c),T.push(Qr[u])):u===154?(S=1-he(o,c,f),y=1-he(o,c,h),T.push(Qr[u])):u===64?(b=he(e,d,h),m=1-he(e,c,h),T.push(Yn[u])):u===106?(b=1-he(o,h,d),m=he(o,h,c),T.push(Yn[u])):u===168?(x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),T.push(kn[u]),T.push(En[u])):u===2?(x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),T.push(kn[u]),T.push(En[u])):u===162?(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),T.push(kn[u]),T.push(En[u])):u===8?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),T.push(Qr[u]),T.push(Yr[u])):u===138?(S=1-he(e,c,f),w=1-he(o,c,f),m=1-he(o,c,h),y=1-he(e,c,h),T.push(Qr[u]),T.push(Yr[u])):u===32?(S=he(o,f,c),w=he(e,f,c),m=he(e,h,c),y=he(o,h,c),T.push(Qr[u]),T.push(Yr[u])):u===42?(E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c),T.push(ei[u]),T.push(Yn[u])):u===128&&(E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h),T.push(ei[u]),T.push(Yn[u])),u===5?(w=1-he(e,c,f),E=1-he(e,h,d),T.push(Yr[u])):u===165?(w=he(o,f,c),E=he(o,d,h),T.push(Yr[u])):u===20?(x=he(e,d,f),y=he(e,h,c),T.push(kn[u])):u===150?(x=1-he(o,f,d),y=1-he(o,c,h),T.push(kn[u])):u===80?(S=he(e,f,c),b=he(e,d,h),T.push(Qr[u])):u===90?(S=1-he(o,c,f),b=1-he(o,h,d),T.push(Qr[u])):u===65?(_=1-he(e,f,d),m=1-he(e,c,h),T.push(En[u])):u===105?(_=he(o,d,f),m=he(o,h,c),T.push(En[u])):u===160?(S=he(o,f,c),w=he(e,f,c),E=he(e,d,h),b=he(o,d,h),T.push(Qr[u]),T.push(Yr[u])):u===10?(S=1-he(e,c,f),w=1-he(o,c,f),E=1-he(o,h,d),b=1-he(e,h,d),T.push(Qr[u]),T.push(Yr[u])):u===130?(x=1-he(e,f,d),_=1-he(o,f,d),m=1-he(o,c,h),y=1-he(e,c,h),T.push(kn[u]),T.push(En[u])):u===40?(x=he(o,d,f),_=he(e,d,f),m=he(e,h,c),y=he(o,h,c),T.push(kn[u]),T.push(En[u])):u===101?(w=he(o,f,c),m=he(o,h,c),T.push(Yr[u])):u===69?(w=1-he(e,c,f),m=1-he(e,c,h),T.push(Yr[u])):u===149?(E=he(o,d,h),y=1-he(o,c,h),T.push(ei[u])):u===21?(E=1-he(e,h,d),y=he(e,h,c),T.push(ei[u])):u===86?(x=1-he(o,f,d),b=1-he(o,h,d),T.push(kn[u])):u===84?(x=he(e,d,f),b=he(e,d,h),T.push(kn[u])):u===89?(S=1-he(o,c,f),_=he(o,d,f),T.push(En[u])):u===81?(S=he(e,f,c),_=1-he(e,f,d),T.push(En[u])):u===96?(S=he(o,f,c),w=he(e,f,c),b=he(e,d,h),m=he(o,h,c),T.push(Qr[u]),T.push(Yr[u])):u===74?(S=1-he(e,c,f),w=1-he(o,c,f),b=1-he(o,h,d),m=1-he(e,c,h),T.push(Qr[u]),T.push(Yr[u])):u===24?(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),y=he(e,h,c),T.push(Qr[u]),T.push(En[u])):u===146?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),y=1-he(o,c,h),T.push(Qr[u]),T.push(En[u])):u===6?(w=1-he(e,c,f),x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),T.push(Yr[u]),T.push(kn[u])):u===164?(w=he(o,f,c),x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),T.push(Yr[u]),T.push(kn[u])):u===129?(_=1-he(e,f,d),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h),T.push(En[u]),T.push(ei[u])):u===41?(_=he(o,d,f),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c),T.push(En[u]),T.push(ei[u])):u===66?(x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),m=1-he(e,c,h),T.push(kn[u]),T.push(En[u])):u===104?(x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),m=he(o,h,c),T.push(En[u]),T.push($a[u])):u===144?(S=he(e,f,c),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h),T.push(Qr[u]),T.push(Yn[u])):u===26?(S=1-he(o,c,f),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c),T.push(Qr[u]),T.push(Yn[u])):u===36?(w=he(o,f,c),x=he(e,d,f),m=he(e,h,c),y=he(o,h,c),T.push(Yr[u]),T.push(kn[u])):u===134?(w=1-he(e,c,f),x=1-he(o,f,d),m=1-he(o,c,h),y=1-he(e,c,h),T.push(Yr[u]),T.push(kn[u])):u===9?(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),E=1-he(e,h,d),T.push(Qr[u]),T.push(Yr[u])):u===161?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),E=he(o,d,h),T.push(Qr[u]),T.push(Yr[u])):u===37?(w=he(o,f,c),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c),T.push(Yr[u]),T.push(ei[u])):u===133?(w=1-he(e,c,f),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h),T.push(Yr[u]),T.push(ei[u])):u===148?(x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h),T.push(kn[u]),T.push(Yn[u])):u===22?(x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c),T.push(kn[u]),T.push(Yn[u])):u===82?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),T.push(Qr[u]),T.push(En[u])):u===88?(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),T.push(Qr[u]),T.push(En[u])):u===73?(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),m=1-he(e,c,h),T.push(Qr[u]),T.push(Yr[u])):u===97?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),m=he(o,h,c),T.push(Qr[u]),T.push(Yr[u])):u===145?(S=he(e,f,c),_=1-he(e,f,d),E=he(o,d,h),y=1-he(o,c,h),T.push(Qr[u]),T.push(ei[u])):u===25?(S=1-he(o,c,f),_=he(o,d,f),E=1-he(e,h,d),y=he(e,h,c),T.push(Qr[u]),T.push(ei[u])):u===70?(w=1-he(e,c,f),x=1-he(o,f,d),b=1-he(o,h,d),m=1-he(e,c,h),T.push(Yr[u]),T.push(kn[u])):u===100?(w=he(o,f,c),x=he(e,d,f),b=he(e,d,h),m=he(o,h,c),T.push(Yr[u]),T.push(kn[u])):u===34?(p===0?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(ei[u]),T.push(Yn[u])):u===35?(p===4?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(En[u]),T.push(Yn[u])):u===136?(p===0?(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)):(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)),T.push(Qr[u]),T.push(Yr[u]),T.push(ei[u]),T.push(Yn[u])):u===153?(p===0?(S=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(En[u])):u===102?(p===0?(w=1-he(e,c,f),x=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Yr[u]),T.push(Yn[u])):u===155?(p===4?(S=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(ei[u])):u===103?(p===4?(w=1-he(e,c,f),x=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Yr[u]),T.push(kn[u])):u===152?(p===0?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(kn[u]),T.push(En[u])):u===156?(p===4?(S=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),y=he(e,h,c)):(S=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),E=he(e,d,h),b=he(o,d,h),y=1-he(o,c,h)),T.push(Qr[u]),T.push(En[u]),T.push(Yn[u])):u===137?(p===0?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)):(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)),T.push(Qr[u]),T.push(Yr[u]),T.push(En[u])):u===139?(p===4?(S=he(o,f,c),w=he(e,f,c),_=1-he(e,f,d),E=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)):(S=1-he(e,c,f),w=1-he(o,c,f),_=he(o,d,f),E=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)),T.push(Qr[u]),T.push(Yr[u]),T.push(ei[u])):u===98?(p===0?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(Yn[u])):u===99?(p===4?(S=1-he(e,c,f),w=1-he(o,c,f),x=he(o,d,f),_=he(e,d,f),b=he(e,d,h),m=1-he(e,c,h)):(S=he(o,f,c),w=he(e,f,c),x=1-he(e,f,d),_=1-he(o,f,d),b=1-he(o,h,d),m=he(o,h,c)),T.push(Qr[u]),T.push(Yr[u]),T.push(En[u])):u===38?(p===0?(w=1-he(e,c,f),x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Yr[u]),T.push(ei[u]),T.push(Yn[u])):u===39?(p===4?(w=1-he(e,c,f),x=he(e,d,f),E=he(e,d,h),b=he(o,d,h),m=1-he(o,c,h),y=1-he(e,c,h)):(w=he(o,f,c),x=1-he(o,f,d),E=1-he(o,h,d),b=1-he(e,h,d),m=he(e,h,c),y=he(o,h,c)),T.push(Yr[u]),T.push(kn[u]),T.push(Yn[u])):u===85&&(S=1,w=0,x=1,_=0,E=0,b=1,m=0,y=1),(m<0||m>1||y<0||y>1||S<0||S>1||x<0||x>1||E<0||E>1||b<0||b>1)&&console.log("MarchingSquaresJS-isoBands: "+u+" "+v+" "+h+","+c+","+f+","+d+" "+p+" "+m+" "+y+" "+S+" "+w+" "+x+" "+_+" "+E+" "+b),a.cells[s][l]={cval:u,cval_real:v,flipped:p,topleft:m,topright:y,righttop:S,rightbottom:w,bottomright:x,bottomleft:_,leftbottom:E,lefttop:b,edges:T}}}}}return a}function QGr(n){for(var e=[],t=n.rows,r=n.cols,i=[],a=0;a<t;a++)for(var o=0;o<r;o++)if(typeof n.cells[a][o]<"u"&&n.cells[a][o].edges.length>0){var s=n.cells[a][o],l=r9r(s),u=null,h=o,c=a;l!==null&&i.push([l.p[0]+h,l.p[1]+c]);do{if(u=n9r(n.cells[c][h],l.x,l.y,l.o),u!==null)i.push([u.p[0]+h,u.p[1]+c]),h+=u.x,c+=u.y,l=u;else break;if(c<0||c>=t||h<0||h>=r||typeof n.cells[c][h]>"u"){h-=u.x,c-=u.y;var f=e9r(n,h,c,u.x,u.y,u.o);if(f!==null)f.path.forEach(function(d){i.push(d)}),h=f.i,c=f.j,l=f;else break}}while(typeof n.cells[c][h]<"u"&&n.cells[c][h].edges.length>0);e.push(i),i=[],n.cells[a][o].edges.length>0&&o--}return e}function e9r(n,e,t,r,i,a){for(var o=n.cells[t][e],s=o.cval_real,l=e+r,u=t+i,h=[],c=!1;!c;){if(typeof n.cells[u]>"u"||typeof n.cells[u][l]>"u")if(u-=i,l-=r,o=n.cells[u][l],s=o.cval_real,i===-1)if(a===0)if(s&Rh)h.push([l,u]),r=-1,i=0,a=0;else if(s&th)h.push([l+1,u]),r=1,i=0,a=0;else{h.push([l+o.bottomright,u]),r=0,i=1,a=1,c=!0;break}else if(s&Rh)h.push([l,u]),r=-1,i=0,a=0;else if(s&th){h.push([l+o.bottomright,u]),r=0,i=1,a=1,c=!0;break}else{h.push([l+o.bottomleft,u]),r=0,i=1,a=0,c=!0;break}else if(i===1)if(a===0)if(s&Rp)h.push([l+1,u+1]),r=1,i=0,a=1;else if(s&lc){h.push([l+o.topleft,u+1]),r=0,i=-1,a=0,c=!0;break}else{h.push([l+o.topright,u+1]),r=0,i=-1,a=1,c=!0;break}else s&Rp?(h.push([l+1,u+1]),r=1,i=0,a=1):(h.push([l+1,u+1]),r=1,i=0,a=1);else if(r===-1)if(a===0)if(s&lc)h.push([l,u+1]),r=0,i=1,a=0;else if(s&Rh){h.push([l,u+o.leftbottom]),r=1,i=0,a=0,c=!0;break}else{h.push([l,u+o.lefttop]),r=1,i=0,a=1,c=!0;break}else if(s&lc)h.push([l,u+1]),r=0,i=1,a=0;else{console.log("MarchingSquaresJS-isoBands: wtf");break}else if(r===1)if(a===0)if(s&th)h.push([l+1,u]),r=0,i=-1,a=1;else{h.push([l+1,u+o.rightbottom]),r=-1,i=0,a=0,c=!0;break}else if(s&th)h.push([l+1,u]),r=0,i=-1,a=1;else if(s&Rp){h.push([l+1,u+o.righttop]),r=-1,i=0,a=1;break}else{h.push([l+1,u+o.rightbottom]),r=-1,i=0,a=0,c=!0;break}else{console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}else if(o=n.cells[u][l],s=o.cval_real,r===-1)if(a===0)if(typeof n.cells[u-1]<"u"&&typeof n.cells[u-1][l]<"u")r=0,i=-1,a=1;else if(s&Rh)h.push([l,u]);else{h.push([l+o.bottomright,u]),r=0,i=1,a=1,c=!0;break}else if(s&lc)console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!");else{console.log("MarchingSquaresJS-isoBands: found entry from top at "+l+","+u);break}else if(r===1)if(a===0){console.log("MarchingSquaresJS-isoBands: wtf");break}else if(typeof n.cells[u+1]<"u"&&typeof n.cells[u+1][l]<"u")r=0,i=1,a=0;else if(s&Rp)h.push([l+1,u+1]),r=1,i=0,a=1;else{h.push([l+o.topleft,u+1]),r=0,i=-1,a=0,c=!0;break}else if(i===-1)if(a===1)if(typeof n.cells[u][l+1]<"u")r=1,i=0,a=1;else if(s&th)h.push([l+1,u]),r=0,i=-1,a=1;else{h.push([l+1,u+o.righttop]),r=-1,i=0,a=1,c=!0;break}else{console.log("MarchingSquaresJS-isoBands: wtf");break}else if(i===1)if(a===0)if(typeof n.cells[u][l-1]<"u")r=-1,i=0,a=0;else if(s&lc)h.push([l,u+1]),r=0,i=1,a=0;else{h.push([l,u+o.leftbottom]),r=1,i=0,a=0,c=!0;break}else{console.log("MarchingSquaresJS-isoBands: wtf");break}else{console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(l+=r,u+=i,l===e&&u===t)break}return{path:h,i:l,j:u,x:r,y:i,o:a}}function t9r(n,e){delete n.edges[e];for(var t=e+1;t<n.edges.length;t++)n.edges[t-1]=n.edges[t];n.edges.pop()}function r9r(n){if(n.edges.length>0){var e=n.edges[n.edges.length-1],t=n.cval_real;switch(e){case 0:return t&Rp?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 1:return t&th?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 2:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 3:return t&Rh?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 4:return t&Rp?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 5:return t&th?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 6:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 7:return t&Rh?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 8:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.righttop],x:-1,y:0,o:1};case 9:return t&Rh?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 10:return t&Rh?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.righttop],x:-1,y:0,o:1};case 11:return t&lc?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 12:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 13:return t&Rh?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 14:return t&Rh?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 15:return t&lc?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 16:return t&th?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 17:return t&lc?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 18:return t&Rh?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 19:return t&lc?{p:[n.bottomleft,0],x:0,y:1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 20:return t&lc?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 21:return t&Rp?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.topright,1],x:0,y:-1,o:1};case 22:return t&lc?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 23:return t&Rp?{p:[0,n.lefttop],x:1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(n);break}}return null}function n9r(n,e,t,r){var i,a,o,s,l=n.cval,u;switch(e){case-1:switch(r){case 0:i=Yr[l],o=Ma[l],s=Ia[l],u=La[l];break;default:i=Qr[l],o=Ta[l],s=Ca[l],u=Aa[l];break}break;case 1:switch(r){case 0:i=ei[l],o=za[l],s=Ua[l],u=Va[l];break;default:i=Yn[l],o=Fa[l],s=Ba[l],u=Ga[l];break}break;default:switch(t){case-1:switch(r){case 0:i=$a[l],o=_a[l],s=xa[l],u=Sa[l];break;default:i=Ya[l],o=wa[l],s=ba[l],u=Ea[l];break}break;case 1:switch(r){case 0:i=En[l],o=Pa[l],s=Oa[l],u=Ra[l];break;default:i=kn[l],o=Da[l],s=Na[l],u=ka[l];break}break}break}if(a=n.edges.indexOf(i),typeof n.edges[a]<"u")t9r(n,a);else return null;switch(l=n.cval_real,i){case 0:l&Rp?(e=n.topleft,t=1):(e=1,t=n.righttop);break;case 1:l&th?(e=1,t=n.rightbottom):(e=n.topleft,t=1);break;case 2:l&th?(e=n.topleft,t=1):(e=n.bottomright,t=0);break;case 3:l&Rh?(e=n.bottomleft,t=0):(e=n.topleft,t=1);break;case 4:l&Rp?(e=n.topright,t=1):(e=1,t=n.righttop);break;case 5:l&th?(e=1,t=n.rightbottom):(e=n.topright,t=1);break;case 6:l&th?(e=n.topright,t=1):(e=n.bottomright,t=0);break;case 7:l&Rh?(e=n.bottomleft,t=0):(e=n.topright,t=1);break;case 8:l&th?(e=1,t=n.righttop):(e=n.bottomright,t=0);break;case 9:l&Rh?(e=n.bottomleft,t=0):(e=1,t=n.righttop);break;case 10:l&Rh?(e=1,t=n.righttop):(e=0,t=n.leftbottom);break;case 11:l&lc?(e=0,t=n.lefttop):(e=1,t=n.righttop);break;case 12:l&th?(e=1,t=n.rightbottom):(e=n.bottomright,t=0);break;case 13:l&Rh?(e=n.bottomleft,t=0):(e=1,t=n.rightbottom);break;case 14:l&Rh?(e=1,t=n.rightbottom):(e=0,t=n.leftbottom);break;case 15:l&lc?(e=0,t=n.lefttop):(e=1,t=n.rightbottom);break;case 16:l&th?(e=0,t=n.leftbottom):(e=n.bottomright,t=0);break;case 17:l&lc?(e=0,t=n.lefttop):(e=n.bottomright,t=0);break;case 18:l&Rh?(e=n.bottomleft,t=0):(e=0,t=n.leftbottom);break;case 19:l&lc?(e=0,t=n.lefttop):(e=n.bottomleft,t=0);break;case 20:l&lc?(e=0,t=n.leftbottom):(e=n.topleft,t=1);break;case 21:l&Rp?(e=n.topright,t=1):(e=0,t=n.leftbottom);break;case 22:l&lc?(e=0,t=n.lefttop):(e=n.topleft,t=1);break;case 23:l&Rp?(e=n.topright,t=1):(e=0,t=n.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(n),null}return(typeof e>"u"||typeof t>"u"||typeof o>"u"||typeof s>"u"||typeof u>"u")&&(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(n),console.log(e+" "+t+" "+o+" "+s+" "+u)),{p:[e,t],x:o,y:s,o:u}}function i9r(n){var e=[],t=0;return n.cells.forEach(function(r,i){r.forEach(function(a,o){if(typeof a<"u"){var s=zr[a.cval](a);typeof s=="object"&&_Z(s)?typeof s[0]=="object"&&_Z(s[0])?typeof s[0][0]=="object"&&_Z(s[0][0])?s.forEach(function(l){l.forEach(function(u){u[0]+=o,u[1]+=i}),e[t++]=l}):(s.forEach(function(l){l[0]+=o,l[1]+=i}),e[t++]=s):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),e}function a9r(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.zProperty||"elevation",i=t.commonProperties||{},a=t.breaksProperties||[];if(Y_(n,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!Io(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(a))throw new Error("breaksProperties is not an Array");var o=yGr(n,{zProperty:r,flip:!0}),s=o9r(o,e,r);s=s9r(s,o,n);var l=s.map(function(u,h){if(a[h]&&!Io(a[h]))throw new Error("Each mappedProperty is required to be an Object");var c=Ghe({},i,a[h]);c[r]=u[r];var f=Ld(u.groupedRings,c);return f});return Zn(l)}function o9r(n,e,t){for(var r=[],i=1;i<e.length;i++){var a=+e[i-1],o=+e[i],s=_Gr(n,a,o-a),l=l9r(s),u=u9r(l),h={};h.groupedRings=u,h[t]=a+"-"+o,r.push(h)}return r}function s9r(n,e,t){var r=yl(t),i=r[2]-r[0],a=r[3]-r[1],o=r[0],s=r[1],l=e[0].length-1,u=e.length-1,h=i/l,c=a/u,f=function(d){d[0]=d[0]*h+o,d[1]=d[1]*c+s};return n.forEach(function(d){d.groupedRings.forEach(function(v){v.forEach(function(p){p.forEach(f)})})}),n}function l9r(n){var e=[],t=[];n.forEach(function(i){var a=Xhe(Qi([i]));t.push(a),e.push({ring:i,area:a})}),t.sort(function(i,a){return a-i});var r=[];return t.forEach(function(i){for(var a=0;a<e.length;a++)if(e[a].area===i){r.push(e[a].ring),e.splice(a,1);break}}),r}function u9r(n){for(var e=n.map(function(l){return{lrCoordinates:l,grouped:!1}}),t=[];!c9r(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;for(var a=Qi([e[r].lrCoordinates]),o=r+1;o<e.length;o++)if(!e[o].grouped){var s=Qi([e[o].lrCoordinates]);h9r(s,a)&&(i.push(e[o].lrCoordinates),e[o].grouped=!0)}t.push(i)}return t}function h9r(n,e){for(var t=_$(n),r=0;r<t.features.length;r++)if(!ss(t.features[r],e))return!1;return!0}function c9r(n){for(var e=0;e<n.length;e++)if(n[e].grouped===!1)return!1;return!0}function HKe(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.pivot,i=t.mutate;if(!n)throw new Error("geojson is required");if(e==null||isNaN(e))throw new Error("angle is required");return e===0||(r||(r=ow(n)),(i===!1||i===void 0)&&(n=Xh(n)),gl(n,function(a){var o=A2(r,a),s=o+e,l=w$(r,a),u=ri(QM(r,l,s));a[0]=u[0],a[1]=u[1]})),n}function jKe(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.origin,i=t.mutate;if(!n)throw new Error("geojson required");if(typeof e!="number"||e===0)throw new Error("invalid factor");var a=Array.isArray(r)||typeof r=="object";return i!==!0&&(n=Xh(n)),n.type==="FeatureCollection"&&!a?(uo(n,function(o,s){n.features[s]=VIe(o,e,r)}),n):VIe(n,e,r)}function VIe(n,e,t){var r=zf(n)==="Point";return t=f9r(n,t),e===1||r||gl(n,function(i){var a=w$(t,i),o=A2(t,i),s=a*e,l=ri(QM(t,s,o));i[0]=l[0],i[1]=l[1],i.length===3&&(i[2]*=e)}),n}function f9r(n,e){if(e==null&&(e="centroid"),Array.isArray(e)||typeof e=="object")return Wo(e);var t=n.bbox?n.bbox:yl(n),r=t[0],i=t[1],a=t[2],o=t[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return Vi([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return Vi([a,i]);case"nw":case"northwest":case"westnorth":case"topleft":return Vi([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return Vi([a,o]);case"center":return m$(n);case void 0:case null:case"centroid":return ow(n);default:throw new Error("invalid origin")}}function d9r(n,e,t,r){if(r=r||{},!Io(r))throw new Error("options is invalid");var i=r.units,a=r.zTranslation,o=r.mutate;if(!n)throw new Error("geojson is required");if(e==null||isNaN(e))throw new Error("distance is required");if(a&&typeof a!="number"&&isNaN(a))throw new Error("zTranslation is not a number");if(a=a!==void 0?a:0,e===0&&a===0)return n;if(t==null||isNaN(t))throw new Error("direction is required");return e<0&&(e=-e,t=t+180),(o===!1||o===void 0)&&(n=Xh(n)),gl(n,function(s){var l=ri(QM(s,e,t,{units:i}));s[0]=l[0],s[1]=l[1],a&&s.length===3&&(s[2]+=a)}),n}function B7(n){var e=n[0],t=n[1];return[t[0]-e[0],t[1]-e[1]]}function Nre(n,e){return n[0]*e[1]-e[0]*n[1]}function v9r(n,e){return[n[0]+e[0],n[1]+e[1]]}function p9r(n,e){return[n[0]-e[0],n[1]-e[1]]}function g9r(n,e){return[n*e[0],n*e[1]]}function y9r(n,e){var t=n[0],r=B7(n),i=e[0],a=B7(e),o=Nre(r,a),s=p9r(i,t),l=Nre(s,a),u=l/o,h=v9r(t,g9r(u,r));return h}function m9r(n,e){var t=B7(n),r=B7(e);return Nre(t,r)===0}function _9r(n,e){return m9r(n,e)?!1:y9r(n,e)}function x9r(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.units;if(!n)throw new Error("geojson is required");if(e==null||isNaN(e))throw new Error("distance is required");var i=zf(n),a=n.properties;switch(i){case"LineString":return $Ie(n,e,r);case"MultiLineString":var o=[];return fh(n,function(s){o.push($Ie(s,e,r).geometry.coordinates)}),Pw(o,a);default:throw new Error("geometry "+i+" is not supported")}}function $Ie(n,e,t){var r=[],i=R7(e,t),a=ri(n),o=[];return a.forEach(function(s,l){if(l!==a.length-1){var u=S9r(s,a[l+1],i);if(r.push(u),l>0){var h=r[l-1],c=_9r(u,h);c!==!1&&(h[1]=c,u[0]=c),o.push(h[0]),l===a.length-2&&(o.push(u[0]),o.push(u[1]))}a.length===2&&(o.push(u[0]),o.push(u[1]))}}),yo(o,n.properties)}function S9r(n,e,t){var r=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),i=n[0]+t*(e[1]-n[1])/r,a=e[0]+t*(e[1]-n[1])/r,o=n[1]+t*(n[0]-e[0])/r,s=e[1]+t*(n[0]-e[0])/r;return[[i,o],[a,s]]}function w9r(n){return(n>0)-(n<0)||+n}function fce(n,e,t){var r=e[0]-n[0],i=e[1]-n[1],a=t[0]-e[0],o=t[1]-e[1];return w9r(r*o-a*i)}function b9r(n,e){var t=n.geometry.coordinates[0].map(function(o){return o[0]}),r=n.geometry.coordinates[0].map(function(o){return o[1]}),i=e.geometry.coordinates[0].map(function(o){return o[0]}),a=e.geometry.coordinates[0].map(function(o){return o[1]});return Math.max.apply(null,t)===Math.max.apply(null,i)&&Math.max.apply(null,r)===Math.max.apply(null,a)&&Math.min.apply(null,t)===Math.min.apply(null,i)&&Math.min.apply(null,r)===Math.min.apply(null,a)}function WIe(n,e){return e.geometry.coordinates[0].every(function(t){return ss(Vi(t),n)})}function E9r(n,e){return n[0]===e[0]&&n[1]===e[1]}var T9r=function(){function n(e){this.id=n.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(e){return e.join(",")},n.prototype.removeInnerEdge=function(e){this.innerEdges=this.innerEdges.filter(function(t){return t.from.id!==e.from.id})},n.prototype.removeOuterEdge=function(e){this.outerEdges=this.outerEdges.filter(function(t){return t.to.id!==e.to.id})},n.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var e=this;this.outerEdgesSorted||(this.outerEdges.sort(function(t,r){var i=t.to,a=r.to;if(i.coordinates[0]-e.coordinates[0]>=0&&a.coordinates[0]-e.coordinates[0]<0)return 1;if(i.coordinates[0]-e.coordinates[0]<0&&a.coordinates[0]-e.coordinates[0]>=0)return-1;if(i.coordinates[0]-e.coordinates[0]===0&&a.coordinates[0]-e.coordinates[0]===0)return i.coordinates[1]-e.coordinates[1]>=0||a.coordinates[1]-e.coordinates[1]>=0?i.coordinates[1]-a.coordinates[1]:a.coordinates[1]-i.coordinates[1];var o=fce(e.coordinates,i.coordinates,a.coordinates);if(o<0)return 1;if(o>0)return-1;var s=Math.pow(i.coordinates[0]-e.coordinates[0],2)+Math.pow(i.coordinates[1]-e.coordinates[1],2),l=Math.pow(a.coordinates[0]-e.coordinates[0],2)+Math.pow(a.coordinates[1]-e.coordinates[1],2);return s-l}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},n.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},n}();const HIe=T9r;var C9r=function(){function n(e,t){this.from=e,this.to=t,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return yo([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(e){return fce(e.from.coordinates,e.to.coordinates,this.to.coordinates)},n}();const A9r=C9r;var M9r=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(e){this.edges.push(e),this.polygon=this.envelope=void 0},n.prototype.get=function(e){return this.edges[e]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(e){this.edges.forEach(e)},n.prototype.map=function(e){return this.edges.map(e)},n.prototype.some=function(e){return this.edges.some(e)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var e=this,t=this.edges.reduce(function(o,s,l){return s.from.coordinates[1]>e.edges[o].from.coordinates[1]&&(o=l),o},0),r=(t===0?this.length:t)-1,i=(t+1)%this.length,a=fce(this.edges[r].from.coordinates,this.edges[t].from.coordinates,this.edges[i].from.coordinates);return a===0?this.edges[r].from.coordinates[0]>this.edges[i].from.coordinates[0]:a>0},n.prototype.toMultiPoint=function(){return $k(this.edges.map(function(e){return e.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(t){return t.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=Qi([e])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=WZe(this.toPolygon())},n.findEdgeRingContaining=function(e,t){var r=e.getEnvelope(),i,a;return t.forEach(function(o){var s=o.getEnvelope();if(a&&(i=a.getEnvelope()),!b9r(s,r)&&WIe(s,r)){for(var l=e.map(function(v){return v.from.coordinates}),u=void 0,h=function(v){o.some(function(p){return E9r(v,p.from.coordinates)})||(u=v)},c=0,f=l;c<f.length;c++){var d=f[c];h(d)}u&&o.inside(Vi(u))&&(!a||WIe(i,s))&&(a=o)}}),a},n.prototype.inside=function(e){return ss(e,this.toPolygon())},n}();const XKe=M9r;function I9r(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var L9r=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(e){I9r(e);var t=new n;return fh(e,function(r){xN(r,"LineString","Graph::fromGeoJson"),Phe(r,function(i,a){if(i){var o=t.getNode(i),s=t.getNode(a);t.addEdge(o,s)}return a})}),t},n.prototype.getNode=function(e){var t=HIe.buildId(e),r=this.nodes[t];return r||(r=this.nodes[t]=new HIe(e)),r},n.prototype.addEdge=function(e,t){var r=new A9r(e,t),i=r.getSymetric();this.edges.push(r),this.edges.push(i)},n.prototype.deleteDangles=function(){var e=this;Object.keys(this.nodes).map(function(t){return e.nodes[t]}).forEach(function(t){return e._removeIfDangle(t)})},n.prototype._removeIfDangle=function(e){var t=this;if(e.innerEdges.length<=1){var r=e.getOuterEdges().map(function(i){return i.to});this.removeNode(e),r.forEach(function(i){return t._removeIfDangle(i)})}},n.prototype.deleteCutEdges=function(){var e=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(t){t.label===t.symetric.label&&(e.removeEdge(t.symetric),e.removeEdge(t))})},n.prototype._computeNextCWEdges=function(e){var t=this;typeof e>"u"?Object.keys(this.nodes).forEach(function(r){return t._computeNextCWEdges(t.nodes[r])}):e.getOuterEdges().forEach(function(r,i){e.getOuterEdge((i===0?e.getOuterEdges().length:i)-1).symetric.next=r})},n.prototype._computeNextCCWEdges=function(e,t){for(var r=e.getOuterEdges(),i,a,o=r.length-1;o>=0;--o){var s=r[o],l=s.symetric,u=void 0,h=void 0;s.label===t&&(u=s),l.label===t&&(h=l),!(!u||!h)&&(h&&(a=h),u&&(a&&(a.next=u,a=void 0),i||(i=u)))}a&&(a.next=i)},n.prototype._findLabeledEdgeRings=function(){var e=[],t=0;return this.edges.forEach(function(r){if(!(r.label>=0)){e.push(r);var i=r;do i.label=t,i=i.next;while(!r.isEqual(i));t++}}),e},n.prototype.getEdgeRings=function(){var e=this;this._computeNextCWEdges(),this.edges.forEach(function(r){r.label=void 0}),this._findLabeledEdgeRings().forEach(function(r){e._findIntersectionNodes(r).forEach(function(i){e._computeNextCCWEdges(i,r.label)})});var t=[];return this.edges.forEach(function(r){r.ring||t.push(e._findEdgeRing(r))}),t},n.prototype._findIntersectionNodes=function(e){var t=[],r=e,i=function(){var a=0;r.from.getOuterEdges().forEach(function(o){o.label===e.label&&++a}),a>1&&t.push(r.from),r=r.next};do i();while(!e.isEqual(r));return t},n.prototype._findEdgeRing=function(e){var t=e,r=new XKe;do r.push(t),t.ring=r,t=t.next;while(!e.isEqual(t));return r},n.prototype.removeNode=function(e){var t=this;e.getOuterEdges().forEach(function(r){return t.removeEdge(r)}),e.innerEdges.forEach(function(r){return t.removeEdge(r)}),delete this.nodes[e.id]},n.prototype.removeEdge=function(e){this.edges=this.edges.filter(function(t){return!t.isEqual(e)}),e.deleteEdge()},n}();const P9r=L9r;function O9r(n){var e=P9r.fromGeoJson(n);e.deleteDangles(),e.deleteCutEdges();var t=[],r=[];return e.getEdgeRings().filter(function(i){return i.isValid()}).forEach(function(i){i.isHole()?t.push(i):r.push(i)}),t.forEach(function(i){XKe.findEdgeRingContaining(i,r)&&r.push(i)}),Zn(r.map(function(i){return i.toPolygon()}))}function YKe(n,e){var t=!0;return fh(n,function(r){fh(e,function(i){if(t===!1)return!1;t=R9r(r.geometry,i.geometry)})}),t}function R9r(n,e){switch(n.type){case"Point":switch(e.type){case"Point":return!F9r(n.coordinates,e.coordinates);case"LineString":return!jIe(e,n);case"Polygon":return!ss(n,e)}break;case"LineString":switch(e.type){case"Point":return!jIe(n,e);case"LineString":return!D9r(n,e);case"Polygon":return!XIe(e,n)}break;case"Polygon":switch(e.type){case"Point":return!ss(e,n);case"LineString":return!XIe(n,e);case"Polygon":return!N9r(e,n)}}return!1}function jIe(n,e){for(var t=0;t<n.coordinates.length-1;t++)if(k9r(n.coordinates[t],n.coordinates[t+1],e.coordinates))return!0;return!1}function D9r(n,e){var t=q_(n,e);return t.features.length>0}function XIe(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){var i=r[t];if(ss(i,n))return!0}var a=q_(e,CN(n));return a.features.length>0}function N9r(n,e){for(var t=0,r=n.coordinates[0];t<r.length;t++){var i=r[t];if(ss(i,e))return!0}for(var a=0,o=e.coordinates[0];a<o.length;a++){var s=o[a];if(ss(s,n))return!0}var l=q_(CN(n),CN(e));return l.features.length>0}function k9r(n,e,t){var r=t[0]-n[0],i=t[1]-n[1],a=e[0]-n[0],o=e[1]-n[1],s=r*o-i*a;return s!==0?!1:Math.abs(a)>=Math.abs(o)?a>0?n[0]<=t[0]&&t[0]<=e[0]:e[0]<=t[0]&&t[0]<=n[0]:o>0?n[1]<=t[1]&&t[1]<=e[1]:e[1]<=t[1]&&t[1]<=n[1]}function F9r(n,e){return n[0]===e[0]&&n[1]===e[1]}function B9r(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type,o=t.coordinates,s=r.coordinates;switch(i){case"Point":switch(a){case"Point":return dce(o,s);default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPoint":switch(a){case"Point":return G9r(t,r);case"MultiPoint":return z9r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"Point":return yd(r,t,{ignoreEndVertices:!0});case"LineString":return $9r(t,r);case"MultiPoint":return U9r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Point":return ss(r,t,{ignoreBoundary:!0});case"LineString":return W9r(t,r);case"Polygon":return H9r(t,r);case"MultiPoint":return V9r(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function G9r(n,e){var t,r=!1;for(t=0;t<n.coordinates.length;t++)if(dce(n.coordinates[t],e.coordinates)){r=!0;break}return r}function z9r(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){for(var i=r[t],a=!1,o=0,s=n.coordinates;o<s.length;o++){var l=s[o];if(dce(i,l)){a=!0;break}}if(!a)return!1}return!0}function U9r(n,e){for(var t=!1,r=0,i=e.coordinates;r<i.length;r++){var a=i[r];if(yd(a,n,{ignoreEndVertices:!0})&&(t=!0),!yd(a,n))return!1}return!!t}function V9r(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){var i=r[t];if(!ss(i,n,{ignoreBoundary:!0}))return!1}return!0}function $9r(n,e){for(var t=!1,r=0,i=e.coordinates;r<i.length;r++){var a=i[r];if(yd({type:"Point",coordinates:a},n,{ignoreEndVertices:!0})&&(t=!0),!yd({type:"Point",coordinates:a},n,{ignoreEndVertices:!1}))return!1}return t}function W9r(n,e){var t=!1,r=0,i=yl(n),a=yl(e);if(!qKe(i,a))return!1;for(r;r<e.coordinates.length-1;r++){var o=j9r(e.coordinates[r],e.coordinates[r+1]);if(ss({type:"Point",coordinates:o},n,{ignoreBoundary:!0})){t=!0;break}}return t}function H9r(n,e){if(n.type==="Feature"&&n.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;var t=yl(n),r=yl(e);if(!qKe(t,r))return!1;for(var i=ls(e).coordinates,a=0,o=i;a<o.length;a++)for(var s=o[a],l=0,u=s;l<u.length;l++){var h=u[l];if(!ss(h,n))return!1}return!0}function qKe(n,e){return!(n[0]>e[0]||n[2]<e[2]||n[1]>e[1]||n[3]<e[3])}function dce(n,e){return n[0]===e[0]&&n[1]===e[1]}function j9r(n,e){return[(n[0]+e[0])/2,(n[1]+e[1])/2]}function X9r(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type;switch(i){case"MultiPoint":switch(a){case"LineString":return YIe(t,r);case"Polygon":return ZIe(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"MultiPoint":return YIe(r,t);case"LineString":return Y9r(t,r);case"Polygon":return qIe(t,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"MultiPoint":return ZIe(r,t);case"LineString":return qIe(r,t);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function YIe(n,e){for(var t=!1,r=!1,i=n.coordinates.length,a=0;a<i&&!t&&!r;){for(var o=0;o<e.coordinates.length-1;o++){var s=!0;(o===0||o===e.coordinates.length-2)&&(s=!1),ZKe(e.coordinates[o],e.coordinates[o+1],n.coordinates[a],s)?t=!0:r=!0}a++}return t&&r}function Y9r(n,e){var t=q_(n,e);if(t.features.length>0)for(var r=0;r<n.coordinates.length-1;r++)for(var i=0;i<e.coordinates.length-1;i++){var a=!0;if((i===0||i===e.coordinates.length-2)&&(a=!1),ZKe(n.coordinates[r],n.coordinates[r+1],e.coordinates[i],a))return!0}return!1}function qIe(n,e){var t=hKe(e),r=q_(n,t);return r.features.length>0}function ZIe(n,e){for(var t=!1,r=!1,i=n.coordinates.length,a=0;a<i&&(!t||!r);a++)ss(Vi(n.coordinates[a]),e)?t=!0:r=!0;return r&&t}function ZKe(n,e,t,r){var i=t[0]-n[0],a=t[1]-n[1],o=e[0]-n[0],s=e[1]-n[1],l=i*s-a*o;return l!==0?!1:r?Math.abs(o)>=Math.abs(s)?o>0?n[0]<=t[0]&&t[0]<=e[0]:e[0]<=t[0]&&t[0]<=n[0]:s>0?n[1]<=t[1]&&t[1]<=e[1]:e[1]<=t[1]&&t[1]<=n[1]:Math.abs(o)>=Math.abs(s)?o>0?n[0]<t[0]&&t[0]<e[0]:e[0]<t[0]&&t[0]<n[0]:s>0?n[1]<t[1]&&t[1]<e[1]:e[1]<t[1]&&t[1]<n[1]}var q9r=PA,Gm=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:Z9r};Gm.prototype.compare=function(n,e){if(n.type!==e.type||!KKe(n,e))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,e.coordinates);case"LineString":return this.compareLine(n.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,e);case"Feature":return this.compareFeature(n,e);default:if(n.type.indexOf("Multi")===0){var t=this,r=KIe(n),i=KIe(e);return r.every(function(a){return this.some(function(o){return t.compare(a,o)})},i)}}return!1};function KIe(n){return n.coordinates.map(function(e){return{type:n.type.replace("Multi",""),coordinates:e}})}function KKe(n,e){return n.hasOwnProperty("coordinates")?n.coordinates.length===e.coordinates.length:n.length===e.length}Gm.prototype.compareCoord=function(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(n[t].toFixed(this.precision)!==e[t].toFixed(this.precision))return!1;return!0};Gm.prototype.compareLine=function(n,e,t,r){if(!KKe(n,e))return!1;var i=this.pseudoNode?n:this.removePseudo(n),a=this.pseudoNode?e:this.removePseudo(e);if(!(r&&!this.compareCoord(i[0],a[0])&&(a=this.fixStartIndex(a,i),!a))){var o=this.compareCoord(i[t],a[t]);return this.direction||o?this.comparePath(i,a):this.compareCoord(i[t],a[a.length-(1+t)])?this.comparePath(i.slice().reverse(),a):!1}};Gm.prototype.fixStartIndex=function(n,e){for(var t,r=-1,i=0;i<n.length;i++)if(this.compareCoord(n[i],e[0])){r=i;break}return r>=0&&(t=[].concat(n.slice(r,n.length),n.slice(1,r+1))),t};Gm.prototype.comparePath=function(n,e){var t=this;return n.every(function(r,i){return t.compareCoord(r,this[i])},e)};Gm.prototype.comparePolygon=function(n,e){if(this.compareLine(n.coordinates[0],e.coordinates[0],1,!0)){var t=n.coordinates.slice(1,n.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return t.every(function(a){return this.some(function(o){return i.compareLine(a,o,1,!0)})},r)}else return!1};Gm.prototype.compareFeature=function(n,e){return n.id!==e.id||!this.objectComparator(n.properties,e.properties)||!this.compareBBox(n,e)?!1:this.compare(n.geometry,e.geometry)};Gm.prototype.compareBBox=function(n,e){return!!(!n.bbox&&!e.bbox||n.bbox&&e.bbox&&this.compareCoord(n.bbox,e.bbox))};Gm.prototype.removePseudo=function(n){return n};function Z9r(n,e){return q9r(n,e,{strict:!0})}var K9r=Gm;const JKe=K9r;function J9r(n,e){var t=ls(n),r=ls(e),i=t.type,a=r.type;if(i==="MultiPoint"&&a!=="MultiPoint"||(i==="LineString"||i==="MultiLineString")&&a!=="LineString"&&a!=="MultiLineString"||(i==="Polygon"||i==="MultiPolygon")&&a!=="Polygon"&&a!=="MultiPolygon")throw new Error("features must be of the same type");if(i==="Point")throw new Error("Point geometry not supported");var o=new JKe({precision:6});if(o.compare(n,e))return!1;var s=0;switch(i){case"MultiPoint":for(var l=0;l<t.coordinates.length;l++)for(var u=0;u<r.coordinates.length;u++){var h=t.coordinates[l],c=r.coordinates[u];if(h[0]===c[0]&&h[1]===c[1])return!0}return!1;case"LineString":case"MultiLineString":B1(n,function(f){B1(e,function(d){WKe(f,d).features.length&&s++})});break;case"Polygon":case"MultiPolygon":B1(n,function(f){B1(e,function(d){q_(f,d).features.length&&s++})});break}return s>0}function Q9r(n,e){var t=ls(n).type,r=ls(e).type;if(t!==r)return!1;var i=new JKe({precision:6});return i.compare(E2(n),E2(e))}function QKe(n,e){var t=!1;return fh(n,function(r){fh(e,function(i){if(t===!0)return!0;t=!YKe(r.geometry,i.geometry)})}),t}var eJe={exports:{}},xZ={exports:{}},JIe;function e7r(){return JIe||(JIe=1,function(n){function e(t,r,i,a){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,r,i,a)}e.prototype.run=function(t,r,i,a){this._init(t,r,i,a);for(var o=0;o<this._datasetLength;o++)if(this._visited[o]!==1){this._visited[o]=1;var s=this._regionQuery(o);if(s.length<this.minPts)this.noise.push(o);else{var l=this.clusters.length;this.clusters.push([]),this._addToCluster(o,l),this._expandCluster(l,s)}}return this.clusters},e.prototype._init=function(t,r,i,a){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}r&&(this.epsilon=r),i&&(this.minPts=i),a&&(this.distance=a)},e.prototype._expandCluster=function(t,r){for(var i=0;i<r.length;i++){var a=r[i];if(this._visited[a]!==1){this._visited[a]=1;var o=this._regionQuery(a);o.length>=this.minPts&&(r=this._mergeArrays(r,o))}this._assigned[a]!==1&&this._addToCluster(a,t)}},e.prototype._addToCluster=function(t,r){this.clusters[r].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var r=[],i=0;i<this._datasetLength;i++){var a=this.distance(this.dataset[t],this.dataset[i]);a<this.epsilon&&r.push(i)}return r},e.prototype._mergeArrays=function(t,r){for(var i=r.length,a=0;a<i;a++){var o=r[a];t.indexOf(o)<0&&t.push(o)}return t},e.prototype._euclideanDistance=function(t,r){for(var i=0,a=Math.min(t.length,r.length);a--;)i+=(t[a]-r[a])*(t[a]-r[a]);return Math.sqrt(i)},n.exports&&(n.exports=e)}(xZ)),xZ.exports}var SZ={exports:{}},QIe;function t7r(){return QIe||(QIe=1,function(n){function e(t,r,i){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,r,i)}e.prototype.init=function(t,r,i){this.assignments=[],this.centroids=[],typeof t<"u"&&(this.dataset=t),typeof r<"u"&&(this.k=r),typeof i<"u"&&(this.distance=i)},e.prototype.run=function(t,r){this.init(t,r);for(var i=this.dataset.length,a=0;a<this.k;a++)this.centroids[a]=this.randomCentroid();for(var o=!0;o;){o=this.assign();for(var s=0;s<this.k;s++){for(var l=new Array(f),u=0,h=0;h<f;h++)l[h]=0;for(var c=0;c<i;c++){var f=this.dataset[c].length;if(s===this.assignments[c]){for(var h=0;h<f;h++)l[h]+=this.dataset[c][h];u++}}if(u>0){for(var h=0;h<f;h++)l[h]/=u;this.centroids[s]=l}else this.centroids[s]=this.randomCentroid(),o=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t=this.dataset.length-1,r,i;do i=Math.round(Math.random()*t),r=this.dataset[i];while(this.centroids.indexOf(r)>=0);return r},e.prototype.assign=function(){for(var t=!1,r=this.dataset.length,i,a=0;a<r;a++)i=this.argmin(this.dataset[a],this.centroids,this.distance),i!=this.assignments[a]&&(this.assignments[a]=i,t=!0);return t},e.prototype.getClusters=function(){for(var t=new Array(this.k),r,i=0;i<this.assignments.length;i++)r=this.assignments[i],typeof t[r]>"u"&&(t[r]=[]),t[r].push(i);return t},e.prototype.argmin=function(t,r,i){for(var a=Number.MAX_VALUE,o=0,s=r.length,l,u=0;u<s;u++)l=i(t,r[u]),l<a&&(a=l,o=u);return o},e.prototype.distance=function(t,r){for(var i=0,a=Math.min(t.length,r.length);a--;){var o=t[a]-r[a];i+=o*o}return Math.sqrt(i)},n.exports&&(n.exports=e)}(SZ)),SZ.exports}var wZ={exports:{}},bZ={exports:{}},eLe;function tJe(){return eLe||(eLe=1,function(n){function e(t,r,i){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,r,i)}e.prototype.insert=function(t,r){for(var i=this._queue.length,a=i;a--;){var o=this._priorities[a];this._sorting==="desc"?r>o&&(i=a):r<o&&(i=a)}this._insertAt(t,r,i)},e.prototype.remove=function(t){for(var r=this._queue.length;r--;){var i=this._queue[r];if(t===i){this._queue.splice(r,1),this._priorities.splice(r,1);break}}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],r=0,i=this._queue.length;r<i;r++)t.push([this._queue[r],this._priorities[r]]);return t},e.prototype._init=function(t,r,i){if(t&&r){if(this._queue=[],this._priorities=[],t.length!==r.length)throw new Error("Arrays must have the same length");for(var a=0;a<t.length;a++)this.insert(t[a],r[a])}i&&(this._sorting=i)},e.prototype._insertAt=function(t,r,i){this._queue.length===i?(this._queue.push(t),this._priorities.push(r)):(this._queue.splice(i,0,t),this._priorities.splice(i,0,r))},n.exports&&(n.exports=e)}(bZ)),bZ.exports}var tLe;function r7r(){return tLe||(tLe=1,function(n){if(n.exports)var e=tJe();function t(r,i,a,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,i,a,o)}t.prototype.run=function(r,i,a,o){this._init(r,i,a,o);for(var s=0,l=this.dataset.length;s<l;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var u=this.clusters.length-1;this._orderedList.push(s);var h=new e(null,null,"asc"),c=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,c,h),this._expandCluster(u,h))}return this.clusters},t.prototype.getReachabilityPlot=function(){for(var r=[],i=0,a=this._orderedList.length;i<a;i++){var o=this._orderedList[i],s=this._reachability[o];r.push([o,s])}return r},t.prototype._init=function(r,i,a,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}i&&(this.epsilon=i),a&&(this.minPts=a),o&&(this.distance=o)},t.prototype._updateQueue=function(r,i,a){var o=this;this._coreDistance=this._distanceToCore(r),i.forEach(function(s){if(o._processed[s]===void 0){var l=o.distance(o.dataset[r],o.dataset[s]),u=Math.max(o._coreDistance,l);o._reachability[s]===void 0?(o._reachability[s]=u,a.insert(s,u)):u<o._reachability[s]&&(o._reachability[s]=u,a.remove(s),a.insert(s,u))}})},t.prototype._expandCluster=function(r,i){for(var a=i.getElements(),o=0,s=a.length;o<s;o++){var l=a[o];if(this._processed[l]===void 0){var u=this._regionQuery(l);this._processed[l]=1,this.clusters[r].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,u,i),this._expandCluster(r,i))}}},t.prototype._distanceToCore=function(r){for(var i=this.epsilon,a=0;a<i;a++){var o=this._regionQuery(r,a);if(o.length>=this.minPts)return a}},t.prototype._regionQuery=function(r,i){i=i||this.epsilon;for(var a=[],o=0,s=this.dataset.length;o<s;o++)this.distance(this.dataset[r],this.dataset[o])<i&&a.push(o);return a},t.prototype._euclideanDistance=function(r,i){for(var a=0,o=Math.min(r.length,i.length);o--;)a+=(r[o]-i[o])*(r[o]-i[o]);return Math.sqrt(a)},n.exports&&(n.exports=t)}(wZ)),wZ.exports}(function(n){n.exports&&(n.exports={DBSCAN:e7r(),KMEANS:t7r(),OPTICS:r7r(),PriorityQueue:tJe()})})(eJe);const n7r=eJe.exports;function i7r(n,e,t){t===void 0&&(t={}),t.mutate!==!0&&(n=Xh(n)),t.minPoints=t.minPoints||3;var r=new n7r.DBSCAN,i=r.run(KM(n),b2(e,t.units),t.minPoints,Mo),a=-1;return i.forEach(function(o){a++,o.forEach(function(s){var l=n.features[s];l.properties||(l.properties={}),l.properties.cluster=a,l.properties.dbscan="core"})}),r.noise.forEach(function(o){var s=n.features[o];s.properties||(s.properties={}),s.properties.cluster?s.properties.dbscan="edge":s.properties.dbscan="noise"}),n}var rJe={eudist:function(e,t,r){for(var i=e.length,a=0,o=0;o<i;o++){var s=(e[o]||0)-(t[o]||0);a+=s*s}return r?Math.sqrt(a):a},mandist:function(e,t,r){for(var i=e.length,a=0,o=0;o<i;o++)a+=Math.abs((e[o]||0)-(t[o]||0));return r?Math.sqrt(a):a},dist:function(e,t,r){var i=Math.abs(e-t);return r?i:i*i}},nJe=rJe,a7r=nJe.eudist,o7r=nJe.dist,s7r={kmrand:function(e,t){for(var r={},i=[],a=t<<2,o=e.length,s=e[0].length>0;i.length<t&&a-- >0;){var l=e[Math.floor(Math.random()*o)],u=s?l.join("_"):""+l;r[u]||(r[u]=!0,i.push(l))}if(i.length<t)throw new Error("Error initializating clusters");return i},kmpp:function(e,t){var r=e[0].length?a7r:o7r,i=[],a=e.length,o=e[0].length>0,s=e[Math.floor(Math.random()*a)];for(o?s.join("_"):""+s,i.push(s);i.length<t;){for(var l=[],u=i.length,h=0,c=[],f=0;f<a;f++){for(var d=1/0,v=0;v<u;v++){var p=r(e[f],i[v]);p<=d&&(d=p)}l[f]=d}for(var g=0;g<a;g++)h+=l[g];for(var m=0;m<a;m++)c[m]={i:m,v:e[m],pr:l[m]/h,cs:0};c.sort(function(S,w){return S.pr-w.pr}),c[0].cs=c[0].pr;for(var y=1;y<a;y++)c[y].cs=c[y-1].cs+c[y].pr;for(var _=Math.random(),x=0;x<a-1&&c[x++].cs<_;);i.push(c[x-1].v)}return i}},l7r=rJe,iJe=s7r,u7r=l7r.eudist,h7r=iJe.kmrand,c7r=iJe.kmpp,rLe=1e4;function nLe(n,e,t){t=t||[];for(var r=0;r<n;r++)t[r]=e;return t}function f7r(n,e,t,r){var i=[],a=[],o=[],s=[],l=!1,u=r||rLe,h=n.length,c=n[0].length,f=c>0,d=[];if(t)t=="kmrand"?i=h7r(n,e):t=="kmpp"?i=c7r(n,e):i=t;else for(var v={};i.length<e;){var p=Math.floor(Math.random()*h);v[p]||(v[p]=!0,i.push(n[p]))}do{nLe(e,0,d);for(var g=0;g<h;g++){for(var m=1/0,y=0,_=0;_<e;_++){var s=f?u7r(n[g],i[_]):Math.abs(n[g]-i[_]);s<=m&&(m=s,y=_)}o[g]=y,d[y]++}for(var x=[],a=[],S=0;S<e;S++)x[S]=f?nLe(c,0,x[S]):0,a[S]=i[S];if(f){for(var w=0;w<e;w++)i[w]=[];for(var b=0;b<h;b++)for(var E=o[b],T=x[E],C=n[b],A=0;A<c;A++)T[A]+=C[A];l=!0;for(var M=0;M<e;M++){for(var I=i[M],R=x[M],k=a[M],D=d[M],G=0;G<c;G++)I[G]=R[G]/D||0;if(l){for(var W=0;W<c;W++)if(k[W]!=I[W]){l=!1;break}}}}else{for(var z=0;z<h;z++){var V=o[z];x[V]+=n[z]}for(var q=0;q<e;q++)i[q]=x[q]/d[q]||0;l=!0;for(var Y=0;Y<e;Y++)if(a[Y]!=i[Y]){l=!1;break}}l=l||--u<=0}while(!l);return{it:rLe-u,k:e,idxs:o,centroids:i}}var d7r=f7r;function v7r(n,e){e===void 0&&(e={});var t=n.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(t/2)),e.numberOfClusters>t&&(e.numberOfClusters=t),e.mutate!==!0&&(n=Xh(n));var r=KM(n),i=r.slice(0,e.numberOfClusters),a=d7r(r,e.numberOfClusters,i),o={};return a.centroids.forEach(function(s,l){o[l]=s}),uo(n,function(s,l){var u=a.idxs[l];s.properties.cluster=u,s.properties.centroid=o[u]}),n}function p7r(n,e){if(!n)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");var t=iLe(n,"line1");if(t!=="LineString")throw new Error("line1 must be a LineString");var r=iLe(e,"line2");if(r!=="LineString")throw new Error("line2 must be a LineString");for(var i=C2(E2(n)).features,a=C2(E2(e)).features,o=0;o<i.length;o++){var s=i[o].geometry.coordinates;if(!a[o])break;var l=a[o].geometry.coordinates;if(!g7r(s,l))return!1}return!0}function g7r(n,e){var t=w2(A2(n[0],n[1])),r=w2(A2(e[0],e[1]));return t===r}function iLe(n,e){if(n.geometry&&n.geometry.type)return n.geometry.type;if(n.type)return n.type;throw new Error("Invalid GeoJSON object for "+e)}function aLe(n){for(var e=n,t=[];e.parent;)t.unshift(e),e=e.parent;return t}function y7r(){return new aJe(function(n){return n.f})}var T$={search:function(n,e,t,r){n.cleanDirty(),r=r||{};var i=r.heuristic||T$.heuristics.manhattan,a=r.closest||!1,o=y7r(),s=e;for(e.h=i(e,t),o.push(e);o.size()>0;){var l=o.pop();if(l===t)return aLe(l);l.closed=!0;for(var u=n.neighbors(l),h=0,c=u.length;h<c;++h){var f=u[h];if(!(f.closed||f.isWall())){var d=l.g+f.getCost(l),v=f.visited;(!v||d<f.g)&&(f.visited=!0,f.parent=l,f.h=f.h||i(f,t),f.g=d,f.f=f.g+f.h,n.markDirty(f),a&&(f.h<s.h||f.h===s.h&&f.g<s.g)&&(s=f),v?o.rescoreElement(f):o.push(f))}}}return a?aLe(s):[]},heuristics:{manhattan:function(n,e){var t=Math.abs(e.x-n.x),r=Math.abs(e.y-n.y);return t+r},diagonal:function(n,e){var t=1,r=Math.sqrt(2),i=Math.abs(e.x-n.x),a=Math.abs(e.y-n.y);return t*(i+a)+(r-2*t)*Math.min(i,a)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function pL(n,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var t=0;t<n.length;t++){this.grid[t]=[];for(var r=0,i=n[t];r<i.length;r++){var a=new C$(t,r,i[r]);this.grid[t][r]=a,this.nodes.push(a)}}this.init()}pL.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)T$.cleanNode(this.nodes[n])};pL.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)T$.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};pL.prototype.markDirty=function(n){this.dirtyNodes.push(n)};pL.prototype.neighbors=function(n){var e=[],t=n.x,r=n.y,i=this.grid;return i[t-1]&&i[t-1][r]&&e.push(i[t-1][r]),i[t+1]&&i[t+1][r]&&e.push(i[t+1][r]),i[t]&&i[t][r-1]&&e.push(i[t][r-1]),i[t]&&i[t][r+1]&&e.push(i[t][r+1]),this.diagonal&&(i[t-1]&&i[t-1][r-1]&&e.push(i[t-1][r-1]),i[t+1]&&i[t+1][r-1]&&e.push(i[t+1][r-1]),i[t-1]&&i[t-1][r+1]&&e.push(i[t-1][r+1]),i[t+1]&&i[t+1][r+1]&&e.push(i[t+1][r+1])),e};pL.prototype.toString=function(){for(var n=[],e=this.grid,t,r,i,a,o=0,s=e.length;o<s;o++){for(t=[],r=e[o],i=0,a=r.length;i<a;i++)t.push(r[i].weight);n.push(t.join(" "))}return n.join(`
`)};function C$(n,e,t){this.x=n,this.y=e,this.weight=t}C$.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};C$.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};C$.prototype.isWall=function(){return this.weight===0};function aJe(n){this.content=[],this.scoreFunction=n}aJe.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),n},remove:function(n){var e=this.content.indexOf(n),t=this.content.pop();e!==this.content.length-1&&(this.content[e]=t,this.scoreFunction(t)<this.scoreFunction(n)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var e=this.content[n];n>0;){var t=(n+1>>1)-1,r=this.content[t];if(this.scoreFunction(e)<this.scoreFunction(r))this.content[t]=e,this.content[n]=r,n=t;else break}},bubbleUp:function(n){for(var e=this.content.length,t=this.content[n],r=this.scoreFunction(t);;){var i=n+1<<1,a=i-1,o=null,s;if(a<e){var l=this.content[a];s=this.scoreFunction(l),s<r&&(o=a)}if(i<e){var u=this.content[i],h=this.scoreFunction(u);h<(o===null?r:s)&&(o=i)}if(o!==null)this.content[n]=this.content[o],this.content[o]=t,n=o;else break}}};function m7r(n,e,t){if(t=t||{},!Io(t))throw new Error("options is invalid");var r=t.resolution,i=t.minDistance,a=t.obstacles||Zn([]);if(!n)throw new Error("start is required");if(!e)throw new Error("end is required");if(r&&!Gu(r)||r<=0)throw new Error("options.resolution must be a number, greater than 0");if(i)throw new Error("options.minDistance is not yet implemented");var o=Wo(n),s=Wo(e);switch(n=Vi(o),e=Vi(s),zf(a)){case"FeatureCollection":if(a.features.length===0)return yo([o,s]);break;case"Polygon":a=Zn([fu(ls(a))]);break;default:throw new Error("invalid obstacles")}var l=a;l.features.push(n),l.features.push(e);var u=yl(jKe(Whe(yl(l)),1.15));if(!r){var h=Mo([u[0],u[1]],[u[2],u[1]],t);r=h/100}l.features.pop(),l.features.pop();for(var c=u[0],f=u[1],d=u[2],v=u[3],p=r/Mo([c,f],[d,f],t),g=p*(d-c),m=r/Mo([c,f],[c,v],t),y=m*(v-f),_=d-c,x=v-f,S=Math.floor(_/g),w=Math.floor(x/y),b=(_-S*g)/2,E=(x-w*y)/2,T=[],C=[],A=[],M=[],I=1/0,R=1/0,k=v-E,D=0;k>=f;){for(var G=[],W=[],z=c+b,V=0;z<=d;){var q=Vi([z,k]),Y=_7r(q,a);G.push(Y?0:1),W.push(z+"|"+k);var le=Mo(q,n);!Y&&le<I&&(I=le,A={x:V,y:D});var j=Mo(q,e);!Y&&j<R&&(R=j,M={x:V,y:D}),z+=g,V++}C.push(G),T.push(W),k-=y,D++}var Q=new pL(C,{diagonal:!0}),ie=Q.grid[A.y][A.x],oe=Q.grid[M.y][M.x],se=T$.search(Q,ie,oe),me=[o];return se.forEach(function(Ce){var Le=T[Ce.x][Ce.y].split("|");me.push([+Le[0],+Le[1]])}),me.push(s),E2(yo(me))}function _7r(n,e){for(var t=0;t<e.features.length;t++)if(ss(n,e.features[t]))return!0;return!1}function oLe(n){return function(){return n}}function x7r(n){return n[0]}function S7r(n){return n[1]}function G7(){this._=null}function A$(n){n.U=n.C=n.L=n.R=n.P=n.N=null}G7.prototype={constructor:G7,insert:function(n,e){var t,r,i;if(n){if(e.P=n,e.N=n.N,n.N&&(n.N.P=e),n.N=e,n.R){for(n=n.R;n.L;)n=n.L;n.L=e}else n.R=e;t=n}else this._?(n=sLe(this._),e.P=null,e.N=n,n.P=n.L=e,t=n):(e.P=e.N=null,this._=e,t=null);for(e.L=e.R=null,e.U=t,e.C=!0,n=e;t&&t.C;)r=t.U,t===r.L?(i=r.R,i&&i.C?(t.C=i.C=!1,r.C=!0,n=r):(n===t.R&&($P(this,t),n=t,t=n.U),t.C=!1,r.C=!0,WP(this,r))):(i=r.L,i&&i.C?(t.C=i.C=!1,r.C=!0,n=r):(n===t.L&&(WP(this,t),n=t,t=n.U),t.C=!1,r.C=!0,$P(this,r))),t=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var e=n.U,t,r=n.L,i=n.R,a,o;if(r?i?a=sLe(i):a=r:a=i,e?e.L===n?e.L=a:e.R=a:this._=a,r&&i?(o=a.C,a.C=n.C,a.L=r,r.U=a,a!==i?(e=a.U,a.U=n.U,n=a.R,e.L=n,a.R=i,i.U=a):(a.U=e,e=a,n=a.R)):(o=n.C,n=a),n&&(n.U=e),!o){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===e.L){if(t=e.R,t.C&&(t.C=!1,e.C=!0,$P(this,e),t=e.R),t.L&&t.L.C||t.R&&t.R.C){(!t.R||!t.R.C)&&(t.L.C=!1,t.C=!0,WP(this,t),t=e.R),t.C=e.C,e.C=t.R.C=!1,$P(this,e),n=this._;break}}else if(t=e.L,t.C&&(t.C=!1,e.C=!0,WP(this,e),t=e.L),t.L&&t.L.C||t.R&&t.R.C){(!t.L||!t.L.C)&&(t.R.C=!1,t.C=!0,$P(this,t),t=e.L),t.C=e.C,e.C=t.L.C=!1,WP(this,e),n=this._;break}t.C=!0,n=e,e=e.U}while(!n.C);n&&(n.C=!1)}}};function $P(n,e){var t=e,r=e.R,i=t.U;i?i.L===t?i.L=r:i.R=r:n._=r,r.U=i,t.U=r,t.R=r.L,t.R&&(t.R.U=t),r.L=t}function WP(n,e){var t=e,r=e.L,i=t.U;i?i.L===t?i.L=r:i.R=r:n._=r,r.U=i,t.U=r,t.L=r.R,t.L&&(t.L.U=t),r.R=t}function sLe(n){for(;n.L;)n=n.L;return n}function kO(n,e,t,r){var i=[null,null],a=Nc.push(i)-1;return i.left=n,i.right=e,t&&z7(i,n,e,t),r&&z7(i,e,n,r),hv[n.index].halfedges.push(a),hv[e.index].halfedges.push(a),i}function HP(n,e,t){var r=[e,t];return r.left=n,r}function z7(n,e,t,r){!n[0]&&!n[1]?(n[0]=r,n.left=e,n.right=t):n.left===t?n[1]=r:n[0]=r}function w7r(n,e,t,r,i){var a=n[0],o=n[1],s=a[0],l=a[1],u=o[0],h=o[1],c=0,f=1,d=u-s,v=h-l,p;if(p=e-s,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=t-l,!(!v&&p>0)){if(p/=v,v<0){if(p<c)return;p<f&&(f=p)}else if(v>0){if(p>f)return;p>c&&(c=p)}if(p=i-l,!(!v&&p<0)){if(p/=v,v<0){if(p>f)return;p>c&&(c=p)}else if(v>0){if(p<c)return;p<f&&(f=p)}return!(c>0)&&!(f<1)||(c>0&&(n[0]=[s+c*d,l+c*v]),f<1&&(n[1]=[s+f*d,l+f*v])),!0}}}}}function b7r(n,e,t,r,i){var a=n[1];if(a)return!0;var o=n[0],s=n.left,l=n.right,u=s[0],h=s[1],c=l[0],f=l[1],d=(u+c)/2,v=(h+f)/2,p,g;if(f===h){if(d<e||d>=r)return;if(u>c){if(!o)o=[d,t];else if(o[1]>=i)return;a=[d,i]}else{if(!o)o=[d,i];else if(o[1]<t)return;a=[d,t]}}else if(p=(u-c)/(f-h),g=v-p*d,p<-1||p>1)if(u>c){if(!o)o=[(t-g)/p,t];else if(o[1]>=i)return;a=[(i-g)/p,i]}else{if(!o)o=[(i-g)/p,i];else if(o[1]<t)return;a=[(t-g)/p,t]}else if(h<f){if(!o)o=[e,p*e+g];else if(o[0]>=r)return;a=[r,p*r+g]}else{if(!o)o=[r,p*r+g];else if(o[0]<e)return;a=[e,p*e+g]}return n[0]=o,n[1]=a,!0}function E7r(n,e,t,r){for(var i=Nc.length,a;i--;)(!b7r(a=Nc[i],n,e,t,r)||!w7r(a,n,e,t,r)||!(Math.abs(a[0][0]-a[1][0])>vs||Math.abs(a[0][1]-a[1][1])>vs))&&delete Nc[i]}function T7r(n){return hv[n.index]={site:n,halfedges:[]}}function C7r(n,e){var t=n.site,r=e.left,i=e.right;return t===i&&(i=r,r=t),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(t===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function oJe(n,e){return e[+(e.left!==n.site)]}function A7r(n,e){return e[+(e.left===n.site)]}function M7r(){for(var n=0,e=hv.length,t,r,i,a;n<e;++n)if((t=hv[n])&&(a=(r=t.halfedges).length)){var o=new Array(a),s=new Array(a);for(i=0;i<a;++i)o[i]=i,s[i]=C7r(t,Nc[r[i]]);for(o.sort(function(l,u){return s[u]-s[l]}),i=0;i<a;++i)s[i]=r[o[i]];for(i=0;i<a;++i)r[i]=s[i]}}function I7r(n,e,t,r){var i=hv.length,a,o,s,l,u,h,c,f,d,v,p,g,m=!0;for(a=0;a<i;++a)if(o=hv[a]){for(s=o.site,u=o.halfedges,l=u.length;l--;)Nc[u[l]]||u.splice(l,1);for(l=0,h=u.length;l<h;)v=A7r(o,Nc[u[l]]),p=v[0],g=v[1],c=oJe(o,Nc[u[++l%h]]),f=c[0],d=c[1],(Math.abs(p-f)>vs||Math.abs(g-d)>vs)&&(u.splice(l,0,Nc.push(HP(s,v,Math.abs(p-n)<vs&&r-g>vs?[n,Math.abs(f-n)<vs?d:r]:Math.abs(g-r)<vs&&t-p>vs?[Math.abs(d-r)<vs?f:t,r]:Math.abs(p-t)<vs&&g-e>vs?[t,Math.abs(f-t)<vs?d:e]:Math.abs(g-e)<vs&&p-n>vs?[Math.abs(d-e)<vs?f:n,e]:null))-1),++h);h&&(m=!1)}if(m){var y,_,x,S=1/0;for(a=0,m=null;a<i;++a)(o=hv[a])&&(s=o.site,y=s[0]-n,_=s[1]-e,x=y*y+_*_,x<S&&(S=x,m=o));if(m){var w=[n,e],b=[n,r],E=[t,r],T=[t,e];m.halfedges.push(Nc.push(HP(s=m.site,w,b))-1,Nc.push(HP(s,b,E))-1,Nc.push(HP(s,E,T))-1,Nc.push(HP(s,T,w))-1)}}for(a=0;a<i;++a)(o=hv[a])&&(o.halfedges.length||delete hv[a])}var sJe=[],vce;function L7r(){A$(this),this.x=this.y=this.arc=this.site=this.cy=null}function OA(n){var e=n.P,t=n.N;if(!(!e||!t)){var r=e.site,i=n.site,a=t.site;if(r!==a){var o=i[0],s=i[1],l=r[0]-o,u=r[1]-s,h=a[0]-o,c=a[1]-s,f=2*(l*c-u*h);if(!(f>=-N7r)){var d=l*l+u*u,v=h*h+c*c,p=(c*d-u*v)/f,g=(l*v-h*d)/f,m=sJe.pop()||new L7r;m.arc=n,m.site=i,m.x=p+o,m.y=(m.cy=g+s)+Math.sqrt(p*p+g*g),n.circle=m;for(var y=null,_=LN._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x)if(_.L)_=_.L;else{y=_.P;break}else if(_.R)_=_.R;else{y=_;break}LN.insert(y,m),y||(vce=m)}}}}function oM(n){var e=n.circle;e&&(e.P||(vce=e.N),LN.remove(e),sJe.push(e),A$(e),n.circle=null)}var lJe=[];function P7r(){A$(this),this.edge=this.site=this.circle=null}function lLe(n){var e=lJe.pop()||new P7r;return e.site=n,e}function EZ(n){oM(n),sM.remove(n),lJe.push(n),A$(n)}function O7r(n){var e=n.circle,t=e.x,r=e.cy,i=[t,r],a=n.P,o=n.N,s=[n];EZ(n);for(var l=a;l.circle&&Math.abs(t-l.circle.x)<vs&&Math.abs(r-l.circle.cy)<vs;)a=l.P,s.unshift(l),EZ(l),l=a;s.unshift(l),oM(l);for(var u=o;u.circle&&Math.abs(t-u.circle.x)<vs&&Math.abs(r-u.circle.cy)<vs;)o=u.N,s.push(u),EZ(u),u=o;s.push(u),oM(u);var h=s.length,c;for(c=1;c<h;++c)u=s[c],l=s[c-1],z7(u.edge,l.site,u.site,i);l=s[0],u=s[h-1],u.edge=kO(l.site,u.site,null,i),OA(l),OA(u)}function R7r(n){for(var e=n[0],t=n[1],r,i,a,o,s=sM._;s;)if(a=uJe(s,t)-e,a>vs)s=s.L;else if(o=e-D7r(s,t),o>vs){if(!s.R){r=s;break}s=s.R}else{a>-vs?(r=s.P,i=s):o>-vs?(r=s,i=s.N):r=i=s;break}T7r(n);var l=lLe(n);if(sM.insert(r,l),!(!r&&!i)){if(r===i){oM(r),i=lLe(r.site),sM.insert(l,i),l.edge=i.edge=kO(r.site,l.site),OA(r),OA(i);return}if(!i){l.edge=kO(r.site,l.site);return}oM(r),oM(i);var u=r.site,h=u[0],c=u[1],f=n[0]-h,d=n[1]-c,v=i.site,p=v[0]-h,g=v[1]-c,m=2*(f*g-d*p),y=f*f+d*d,_=p*p+g*g,x=[(g*y-d*_)/m+h,(f*_-p*y)/m+c];z7(i.edge,u,v,x),l.edge=kO(u,n,null,x),i.edge=kO(n,v,null,x),OA(r),OA(i)}}function uJe(n,e){var t=n.site,r=t[0],i=t[1],a=i-e;if(!a)return r;var o=n.P;if(!o)return-1/0;t=o.site;var s=t[0],l=t[1],u=l-e;if(!u)return s;var h=s-r,c=1/a-1/u,f=h/u;return c?(-f+Math.sqrt(f*f-2*c*(h*h/(-2*u)-l+u/2+i-a/2)))/c+r:(r+s)/2}function D7r(n,e){var t=n.N;if(t)return uJe(t,e);var r=n.site;return r[1]===e?r[0]:1/0}var vs=1e-6,N7r=1e-12,sM,hv,LN,Nc;function k7r(n,e,t){return(n[0]-t[0])*(e[1]-n[1])-(n[0]-e[0])*(t[1]-n[1])}function F7r(n,e){return e[1]-n[1]||e[0]-n[0]}function kre(n,e){var t=n.sort(F7r).pop(),r,i,a;for(Nc=[],hv=new Array(n.length),sM=new G7,LN=new G7;;)if(a=vce,t&&(!a||t[1]<a.y||t[1]===a.y&&t[0]<a.x))(t[0]!==r||t[1]!==i)&&(R7r(t),r=t[0],i=t[1]),t=n.pop();else if(a)O7r(a.arc);else break;if(M7r(),e){var o=+e[0][0],s=+e[0][1],l=+e[1][0],u=+e[1][1];E7r(o,s,l,u),I7r(o,s,l,u)}this.edges=Nc,this.cells=hv,sM=LN=Nc=hv=null}kre.prototype={constructor:kre,polygons:function(){var n=this.edges;return this.cells.map(function(e){var t=e.halfedges.map(function(r){return oJe(e,n[r])});return t.data=e.site.data,t})},triangles:function(){var n=[],e=this.edges;return this.cells.forEach(function(t,r){if(!!(s=(a=t.halfedges).length))for(var i=t.site,a,o=-1,s,l,u=e[a[s-1]],h=u.left===i?u.right:u.left;++o<s;)l=h,u=e[a[o]],h=u.left===i?u.right:u.left,l&&h&&r<l.index&&r<h.index&&k7r(i,l,h)<0&&n.push([i.data,l.data,h.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,e,t){for(var r=this,i,a=r._found||0,o=r.cells.length,s;!(s=r.cells[a]);)if(++a>=o)return null;var l=n-s.site[0],u=e-s.site[1],h=l*l+u*u;do s=r.cells[i=a],a=null,s.halfedges.forEach(function(c){var f=r.edges[c],d=f.left;if(!((d===s.site||!d)&&!(d=f.right))){var v=n-d[0],p=e-d[1],g=v*v+p*p;g<h&&(h=g,a=d.index)}});while(a!==null);return r._found=i,t==null||h<=t*t?s.site:null}};function B7r(){var n=x7r,e=S7r,t=null;function r(i){return new kre(i.map(function(a,o){var s=[Math.round(n(a,o,i)/vs)*vs,Math.round(e(a,o,i)/vs)*vs];return s.index=o,s.data=a,s}),t)}return r.polygons=function(i){return r(i).polygons()},r.links=function(i){return r(i).links()},r.triangles=function(i){return r(i).triangles()},r.x=function(i){return arguments.length?(n=typeof i=="function"?i:oLe(+i),r):n},r.y=function(i){return arguments.length?(e=typeof i=="function"?i:oLe(+i),r):e},r.extent=function(i){return arguments.length?(t=i==null?null:[[+i[0][0],+i[0][1]],[+i[1][0],+i[1][1]]],r):t&&[[t[0][0],t[0][1]],[t[1][0],t[1][1]]]},r.size=function(i){return arguments.length?(t=i==null?null:[[0,0],[+i[0],+i[1]]],r):t&&[t[1][0]-t[0][0],t[1][1]-t[0][1]]},r}function G7r(n){return n=n.slice(),n.push(n[0]),Qi([n])}function z7r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.bbox||[-180,-85,180,85];if(!n)throw new Error("points is required");if(!Array.isArray(t))throw new Error("bbox is invalid");return Y_(n,"Point","points"),Zn(B7r().x(function(r){return r.geometry.coordinates[0]}).y(function(r){return r.geometry.coordinates[1]}).extent([[t[0],t[1]],[t[2],t[3]]]).polygons(n.features).map(G7r))}function hJe(n,e,t,r){r=r||{};var i=r.steps||64,a=r.units||"kilometers",o=r.angle||0,s=r.pivot||n,l=r.properties||n.properties||{};if(!n)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!t)throw new Error("ySemiAxis is required");if(!Io(r))throw new Error("options must be an object");if(!Gu(i))throw new Error("steps must be a number");if(!Gu(o))throw new Error("angle must be a number");var u=Wo(n);if(a==="degrees")var h=ku(o);else e=QM(n,e,90,{units:a}),t=QM(n,t,0,{units:a}),e=Wo(e)[0]-u[0],t=Wo(t)[1]-u[1];for(var c=[],f=0;f<i;f+=1){var d=f*-360/i,v=e*t/Math.sqrt(Math.pow(t,2)+Math.pow(e,2)*Math.pow(uLe(d),2)),p=e*t/Math.sqrt(Math.pow(e,2)+Math.pow(t,2)/Math.pow(uLe(d),2));if(d<-90&&d>=-270&&(v=-v),d<-180&&d>=-360&&(p=-p),a==="degrees"){var g=v*Math.cos(h)+p*Math.sin(h),m=p*Math.cos(h)-v*Math.sin(h);v=g,p=m}c.push([v+u[0],p+u[1]])}return c.push(c[0]),a==="degrees"?Qi([c],l):HKe(Qi([c],l),o,{pivot:s})}function uLe(n){var e=n*Math.PI/180;return Math.tan(e)}function pce(n,e){e===void 0&&(e={});var t=0,r=0,i=0;return Pd(n,function(a,o,s){var l=e.weight?s==null?void 0:s[e.weight]:void 0;if(l=l==null?1:l,!Gu(l))throw new Error("weight value must be a number for feature index "+o);l=Number(l),l>0&&gl(a,function(u){t+=u[0]*l,r+=u[1]*l,i+=l})}),Vi([t/i,r/i],e.properties,e)}function U7r(n,e){if(e===void 0&&(e={}),e=e||{},!Io(e))throw new Error("options is invalid");var t=e.counter||10;if(!Gu(t))throw new Error("counter must be a number");var r=e.weight,i=pce(n,{weight:e.weight}),a=Zn([]);uo(n,function(s){var l;a.features.push(ow(s,{properties:{weight:(l=s.properties)===null||l===void 0?void 0:l[r]}}))});var o={tolerance:e.tolerance,medianCandidates:[]};return cJe(i.geometry.coordinates,[0,0],a,o,t)}function cJe(n,e,t,r,i){var a=r.tolerance||.001,o=0,s=0,l=0,u=0;if(uo(t,function(f){var d,v=(d=f.properties)===null||d===void 0?void 0:d.weight,p=v==null?1:v;if(p=Number(p),!Gu(p))throw new Error("weight value must be a number");if(p>0){u+=1;var g=p*Mo(f,n);g===0&&(g=1);var m=p/g;o+=f.geometry.coordinates[0]*m,s+=f.geometry.coordinates[1]*m,l+=m}}),u<1)throw new Error("no features to measure");var h=o/l,c=s/l;return u===1||i===0||Math.abs(h-e[0])<a&&Math.abs(c-e[1])<a?Vi([h,c],{medianCandidates:r.medianCandidates}):(r.medianCandidates.push([h,c]),cJe([h,c],n,t,r,i-1))}function V7r(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.steps||64,r=e.weight,i=e.properties||{};if(!Gu(t))throw new Error("steps must be a number");if(!Io(i))throw new Error("properties must be a number");var a=KM(n).length,o=pce(n,{weight:r}),s=0,l=0,u=0;uo(n,function(b){var E=b.properties[r]||1,T=hLe(ri(b),ri(o));s+=Math.pow(T.x,2)*E,l+=Math.pow(T.y,2)*E,u+=T.x*T.y*E});var h=s-l,c=Math.sqrt(Math.pow(h,2)+4*Math.pow(u,2)),f=2*u,d=Math.atan((h+c)/f),v=d*180/Math.PI,p=0,g=0,m=0;uo(n,function(b){var E=b.properties[r]||1,T=hLe(ri(b),ri(o));p+=Math.pow(T.x*Math.cos(d)-T.y*Math.sin(d),2)*E,g+=Math.pow(T.x*Math.sin(d)+T.y*Math.cos(d),2)*E,m+=E});var y=Math.sqrt(2*p/m),_=Math.sqrt(2*g/m),x=hJe(o,y,_,{units:"degrees",angle:v,steps:t,properties:i}),S=Sre(n,Zn([x])),w={meanCenterCoordinates:ri(o),semiMajorAxis:y,semiMinorAxis:_,numberOfFeatures:a,angle:v,percentageWithinEllipse:100*KM(S).length/a};return x.properties.standardDeviationalEllipse=w,x}function hLe(n,e){return{x:n[0]-e[0],y:n[1]-e[1]}}function $7r(n,e,t,r){if(r===void 0&&(r={}),!Io(r))throw new Error("options is invalid");if(!n)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!t)throw new Error("endPoint is required");var i=n,a=e,o=t,s=w2(r.mercator!==!0?x_(i,a):A2(i,a)),l=w2(r.mercator!==!0?x_(o,a):A2(o,a)),u=Math.abs(s-l);return r.explementary===!0?360-u:u}function W7r(n,e){var t=[],r=e.iterations||1;if(!n)throw new Error("inputPolys is required");return Pd(n,function(i,a,o){var s,l,u;switch(i.type){case"Polygon":s=[[]];for(var h=0;h<r;h++)u=[[]],l=i,h>0&&(l=Qi(s).geometry),H7r(l,u),s=u.slice(0);t.push(Qi(s,o));break;case"MultiPolygon":s=[[[]]];for(var c=0;c<r;c++)u=[[[]]],l=i,c>0&&(l=Ld(s).geometry),j7r(l,u),s=u.slice(0);t.push(Ld(s,o));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}}),Zn(t)}function H7r(n,e){var t=0,r=0;gl(n,function(i,a,o,s,l){l>t&&(t=l,r=a,e.push([]));var u=a-r,h=n.coordinates[l][u+1],c=i[0],f=i[1],d=h[0],v=h[1];e[l].push([.75*c+.25*d,.75*f+.25*v]),e[l].push([.25*c+.75*d,.25*f+.75*v])},!0),e.forEach(function(i){i.push(i[0])})}function j7r(n,e){var t=0,r=0,i=0;gl(n,function(a,o,s,l,u){l>i&&(i=l,r=o,e.push([[]])),u>t&&(t=u,r=o,e[l].push([]));var h=o-r,c=n.coordinates[l][u][h+1],f=a[0],d=a[1],v=c[0],p=c[1];e[l][u].push([.75*f+.25*v,.75*d+.25*p]),e[l][u].push([.25*f+.75*v,.25*d+.75*p])},!0),e.forEach(function(a){a.forEach(function(o){o.push(o[0])})})}function X7r(n,e,t){t===void 0&&(t=2);var r=Wo(n),i=Wo(e),a=r[0]-i[0],o=r[1]-i[1];return t===1?Math.abs(a)+Math.abs(o):Math.pow(Math.pow(a,t)+Math.pow(o,t),1/t)}function fJe(n,e){e=e||{};var t=e.threshold||1e4,r=e.p||2,i=e.binary||!1,a=e.alpha||-1,o=e.standardization||!1,s=[];uo(n,function(d){s.push(ow(d))});for(var l=[],u=0;u<s.length;u++)l[u]=[];for(var u=0;u<s.length;u++)for(var h=u;h<s.length;h++){u===h&&(l[u][h]=0);var c=X7r(s[u],s[h],r);l[u][h]=c,l[h][u]=c}for(var u=0;u<s.length;u++)for(var h=0;h<s.length;h++){var c=l[u][h];c!==0&&(i?c<=t?l[u][h]=1:l[u][h]=0:c<=t?l[u][h]=Math.pow(c,a):l[u][h]=0)}if(o)for(var u=0;u<s.length;u++)for(var f=l[u].reduce(function(v,p){return v+p},0),h=0;h<s.length;h++)l[u][h]=l[u][h]/f;return l}function Y7r(n,e){var t=e.inputField,r=e.threshold||1e5,i=e.p||2,a=e.binary||!1,o=e.alpha||-1,s=e.standardization||!0,l=fJe(n,{alpha:o,binary:a,p:i,standardization:s,threshold:r}),u=[];uo(n,function(A){var M=A.properties||{};u.push(M[t])});for(var h=dJe(u),c=q7r(u),f=0,d=0,v=0,p=0,g=l.length,m=0;m<g;m++){for(var y=0,_=0;_<g;_++)f+=l[m][_]*(u[m]-h)*(u[_]-h),d+=l[m][_],v+=Math.pow(l[m][_]+l[_][m],2),y+=l[m][_]+l[_][m];p+=Math.pow(y,2)}v=.5*v;var x=f/d/c,S=-1/(g-1),w=g*g*v-g*p+3*(d*d),b=(g-1)*(g+1)*(d*d),E=w/b-S*S,T=Math.sqrt(E),C=(x-S)/T;return{expectedMoranIndex:S,moranIndex:x,stdNorm:T,zNorm:C}}function dJe(n){for(var e=0,t=0,r=n;t<r.length;t++){var i=r[t];e+=i}return e/n.length}function q7r(n){for(var e=dJe(n),t=0,r=0,i=n;r<i.length;r++){var a=i[r];t+=Math.pow(a-e,2)}return t/n.length}function vJe(n,e){return e===void 0&&(e={}),gJe(n,"mercator",e)}function pJe(n,e){return e===void 0&&(e={}),gJe(n,"wgs84",e)}function gJe(n,e,t){t===void 0&&(t={}),t=t||{};var r=t.mutate;if(!n)throw new Error("geojson is required");return Array.isArray(n)&&Gu(n[0])?n=e==="mercator"?cLe(n):fLe(n):(r!==!0&&(n=Xh(n)),gl(n,function(i){var a=e==="mercator"?cLe(i):fLe(i);i[0]=a[0],i[1]=a[1]})),n}function cLe(n){var e=Math.PI/180,t=6378137,r=20037508342789244e-9,i=Math.abs(n[0])<=180?n[0]:n[0]-Z7r(n[0])*360,a=[t*i*e,t*Math.log(Math.tan(Math.PI*.25+.5*n[1]*e))];return a[0]>r&&(a[0]=r),a[0]<-r&&(a[0]=-r),a[1]>r&&(a[1]=r),a[1]<-r&&(a[1]=-r),a}function fLe(n){var e=180/Math.PI,t=6378137;return[n[0]*e/t,(Math.PI*.5-2*Math.atan(Math.exp(-n[1]/t)))*e]}function Z7r(n){return n<0?-1:n>0?1:0}const K7r=Object.freeze(Object.defineProperty({__proto__:null,toMercator:vJe,toWgs84:pJe},Symbol.toStringTag,{value:"Module"}));var J7r=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};function qk(n){return Array.isArray(n)?dLe(n):n&&n.bbox?dLe(n.bbox):[ezr(),tzr()]}function yJe(n,e){e===void 0&&(e={}),n==null&&(n=1);for(var t=[],r=0;r<n;r++)t.push(Vi(qk(e.bbox)));return Zn(t)}function mJe(n,e){e===void 0&&(e={}),n==null&&(n=1),(!Gu(e.num_vertices)||e.num_vertices===void 0)&&(e.num_vertices=10),(!Gu(e.max_radial_length)||e.max_radial_length===void 0)&&(e.max_radial_length=10);for(var t=[],r=function(a){var o=[],s=J7r(Array(e.num_vertices+1)).map(Math.random);s.forEach(function(l,u,h){h[u]=u>0?l+h[u-1]:l}),s.forEach(function(l){l=l*2*Math.PI/s[s.length-1];var u=Math.random();o.push([u*(e.max_radial_length||10)*Math.sin(l),u*(e.max_radial_length||10)*Math.cos(l)])}),o[o.length-1]=o[0],o=o.map(Q7r(qk(e.bbox))),t.push(Qi([o]))},i=0;i<n;i++)r();return Zn(t)}function _Je(n,e){if(e===void 0&&(e={}),e=e||{},!Io(e))throw new Error("options is invalid");var t=e.bbox,r=e.num_vertices,i=e.max_length,a=e.max_rotation;n==null&&(n=1),(!Gu(r)||r===void 0||r<2)&&(r=10),(!Gu(i)||i===void 0)&&(i=1e-4),(!Gu(a)||a===void 0)&&(a=Math.PI/8);for(var o=[],s=0;s<n;s++){for(var l=qk(t),u=[l],h=0;h<r-1;h++){var c=h===0?Math.random()*2*Math.PI:Math.tan((u[h][1]-u[h-1][1])/(u[h][0]-u[h-1][0])),f=c+(Math.random()-.5)*a*2,d=Math.random()*i;u.push([u[h][0]+d*Math.cos(f),u[h][1]+d*Math.sin(f)])}o.push(yo(u))}return Zn(o)}function Q7r(n){return function(e){return[e[0]+n[0],e[1]+n[1]]}}function xJe(){return Math.random()-.5}function ezr(){return xJe()*360}function tzr(){return xJe()*180}function dLe(n){return[Math.random()*(n[2]-n[0])+n[0],Math.random()*(n[3]-n[1])+n[1]]}const rzr=Object.freeze(Object.defineProperty({__proto__:null,randomPosition:qk,randomPoint:yJe,randomPolygon:mJe,randomLineString:_Je},Symbol.toStringTag,{value:"Module"}));function SJe(n,e){if(!n)throw new Error("geojson is required");if(n.type!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(e==null)throw new Error("filter is required");var t=[];return uo(n,function(r){M$(r.properties,e)&&t.push(r)}),Zn(t)}function gce(n,e,t){if(!n)throw new Error("geojson is required");if(n.type!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(e==null)throw new Error("property is required");for(var r=yce(n,e),i=Object.keys(r),a=0;a<i.length;a++){for(var o=i[a],s=r[o],l=[],u=0;u<s.length;u++)l.push(n.features[s[u]]);t(Zn(l),o,a)}}function wJe(n,e,t,r){var i=r;return gce(n,e,function(a,o,s){s===0&&r===void 0?i=a:i=t(i,a,o,s)}),i}function yce(n,e){var t={};return uo(n,function(r,i){var a=r.properties||{};if(Object.prototype.hasOwnProperty.call(a,String(e))){var o=a[e];Object.prototype.hasOwnProperty.call(t,o)?t[o].push(i):t[o]=[i]}}),t}function M$(n,e){if(n===void 0)return!1;var t=typeof e;if(t==="number"||t==="string")return Object.prototype.hasOwnProperty.call(n,e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!M$(n,e[r]))return!1;return!0}else return mce(n,e)}function mce(n,e){for(var t=Object.keys(e),r=0;r<t.length;r++){var i=t[r];if(n[i]!==e[i])return!1}return!0}function bJe(n,e){if(!e)return{};if(!e.length)return{};for(var t={},r=0;r<e.length;r++){var i=e[r];Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}const nzr=Object.freeze(Object.defineProperty({__proto__:null,getCluster:SJe,clusterEach:gce,clusterReduce:wJe,createBins:yce,applyFilter:M$,propertiesContainsFilter:mce,filterProperties:bJe},Symbol.toStringTag,{value:"Module"}));/**
* splaytree v3.1.2
* Fast Splay tree for Node and browser
*
* @author Alexander Milevski <info@w8r.name>
* @license MIT
* @preserve
*//*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function izr(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(h){u=[6,h],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var sw=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function azr(n,e){return n>e?1:n<e?-1:0}function qx(n,e,t){for(var r=new sw(null,null),i=r,a=r;;){var o=t(n,e.key);if(o<0){if(e.left===null)break;if(t(n,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}a.left=e,a=e,e=e.left}else if(o>0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,a.left=e.right,e.left=r.right,e.right=r.left,e}function TZ(n,e,t,r){var i=new sw(n,e);if(t===null)return i.left=i.right=null,i;t=qx(n,t,r);var a=r(n,t.key);return a<0?(i.left=t.left,i.right=t,t.left=null):a>=0&&(i.right=t.right,i.left=t,t.right=null),i}function vLe(n,e,t){var r=null,i=null;if(e){e=qx(n,e,t);var a=t(e.key,n);a===0?(r=e.left,i=e.right):a<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function ozr(n,e,t){return e===null?n:(n===null||(e=qx(n.key,e,t),e.left=n),e)}function Fre(n,e,t,r,i){if(n){r(""+e+(t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+i(n)+`
`);var a=e+(t?" ":"\u2502 ");n.left&&Fre(n.left,a,!1,r,i),n.right&&Fre(n.right,a,!0,r,i)}}var _ce=function(){function n(e){e===void 0&&(e=azr),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=TZ(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var r=new sw(e,t);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,a=qx(e,this._root,i),o=i(e,a.key);return o===0?this._root=a:(o<0?(r.left=a.left,r.right=a,a.left=null):o>0&&(r.right=a.right,r.left=a,a.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,r){var i;if(t===null)return null;t=qx(e,t,r);var a=r(e,t.key);return a===0?(t.left===null?i=t.right:(i=qx(e,t.left,r),i.right=t.right),this._size--,i):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=qx(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,r=this._comparator;t;){var i=r(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=qx(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,r=this._comparator;t;){var i=r(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var r=this._root,i=[],a=!1;!a;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),e.call(t,r),r=r.right):a=!0;return this},n.prototype.range=function(e,t,r,i){for(var a=[],o=this._comparator,s=this._root,l;a.length!==0||s;)if(s)a.push(s),s=s.left;else{if(s=a.pop(),l=o(s.key,t),l>0)break;if(o(s.key,e)>=0&&r.call(i,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var r=t.key;return e.push(r)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var r=t.data;return e.push(r)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,r=!1,i=0,a=[];!r;)if(t)a.push(t),t=t.left;else if(a.length>0){if(t=a.pop(),i===e)return t;i++,t=t.right}else r=!0;return null},n.prototype.next=function(e){var t=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var i=this._comparator;t;){var a=i(e.key,t.key);if(a===0)break;a<0?(r=t,t=t.left):t=t.right}return r},n.prototype.prev=function(e){var t=this._root,r=null;if(e.left!==null){for(r=e.left;r.right;)r=r.right;return r}for(var i=this._comparator;t;){var a=i(e.key,t.key);if(a===0)break;a<0?t=t.left:(r=t,t=t.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return lzr(this._root)},n.prototype.load=function(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=!1);var i=e.length,a=this._comparator;if(r&&zre(e,t,0,i-1,a),this._root===null)this._root=Bre(e,t,0,i),this._size=i;else{var o=uzr(this.toList(),szr(e,t),a);i=this._size+i,this._root=Gre({head:o},0,i)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(r){return String(r.key)});var t=[];return Fre(this._root,"",!0,function(r){return t.push(r)},e),t.join("")},n.prototype.update=function(e,t,r){var i=this._comparator,a=vLe(e,this._root,i),o=a.left,s=a.right;i(e,t)<0?s=TZ(t,r,s,i):o=TZ(t,r,o,i),this._root=ozr(o,s,i)},n.prototype.split=function(e){return vLe(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,r;return izr(this,function(i){switch(i.label){case 0:e=this._root,t=[],r=!1,i.label=1;case 1:return r?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return i.sent(),e=e.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Bre(n,e,t,r){var i=r-t;if(i>0){var a=t+Math.floor(i/2),o=n[a],s=e[a],l=new sw(o,s);return l.left=Bre(n,e,t,a),l.right=Bre(n,e,a+1,r),l}return null}function szr(n,e){for(var t=new sw(null,null),r=t,i=0;i<n.length;i++)r=r.next=new sw(n[i],e[i]);return r.next=null,t.next}function lzr(n){for(var e=n,t=[],r=!1,i=new sw(null,null),a=i;!r;)e?(t.push(e),e=e.left):t.length>0?(e=a=a.next=t.pop(),e=e.right):r=!0;return a.next=null,i.next}function Gre(n,e,t){var r=t-e;if(r>0){var i=e+Math.floor(r/2),a=Gre(n,e,i),o=n.head;return o.left=a,n.head=n.head.next,o.right=Gre(n,i+1,t),o}return null}function uzr(n,e,t){for(var r=new sw(null,null),i=r,a=n,o=e;a!==null&&o!==null;)t(a.key,o.key)<0?(i.next=a,a=a.next):(i.next=o,o=o.next),i=i.next;return a!==null?i.next=a:o!==null&&(i.next=o),r.next}function zre(n,e,t,r,i){if(!(t>=r)){for(var a=n[t+r>>1],o=t-1,s=r+1;;){do o++;while(i(n[o],a)<0);do s--;while(i(n[s],a)>0);if(o>=s)break;var l=n[o];n[o]=n[s],n[s]=l,l=e[o],e[o]=e[s],e[s]=l}zre(n,e,t,s,i),zre(n,e,s+1,r,i)}}const e_=11102230246251565e-32,Mc=134217729,hzr=(3+8*e_)*e_;function CZ(n,e,t,r,i){let a,o,s,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(a=u,u=e[++c]):(a=h,h=r[++f]);let d=0;if(c<n&&f<t)for(h>u==h>-u?(o=u+a,s=a-(o-u),u=e[++c]):(o=h+a,s=a-(o-h),h=r[++f]),a=o,s!==0&&(i[d++]=s);c<n&&f<t;)h>u==h>-u?(o=a+u,l=o-a,s=a-(o-l)+(u-l),u=e[++c]):(o=a+h,l=o-a,s=a-(o-l)+(h-l),h=r[++f]),a=o,s!==0&&(i[d++]=s);for(;c<n;)o=a+u,l=o-a,s=a-(o-l)+(u-l),u=e[++c],a=o,s!==0&&(i[d++]=s);for(;f<t;)o=a+h,l=o-a,s=a-(o-l)+(h-l),h=r[++f],a=o,s!==0&&(i[d++]=s);return(a!==0||d===0)&&(i[d++]=a),d}function czr(n,e){let t=e[0];for(let r=1;r<n;r++)t+=e[r];return t}function Zk(n){return new Float64Array(n)}const fzr=(3+16*e_)*e_,dzr=(2+12*e_)*e_,vzr=(9+64*e_)*e_*e_,OC=Zk(4),pLe=Zk(8),gLe=Zk(12),yLe=Zk(16),vf=Zk(4);function pzr(n,e,t,r,i,a,o){let s,l,u,h,c,f,d,v,p,g,m,y,_,x,S,w,b,E;const T=n-i,C=t-i,A=e-a,M=r-a;x=T*M,f=Mc*T,d=f-(f-T),v=T-d,f=Mc*M,p=f-(f-M),g=M-p,S=v*g-(x-d*p-v*p-d*g),w=A*C,f=Mc*A,d=f-(f-A),v=A-d,f=Mc*C,p=f-(f-C),g=C-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,OC[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,OC[1]=_-(m+c)+(c-w),E=y+m,c=E-y,OC[2]=y-(E-c)+(m-c),OC[3]=E;let I=czr(4,OC),R=dzr*o;if(I>=R||-I>=R||(c=n-T,s=n-(T+c)+(c-i),c=t-C,u=t-(C+c)+(c-i),c=e-A,l=e-(A+c)+(c-a),c=r-M,h=r-(M+c)+(c-a),s===0&&l===0&&u===0&&h===0)||(R=vzr*o+hzr*Math.abs(I),I+=T*h+M*s-(A*u+C*l),I>=R||-I>=R))return I;x=s*M,f=Mc*s,d=f-(f-s),v=s-d,f=Mc*M,p=f-(f-M),g=M-p,S=v*g-(x-d*p-v*p-d*g),w=l*C,f=Mc*l,d=f-(f-l),v=l-d,f=Mc*C,p=f-(f-C),g=C-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,vf[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,vf[1]=_-(m+c)+(c-w),E=y+m,c=E-y,vf[2]=y-(E-c)+(m-c),vf[3]=E;const k=CZ(4,OC,4,vf,pLe);x=T*h,f=Mc*T,d=f-(f-T),v=T-d,f=Mc*h,p=f-(f-h),g=h-p,S=v*g-(x-d*p-v*p-d*g),w=A*u,f=Mc*A,d=f-(f-A),v=A-d,f=Mc*u,p=f-(f-u),g=u-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,vf[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,vf[1]=_-(m+c)+(c-w),E=y+m,c=E-y,vf[2]=y-(E-c)+(m-c),vf[3]=E;const D=CZ(k,pLe,4,vf,gLe);x=s*h,f=Mc*s,d=f-(f-s),v=s-d,f=Mc*h,p=f-(f-h),g=h-p,S=v*g-(x-d*p-v*p-d*g),w=l*u,f=Mc*l,d=f-(f-l),v=l-d,f=Mc*u,p=f-(f-u),g=u-p,b=v*g-(w-d*p-v*p-d*g),m=S-b,c=S-m,vf[0]=S-(m+c)+(c-b),y=x+m,c=y-x,_=x-(y-c)+(m-c),m=_-w,c=_-m,vf[1]=_-(m+c)+(c-w),E=y+m,c=E-y,vf[2]=y-(E-c)+(m-c),vf[3]=E;const G=CZ(D,gLe,4,vf,yLe);return yLe[G-1]}function gzr(n,e,t,r,i,a){const o=(e-a)*(t-i),s=(n-i)*(r-a),l=o-s,u=Math.abs(o+s);return Math.abs(l)>=fzr*u?l:-pzr(n,e,t,r,i,a,u)}const jP=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Ure=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,r=n.ur.x<e.ur.x?n.ur.x:e.ur.x,i=n.ll.y<e.ll.y?e.ll.y:n.ll.y,a=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:i},ur:{x:r,y:a}}};let dS=Number.EPSILON;dS===void 0&&(dS=Math.pow(2,-52));const yzr=dS*dS,mLe=(n,e)=>{if(-dS<n&&n<dS&&-dS<e&&e<dS)return 0;const t=n-e;return t*t<yzr*n*e?0:n<e?-1:1};class mzr{constructor(){this.reset()}reset(){this.xRounder=new _Le,this.yRounder=new _Le}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class _Le{constructor(){this.tree=new _ce,this.round(0)}round(e){const t=this.tree.add(e),r=this.tree.prev(t);if(r!==null&&mLe(t.key,r.key)===0)return this.tree.remove(e),r.key;const i=this.tree.next(t);return i!==null&&mLe(t.key,i.key)===0?(this.tree.remove(e),i.key):e}}const PN=new mzr,A8=(n,e)=>n.x*e.y-n.y*e.x,EJe=(n,e)=>n.x*e.x+n.y*e.y,xLe=(n,e,t)=>{const r=gzr(n.x,n.y,e.x,e.y,t.x,t.y);return r>0?-1:r<0?1:0},U7=n=>Math.sqrt(EJe(n,n)),_zr=(n,e,t)=>{const r={x:e.x-n.x,y:e.y-n.y},i={x:t.x-n.x,y:t.y-n.y};return A8(i,r)/U7(i)/U7(r)},xzr=(n,e,t)=>{const r={x:e.x-n.x,y:e.y-n.y},i={x:t.x-n.x,y:t.y-n.y};return EJe(i,r)/U7(i)/U7(r)},SLe=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},wLe=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},Szr=(n,e,t,r)=>{if(e.x===0)return wLe(t,r,n.x);if(r.x===0)return wLe(n,e,t.x);if(e.y===0)return SLe(t,r,n.y);if(r.y===0)return SLe(n,e,t.y);const i=A8(e,r);if(i==0)return null;const a={x:t.x-n.x,y:t.y-n.y},o=A8(a,e)/i,s=A8(a,r)/i,l=n.x+s*e.x,u=t.x+o*r.x,h=n.y+s*e.y,c=t.y+o*r.y,f=(l+u)/2,d=(h+c)/2;return{x:f,y:d}};class xp{static compare(e,t){const r=xp.comparePoints(e.point,t.point);return r!==0?r:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:MS.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let r=0,i=t.length;r<i;r++){const a=t[r];this.point.events.push(a),a.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const r=this.point.events[t];if(r.segment.consumedBy===void 0)for(let i=t+1;i<e;i++){const a=this.point.events[i];a.consumedBy===void 0&&r.otherSE.point.events===a.otherSE.point.events&&r.segment.consume(a.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,r=this.point.events.length;t<r;t++){const i=this.point.events[t];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}getLeftmostComparator(e){const t=new Map,r=i=>{const a=i.otherSE;t.set(i,{sine:_zr(this.point,e.point,a.point),cosine:xzr(this.point,e.point,a.point)})};return(i,a)=>{t.has(i)||r(i),t.has(a)||r(a);const{sine:o,cosine:s}=t.get(i),{sine:l,cosine:u}=t.get(a);return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}}let wzr=0;class MS{static compare(e,t){const r=e.leftSE.point.x,i=t.leftSE.point.x,a=e.rightSE.point.x,o=t.rightSE.point.x;if(o<r)return 1;if(a<i)return-1;const s=e.leftSE.point.y,l=t.leftSE.point.y,u=e.rightSE.point.y,h=t.rightSE.point.y;if(r<i){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const c=e.comparePoint(t.leftSE.point);if(c<0)return 1;if(c>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(r>i){if(s<l&&s<h)return-1;if(s>l&&s>h)return 1;const c=t.comparePoint(e.leftSE.point);if(c!==0)return c;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(a<o){const c=t.comparePoint(e.rightSE.point);if(c!==0)return c}if(a>o){const c=e.comparePoint(t.rightSE.point);if(c<0)return 1;if(c>0)return-1}if(a!==o){const c=u-s,f=a-r,d=h-l,v=o-i;if(c>f&&d<v)return 1;if(c<f&&d>v)return-1}return a>o?1:a<o||u<h?-1:u>h?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,r,i){this.id=++wzr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=r,this.windings=i}static fromRing(e,t,r){let i,a,o;const s=xp.comparePoints(e,t);if(s<0)i=e,a=t,o=1;else if(s>0)i=t,a=e,o=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const l=new xp(i,!0),u=new xp(a,!1);return new MS(l,u,[r],[o])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(t.x===r.x)return e.x===t.x?0:e.x<t.x?1:-1;const a=(e.y-t.y)/i.y,o=t.x+a*i.x;if(e.x===o)return 0;const s=(e.x-t.x)/i.x,l=t.y+s*i.y;return e.y===l?0:e.y<l?-1:1}getIntersection(e){const t=this.bbox(),r=e.bbox(),i=Ure(t,r);if(i===null)return null;const a=this.leftSE.point,o=this.rightSE.point,s=e.leftSE.point,l=e.rightSE.point,u=jP(t,s)&&this.comparePoint(s)===0,h=jP(r,a)&&e.comparePoint(a)===0,c=jP(t,l)&&this.comparePoint(l)===0,f=jP(r,o)&&e.comparePoint(o)===0;if(h&&u)return f&&!c?o:!f&&c?l:null;if(h)return c&&a.x===l.x&&a.y===l.y?null:a;if(u)return f&&o.x===s.x&&o.y===s.y?null:s;if(f&&c)return null;if(f)return o;if(c)return l;const d=Szr(a,this.vector(),s,e.vector());return d===null||!jP(i,d)?null:PN.round(d.x,d.y)}split(e){const t=[],r=e.events!==void 0,i=new xp(e,!0),a=new xp(e,!1),o=this.rightSE;this.replaceRightSE(a),t.push(a),t.push(i);const s=new MS(i,o,this.rings.slice(),this.windings.slice());return xp.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),xp.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),a.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,r=this.windings.length;t<r;t++)this.windings[t]*=-1}consume(e){let t=this,r=e;for(;t.consumedBy;)t=t.consumedBy;for(;r.consumedBy;)r=r.consumedBy;const i=MS.compare(t,r);if(i!==0){if(i>0){const a=t;t=r,r=a}if(t.prev===r){const a=t;t=r,r=a}for(let a=0,o=r.rings.length;a<o;a++){const s=r.rings[a],l=r.windings[a],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(l)):t.windings[u]+=l}r.rings=null,r.windings=null,r.consumedBy=t,r.leftSE.consumedBy=t.leftSE,r.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,r=this._afterState.windings,i=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],h=this.windings[s],c=t.indexOf(u);c===-1?(t.push(u),r.push(h)):r[c]+=h}const a=[],o=[];for(let s=0,l=t.length;s<l;s++){if(r[s]===0)continue;const u=t[s],h=u.poly;if(o.indexOf(h)===-1)if(u.isExterior)a.push(h);else{o.indexOf(h)===-1&&o.push(h);const c=a.indexOf(u.poly);c!==-1&&a.splice(c,1)}}for(let s=0,l=a.length;s<l;s++){const u=a[s].multiPoly;i.indexOf(u)===-1&&i.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(o0.type){case"union":{const r=e.length===0,i=t.length===0;this._isInResult=r!==i;break}case"intersection":{let r,i;e.length<t.length?(r=e.length,i=t.length):(r=t.length,i=e.length),this._isInResult=i===o0.numMultiPolys&&r<i;break}case"xor":{const r=Math.abs(e.length-t.length);this._isInResult=r%2===1;break}case"difference":{const r=i=>i.length===1&&i[0].isSubject;this._isInResult=r(e)!==r(t);break}default:throw new Error(`Unrecognized operation type found ${o0.type}`)}return this._isInResult}}class bLe{constructor(e,t,r){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=PN.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let a=i;for(let o=1,s=e.length;o<s;o++){if(typeof e[o][0]!="number"||typeof e[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=PN.round(e[o][0],e[o][1]);l.x===a.x&&l.y===a.y||(this.segments.push(MS.fromRing(a,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),a=l)}(i.x!==a.x||i.y!==a.y)&&this.segments.push(MS.fromRing(a,i,this))}getSweepEvents(){const e=[];for(let t=0,r=this.segments.length;t<r;t++){const i=this.segments[t];e.push(i.leftSE),e.push(i.rightSE)}return e}}class bzr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new bLe(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,i=e.length;r<i;r++){const a=new bLe(e[r],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;t<r;t++){const i=this.interiorRings[t].getSweepEvents();for(let a=0,o=i.length;a<o;a++)e.push(i[a])}return e}}class ELe{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let r=0,i=e.length;r<i;r++){const a=new bzr(e[r],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,r=this.polys.length;t<r;t++){const i=this.polys[t].getSweepEvents();for(let a=0,o=i.length;a<o;a++)e.push(i[a])}return e}}class V7{static factory(e){const t=[];for(let r=0,i=e.length;r<i;r++){const a=e[r];if(!a.isInResult()||a.ringOut)continue;let o=null,s=a.leftSE,l=a.rightSE;const u=[s],h=s.point,c=[];for(;o=s,s=l,u.push(s),s.point!==h;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const p=u[0].point,g=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${g.x}, ${g.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let p=0,g=c.length;p<g;p++)if(c[p].point===s.point){d=p;break}if(d!==null){const p=c.splice(d)[0],g=u.splice(p.index);g.unshift(g[0].otherSE),t.push(new V7(g.reverse()));continue}c.push({index:u.length,point:s.point});const v=s.getLeftmostComparator(o);l=f.sort(v)[0].otherSE;break}t.push(new V7(u))}return t}constructor(e){this.events=e;for(let t=0,r=e.length;t<r;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,h=this.events.length-1;u<h;u++){const c=this.events[u].point,f=this.events[u+1].point;xLe(c,e,f)!==0&&(t.push(c),e=c)}if(t.length===1)return null;const r=t[0],i=t[1];xLe(r,e,i)===0&&t.shift(),t.push(t[0]);const a=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,l=[];for(let u=o;u!=s;u+=a)l.push([t[u].x,t[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let i=1,a=this.events.length;i<a;i++){const o=this.events[i];xp.compare(e,o)>0&&(e=o)}let t=e.segment.prevInResult(),r=t?t.prevInResult():null;for(;;){if(!t)return null;if(!r)return t.ringOut;if(r.ringOut!==t.ringOut)return r.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=r.prevInResult(),r=t?t.prevInResult():null}}}class TLe{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,r=this.interiorRings.length;t<r;t++){const i=this.interiorRings[t].getGeom();i!==null&&e.push(i)}return e}}class Ezr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,r=this.polys.length;t<r;t++){const i=this.polys[t].getGeom();i!==null&&e.push(i)}return e}_composePolys(e){const t=[];for(let r=0,i=e.length;r<i;r++){const a=e[r];if(!a.poly)if(a.isExteriorRing())t.push(new TLe(a));else{const o=a.enclosingRing();o.poly||t.push(new TLe(o)),o.poly.addInterior(a)}}return t}}class Tzr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:MS.compare;this.queue=e,this.tree=new _ce(t),this.segments=[]}process(e){const t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),r;const i=e.isLeft?this.tree.add(t):this.tree.find(t);if(!i)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let a=i,o=i,s,l;for(;s===void 0;)a=this.tree.prev(a),a===null?s=null:a.key.consumedBy===void 0&&(s=a.key);for(;l===void 0;)o=this.tree.next(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);if(e.isLeft){let u=null;if(s){const c=s.getIntersection(t);if(c!==null&&(t.isAnEndpoint(c)||(u=c),!s.isAnEndpoint(c))){const f=this._splitSafely(s,c);for(let d=0,v=f.length;d<v;d++)r.push(f[d])}}let h=null;if(l){const c=l.getIntersection(t);if(c!==null&&(t.isAnEndpoint(c)||(h=c),!l.isAnEndpoint(c))){const f=this._splitSafely(l,c);for(let d=0,v=f.length;d<v;d++)r.push(f[d])}}if(u!==null||h!==null){let c=null;u===null?c=h:h===null?c=u:c=xp.comparePoints(u,h)<=0?u:h,this.queue.remove(t.rightSE),r.push(t.rightSE);const f=t.split(c);for(let d=0,v=f.length;d<v;d++)r.push(f[d])}r.length>0?(this.tree.remove(t),r.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const h=this._splitSafely(s,u);for(let c=0,f=h.length;c<f;c++)r.push(h[c])}if(!l.isAnEndpoint(u)){const h=this._splitSafely(l,u);for(let c=0,f=h.length;c<f;c++)r.push(h[c])}}}this.tree.remove(t)}return r}_splitSafely(e,t){this.tree.remove(e);const r=e.rightSE;this.queue.remove(r);const i=e.split(t);return i.push(r),e.consumedBy===void 0&&this.tree.add(e),i}}const CLe=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Czr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Azr{run(e,t,r){o0.type=e,PN.reset();const i=[new ELe(t,!0)];for(let c=0,f=r.length;c<f;c++)i.push(new ELe(r[c],!1));if(o0.numMultiPolys=i.length,o0.type==="difference"){const c=i[0];let f=1;for(;f<i.length;)Ure(i[f].bbox,c.bbox)!==null?f++:i.splice(f,1)}if(o0.type==="intersection")for(let c=0,f=i.length;c<f;c++){const d=i[c];for(let v=c+1,p=i.length;v<p;v++)if(Ure(d.bbox,i[v].bbox)===null)return[]}const a=new _ce(xp.compare);for(let c=0,f=i.length;c<f;c++){const d=i[c].getSweepEvents();for(let v=0,p=d.length;v<p;v++)if(a.insert(d[v]),a.size>CLe)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new Tzr(a);let s=a.size,l=a.pop();for(;l;){const c=l.key;if(a.size===s){const d=c.segment;throw new Error(`Unable to pop() ${c.isLeft?"left":"right"} SweepEvent [${c.point.x}, ${c.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(a.size>CLe)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>Czr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=o.process(c);for(let d=0,v=f.length;d<v;d++){const p=f[d];p.consumedBy===void 0&&a.insert(p)}s=a.size,l=a.pop()}PN.reset();const u=V7.factory(o.segments);return new Ezr(u).getGeom()}}const o0=new Azr,Mzr=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return o0.run("union",n,t)},Izr=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return o0.run("intersection",n,t)},Lzr=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return o0.run("xor",n,t)},Pzr=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return o0.run("difference",n,t)};var t_={union:Mzr,intersection:Izr,xor:Lzr,difference:Pzr};function Ozr(n,e){var t=ls(n),r=ls(e),i=n.properties||{},a=t_.difference(t.coordinates,r.coordinates);return a.length===0?null:a.length===1?Qi(a[0],i):Ld(a,i)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var t=Object(this),r=Math.max(Math.min(t.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var a=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(a=a<0?Math.max(r+arguments[2],0):Math.min(a,r);i<a;)t[i]=e,++i;return t},writable:!0});Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)};Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};Number.parseFloat=Number.parseFloat||parseFloat;Number.isNaN=Number.isNaN||function(n){return n!==n};Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var M2=function(){};M2.prototype.interfaces_=function(){return[]};M2.prototype.getClass=function(){return M2};M2.prototype.equalsWithTolerance=function(e,t,r){return Math.abs(e-t)<=r};var Ss=function(n){function e(t){n.call(this,t),this.name="IllegalArgumentException",this.message=t,this.stack=new n().stack}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}(Error),ui=function(){},TJe={MAX_VALUE:{configurable:!0}};ui.isNaN=function(e){return Number.isNaN(e)};ui.doubleToLongBits=function(e){return e};ui.longBitsToDouble=function(e){return e};ui.isInfinite=function(e){return!Number.isFinite(e)};TJe.MAX_VALUE.get=function(){return Number.MAX_VALUE};Object.defineProperties(ui,TJe);var $d=function(){},I$=function(){},eI=function(){};function Wd(){}var tt=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},xT={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};tt.prototype.setOrdinate=function(e,t){switch(e){case tt.X:this.x=t;break;case tt.Y:this.y=t;break;case tt.Z:this.z=t;break;default:throw new Ss("Invalid ordinate index: "+e)}};tt.prototype.equals2D=function(){if(arguments.length===1){var e=arguments[0];return!(this.x!==e.x||this.y!==e.y)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return!(!M2.equalsWithTolerance(this.x,t.x,r)||!M2.equalsWithTolerance(this.y,t.y,r))}};tt.prototype.getOrdinate=function(e){switch(e){case tt.X:return this.x;case tt.Y:return this.y;case tt.Z:return this.z}throw new Ss("Invalid ordinate index: "+e)};tt.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||ui.isNaN(this.z))&&ui.isNaN(e.z)};tt.prototype.equals=function(e){return e instanceof tt?this.equals2D(e):!1};tt.prototype.equalInZ=function(e,t){return M2.equalsWithTolerance(this.z,e.z,t)};tt.prototype.compareTo=function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0};tt.prototype.clone=function(){};tt.prototype.copy=function(){return new tt(this)};tt.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};tt.prototype.distance3D=function(e){var t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+r*r+i*i)};tt.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)};tt.prototype.hashCode=function(){var e=17;return e=37*e+tt.hashCode(this.x),e=37*e+tt.hashCode(this.y),e};tt.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z};tt.prototype.interfaces_=function(){return[$d,I$,Wd]};tt.prototype.getClass=function(){return tt};tt.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ui.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}};xT.DimensionalComparator.get=function(){return z1};xT.serialVersionUID.get=function(){return 6683108902428367e3};xT.NULL_ORDINATE.get=function(){return ui.NaN};xT.X.get=function(){return 0};xT.Y.get=function(){return 1};xT.Z.get=function(){return 2};Object.defineProperties(tt,xT);var z1=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Ss("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};z1.prototype.compare=function(e,t){var r=e,i=t,a=z1.compare(r.x,i.x);if(a!==0)return a;var o=z1.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var s=z1.compare(r.z,i.z);return s};z1.prototype.interfaces_=function(){return[eI]};z1.prototype.getClass=function(){return z1};z1.compare=function(e,t){return e<t?-1:e>t?1:ui.isNaN(e)?ui.isNaN(t)?0:-1:ui.isNaN(t)?1:0};var tI=function(){};tI.prototype.create=function(){};tI.prototype.interfaces_=function(){return[]};tI.prototype.getClass=function(){return tI};var dt=function(){},Kk={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};dt.prototype.interfaces_=function(){return[]};dt.prototype.getClass=function(){return dt};dt.toLocationSymbol=function(e){switch(e){case dt.EXTERIOR:return"e";case dt.BOUNDARY:return"b";case dt.INTERIOR:return"i";case dt.NONE:return"-"}throw new Ss("Unknown location value: "+e)};Kk.INTERIOR.get=function(){return 0};Kk.BOUNDARY.get=function(){return 1};Kk.EXTERIOR.get=function(){return 2};Kk.NONE.get=function(){return-1};Object.defineProperties(dt,Kk);var zn=function(n,e){return n.interfaces_&&n.interfaces_().indexOf(e)>-1},Uf=function(){},CJe={LOG_10:{configurable:!0}};Uf.prototype.interfaces_=function(){return[]};Uf.prototype.getClass=function(){return Uf};Uf.log10=function(e){var t=Math.log(e);return ui.isInfinite(t)||ui.isNaN(t)?t:t/Uf.LOG_10};Uf.min=function(e,t,r,i){var a=e;return t<a&&(a=t),r<a&&(a=r),i<a&&(a=i),a};Uf.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],r=arguments[2];return e<t?t:e>r?r:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],a=arguments[1],o=arguments[2];return i<a?a:i>o?o:i}};Uf.wrap=function(e,t){return e<0?t- -e%t:e%t};Uf.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2],i=e;return t>i&&(i=t),r>i&&(i=r),i}else if(arguments.length===4){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3],u=a;return o>u&&(u=o),s>u&&(u=s),l>u&&(u=l),u}};Uf.average=function(e,t){return(e+t)/2};CJe.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(Uf,CJe);var hg=function(e){this.str=e};hg.prototype.append=function(e){this.str+=e};hg.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)};hg.prototype.toString=function(e){return this.str};var jp=function(e){this.value=e};jp.prototype.intValue=function(){return this.value};jp.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0};jp.isNaN=function(e){return Number.isNaN(e)};var ON=function(){};ON.isWhitespace=function(e){return e<=32&&e>=0||e===127};ON.toUpperCase=function(e){return e.toUpperCase()};var Et=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof n){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.init(i,a)}},Fv={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Et.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo};Et.prototype.extractSignificantDigits=function(e,t){var r=this.abs(),i=Et.magnitude(r._hi),a=Et.TEN.pow(i);r=r.divide(a),r.gt(Et.TEN)?(r=r.divide(Et.TEN),i+=1):r.lt(Et.ONE)&&(r=r.multiply(Et.TEN),i-=1);for(var o=i+1,s=new hg,l=Et.MAX_PRINT_DIGITS-1,u=0;u<=l;u++){e&&u===o&&s.append(".");var h=Math.trunc(r._hi);if(h<0)break;var c=!1,f=0;h>9?(c=!0,f="9"):f="0"+h,s.append(f),r=r.subtract(Et.valueOf(h)).multiply(Et.TEN),c&&r.selfAdd(Et.TEN);var d=!0,v=Et.magnitude(r._hi);if(v<0&&Math.abs(v)>=l-u&&(d=!1),!d)break}return t[0]=i,s.toString()};Et.prototype.sqr=function(){return this.multiply(this)};Et.prototype.doubleValue=function(){return this._hi+this._lo};Et.prototype.subtract=function(){if(arguments[0]instanceof Et){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}};Et.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}};Et.prototype.isZero=function(){return this._hi===0&&this._lo===0};Et.prototype.selfSubtract=function(){if(arguments[0]instanceof Et){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}};Et.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Et.prototype.min=function(e){return this.le(e)?this:e};Et.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Et){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=null,o=null,s=null,l=null,u=null,h=null,c=null,f=null;return u=this._hi/r,h=Et.SPLIT*u,a=h-u,f=Et.SPLIT*r,a=h-a,o=u-a,s=f-r,c=u*r,s=f-s,l=r-s,f=a*s-c+a*l+o*s+o*l,h=(this._hi-c-f+this._lo-u*i)/r,f=u+h,this._hi=f,this._lo=u-f+h,this}};Et.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Et.prototype.divide=function(){if(arguments[0]instanceof Et){var e=arguments[0],t=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;o=this._hi/e._hi,s=Et.SPLIT*o,t=s-o,u=Et.SPLIT*e._hi,t=s-t,r=o-t,i=u-e._hi,l=o*e._hi,i=u-i,a=e._hi-i,u=t*i-l+t*a+r*i+r*a,s=(this._hi-l-u+this._lo-o*e._lo)/e._hi,u=o+s;var h=u,c=o-u+s;return new Et(h,c)}else if(typeof arguments[0]=="number"){var f=arguments[0];return ui.isNaN(f)?Et.createNaN():Et.copy(this).selfDivide(f,0)}};Et.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo};Et.prototype.pow=function(e){if(e===0)return Et.valueOf(1);var t=new Et(this),r=Et.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else r=t;return e<0?r.reciprocal():r};Et.prototype.ceil=function(){if(this.isNaN())return Et.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new Et(e,t)};Et.prototype.compareTo=function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0};Et.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()};Et.prototype.setValue=function(){if(arguments[0]instanceof Et){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}};Et.prototype.max=function(e){return this.ge(e)?this:e};Et.prototype.sqrt=function(){if(this.isZero())return Et.valueOf(0);if(this.isNegative())return Et.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,r=Et.valueOf(t),i=this.subtract(r.sqr()),a=i._hi*(e*.5);return r.add(a)};Et.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Et){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],r=null,i=null,a=null,o=null,s=null,l=null;return a=this._hi+t,s=a-this._hi,o=a-s,o=t-s+(this._hi-o),l=o+this._lo,r=a+l,i=l+(a-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var u=arguments[0],h=arguments[1],c=null,f=null,d=null,v=null,p=null,g=null,m=null,y=null;p=this._hi+u,d=this._lo+h,m=p-this._hi,y=d-this._lo,g=p-m,v=d-y,g=u-m+(this._hi-g),v=h-y+(this._lo-v),m=g+d,c=p+m,f=m+(p-c),m=v+f;var _=c+m,x=m+(c-_);return this._hi=_,this._lo=x,this}};Et.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Et){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=null,o=null,s=null,l=null,u=null,h=null;u=Et.SPLIT*this._hi,a=u-this._hi,h=Et.SPLIT*r,a=u-a,o=this._hi-a,s=h-r,u=this._hi*r,s=h-s,l=r-s,h=a*s-u+a*l+o*s+o*l+(this._hi*i+this._lo*r);var c=u+h;a=u-c;var f=h+a;return this._hi=c,this._lo=f,this}};Et.prototype.selfSqr=function(){return this.selfMultiply(this)};Et.prototype.floor=function(){if(this.isNaN())return Et.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new Et(e,t)};Et.prototype.negate=function(){return this.isNaN()?this:new Et(-this._hi,-this._lo)};Et.prototype.clone=function(){};Et.prototype.multiply=function(){if(arguments[0]instanceof Et){var e=arguments[0];return e.isNaN()?Et.createNaN():Et.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ui.isNaN(t)?Et.createNaN():Et.copy(this).selfMultiply(t,0)}};Et.prototype.isNaN=function(){return ui.isNaN(this._hi)};Et.prototype.intValue=function(){return Math.trunc(this._hi)};Et.prototype.toString=function(){var e=Et.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()};Et.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!0,t),i=t[0]+1,a=r;if(r.charAt(0)===".")a="0"+r;else if(i<0)a="0."+Et.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var o=i-r.length,s=Et.stringOfChar("0",o);a=r+s+".0"}return this.isNegative()?"-"+a:a};Et.prototype.reciprocal=function(){var e=null,t=null,r=null,i=null,a=null,o=null,s=null,l=null;a=1/this._hi,o=Et.SPLIT*a,e=o-a,l=Et.SPLIT*this._hi,e=o-e,t=a-e,r=l-this._hi,s=a*this._hi,r=l-r,i=this._hi-r,l=e*r-s+e*i+t*r+t*i,o=(1-s-l-a*this._lo)/this._hi;var u=a+o,h=a-u+o;return new Et(u,h)};Et.prototype.toSciNotation=function(){if(this.isZero())return Et.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!1,t),i=Et.SCI_NOT_EXPONENT_CHAR+t[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var a="";r.length>1&&(a=r.substring(1));var o=r.charAt(0)+"."+a;return this.isNegative()?"-"+o+i:o+i};Et.prototype.abs=function(){return this.isNaN()?Et.NaN:this.isNegative()?this.negate():new Et(this)};Et.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Et.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo};Et.prototype.add=function(){if(arguments[0]instanceof Et){var e=arguments[0];return Et.copy(this).selfAdd(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return Et.copy(this).selfAdd(t)}};Et.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof Et){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}};Et.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo};Et.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Et.prototype.trunc=function(){return this.isNaN()?Et.NaN:this.isPositive()?this.floor():this.ceil()};Et.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Et.prototype.interfaces_=function(){return[Wd,$d,I$]};Et.prototype.getClass=function(){return Et};Et.sqr=function(e){return Et.valueOf(e).selfMultiply(e)};Et.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return Et.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new Et(t)}};Et.sqrt=function(e){return Et.valueOf(e).sqrt()};Et.parse=function(e){for(var t=0,r=e.length;ON.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<r){var a=e.charAt(t);(a==="-"||a==="+")&&(t++,a==="-"&&(i=!0))}for(var o=new Et,s=0,l=0,u=0;!(t>=r);){var h=e.charAt(t);if(t++,ON.isDigit(h)){var c=h-"0";o.selfMultiply(Et.TEN),o.selfAdd(c),s++;continue}if(h==="."){l=s;continue}if(h==="e"||h==="E"){var f=e.substring(t);try{u=jp.parseInt(f)}catch(m){throw m instanceof Error?new Error("Invalid exponent "+f+" in string "+e):m}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+t+" in string "+e)}var d=o,v=s-l-u;if(v===0)d=o;else if(v>0){var p=Et.TEN.pow(v);d=o.divide(p)}else if(v<0){var g=Et.TEN.pow(-v);d=o.multiply(g)}return i?d.negate():d};Et.createNaN=function(){return new Et(ui.NaN,ui.NaN)};Et.copy=function(e){return new Et(e)};Et.magnitude=function(e){var t=Math.abs(e),r=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(r)),a=Math.pow(10,i);return a*10<=t&&(i+=1),i};Et.stringOfChar=function(e,t){for(var r=new hg,i=0;i<t;i++)r.append(e);return r.toString()};Fv.PI.get=function(){return new Et(3.141592653589793,12246467991473532e-32)};Fv.TWO_PI.get=function(){return new Et(6.283185307179586,24492935982947064e-32)};Fv.PI_2.get=function(){return new Et(1.5707963267948966,6123233995736766e-32)};Fv.E.get=function(){return new Et(2.718281828459045,14456468917292502e-32)};Fv.NaN.get=function(){return new Et(ui.NaN,ui.NaN)};Fv.EPS.get=function(){return 123259516440783e-46};Fv.SPLIT.get=function(){return 134217729};Fv.MAX_PRINT_DIGITS.get=function(){return 32};Fv.TEN.get=function(){return Et.valueOf(10)};Fv.ONE.get=function(){return Et.valueOf(1)};Fv.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"};Fv.SCI_NOT_ZERO.get=function(){return"0.0E0"};Object.defineProperties(Et,Fv);var uc=function(){},AJe={DP_SAFE_EPSILON:{configurable:!0}};uc.prototype.interfaces_=function(){return[]};uc.prototype.getClass=function(){return uc};uc.orientationIndex=function(e,t,r){var i=uc.orientationIndexFilter(e,t,r);if(i<=1)return i;var a=Et.valueOf(t.x).selfAdd(-e.x),o=Et.valueOf(t.y).selfAdd(-e.y),s=Et.valueOf(r.x).selfAdd(-t.x),l=Et.valueOf(r.y).selfAdd(-t.y);return a.selfMultiply(l).selfSubtract(o.selfMultiply(s)).signum()};uc.signOfDet2x2=function(e,t,r,i){var a=e.multiply(i).selfSubtract(t.multiply(r));return a.signum()};uc.intersection=function(e,t,r,i){var a=Et.valueOf(i.y).selfSubtract(r.y).selfMultiply(Et.valueOf(t.x).selfSubtract(e.x)),o=Et.valueOf(i.x).selfSubtract(r.x).selfMultiply(Et.valueOf(t.y).selfSubtract(e.y)),s=a.subtract(o),l=Et.valueOf(i.x).selfSubtract(r.x).selfMultiply(Et.valueOf(e.y).selfSubtract(r.y)),u=Et.valueOf(i.y).selfSubtract(r.y).selfMultiply(Et.valueOf(e.x).selfSubtract(r.x)),h=l.subtract(u),c=h.selfDivide(s).doubleValue(),f=Et.valueOf(e.x).selfAdd(Et.valueOf(t.x).selfSubtract(e.x).selfMultiply(c)).doubleValue(),d=Et.valueOf(t.x).selfSubtract(e.x).selfMultiply(Et.valueOf(e.y).selfSubtract(r.y)),v=Et.valueOf(t.y).selfSubtract(e.y).selfMultiply(Et.valueOf(e.x).selfSubtract(r.x)),p=d.subtract(v),g=p.selfDivide(s).doubleValue(),m=Et.valueOf(r.y).selfAdd(Et.valueOf(i.y).selfSubtract(r.y).selfMultiply(g)).doubleValue();return new tt(f,m)};uc.orientationIndexFilter=function(e,t,r){var i=null,a=(e.x-r.x)*(t.y-r.y),o=(e.y-r.y)*(t.x-r.x),s=a-o;if(a>0){if(o<=0)return uc.signum(s);i=a+o}else if(a<0){if(o>=0)return uc.signum(s);i=-a-o}else return uc.signum(s);var l=uc.DP_SAFE_EPSILON*i;return s>=l||-s>=l?uc.signum(s):2};uc.signum=function(e){return e>0?1:e<0?-1:0};AJe.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(uc,AJe);var ua=function(){},Jk={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Jk.X.get=function(){return 0};Jk.Y.get=function(){return 1};Jk.Z.get=function(){return 2};Jk.M.get=function(){return 3};ua.prototype.setOrdinate=function(e,t,r){};ua.prototype.size=function(){};ua.prototype.getOrdinate=function(e,t){};ua.prototype.getCoordinate=function(){};ua.prototype.getCoordinateCopy=function(e){};ua.prototype.getDimension=function(){};ua.prototype.getX=function(e){};ua.prototype.clone=function(){};ua.prototype.expandEnvelope=function(e){};ua.prototype.copy=function(){};ua.prototype.getY=function(e){};ua.prototype.toCoordinateArray=function(){};ua.prototype.interfaces_=function(){return[I$]};ua.prototype.getClass=function(){return ua};Object.defineProperties(ua,Jk);var MJe=function(){},gL=function(n){function e(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(MJe),zu=function(){};zu.arraycopy=function(e,t,r,i,a){for(var o=0,s=t;s<t+a;s++)r[i+o]=e[s],o++};zu.getProperty=function(e){return{"line.separator":`
`}[e]};var Sv=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],r=arguments[1];this.x=t,this.y=r,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var i=arguments[0],a=arguments[1];this.x=i.y*a.w-a.y*i.w,this.y=a.x*i.w-i.x*a.w,this.w=i.x*a.y-a.x*i.y}else if(arguments[0]instanceof tt&&arguments[1]instanceof tt){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(arguments.length===3){var l=arguments[0],u=arguments[1],h=arguments[2];this.x=l,this.y=u,this.w=h}else if(arguments.length===4){var c=arguments[0],f=arguments[1],d=arguments[2],v=arguments[3],p=c.y-f.y,g=f.x-c.x,m=c.x*f.y-f.x*c.y,y=d.y-v.y,_=v.x-d.x,x=d.x*v.y-v.x*d.y;this.x=g*x-_*m,this.y=y*m-p*x,this.w=p*_-y*g}};Sv.prototype.getY=function(){var e=this.y/this.w;if(ui.isNaN(e)||ui.isInfinite(e))throw new gL;return e};Sv.prototype.getX=function(){var e=this.x/this.w;if(ui.isNaN(e)||ui.isInfinite(e))throw new gL;return e};Sv.prototype.getCoordinate=function(){var e=new tt;return e.x=this.getX(),e.y=this.getY(),e};Sv.prototype.interfaces_=function(){return[]};Sv.prototype.getClass=function(){return Sv};Sv.intersection=function(e,t,r,i){var a=e.y-t.y,o=t.x-e.x,s=e.x*t.y-t.x*e.y,l=r.y-i.y,u=i.x-r.x,h=r.x*i.y-i.x*r.y,c=o*h-u*s,f=l*s-a*h,d=a*u-l*o,v=c/d,p=f/d;if(ui.isNaN(v)||ui.isInfinite(v)||ui.isNaN(p)||ui.isInfinite(p))throw new gL;return new tt(v,p)};var gn=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof n){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3];this.init(a,o,s,l)}},IJe={serialVersionUID:{configurable:!0}};gn.prototype.getArea=function(){return this.getWidth()*this.getHeight()};gn.prototype.equals=function(e){if(!(e instanceof gn))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()};gn.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new gn;var t=this._minx>e._minx?this._minx:e._minx,r=this._miny>e._miny?this._miny:e._miny,i=this._maxx<e._maxx?this._maxx:e._maxx,a=this._maxy<e._maxy?this._maxy:e._maxy;return new gn(t,i,r,a)};gn.prototype.isNull=function(){return this._maxx<this._minx};gn.prototype.getMaxX=function(){return this._maxx};gn.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];return this.covers(e.x,e.y)}else if(arguments[0]instanceof gn){var t=arguments[0];return this.isNull()||t.isNull()?!1:t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}};gn.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof gn){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}else if(arguments[0]instanceof tt){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}};gn.prototype.getMinY=function(){return this._miny};gn.prototype.getMinX=function(){return this._minx};gn.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof gn){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}};gn.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t};gn.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx};gn.prototype.compareTo=function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0};gn.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)};gn.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};gn.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};gn.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};gn.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t};gn.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};gn.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof gn){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof tt){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.covers(r,i)}};gn.prototype.centre=function(){return this.isNull()?null:new tt((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};gn.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof gn){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3];a<o?(this._minx=a,this._maxx=o):(this._minx=o,this._maxx=a),s<l?(this._miny=s,this._maxy=l):(this._miny=l,this._maxy=s)}};gn.prototype.getMaxY=function(){return this._maxy};gn.prototype.distance=function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var r=0;return this._maxy<e._miny?r=e._miny-this._maxy:this._miny>e._maxy&&(r=this._miny-e._maxy),t===0?r:r===0?t:Math.sqrt(t*t+r*r)};gn.prototype.hashCode=function(){var e=17;return e=37*e+tt.hashCode(this._minx),e=37*e+tt.hashCode(this._maxx),e=37*e+tt.hashCode(this._miny),e=37*e+tt.hashCode(this._maxy),e};gn.prototype.interfaces_=function(){return[$d,Wd]};gn.prototype.getClass=function(){return gn};gn.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2];return r.x>=(e.x<t.x?e.x:t.x)&&r.x<=(e.x>t.x?e.x:t.x)&&r.y>=(e.y<t.y?e.y:t.y)&&r.y<=(e.y>t.y?e.y:t.y)}else if(arguments.length===4){var i=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3],l=Math.min(o.x,s.x),u=Math.max(o.x,s.x),h=Math.min(i.x,a.x),c=Math.max(i.x,a.x);return!(h>u||c<l||(l=Math.min(o.y,s.y),u=Math.max(o.y,s.y),h=Math.min(i.y,a.y),c=Math.max(i.y,a.y),h>u)||c<l)}};IJe.serialVersionUID.get=function(){return 5873921885273102e3};Object.defineProperties(gn,IJe);var ap={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},L$=function(e){this.geometryFactory=e||new Fi};L$.prototype.read=function(e){var t,r,i;e=e.replace(/[\n\r]/g," ");var a=ap.typeStr.exec(e);if(e.search("EMPTY")!==-1&&(a=ap.emptyTypeStr.exec(e),a[2]=void 0),a&&(r=a[1].toLowerCase(),i=a[2],RA[r]&&(t=RA[r].apply(this,[i]))),t===void 0)throw new Error("Could not parse WKT "+e);return t};L$.prototype.write=function(e){return this.extractGeometry(e)};L$.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!wy[t])return null;var r=t.toUpperCase(),i;return e.isEmpty()?i=r+" EMPTY":i=r+"("+wy[t].apply(this,[e])+")",i};var wy={coordinate:function(e){return e.x+" "+e.y},point:function(e){return wy.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=this,r=[],i=0,a=e._geometries.length;i<a;++i)r.push("("+wy.point.apply(t,[e._geometries[i]])+")");return r.join(",")},linestring:function(e){for(var t=this,r=[],i=0,a=e._points._coordinates.length;i<a;++i)r.push(wy.coordinate.apply(t,[e._points._coordinates[i]]));return r.join(",")},linearring:function(e){for(var t=this,r=[],i=0,a=e._points._coordinates.length;i<a;++i)r.push(wy.coordinate.apply(t,[e._points._coordinates[i]]));return r.join(",")},multilinestring:function(e){for(var t=this,r=[],i=0,a=e._geometries.length;i<a;++i)r.push("("+wy.linestring.apply(t,[e._geometries[i]])+")");return r.join(",")},polygon:function(e){var t=this,r=[];r.push("("+wy.linestring.apply(this,[e._shell])+")");for(var i=0,a=e._holes.length;i<a;++i)r.push("("+wy.linestring.apply(t,[e._holes[i]])+")");return r.join(",")},multipolygon:function(e){for(var t=this,r=[],i=0,a=e._geometries.length;i<a;++i)r.push("("+wy.polygon.apply(t,[e._geometries[i]])+")");return r.join(",")},geometrycollection:function(e){for(var t=this,r=[],i=0,a=e._geometries.length;i<a;++i)r.push(t.extractGeometry(e._geometries[i]));return r.join(",")}},RA={point:function(e){if(e===void 0)return this.geometryFactory.createPoint();var t=e.trim().split(ap.spaces);return this.geometryFactory.createPoint(new tt(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPoint();for(var r,i=e.trim().split(","),a=[],o=0,s=i.length;o<s;++o)r=i[o].replace(ap.trimParens,"$1"),a.push(RA.point.apply(t,[r]));return this.geometryFactory.createMultiPoint(a)},linestring:function(e){if(e===void 0)return this.geometryFactory.createLineString();for(var t=e.trim().split(","),r=[],i,a=0,o=t.length;a<o;++a)i=t[a].trim().split(ap.spaces),r.push(new tt(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(e){if(e===void 0)return this.geometryFactory.createLinearRing();for(var t=e.trim().split(","),r=[],i,a=0,o=t.length;a<o;++a)i=t[a].trim().split(ap.spaces),r.push(new tt(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=e.trim().split(ap.parenComma),a=[],o=0,s=i.length;o<s;++o)r=i[o].replace(ap.trimParens,"$1"),a.push(RA.linestring.apply(t,[r]));return this.geometryFactory.createMultiLineString(a)},polygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createPolygon();for(var r,i,a,o=e.trim().split(ap.parenComma),s,l=[],u=0,h=o.length;u<h;++u)r=o[u].replace(ap.trimParens,"$1"),i=RA.linestring.apply(t,[r]),a=t.geometryFactory.createLinearRing(i._points),u===0?s=a:l.push(a);return this.geometryFactory.createPolygon(s,l)},multipolygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=e.trim().split(ap.doubleParenComma),a=[],o=0,s=i.length;o<s;++o)r=i[o].replace(ap.trimParens,"$1"),a.push(RA.polygon.apply(t,[r]));return this.geometryFactory.createMultiPolygon(a)},geometrycollection:function(e){var t=this;if(e===void 0)return this.geometryFactory.createGeometryCollection();e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var r=e.trim().split("|"),i=[],a=0,o=r.length;a<o;++a)i.push(t.read(r[a]));return this.geometryFactory.createGeometryCollection(i)}},Mv=function(e){this.parser=new L$(e)};Mv.prototype.write=function(e){return this.parser.write(e)};Mv.toLineString=function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var xm=function(n){function e(t){n.call(this,t),this.name="RuntimeException",this.message=t,this.stack=new n().stack}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}(Error),$7=function(n){function e(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var t=arguments[0];n.call(this,t)}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(xm),mi=function(){};mi.prototype.interfaces_=function(){return[]};mi.prototype.getClass=function(){return mi};mi.shouldNeverReachHere=function(){if(arguments.length===0)mi.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new $7("Should never reach here"+(e!==null?": "+e:""))}};mi.isTrue=function(){var e,t;if(arguments.length===1)e=arguments[0],mi.isTrue(e,null);else if(arguments.length===2&&(e=arguments[0],t=arguments[1],!e))throw t===null?new $7:new $7(t)};mi.equals=function(){var e,t,r;if(arguments.length===2)e=arguments[0],t=arguments[1],mi.equals(e,t,null);else if(arguments.length===3&&(e=arguments[0],t=arguments[1],r=arguments[2],!t.equals(e)))throw new $7("Expected "+e+" but encountered "+t+(r!==null?": "+r:""))};var Ls=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new tt,this._intPt[1]=new tt,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},ST={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Ls.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]};Ls.prototype.getTopologySummary=function(){var e=new hg;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()};Ls.prototype.computeIntersection=function(e,t,r,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,r,i)};Ls.prototype.getIntersectionNum=function(){return this._result};Ls.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var e=arguments[0],t=this.getEdgeDistance(e,0),r=this.getEdgeDistance(e,1);t>r?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}};Ls.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};Ls.prototype.setPrecisionModel=function(e){this._precisionModel=e};Ls.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],r=0;r<this._result;r++)if(!(e._intPt[r].equals2D(e._inputLines[t][0])||e._intPt[r].equals2D(e._inputLines[t][1])))return!0;return!1}};Ls.prototype.getIntersection=function(e){return this._intPt[e]};Ls.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};Ls.prototype.hasIntersection=function(){return this._result!==Ls.NO_INTERSECTION};Ls.prototype.getEdgeDistance=function(e,t){var r=Ls.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1]);return r};Ls.prototype.isCollinear=function(){return this._result===Ls.COLLINEAR_INTERSECTION};Ls.prototype.toString=function(){return Mv.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Mv.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()};Ls.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]};Ls.prototype.isIntersection=function(e){for(var t=this,r=0;r<this._result;r++)if(t._intPt[r].equals2D(e))return!0;return!1};Ls.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]};Ls.prototype.interfaces_=function(){return[]};Ls.prototype.getClass=function(){return Ls};Ls.computeEdgeDistance=function(e,t,r){var i=Math.abs(r.x-t.x),a=Math.abs(r.y-t.y),o=-1;if(e.equals(t))o=0;else if(e.equals(r))i>a?o=i:o=a;else{var s=Math.abs(e.x-t.x),l=Math.abs(e.y-t.y);i>a?o=s:o=l,o===0&&!e.equals(t)&&(o=Math.max(s,l))}return mi.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o};Ls.nonRobustComputeEdgeDistance=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=Math.sqrt(i*i+a*a);return mi.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o};ST.DONT_INTERSECT.get=function(){return 0};ST.DO_INTERSECT.get=function(){return 1};ST.COLLINEAR.get=function(){return 2};ST.NO_INTERSECTION.get=function(){return 0};ST.POINT_INTERSECTION.get=function(){return 1};ST.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(Ls,ST);var Ow=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(r){var i=new gn(this._inputLines[0][0],this._inputLines[0][1]),a=new gn(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&a.contains(r)},e.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];if(this._isProper=!1,gn.intersects(i,a,r)&&Gr.orientationIndex(i,a,r)===0&&Gr.orientationIndex(a,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(a))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(r,i,a,o,s){s.x=this.smallestInAbsValue(r.x,i.x,a.x,o.x),s.y=this.smallestInAbsValue(r.y,i.y,a.y,o.y),r.x-=s.x,r.y-=s.y,i.x-=s.x,i.y-=s.y,a.x-=s.x,a.y-=s.y,o.x-=s.x,o.y-=s.y},e.prototype.safeHCoordinateIntersection=function(r,i,a,o){var s=null;try{s=Sv.intersection(r,i,a,o)}catch(l){if(l instanceof gL)s=e.nearestEndpoint(r,i,a,o);else throw l}finally{}return s},e.prototype.intersection=function(r,i,a,o){var s=this.intersectionWithNormalization(r,i,a,o);return this.isInSegmentEnvelopes(s)||(s=new tt(e.nearestEndpoint(r,i,a,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(s),s},e.prototype.smallestInAbsValue=function(r,i,a,o){var s=r,l=Math.abs(s);return Math.abs(i)<l&&(s=i,l=Math.abs(i)),Math.abs(a)<l&&(s=a,l=Math.abs(a)),Math.abs(o)<l&&(s=o),s},e.prototype.checkDD=function(r,i,a,o,s){var l=uc.intersection(r,i,a,o),u=this.isInSegmentEnvelopes(l);zu.out.println("DD in env = "+u+" --------------------- "+l),s.distance(l)>1e-4&&zu.out.println("Distance = "+s.distance(l))},e.prototype.intersectionWithNormalization=function(r,i,a,o){var s=new tt(r),l=new tt(i),u=new tt(a),h=new tt(o),c=new tt;this.normalizeToEnvCentre(s,l,u,h,c);var f=this.safeHCoordinateIntersection(s,l,u,h);return f.x+=c.x,f.y+=c.y,f},e.prototype.computeCollinearIntersection=function(r,i,a,o){var s=gn.intersects(r,i,a),l=gn.intersects(r,i,o),u=gn.intersects(a,o,r),h=gn.intersects(a,o,i);return s&&l?(this._intPt[0]=a,this._intPt[1]=o,n.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=a,this._intPt[1]=r,a.equals(r)&&!l&&!h?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):s&&h?(this._intPt[0]=a,this._intPt[1]=i,a.equals(i)&&!l&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):l&&u?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!s&&!h?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!s&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(r,i,a,o,s){var l=r.x<i.x?r.x:i.x,u=r.y<i.y?r.y:i.y,h=r.x>i.x?r.x:i.x,c=r.y>i.y?r.y:i.y,f=a.x<o.x?a.x:o.x,d=a.y<o.y?a.y:o.y,v=a.x>o.x?a.x:o.x,p=a.y>o.y?a.y:o.y,g=l>f?l:f,m=h<v?h:v,y=u>d?u:d,_=c<p?c:p,x=(g+m)/2,S=(y+_)/2;s.x=x,s.y=S,r.x-=s.x,r.y-=s.y,i.x-=s.x,i.y-=s.y,a.x-=s.x,a.y-=s.y,o.x-=s.x,o.y-=s.y},e.prototype.computeIntersect=function(r,i,a,o){if(this._isProper=!1,!gn.intersects(r,i,a,o))return n.NO_INTERSECTION;var s=Gr.orientationIndex(r,i,a),l=Gr.orientationIndex(r,i,o);if(s>0&&l>0||s<0&&l<0)return n.NO_INTERSECTION;var u=Gr.orientationIndex(a,o,r),h=Gr.orientationIndex(a,o,i);if(u>0&&h>0||u<0&&h<0)return n.NO_INTERSECTION;var c=s===0&&l===0&&u===0&&h===0;return c?this.computeCollinearIntersection(r,i,a,o):(s===0||l===0||u===0||h===0?(this._isProper=!1,r.equals2D(a)||r.equals2D(o)?this._intPt[0]=r:i.equals2D(a)||i.equals2D(o)?this._intPt[0]=i:s===0?this._intPt[0]=new tt(a):l===0?this._intPt[0]=new tt(o):u===0?this._intPt[0]=new tt(r):h===0&&(this._intPt[0]=new tt(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,a,o)),n.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(r,i,a,o){var s=r,l=Gr.distancePointLine(r,a,o),u=Gr.distancePointLine(i,a,o);return u<l&&(l=u,s=i),u=Gr.distancePointLine(a,r,i),u<l&&(l=u,s=a),u=Gr.distancePointLine(o,r,i),u<l&&(l=u,s=o),s},e}(Ls),I2=function(){};I2.prototype.interfaces_=function(){return[]};I2.prototype.getClass=function(){return I2};I2.orientationIndex=function(e,t,r){var i=t.x-e.x,a=t.y-e.y,o=r.x-t.x,s=r.y-t.y;return I2.signOfDet2x2(i,a,o,s)};I2.signOfDet2x2=function(e,t,r,i){var a=null,o=null,s=null;if(a=1,e===0||i===0)return t===0||r===0?0:t>0?r>0?-a:a:r>0?a:-a;if(t===0||r===0)return i>0?e>0?a:-a:e>0?-a:a;if(t>0?i>0?t<=i||(a=-a,o=e,e=r,r=o,o=t,t=i,i=o):t<=-i?(a=-a,r=-r,i=-i):(o=e,e=-r,r=o,o=t,t=-i,i=o):i>0?-t<=i?(a=-a,e=-e,t=-t):(o=-e,e=r,r=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,r=-r,i=-i):(a=-a,o=-e,e=-r,r=o,o=-t,t=-i,i=o),e>0)if(r>0){if(!(e<=r))return a}else return a;else{if(r>0)return-a;if(e>=r)a=-a,e=-e,r=-r;else return-a}for(;;){if(s=Math.floor(r/e),r=r-s*e,i=i-s*t,i<0)return-a;if(i>t)return a;if(e>r+r){if(t<i+i)return a}else{if(t>i+i)return-a;r=e-r,i=t-i,a=-a}if(i===0)return r===0?0:-a;if(r===0||(s=Math.floor(e/r),e=e-s*r,t=t-s*i,t<0))return a;if(t>i)return-a;if(r>e+e){if(i<t+t)return-a}else{if(i>t+t)return a;e=r-e,t=i-t,a=-a}if(t===0)return e===0?0:a;if(e===0)return-a}};var Gp=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};Gp.prototype.countSegment=function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var r=e.x,i=t.x;return r>i&&(r=t.x,i=e.x),this._p.x>=r&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var a=e.x-this._p.x,o=e.y-this._p.y,s=t.x-this._p.x,l=t.y-this._p.y,u=I2.signOfDet2x2(a,o,s,l);if(u===0)return this._isPointOnSegment=!0,null;l<o&&(u=-u),u>0&&this._crossingCount++}};Gp.prototype.isPointInPolygon=function(){return this.getLocation()!==dt.EXTERIOR};Gp.prototype.getLocation=function(){return this._isPointOnSegment?dt.BOUNDARY:this._crossingCount%2===1?dt.INTERIOR:dt.EXTERIOR};Gp.prototype.isOnSegment=function(){return this._isPointOnSegment};Gp.prototype.interfaces_=function(){return[]};Gp.prototype.getClass=function(){return Gp};Gp.locatePointInRing=function(){if(arguments[0]instanceof tt&&zn(arguments[1],ua)){for(var e=arguments[0],t=arguments[1],r=new Gp(e),i=new tt,a=new tt,o=1;o<t.size();o++)if(t.getCoordinate(o,i),t.getCoordinate(o-1,a),r.countSegment(i,a),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof tt&&arguments[1]instanceof Array){for(var s=arguments[0],l=arguments[1],u=new Gp(s),h=1;h<l.length;h++){var c=l[h],f=l[h-1];if(u.countSegment(c,f),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var Gr=function(){},wT={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Gr.prototype.interfaces_=function(){return[]};Gr.prototype.getClass=function(){return Gr};Gr.orientationIndex=function(e,t,r){return uc.orientationIndex(e,t,r)};Gr.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,r=e[0].x,i=1;i<e.length-1;i++){var a=e[i].x-r,o=e[i+1].y,s=e[i-1].y;t+=a*(s-o)}return t/2}else if(zn(arguments[0],ua)){var l=arguments[0],u=l.size();if(u<3)return 0;var h=new tt,c=new tt,f=new tt;l.getCoordinate(0,c),l.getCoordinate(1,f);var d=c.x;f.x-=d;for(var v=0,p=1;p<u-1;p++)h.y=c.y,c.x=f.x,c.y=f.y,l.getCoordinate(p+1,f),f.x-=d,v+=c.x*(h.y-f.y);return v/2}};Gr.distanceLineLine=function(e,t,r,i){if(e.equals(t))return Gr.distancePointLine(e,r,i);if(r.equals(i))return Gr.distancePointLine(i,e,t);var a=!1;if(!gn.intersects(e,t,r,i))a=!0;else{var o=(t.x-e.x)*(i.y-r.y)-(t.y-e.y)*(i.x-r.x);if(o===0)a=!0;else{var s=(e.y-r.y)*(i.x-r.x)-(e.x-r.x)*(i.y-r.y),l=(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y),u=l/o,h=s/o;(h<0||h>1||u<0||u>1)&&(a=!0)}}return a?Uf.min(Gr.distancePointLine(e,r,i),Gr.distancePointLine(t,r,i),Gr.distancePointLine(r,e,t),Gr.distancePointLine(i,e,t)):0};Gr.isPointInRing=function(e,t){return Gr.locatePointInRing(e,t)!==dt.EXTERIOR};Gr.computeLength=function(e){var t=e.size();if(t<=1)return 0;var r=0,i=new tt;e.getCoordinate(0,i);for(var a=i.x,o=i.y,s=1;s<t;s++){e.getCoordinate(s,i);var l=i.x,u=i.y,h=l-a,c=u-o;r+=Math.sqrt(h*h+c*c),a=l,o=u}return r};Gr.isCCW=function(e){var t=e.length-1;if(t<3)throw new Ss("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=e[0],i=0,a=1;a<=t;a++){var o=e[a];o.y>r.y&&(r=o,i=a)}var s=i;do s=s-1,s<0&&(s=t);while(e[s].equals2D(r)&&s!==i);var l=i;do l=(l+1)%t;while(e[l].equals2D(r)&&l!==i);var u=e[s],h=e[l];if(u.equals2D(r)||h.equals2D(r)||u.equals2D(h))return!1;var c=Gr.computeOrientation(u,r,h),f=!1;return c===0?f=u.x>h.x:f=c>0,f};Gr.locatePointInRing=function(e,t){return Gp.locatePointInRing(e,t)};Gr.distancePointLinePerpendicular=function(e,t,r){var i=(r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y),a=((t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y))/i;return Math.abs(a)*Math.sqrt(i)};Gr.computeOrientation=function(e,t,r){return Gr.orientationIndex(e,t,r)};Gr.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Ss("Line array must contain at least one vertex");for(var r=e.distance(t[0]),i=0;i<t.length-1;i++){var a=Gr.distancePointLine(e,t[i],t[i+1]);a<r&&(r=a)}return r}else if(arguments.length===3){var o=arguments[0],s=arguments[1],l=arguments[2];if(s.x===l.x&&s.y===l.y)return o.distance(s);var u=(l.x-s.x)*(l.x-s.x)+(l.y-s.y)*(l.y-s.y),h=((o.x-s.x)*(l.x-s.x)+(o.y-s.y)*(l.y-s.y))/u;if(h<=0)return o.distance(s);if(h>=1)return o.distance(l);var c=((s.y-o.y)*(l.x-s.x)-(s.x-o.x)*(l.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}};Gr.isOnLine=function(e,t){for(var r=new Ow,i=1;i<t.length;i++){var a=t[i-1],o=t[i];if(r.computeIntersection(e,a,o),r.hasIntersection())return!0}return!1};wT.CLOCKWISE.get=function(){return-1};wT.RIGHT.get=function(){return Gr.CLOCKWISE};wT.COUNTERCLOCKWISE.get=function(){return 1};wT.LEFT.get=function(){return Gr.COUNTERCLOCKWISE};wT.COLLINEAR.get=function(){return 0};wT.STRAIGHT.get=function(){return Gr.COLLINEAR};Object.defineProperties(Gr,wT);var Sm=function(){};Sm.prototype.filter=function(e){};Sm.prototype.interfaces_=function(){return[]};Sm.prototype.getClass=function(){return Sm};var Gn=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},j0={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Gn.prototype.isGeometryCollection=function(){return this.getSortIndex()===Gn.SORTINDEX_GEOMETRYCOLLECTION};Gn.prototype.getFactory=function(){return this._factory};Gn.prototype.getGeometryN=function(e){return this};Gn.prototype.getArea=function(){return 0};Gn.prototype.isRectangle=function(){return!1};Gn.prototype.equals=function(){if(arguments[0]instanceof Gn){var e=arguments[0];return e===null?!1:this.equalsTopo(e)}else if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof Gn))return!1;var r=t;return this.equalsExact(r)}};Gn.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)};Gn.prototype.geometryChanged=function(){this.apply(Gn.geometryChangedFilter)};Gn.prototype.geometryChangedAction=function(){this._envelope=null};Gn.prototype.equalsNorm=function(e){return e===null?!1:this.norm().equalsExact(e.norm())};Gn.prototype.getLength=function(){return 0};Gn.prototype.getNumGeometries=function(){return 1};Gn.prototype.compareTo=function(){if(arguments.length===1){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}};Gn.prototype.getUserData=function(){return this._userData};Gn.prototype.getSRID=function(){return this._SRID};Gn.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};Gn.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===Gn.SORTINDEX_GEOMETRYCOLLECTION)throw new Ss("This method does not support GeometryCollection arguments")};Gn.prototype.equal=function(e,t,r){return r===0?e.equals(t):e.distance(t)<=r};Gn.prototype.norm=function(){var e=this.copy();return e.normalize(),e};Gn.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()};Gn.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new gn(this._envelope)};Gn.prototype.setSRID=function(e){this._SRID=e};Gn.prototype.setUserData=function(e){this._userData=e};Gn.prototype.compare=function(e,t){for(var r=e.iterator(),i=t.iterator();r.hasNext()&&i.hasNext();){var a=r.next(),o=i.next(),s=a.compareTo(o);if(s!==0)return s}return r.hasNext()?1:i.hasNext()?-1:0};Gn.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()};Gn.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Gn.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Gn.SORTINDEX_MULTIPOINT||this.getSortIndex()===Gn.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Gn.SORTINDEX_MULTIPOLYGON};Gn.prototype.interfaces_=function(){return[I$,$d,Wd]};Gn.prototype.getClass=function(){return Gn};Gn.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1};Gn.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1};j0.serialVersionUID.get=function(){return 8763622679187377e3};j0.SORTINDEX_POINT.get=function(){return 0};j0.SORTINDEX_MULTIPOINT.get=function(){return 1};j0.SORTINDEX_LINESTRING.get=function(){return 2};j0.SORTINDEX_LINEARRING.get=function(){return 3};j0.SORTINDEX_MULTILINESTRING.get=function(){return 4};j0.SORTINDEX_POLYGON.get=function(){return 5};j0.SORTINDEX_MULTIPOLYGON.get=function(){return 6};j0.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7};j0.geometryChangedFilter.get=function(){return xce};Object.defineProperties(Gn,j0);var xce=function(){};xce.interfaces_=function(){return[Sm]};xce.filter=function(e){e.geometryChangedAction()};var w0=function(){};w0.prototype.filter=function(e){};w0.prototype.interfaces_=function(){return[]};w0.prototype.getClass=function(){return w0};var Od=function(){},zm={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Od.prototype.isInBoundary=function(e){};Od.prototype.interfaces_=function(){return[]};Od.prototype.getClass=function(){return Od};zm.Mod2BoundaryNodeRule.get=function(){return rI};zm.EndPointBoundaryNodeRule.get=function(){return nI};zm.MultiValentEndPointBoundaryNodeRule.get=function(){return iI};zm.MonoValentEndPointBoundaryNodeRule.get=function(){return aI};zm.MOD2_BOUNDARY_RULE.get=function(){return new rI};zm.ENDPOINT_BOUNDARY_RULE.get=function(){return new nI};zm.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new iI};zm.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new aI};zm.OGC_SFS_BOUNDARY_RULE.get=function(){return Od.MOD2_BOUNDARY_RULE};Object.defineProperties(Od,zm);var rI=function(){};rI.prototype.isInBoundary=function(e){return e%2===1};rI.prototype.interfaces_=function(){return[Od]};rI.prototype.getClass=function(){return rI};var nI=function(){};nI.prototype.isInBoundary=function(e){return e>0};nI.prototype.interfaces_=function(){return[Od]};nI.prototype.getClass=function(){return nI};var iI=function(){};iI.prototype.isInBoundary=function(e){return e>1};iI.prototype.interfaces_=function(){return[Od]};iI.prototype.getClass=function(){return iI};var aI=function(){};aI.prototype.isInBoundary=function(e){return e===1};aI.prototype.interfaces_=function(){return[Od]};aI.prototype.getClass=function(){return aI};var Al=function(){};Al.prototype.add=function(){};Al.prototype.addAll=function(){};Al.prototype.isEmpty=function(){};Al.prototype.iterator=function(){};Al.prototype.size=function(){};Al.prototype.toArray=function(){};Al.prototype.remove=function(){};function Sce(n){this.message=n||""}Sce.prototype=new Error;Sce.prototype.name="IndexOutOfBoundsException";var yL=function(){};yL.prototype.hasNext=function(){};yL.prototype.next=function(){};yL.prototype.remove=function(){};var wv=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Al);function mL(n){this.message=n||""}mL.prototype=new Error;mL.prototype.name="NoSuchElementException";var Pr=function(n){function e(){n.call(this),this.array_=[],arguments[0]instanceof Al&&this.addAll(arguments[0])}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[n,Al]},e.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(r){for(var i=this,a=r.iterator();a.hasNext();)i.add(a.next());return!0},e.prototype.set=function(r,i){var a=this.array_[r];return this.array_[r]=i,a},e.prototype.iterator=function(){return new Rzr(this)},e.prototype.get=function(r){if(r<0||r>=this.size())throw new Sce;return this.array_[r]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var r=this,i=[],a=0,o=this.array_.length;a<o;a++)i.push(r.array_[a]);return i},e.prototype.remove=function(r){for(var i=this,a=!1,o=0,s=this.array_.length;o<s;o++)if(i.array_[o]===r){i.array_.splice(o,1),a=!0;break}return a},e}(wv),Rzr=function(n){function e(t){n.call(this),this.arrayList_=t,this.position_=0}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new mL;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(yL),Qk=function(n){function e(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],a=arguments[1];this.ensureCapacity(i.length),this.add(i,a)}}}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={coordArrayType:{configurable:!0}};return t.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(i){return this.get(i)},e.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var a=arguments[0],o=arguments[1],s=!1,l=a.iterator();l.hasNext();)i.add(l.next(),o),s=!0;return s}else return n.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var i=this,a=n.prototype.clone.call(this),o=0;o<this.size();o++)a.add(o,i.get(o).copy());return a},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var i=this;if(arguments.length===1){var a=arguments[0];n.prototype.add.call(this,a)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],s=arguments[1];return this.add(o,s,!0),!0}else if(arguments[0]instanceof tt&&typeof arguments[1]=="boolean"){var l=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(l))return null}n.prototype.add.call(this,l)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],f=arguments[1];return this.add(c,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var d=arguments[0],v=arguments[1],p=arguments[2];if(p)for(var g=0;g<d.length;g++)i.add(d[g],v);else for(var m=d.length-1;m>=0;m--)i.add(d[m],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof tt){var y=arguments[0],_=arguments[1],x=arguments[2];if(!x){var S=this.size();if(S>0){if(y>0){var w=this.get(y-1);if(w.equals2D(_))return null}if(y<S){var b=this.get(y);if(b.equals2D(_))return null}}}n.prototype.add.call(this,y,_)}}else if(arguments.length===4){var E=arguments[0],T=arguments[1],C=arguments[2],A=arguments[3],M=1;C>A&&(M=-1);for(var I=C;I!==A;I+=M)i.add(E[I],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new tt(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(Pr),Bi=function(){},P$={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};P$.ForwardComparator.get=function(){return RN};P$.BidirectionalComparator.get=function(){return oI};P$.coordArrayType.get=function(){return new Array(0).fill(null)};Bi.prototype.interfaces_=function(){return[]};Bi.prototype.getClass=function(){return Bi};Bi.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))};Bi.ptNotInList=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(Bi.indexOf(i,t)<0)return i}return null};Bi.scroll=function(e,t){var r=Bi.indexOf(t,e);if(r<0)return null;var i=new Array(e.length).fill(null);zu.arraycopy(e,r,i,0,e.length-r),zu.arraycopy(e,0,i,e.length-r,r),zu.arraycopy(i,0,e,0,e.length)};Bi.equals=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!e[r].equals(t[r]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2];if(i===a)return!0;if(i===null||a===null||i.length!==a.length)return!1;for(var s=0;s<i.length;s++)if(o.compare(i[s],a[s])!==0)return!1;return!0}};Bi.intersection=function(e,t){for(var r=new Qk,i=0;i<e.length;i++)t.intersects(e[i])&&r.add(e[i],!0);return r.toCoordinateArray()};Bi.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1};Bi.removeRepeatedPoints=function(e){if(!Bi.hasRepeatedPoints(e))return e;var t=new Qk(e,!1);return t.toCoordinateArray()};Bi.reverse=function(e){for(var t=e.length-1,r=Math.trunc(t/2),i=0;i<=r;i++){var a=e[i];e[i]=e[t-i],e[t-i]=a}};Bi.removeNull=function(e){for(var t=0,r=0;r<e.length;r++)e[r]!==null&&t++;var i=new Array(t).fill(null);if(t===0)return i;for(var a=0,o=0;o<e.length;o++)e[o]!==null&&(i[a++]=e[o]);return i};Bi.copyDeep=function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),r=0;r<e.length;r++)t[r]=new tt(e[r]);return t}else if(arguments.length===5)for(var i=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3],l=arguments[4],u=0;u<l;u++)o[s+u]=new tt(i[a+u])};Bi.isEqualReversed=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=t[e.length-r-1];if(i.compareTo(a)!==0)return!1}return!0};Bi.envelope=function(e){for(var t=new gn,r=0;r<e.length;r++)t.expandToInclude(e[r]);return t};Bi.toCoordinateArray=function(e){return e.toArray(Bi.coordArrayType)};Bi.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]};Bi.indexOf=function(e,t){for(var r=0;r<t.length;r++)if(e.equals(t[r]))return r;return-1};Bi.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var r=e.length-1-t,i=e[t].compareTo(e[r]);if(i!==0)return i}return 1};Bi.compare=function(e,t){for(var r=0;r<e.length&&r<t.length;){var i=e[r].compareTo(t[r]);if(i!==0)return i;r++}return r<t.length?-1:r<e.length?1:0};Bi.minCoordinate=function(e){for(var t=null,r=0;r<e.length;r++)(t===null||t.compareTo(e[r])>0)&&(t=e[r]);return t};Bi.extract=function(e,t,r){t=Uf.clamp(t,0,e.length),r=Uf.clamp(r,-1,e.length);var i=r-t+1;r<0&&(i=0),t>=e.length&&(i=0),r<t&&(i=0);var a=new Array(i).fill(null);if(i===0)return a;for(var o=0,s=t;s<=r;s++)a[o++]=e[s];return a};Object.defineProperties(Bi,P$);var RN=function(){};RN.prototype.compare=function(e,t){var r=e,i=t;return Bi.compare(r,i)};RN.prototype.interfaces_=function(){return[eI]};RN.prototype.getClass=function(){return RN};var oI=function(){};oI.prototype.compare=function(e,t){var r=e,i=t;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var a=Bi.compare(r,i),o=Bi.isEqualReversed(r,i);return o?0:a};oI.prototype.OLDcompare=function(e,t){var r=e,i=t;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var a=Bi.increasingDirection(r),o=Bi.increasingDirection(i),s=a>0?0:r.length-1,l=o>0?0:r.length-1,u=0;u<r.length;u++){var h=r[s].compareTo(i[l]);if(h!==0)return h;s+=a,l+=o}return 0};oI.prototype.interfaces_=function(){return[eI]};oI.prototype.getClass=function(){return oI};var bT=function(){};bT.prototype.get=function(){};bT.prototype.put=function(){};bT.prototype.size=function(){};bT.prototype.values=function(){};bT.prototype.entrySet=function(){};var Dzr=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}(bT);function eF(n){this.message=n||""}eF.prototype=new Error;eF.prototype.name="OperationNotSupported";function O$(){}O$.prototype=new Al;O$.prototype.contains=function(){};var wce=function(n){function e(){n.call(this),this.array_=[],arguments[0]instanceof Al&&this.addAll(arguments[0])}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.contains=function(r){for(var i=this,a=0,o=this.array_.length;a<o;a++){var s=i.array_[a];if(s===r)return!0}return!1},e.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},e.prototype.addAll=function(r){for(var i=this,a=r.iterator();a.hasNext();)i.add(a.next());return!0},e.prototype.remove=function(r){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var r=this,i=[],a=0,o=this.array_.length;a<o;a++)i.push(r.array_[a]);return i},e.prototype.iterator=function(){return new Nzr(this)},e}(O$),Nzr=function(n){function e(t){n.call(this),this.hashSet_=t,this.position_=0}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new mL;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new eF},e}(yL),Ty=0,bx=1;function ALe(n){return n===null?Ty:n.color}function Bo(n){return n===null?null:n.parent}function fy(n,e){n!==null&&(n.color=e)}function AZ(n){return n===null?null:n.left}function MLe(n){return n===null?null:n.right}function dh(){this.root_=null,this.size_=0}dh.prototype=new Dzr;dh.prototype.get=function(n){for(var e=this.root_;e!==null;){var t=n.compareTo(e.key);if(t<0)e=e.left;else if(t>0)e=e.right;else return e.value}return null};dh.prototype.put=function(n,e){if(this.root_===null)return this.root_={key:n,value:e,left:null,right:null,parent:null,color:Ty,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,r,i;do if(r=t,i=n.compareTo(t.key),i<0)t=t.left;else if(i>0)t=t.right;else{var a=t.value;return t.value=e,a}while(t!==null);var o={key:n,left:null,right:null,value:e,parent:r,color:Ty,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=o:r.right=o,this.fixAfterInsertion(o),this.size_++,null};dh.prototype.fixAfterInsertion=function(n){var e=this;for(n.color=bx;n!=null&&n!==this.root_&&n.parent.color===bx;)if(Bo(n)===AZ(Bo(Bo(n)))){var t=MLe(Bo(Bo(n)));ALe(t)===bx?(fy(Bo(n),Ty),fy(t,Ty),fy(Bo(Bo(n)),bx),n=Bo(Bo(n))):(n===MLe(Bo(n))&&(n=Bo(n),e.rotateLeft(n)),fy(Bo(n),Ty),fy(Bo(Bo(n)),bx),e.rotateRight(Bo(Bo(n))))}else{var r=AZ(Bo(Bo(n)));ALe(r)===bx?(fy(Bo(n),Ty),fy(r,Ty),fy(Bo(Bo(n)),bx),n=Bo(Bo(n))):(n===AZ(Bo(n))&&(n=Bo(n),e.rotateRight(n)),fy(Bo(n),Ty),fy(Bo(Bo(n)),bx),e.rotateLeft(Bo(Bo(n))))}this.root_.color=Ty};dh.prototype.values=function(){var n=new Pr,e=this.getFirstEntry();if(e!==null)for(n.add(e.value);(e=dh.successor(e))!==null;)n.add(e.value);return n};dh.prototype.entrySet=function(){var n=new wce,e=this.getFirstEntry();if(e!==null)for(n.add(e);(e=dh.successor(e))!==null;)n.add(e);return n};dh.prototype.rotateLeft=function(n){if(n!=null){var e=n.right;n.right=e.left,e.left!=null&&(e.left.parent=n),e.parent=n.parent,n.parent===null?this.root_=e:n.parent.left===n?n.parent.left=e:n.parent.right=e,e.left=n,n.parent=e}};dh.prototype.rotateRight=function(n){if(n!=null){var e=n.left;n.left=e.right,e.right!=null&&(e.right.parent=n),e.parent=n.parent,n.parent===null?this.root_=e:n.parent.right===n?n.parent.right=e:n.parent.left=e,e.right=n,n.parent=e}};dh.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n};dh.successor=function(n){if(n===null)return null;if(n.right!==null){for(var e=n.right;e.left!==null;)e=e.left;return e}else{for(var t=n.parent,r=n;t!==null&&r===t.right;)r=t,t=t.parent;return t}};dh.prototype.size=function(){return this.size_};var DN=function(){};DN.prototype.interfaces_=function(){return[]};DN.prototype.getClass=function(){return DN};function LJe(){}LJe.prototype=new O$;function Xp(){this.array_=[],arguments[0]instanceof Al&&this.addAll(arguments[0])}Xp.prototype=new LJe;Xp.prototype.contains=function(n){for(var e=this,t=0,r=this.array_.length;t<r;t++){var i=e.array_[t];if(i.compareTo(n)===0)return!0}return!1};Xp.prototype.add=function(n){var e=this;if(this.contains(n))return!1;for(var t=0,r=this.array_.length;t<r;t++){var i=e.array_[t];if(i.compareTo(n)===1)return e.array_.splice(t,0,n),!0}return this.array_.push(n),!0};Xp.prototype.addAll=function(n){for(var e=this,t=n.iterator();t.hasNext();)e.add(t.next());return!0};Xp.prototype.remove=function(n){throw new eF};Xp.prototype.size=function(){return this.array_.length};Xp.prototype.isEmpty=function(){return this.array_.length===0};Xp.prototype.toArray=function(){for(var n=this,e=[],t=0,r=this.array_.length;t<r;t++)e.push(n.array_[t]);return e};Xp.prototype.iterator=function(){return new R$(this)};var R$=function(n){this.treeSet_=n,this.position_=0};R$.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new mL;return this.treeSet_.array_[this.position_++]};R$.prototype.hasNext=function(){return this.position_<this.treeSet_.size()};R$.prototype.remove=function(){throw new eF};var IS=function(){};IS.sort=function(){var e=arguments[0],t,r,i,a;if(arguments.length===1)a=function(s,l){return s.compareTo(l)},e.sort(a);else if(arguments.length===2)i=arguments[1],a=function(s,l){return i.compare(s,l)},e.sort(a);else if(arguments.length===3){r=e.slice(arguments[1],arguments[2]),r.sort();var o=e.slice(0,arguments[1]).concat(r,e.slice(arguments[2],e.length));for(e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])}else if(arguments.length===4)for(r=e.slice(arguments[1],arguments[2]),i=arguments[3],a=function(s,l){return i.compare(s,l)},r.sort(a),o=e.slice(0,arguments[1]).concat(r,e.slice(arguments[2],e.length)),e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])};IS.asList=function(e){for(var t=new Pr,r=0,i=e.length;r<i;r++)t.add(e[r]);return t};var Ja=function(){},Bv={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Bv.P.get=function(){return 0};Bv.L.get=function(){return 1};Bv.A.get=function(){return 2};Bv.FALSE.get=function(){return-1};Bv.TRUE.get=function(){return-2};Bv.DONTCARE.get=function(){return-3};Bv.SYM_FALSE.get=function(){return"F"};Bv.SYM_TRUE.get=function(){return"T"};Bv.SYM_DONTCARE.get=function(){return"*"};Bv.SYM_P.get=function(){return"0"};Bv.SYM_L.get=function(){return"1"};Bv.SYM_A.get=function(){return"2"};Ja.prototype.interfaces_=function(){return[]};Ja.prototype.getClass=function(){return Ja};Ja.toDimensionSymbol=function(e){switch(e){case Ja.FALSE:return Ja.SYM_FALSE;case Ja.TRUE:return Ja.SYM_TRUE;case Ja.DONTCARE:return Ja.SYM_DONTCARE;case Ja.P:return Ja.SYM_P;case Ja.L:return Ja.SYM_L;case Ja.A:return Ja.SYM_A}throw new Ss("Unknown dimension value: "+e)};Ja.toDimensionValue=function(e){switch(ON.toUpperCase(e)){case Ja.SYM_FALSE:return Ja.FALSE;case Ja.SYM_TRUE:return Ja.TRUE;case Ja.SYM_DONTCARE:return Ja.DONTCARE;case Ja.SYM_P:return Ja.P;case Ja.SYM_L:return Ja.L;case Ja.SYM_A:return Ja.A}throw new Ss("Unknown dimension symbol: "+e)};Object.defineProperties(Ja,Bv);var Yp=function(){};Yp.prototype.filter=function(e){};Yp.prototype.interfaces_=function(){return[]};Yp.prototype.getClass=function(){return Yp};var Iv=function(){};Iv.prototype.filter=function(e,t){};Iv.prototype.isDone=function(){};Iv.prototype.isGeometryChanged=function(){};Iv.prototype.interfaces_=function(){return[]};Iv.prototype.getClass=function(){return Iv};var Yh=function(n){function e(r,i){if(n.call(this,i),this._geometries=r||[],n.hasNullElements(this._geometries))throw new Ss("geometries must not contain null elements")}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var i=this,a=new gn,o=0;o<this._geometries.length;o++)a.expandToInclude(i._geometries[o].getEnvelopeInternal());return a},e.prototype.getGeometryN=function(i){return this._geometries[i]},e.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var i=this,a=new Array(this.getNumPoints()).fill(null),o=-1,s=0;s<this._geometries.length;s++)for(var l=i._geometries[s].getCoordinates(),u=0;u<l.length;u++)o++,a[o]=l[u];return a},e.prototype.getArea=function(){for(var i=this,a=0,o=0;o<this._geometries.length;o++)a+=i._geometries[o].getArea();return a},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var a=arguments[0],o=arguments[1];if(!this.isEquivalentClass(a))return!1;var s=a;if(this._geometries.length!==s._geometries.length)return!1;for(var l=0;l<this._geometries.length;l++)if(!i._geometries[l].equalsExact(s._geometries[l],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,a=0;a<this._geometries.length;a++)i._geometries[a].normalize();IS.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var i=this,a=Ja.FALSE,o=0;o<this._geometries.length;o++)a=Math.max(a,i._geometries[o].getBoundaryDimension());return a},e.prototype.getDimension=function(){for(var i=this,a=Ja.FALSE,o=0;o<this._geometries.length;o++)a=Math.max(a,i._geometries[o].getDimension());return a},e.prototype.getLength=function(){for(var i=this,a=0,o=0;o<this._geometries.length;o++)a+=i._geometries[o].getLength();return a},e.prototype.getNumPoints=function(){for(var i=this,a=0,o=0;o<this._geometries.length;o++)a+=i._geometries[o].getNumPoints();return a},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var i=this,a=this._geometries.length,o=new Array(a).fill(null),s=0;s<this._geometries.length;s++)o[s]=i._geometries[s].reverse();return this.getFactory().createGeometryCollection(o)},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var a=arguments[0],o=new Xp(IS.asList(this._geometries)),s=new Xp(IS.asList(a._geometries));return this.compare(o,s)}else if(arguments.length===2){for(var l=arguments[0],u=arguments[1],h=l,c=this.getNumGeometries(),f=h.getNumGeometries(),d=0;d<c&&d<f;){var v=i.getGeometryN(d),p=h.getGeometryN(d),g=v.compareToSameClass(p,u);if(g!==0)return g;d++}return d<c?1:d<f?-1:0}},e.prototype.apply=function(){var i=this;if(zn(arguments[0],w0))for(var a=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(a);else if(zn(arguments[0],Iv)){var s=arguments[0];if(this._geometries.length===0)return null;for(var l=0;l<this._geometries.length&&(i._geometries[l].apply(s),!s.isDone());l++);s.isGeometryChanged()&&this.geometryChanged()}else if(zn(arguments[0],Yp)){var u=arguments[0];u.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(u)}else if(zn(arguments[0],Sm)){var c=arguments[0];c.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(c)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),mi.shouldNeverReachHere(),null},e.prototype.clone=function(){var i=this,a=n.prototype.clone.call(this);a._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)a._geometries[o]=i._geometries[o].clone();return a},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var i=this,a=new Array(this._geometries.length).fill(null),o=0;o<a.length;o++)a[o]=i._geometries[o].copy();return new e(a,this._factory)},e.prototype.isEmpty=function(){for(var i=this,a=0;a<this._geometries.length;a++)if(!i._geometries[a].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,t),e}(Gn),lw=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Gn.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,a):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ja.FALSE:0},e.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var a=0;a<this._geometries.length;a++)if(!i._geometries[a].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var i=this,a=this._geometries.length,o=new Array(a).fill(null),s=0;s<this._geometries.length;s++)o[a-1-s]=i._geometries[s].reverse();return this.getFactory().createMultiLineString(o)},e.prototype.getBoundary=function(){return new _d(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var i=this,a=new Array(this._geometries.length).fill(null),o=0;o<a.length;o++)a[o]=i._geometries[o].copy();return new e(a,this._factory)},e.prototype.interfaces_=function(){return[DN]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,t),e}(Yh),_d=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var e=arguments[0],t=Od.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};_d.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return t.length===1?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)};_d.prototype.getBoundary=function(){return this._geom instanceof $s?this.boundaryLineString(this._geom):this._geom instanceof lw?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()};_d.prototype.boundaryLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(e.isClosed()){var t=this._bnRule.isInBoundary(2);return t?e.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])};_d.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()};_d.prototype.computeBoundaryCoordinates=function(e){var t=this,r=new Pr;this._endpointMap=new dh;for(var i=0;i<e.getNumGeometries();i++){var a=e.getGeometryN(i);a.getNumPoints()!==0&&(t.addEndpoint(a.getCoordinateN(0)),t.addEndpoint(a.getCoordinateN(a.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var s=o.next(),l=s.getValue(),u=l.count;t._bnRule.isInBoundary(u)&&r.add(s.getKey())}return Bi.toCoordinateArray(r)};_d.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);t===null&&(t=new W7,this._endpointMap.put(e,t)),t.count++};_d.prototype.interfaces_=function(){return[]};_d.prototype.getClass=function(){return _d};_d.getBoundary=function(){if(arguments.length===1){var e=arguments[0],t=new _d(e);return t.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=new _d(r,i);return a.getBoundary()}};var W7=function(){this.count=null};W7.prototype.interfaces_=function(){return[]};W7.prototype.getClass=function(){return W7};function kzr(){}function Fzr(){}var Bzr=function(){};function Gzr(){}function zzr(){}function Uzr(){}var xd=function(){},bce={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};xd.prototype.interfaces_=function(){return[]};xd.prototype.getClass=function(){return xd};xd.chars=function(e,t){for(var r=new Array(t).fill(null),i=0;i<t;i++)r[i]=e;return String(r)};xd.getStackTrace=function(){if(arguments.length===1){var e=arguments[0],t=new Gzr,r=new kzr;return e.printStackTrace(r),t.toString()}else if(arguments.length===2){var i=arguments[0],a=arguments[1],o="";new Fzr(xd.getStackTrace(i));for(var s=new Uzr,l=0;l<a;l++)try{o+=s.readLine()+xd.NEWLINE}catch(u){if(u instanceof zzr)mi.shouldNeverReachHere();else throw u}finally{}return o}};xd.split=function(e,t){for(var r=t.length,i=new Pr,a=""+e,o=a.indexOf(t);o>=0;){var s=a.substring(0,o);i.add(s),a=a.substring(o+r),o=a.indexOf(t)}a.length>0&&i.add(a);for(var l=new Array(i.size()).fill(null),u=0;u<l.length;u++)l[u]=i.get(u);return l};xd.toString=function(){if(arguments.length===1){var e=arguments[0];return xd.SIMPLE_ORDINATE_FORMAT.format(e)}};xd.spaces=function(e){return xd.chars(" ",e)};bce.NEWLINE.get=function(){return zu.getProperty("line.separator")};bce.SIMPLE_ORDINATE_FORMAT.get=function(){return new Bzr};Object.defineProperties(xd,bce);var rl=function(){};rl.prototype.interfaces_=function(){return[]};rl.prototype.getClass=function(){return rl};rl.copyCoord=function(e,t,r,i){for(var a=Math.min(e.getDimension(),r.getDimension()),o=0;o<a;o++)r.setOrdinate(i,o,e.getOrdinate(t,o))};rl.isRing=function(e){var t=e.size();return t===0?!0:t<=3?!1:e.getOrdinate(0,ua.X)===e.getOrdinate(t-1,ua.X)&&e.getOrdinate(0,ua.Y)===e.getOrdinate(t-1,ua.Y)};rl.isEqual=function(e,t){var r=e.size(),i=t.size();if(r!==i)return!1;for(var a=Math.min(e.getDimension(),t.getDimension()),o=0;o<r;o++)for(var s=0;s<a;s++){var l=e.getOrdinate(o,s),u=t.getOrdinate(o,s);if(e.getOrdinate(o,s)!==t.getOrdinate(o,s)&&!(ui.isNaN(l)&&ui.isNaN(u)))return!1}return!0};rl.extend=function(e,t,r){var i=e.create(r,t.getDimension()),a=t.size();if(rl.copy(t,0,i,0,a),a>0)for(var o=a;o<r;o++)rl.copy(t,a-1,i,o,1);return i};rl.reverse=function(e){for(var t=e.size()-1,r=Math.trunc(t/2),i=0;i<=r;i++)rl.swap(e,i,t-i)};rl.swap=function(e,t,r){if(t===r)return null;for(var i=0;i<e.getDimension();i++){var a=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(r,i)),e.setOrdinate(r,i,a)}};rl.copy=function(e,t,r,i,a){for(var o=0;o<a;o++)rl.copyCoord(e,t+o,r,i+o)};rl.toString=function(){if(arguments.length===1){var e=arguments[0],t=e.size();if(t===0)return"()";var r=e.getDimension(),i=new hg;i.append("(");for(var a=0;a<t;a++){a>0&&i.append(" ");for(var o=0;o<r;o++)o>0&&i.append(","),i.append(xd.toString(e.getOrdinate(a,o)))}return i.append(")"),i.toString()}};rl.ensureValidRing=function(e,t){var r=t.size();if(r===0)return t;if(r<=3)return rl.createClosedRing(e,t,4);var i=t.getOrdinate(0,ua.X)===t.getOrdinate(r-1,ua.X)&&t.getOrdinate(0,ua.Y)===t.getOrdinate(r-1,ua.Y);return i?t:rl.createClosedRing(e,t,r+1)};rl.createClosedRing=function(e,t,r){var i=e.create(r,t.getDimension()),a=t.size();rl.copy(t,0,i,0,a);for(var o=a;o<r;o++)rl.copy(t,0,i,o,1);return i};var $s=function(n){function e(r,i){n.call(this,i),this._points=null,this.init(r)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new gn:this._points.expandEnvelope(new gn)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var a=arguments[0],o=arguments[1];if(!this.isEquivalentClass(a))return!1;var s=a;if(this._points.size()!==s._points.size())return!1;for(var l=0;l<this._points.size();l++)if(!i.equal(i._points.getCoordinate(l),s._points.getCoordinate(l),o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,a=0;a<Math.trunc(this._points.size()/2);a++){var o=i._points.size()-1-a;if(!i._points.getCoordinate(a).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(a).compareTo(i._points.getCoordinate(o))>0&&rl.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ja.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Gr.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();rl.reverse(i);var a=this.getFactory().createLineString(i);return a},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var a=arguments[0],o=a,s=0,l=0;s<this._points.size()&&l<o._points.size();){var u=i._points.getCoordinate(s).compareTo(o._points.getCoordinate(l));if(u!==0)return u;s++,l++}return s<this._points.size()?1:l<o._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],c=arguments[1],f=h;return c.compare(this._points,f._points)}},e.prototype.apply=function(){var i=this;if(zn(arguments[0],w0))for(var a=arguments[0],o=0;o<this._points.size();o++)a.filter(i._points.getCoordinate(o));else if(zn(arguments[0],Iv)){var s=arguments[0];if(this._points.size()===0)return null;for(var l=0;l<this._points.size()&&(s.filter(i._points,l),!s.isDone());l++);s.isGeometryChanged()&&this.geometryChanged()}else if(zn(arguments[0],Yp)){var u=arguments[0];u.filter(this)}else if(zn(arguments[0],Sm)){var h=arguments[0];h.filter(this)}},e.prototype.getBoundary=function(){return new _d(this).getBoundary()},e.prototype.isEquivalentClass=function(i){return i instanceof e},e.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._points=this._points.clone(),i},e.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new Ss("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var a=this,o=0;o<this._points.size();o++)if(a._points.getCoordinate(o).equals(i))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},e.prototype.interfaces_=function(){return[DN]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,t),e}(Gn),NN=function(){};NN.prototype.interfaces_=function(){return[]};NN.prototype.getClass=function(){return NN};var Jc=function(n){function e(r,i){n.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new gn;var i=new gn;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},e.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),a):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Ja.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],a=i;return this.getCoordinate().compareTo(a.getCoordinate())}else if(arguments.length===2){var o=arguments[0],s=arguments[1],l=o;return s.compare(this._coordinates,l._coordinates)}},e.prototype.apply=function(){if(zn(arguments[0],w0)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(zn(arguments[0],Iv)){var a=arguments[0];if(this.isEmpty())return null;a.filter(this._coordinates,0),a.isGeometryChanged()&&this.geometryChanged()}else if(zn(arguments[0],Yp)){var o=arguments[0];o.filter(this)}else if(zn(arguments[0],Sm)){var s=arguments[0];s.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var i=n.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),mi.isTrue(i.size()<=1),this._coordinates=i},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[NN]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,t),e}(Gn),S_=function(){};S_.prototype.interfaces_=function(){return[]};S_.prototype.getClass=function(){return S_};var Rl=function(n){function e(r,i,a){if(n.call(this,a),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),n.hasNullElements(i))throw new Ss("holes must not contain null elements");if(r.isEmpty()&&n.hasNonEmptyElements(i))throw new Ss("shell is empty but holes are not");this._shell=r,this._holes=i}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var a=new Array(this.getNumPoints()).fill(null),o=-1,s=this._shell.getCoordinates(),l=0;l<s.length;l++)o++,a[o]=s[l];for(var u=0;u<this._holes.length;u++)for(var h=i._holes[u].getCoordinates(),c=0;c<h.length;c++)o++,a[o]=h[c];return a},e.prototype.getArea=function(){var i=this,a=0;a+=Math.abs(Gr.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)a-=Math.abs(Gr.signedArea(i._holes[o].getCoordinateSequence()));return a},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),a=this.getEnvelopeInternal(),o=0;o<5;o++){var s=i.getX(o);if(!(s===a.getMinX()||s===a.getMaxX()))return!1;var l=i.getY(o);if(!(l===a.getMinY()||l===a.getMaxY()))return!1}for(var u=i.getX(0),h=i.getY(0),c=1;c<=4;c++){var f=i.getX(c),d=i.getY(c),v=f!==u,p=d!==h;if(v===p)return!1;u=f,h=d}return!0},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var a=arguments[0],o=arguments[1];if(!this.isEquivalentClass(a))return!1;var s=a,l=this._shell,u=s._shell;if(!l.equalsExact(u,o)||this._holes.length!==s._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!i._holes[h].equalsExact(s._holes[h],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var a=0;a<this._holes.length;a++)i.normalize(i._holes[a],!1);IS.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];if(o.isEmpty())return null;var l=new Array(o.getCoordinates().length-1).fill(null);zu.arraycopy(o.getCoordinates(),0,l,0,l.length);var u=Bi.minCoordinate(o.getCoordinates());Bi.scroll(l,u),zu.arraycopy(l,0,o.getCoordinates(),0,l.length),o.getCoordinates()[l.length]=l[0],Gr.isCCW(o.getCoordinates())===s&&Bi.reverse(o.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var i=this,a=0;a+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)a+=i._holes[o].getLength();return a},e.prototype.getNumPoints=function(){for(var i=this,a=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)a+=i._holes[o].getNumPoints();return a},e.prototype.reverse=function(){var i=this,a=this.copy();a._shell=this._shell.copy().reverse(),a._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)a._holes[o]=i._holes[o].copy().reverse();return a},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var a=arguments[0],o=this._shell,s=a._shell;return o.compareToSameClass(s)}else if(arguments.length===2){var l=arguments[0],u=arguments[1],h=l,c=this._shell,f=h._shell,d=c.compareToSameClass(f,u);if(d!==0)return d;for(var v=this.getNumInteriorRing(),p=h.getNumInteriorRing(),g=0;g<v&&g<p;){var m=i.getInteriorRingN(g),y=h.getInteriorRingN(g),_=m.compareToSameClass(y,u);if(_!==0)return _;g++}return g<v?1:g<p?-1:0}},e.prototype.apply=function(i){var a=this;if(zn(i,w0)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)a._holes[o].apply(i)}else if(zn(i,Iv)){if(this._shell.apply(i),!i.isDone())for(var s=0;s<this._holes.length&&(a._holes[s].apply(i),!i.isDone());s++);i.isGeometryChanged()&&this.geometryChanged()}else if(zn(i,Yp))i.filter(this);else if(zn(i,Sm)){i.filter(this),this._shell.apply(i);for(var l=0;l<this._holes.length;l++)a._holes[l].apply(i)}},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var a=new Array(this._holes.length+1).fill(null);a[0]=this._shell;for(var o=0;o<this._holes.length;o++)a[o+1]=i._holes[o];return a.length<=1?this.getFactory().createLinearRing(a[0].getCoordinateSequence()):this.getFactory().createMultiLineString(a)},e.prototype.clone=function(){var i=this,a=n.prototype.clone.call(this);a._shell=this._shell.clone(),a._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)a._holes[o]=i._holes[o].clone();return a},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var i=this,a=this._shell.copy(),o=new Array(this._holes.length).fill(null),s=0;s<o.length;s++)o[s]=i._holes[s].copy();return new e(a,o,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(i){return this._holes[i]},e.prototype.interfaces_=function(){return[S_]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,t),e}(Gn),sI=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Gn.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,a):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Ja.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var i=this,a=new Array(this._geometries.length).fill(null),o=0;o<a.length;o++)a[o]=i._geometries[o].copy();return new e(a,this._factory)},e.prototype.interfaces_=function(){return[NN]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,t),e}(Yh),b0=function(n){function e(r,i){r instanceof tt&&i instanceof Fi&&(r=i.getCoordinateSequenceFactory().create(r)),n.call(this,r,i),this.validateConstruction()}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Gn.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Ja.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},e.prototype.reverse=function(){var i=this._points.copy();rl.reverse(i);var a=this.getFactory().createLinearRing(i);return a},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new Ss("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Ss("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}($s),p0=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Gn.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,a):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,a=this._geometries.length,o=new Array(a).fill(null),s=0;s<this._geometries.length;s++)o[s]=i._geometries[s].reverse();return this.getFactory().createMultiPolygon(o)},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var a=new Pr,o=0;o<this._geometries.length;o++)for(var s=i._geometries[o],l=s.getBoundary(),u=0;u<l.getNumGeometries();u++)a.add(l.getGeometryN(u));var h=new Array(a.size()).fill(null);return this.getFactory().createMultiLineString(a.toArray(h))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var i=this,a=new Array(this._geometries.length).fill(null),o=0;o<a.length;o++)a[o]=i._geometries[o].copy();return new e(a,this._factory)},e.prototype.interfaces_=function(){return[S_]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,t),e}(Yh),Rd=function(e){this._factory=e||null,this._isUserDataCopied=!1},D$={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Rd.prototype.setCopyUserData=function(e){this._isUserDataCopied=e};Rd.prototype.edit=function(e,t){if(e===null)return null;var r=this.editInternal(e,t);return this._isUserDataCopied&&r.setUserData(e.getUserData()),r};Rd.prototype.editInternal=function(e,t){return this._factory===null&&(this._factory=e.getFactory()),e instanceof Yh?this.editGeometryCollection(e,t):e instanceof Rl?this.editPolygon(e,t):e instanceof Jc?t.edit(e,this._factory):e instanceof $s?t.edit(e,this._factory):(mi.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)};Rd.prototype.editGeometryCollection=function(e,t){for(var r=this,i=t.edit(e,this._factory),a=new Pr,o=0;o<i.getNumGeometries();o++){var s=r.edit(i.getGeometryN(o),t);s===null||s.isEmpty()||a.add(s)}return i.getClass()===sI?this._factory.createMultiPoint(a.toArray([])):i.getClass()===lw?this._factory.createMultiLineString(a.toArray([])):i.getClass()===p0?this._factory.createMultiPolygon(a.toArray([])):this._factory.createGeometryCollection(a.toArray([]))};Rd.prototype.editPolygon=function(e,t){var r=this,i=t.edit(e,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var a=this.edit(i.getExteriorRing(),t);if(a===null||a.isEmpty())return this._factory.createPolygon();for(var o=new Pr,s=0;s<i.getNumInteriorRing();s++){var l=r.edit(i.getInteriorRingN(s),t);l===null||l.isEmpty()||o.add(l)}return this._factory.createPolygon(a,o.toArray([]))};Rd.prototype.interfaces_=function(){return[]};Rd.prototype.getClass=function(){return Rd};Rd.GeometryEditorOperation=function(){};D$.NoOpGeometryOperation.get=function(){return kN};D$.CoordinateOperation.get=function(){return FN};D$.CoordinateSequenceOperation.get=function(){return BN};Object.defineProperties(Rd,D$);var kN=function(){};kN.prototype.edit=function(e,t){return e};kN.prototype.interfaces_=function(){return[Rd.GeometryEditorOperation]};kN.prototype.getClass=function(){return kN};var FN=function(){};FN.prototype.edit=function(e,t){var r=this.editCoordinates(e.getCoordinates(),e);return r===null?e:e instanceof b0?t.createLinearRing(r):e instanceof $s?t.createLineString(r):e instanceof Jc?r.length>0?t.createPoint(r[0]):t.createPoint():e};FN.prototype.interfaces_=function(){return[Rd.GeometryEditorOperation]};FN.prototype.getClass=function(){return FN};var BN=function(){};BN.prototype.edit=function(e,t){return e instanceof b0?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof $s?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof Jc?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e};BN.prototype.interfaces_=function(){return[Rd.GeometryEditorOperation]};BN.prototype.getClass=function(){return BN};var el=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var r=0;r<t;r++)e._coordinates[r]=new tt}else if(zn(arguments[0],ua)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var a=0;a<this._coordinates.length;a++)e._coordinates[a]=i.getCoordinateCopy(a)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=o,this._dimension=s,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],u=arguments[1];this._coordinates=new Array(l).fill(null),this._dimension=u;for(var h=0;h<l;h++)e._coordinates[h]=new tt}}},PJe={serialVersionUID:{configurable:!0}};el.prototype.setOrdinate=function(e,t,r){switch(t){case ua.X:this._coordinates[e].x=r;break;case ua.Y:this._coordinates[e].y=r;break;case ua.Z:this._coordinates[e].z=r;break;default:throw new Ss("invalid ordinateIndex")}};el.prototype.size=function(){return this._coordinates.length};el.prototype.getOrdinate=function(e,t){switch(t){case ua.X:return this._coordinates[e].x;case ua.Y:return this._coordinates[e].y;case ua.Z:return this._coordinates[e].z}return ui.NaN};el.prototype.getCoordinate=function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}else if(arguments.length===2){var t=arguments[0],r=arguments[1];r.x=this._coordinates[t].x,r.y=this._coordinates[t].y,r.z=this._coordinates[t].z}};el.prototype.getCoordinateCopy=function(e){return new tt(this._coordinates[e])};el.prototype.getDimension=function(){return this._dimension};el.prototype.getX=function(e){return this._coordinates[e].x};el.prototype.clone=function(){for(var e=this,t=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)t[r]=e._coordinates[r].clone();return new el(t,this._dimension)};el.prototype.expandEnvelope=function(e){for(var t=this,r=0;r<this._coordinates.length;r++)e.expandToInclude(t._coordinates[r]);return e};el.prototype.copy=function(){for(var e=this,t=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)t[r]=e._coordinates[r].copy();return new el(t,this._dimension)};el.prototype.toString=function(){var e=this;if(this._coordinates.length>0){var t=new hg(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)t.append(", "),t.append(e._coordinates[r]);return t.append(")"),t.toString()}else return"()"};el.prototype.getY=function(e){return this._coordinates[e].y};el.prototype.toCoordinateArray=function(){return this._coordinates};el.prototype.interfaces_=function(){return[ua,Wd]};el.prototype.getClass=function(){return el};PJe.serialVersionUID.get=function(){return-0xcb44a778db18e00};Object.defineProperties(el,PJe);var E0=function(){},Ece={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};E0.prototype.readResolve=function(){return E0.instance()};E0.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new el(e)}else if(zn(arguments[0],ua)){var t=arguments[0];return new el(t)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new el(r):new el(r,i)}};E0.prototype.interfaces_=function(){return[tI,Wd]};E0.prototype.getClass=function(){return E0};E0.instance=function(){return E0.instanceObject};Ece.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};Ece.instanceObject.get=function(){return new E0};Object.defineProperties(E0,Ece);var OJe=function(n){function e(){n.call(this),this.map_=new Map}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(r){return this.map_.get(r)||null},e.prototype.put=function(r,i){return this.map_.set(r,i),i},e.prototype.values=function(){for(var r=new Pr,i=this.map_.values(),a=i.next();!a.done;)r.add(a.value),a=i.next();return r},e.prototype.entrySet=function(){var r=new wce;return this.map_.entries().forEach(function(i){return r.add(i)}),r},e.prototype.size=function(){return this.map_.size()},e}(bT),to=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof qp){var e=arguments[0];this._modelType=e,e===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=n.FIXED,this.setScale(t)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Tce={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};to.prototype.equals=function(e){if(!(e instanceof to))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale};to.prototype.compareTo=function(e){var t=e,r=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new jp(r).compareTo(new jp(i))};to.prototype.getScale=function(){return this._scale};to.prototype.isFloating=function(){return this._modelType===to.FLOATING||this._modelType===to.FLOATING_SINGLE};to.prototype.getType=function(){return this._modelType};to.prototype.toString=function(){var e="UNKNOWN";return this._modelType===to.FLOATING?e="Floating":this._modelType===to.FLOATING_SINGLE?e="Floating-Single":this._modelType===to.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e};to.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ui.isNaN(e))return e;if(this._modelType===to.FLOATING_SINGLE){var t=e;return t}return this._modelType===to.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof tt){var r=arguments[0];if(this._modelType===to.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}};to.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===to.FLOATING?e=16:this._modelType===to.FLOATING_SINGLE?e=6:this._modelType===to.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e};to.prototype.setScale=function(e){this._scale=Math.abs(e)};to.prototype.interfaces_=function(){return[Wd,$d]};to.prototype.getClass=function(){return to};to.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t};Tce.serialVersionUID.get=function(){return 7777263578777804e3};Tce.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(to,Tce);var qp=function n(e){this._name=e||null,n.nameToTypeMap.put(e,this)},Cce={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};qp.prototype.readResolve=function(){return qp.nameToTypeMap.get(this._name)};qp.prototype.toString=function(){return this._name};qp.prototype.interfaces_=function(){return[Wd]};qp.prototype.getClass=function(){return qp};Cce.serialVersionUID.get=function(){return-552860263173159e4};Cce.nameToTypeMap.get=function(){return new OJe};Object.defineProperties(qp,Cce);to.Type=qp;to.FIXED=new qp("FIXED");to.FLOATING=new qp("FLOATING");to.FLOATING_SINGLE=new qp("FLOATING SINGLE");var Fi=function n(){this._precisionModel=new to,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?zn(arguments[0],tI)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof to&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},RJe={serialVersionUID:{configurable:!0}};Fi.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new tt(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new tt(e.getMinX(),e.getMinY()),new tt(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new tt(e.getMinX(),e.getMinY()),new tt(e.getMinX(),e.getMaxY()),new tt(e.getMaxX(),e.getMaxY()),new tt(e.getMaxX(),e.getMinY()),new tt(e.getMinX(),e.getMinY())]),null)};Fi.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new $s(this.getCoordinateSequenceFactory().create(e),this);if(zn(e,ua))return new $s(e,this)}else return new $s(this.getCoordinateSequenceFactory().create([]),this)};Fi.prototype.createMultiLineString=function(){if(arguments.length===0)return new lw(null,this);if(arguments.length===1){var e=arguments[0];return new lw(e,this)}};Fi.prototype.buildGeometry=function(e){for(var t=null,r=!1,i=!1,a=e.iterator();a.hasNext();){var o=a.next(),s=o.getClass();t===null&&(t=s),s!==t&&(r=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(Fi.toGeometryArray(e));var l=e.iterator().next(),u=e.size()>1;if(u){if(l instanceof Rl)return this.createMultiPolygon(Fi.toPolygonArray(e));if(l instanceof $s)return this.createMultiLineString(Fi.toLineStringArray(e));if(l instanceof Jc)return this.createMultiPoint(Fi.toPointArray(e));mi.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l};Fi.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)};Fi.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof tt){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(zn(arguments[0],ua)){var t=arguments[0];return new Jc(t,this)}}};Fi.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};Fi.prototype.createPolygon=function(){if(arguments.length===0)return new Rl(null,null,this);if(arguments.length===1){if(zn(arguments[0],ua)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof b0){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],a=arguments[1];return new Rl(i,a,this)}};Fi.prototype.getSRID=function(){return this._SRID};Fi.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Yh(null,this);if(arguments.length===1){var e=arguments[0];return new Yh(e,this)}};Fi.prototype.createGeometry=function(e){var t=new Rd(this);return t.edit(e,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})};Fi.prototype.getPrecisionModel=function(){return this._precisionModel};Fi.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(zn(arguments[0],ua)){var t=arguments[0];return new b0(t,this)}}};Fi.prototype.createMultiPolygon=function(){if(arguments.length===0)return new p0(null,this);if(arguments.length===1){var e=arguments[0];return new p0(e,this)}};Fi.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new sI(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new sI(t,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(zn(arguments[0],ua)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var a=new Array(i.size()).fill(null),o=0;o<i.size();o++){var s=e.getCoordinateSequenceFactory().create(1,i.getDimension());rl.copy(i,o,s,0,1),a[o]=e.createPoint(s)}return this.createMultiPoint(a)}}};Fi.prototype.interfaces_=function(){return[Wd]};Fi.prototype.getClass=function(){return Fi};Fi.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.toGeometryArray=function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.getDefaultCoordinateSequenceFactory=function(){return E0.instance()};Fi.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)};Fi.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)};RJe.serialVersionUID.get=function(){return-6820524753094096e3};Object.defineProperties(Fi,RJe);var Vzr=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],N$=function(e){this.geometryFactory=e||new Fi};N$.prototype.read=function(e){var t;typeof e=="string"?t=JSON.parse(e):t=e;var r=t.type;if(!mp[r])throw new Error("Unknown GeoJSON type: "+t.type);return Vzr.indexOf(r)!==-1?mp[r].apply(this,[t.coordinates]):r==="GeometryCollection"?mp[r].apply(this,[t.geometries]):mp[r].apply(this,[t])};N$.prototype.write=function(e){var t=e.getGeometryType();if(!by[t])throw new Error("Geometry is not supported");return by[t].apply(this,[e])};var mp={Feature:function(n){var e={};for(var t in n)e[t]=n[t];if(n.geometry){var r=n.geometry.type;if(!mp[r])throw new Error("Unknown GeoJSON type: "+n.type);e.geometry=this.read(n.geometry)}return n.bbox&&(e.bbox=mp.bbox.apply(this,[n.bbox])),e},FeatureCollection:function(n){var e=this,t={};if(n.features){t.features=[];for(var r=0;r<n.features.length;++r)t.features.push(e.read(n.features[r]))}return n.bbox&&(t.bbox=this.parse.bbox.apply(this,[n.bbox])),t},coordinates:function(n){for(var e=[],t=0;t<n.length;++t){var r=n[t];e.push(new tt(r[0],r[1]))}return e},bbox:function(n){return this.geometryFactory.createLinearRing([new tt(n[0],n[1]),new tt(n[2],n[1]),new tt(n[2],n[3]),new tt(n[0],n[3]),new tt(n[0],n[1])])},Point:function(n){var e=new tt(n[0],n[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(n){for(var e=this,t=[],r=0;r<n.length;++r)t.push(mp.Point.apply(e,[n[r]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(n){var e=mp.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(e)},MultiLineString:function(n){for(var e=this,t=[],r=0;r<n.length;++r)t.push(mp.LineString.apply(e,[n[r]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(n){for(var e=this,t=mp.coordinates.apply(this,[n[0]]),r=this.geometryFactory.createLinearRing(t),i=[],a=1;a<n.length;++a){var o=n[a],s=mp.coordinates.apply(e,[o]),l=e.geometryFactory.createLinearRing(s);i.push(l)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(n){for(var e=this,t=[],r=0;r<n.length;++r){var i=n[r];t.push(mp.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(n){for(var e=this,t=[],r=0;r<n.length;++r){var i=n[r];t.push(e.read(i))}return this.geometryFactory.createGeometryCollection(t)}},by={coordinate:function(n){return[n.x,n.y]},Point:function(n){var e=by.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],a=by.Point.apply(e,[i]);t.push(a.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(n){for(var e=this,t=[],r=n.getCoordinates(),i=0;i<r.length;++i){var a=r[i];t.push(by.coordinate.apply(e,[a]))}return{type:"LineString",coordinates:t}},MultiLineString:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],a=by.LineString.apply(e,[i]);t.push(a.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(n){var e=this,t=[],r=by.LineString.apply(this,[n._shell]);t.push(r.coordinates);for(var i=0;i<n._holes.length;++i){var a=n._holes[i],o=by.LineString.apply(e,[a]);t.push(o.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],a=by.Polygon.apply(e,[i]);t.push(a.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],a=i.getGeometryType();t.push(by[a].apply(e,[i]))}return{type:"GeometryCollection",geometries:t}}},Ace=function(e){this.geometryFactory=e||new Fi,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new N$(this.geometryFactory)};Ace.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===to.FIXED&&this.reducePrecision(t),t};Ace.prototype.reducePrecision=function(e){var t=this,r,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(r=0,i=e.points.length;r<i;r++)t.precisionModel.makePrecise(e.points[r]);else if(e.geometries)for(r=0,i=e.geometries.length;r<i;r++)t.reducePrecision(e.geometries[r])};var DJe=function(){this.parser=new N$(this.geometryFactory)};DJe.prototype.write=function(e){return this.parser.write(e)};var wr=function(){},k$={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};wr.prototype.interfaces_=function(){return[]};wr.prototype.getClass=function(){return wr};wr.opposite=function(e){return e===wr.LEFT?wr.RIGHT:e===wr.RIGHT?wr.LEFT:e};k$.ON.get=function(){return 0};k$.LEFT.get=function(){return 1};k$.RIGHT.get=function(){return 2};Object.defineProperties(wr,k$);function F$(n){this.message=n||""}F$.prototype=new Error;F$.prototype.name="EmptyStackException";function cg(){this.array_=[]}cg.prototype=new wv;cg.prototype.add=function(n){return this.array_.push(n),!0};cg.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]};cg.prototype.push=function(n){return this.array_.push(n),n};cg.prototype.pop=function(n){if(this.array_.length===0)throw new F$;return this.array_.pop()};cg.prototype.peek=function(){if(this.array_.length===0)throw new F$;return this.array_[this.array_.length-1]};cg.prototype.empty=function(){return this.array_.length===0};cg.prototype.isEmpty=function(){return this.empty()};cg.prototype.search=function(n){return this.array_.indexOf(n)};cg.prototype.size=function(){return this.array_.length};cg.prototype.toArray=function(){for(var n=this,e=[],t=0,r=this.array_.length;t<r;t++)e.push(n.array_[t]);return e};var Zp=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Zp.prototype.getCoordinate=function(){return this._minCoord};Zp.prototype.getRightmostSide=function(e,t){var r=this.getRightmostSideOfSegment(e,t);return r<0&&(r=this.getRightmostSideOfSegment(e,t-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),r};Zp.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();mi.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],r=e[this._minIndex+1],i=Gr.computeOrientation(this._minCoord,r,t),a=!1;(t.y<this._minCoord.y&&r.y<this._minCoord.y&&i===Gr.COUNTERCLOCKWISE||t.y>this._minCoord.y&&r.y>this._minCoord.y&&i===Gr.CLOCKWISE)&&(a=!0),a&&(this._minIndex=this._minIndex-1)};Zp.prototype.getRightmostSideOfSegment=function(e,t){var r=e.getEdge(),i=r.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var a=wr.LEFT;return i[t].y<i[t+1].y&&(a=wr.RIGHT),a};Zp.prototype.getEdge=function(){return this._orientedDe};Zp.prototype.checkForRightmostCoordinate=function(e){for(var t=this,r=e.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(t._minCoord===null||r[i].x>t._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=r[i])};Zp.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};Zp.prototype.findEdge=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next();!i.isForward()||t.checkForRightmostCoordinate(i)}mi.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var a=this.getRightmostSide(this._minDe,this._minIndex);a===wr.LEFT&&(this._orientedDe=this._minDe.getSym())};Zp.prototype.interfaces_=function(){return[]};Zp.prototype.getClass=function(){return Zp};var wm=function(n){function e(t,r){n.call(this,e.msgWithCoord(t,r)),this.pt=r?new tt(r):null,this.name="TopologyException"}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(r,i){return i?r:r+" [ "+i+" ]"},e}(xm),B$=function(){this.array_=[]};B$.prototype.addLast=function(e){this.array_.push(e)};B$.prototype.removeFirst=function(){return this.array_.shift()};B$.prototype.isEmpty=function(){return this.array_.length===0};var qh=function(){this._finder=null,this._dirEdgeList=new Pr,this._nodes=new Pr,this._rightMostCoord=null,this._env=null,this._finder=new Zp};qh.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}};qh.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};qh.prototype.computeNodeDepth=function(e){for(var t=this,r=null,i=e.getEdges().iterator();i.hasNext();){var a=i.next();if(a.isVisited()||a.getSym().isVisited()){r=a;break}}if(r===null)throw new wm("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(r);for(var o=e.getEdges().iterator();o.hasNext();){var s=o.next();s.setVisited(!0),t.copySymDepths(s)}};qh.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(wr.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)};qh.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};qh.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(wr.RIGHT)>=1&&t.getDepth(wr.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}};qh.prototype.computeDepths=function(e){var t=this,r=new wce,i=new B$,a=e.getNode();for(i.addLast(a),r.add(a),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();r.add(o),t.computeNodeDepth(o);for(var s=o.getEdges().iterator();s.hasNext();){var l=s.next(),u=l.getSym();if(!u.isVisited()){var h=u.getNode();r.contains(h)||(i.addLast(h),r.add(h))}}}};qh.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0};qh.prototype.getEnvelope=function(){if(this._env===null){for(var e=new gn,t=this._dirEdgeList.iterator();t.hasNext();)for(var r=t.next(),i=r.getEdge().getCoordinates(),a=0;a<i.length-1;a++)e.expandToInclude(i[a]);this._env=e}return this._env};qh.prototype.addReachable=function(e){var t=this,r=new cg;for(r.add(e);!r.empty();){var i=r.pop();t.add(i,r)}};qh.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(wr.LEFT,e.getDepth(wr.RIGHT)),t.setDepth(wr.RIGHT,e.getDepth(wr.LEFT))};qh.prototype.add=function(e,t){var r=this;e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var a=i.next();r._dirEdgeList.add(a);var o=a.getSym(),s=o.getNode();s.isVisited()||t.push(s)}};qh.prototype.getNodes=function(){return this._nodes};qh.prototype.getDirectedEdges=function(){return this._dirEdgeList};qh.prototype.interfaces_=function(){return[$d]};qh.prototype.getClass=function(){return qh};var Uo=function n(){var e=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[wr.ON]=r}else if(arguments[0]instanceof n){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var a=0;a<this.location.length;a++)e.location[a]=i.location[a]}}else if(arguments.length===3){var o=arguments[0],s=arguments[1],l=arguments[2];this.init(3),this.location[wr.ON]=o,this.location[wr.LEFT]=s,this.location[wr.RIGHT]=l}};Uo.prototype.setAllLocations=function(e){for(var t=this,r=0;r<this.location.length;r++)t.location[r]=e};Uo.prototype.isNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]!==dt.NONE)return!1;return!0};Uo.prototype.setAllLocationsIfNull=function(e){for(var t=this,r=0;r<this.location.length;r++)t.location[r]===dt.NONE&&(t.location[r]=e)};Uo.prototype.isLine=function(){return this.location.length===1};Uo.prototype.merge=function(e){var t=this;if(e.location.length>this.location.length){var r=new Array(3).fill(null);r[wr.ON]=this.location[wr.ON],r[wr.LEFT]=dt.NONE,r[wr.RIGHT]=dt.NONE,this.location=r}for(var i=0;i<this.location.length;i++)t.location[i]===dt.NONE&&i<e.location.length&&(t.location[i]=e.location[i])};Uo.prototype.getLocations=function(){return this.location};Uo.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[wr.LEFT];this.location[wr.LEFT]=this.location[wr.RIGHT],this.location[wr.RIGHT]=e};Uo.prototype.toString=function(){var e=new hg;return this.location.length>1&&e.append(dt.toLocationSymbol(this.location[wr.LEFT])),e.append(dt.toLocationSymbol(this.location[wr.ON])),this.location.length>1&&e.append(dt.toLocationSymbol(this.location[wr.RIGHT])),e.toString()};Uo.prototype.setLocations=function(e,t,r){this.location[wr.ON]=e,this.location[wr.LEFT]=t,this.location[wr.RIGHT]=r};Uo.prototype.get=function(e){return e<this.location.length?this.location[e]:dt.NONE};Uo.prototype.isArea=function(){return this.location.length>1};Uo.prototype.isAnyNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]===dt.NONE)return!0;return!1};Uo.prototype.setLocation=function(){if(arguments.length===1){var e=arguments[0];this.setLocation(wr.ON,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this.location[t]=r}};Uo.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(dt.NONE)};Uo.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]};Uo.prototype.allPositionsEqual=function(e){for(var t=this,r=0;r<this.location.length;r++)if(t.location[r]!==e)return!1;return!0};Uo.prototype.interfaces_=function(){return[]};Uo.prototype.getClass=function(){return Uo};var fo=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Uo(e),this.elt[1]=new Uo(e)}else if(arguments[0]instanceof n){var t=arguments[0];this.elt[0]=new Uo(t.elt[0]),this.elt[1]=new Uo(t.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new Uo(dt.NONE),this.elt[1]=new Uo(dt.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var a=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new Uo(a,o,s),this.elt[1]=new Uo(a,o,s)}else if(arguments.length===4){var l=arguments[0],u=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new Uo(dt.NONE,dt.NONE,dt.NONE),this.elt[1]=new Uo(dt.NONE,dt.NONE,dt.NONE),this.elt[l].setLocations(u,h,c)}};fo.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e};fo.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)};fo.prototype.isNull=function(e){return this.elt[e].isNull()};fo.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this.elt[t].setAllLocationsIfNull(r)}};fo.prototype.isLine=function(e){return this.elt[e].isLine()};fo.prototype.merge=function(e){for(var t=this,r=0;r<2;r++)t.elt[r]===null&&e.elt[r]!==null?t.elt[r]=new Uo(e.elt[r]):t.elt[r].merge(e.elt[r])};fo.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()};fo.prototype.getLocation=function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(wr.ON)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return this.elt[t].get(r)}};fo.prototype.toString=function(){var e=new hg;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()};fo.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}};fo.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()};fo.prototype.setLocation=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(wr.ON,t)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this.elt[r].setLocation(i,a)}};fo.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)};fo.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)};fo.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new Uo(this.elt[e].location[0]))};fo.prototype.interfaces_=function(){return[]};fo.prototype.getClass=function(){return fo};fo.toLineLabel=function(e){for(var t=new fo(dt.NONE),r=0;r<2;r++)t.setLocation(r,e.getLocation(r));return t};var ml=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Pr,this._pts=new Pr,this._label=new fo(dt.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Pr,this._geometryFactory=null;var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()};ml.prototype.computeRing=function(){var e=this;if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)t[r]=e._pts.get(r);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=Gr.isCCW(this._ring.getCoordinates())};ml.prototype.isIsolated=function(){return this._label.getGeometryCount()===1};ml.prototype.computePoints=function(e){var t=this;this._startDe=e;var r=e,i=!0;do{if(r===null)throw new wm("Found null DirectedEdge");if(r.getEdgeRing()===t)throw new wm("Directed Edge visited twice during ring-building at "+r.getCoordinate());t._edges.add(r);var a=r.getLabel();mi.isTrue(a.isArea()),t.mergeLabel(a),t.addPoints(r.getEdge(),r.isForward(),i),i=!1,t.setEdgeRing(r,t),r=t.getNext(r)}while(r!==this._startDe)};ml.prototype.getLinearRing=function(){return this._ring};ml.prototype.getCoordinate=function(e){return this._pts.get(e)};ml.prototype.computeMaxNodeDegree=function(){var e=this;this._maxNodeDegree=0;var t=this._startDe;do{var r=t.getNode(),i=r.getEdges().getOutgoingDegree(e);i>e._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2};ml.prototype.addPoints=function(e,t,r){var i=this,a=e.getCoordinates();if(t){var o=1;r&&(o=0);for(var s=o;s<a.length;s++)i._pts.add(a[s])}else{var l=a.length-2;r&&(l=a.length-1);for(var u=l;u>=0;u--)i._pts.add(a[u])}};ml.prototype.isHole=function(){return this._isHole};ml.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)};ml.prototype.containsPoint=function(e){var t=this.getLinearRing(),r=t.getEnvelopeInternal();if(!r.contains(e)||!Gr.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var a=i.next();if(a.containsPoint(e))return!1}return!0};ml.prototype.addHole=function(e){this._holes.add(e)};ml.prototype.isShell=function(){return this._shell===null};ml.prototype.getLabel=function(){return this._label};ml.prototype.getEdges=function(){return this._edges};ml.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};ml.prototype.getShell=function(){return this._shell};ml.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=t.getLocation(r,wr.RIGHT);if(i===dt.NONE)return null;if(this._label.getLocation(r)===dt.NONE)return this._label.setLocation(r,i),null}};ml.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)};ml.prototype.toPolygon=function(e){for(var t=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=t._holes.get(i).getLinearRing();var a=e.createPolygon(this.getLinearRing(),r);return a};ml.prototype.interfaces_=function(){return[]};ml.prototype.getClass=function(){return ml};var $zr=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},e.prototype.getNext=function(r){return r.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ml),Wzr=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var r=this,i=new Pr,a=this._startDe;do{if(a.getMinEdgeRing()===null){var o=new $zr(a,r._geometryFactory);i.add(o)}a=a.getNext()}while(a!==this._startDe);return i},e.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var a=i.getNode();a.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},e.prototype.getNext=function(r){return r.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ml),Vf=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}};Vf.prototype.setVisited=function(e){this._isVisited=e};Vf.prototype.setInResult=function(e){this._isInResult=e};Vf.prototype.isCovered=function(){return this._isCovered};Vf.prototype.isCoveredSet=function(){return this._isCoveredSet};Vf.prototype.setLabel=function(e){this._label=e};Vf.prototype.getLabel=function(){return this._label};Vf.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0};Vf.prototype.updateIM=function(e){mi.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)};Vf.prototype.isInResult=function(){return this._isInResult};Vf.prototype.isVisited=function(){return this._isVisited};Vf.prototype.interfaces_=function(){return[]};Vf.prototype.getClass=function(){return Vf};var G$=function(n){function e(){n.call(this),this._coord=null,this._edges=null;var t=arguments[0],r=arguments[1];this._coord=t,this._edges=r,this._label=new fo(0,dt.NONE)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(r){r.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(r){},e.prototype.computeMergedLocation=function(r,i){var a=dt.NONE;if(a=this._label.getLocation(i),!r.isNull(i)){var o=r.getLocation(i);a!==dt.BOUNDARY&&(a=o)}return a},e.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new fo(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof fo)for(var a=arguments[0],o=0;o<2;o++){var s=r.computeMergedLocation(a,o),l=r._label.getLocation(o);l===dt.NONE&&r._label.setLocation(o,s)}},e.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},e.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=dt.NONE;this._label!==null&&(i=this._label.getLocation(r));var a=null;switch(i){case dt.BOUNDARY:a=dt.INTERIOR;break;case dt.INTERIOR:a=dt.BOUNDARY;break;default:a=dt.BOUNDARY;break}this._label.setLocation(r,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vf),Kp=function(){this.nodeMap=new dh,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};Kp.prototype.find=function(e){return this.nodeMap.get(e)};Kp.prototype.addNode=function(){if(arguments[0]instanceof tt){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof G$){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}};Kp.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}};Kp.prototype.iterator=function(){return this.nodeMap.values().iterator()};Kp.prototype.values=function(){return this.nodeMap.values()};Kp.prototype.getBoundaryNodes=function(e){for(var t=new Pr,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(e)===dt.BOUNDARY&&t.add(i)}return t};Kp.prototype.add=function(e){var t=e.getCoordinate(),r=this.addNode(t);r.add(e)};Kp.prototype.interfaces_=function(){return[]};Kp.prototype.getClass=function(){return Kp};var Eo=function(){},tF={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Eo.prototype.interfaces_=function(){return[]};Eo.prototype.getClass=function(){return Eo};Eo.isNorthern=function(e){return e===Eo.NE||e===Eo.NW};Eo.isOpposite=function(e,t){if(e===t)return!1;var r=(e-t+4)%4;return r===2};Eo.commonHalfPlane=function(e,t){if(e===t)return e;var r=(e-t+4)%4;if(r===2)return-1;var i=e<t?e:t,a=e>t?e:t;return i===0&&a===3?3:i};Eo.isInHalfPlane=function(e,t){return t===Eo.SE?e===Eo.SE||e===Eo.SW:e===t||e===t+1};Eo.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Ss("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Eo.NE:Eo.SE:t>=0?Eo.NW:Eo.SW}else if(arguments[0]instanceof tt&&arguments[1]instanceof tt){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new Ss("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?Eo.NE:Eo.SE:i.y>=r.y?Eo.NW:Eo.SW}};tF.NE.get=function(){return 0};tF.NW.get=function(){return 1};tF.SW.get=function(){return 2};tF.SE.get=function(){return 3};Object.defineProperties(Eo,tF);var vh=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],r=arguments[1],i=arguments[2],a=null;this._edge=t,this.init(r,i),this._label=a}else if(arguments.length===4){var o=arguments[0],s=arguments[1],l=arguments[2],u=arguments[3];this._edge=o,this.init(s,l),this._label=u}};vh.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:Gr.computeOrientation(e._p0,e._p1,this._p1)};vh.prototype.getDy=function(){return this._dy};vh.prototype.getCoordinate=function(){return this._p0};vh.prototype.setNode=function(e){this._node=e};vh.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),a=r.substring(i+1);e.print(" "+a+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)};vh.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)};vh.prototype.getDirectedCoordinate=function(){return this._p1};vh.prototype.getDx=function(){return this._dx};vh.prototype.getLabel=function(){return this._label};vh.prototype.getEdge=function(){return this._edge};vh.prototype.getQuadrant=function(){return this._quadrant};vh.prototype.getNode=function(){return this._node};vh.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),r=t.lastIndexOf("."),i=t.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label};vh.prototype.computeLabel=function(e){};vh.prototype.init=function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Eo.quadrant(this._dx,this._dy),mi.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")};vh.prototype.interfaces_=function(){return[$d]};vh.prototype.getClass=function(){return vh};var Vre=function(n){function e(){var t=arguments[0],r=arguments[1];if(n.call(this,t),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var i=t.getNumPoints()-1;this.init(t.getCoordinate(i),t.getCoordinate(i-1))}this.computeDirectedLabel()}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(r){return this._depth[r]},e.prototype.setVisited=function(r){this._isVisited=r},e.prototype.computeDirectedLabel=function(){this._label=new fo(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new wm("assigned depths do not match",this.getCoordinate());this._depth[r]=i},e.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,a=0;a<2;a++)r._label.isArea(a)&&r._label.getLocation(a,wr.LEFT)===dt.INTERIOR&&r._label.getLocation(a,wr.RIGHT)===dt.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(r){this._nextMin=r},e.prototype.print=function(r){n.prototype.print.call(this,r),r.print(" "+this._depth[wr.LEFT]+"/"+this._depth[wr.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},e.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},e.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,dt.EXTERIOR),a=!this._label.isArea(1)||this._label.allPositionsEqual(1,dt.EXTERIOR);return r&&i&&a},e.prototype.setEdgeRing=function(r){this._edgeRing=r},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},e.prototype.setInResult=function(r){this._isInResult=r},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},e.prototype.setSym=function(r){this._sym=r},e.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},e.prototype.setEdgeDepths=function(r,i){var a=this.getEdge().getDepthDelta();this._isForward||(a=-a);var o=1;r===wr.LEFT&&(o=-1);var s=wr.opposite(r),l=a*o,u=i+l;this.setDepth(r,i),this.setDepth(s,u)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(r){this._next=r},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(r,i){return r===dt.EXTERIOR&&i===dt.INTERIOR?1:r===dt.INTERIOR&&i===dt.EXTERIOR?-1:0},e}(vh),lI=function(){};lI.prototype.createNode=function(e){return new G$(e,null)};lI.prototype.interfaces_=function(){return[]};lI.prototype.getClass=function(){return lI};var Ps=function(){if(this._edges=new Pr,this._nodes=null,this._edgeEndList=new Pr,arguments.length===0)this._nodes=new Kp(new lI);else if(arguments.length===1){var e=arguments[0];this._nodes=new Kp(e)}};Ps.prototype.printEdges=function(e){var t=this;e.println("Edges:");for(var r=0;r<this._edges.size();r++){e.println("edge "+r+":");var i=t._edges.get(r);i.print(e),i.eiList.print(e)}};Ps.prototype.find=function(e){return this._nodes.find(e)};Ps.prototype.addNode=function(){if(arguments[0]instanceof G$){var e=arguments[0];return this._nodes.addNode(e)}else if(arguments[0]instanceof tt){var t=arguments[0];return this._nodes.addNode(t)}};Ps.prototype.getNodeIterator=function(){return this._nodes.iterator()};Ps.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkResultDirectedEdges()}};Ps.prototype.debugPrintln=function(e){zu.out.println(e)};Ps.prototype.isBoundaryNode=function(e,t){var r=this._nodes.find(t);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(e)===dt.BOUNDARY};Ps.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkAllDirectedEdges()}};Ps.prototype.matchInSameDirection=function(e,t,r,i){return e.equals(r)?Gr.computeOrientation(e,t,i)===Gr.COLLINEAR&&Eo.quadrant(e,t)===Eo.quadrant(r,i):!1};Ps.prototype.getEdgeEnds=function(){return this._edgeEndList};Ps.prototype.debugPrint=function(e){zu.out.print(e)};Ps.prototype.getEdgeIterator=function(){return this._edges.iterator()};Ps.prototype.findEdgeInSameDirection=function(e,t){for(var r=this,i=0;i<this._edges.size();i++){var a=r._edges.get(i),o=a.getCoordinates();if(r.matchInSameDirection(e,t,o[0],o[1])||r.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return a}return null};Ps.prototype.insertEdge=function(e){this._edges.add(e)};Ps.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var r=t.next();if(r.getEdge()===e)return r}return null};Ps.prototype.addEdges=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next();t._edges.add(i);var a=new Vre(i,!0),o=new Vre(i,!1);a.setSym(o),o.setSym(a),t.add(a),t.add(o)}};Ps.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)};Ps.prototype.getNodes=function(){return this._nodes.values()};Ps.prototype.findEdge=function(e,t){for(var r=this,i=0;i<this._edges.size();i++){var a=r._edges.get(i),o=a.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return a}return null};Ps.prototype.interfaces_=function(){return[]};Ps.prototype.getClass=function(){return Ps};Ps.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){var r=t.next();r.getEdges().linkResultDirectedEdges()}};var Qc=function(){this._geometryFactory=null,this._shellList=new Pr;var e=arguments[0];this._geometryFactory=e};Qc.prototype.sortShellsAndHoles=function(e,t,r){for(var i=e.iterator();i.hasNext();){var a=i.next();a.isHole()?r.add(a):t.add(a)}};Qc.prototype.computePolygons=function(e){for(var t=this,r=new Pr,i=e.iterator();i.hasNext();){var a=i.next(),o=a.toPolygon(t._geometryFactory);r.add(o)}return r};Qc.prototype.placeFreeHoles=function(e,t){for(var r=this,i=t.iterator();i.hasNext();){var a=i.next();if(a.getShell()===null){var o=r.findEdgeRingContaining(a,e);if(o===null)throw new wm("unable to assign hole to a shell",a.getCoordinate(0));a.setShell(o)}}};Qc.prototype.buildMinimalEdgeRings=function(e,t,r){for(var i=this,a=new Pr,o=e.iterator();o.hasNext();){var s=o.next();if(s.getMaxNodeDegree()>2){s.linkDirectedEdgesForMinimalEdgeRings();var l=s.buildMinimalRings(),u=i.findShell(l);u!==null?(i.placePolygonHoles(u,l),t.add(u)):r.addAll(l)}else a.add(s)}return a};Qc.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var r=t.next();if(r.containsPoint(e))return!0}return!1};Qc.prototype.buildMaximalEdgeRings=function(e){for(var t=this,r=new Pr,i=e.iterator();i.hasNext();){var a=i.next();if(a.isInResult()&&a.getLabel().isArea()&&a.getEdgeRing()===null){var o=new Wzr(a,t._geometryFactory);r.add(o),o.setInResult()}}return r};Qc.prototype.placePolygonHoles=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(e)}};Qc.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e};Qc.prototype.findEdgeRingContaining=function(e,t){for(var r=e.getLinearRing(),i=r.getEnvelopeInternal(),a=r.getCoordinateN(0),o=null,s=null,l=t.iterator();l.hasNext();){var u=l.next(),h=u.getLinearRing(),c=h.getEnvelopeInternal();o!==null&&(s=o.getLinearRing().getEnvelopeInternal());var f=!1;c.contains(i)&&Gr.isPointInRing(a,h.getCoordinates())&&(f=!0),f&&(o===null||s.contains(c))&&(o=u)}return o};Qc.prototype.findShell=function(e){for(var t=0,r=null,i=e.iterator();i.hasNext();){var a=i.next();a.isHole()||(r=a,t++)}return mi.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),r};Qc.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],r=arguments[1];Ps.linkResultDirectedEdges(r);var i=this.buildMaximalEdgeRings(t),a=new Pr,o=this.buildMinimalEdgeRings(i,this._shellList,a);this.sortShellsAndHoles(o,this._shellList,a),this.placeFreeHoles(this._shellList,a)}};Qc.prototype.interfaces_=function(){return[]};Qc.prototype.getClass=function(){return Qc};var uI=function(){};uI.prototype.getBounds=function(){};uI.prototype.interfaces_=function(){return[]};uI.prototype.getClass=function(){return uI};var Lv=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};Lv.prototype.getItem=function(){return this._item};Lv.prototype.getBounds=function(){return this._bounds};Lv.prototype.interfaces_=function(){return[uI,Wd]};Lv.prototype.getClass=function(){return Lv};var bm=function(){this._size=null,this._items=null,this._size=0,this._items=new Pr,this._items.add(null)};bm.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e};bm.prototype.size=function(){return this._size};bm.prototype.reorder=function(e){for(var t=this,r=null,i=this._items.get(e);e*2<=this._size&&(r=e*2,r!==t._size&&t._items.get(r+1).compareTo(t._items.get(r))<0&&r++,t._items.get(r).compareTo(i)<0);e=r)t._items.set(e,t._items.get(r));this._items.set(e,i)};bm.prototype.clear=function(){this._size=0,this._items.clear()};bm.prototype.isEmpty=function(){return this._size===0};bm.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)t._items.set(r,t._items.get(Math.trunc(r/2)));this._items.set(r,e)};bm.prototype.interfaces_=function(){return[]};bm.prototype.getClass=function(){return bm};var w_=function(){};w_.prototype.visitItem=function(e){};w_.prototype.interfaces_=function(){return[]};w_.prototype.getClass=function(){return w_};var L2=function(){};L2.prototype.insert=function(e,t){};L2.prototype.remove=function(e,t){};L2.prototype.query=function(){};L2.prototype.interfaces_=function(){return[]};L2.prototype.getClass=function(){return L2};var Ol=function(){if(this._childBoundables=new Pr,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}},NJe={serialVersionUID:{configurable:!0}};Ol.prototype.getLevel=function(){return this._level};Ol.prototype.size=function(){return this._childBoundables.size()};Ol.prototype.getChildBoundables=function(){return this._childBoundables};Ol.prototype.addChildBoundable=function(e){mi.isTrue(this._bounds===null),this._childBoundables.add(e)};Ol.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};Ol.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};Ol.prototype.interfaces_=function(){return[uI,Wd]};Ol.prototype.getClass=function(){return Ol};NJe.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(Ol,NJe);var Pv=function(){};Pv.reverseOrder=function(){return{compare:function(t,r){return r.compareTo(t)}}};Pv.min=function(e){return Pv.sort(e),e.get(0)};Pv.sort=function(e,t){var r=e.toArray();t?IS.sort(r,t):IS.sort(r);for(var i=e.iterator(),a=0,o=r.length;a<o;a++)i.next(),i.set(r[a])};Pv.singletonList=function(e){var t=new Pr;return t.add(e),t};var fl=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],r=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=r,this._distance=this.distance()};fl.prototype.expandToQueue=function(e,t){var r=fl.isComposite(this._boundable1),i=fl.isComposite(this._boundable2);if(r&&i)return fl.area(this._boundable1)>fl.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(r)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Ss("neither boundable is composite")};fl.prototype.isLeaves=function(){return!(fl.isComposite(this._boundable1)||fl.isComposite(this._boundable2))};fl.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0};fl.prototype.expand=function(e,t,r,i){for(var a=this,o=e.getChildBoundables(),s=o.iterator();s.hasNext();){var l=s.next(),u=new fl(l,t,a._itemDistance);u.getDistance()<i&&r.add(u)}};fl.prototype.getBoundable=function(e){return e===0?this._boundable1:this._boundable2};fl.prototype.getDistance=function(){return this._distance};fl.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())};fl.prototype.interfaces_=function(){return[$d]};fl.prototype.getClass=function(){return fl};fl.area=function(e){return e.getBounds().getArea()};fl.isComposite=function(e){return e instanceof Ol};var du=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new Pr,this._nodeCapacity=null,arguments.length===0){var e=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var t=arguments[0];mi.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},z$={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};du.prototype.getNodeCapacity=function(){return this._nodeCapacity};du.prototype.lastNode=function(e){return e.get(e.size()-1)};du.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],r=0,i=t.getChildBoundables().iterator();i.hasNext();){var a=i.next();a instanceof Ol?r+=e.size(a):a instanceof Lv&&(r+=1)}return r}};du.prototype.removeItem=function(e,t){for(var r=null,i=e.getChildBoundables().iterator();i.hasNext();){var a=i.next();a instanceof Lv&&a.getItem()===t&&(r=a)}return r!==null?(e.getChildBoundables().remove(r),!0):!1};du.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new Pr:t}else if(arguments.length===1){for(var r=arguments[0],i=new Pr,a=r.getChildBoundables().iterator();a.hasNext();){var o=a.next();if(o instanceof Ol){var s=e.itemsTree(o);s!==null&&i.add(s)}else o instanceof Lv?i.add(o.getItem()):mi.shouldNeverReachHere()}return i.size()<=0?null:i}};du.prototype.insert=function(e,t){mi.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Lv(e,t))};du.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],r=new Pr;return this.boundablesAtLevel(t,this._root,r),r}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2];if(mi.isTrue(i>-2),a.getLevel()===i)return o.add(a),null;for(var s=a.getChildBoundables().iterator();s.hasNext();){var l=s.next();l instanceof Ol?e.boundablesAtLevel(i,l,o):(mi.isTrue(l instanceof Lv),i===-1&&o.add(l))}return null}};du.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var r=new Pr;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,r),r}else if(arguments.length===2){var i=arguments[0],a=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,a)}else if(arguments.length===3){if(zn(arguments[2],w_)&&arguments[0]instanceof Object&&arguments[1]instanceof Ol)for(var o=arguments[0],s=arguments[1],l=arguments[2],u=s.getChildBoundables(),h=0;h<u.size();h++){var c=u.get(h);!e.getIntersectsOp().intersects(c.getBounds(),o)||(c instanceof Ol?e.query(o,c,l):c instanceof Lv?l.visitItem(c.getItem()):mi.shouldNeverReachHere())}else if(zn(arguments[2],wv)&&arguments[0]instanceof Object&&arguments[1]instanceof Ol)for(var f=arguments[0],d=arguments[1],v=arguments[2],p=d.getChildBoundables(),g=0;g<p.size();g++){var m=p.get(g);!e.getIntersectsOp().intersects(m.getBounds(),f)||(m instanceof Ol?e.query(f,m,v):m instanceof Lv?v.add(m.getItem()):mi.shouldNeverReachHere())}}};du.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0};du.prototype.getRoot=function(){return this.build(),this._root};du.prototype.remove=function(){var e=this;if(arguments.length===2){var t=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),t)?this.remove(t,this._root,r):!1}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2],s=this.removeItem(a,o);if(s)return!0;for(var l=null,u=a.getChildBoundables().iterator();u.hasNext();){var h=u.next();if(!!e.getIntersectsOp().intersects(h.getBounds(),i)&&h instanceof Ol&&(s=e.remove(i,h,o),s)){l=h;break}}return l!==null&&l.getChildBoundables().isEmpty()&&a.getChildBoundables().remove(l),s}};du.prototype.createHigherLevels=function(e,t){mi.isTrue(!e.isEmpty());var r=this.createParentBoundables(e,t+1);return r.size()===1?r.get(0):this.createHigherLevels(r,t+1)};du.prototype.depth=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var t=arguments[0],r=0,i=t.getChildBoundables().iterator();i.hasNext();){var a=i.next();if(a instanceof Ol){var o=e.depth(a);o>r&&(r=o)}}return r+1}};du.prototype.createParentBoundables=function(e,t){var r=this;mi.isTrue(!e.isEmpty());var i=new Pr;i.add(this.createNode(t));var a=new Pr(e);Pv.sort(a,this.getComparator());for(var o=a.iterator();o.hasNext();){var s=o.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(t)),r.lastNode(i).addChildBoundable(s)}return i};du.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};du.prototype.interfaces_=function(){return[Wd]};du.prototype.getClass=function(){return du};du.compareDoubles=function(e,t){return e>t?1:e<t?-1:0};z$.IntersectsOp.get=function(){return Hzr};z$.serialVersionUID.get=function(){return-3886435814360241e3};z$.DEFAULT_NODE_CAPACITY.get=function(){return 10};Object.defineProperties(du,z$);var Hzr=function(){},hI=function(){};hI.prototype.distance=function(e,t){};hI.prototype.interfaces_=function(){return[]};hI.prototype.getClass=function(){return hI};var kJe=function(n){function e(r){r=r||e.DEFAULT_NODE_CAPACITY,n.call(this,r)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(i,a){var o=this;mi.isTrue(i.length>0);for(var s=new Pr,l=0;l<i.length;l++)s.addAll(o.createParentBoundablesFromVerticalSlice(i[l],a));return s},e.prototype.createNode=function(i){return new ILe(i)},e.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];if(i.isNull())return null;n.prototype.insert.call(this,i,a)}else return n.prototype.insert.apply(this,arguments)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(i,a){for(var o=Math.trunc(Math.ceil(i.size()/a)),s=new Array(a).fill(null),l=i.iterator(),u=0;u<a;u++){s[u]=new Pr;for(var h=0;l.hasNext()&&h<o;){var c=l.next();s[u].add(c),h++}}return s},e.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return n.prototype.query.call(this,i)}else if(arguments.length===2){var a=arguments[0],o=arguments[1];n.prototype.query.call(this,a,o)}else if(arguments.length===3){if(zn(arguments[2],w_)&&arguments[0]instanceof Object&&arguments[1]instanceof Ol){var s=arguments[0],l=arguments[1],u=arguments[2];n.prototype.query.call(this,s,l,u)}else if(zn(arguments[2],wv)&&arguments[0]instanceof Object&&arguments[1]instanceof Ol){var h=arguments[0],c=arguments[1],f=arguments[2];n.prototype.query.call(this,h,c,f)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(i,a){return n.prototype.createParentBoundables.call(this,i,a)},e.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],a=arguments[1];return n.prototype.remove.call(this,i,a)}else return n.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(i,a){mi.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),s=new Pr(i);Pv.sort(s,e.xComparator);var l=this.verticalSlices(s,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(l,a)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(zn(arguments[0],hI)){var i=arguments[0],a=new fl(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(a)}else if(arguments[0]instanceof fl){var o=arguments[0];return this.nearestNeighbour(o,ui.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&zn(arguments[1],hI)){var s=arguments[0],l=arguments[1],u=new fl(this.getRoot(),s.getRoot(),l);return this.nearestNeighbour(u)}else if(arguments[0]instanceof fl&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=c,d=null,v=new bm;for(v.add(h);!v.isEmpty()&&f>0;){var p=v.poll(),g=p.getDistance();if(g>=f)break;p.isLeaves()?(f=g,d=p):p.expandToQueue(v,f)}return[d.getBoundable(0).getItem(),d.getBoundable(1).getItem()]}}else if(arguments.length===3){var m=arguments[0],y=arguments[1],_=arguments[2],x=new Lv(m,y),S=new fl(this.getRoot(),x,_);return this.nearestNeighbour(S)[0]}},e.prototype.interfaces_=function(){return[L2,Wd]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,a){return(i+a)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},t.STRtreeNode.get=function(){return ILe},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[eI]},compare:function(r,i){return n.compareDoubles(e.centreX(r.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[eI]},compare:function(r,i){return n.compareDoubles(e.centreY(r.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(du),ILe=function(n){function e(){var t=arguments[0];n.call(this,t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var a=i.next();r===null?r=new gn(a.getBounds()):r.expandToInclude(a.getBounds())}return r},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ol),ac=function(){};ac.prototype.interfaces_=function(){return[]};ac.prototype.getClass=function(){return ac};ac.relativeSign=function(e,t){return e<t?-1:e>t?1:0};ac.compare=function(e,t,r){if(t.equals2D(r))return 0;var i=ac.relativeSign(t.x,r.x),a=ac.relativeSign(t.y,r.y);switch(e){case 0:return ac.compareValue(i,a);case 1:return ac.compareValue(a,i);case 2:return ac.compareValue(a,-i);case 3:return ac.compareValue(-i,a);case 4:return ac.compareValue(-i,-a);case 5:return ac.compareValue(-a,-i);case 6:return ac.compareValue(-a,i);case 7:return ac.compareValue(i,-a)}return mi.shouldNeverReachHere("invalid octant value"),0};ac.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var b_=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this._segString=e,this.coord=new tt(t),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(r))};b_.prototype.getCoordinate=function(){return this.coord};b_.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)};b_.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:ac.compare(this._segmentOctant,this.coord,t.coord)};b_.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e};b_.prototype.isInterior=function(){return this._isInterior};b_.prototype.interfaces_=function(){return[$d]};b_.prototype.getClass=function(){return b_};var Zh=function(){this._nodeMap=new dh,this._edge=null;var e=arguments[0];this._edge=e};Zh.prototype.getSplitCoordinates=function(){var e=this,t=new Qk;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var a=r.next();e.addEdgeCoordinates(i,a,t),i=a}return t.toCoordinateArray()};Zh.prototype.addCollapsedNodes=function(){var e=this,t=new Pr;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var r=t.iterator();r.hasNext();){var i=r.next().intValue();e.add(e._edge.getCoordinate(i),i)}};Zh.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}};Zh.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,r=0;r<this._edge.size()-2;r++){var i=t._edge.getCoordinate(r),a=t._edge.getCoordinate(r+2);i.equals2D(a)&&e.add(new jp(r+1))}};Zh.prototype.addEdgeCoordinates=function(e,t,r){var i=this,a=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(a);r.add(new tt(e.coord),!1);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)r.add(i._edge.getCoordinate(s));o&&r.add(new tt(t.coord))};Zh.prototype.iterator=function(){return this._nodeMap.values().iterator()};Zh.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var a=r.next(),o=t.createSplitEdge(i,a);e.add(o),i=a}};Zh.prototype.findCollapseIndex=function(e,t,r){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1?(r[0]=e.segmentIndex+1,!0):!1};Zh.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=this,r=new Array(1).fill(null),i=this.iterator(),a=i.next();i.hasNext();){var o=i.next(),s=t.findCollapseIndex(a,o,r);s&&e.add(new jp(r[0])),a=o}};Zh.prototype.getEdge=function(){return this._edge};Zh.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)};Zh.prototype.createSplitEdge=function(e,t){var r=this,i=t.segmentIndex-e.segmentIndex+2,a=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(a);o||i--;var s=new Array(i).fill(null),l=0;s[l++]=new tt(e.coord);for(var u=e.segmentIndex+1;u<=t.segmentIndex;u++)s[l++]=r._edge.getCoordinate(u);return o&&(s[l]=new tt(t.coord)),new al(s,this._edge.getData())};Zh.prototype.add=function(e,t){var r=new b_(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(r);return i!==null?(mi.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)};Zh.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),r=e.get(0),i=r.getCoordinate(0);if(!i.equals2D(t[0]))throw new xm("bad split edge start point at "+i);var a=e.get(e.size()-1),o=a.getCoordinates(),s=o[o.length-1];if(!s.equals2D(t[t.length-1]))throw new xm("bad split edge end point at "+s)};Zh.prototype.interfaces_=function(){return[]};Zh.prototype.getClass=function(){return Zh};var P2=function(){};P2.prototype.interfaces_=function(){return[]};P2.prototype.getClass=function(){return P2};P2.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Ss("Cannot compute the octant for point ( "+e+", "+t+" )");var r=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?r>=i?0:1:r>=i?7:6:t>=0?r>=i?3:2:r>=i?4:5}else if(arguments[0]instanceof tt&&arguments[1]instanceof tt){var a=arguments[0],o=arguments[1],s=o.x-a.x,l=o.y-a.y;if(s===0&&l===0)throw new Ss("Cannot compute the octant for two identical points "+a);return P2.octant(s,l)}};var T0=function(){};T0.prototype.getCoordinates=function(){};T0.prototype.size=function(){};T0.prototype.getCoordinate=function(e){};T0.prototype.isClosed=function(){};T0.prototype.setData=function(e){};T0.prototype.getData=function(){};T0.prototype.interfaces_=function(){return[]};T0.prototype.getClass=function(){return T0};var GN=function(){};GN.prototype.addIntersection=function(e,t){};GN.prototype.interfaces_=function(){return[T0]};GN.prototype.getClass=function(){return GN};var al=function(){this._nodeList=new Zh(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};al.prototype.getCoordinates=function(){return this._pts};al.prototype.size=function(){return this._pts.length};al.prototype.getCoordinate=function(e){return this._pts[e]};al.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};al.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))};al.prototype.setData=function(e){this._data=e};al.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:P2.octant(e,t)};al.prototype.getData=function(){return this._data};al.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[3],o=new tt(r.getIntersection(a));this.addIntersection(o,i)}};al.prototype.toString=function(){return Mv.toLineString(new el(this._pts))};al.prototype.getNodeList=function(){return this._nodeList};al.prototype.addIntersectionNode=function(e,t){var r=t,i=r+1;if(i<this._pts.length){var a=this._pts[i];e.equals2D(a)&&(r=i)}var o=this._nodeList.add(e,r);return o};al.prototype.addIntersections=function(e,t,r){for(var i=this,a=0;a<e.getIntersectionNum();a++)i.addIntersection(e,t,r,a)};al.prototype.interfaces_=function(){return[GN]};al.prototype.getClass=function(){return al};al.getNodedSubstrings=function(){if(arguments.length===1){var e=arguments[0],t=new Pr;return al.getNodedSubstrings(e,t),t}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],a=r.iterator();a.hasNext();){var o=a.next();o.getNodeList().addSplitEdges(i)}};var wn=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new tt,this.p1=new tt;else if(arguments.length===1){var e=arguments[0];this.p0=new tt(e.p0),this.p1=new tt(e.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var t=arguments[0],r=arguments[1],i=arguments[2],a=arguments[3];this.p0=new tt(t,r),this.p1=new tt(i,a)}},FJe={serialVersionUID:{configurable:!0}};wn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)};wn.prototype.orientationIndex=function(){if(arguments[0]instanceof wn){var e=arguments[0],t=Gr.orientationIndex(this.p0,this.p1,e.p0),r=Gr.orientationIndex(this.p0,this.p1,e.p1);return t>=0&&r>=0||t<=0&&r<=0?Math.max(t,r):0}else if(arguments[0]instanceof tt){var i=arguments[0];return Gr.orientationIndex(this.p0,this.p1,i)}};wn.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])};wn.prototype.isVertical=function(){return this.p0.x===this.p1.x};wn.prototype.equals=function(e){if(!(e instanceof wn))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)};wn.prototype.intersection=function(e){var t=new Ow;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null};wn.prototype.project=function(){if(arguments[0]instanceof tt){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new tt(e);var t=this.projectionFactor(e),r=new tt;return r.x=this.p0.x+t*(this.p1.x-this.p0.x),r.y=this.p0.y+t*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof wn){var i=arguments[0],a=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(a>=1&&o>=1||a<=0&&o<=0)return null;var s=this.project(i.p0);a<0&&(s=this.p0),a>1&&(s=this.p1);var l=this.project(i.p1);return o<0&&(l=this.p0),o>1&&(l=this.p1),new wn(s,l)}};wn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};wn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};wn.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1};wn.prototype.distancePerpendicular=function(e){return Gr.distancePointLinePerpendicular(e,this.p0,this.p1)};wn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};wn.prototype.midPoint=function(){return wn.midPoint(this.p0,this.p1)};wn.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,i=t*t+r*r;if(i<=0)return ui.NaN;var a=((e.x-this.p0.x)*t+(e.y-this.p0.y)*r)/i;return a};wn.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var r=new Array(2).fill(null),i=ui.MAX_VALUE,a=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),r[0]=o,r[1]=e.p0;var s=this.closestPoint(e.p1);a=s.distance(e.p1),a<i&&(i=a,r[0]=s,r[1]=e.p1);var l=e.closestPoint(this.p0);a=l.distance(this.p0),a<i&&(i=a,r[0]=this.p0,r[1]=l);var u=e.closestPoint(this.p1);return a=u.distance(this.p1),a<i&&(i=a,r[0]=this.p1,r[1]=u),r};wn.prototype.closestPoint=function(e){var t=this.projectionFactor(e);if(t>0&&t<1)return this.project(e);var r=this.p0.distance(e),i=this.p1.distance(e);return r<i?this.p0:this.p1};wn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)};wn.prototype.getLength=function(){return this.p0.distance(this.p1)};wn.prototype.compareTo=function(e){var t=e,r=this.p0.compareTo(t.p0);return r!==0?r:this.p1.compareTo(t.p1)};wn.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e};wn.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)};wn.prototype.lineIntersection=function(e){try{var t=Sv.intersection(this.p0,this.p1,e.p0,e.p1);return t}catch(r){if(!(r instanceof gL))throw r}finally{}return null};wn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)};wn.prototype.pointAlongOffset=function(e,t){var r=this.p0.x+e*(this.p1.x-this.p0.x),i=this.p0.y+e*(this.p1.y-this.p0.y),a=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(a*a+o*o),l=0,u=0;if(t!==0){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");l=t*a/s,u=t*o/s}var h=r-u,c=i+l,f=new tt(h,c);return f};wn.prototype.setCoordinates=function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=r.x,this.p1.y=r.y}};wn.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||ui.isNaN(t))&&(t=1),t};wn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};wn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};wn.prototype.distance=function(){if(arguments[0]instanceof wn){var e=arguments[0];return Gr.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof tt){var t=arguments[0];return Gr.distancePointLine(t,this.p0,this.p1)}};wn.prototype.pointAlong=function(e){var t=new tt;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t};wn.prototype.hashCode=function(){var e=ui.doubleToLongBits(this.p0.x);e^=ui.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),r=ui.doubleToLongBits(this.p1.x);r^=ui.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return t^i};wn.prototype.interfaces_=function(){return[$d,Wd]};wn.prototype.getClass=function(){return wn};wn.midPoint=function(e,t){return new tt((e.x+t.x)/2,(e.y+t.y)/2)};FJe.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(wn,FJe);var zN=function(){this.tempEnv1=new gn,this.tempEnv2=new gn,this._overlapSeg1=new wn,this._overlapSeg2=new wn};zN.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}};zN.prototype.interfaces_=function(){return[]};zN.prototype.getClass=function(){return zN};var ef=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=r,this._context=i};ef.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]};ef.prototype.computeSelect=function(e,t,r,i){var a=this._pts[t],o=this._pts[r];if(i.tempEnv1.init(a,o),r-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var s=Math.trunc((t+r)/2);t<s&&this.computeSelect(e,t,s,i),s<r&&this.computeSelect(e,s,r,i)};ef.prototype.getCoordinates=function(){for(var e=this,t=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)t[r++]=e._pts[i];return t};ef.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)};ef.prototype.setId=function(e){this._id=e};ef.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)};ef.prototype.getEnvelope=function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new gn(e,t)}return this._env};ef.prototype.getEndIndex=function(){return this._end};ef.prototype.getStartIndex=function(){return this._start};ef.prototype.getContext=function(){return this._context};ef.prototype.getId=function(){return this._id};ef.prototype.computeOverlapsInternal=function(e,t,r,i,a,o){var s=this._pts[e],l=this._pts[t],u=r._pts[i],h=r._pts[a];if(t-e===1&&a-i===1)return o.overlap(this,e,r,i),null;if(o.tempEnv1.init(s,l),o.tempEnv2.init(u,h),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((e+t)/2),f=Math.trunc((i+a)/2);e<c&&(i<f&&this.computeOverlapsInternal(e,c,r,i,f,o),f<a&&this.computeOverlapsInternal(e,c,r,f,a,o)),c<t&&(i<f&&this.computeOverlapsInternal(c,t,r,i,f,o),f<a&&this.computeOverlapsInternal(c,t,r,f,a,o))};ef.prototype.interfaces_=function(){return[]};ef.prototype.getClass=function(){return ef};var zp=function(){};zp.prototype.interfaces_=function(){return[]};zp.prototype.getClass=function(){return zp};zp.getChainStartIndices=function(e){var t=0,r=new Pr;r.add(new jp(t));do{var i=zp.findChainEnd(e,t);r.add(new jp(i)),t=i}while(t<e.length-1);var a=zp.toIntArray(r);return a};zp.findChainEnd=function(e,t){for(var r=t;r<e.length-1&&e[r].equals2D(e[r+1]);)r++;if(r>=e.length-1)return e.length-1;for(var i=Eo.quadrant(e[r],e[r+1]),a=t+1;a<e.length;){if(!e[a-1].equals2D(e[a])){var o=Eo.quadrant(e[a-1],e[a]);if(o!==i)break}a++}return a-1};zp.getChains=function(){if(arguments.length===1){var e=arguments[0];return zp.getChains(e,null)}else if(arguments.length===2){for(var t=arguments[0],r=arguments[1],i=new Pr,a=zp.getChainStartIndices(t),o=0;o<a.length-1;o++){var s=new ef(t,a[o],a[o+1],r);i.add(s)}return i}};zp.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),r=0;r<t.length;r++)t[r]=e.get(r).intValue();return t};var uw=function(){};uw.prototype.computeNodes=function(e){};uw.prototype.getNodedSubstrings=function(){};uw.prototype.interfaces_=function(){return[]};uw.prototype.getClass=function(){return uw};var UN=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}};UN.prototype.setSegmentIntersector=function(e){this._segInt=e};UN.prototype.interfaces_=function(){return[uw]};UN.prototype.getClass=function(){return UN};var Mce=function(n){function e(r){r?n.call(this,r):n.call(this),this._monoChains=new Pr,this._index=new kJe,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return al.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(i){for(var a=this,o=zp.getChains(i.getCoordinates(),i),s=o.iterator();s.hasNext();){var l=s.next();l.setId(a._idCounter++),a._index.insert(l.getEnvelope(),l),a._monoChains.add(l)}},e.prototype.computeNodes=function(i){var a=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)a.add(o.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var i=this,a=new LLe(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var s=o.next(),l=i._index.query(s.getEnvelope()),u=l.iterator();u.hasNext();){var h=u.next();if(h.getId()>s.getId()&&(s.computeOverlaps(h,a),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return LLe},Object.defineProperties(e,t),e}(UN),LLe=function(n){function e(){n.call(this),this._si=null;var t=arguments[0];this._si=t}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],o=arguments[3],s=r.getContext(),l=a.getContext();this._si.processIntersections(s,i,l,o)}else return n.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zN),eo=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(a),this.setJoinStyle(o),this.setMitreLimit(s)}}},Um={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};eo.prototype.getEndCapStyle=function(){return this._endCapStyle};eo.prototype.isSingleSided=function(){return this._isSingleSided};eo.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=eo.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=eo.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==eo.JOIN_ROUND&&(this._quadrantSegments=eo.DEFAULT_QUADRANT_SEGMENTS)};eo.prototype.getJoinStyle=function(){return this._joinStyle};eo.prototype.setJoinStyle=function(e){this._joinStyle=e};eo.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e};eo.prototype.getSimplifyFactor=function(){return this._simplifyFactor};eo.prototype.getQuadrantSegments=function(){return this._quadrantSegments};eo.prototype.setEndCapStyle=function(e){this._endCapStyle=e};eo.prototype.getMitreLimit=function(){return this._mitreLimit};eo.prototype.setMitreLimit=function(e){this._mitreLimit=e};eo.prototype.setSingleSided=function(e){this._isSingleSided=e};eo.prototype.interfaces_=function(){return[]};eo.prototype.getClass=function(){return eo};eo.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)};Um.CAP_ROUND.get=function(){return 1};Um.CAP_FLAT.get=function(){return 2};Um.CAP_SQUARE.get=function(){return 3};Um.JOIN_ROUND.get=function(){return 1};Um.JOIN_MITRE.get=function(){return 2};Um.JOIN_BEVEL.get=function(){return 3};Um.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};Um.DEFAULT_MITRE_LIMIT.get=function(){return 5};Um.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(eo,Um);var Hs=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Gr.COUNTERCLOCKWISE,this._inputLine=e||null},rF={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Hs.prototype.isDeletable=function(e,t,r,i){var a=this._inputLine[e],o=this._inputLine[t],s=this._inputLine[r];return!this.isConcave(a,o,s)||!this.isShallow(a,o,s,i)?!1:this.isShallowSampled(a,o,e,r,i)};Hs.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,r=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(r),a=!1;i<this._inputLine.length;){var o=!1;e.isDeletable(t,r,i,e._distanceTol)&&(e._isDeleted[r]=Hs.DELETE,o=!0,a=!0),o?t=i:t=r,r=e.findNextNonDeletedIndex(t),i=e.findNextNonDeletedIndex(r)}return a};Hs.prototype.isShallowConcavity=function(e,t,r,i){var a=Gr.computeOrientation(e,t,r),o=a===this._angleOrientation;if(!o)return!1;var s=Gr.distancePointLine(t,e,r);return s<i};Hs.prototype.isShallowSampled=function(e,t,r,i,a){var o=this,s=Math.trunc((i-r)/Hs.NUM_PTS_TO_CHECK);s<=0&&(s=1);for(var l=r;l<i;l+=s)if(!o.isShallow(e,t,o._inputLine[l],a))return!1;return!0};Hs.prototype.isConcave=function(e,t,r){var i=Gr.computeOrientation(e,t,r),a=i===this._angleOrientation;return a};Hs.prototype.simplify=function(e){var t=this;this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=Gr.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var r=!1;do r=t.deleteShallowConcavities();while(r);return this.collapseLine()};Hs.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===Hs.DELETE;)t++;return t};Hs.prototype.isShallow=function(e,t,r,i){var a=Gr.distancePointLine(t,e,r);return a<i};Hs.prototype.collapseLine=function(){for(var e=this,t=new Qk,r=0;r<this._inputLine.length;r++)e._isDeleted[r]!==Hs.DELETE&&t.add(e._inputLine[r]);return t.toCoordinateArray()};Hs.prototype.interfaces_=function(){return[]};Hs.prototype.getClass=function(){return Hs};Hs.simplify=function(e,t){var r=new Hs(e);return r.simplify(t)};rF.INIT.get=function(){return 0};rF.DELETE.get=function(){return 1};rF.KEEP.get=function(){return 1};rF.NUM_PTS_TO_CHECK.get=function(){return 10};Object.defineProperties(Hs,rF);var $f=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Pr},BJe={COORDINATE_ARRAY_TYPE:{configurable:!0}};$f.prototype.getCoordinates=function(){var e=this._ptList.toArray($f.COORDINATE_ARRAY_TYPE);return e};$f.prototype.setPrecisionModel=function(e){this._precisionModel=e};$f.prototype.addPt=function(e){var t=new tt(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)};$f.prototype.revere=function(){};$f.prototype.addPts=function(e,t){var r=this;if(t)for(var i=0;i<e.length;i++)r.addPt(e[i]);else for(var a=e.length-1;a>=0;a--)r.addPt(e[a])};$f.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),r=e.distance(t);return r<this._minimimVertexDistance};$f.prototype.toString=function(){var e=new Fi,t=e.createLineString(this.getCoordinates());return t.toString()};$f.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var e=new tt(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)};$f.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e};$f.prototype.interfaces_=function(){return[]};$f.prototype.getClass=function(){return $f};BJe.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)};Object.defineProperties($f,BJe);var ea=function(){},ET={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};ea.prototype.interfaces_=function(){return[]};ea.prototype.getClass=function(){return ea};ea.toDegrees=function(e){return e*180/Math.PI};ea.normalize=function(e){for(;e>Math.PI;)e-=ea.PI_TIMES_2;for(;e<=-Math.PI;)e+=ea.PI_TIMES_2;return e};ea.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=r.x-t.x,a=r.y-t.y;return Math.atan2(a,i)}};ea.isAcute=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=r.x-t.x,s=r.y-t.y,l=i*o+a*s;return l>0};ea.isObtuse=function(e,t,r){var i=e.x-t.x,a=e.y-t.y,o=r.x-t.x,s=r.y-t.y,l=i*o+a*s;return l<0};ea.interiorAngle=function(e,t,r){var i=ea.angle(t,e),a=ea.angle(t,r);return Math.abs(a-i)};ea.normalizePositive=function(e){if(e<0){for(;e<0;)e+=ea.PI_TIMES_2;e>=ea.PI_TIMES_2&&(e=0)}else{for(;e>=ea.PI_TIMES_2;)e-=ea.PI_TIMES_2;e<0&&(e=0)}return e};ea.angleBetween=function(e,t,r){var i=ea.angle(t,e),a=ea.angle(t,r);return ea.diff(i,a)};ea.diff=function(e,t){var r=null;return e<t?r=t-e:r=e-t,r>Math.PI&&(r=2*Math.PI-r),r};ea.toRadians=function(e){return e*Math.PI/180};ea.getTurn=function(e,t){var r=Math.sin(t-e);return r>0?ea.COUNTERCLOCKWISE:r<0?ea.CLOCKWISE:ea.NONE};ea.angleBetweenOriented=function(e,t,r){var i=ea.angle(t,e),a=ea.angle(t,r),o=a-i;return o<=-Math.PI?o+ea.PI_TIMES_2:o>Math.PI?o-ea.PI_TIMES_2:o};ET.PI_TIMES_2.get=function(){return 2*Math.PI};ET.PI_OVER_2.get=function(){return Math.PI/2};ET.PI_OVER_4.get=function(){return Math.PI/4};ET.COUNTERCLOCKWISE.get=function(){return Gr.COUNTERCLOCKWISE};ET.CLOCKWISE.get=function(){return Gr.CLOCKWISE};ET.NONE.get=function(){return Gr.COLLINEAR};Object.defineProperties(ea,ET);var us=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new wn,this._seg1=new wn,this._offset0=new wn,this._offset1=new wn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new Ow,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===eo.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},nF={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};us.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=Gr.computeOrientation(this._s0,this._s1,this._s2),i=r===Gr.CLOCKWISE&&this._side===wr.LEFT||r===Gr.COUNTERCLOCKWISE&&this._side===wr.RIGHT;r===0?this.addCollinear(t):i?this.addOutsideTurn(r,t):this.addInsideTurn(r,t)};us.prototype.addLineEndCap=function(e,t){var r=new wn(e,t),i=new wn;this.computeOffsetSegment(r,wr.LEFT,this._distance,i);var a=new wn;this.computeOffsetSegment(r,wr.RIGHT,this._distance,a);var o=t.x-e.x,s=t.y-e.y,l=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case eo.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,l+Math.PI/2,l-Math.PI/2,Gr.CLOCKWISE,this._distance),this._segList.addPt(a.p1);break;case eo.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(a.p1);break;case eo.CAP_SQUARE:var u=new tt;u.x=Math.abs(this._distance)*Math.cos(l),u.y=Math.abs(this._distance)*Math.sin(l);var h=new tt(i.p1.x+u.x,i.p1.y+u.y),c=new tt(a.p1.x+u.x,a.p1.y+u.y);this._segList.addPt(h),this._segList.addPt(c);break}};us.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e};us.prototype.addMitreJoin=function(e,t,r,i){var a=!0,o=null;try{o=Sv.intersection(t.p0,t.p1,r.p0,r.p1);var s=i<=0?1:o.distance(e)/Math.abs(i);s>this._bufParams.getMitreLimit()&&(a=!1)}catch(l){if(l instanceof gL)o=new tt(0,0),a=!1;else throw l}finally{}a?this._segList.addPt(o):this.addLimitedMitreJoin(t,r,i,this._bufParams.getMitreLimit())};us.prototype.addFilletCorner=function(e,t,r,i,a){var o=t.x-e.x,s=t.y-e.y,l=Math.atan2(s,o),u=r.x-e.x,h=r.y-e.y,c=Math.atan2(h,u);i===Gr.CLOCKWISE?l<=c&&(l+=2*Math.PI):l>=c&&(l-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,l,c,i,a),this._segList.addPt(r)};us.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*us.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===eo.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===eo.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))};us.prototype.createSquare=function(e){this._segList.addPt(new tt(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new tt(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new tt(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new tt(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()};us.prototype.addSegments=function(e,t){this._segList.addPts(e,t)};us.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)};us.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)};us.prototype.initSideSegments=function(e,t,r){this._s1=e,this._s2=t,this._side=r,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)};us.prototype.addLimitedMitreJoin=function(e,t,r,i){var a=this._seg0.p1,o=ea.angle(a,this._seg0.p0),s=ea.angleBetweenOriented(this._seg0.p0,a,this._seg1.p1),l=s/2,u=ea.normalize(o+l),h=ea.normalize(u+Math.PI),c=i*r,f=c*Math.abs(Math.sin(l)),d=r-f,v=a.x+c*Math.cos(h),p=a.y+c*Math.sin(h),g=new tt(v,p),m=new wn(a,g),y=m.pointAlongOffset(1,d),_=m.pointAlongOffset(1,-d);this._side===wr.LEFT?(this._segList.addPt(y),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(y))};us.prototype.computeOffsetSegment=function(e,t,r,i){var a=t===wr.LEFT?1:-1,o=e.p1.x-e.p0.x,s=e.p1.y-e.p0.y,l=Math.sqrt(o*o+s*s),u=a*r*o/l,h=a*r*s/l;i.p0.x=e.p0.x-h,i.p0.y=e.p0.y+u,i.p1.x=e.p1.x-h,i.p1.y=e.p1.y+u};us.prototype.addFilletArc=function(e,t,r,i,a){var o=this,s=i===Gr.CLOCKWISE?-1:1,l=Math.abs(t-r),u=Math.trunc(l/this._filletAngleQuantum+.5);if(u<1)return null;for(var h=0,c=l/u,f=h,d=new tt;f<l;){var v=t+s*f;d.x=e.x+a*Math.cos(v),d.y=e.y+a*Math.sin(v),o._segList.addPt(d),f+=c}};us.prototype.addInsideTurn=function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*us.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new tt((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var i=new tt((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};us.prototype.createCircle=function(e){var t=new tt(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};us.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)};us.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new $f,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*us.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};us.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===eo.JOIN_BEVEL||this._bufParams.getJoinStyle()===eo.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Gr.CLOCKWISE,this._distance))};us.prototype.closeRing=function(){this._segList.closeRing()};us.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};us.prototype.interfaces_=function(){return[]};us.prototype.getClass=function(){return us};nF.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};nF.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};nF.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};nF.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(us,nF);var yc=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};yc.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var r=t<0,i=Math.abs(t),a=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],a):this.computeOffsetCurve(e,r,a);var o=a.getCoordinates();return r&&Bi.reverse(o),o};yc.prototype.computeSingleSidedBufferCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);if(t){r.addSegments(e,!0);var a=Hs.simplify(e,-i),o=a.length-1;r.initSideSegments(a[o],a[o-1],wr.LEFT),r.addFirstSegment();for(var s=o-2;s>=0;s--)r.addNextSegment(a[s],!0)}else{r.addSegments(e,!1);var l=Hs.simplify(e,i),u=l.length-1;r.initSideSegments(l[0],l[1],wr.LEFT),r.addFirstSegment();for(var h=2;h<=u;h++)r.addNextSegment(l[h],!0)}r.addLastSegment(),r.closeRing()};yc.prototype.computeRingBufferCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);t===wr.RIGHT&&(i=-i);var a=Hs.simplify(e,i),o=a.length-1;r.initSideSegments(a[o-1],a[0],t);for(var s=1;s<=o;s++){var l=s!==1;r.addNextSegment(a[s],l)}r.closeRing()};yc.prototype.computeLineBufferCurve=function(e,t){var r=this.simplifyTolerance(this._distance),i=Hs.simplify(e,r),a=i.length-1;t.initSideSegments(i[0],i[1],wr.LEFT);for(var o=2;o<=a;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[a-1],i[a]);var s=Hs.simplify(e,-r),l=s.length-1;t.initSideSegments(s[l],s[l-1],wr.LEFT);for(var u=l-2;u>=0;u--)t.addNextSegment(s[u],!0);t.addLastSegment(),t.addLineEndCap(s[1],s[0]),t.closeRing()};yc.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case eo.CAP_ROUND:t.createCircle(e);break;case eo.CAP_SQUARE:t.createSquare(e);break}};yc.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var r=Math.abs(t),i=this.getSegGen(r);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var a=t<0;this.computeSingleSidedBufferCurve(e,a,i)}else this.computeLineBufferCurve(e,i);var o=i.getCoordinates();return o};yc.prototype.getBufferParameters=function(){return this._bufParams};yc.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()};yc.prototype.getRingCurve=function(e,t,r){if(this._distance=r,e.length<=2)return this.getLineCurve(e,r);if(r===0)return yc.copyCoordinates(e);var i=this.getSegGen(r);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()};yc.prototype.computeOffsetCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);if(t){var a=Hs.simplify(e,-i),o=a.length-1;r.initSideSegments(a[o],a[o-1],wr.LEFT),r.addFirstSegment();for(var s=o-2;s>=0;s--)r.addNextSegment(a[s],!0)}else{var l=Hs.simplify(e,i),u=l.length-1;r.initSideSegments(l[0],l[1],wr.LEFT),r.addFirstSegment();for(var h=2;h<=u;h++)r.addNextSegment(l[h],!0)}r.addLastSegment()};yc.prototype.getSegGen=function(e){return new us(this._precisionModel,this._bufParams,e)};yc.prototype.interfaces_=function(){return[]};yc.prototype.getClass=function(){return yc};yc.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),r=0;r<t.length;r++)t[r]=new tt(e[r]);return t};var O2=function(){this._subgraphs=null,this._seg=new wn,this._cga=new Gr;var e=arguments[0];this._subgraphs=e},GJe={DepthSegment:{configurable:!0}};O2.prototype.findStabbedSegments=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],r=new Pr,i=this._subgraphs.iterator();i.hasNext();){var a=i.next(),o=a.getEnvelope();t.y<o.getMinY()||t.y>o.getMaxY()||e.findStabbedSegments(t,a.getDirectedEdges(),r)}return r}else if(arguments.length===3){if(zn(arguments[2],wv)&&arguments[0]instanceof tt&&arguments[1]instanceof Vre)for(var s=arguments[0],l=arguments[1],u=arguments[2],h=l.getEdge().getCoordinates(),c=0;c<h.length-1;c++){e._seg.p0=h[c],e._seg.p1=h[c+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var f=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(f<s.x)&&!e._seg.isHorizontal()&&!(s.y<e._seg.p0.y||s.y>e._seg.p1.y)&&Gr.computeOrientation(e._seg.p0,e._seg.p1,s)!==Gr.RIGHT){var d=l.getDepth(wr.LEFT);e._seg.p0.equals(h[c])||(d=l.getDepth(wr.RIGHT));var v=new hw(e._seg,d);u.add(v)}}else if(zn(arguments[2],wv)&&arguments[0]instanceof tt&&zn(arguments[1],wv))for(var p=arguments[0],g=arguments[1],m=arguments[2],y=g.iterator();y.hasNext();){var _=y.next();!_.isForward()||e.findStabbedSegments(p,_,m)}}};O2.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var r=Pv.min(t);return r._leftDepth};O2.prototype.interfaces_=function(){return[]};O2.prototype.getClass=function(){return O2};GJe.DepthSegment.get=function(){return hw};Object.defineProperties(O2,GJe);var hw=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new wn(e),this._leftDepth=t};hw.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(t._upwardSeg);return r!==0||(r=-1*t._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(t._upwardSeg)};hw.prototype.compareX=function(e,t){var r=e.p0.compareTo(t.p0);return r!==0?r:e.p1.compareTo(t.p1)};hw.prototype.toString=function(){return this._upwardSeg.toString()};hw.prototype.interfaces_=function(){return[$d]};hw.prototype.getClass=function(){return hw};var ro=function(e,t,r){this.p0=e||null,this.p1=t||null,this.p2=r||null};ro.prototype.area=function(){return ro.area(this.p0,this.p1,this.p2)};ro.prototype.signedArea=function(){return ro.signedArea(this.p0,this.p1,this.p2)};ro.prototype.interpolateZ=function(e){if(e===null)throw new Ss("Supplied point is null.");return ro.interpolateZ(e,this.p0,this.p1,this.p2)};ro.prototype.longestSideLength=function(){return ro.longestSideLength(this.p0,this.p1,this.p2)};ro.prototype.isAcute=function(){return ro.isAcute(this.p0,this.p1,this.p2)};ro.prototype.circumcentre=function(){return ro.circumcentre(this.p0,this.p1,this.p2)};ro.prototype.area3D=function(){return ro.area3D(this.p0,this.p1,this.p2)};ro.prototype.centroid=function(){return ro.centroid(this.p0,this.p1,this.p2)};ro.prototype.inCentre=function(){return ro.inCentre(this.p0,this.p1,this.p2)};ro.prototype.interfaces_=function(){return[]};ro.prototype.getClass=function(){return ro};ro.area=function(e,t,r){return Math.abs(((r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y))/2)};ro.signedArea=function(e,t,r){return((r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y))/2};ro.det=function(e,t,r,i){return e*i-t*r};ro.interpolateZ=function(e,t,r,i){var a=t.x,o=t.y,s=r.x-a,l=i.x-a,u=r.y-o,h=i.y-o,c=s*h-l*u,f=e.x-a,d=e.y-o,v=(h*f-l*d)/c,p=(-u*f+s*d)/c,g=t.z+v*(r.z-t.z)+p*(i.z-t.z);return g};ro.longestSideLength=function(e,t,r){var i=e.distance(t),a=t.distance(r),o=r.distance(e),s=i;return a>s&&(s=a),o>s&&(s=o),s};ro.isAcute=function(e,t,r){return!(!ea.isAcute(e,t,r)||!ea.isAcute(t,r,e)||!ea.isAcute(r,e,t))};ro.circumcentre=function(e,t,r){var i=r.x,a=r.y,o=e.x-i,s=e.y-a,l=t.x-i,u=t.y-a,h=2*ro.det(o,s,l,u),c=ro.det(s,o*o+s*s,u,l*l+u*u),f=ro.det(o,o*o+s*s,l,l*l+u*u),d=i-c/h,v=a+f/h;return new tt(d,v)};ro.perpendicularBisector=function(e,t){var r=t.x-e.x,i=t.y-e.y,a=new Sv(e.x+r/2,e.y+i/2,1),o=new Sv(e.x-i+r/2,e.y+r+i/2,1);return new Sv(a,o)};ro.angleBisector=function(e,t,r){var i=t.distance(e),a=t.distance(r),o=i/(i+a),s=r.x-e.x,l=r.y-e.y,u=new tt(e.x+o*s,e.y+o*l);return u};ro.area3D=function(e,t,r){var i=t.x-e.x,a=t.y-e.y,o=t.z-e.z,s=r.x-e.x,l=r.y-e.y,u=r.z-e.z,h=a*u-o*l,c=o*s-i*u,f=i*l-a*s,d=h*h+c*c+f*f,v=Math.sqrt(d)/2;return v};ro.centroid=function(e,t,r){var i=(e.x+t.x+r.x)/3,a=(e.y+t.y+r.y)/3;return new tt(i,a)};ro.inCentre=function(e,t,r){var i=t.distance(r),a=e.distance(r),o=e.distance(t),s=i+a+o,l=(i*e.x+a*t.x+o*r.x)/s,u=(i*e.y+a*t.y+o*r.y)/s;return new tt(l,u)};var Dd=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Pr;var e=arguments[0],t=arguments[1],r=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=r};Dd.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),r=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(r,dt.EXTERIOR,dt.INTERIOR)};Dd.prototype.addPolygon=function(e){var t=this,r=this._distance,i=wr.LEFT;this._distance<0&&(r=-this._distance,i=wr.RIGHT);var a=e.getExteriorRing(),o=Bi.removeRepeatedPoints(a.getCoordinates());if(this._distance<0&&this.isErodedCompletely(a,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,r,i,dt.EXTERIOR,dt.INTERIOR);for(var s=0;s<e.getNumInteriorRing();s++){var l=e.getInteriorRingN(s),u=Bi.removeRepeatedPoints(l.getCoordinates());t._distance>0&&t.isErodedCompletely(l,-t._distance)||t.addPolygonRing(u,r,wr.opposite(i),dt.INTERIOR,dt.EXTERIOR)}};Dd.prototype.isTriangleErodedCompletely=function(e,t){var r=new ro(e[0],e[1],e[2]),i=r.inCentre(),a=Gr.distancePointLine(i,r.p0,r.p1);return a<Math.abs(t)};Dd.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=Bi.removeRepeatedPoints(e.getCoordinates()),r=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(r,dt.EXTERIOR,dt.INTERIOR)};Dd.prototype.addCurve=function(e,t,r){if(e===null||e.length<2)return null;var i=new al(e,new fo(0,dt.BOUNDARY,t,r));this._curveList.add(i)};Dd.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList};Dd.prototype.addPolygonRing=function(e,t,r,i,a){if(t===0&&e.length<b0.MINIMUM_VALID_SIZE)return null;var o=i,s=a;e.length>=b0.MINIMUM_VALID_SIZE&&Gr.isCCW(e)&&(o=a,s=i,r=wr.opposite(r));var l=this._curveBuilder.getRingCurve(e,r,t);this.addCurve(l,o,s)};Dd.prototype.add=function(e){if(e.isEmpty())return null;e instanceof Rl?this.addPolygon(e):e instanceof $s?this.addLineString(e):e instanceof Jc?this.addPoint(e):e instanceof sI?this.addCollection(e):e instanceof lw?this.addCollection(e):e instanceof p0?this.addCollection(e):e instanceof Yh&&this.addCollection(e)};Dd.prototype.isErodedCompletely=function(e,t){var r=e.getCoordinates();if(r.length<4)return t<0;if(r.length===4)return this.isTriangleErodedCompletely(r,t);var i=e.getEnvelopeInternal(),a=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>a};Dd.prototype.addCollection=function(e){for(var t=this,r=0;r<e.getNumGeometries();r++){var i=e.getGeometryN(r);t.add(i)}};Dd.prototype.interfaces_=function(){return[]};Dd.prototype.getClass=function(){return Dd};var cI=function(){};cI.prototype.locate=function(e){};cI.prototype.interfaces_=function(){return[]};cI.prototype.getClass=function(){return cI};var g0=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};g0.prototype.next=function(){if(this._atStart)return this._atStart=!1,g0.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new mL;var e=this._parent.getGeometryN(this._index++);return e instanceof Yh?(this._subcollectionIterator=new g0(e),this._subcollectionIterator.next()):e};g0.prototype.remove=function(){throw new Error(this.getClass().getName())};g0.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};g0.prototype.interfaces_=function(){return[yL]};g0.prototype.getClass=function(){return g0};g0.isAtomic=function(e){return!(e instanceof Yh)};var Ff=function(){this._geom=null;var e=arguments[0];this._geom=e};Ff.prototype.locate=function(e){return Ff.locate(e,this._geom)};Ff.prototype.interfaces_=function(){return[cI]};Ff.prototype.getClass=function(){return Ff};Ff.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?Gr.isPointInRing(e,t.getCoordinates()):!1};Ff.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var r=t.getExteriorRing();if(!Ff.isPointInRing(e,r))return!1;for(var i=0;i<t.getNumInteriorRing();i++){var a=t.getInteriorRingN(i);if(Ff.isPointInRing(e,a))return!1}return!0};Ff.containsPoint=function(e,t){if(t instanceof Rl)return Ff.containsPointInPolygon(e,t);if(t instanceof Yh)for(var r=new g0(t);r.hasNext();){var i=r.next();if(i!==t&&Ff.containsPoint(e,i))return!0}return!1};Ff.locate=function(e,t){return t.isEmpty()?dt.EXTERIOR:Ff.containsPoint(e,t)?dt.INTERIOR:dt.EXTERIOR};var ph=function(){this._edgeMap=new dh,this._edgeList=null,this._ptInAreaLocation=[dt.NONE,dt.NONE]};ph.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),r=t-1;return t===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)};ph.prototype.propagateSideLabels=function(e){for(var t=dt.NONE,r=this.iterator();r.hasNext();){var i=r.next(),a=i.getLabel();a.isArea(e)&&a.getLocation(e,wr.LEFT)!==dt.NONE&&(t=a.getLocation(e,wr.LEFT))}if(t===dt.NONE)return null;for(var o=t,s=this.iterator();s.hasNext();){var l=s.next(),u=l.getLabel();if(u.getLocation(e,wr.ON)===dt.NONE&&u.setLocation(e,wr.ON,o),u.isArea(e)){var h=u.getLocation(e,wr.LEFT),c=u.getLocation(e,wr.RIGHT);if(c!==dt.NONE){if(c!==o)throw new wm("side location conflict",l.getCoordinate());h===dt.NONE&&mi.shouldNeverReachHere("found single null side (at "+l.getCoordinate()+")"),o=h}else mi.isTrue(u.getLocation(e,wr.LEFT)===dt.NONE,"found single null side"),u.setLocation(e,wr.RIGHT,o),u.setLocation(e,wr.LEFT,o)}}};ph.prototype.getCoordinate=function(){var e=this.iterator();if(!e.hasNext())return null;var t=e.next();return t.getCoordinate()};ph.prototype.print=function(e){zu.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}};ph.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)};ph.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var r=t.size()-1,i=t.get(r).getLabel(),a=i.getLocation(e,wr.LEFT);mi.isTrue(a!==dt.NONE,"Found unlabelled area edge");for(var o=a,s=this.iterator();s.hasNext();){var l=s.next(),u=l.getLabel();mi.isTrue(u.isArea(e),"Found non-area edge");var h=u.getLocation(e,wr.LEFT),c=u.getLocation(e,wr.RIGHT);if(h===c||c!==o)return!1;o=h}return!0};ph.prototype.findIndex=function(e){var t=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=t._edgeList.get(r);if(i===e)return r}return-1};ph.prototype.iterator=function(){return this.getEdges().iterator()};ph.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Pr(this._edgeMap.values())),this._edgeList};ph.prototype.getLocation=function(e,t,r){return this._ptInAreaLocation[e]===dt.NONE&&(this._ptInAreaLocation[e]=Ff.locate(t,r[e].getGeometry())),this._ptInAreaLocation[e]};ph.prototype.toString=function(){var e=new hg;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
`);for(var t=this.iterator();t.hasNext();){var r=t.next();e.append(r),e.append(`
`)}return e.toString()};ph.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();r.computeLabel(e)}};ph.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var a=i.next(),o=a.getLabel(),s=0;s<2;s++)o.isLine(s)&&o.getLocation(s)===dt.BOUNDARY&&(r[s]=!0);for(var l=this.iterator();l.hasNext();)for(var u=l.next(),h=u.getLabel(),c=0;c<2;c++)if(h.isAnyNull(c)){var f=dt.NONE;if(r[c])f=dt.EXTERIOR;else{var d=u.getCoordinate();f=t.getLocation(c,d,e)}h.setAllLocationsIfNull(c,f)}};ph.prototype.getDegree=function(){return this._edgeMap.size()};ph.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null};ph.prototype.interfaces_=function(){return[]};ph.prototype.getClass=function(){return ph};var jzr=function(n){function e(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,a=null,o=this._SCANNING_FOR_INCOMING,s=0;s<this._resultAreaEdgeList.size();s++){var l=r._resultAreaEdgeList.get(s),u=l.getSym();if(!!l.getLabel().isArea())switch(i===null&&l.isInResult()&&(i=l),o){case r._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;a=u,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!l.isInResult())continue;a.setNext(l),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new wm("no outgoing dirEdge found",this.getCoordinate());mi.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),a.setNext(i)}},e.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},e.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var a=r.get(0);if(i===1)return a;var o=r.get(i-1),s=a.getQuadrant(),l=o.getQuadrant();return Eo.isNorthern(s)&&Eo.isNorthern(l)?a:!Eo.isNorthern(s)&&!Eo.isNorthern(l)?o:a.getDy()!==0?a:o.getDy()!==0?o:(mi.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(r){zu.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var a=i.next();r.print("out "),a.print(r),r.println(),r.print("in "),a.getSym().print(r),r.println()}},e.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Pr;for(var i=this.iterator();i.hasNext();){var a=i.next();(a.isInResult()||a.getSym().isInResult())&&r._resultAreaEdgeList.add(a)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var a=i.next(),o=a.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,a=null,o=this._edgeList.size()-1;o>=0;o--){var s=r._edgeList.get(o),l=s.getSym();a===null&&(a=l),i!==null&&l.setNext(i),i=s}a.setNext(i)},e.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],a=this.findIndex(i),o=i.getDepth(wr.LEFT),s=i.getDepth(wr.RIGHT),l=this.computeDepths(a+1,this._edgeList.size(),o),u=this.computeDepths(0,a,l);if(u!==s)throw new wm("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],c=arguments[1],f=arguments[2],d=f,v=h;v<c;v++){var p=r._edgeList.get(v);p.setEdgeDepths(wr.RIGHT,d),d=p.getDepth(wr.LEFT)}return d}},e.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),a=i.getLabel();a.merge(i.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,a=null,o=null,s=this._SCANNING_FOR_INCOMING,l=this._resultAreaEdgeList.size()-1;l>=0;l--){var u=i._resultAreaEdgeList.get(l),h=u.getSym();switch(a===null&&u.getEdgeRing()===r&&(a=u),s){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==r)continue;o=h,s=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==r)continue;o.setNextMin(u),s=i._SCANNING_FOR_INCOMING;break}}s===this._LINKING_TO_OUTGOING&&(mi.isTrue(a!==null,"found null for first outgoing dirEdge"),mi.isTrue(a.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(a))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var a=i.next();a.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],s=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===o&&s++}return s}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var r=dt.NONE,i=this.iterator();i.hasNext();){var a=i.next(),o=a.getSym();if(!a.isLineEdge()){if(a.isInResult()){r=dt.INTERIOR;break}if(o.isInResult()){r=dt.EXTERIOR;break}}}if(r===dt.NONE)return null;for(var s=r,l=this.iterator();l.hasNext();){var u=l.next(),h=u.getSym();u.isLineEdge()?u.getEdge().setCovered(s===dt.INTERIOR):(u.isInResult()&&(s=dt.EXTERIOR),h.isInResult()&&(s=dt.INTERIOR))}},e.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new fo(dt.NONE);for(var a=this.iterator();a.hasNext();)for(var o=a.next(),s=o.getEdge(),l=s.getLabel(),u=0;u<2;u++){var h=l.getLocation(u);(h===dt.INTERIOR||h===dt.BOUNDARY)&&i._label.setLocation(u,dt.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ph),zJe=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.createNode=function(r){return new G$(r,new jzr)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(lI),E_=function n(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=n.orientation(e)};E_.prototype.compareTo=function(e){var t=e,r=E_.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return r};E_.prototype.interfaces_=function(){return[$d]};E_.prototype.getClass=function(){return E_};E_.orientation=function(e){return Bi.increasingDirection(e)===1};E_.compareOriented=function(e,t,r,i){for(var a=t?1:-1,o=i?1:-1,s=t?e.length:-1,l=i?r.length:-1,u=t?0:e.length-1,h=i?0:r.length-1;;){var c=e[u].compareTo(r[h]);if(c!==0)return c;u+=a,h+=o;var f=u===s,d=h===l;if(f&&!d)return-1;if(!f&&d)return 1;if(f&&d)return 0}};var Ov=function(){this._edges=new Pr,this._ocaMap=new dh};Ov.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=t._edges.get(r);r>0&&e.print(","),e.print("(");for(var a=i.getCoordinates(),o=0;o<a.length;o++)o>0&&e.print(","),e.print(a[o].x+" "+a[o].y);e.println(")")}e.print(") ")};Ov.prototype.addAll=function(e){for(var t=this,r=e.iterator();r.hasNext();)t.add(r.next())};Ov.prototype.findEdgeIndex=function(e){for(var t=this,r=0;r<this._edges.size();r++)if(t._edges.get(r).equals(e))return r;return-1};Ov.prototype.iterator=function(){return this._edges.iterator()};Ov.prototype.getEdges=function(){return this._edges};Ov.prototype.get=function(e){return this._edges.get(e)};Ov.prototype.findEqualEdge=function(e){var t=new E_(e.getCoordinates()),r=this._ocaMap.get(t);return r};Ov.prototype.add=function(e){this._edges.add(e);var t=new E_(e.getCoordinates());this._ocaMap.put(t,e)};Ov.prototype.interfaces_=function(){return[]};Ov.prototype.getClass=function(){return Ov};var cw=function(){};cw.prototype.processIntersections=function(e,t,r,i){};cw.prototype.isDone=function(){};cw.prototype.interfaces_=function(){return[]};cw.prototype.getClass=function(){return cw};var Wf=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var e=arguments[0];this._li=e};Wf.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(Wf.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var a=e.size()-1;if(t===0&&i===a||i===0&&t===a)return!0}}return!1};Wf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Wf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Wf.prototype.getLineIntersector=function(){return this._li};Wf.prototype.hasProperIntersection=function(){return this._hasProper};Wf.prototype.processIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var a=e.getCoordinates()[t],o=e.getCoordinates()[t+1],s=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(a,o,s,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))};Wf.prototype.hasIntersection=function(){return this._hasIntersection};Wf.prototype.isDone=function(){return!1};Wf.prototype.hasInteriorIntersection=function(){return this._hasInterior};Wf.prototype.interfaces_=function(){return[cw]};Wf.prototype.getClass=function(){return Wf};Wf.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var Jp=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],r=arguments[2];this.coord=new tt(e),this.segmentIndex=t,this.dist=r};Jp.prototype.getSegmentIndex=function(){return this.segmentIndex};Jp.prototype.getCoordinate=function(){return this.coord};Jp.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)};Jp.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)};Jp.prototype.isEndPoint=function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e};Jp.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist};Jp.prototype.getDistance=function(){return this.dist};Jp.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0};Jp.prototype.interfaces_=function(){return[$d]};Jp.prototype.getClass=function(){return Jp};var C0=function(){this._nodeMap=new dh,this.edge=null;var e=arguments[0];this.edge=e};C0.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}};C0.prototype.iterator=function(){return this._nodeMap.values().iterator()};C0.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var a=r.next(),o=t.createSplitEdge(i,a);e.add(o),i=a}};C0.prototype.addEndpoints=function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)};C0.prototype.createSplitEdge=function(e,t){var r=this,i=t.segmentIndex-e.segmentIndex+2,a=this.edge.pts[t.segmentIndex],o=t.dist>0||!t.coord.equals2D(a);o||i--;var s=new Array(i).fill(null),l=0;s[l++]=new tt(e.coord);for(var u=e.segmentIndex+1;u<=t.segmentIndex;u++)s[l++]=r.edge.pts[u];return o&&(s[l]=t.coord),new H7(s,new fo(this.edge._label))};C0.prototype.add=function(e,t,r){var i=new Jp(e,t,r),a=this._nodeMap.get(i);return a!==null?a:(this._nodeMap.put(i,i),i)};C0.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();if(r.coord.equals(e))return!0}return!1};C0.prototype.interfaces_=function(){return[]};C0.prototype.getClass=function(){return C0};var fw=function(){};fw.prototype.getChainStartIndices=function(e){var t=this,r=0,i=new Pr;i.add(new jp(r));do{var a=t.findChainEnd(e,r);i.add(new jp(a)),r=a}while(r<e.length-1);var o=fw.toIntArray(i);return o};fw.prototype.findChainEnd=function(e,t){for(var r=Eo.quadrant(e[t],e[t+1]),i=t+1;i<e.length;){var a=Eo.quadrant(e[i-1],e[i]);if(a!==r)break;i++}return i-1};fw.prototype.interfaces_=function(){return[]};fw.prototype.getClass=function(){return fw};fw.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),r=0;r<t.length;r++)t[r]=e.get(r).intValue();return t};var Em=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new gn,this.env2=new gn;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new fw;this.startIndex=t.getChainStartIndices(this.pts)};Em.prototype.getCoordinates=function(){return this.pts};Em.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return t>r?t:r};Em.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return t<r?t:r};Em.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[r],t.startIndex[r+1],i)}else if(arguments.length===6){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3],u=arguments[4],h=arguments[5],c=this.pts[a],f=this.pts[o],d=s.pts[l],v=s.pts[u];if(o-a===1&&u-l===1)return h.addIntersections(this.e,a,s.e,l),null;if(this.env1.init(c,f),this.env2.init(d,v),!this.env1.intersects(this.env2))return null;var p=Math.trunc((a+o)/2),g=Math.trunc((l+u)/2);a<p&&(l<g&&this.computeIntersectsForChain(a,p,s,l,g,h),g<u&&this.computeIntersectsForChain(a,p,s,g,u,h)),p<o&&(l<g&&this.computeIntersectsForChain(p,o,s,l,g,h),g<u&&this.computeIntersectsForChain(p,o,s,g,u,h))}};Em.prototype.getStartIndexes=function(){return this.startIndex};Em.prototype.computeIntersects=function(e,t){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var a=0;a<e.startIndex.length-1;a++)r.computeIntersectsForChain(i,e,a,t)};Em.prototype.interfaces_=function(){return[]};Em.prototype.getClass=function(){return Em};var Fu=function n(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var r=0;r<3;r++)e._depth[t][r]=n.NULL_VALUE},UJe={NULL_VALUE:{configurable:!0}};Fu.prototype.getDepth=function(e,t){return this._depth[e][t]};Fu.prototype.setDepth=function(e,t,r){this._depth[e][t]=r};Fu.prototype.isNull=function(){var e=this;if(arguments.length===0){for(var t=0;t<2;t++)for(var r=0;r<3;r++)if(e._depth[t][r]!==Fu.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Fu.NULL_VALUE}else if(arguments.length===2){var a=arguments[0],o=arguments[1];return this._depth[a][o]===Fu.NULL_VALUE}};Fu.prototype.normalize=function(){for(var e=this,t=0;t<2;t++)if(!e.isNull(t)){var r=e._depth[t][1];e._depth[t][2]<r&&(r=e._depth[t][2]),r<0&&(r=0);for(var i=1;i<3;i++){var a=0;e._depth[t][i]>r&&(a=1),e._depth[t][i]=a}}};Fu.prototype.getDelta=function(e){return this._depth[e][wr.RIGHT]-this._depth[e][wr.LEFT]};Fu.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?dt.EXTERIOR:dt.INTERIOR};Fu.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};Fu.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var a=t.getLocation(r,i);(a===dt.EXTERIOR||a===dt.INTERIOR)&&(e.isNull(r,i)?e._depth[r][i]=Fu.depthAtLocation(a):e._depth[r][i]+=Fu.depthAtLocation(a))}else if(arguments.length===3){var o=arguments[0],s=arguments[1],l=arguments[2];l===dt.INTERIOR&&this._depth[o][s]++}};Fu.prototype.interfaces_=function(){return[]};Fu.prototype.getClass=function(){return Fu};Fu.depthAtLocation=function(e){return e===dt.EXTERIOR?0:e===dt.INTERIOR?1:Fu.NULL_VALUE};UJe.NULL_VALUE.get=function(){return-1};Object.defineProperties(Fu,UJe);var H7=function(n){function e(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new C0(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Fu,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new e(r,fo.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(r){this._isIsolated=r},e.prototype.setName=function(r){this._name=r},e.prototype.equals=function(r){var i=this;if(!(r instanceof e))return!1;var a=r;if(this.pts.length!==a.pts.length)return!1;for(var o=!0,s=!0,l=this.pts.length,u=0;u<this.pts.length;u++)if(i.pts[u].equals2D(a.pts[u])||(o=!1),i.pts[u].equals2D(a.pts[--l])||(s=!1),!o&&!s)return!1;return!0},e.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},e.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var a=0;a<this.pts.length;a++)a>0&&r.print(","),r.print(i.pts[a].x+" "+i.pts[a].y);r.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(r){e.updateIM(this._label,r)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var a=this.pts.length-1;a>=0;a--)r.print(i.pts[a]+" ");r.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Em(this)),this._mce},e.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new gn;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},e.prototype.addIntersection=function(r,i,a,o){var s=new tt(r.getIntersection(o)),l=i,u=r.getEdgeDistance(a,o),h=l+1;if(h<this.pts.length){var c=this.pts[h];s.equals2D(c)&&(l=h,u=0)}this.eiList.add(s,l,u)},e.prototype.toString=function(){var r=this,i=new hg;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var a=0;a<this.pts.length;a++)a>0&&i.append(","),i.append(r.pts[a].x+" "+r.pts[a].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var a=0;a<this.pts.length;a++)if(!i.pts[a].equals2D(r.pts[a]))return!1;return!0},e.prototype.setDepthDelta=function(r){this._depthDelta=r},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(r,i,a){for(var o=this,s=0;s<r.getIntersectionNum();s++)o.addIntersection(r,i,a,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,wr.ON),r.getLocation(1,wr.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,wr.LEFT),r.getLocation(1,wr.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,wr.RIGHT),r.getLocation(1,wr.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},e}(Vf),jh=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ov,this._bufParams=e||null};jh.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e};jh.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var r=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new fo(e.getLabel()),i.flip()),r.merge(i);var a=jh.depthDelta(i),o=t.getDepthDelta(),s=o+a;t.setDepthDelta(s)}else this._edgeList.add(e),e.setDepthDelta(jh.depthDelta(e.getLabel()))};jh.prototype.buildSubgraphs=function(e,t){for(var r=new Pr,i=e.iterator();i.hasNext();){var a=i.next(),o=a.getRightmostCoordinate(),s=new O2(r),l=s.getDepth(o);a.computeDepth(l),a.findResultEdges(),r.add(a),t.add(a.getDirectedEdges(),a.getNodes())}};jh.prototype.createSubgraphs=function(e){for(var t=new Pr,r=e.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var a=new qh;a.create(i),t.add(a)}}return Pv.sort(t,Pv.reverseOrder()),t};jh.prototype.createEmptyResultGeometry=function(){var e=this._geomFact.createPolygon();return e};jh.prototype.getNoder=function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new Mce,r=new Ow;return r.setPrecisionModel(e),t.setSegmentIntersector(new Wf(r)),t};jh.prototype.buffer=function(e,t){var r=this._workingPrecisionModel;r===null&&(r=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new yc(r,this._bufParams),a=new Dd(e,t,i),o=a.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new Ps(new zJe),this._graph.addEdges(this._edgeList.getEdges());var s=this.createSubgraphs(this._graph),l=new Qc(this._geomFact);this.buildSubgraphs(s,l);var u=l.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(u);return h};jh.prototype.computeNodedEdges=function(e,t){var r=this,i=this.getNoder(t);i.computeNodes(e);for(var a=i.getNodedSubstrings(),o=a.iterator();o.hasNext();){var s=o.next(),l=s.getCoordinates();if(!(l.length===2&&l[0].equals2D(l[1]))){var u=s.getData(),h=new H7(s.getCoordinates(),new fo(u));r.insertUniqueEdge(h)}}};jh.prototype.setNoder=function(e){this._workingNoder=e};jh.prototype.interfaces_=function(){return[]};jh.prototype.getClass=function(){return jh};jh.depthDelta=function(e){var t=e.getLocation(0,wr.LEFT),r=e.getLocation(0,wr.RIGHT);return t===dt.INTERIOR&&r===dt.EXTERIOR?1:t===dt.EXTERIOR&&r===dt.INTERIOR?-1:0};jh.convertSegStrings=function(e){for(var t=new Fi,r=new Pr;e.hasNext();){var i=e.next(),a=t.createLineString(i.getCoordinates());r.add(a)}return t.buildGeometry(r)};var T_=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var e=arguments[0],t=arguments[1];this._noder=e,this._scaleFactor=t,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],a=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=a,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};T_.prototype.rescale=function(){var e=this;if(zn(arguments[0],Al))for(var t=arguments[0],r=t.iterator();r.hasNext();){var i=r.next();e.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var a=arguments[0],o=0;o<a.length;o++)a[o].x=a[o].x/e._scaleFactor+e._offsetX,a[o].y=a[o].y/e._scaleFactor+e._offsetY;a.length===2&&a[0].equals2D(a[1])&&zu.out.println(a)}};T_.prototype.scale=function(){var e=this;if(zn(arguments[0],Al)){for(var t=arguments[0],r=new Pr,i=t.iterator();i.hasNext();){var a=i.next();r.add(new al(e.scale(a.getCoordinates()),a.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=new Array(o.length).fill(null),l=0;l<o.length;l++)s[l]=new tt(Math.round((o[l].x-e._offsetX)*e._scaleFactor),Math.round((o[l].y-e._offsetY)*e._scaleFactor),o[l].z);var u=Bi.removeRepeatedPoints(s);return u}};T_.prototype.isIntegerPrecision=function(){return this._scaleFactor===1};T_.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e};T_.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)};T_.prototype.interfaces_=function(){return[uw]};T_.prototype.getClass=function(){return T_};var Qp=function(){this._li=new Ow,this._segStrings=null;var e=arguments[0];this._segStrings=e},VJe={fact:{configurable:!0}};Qp.prototype.checkEndPtVertexIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var r=t.next(),i=r.getCoordinates();e.checkEndPtVertexIntersections(i[0],e._segStrings),e.checkEndPtVertexIntersections(i[i.length-1],e._segStrings)}else if(arguments.length===2){for(var a=arguments[0],o=arguments[1],s=o.iterator();s.hasNext();)for(var l=s.next(),u=l.getCoordinates(),h=1;h<u.length-1;h++)if(u[h].equals(a))throw new xm("found endpt/interior pt intersection at index "+h+" :pt "+a)}};Qp.prototype.checkInteriorIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var r=t.next(),i=this._segStrings.iterator();i.hasNext();){var a=i.next();e.checkInteriorIntersections(r,a)}else if(arguments.length===2)for(var o=arguments[0],s=arguments[1],l=o.getCoordinates(),u=s.getCoordinates(),h=0;h<l.length-1;h++)for(var c=0;c<u.length-1;c++)e.checkInteriorIntersections(o,h,s,c);else if(arguments.length===4){var f=arguments[0],d=arguments[1],v=arguments[2],p=arguments[3];if(f===v&&d===p)return null;var g=f.getCoordinates()[d],m=f.getCoordinates()[d+1],y=v.getCoordinates()[p],_=v.getCoordinates()[p+1];if(this._li.computeIntersection(g,m,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,m)||this.hasInteriorIntersection(this._li,y,_)))throw new xm("found non-noded intersection at "+g+"-"+m+" and "+y+"-"+_)}};Qp.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()};Qp.prototype.checkCollapses=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var r=t.next();e.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],a=i.getCoordinates(),o=0;o<a.length-2;o++)e.checkCollapse(a[o],a[o+1],a[o+2])};Qp.prototype.hasInteriorIntersection=function(e,t,r){for(var i=0;i<e.getIntersectionNum();i++){var a=e.getIntersection(i);if(!(a.equals(t)||a.equals(r)))return!0}return!1};Qp.prototype.checkCollapse=function(e,t,r){if(e.equals(r))throw new xm("found non-noded collapse at "+Qp.fact.createLineString([e,t,r]))};Qp.prototype.interfaces_=function(){return[]};Qp.prototype.getClass=function(){return Qp};VJe.fact.get=function(){return new Fi};Object.defineProperties(Qp,VJe);var mc=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],r=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=r,t<=0)throw new Ss("Scale factor must be non-zero");t!==1&&(this._pt=new tt(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new tt,this._p1Scaled=new tt),this.initCorners(this._pt)},$Je={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};mc.prototype.intersectsScaled=function(e,t){var r=Math.min(e.x,t.x),i=Math.max(e.x,t.x),a=Math.min(e.y,t.y),o=Math.max(e.y,t.y),s=this._maxx<r||this._minx>i||this._maxy<a||this._miny>o;if(s)return!1;var l=this.intersectsToleranceSquare(e,t);return mi.isTrue(!(s&&l),"Found bad envelope test"),l};mc.prototype.initCorners=function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new tt(this._maxx,this._maxy),this._corner[1]=new tt(this._minx,this._maxy),this._corner[2]=new tt(this._minx,this._miny),this._corner[3]=new tt(this._maxx,this._miny)};mc.prototype.intersects=function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};mc.prototype.scale=function(e){return Math.round(e*this._scaleFactor)};mc.prototype.getCoordinate=function(){return this._originalPt};mc.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)};mc.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=mc.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new gn(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv};mc.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))};mc.prototype.intersectsToleranceSquare=function(e,t){var r=!1,i=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||r&&i||e.equals(this._pt)||t.equals(this._pt))};mc.prototype.addSnappedNode=function(e,t){var r=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(r,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1};mc.prototype.interfaces_=function(){return[]};mc.prototype.getClass=function(){return mc};$Je.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(mc,$Je);var VN=function(){this.tempEnv1=new gn,this.selectedSegment=new wn};VN.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}};VN.prototype.interfaces_=function(){return[]};VN.prototype.getClass=function(){return VN};var fI=function(){this._index=null;var e=arguments[0];this._index=e},WJe={HotPixelSnapAction:{configurable:!0}};fI.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],r=arguments[1],i=arguments[2],a=t.getSafeEnvelope(),o=new HJe(t,r,i);return this._index.query(a,{interfaces_:function(){return[w_]},visitItem:function(s){var l=s;l.select(a,o)}}),o.isNodeAdded()}};fI.prototype.interfaces_=function(){return[]};fI.prototype.getClass=function(){return fI};WJe.HotPixelSnapAction.get=function(){return HJe};Object.defineProperties(fI,WJe);var HJe=function(n){function e(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],a=r.getContext();if(this._parentEdge!==null&&a===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(a,i)}else return n.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(VN),R2=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new Pr};R2.prototype.processIntersections=function(e,t,r,i){var a=this;if(e===r&&t===i)return null;var o=e.getCoordinates()[t],s=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,s,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)a._interiorIntersections.add(a._li.getIntersection(h));e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1)}};R2.prototype.isDone=function(){return!1};R2.prototype.getInteriorIntersections=function(){return this._interiorIntersections};R2.prototype.interfaces_=function(){return[cw]};R2.prototype.getClass=function(){return R2};var A0=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new Ow,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};A0.prototype.checkCorrectness=function(e){var t=al.getNodedSubstrings(e),r=new Qp(t);try{r.checkValid()}catch(i){if(i instanceof MJe)i.printStackTrace();else throw i}finally{}};A0.prototype.getNodedSubstrings=function(){return al.getNodedSubstrings(this._nodedSegStrings)};A0.prototype.snapRound=function(e,t){var r=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(r),this.computeVertexSnaps(e)};A0.prototype.findInteriorIntersections=function(e,t){var r=new R2(t);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(e),r.getInteriorIntersections()};A0.prototype.computeVertexSnaps=function(){var e=this;if(zn(arguments[0],Al))for(var t=arguments[0],r=t.iterator();r.hasNext();){var i=r.next();e.computeVertexSnaps(i)}else if(arguments[0]instanceof al)for(var a=arguments[0],o=a.getCoordinates(),s=0;s<o.length;s++){var l=new mc(o[s],e._scaleFactor,e._li),u=e._pointSnapper.snap(l,a,s);u&&a.addIntersection(o[s],s)}};A0.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new Mce,this._pointSnapper=new fI(this._noder.getIndex()),this.snapRound(e,this._li)};A0.prototype.computeIntersectionSnaps=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next(),a=new mc(i,t._scaleFactor,t._li);t._pointSnapper.snap(a)}};A0.prototype.interfaces_=function(){return[uw]};A0.prototype.getClass=function(){return A0};var Ou=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new eo,this._resultGeometry=null,this._saveException=null,arguments.length===1){var e=arguments[0];this._argGeom=e}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this._argGeom=t,this._bufParams=r}},_L={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ou.prototype.bufferFixedPrecision=function(e){var t=new T_(new A0(new to(1)),e.getScale()),r=new jh(this._bufParams);r.setWorkingPrecisionModel(e),r.setNoder(t),this._resultGeometry=r.buffer(this._argGeom,this._distance)};Ou.prototype.bufferReducedPrecision=function(){var e=this;if(arguments.length===0){for(var t=Ou.MAX_PRECISION_DIGITS;t>=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof wm)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Ou.precisionScaleFactor(this._argGeom,this._distance,r),a=new to(i);this.bufferFixedPrecision(a)}};Ou.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===to.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()};Ou.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)};Ou.prototype.bufferOriginalPrecision=function(){try{var e=new jh(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof xm)this._saveException=t;else throw t}finally{}};Ou.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry};Ou.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)};Ou.prototype.interfaces_=function(){return[]};Ou.prototype.getClass=function(){return Ou};Ou.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new Ou(e),i=r.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Gn&&typeof arguments[1]=="number"){var a=arguments[0],o=arguments[1],s=arguments[2],l=new Ou(a);l.setQuadrantSegments(s);var u=l.getResultGeometry(o);return u}else if(arguments[2]instanceof eo&&arguments[0]instanceof Gn&&typeof arguments[1]=="number"){var h=arguments[0],c=arguments[1],f=arguments[2],d=new Ou(h,f),v=d.getResultGeometry(c);return v}}else if(arguments.length===4){var p=arguments[0],g=arguments[1],m=arguments[2],y=arguments[3],_=new Ou(p);_.setQuadrantSegments(m),_.setEndCapStyle(y);var x=_.getResultGeometry(g);return x}};Ou.precisionScaleFactor=function(e,t,r){var i=e.getEnvelopeInternal(),a=Uf.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=t>0?t:0,s=a+2*o,l=Math.trunc(Math.log(s)/Math.log(10)+1),u=r-l,h=Math.pow(10,u);return h};_L.CAP_ROUND.get=function(){return eo.CAP_ROUND};_L.CAP_BUTT.get=function(){return eo.CAP_FLAT};_L.CAP_FLAT.get=function(){return eo.CAP_FLAT};_L.CAP_SQUARE.get=function(){return eo.CAP_SQUARE};_L.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(Ou,_L);var Uh=function(){this._pt=[new tt,new tt],this._distance=ui.NaN,this._isNull=!0};Uh.prototype.getCoordinates=function(){return this._pt};Uh.prototype.getCoordinate=function(e){return this._pt[e]};Uh.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i<this._distance&&this.initialize(t,r,i)}};Uh.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=a,this._isNull=!1}};Uh.prototype.getDistance=function(){return this._distance};Uh.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i>this._distance&&this.initialize(t,r,i)}};Uh.prototype.interfaces_=function(){return[]};Uh.prototype.getClass=function(){return Uh};var Yg=function(){};Yg.prototype.interfaces_=function(){return[]};Yg.prototype.getClass=function(){return Yg};Yg.computeDistance=function(){if(arguments[2]instanceof Uh&&arguments[0]instanceof $s&&arguments[1]instanceof tt)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=e.getCoordinates(),a=new wn,o=0;o<i.length-1;o++){a.setCoordinates(i[o],i[o+1]);var s=a.closestPoint(t);r.setMinimum(s,t)}else if(arguments[2]instanceof Uh&&arguments[0]instanceof Rl&&arguments[1]instanceof tt){var l=arguments[0],u=arguments[1],h=arguments[2];Yg.computeDistance(l.getExteriorRing(),u,h);for(var c=0;c<l.getNumInteriorRing();c++)Yg.computeDistance(l.getInteriorRingN(c),u,h)}else if(arguments[2]instanceof Uh&&arguments[0]instanceof Gn&&arguments[1]instanceof tt){var f=arguments[0],d=arguments[1],v=arguments[2];if(f instanceof $s)Yg.computeDistance(f,d,v);else if(f instanceof Rl)Yg.computeDistance(f,d,v);else if(f instanceof Yh)for(var p=f,g=0;g<p.getNumGeometries();g++){var m=p.getGeometryN(g);Yg.computeDistance(m,d,v)}else v.setMinimum(f.getCoordinate(),d)}else if(arguments[2]instanceof Uh&&arguments[0]instanceof wn&&arguments[1]instanceof tt){var y=arguments[0],_=arguments[1],x=arguments[2],S=y.closestPoint(_);x.setMinimum(S,_)}};var dw=function(e){this._maxPtDist=new Uh,this._inputGeom=e||null},Ice={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};dw.prototype.computeMaxMidpointDistance=function(e){var t=new C_(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())};dw.prototype.computeMaxVertexDistance=function(e){var t=new D2(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())};dw.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()};dw.prototype.getDistancePoints=function(){return this._maxPtDist};dw.prototype.interfaces_=function(){return[]};dw.prototype.getClass=function(){return dw};Ice.MaxPointDistanceFilter.get=function(){return D2};Ice.MaxMidpointDistanceFilter.get=function(){return C_};Object.defineProperties(dw,Ice);var D2=function(e){this._maxPtDist=new Uh,this._minPtDist=new Uh,this._geom=e||null};D2.prototype.filter=function(e){this._minPtDist.initialize(),Yg.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};D2.prototype.getMaxPointDistance=function(){return this._maxPtDist};D2.prototype.interfaces_=function(){return[w0]};D2.prototype.getClass=function(){return D2};var C_=function(e){this._maxPtDist=new Uh,this._minPtDist=new Uh,this._geom=e||null};C_.prototype.filter=function(e,t){if(t===0)return null;var r=e.getCoordinate(t-1),i=e.getCoordinate(t),a=new tt((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),Yg.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};C_.prototype.isDone=function(){return!1};C_.prototype.isGeometryChanged=function(){return!1};C_.prototype.getMaxPointDistance=function(){return this._maxPtDist};C_.prototype.interfaces_=function(){return[Iv]};C_.prototype.getClass=function(){return C_};var im=function(e){this._comps=e||null};im.prototype.filter=function(e){e instanceof Rl&&this._comps.add(e)};im.prototype.interfaces_=function(){return[Yp]};im.prototype.getClass=function(){return im};im.getPolygons=function(){if(arguments.length===1){var e=arguments[0];return im.getPolygons(e,new Pr)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof Rl?r.add(t):t instanceof Yh&&t.apply(new im(r)),r}};var Pu=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var e=arguments[0];this._lines=e}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this._lines=t,this._isForcedToLineString=r}};Pu.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof b0){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof $s&&this._lines.add(e)};Pu.prototype.setForceToLineString=function(e){this._isForcedToLineString=e};Pu.prototype.interfaces_=function(){return[Sm]};Pu.prototype.getClass=function(){return Pu};Pu.getGeometry=function(){if(arguments.length===1){var e=arguments[0];return e.getFactory().buildGeometry(Pu.getLines(e))}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t.getFactory().buildGeometry(Pu.getLines(t,r))}};Pu.getLines=function(){if(arguments.length===1){var e=arguments[0];return Pu.getLines(e,!1)}else if(arguments.length===2){if(zn(arguments[0],Al)&&zn(arguments[1],Al)){for(var t=arguments[0],r=arguments[1],i=t.iterator();i.hasNext();){var a=i.next();Pu.getLines(a,r)}return r}else if(arguments[0]instanceof Gn&&typeof arguments[1]=="boolean"){var o=arguments[0],s=arguments[1],l=new Pr;return o.apply(new Pu(l,s)),l}else if(arguments[0]instanceof Gn&&zn(arguments[1],Al)){var u=arguments[0],h=arguments[1];return u instanceof $s?h.add(u):u.apply(new Pu(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&zn(arguments[0],Al)&&zn(arguments[1],Al)){for(var c=arguments[0],f=arguments[1],d=arguments[2],v=c.iterator();v.hasNext();){var p=v.next();Pu.getLines(p,f,d)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Gn&&zn(arguments[1],Al)){var g=arguments[0],m=arguments[1],y=arguments[2];return g.apply(new Pu(m,y)),m}}};var Rv=function(){if(this._boundaryRule=Od.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e===null)throw new Ss("Rule must be non-null");this._boundaryRule=e}}};Rv.prototype.locateInternal=function(){var e=this;if(arguments[0]instanceof tt&&arguments[1]instanceof Rl){var t=arguments[0],r=arguments[1];if(r.isEmpty())return dt.EXTERIOR;var i=r.getExteriorRing(),a=this.locateInPolygonRing(t,i);if(a===dt.EXTERIOR)return dt.EXTERIOR;if(a===dt.BOUNDARY)return dt.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var s=r.getInteriorRingN(o),l=e.locateInPolygonRing(t,s);if(l===dt.INTERIOR)return dt.EXTERIOR;if(l===dt.BOUNDARY)return dt.BOUNDARY}return dt.INTERIOR}else if(arguments[0]instanceof tt&&arguments[1]instanceof $s){var u=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(u))return dt.EXTERIOR;var c=h.getCoordinates();return!h.isClosed()&&(u.equals(c[0])||u.equals(c[c.length-1]))?dt.BOUNDARY:Gr.isOnLine(u,c)?dt.INTERIOR:dt.EXTERIOR}else if(arguments[0]instanceof tt&&arguments[1]instanceof Jc){var f=arguments[0],d=arguments[1],v=d.getCoordinate();return v.equals2D(f)?dt.INTERIOR:dt.EXTERIOR}};Rv.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?Gr.locatePointInRing(e,t.getCoordinates()):dt.EXTERIOR};Rv.prototype.intersects=function(e,t){return this.locate(e,t)!==dt.EXTERIOR};Rv.prototype.updateLocationInfo=function(e){e===dt.INTERIOR&&(this._isIn=!0),e===dt.BOUNDARY&&this._numBoundaries++};Rv.prototype.computeLocation=function(e,t){var r=this;if(t instanceof Jc&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof $s)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof Rl)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof lw)for(var i=t,a=0;a<i.getNumGeometries();a++){var o=i.getGeometryN(a);r.updateLocationInfo(r.locateInternal(e,o))}else if(t instanceof p0)for(var s=t,l=0;l<s.getNumGeometries();l++){var u=s.getGeometryN(l);r.updateLocationInfo(r.locateInternal(e,u))}else if(t instanceof Yh)for(var h=new g0(t);h.hasNext();){var c=h.next();c!==t&&r.computeLocation(e,c)}};Rv.prototype.locate=function(e,t){return t.isEmpty()?dt.EXTERIOR:t instanceof $s?this.locateInternal(e,t):t instanceof Rl?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?dt.BOUNDARY:this._numBoundaries>0||this._isIn?dt.INTERIOR:dt.EXTERIOR)};Rv.prototype.interfaces_=function(){return[]};Rv.prototype.getClass=function(){return Rv};var Vh=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];n.call(this,e,n.INSIDE_AREA,t)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._component=r,this._segIndex=i,this._pt=a}},jJe={INSIDE_AREA:{configurable:!0}};Vh.prototype.isInsideArea=function(){return this._segIndex===Vh.INSIDE_AREA};Vh.prototype.getCoordinate=function(){return this._pt};Vh.prototype.getGeometryComponent=function(){return this._component};Vh.prototype.getSegmentIndex=function(){return this._segIndex};Vh.prototype.interfaces_=function(){return[]};Vh.prototype.getClass=function(){return Vh};jJe.INSIDE_AREA.get=function(){return-1};Object.defineProperties(Vh,jJe);var r_=function(e){this._pts=e||null};r_.prototype.filter=function(e){e instanceof Jc&&this._pts.add(e)};r_.prototype.interfaces_=function(){return[Yp]};r_.prototype.getClass=function(){return r_};r_.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof Jc?Pv.singletonList(e):r_.getPoints(e,new Pr)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof Jc?r.add(t):t instanceof Yh&&t.apply(new r_(r)),r}};var N2=function(){this._locations=null;var e=arguments[0];this._locations=e};N2.prototype.filter=function(e){(e instanceof Jc||e instanceof $s||e instanceof Rl)&&this._locations.add(new Vh(e,0,e.getCoordinate()))};N2.prototype.interfaces_=function(){return[Yp]};N2.prototype.getClass=function(){return N2};N2.getLocations=function(e){var t=new Pr;return e.apply(new N2(t)),t};var Vu=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Rv,this._minDistanceLocation=null,this._minDistance=ui.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=a}};Vu.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=1-r,o=im.getPolygons(this._geom[r]);if(o.size()>0){var s=N2.getLocations(this._geom[a]);if(this.computeContainmentDistance(s,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[a]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&zn(arguments[0],wv)&&zn(arguments[1],wv)){for(var l=arguments[0],u=arguments[1],h=arguments[2],c=0;c<l.size();c++)for(var f=l.get(c),d=0;d<u.size();d++)if(e.computeContainmentDistance(f,u.get(d),h),e._minDistance<=e._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Vh&&arguments[1]instanceof Rl){var v=arguments[0],p=arguments[1],g=arguments[2],m=v.getCoordinate();if(dt.EXTERIOR!==this._ptLocator.locate(m,p))return this._minDistance=0,g[0]=v,g[1]=new Vh(p,m),null}}};Vu.prototype.computeMinDistanceLinesPoints=function(e,t,r){for(var i=this,a=0;a<e.size();a++)for(var o=e.get(a),s=0;s<t.size();s++){var l=t.get(s);if(i.computeMinDistance(o,l,r),i._minDistance<=i._terminateDistance)return null}};Vu.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=Pu.getLines(this._geom[0]),r=Pu.getLines(this._geom[1]),i=r_.getPoints(this._geom[0]),a=r_.getPoints(this._geom[1]);if(this.computeMinDistanceLines(t,r,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(t,a,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance)||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(r,i,e),this.updateMinDistance(e,!0),this._minDistance<=this._terminateDistance))return null;e[0]=null,e[1]=null,this.computeMinDistancePoints(i,a,e),this.updateMinDistance(e,!1)};Vu.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation};Vu.prototype.updateMinDistance=function(e,t){if(e[0]===null)return null;t?(this._minDistanceLocation[0]=e[1],this._minDistanceLocation[1]=e[0]):(this._minDistanceLocation[0]=e[0],this._minDistanceLocation[1]=e[1])};Vu.prototype.nearestPoints=function(){this.computeMinDistance();var e=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return e};Vu.prototype.computeMinDistance=function(){var e=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof $s&&arguments[1]instanceof Jc){var t=arguments[0],r=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var a=t.getCoordinates(),o=r.getCoordinate(),s=0;s<a.length-1;s++){var l=Gr.distancePointLine(o,a[s],a[s+1]);if(l<e._minDistance){e._minDistance=l;var u=new wn(a[s],a[s+1]),h=u.closestPoint(o);i[0]=new Vh(t,s,h),i[1]=new Vh(r,0,o)}if(e._minDistance<=e._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof $s&&arguments[1]instanceof $s){var c=arguments[0],f=arguments[1],d=arguments[2];if(c.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=c.getCoordinates(),p=f.getCoordinates(),g=0;g<v.length-1;g++)for(var m=0;m<p.length-1;m++){var y=Gr.distanceLineLine(v[g],v[g+1],p[m],p[m+1]);if(y<e._minDistance){e._minDistance=y;var _=new wn(v[g],v[g+1]),x=new wn(p[m],p[m+1]),S=_.closestPoints(x);d[0]=new Vh(c,g,S[0]),d[1]=new Vh(f,m,S[1])}if(e._minDistance<=e._terminateDistance)return null}}}};Vu.prototype.computeMinDistancePoints=function(e,t,r){for(var i=this,a=0;a<e.size();a++)for(var o=e.get(a),s=0;s<t.size();s++){var l=t.get(s),u=o.getCoordinate().distance(l.getCoordinate());if(u<i._minDistance&&(i._minDistance=u,r[0]=new Vh(o,0,o.getCoordinate()),r[1]=new Vh(l,0,l.getCoordinate())),i._minDistance<=i._terminateDistance)return null}};Vu.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Ss("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)};Vu.prototype.computeMinDistanceLines=function(e,t,r){for(var i=this,a=0;a<e.size();a++)for(var o=e.get(a),s=0;s<t.size();s++){var l=t.get(s);if(i.computeMinDistance(o,l,r),i._minDistance<=i._terminateDistance)return null}};Vu.prototype.interfaces_=function(){return[]};Vu.prototype.getClass=function(){return Vu};Vu.distance=function(e,t){var r=new Vu(e,t);return r.distance()};Vu.isWithinDistance=function(e,t,r){var i=new Vu(e,t,r);return i.distance()<=r};Vu.nearestPoints=function(e,t){var r=new Vu(e,t);return r.nearestPoints()};var oh=function(){this._pt=[new tt,new tt],this._distance=ui.NaN,this._isNull=!0};oh.prototype.getCoordinates=function(){return this._pt};oh.prototype.getCoordinate=function(e){return this._pt[e]};oh.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i<this._distance&&this.initialize(t,r,i)}};oh.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=a,this._isNull=!1}};oh.prototype.toString=function(){return Mv.toLineString(this._pt[0],this._pt[1])};oh.prototype.getDistance=function(){return this._distance};oh.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i>this._distance&&this.initialize(t,r,i)}};oh.prototype.interfaces_=function(){return[]};oh.prototype.getClass=function(){return oh};var Ep=function(){};Ep.prototype.interfaces_=function(){return[]};Ep.prototype.getClass=function(){return Ep};Ep.computeDistance=function(){if(arguments[2]instanceof oh&&arguments[0]instanceof $s&&arguments[1]instanceof tt)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=new wn,a=e.getCoordinates(),o=0;o<a.length-1;o++){i.setCoordinates(a[o],a[o+1]);var s=i.closestPoint(t);r.setMinimum(s,t)}else if(arguments[2]instanceof oh&&arguments[0]instanceof Rl&&arguments[1]instanceof tt){var l=arguments[0],u=arguments[1],h=arguments[2];Ep.computeDistance(l.getExteriorRing(),u,h);for(var c=0;c<l.getNumInteriorRing();c++)Ep.computeDistance(l.getInteriorRingN(c),u,h)}else if(arguments[2]instanceof oh&&arguments[0]instanceof Gn&&arguments[1]instanceof tt){var f=arguments[0],d=arguments[1],v=arguments[2];if(f instanceof $s)Ep.computeDistance(f,d,v);else if(f instanceof Rl)Ep.computeDistance(f,d,v);else if(f instanceof Yh)for(var p=f,g=0;g<p.getNumGeometries();g++){var m=p.getGeometryN(g);Ep.computeDistance(m,d,v)}else v.setMinimum(f.getCoordinate(),d)}else if(arguments[2]instanceof oh&&arguments[0]instanceof wn&&arguments[1]instanceof tt){var y=arguments[0],_=arguments[1],x=arguments[2],S=y.closestPoint(_);x.setMinimum(S,_)}};var Sd=function(){this._g0=null,this._g1=null,this._ptDist=new oh,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},Lce={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Sd.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()};Sd.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new Ss("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e};Sd.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)};Sd.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Sd.prototype.computeOrientedDistance=function(e,t,r){var i=new k2(t);if(e.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var a=new A_(t,this._densifyFrac);e.apply(a),r.setMaximum(a.getMaxPointDistance())}};Sd.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Sd.prototype.interfaces_=function(){return[]};Sd.prototype.getClass=function(){return Sd};Sd.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new Sd(e,t);return r.distance()}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2],s=new Sd(i,a);return s.setDensifyFraction(o),s.distance()}};Lce.MaxPointDistanceFilter.get=function(){return k2};Lce.MaxDensifiedByFractionDistanceFilter.get=function(){return A_};Object.defineProperties(Sd,Lce);var k2=function(){this._maxPtDist=new oh,this._minPtDist=new oh,this._euclideanDist=new Ep,this._geom=null;var e=arguments[0];this._geom=e};k2.prototype.filter=function(e){this._minPtDist.initialize(),Ep.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};k2.prototype.getMaxPointDistance=function(){return this._maxPtDist};k2.prototype.interfaces_=function(){return[w0]};k2.prototype.getClass=function(){return k2};var A_=function(){this._maxPtDist=new oh,this._minPtDist=new oh,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};A_.prototype.filter=function(e,t){var r=this;if(t===0)return null;for(var i=e.getCoordinate(t-1),a=e.getCoordinate(t),o=(a.x-i.x)/this._numSubSegs,s=(a.y-i.y)/this._numSubSegs,l=0;l<this._numSubSegs;l++){var u=i.x+l*o,h=i.y+l*s,c=new tt(u,h);r._minPtDist.initialize(),Ep.computeDistance(r._geom,c,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}};A_.prototype.isDone=function(){return!1};A_.prototype.isGeometryChanged=function(){return!1};A_.prototype.getMaxPointDistance=function(){return this._maxPtDist};A_.prototype.interfaces_=function(){return[Iv]};A_.prototype.getClass=function(){return A_};var Xc=function(e,t,r){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._bufDistance=t||null,this._result=r||null},Pce={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Xc.prototype.checkMaximumDistance=function(e,t,r){var i=new Sd(t,e);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var a=i.getCoordinates();this._errorLocation=a[1],this._errorIndicator=e.getFactory().createLineString(a),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Mv.toLineString(a[0],a[1])+")"}};Xc.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=Xc.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Xc.VERBOSE&&zu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};Xc.prototype.checkNegativeValid=function(){if(!(this._input instanceof Rl||this._input instanceof p0||this._input instanceof Yh))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)};Xc.prototype.getErrorIndicator=function(){return this._errorIndicator};Xc.prototype.checkMinimumDistance=function(e,t,r){var i=new Vu(e,t,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var a=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=e.getFactory().createLineString(a),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Mv.toLineString(a[0],a[1])+" )"}};Xc.prototype.checkPositiveValid=function(){var e=this._result.getBoundary();if(this.checkMinimumDistance(this._input,e,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,e,this._maxValidDistance)};Xc.prototype.getErrorLocation=function(){return this._errorLocation};Xc.prototype.getPolygonLines=function(e){for(var t=new Pr,r=new Pu(t),i=im.getPolygons(e),a=i.iterator();a.hasNext();){var o=a.next();o.apply(r)}return e.getFactory().buildGeometry(t)};Xc.prototype.getErrorMessage=function(){return this._errMsg};Xc.prototype.interfaces_=function(){return[]};Xc.prototype.getClass=function(){return Xc};Pce.VERBOSE.get=function(){return!1};Pce.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012};Object.defineProperties(Xc,Pce);var $u=function(e,t,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=r||null},Oce={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};$u.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid};$u.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*$u.MAX_ENV_DIFF_FRAC;e===0&&(e=.001);var t=new gn(this._input.getEnvelopeInternal());t.expandBy(this._distance);var r=new gn(this._result.getEnvelopeInternal());r.expandBy(e),r.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")};$u.prototype.checkDistance=function(){var e=new Xc(this._input,this._distance,this._result);e.isValid()||(this._isValid=!1,this._errorMsg=e.getErrorMessage(),this._errorLocation=e.getErrorLocation(),this._errorIndicator=e.getErrorIndicator()),this.report("Distance")};$u.prototype.checkArea=function(){var e=this._input.getArea(),t=this._result.getArea();this._distance>0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e<t&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")};$u.prototype.checkPolygonal=function(){this._result instanceof Rl||this._result instanceof p0||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")};$u.prototype.getErrorIndicator=function(){return this._errorIndicator};$u.prototype.getErrorLocation=function(){return this._errorLocation};$u.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};$u.prototype.report=function(e){if(!$u.VERBOSE)return null;zu.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))};$u.prototype.getErrorMessage=function(){return this._errorMsg};$u.prototype.interfaces_=function(){return[]};$u.prototype.getClass=function(){return $u};$u.isValidMsg=function(e,t,r){var i=new $u(e,t,r);return i.isValid()?null:i.getErrorMessage()};$u.isValid=function(e,t,r){var i=new $u(e,t,r);return!!i.isValid()};Oce.VERBOSE.get=function(){return!1};Oce.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties($u,Oce);var eg=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};eg.prototype.getCoordinates=function(){return this._pts};eg.prototype.size=function(){return this._pts.length};eg.prototype.getCoordinate=function(e){return this._pts[e]};eg.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};eg.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:P2.octant(this.getCoordinate(e),this.getCoordinate(e+1))};eg.prototype.setData=function(e){this._data=e};eg.prototype.getData=function(){return this._data};eg.prototype.toString=function(){return Mv.toLineString(new el(this._pts))};eg.prototype.interfaces_=function(){return[T0]};eg.prototype.getClass=function(){return eg};var vu=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Pr,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};vu.prototype.getInteriorIntersection=function(){return this._interiorIntersection};vu.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e};vu.prototype.getIntersectionSegments=function(){return this._intSegments};vu.prototype.count=function(){return this._intersectionCount};vu.prototype.getIntersections=function(){return this._intersections};vu.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};vu.prototype.setKeepIntersections=function(e){this._keepIntersections=e};vu.prototype.processIntersections=function(e,t,r,i){if(!this._findAllIntersections&&this.hasIntersection()||e===r&&t===i)return null;if(this._isCheckEndSegmentsOnly){var a=this.isEndSegment(e,t)||this.isEndSegment(r,i);if(!a)return null}var o=e.getCoordinates()[t],s=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,s,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=s,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};vu.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2};vu.prototype.hasIntersection=function(){return this._interiorIntersection!==null};vu.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};vu.prototype.interfaces_=function(){return[cw]};vu.prototype.getClass=function(){return vu};vu.createAllIntersectionsFinder=function(e){var t=new vu(e);return t.setFindAllIntersections(!0),t};vu.createAnyIntersectionFinder=function(e){return new vu(e)};vu.createIntersectionCounter=function(e){var t=new vu(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var Dv=function(){this._li=new Ow,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};Dv.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Dv.prototype.getIntersections=function(){return this._segInt.getIntersections()};Dv.prototype.isValid=function(){return this.execute(),this._isValid};Dv.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e};Dv.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new vu(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Mce;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Dv.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new wm(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Dv.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Mv.toLineString(e[0],e[1])+" and "+Mv.toLineString(e[2],e[3])};Dv.prototype.interfaces_=function(){return[]};Dv.prototype.getClass=function(){return Dv};Dv.computeIntersections=function(e){var t=new Dv(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var vw=function n(){this._nv=null;var e=arguments[0];this._nv=new Dv(n.toSegmentStrings(e))};vw.prototype.checkValid=function(){this._nv.checkValid()};vw.prototype.interfaces_=function(){return[]};vw.prototype.getClass=function(){return vw};vw.toSegmentStrings=function(e){for(var t=new Pr,r=e.iterator();r.hasNext();){var i=r.next();t.add(new eg(i.getCoordinates(),i))}return t};vw.checkValid=function(e){var t=new vw(e);t.checkValid()};var F2=function(e){this._mapOp=e};F2.prototype.map=function(e){for(var t=this,r=new Pr,i=0;i<e.getNumGeometries();i++){var a=t._mapOp.map(e.getGeometryN(i));a.isEmpty()||r.add(a)}return e.getFactory().createGeometryCollection(Fi.toGeometryArray(r))};F2.prototype.interfaces_=function(){return[]};F2.prototype.getClass=function(){return F2};F2.map=function(e,t){var r=new F2(t);return r.map(e)};var tg=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Pr,this._resultLineList=new Pr;var e=arguments[0],t=arguments[1],r=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=r};tg.prototype.collectLines=function(e){for(var t=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();t.collectLineEdge(i,e,t._lineEdgesList),t.collectBoundaryTouchEdge(i,e,t._lineEdgesList)}};tg.prototype.labelIsolatedLine=function(e,t){var r=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,r)};tg.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList};tg.prototype.collectLineEdge=function(e,t,r){var i=e.getLabel(),a=e.getEdge();e.isLineEdge()&&!e.isVisited()&&pi.isResultOfOp(i,t)&&!a.isCovered()&&(r.add(a),e.setVisitedEdge(!0))};tg.prototype.findCoveredLineEdges=function(){for(var e=this,t=this._op.getGraph().getNodes().iterator();t.hasNext();){var r=t.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var a=i.next(),o=a.getEdge();if(a.isLineEdge()&&!o.isCoveredSet()){var s=e._op.isCoveredByA(a.getCoordinate());o.setCovered(s)}}};tg.prototype.labelIsolatedLines=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next(),a=i.getLabel();i.isIsolated()&&(a.isNull(0)?t.labelIsolatedLine(i,0):t.labelIsolatedLine(i,1))}};tg.prototype.buildLines=function(e){for(var t=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),a=t._geometryFactory.createLineString(i.getCoordinates());t._resultLineList.add(a),i.setInResult(!0)}};tg.prototype.collectBoundaryTouchEdge=function(e,t,r){var i=e.getLabel();if(e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult())return null;mi.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),pi.isResultOfOp(i,t)&&t===pi.INTERSECTION&&(r.add(e.getEdge()),e.setVisitedEdge(!0))};tg.prototype.interfaces_=function(){return[]};tg.prototype.getClass=function(){return tg};var B2=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Pr;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};B2.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var r=this._geometryFactory.createPoint(t);this._resultPointList.add(r)}};B2.prototype.extractNonCoveredResultNodes=function(e){for(var t=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||e===pi.INTERSECTION)){var a=i.getLabel();pi.isResultOfOp(a,e)&&t.filterCoveredNodeToPoint(i)}}};B2.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList};B2.prototype.interfaces_=function(){return[]};B2.prototype.getClass=function(){return B2};var _c=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};_c.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))};_c.prototype.transformPolygon=function(e,t){var r=this,i=!0,a=this.transformLinearRing(e.getExteriorRing(),e);(a===null||!(a instanceof b0)||a.isEmpty())&&(i=!1);for(var o=new Pr,s=0;s<e.getNumInteriorRing();s++){var l=r.transformLinearRing(e.getInteriorRingN(s),e);l===null||l.isEmpty()||(l instanceof b0||(i=!1),o.add(l))}if(i)return this._factory.createPolygon(a,o.toArray([]));var u=new Pr;return a!==null&&u.add(a),u.addAll(o),this._factory.buildGeometry(u)};_c.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)};_c.prototype.getInputGeometry=function(){return this._inputGeom};_c.prototype.transformMultiLineString=function(e,t){for(var r=this,i=new Pr,a=0;a<e.getNumGeometries();a++){var o=r.transformLineString(e.getGeometryN(a),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)};_c.prototype.transformCoordinates=function(e,t){return this.copy(e)};_c.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))};_c.prototype.transformMultiPoint=function(e,t){for(var r=this,i=new Pr,a=0;a<e.getNumGeometries();a++){var o=r.transformPoint(e.getGeometryN(a),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)};_c.prototype.transformMultiPolygon=function(e,t){for(var r=this,i=new Pr,a=0;a<e.getNumGeometries();a++){var o=r.transformPolygon(e.getGeometryN(a),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)};_c.prototype.copy=function(e){return e.copy()};_c.prototype.transformGeometryCollection=function(e,t){for(var r=this,i=new Pr,a=0;a<e.getNumGeometries();a++){var o=r.transform(e.getGeometryN(a));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Fi.toGeometryArray(i)):this._factory.buildGeometry(i)};_c.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof Jc)return this.transformPoint(e,null);if(e instanceof sI)return this.transformMultiPoint(e,null);if(e instanceof b0)return this.transformLinearRing(e,null);if(e instanceof $s)return this.transformLineString(e,null);if(e instanceof lw)return this.transformMultiLineString(e,null);if(e instanceof Rl)return this.transformPolygon(e,null);if(e instanceof p0)return this.transformMultiPolygon(e,null);if(e instanceof Yh)return this.transformGeometryCollection(e,null);throw new Ss("Unknown Geometry subtype: "+e.getClass().getName())};_c.prototype.transformLinearRing=function(e,t){var r=this.transformCoordinates(e.getCoordinateSequence(),e);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)};_c.prototype.interfaces_=function(){return[]};_c.prototype.getClass=function(){return _c};var M0=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new wn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $s&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];n.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};M0.prototype.snapVertices=function(e,t){for(var r=this,i=this._isClosed?e.size()-1:e.size(),a=0;a<i;a++){var o=e.get(a),s=r.findSnapForVertex(o,t);s!==null&&(e.set(a,new tt(s)),a===0&&r._isClosed&&e.set(e.size()-1,new tt(s)))}};M0.prototype.findSnapForVertex=function(e,t){for(var r=this,i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<r._snapTolerance)return t[i]}return null};M0.prototype.snapTo=function(e){var t=new Qk(this._srcPts);this.snapVertices(t,e),this.snapSegments(t,e);var r=t.toCoordinateArray();return r};M0.prototype.snapSegments=function(e,t){var r=this;if(t.length===0)return null;var i=t.length;t[0].equals2D(t[t.length-1])&&(i=t.length-1);for(var a=0;a<i;a++){var o=t[a],s=r.findSegmentIndexToSnap(o,e);s>=0&&e.add(s+1,new tt(o),!1)}};M0.prototype.findSegmentIndexToSnap=function(e,t){for(var r=this,i=ui.MAX_VALUE,a=-1,o=0;o<t.size()-1;o++){if(r._seg.p0=t.get(o),r._seg.p1=t.get(o+1),r._seg.p0.equals2D(e)||r._seg.p1.equals2D(e)){if(r._allowSnappingToSourceVertices)continue;return-1}var s=r._seg.distance(e);s<r._snapTolerance&&s<i&&(i=s,a=o)}return a};M0.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e};M0.prototype.interfaces_=function(){return[]};M0.prototype.getClass=function(){return M0};M0.isClosed=function(e){return e.length<=1?!1:e[0].equals2D(e[e.length-1])};var tl=function(e){this._srcGeom=e||null},XJe={SNAP_PRECISION_FACTOR:{configurable:!0}};tl.prototype.snapTo=function(e,t){var r=this.extractTargetCoordinates(e),i=new YJe(t,r);return i.transform(this._srcGeom)};tl.prototype.snapToSelf=function(e,t){var r=this.extractTargetCoordinates(this._srcGeom),i=new YJe(e,r,!0),a=i.transform(this._srcGeom),o=a;return t&&zn(o,S_)&&(o=a.buffer(0)),o};tl.prototype.computeSnapTolerance=function(e){var t=this.computeMinimumSegmentLength(e),r=t/10;return r};tl.prototype.extractTargetCoordinates=function(e){for(var t=new Xp,r=e.getCoordinates(),i=0;i<r.length;i++)t.add(r[i]);return t.toArray(new Array(0).fill(null))};tl.prototype.computeMinimumSegmentLength=function(e){for(var t=ui.MAX_VALUE,r=0;r<e.length-1;r++){var i=e[r].distance(e[r+1]);i<t&&(t=i)}return t};tl.prototype.interfaces_=function(){return[]};tl.prototype.getClass=function(){return tl};tl.snap=function(e,t,r){var i=new Array(2).fill(null),a=new tl(e);i[0]=a.snapTo(t,r);var o=new tl(t);return i[1]=o.snapTo(i[0],r),i};tl.computeOverlaySnapTolerance=function(){if(arguments.length===1){var e=arguments[0],t=tl.computeSizeBasedSnapTolerance(e),r=e.getPrecisionModel();if(r.getType()===to.FIXED){var i=1/r.getScale()*2/1.415;i>t&&(t=i)}return t}else if(arguments.length===2){var a=arguments[0],o=arguments[1];return Math.min(tl.computeOverlaySnapTolerance(a),tl.computeOverlaySnapTolerance(o))}};tl.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),r=Math.min(t.getHeight(),t.getWidth()),i=r*tl.SNAP_PRECISION_FACTOR;return i};tl.snapToSelf=function(e,t,r){var i=new tl(e);return i.snapToSelf(t,r)};XJe.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(tl,XJe);var YJe=function(n){function e(t,r,i){n.call(this),this._snapTolerance=t||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(r,i){var a=new M0(r,this._snapTolerance);return a.setAllowSnappingToSourceVertices(this._isSelfSnap),a.snapTo(i)},e.prototype.transformCoordinates=function(r,i){var a=r.toCoordinateArray(),o=this.snapLine(a,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_c),Bh=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Bh.prototype.getCommon=function(){return ui.longBitsToDouble(this._commonBits)};Bh.prototype.add=function(e){var t=ui.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Bh.signExpBits(this._commonBits),this._isFirst=!1,null;var r=Bh.signExpBits(t);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Bh.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Bh.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};Bh.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ui.longBitsToDouble(e),r=ui.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+r,a=i.substring(i.length-64),o=a.substring(0,1)+" "+a.substring(1,12)+"(exp) "+a.substring(12)+" [ "+t+" ]";return o}};Bh.prototype.interfaces_=function(){return[]};Bh.prototype.getClass=function(){return Bh};Bh.getBit=function(e,t){var r=1<<t;return(e&r)!==0?1:0};Bh.signExpBits=function(e){return e>>52};Bh.zeroLowerBits=function(e,t){var r=(1<<t)-1,i=~r,a=e&i;return a};Bh.numCommonMostSigMantissaBits=function(e,t){for(var r=0,i=52;i>=0;i--){if(Bh.getBit(e,i)!==Bh.getBit(t,i))return r;r++}return 52};var M_=function(){this._commonCoord=null,this._ccFilter=new G2},Rce={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};M_.prototype.addCommonBits=function(e){var t=new I_(this._commonCoord);e.apply(t),e.geometryChanged()};M_.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new tt(this._commonCoord);t.x=-t.x,t.y=-t.y;var r=new I_(t);return e.apply(r),e.geometryChanged(),e};M_.prototype.getCommonCoordinate=function(){return this._commonCoord};M_.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};M_.prototype.interfaces_=function(){return[]};M_.prototype.getClass=function(){return M_};Rce.CommonCoordinateFilter.get=function(){return G2};Rce.Translater.get=function(){return I_};Object.defineProperties(M_,Rce);var G2=function(){this._commonBitsX=new Bh,this._commonBitsY=new Bh};G2.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)};G2.prototype.getCommonCoordinate=function(){return new tt(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};G2.prototype.interfaces_=function(){return[w0]};G2.prototype.getClass=function(){return G2};var I_=function(){this.trans=null;var e=arguments[0];this.trans=e};I_.prototype.filter=function(e,t){var r=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,r),e.setOrdinate(t,1,i)};I_.prototype.isDone=function(){return!1};I_.prototype.isGeometryChanged=function(){return!0};I_.prototype.interfaces_=function(){return[Iv]};I_.prototype.getClass=function(){return I_};var pu=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};pu.prototype.selfSnap=function(e){var t=new tl(e),r=t.snapTo(e,this._snapTolerance);return r};pu.prototype.removeCommonBits=function(e){this._cbr=new M_,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t};pu.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e};pu.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),r=pi.overlayOp(t[0],t[1],e);return this.prepareResult(r)};pu.prototype.checkValid=function(e){e.isValid()||zu.out.println("Snapped geometry is invalid")};pu.prototype.computeSnapTolerance=function(){this._snapTolerance=tl.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};pu.prototype.snap=function(e){var t=this.removeCommonBits(e),r=tl.snap(t[0],t[1],this._snapTolerance);return r};pu.prototype.interfaces_=function(){return[]};pu.prototype.getClass=function(){return pu};pu.overlayOp=function(e,t,r){var i=new pu(e,t);return i.getResultGeometry(r)};pu.union=function(e,t){return pu.overlayOp(e,t,pi.UNION)};pu.intersection=function(e,t){return pu.overlayOp(e,t,pi.INTERSECTION)};pu.symDifference=function(e,t){return pu.overlayOp(e,t,pi.SYMDIFFERENCE)};pu.difference=function(e,t){return pu.overlayOp(e,t,pi.DIFFERENCE)};var Kh=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};Kh.prototype.getResultGeometry=function(e){var t=null,r=!1,i=null;try{t=pi.overlayOp(this._geom[0],this._geom[1],e);var a=!0;a&&(r=!0)}catch(o){if(o instanceof xm)i=o;else throw o}finally{}if(!r)try{t=pu.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof xm?i:o}finally{}return t};Kh.prototype.interfaces_=function(){return[]};Kh.prototype.getClass=function(){return Kh};Kh.overlayOp=function(e,t,r){var i=new Kh(e,t);return i.getResultGeometry(r)};Kh.union=function(e,t){return Kh.overlayOp(e,t,pi.UNION)};Kh.intersection=function(e,t){return Kh.overlayOp(e,t,pi.INTERSECTION)};Kh.symDifference=function(e,t){return Kh.overlayOp(e,t,pi.SYMDIFFERENCE)};Kh.difference=function(e,t){return Kh.overlayOp(e,t,pi.DIFFERENCE)};var $N=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};$N.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)};$N.prototype.interfaces_=function(){return[]};$N.prototype.getClass=function(){return $N};var tf=function n(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],t=arguments[1];this._eventType=n.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=a}},Dce={INSERT:{configurable:!0},DELETE:{configurable:!0}};tf.prototype.isDelete=function(){return this._eventType===tf.DELETE};tf.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e};tf.prototype.getObject=function(){return this._obj};tf.prototype.compareTo=function(e){var t=e;return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:this._eventType>t._eventType?1:0};tf.prototype.getInsertEvent=function(){return this._insertEvent};tf.prototype.isInsert=function(){return this._eventType===tf.INSERT};tf.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label};tf.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};tf.prototype.interfaces_=function(){return[$d]};tf.prototype.getClass=function(){return tf};Dce.INSERT.get=function(){return 1};Dce.DELETE.get=function(){return 2};Object.defineProperties(tf,Dce);var j7=function(){};j7.prototype.interfaces_=function(){return[]};j7.prototype.getClass=function(){return j7};var Wu=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],r=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=r};Wu.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(Wu.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var a=e.getNumPoints()-1;if(t===0&&i===a||i===0&&t===a)return!0}}return!1};Wu.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Wu.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e};Wu.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Wu.prototype.isBoundaryPointInternal=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next(),a=i.getCoordinate();if(e.isIntersection(a))return!0}return!1};Wu.prototype.hasProperIntersection=function(){return this._hasProper};Wu.prototype.hasIntersection=function(){return this._hasIntersection};Wu.prototype.isDone=function(){return this._isDone};Wu.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))};Wu.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t};Wu.prototype.addIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var a=e.getCoordinates()[t],o=e.getCoordinates()[t+1],s=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(a,o,s,l),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};Wu.prototype.interfaces_=function(){return[]};Wu.prototype.getClass=function(){return Wu};Wu.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var Xzr=function(n){function e(){n.call(this),this.events=new Pr,this.nOverlaps=null}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var r=this;Pv.sort(this.events);for(var i=0;i<this.events.size();i++){var a=r.events.get(i);a.isDelete()&&a.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var a=0;a<this.events.size();a++){var o=r.events.get(a);if(o.isInsert()&&r.processOverlaps(a,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Wu&&zn(arguments[0],wv)&&zn(arguments[1],wv)){var s=arguments[0],l=arguments[1],u=arguments[2];this.addEdges(s,s),this.addEdges(l,l),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&zn(arguments[0],wv)&&arguments[1]instanceof Wu){var h=arguments[0],c=arguments[1],f=arguments[2];f?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(c)}}},e.prototype.addEdge=function(r,i){for(var a=this,o=r.getMonotoneChainEdge(),s=o.getStartIndexes(),l=0;l<s.length-1;l++){var u=new $N(o,l),h=new tf(i,o.getMinX(l),u);a.events.add(h),a.events.add(new tf(o.getMaxX(l),h))}},e.prototype.processOverlaps=function(r,i,a,o){for(var s=this,l=a.getObject(),u=r;u<i;u++){var h=s.events.get(u);if(h.isInsert()){var c=h.getObject();a.isSameLabel(h)||(l.computeIntersections(c,o),s.nOverlaps++)}}},e.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],a=i.iterator();a.hasNext();){var o=a.next();r.addEdge(o,o)}else if(arguments.length===2)for(var s=arguments[0],l=arguments[1],u=s.iterator();u.hasNext();){var h=u.next();r.addEdge(h,l)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(j7),I0=function(){this._min=ui.POSITIVE_INFINITY,this._max=ui.NEGATIVE_INFINITY},qJe={NodeComparator:{configurable:!0}};I0.prototype.getMin=function(){return this._min};I0.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)};I0.prototype.getMax=function(){return this._max};I0.prototype.toString=function(){return Mv.toLineString(new tt(this._min,0),new tt(this._max,0))};I0.prototype.interfaces_=function(){return[]};I0.prototype.getClass=function(){return I0};qJe.NodeComparator.get=function(){return WN};Object.defineProperties(I0,qJe);var WN=function(){};WN.prototype.compare=function(e,t){var r=e,i=t,a=(r._min+r._max)/2,o=(i._min+i._max)/2;return a<o?-1:a>o?1:0};WN.prototype.interfaces_=function(){return[eI]};WN.prototype.getClass=function(){return WN};var Yzr=function(n){function e(){n.call(this),this._item=null;var t=arguments[0],r=arguments[1],i=arguments[2];this._min=t,this._max=r,this._item=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.query=function(r,i,a){if(!this.intersects(r,i))return null;a.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(I0),qzr=function(n){function e(){n.call(this),this._node1=null,this._node2=null;var t=arguments[0],r=arguments[1];this._node1=t,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},e.prototype.query=function(r,i,a){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,a),this._node2!==null&&this._node2.query(r,i,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(I0),L0=function(){this._leaves=new Pr,this._root=null,this._level=0};L0.prototype.buildTree=function(){var e=this;Pv.sort(this._leaves,new I0.NodeComparator);for(var t=this._leaves,r=null,i=new Pr;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);r=t,t=i,i=r}};L0.prototype.insert=function(e,t,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Yzr(e,t,r))};L0.prototype.query=function(e,t,r){this.init(),this._root.query(e,t,r)};L0.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};L0.prototype.printNode=function(e){zu.out.println(Mv.toLineString(new tt(e._min,this._level),new tt(e._max,this._level)))};L0.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};L0.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var r=0;r<e.size();r+=2){var i=e.get(r),a=r+1<e.size()?e.get(r):null;if(a===null)t.add(i);else{var o=new qzr(e.get(r),e.get(r+1));t.add(o)}}};L0.prototype.interfaces_=function(){return[]};L0.prototype.getClass=function(){return L0};var dI=function(){this._items=new Pr};dI.prototype.visitItem=function(e){this._items.add(e)};dI.prototype.getItems=function(){return this._items};dI.prototype.interfaces_=function(){return[w_]};dI.prototype.getClass=function(){return dI};var vI=function(){this._index=null;var e=arguments[0];if(!zn(e,S_))throw new Ss("Argument must be Polygonal");this._index=new pw(e)},Nce={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};vI.prototype.locate=function(e){var t=new Gp(e),r=new pI(t);return this._index.query(e.y,e.y,r),t.getLocation()};vI.prototype.interfaces_=function(){return[cI]};vI.prototype.getClass=function(){return vI};Nce.SegmentVisitor.get=function(){return pI};Nce.IntervalIndexedGeometry.get=function(){return pw};Object.defineProperties(vI,Nce);var pI=function(){this._counter=null;var e=arguments[0];this._counter=e};pI.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))};pI.prototype.interfaces_=function(){return[w_]};pI.prototype.getClass=function(){return pI};var pw=function(){this._index=new L0;var e=arguments[0];this.init(e)};pw.prototype.init=function(e){for(var t=this,r=Pu.getLines(e),i=r.iterator();i.hasNext();){var a=i.next(),o=a.getCoordinates();t.addLine(o)}};pw.prototype.addLine=function(e){for(var t=this,r=1;r<e.length;r++){var i=new wn(e[r-1],e[r]),a=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);t._index.insert(a,o,i)}};pw.prototype.query=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new dI;return this._index.query(e,t,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2];this._index.query(i,a,o)}};pw.prototype.interfaces_=function(){return[]};pw.prototype.getClass=function(){return pw};var XP=function(n){function e(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new OJe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Rv,arguments.length===2){var t=arguments[0],r=arguments[1],i=Od.OGC_SFS_BOUNDARY_RULE;this._argIndex=t,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var a=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=a,this._parentGeom=o,this._boundaryNodeRule=s,o!==null&&this.add(o)}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(r,i){var a=this._nodes.addNode(i),o=a.getLabel(),s=1,l=dt.NONE;l=o.getLocation(r,wr.ON),l===dt.BOUNDARY&&s++;var u=e.determineBoundary(this._boundaryNodeRule,s);o.setLocation(r,u)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var a=arguments[0],o=arguments[1],s=arguments[2],l=new Wu(a,!0,!1);l.setIsDoneIfProperInt(s);var u=this.createEdgeSetIntersector(),h=this._parentGeom instanceof b0||this._parentGeom instanceof Rl||this._parentGeom instanceof p0,c=o||!h;return u.computeIntersections(this._edges,l,c),this.addSelfIntersectionNodes(this._argIndex),l}},e.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var a=i.next();a.eiList.addSplitEdges(r)}},e.prototype.computeEdgeIntersections=function(r,i,a){var o=new Wu(i,a,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var s=this.createEdgeSetIntersector();return s.computeIntersections(this._edges,r._edges,o),o},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Jc){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,dt.INTERIOR)}else if(arguments[0]instanceof tt){var a=arguments[0];this.insertPoint(this._argIndex,a,dt.INTERIOR)}},e.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),dt.EXTERIOR,dt.INTERIOR);for(var a=0;a<r.getNumInteriorRing();a++){var o=r.getInteriorRingN(a);i.addPolygonRing(o,dt.INTERIOR,dt.EXTERIOR)}},e.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],dt.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],dt.BOUNDARY)},e.prototype.addLineString=function(r){var i=Bi.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var a=new H7(i,new fo(this._argIndex,dt.INTERIOR));this._lineEdgeMap.put(r,a),this.insertEdge(a),mi.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),a=0,o=r.iterator();o.hasNext();){var s=o.next();i[a++]=s.getCoordinate().copy()}return i},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(r,i,a){if(this.isBoundaryNode(r,i))return null;a===dt.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,a)},e.prototype.addPolygonRing=function(r,i,a){if(r.isEmpty())return null;var o=Bi.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var s=i,l=a;Gr.isCCW(o)&&(s=a,l=i);var u=new H7(o,new fo(this._argIndex,dt.BOUNDARY,s,l));this._lineEdgeMap.put(r,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],dt.BOUNDARY)},e.prototype.insertPoint=function(r,i,a){var o=this._nodes.addNode(i),s=o.getLabel();s===null?o._label=new fo(r,a):s.setLocation(r,a)},e.prototype.createEdgeSetIntersector=function(){return new Xzr},e.prototype.addSelfIntersectionNodes=function(r){for(var i=this,a=this._edges.iterator();a.hasNext();)for(var o=a.next(),s=o.getLabel().getLocation(r),l=o.eiList.iterator();l.hasNext();){var u=l.next();i.addSelfIntersectionNode(r,u.coord,s)}},e.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof p0&&(this._useBoundaryDeterminationRule=!1),r instanceof Rl)this.addPolygon(r);else if(r instanceof $s)this.addLineString(r);else if(r instanceof Jc)this.addPoint(r);else if(r instanceof sI)this.addCollection(r);else if(r instanceof lw)this.addCollection(r);else if(r instanceof p0)this.addCollection(r);else if(r instanceof Yh)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(r){for(var i=this,a=0;a<r.getNumGeometries();a++){var o=r.getGeometryN(a);i.add(o)}},e.prototype.locate=function(r){return zn(this._parentGeom,S_)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new vI(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(r,i){return r.isInBoundary(i)?dt.BOUNDARY:dt.INTERIOR},e}(Ps),gI=function(){if(this._li=new Ow,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new XP(0,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=Od.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new XP(0,t,i),this._arg[1]=new XP(1,r,i)}else if(arguments.length===3){var a=arguments[0],o=arguments[1],s=arguments[2];a.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(a.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new XP(0,a,s),this._arg[1]=new XP(1,o,s)}};gI.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()};gI.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)};gI.prototype.interfaces_=function(){return[]};gI.prototype.getClass=function(){return gI};var LS=function(){};LS.prototype.interfaces_=function(){return[]};LS.prototype.getClass=function(){return LS};LS.map=function(){if(arguments[0]instanceof Gn&&zn(arguments[1],LS.MapOp)){for(var e=arguments[0],t=arguments[1],r=new Pr,i=0;i<e.getNumGeometries();i++){var a=t.map(e.getGeometryN(i));a!==null&&r.add(a)}return e.getFactory().buildGeometry(r)}else if(zn(arguments[0],Al)&&zn(arguments[1],LS.MapOp)){for(var o=arguments[0],s=arguments[1],l=new Pr,u=o.iterator();u.hasNext();){var h=u.next(),c=s.map(h);c!==null&&l.add(c)}return l}};LS.MapOp=function(){};var pi=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r),this._ptLocator=new Rv,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ov,this._resultPolyList=new Pr,this._resultLineList=new Pr,this._resultPointList=new Pr,this._graph=new Ps(new zJe),this._geomFact=t.getFactory()}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var a=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new fo(r.getLabel()),o.flip());var s=i.getDepth();s.isNull()&&s.add(a),s.add(o),a.merge(o)}else this._edgeList.add(r)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),a=i.getSym();i.isInResult()&&a.isInResult()&&(i.setInResult(!1),a.setInResult(!1))}},e.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},e.prototype.computeGeometry=function(r,i,a,o){var s=new Pr;return s.addAll(r),s.addAll(i),s.addAll(a),s.isEmpty()?e.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(s)},e.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(r,i){for(var a=this,o=i.iterator();o.hasNext();){var s=o.next(),l=a._ptLocator.locate(r,s);if(l!==dt.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var r=new Pr,i=this._edgeList.iterator();i.hasNext();){var a=i.next();a.isCollapsed()&&(i.remove(),r.add(a.getCollapsedEdge()))}this._edgeList.addAll(r)},e.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),a=i.getEdges().getLabel();i.getLabel().merge(a)}},e.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},e.prototype.insertUniqueEdges=function(r){for(var i=this,a=r.iterator();a.hasNext();){var o=a.next();i.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(r){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new Pr;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),vw.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var a=new Qc(this._geomFact);a.add(this._graph),this._resultPolyList=a.getPolygons();var o=new tg(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var s=new B2(this,this._geomFact,this._ptLocator);this._resultPointList=s.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},e.prototype.labelIncompleteNode=function(r,i){var a=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,a)},e.prototype.copyPoints=function(r){for(var i=this,a=this._arg[r].getNodeIterator();a.hasNext();){var o=a.next(),s=i._graph.addNode(o.getCoordinate());s.setLabel(r,o.getLabel().getLocation(r))}},e.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var a=i.next(),o=a.getLabel();o.isArea()&&!a.isInteriorAreaEdge()&&e.isResultOfOp(o.getLocation(0,wr.RIGHT),o.getLocation(1,wr.RIGHT),r)&&a.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),a=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var s=0;s<2;s++)!a.isNull(s)&&a.isArea()&&!o.isNull(s)&&(o.getDelta(s)===0?a.toLine(s):(mi.isTrue(!o.isNull(s,wr.LEFT),"depth of LEFT side has not been initialized"),a.setLocation(s,wr.LEFT,o.getLocation(s,wr.LEFT)),mi.isTrue(!o.isNull(s,wr.RIGHT),"depth of RIGHT side has not been initialized"),a.setLocation(s,wr.RIGHT,o.getLocation(s,wr.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var a=i.next();a.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var a=i.next(),o=a.getLabel();a.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(a,0):r.labelIncompleteNode(a,1)),a.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gI);pi.overlayOp=function(n,e,t){var r=new pi(n,e),i=r.getResultGeometry(t);return i};pi.intersection=function(n,e){if(n.isEmpty()||e.isEmpty())return pi.createEmptyResult(pi.INTERSECTION,n,e,n.getFactory());if(n.isGeometryCollection()){var t=e;return F2.map(n,{interfaces_:function(){return[LS.MapOp]},map:function(r){return r.intersection(t)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Kh.overlayOp(n,e,pi.INTERSECTION)};pi.symDifference=function(n,e){if(n.isEmpty()||e.isEmpty()){if(n.isEmpty()&&e.isEmpty())return pi.createEmptyResult(pi.SYMDIFFERENCE,n,e,n.getFactory());if(n.isEmpty())return e.copy();if(e.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Kh.overlayOp(n,e,pi.SYMDIFFERENCE)};pi.resultDimension=function(n,e,t){var r=e.getDimension(),i=t.getDimension(),a=-1;switch(n){case pi.INTERSECTION:a=Math.min(r,i);break;case pi.UNION:a=Math.max(r,i);break;case pi.DIFFERENCE:a=r;break;case pi.SYMDIFFERENCE:a=Math.max(r,i);break}return a};pi.createEmptyResult=function(n,e,t,r){var i=null;switch(pi.resultDimension(n,e,t)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i};pi.difference=function(n,e){return n.isEmpty()?pi.createEmptyResult(pi.DIFFERENCE,n,e,n.getFactory()):e.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Kh.overlayOp(n,e,pi.DIFFERENCE))};pi.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],e=arguments[1],t=n.getLocation(0),r=n.getLocation(1);return pi.isResultOfOp(t,r,e)}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2];switch(i===dt.BOUNDARY&&(i=dt.INTERIOR),a===dt.BOUNDARY&&(a=dt.INTERIOR),o){case pi.INTERSECTION:return i===dt.INTERIOR&&a===dt.INTERIOR;case pi.UNION:return i===dt.INTERIOR||a===dt.INTERIOR;case pi.DIFFERENCE:return i===dt.INTERIOR&&a!==dt.INTERIOR;case pi.SYMDIFFERENCE:return i===dt.INTERIOR&&a!==dt.INTERIOR||i!==dt.INTERIOR&&a===dt.INTERIOR}return!1}};pi.INTERSECTION=1;pi.UNION=2;pi.DIFFERENCE=3;pi.SYMDIFFERENCE=4;var n_=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Rv,this._seg=new wn;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};n_.prototype.isWithinToleranceOfBoundary=function(e){for(var t=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=t._linework.getGeometryN(r),a=i.getCoordinateSequence(),o=0;o<a.size()-1;o++){a.getCoordinate(o,t._seg.p0),a.getCoordinate(o+1,t._seg.p1);var s=t._seg.distance(e);if(s<=t._boundaryDistanceTolerance)return!0}return!1};n_.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?dt.BOUNDARY:this._ptLocator.locate(e,this._g)};n_.prototype.extractLinework=function(e){var t=new yI;e.apply(t);var r=t.getLinework(),i=Fi.toLineStringArray(r);return e.getFactory().createMultiLineString(i)};n_.prototype.interfaces_=function(){return[]};n_.prototype.getClass=function(){return n_};var yI=function(){this._linework=null,this._linework=new Pr};yI.prototype.getLinework=function(){return this._linework};yI.prototype.filter=function(e){var t=this;if(e instanceof Rl){var r=e;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)t._linework.add(r.getInteriorRingN(i))}};yI.prototype.interfaces_=function(){return[Yp]};yI.prototype.getClass=function(){return yI};var gw=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};gw.prototype.extractPoints=function(e,t,r){for(var i=this,a=e.getCoordinates(),o=0;o<a.length-1;o++)i.computeOffsetPoints(a[o],a[o+1],t,r)};gw.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t};gw.prototype.getPoints=function(e){for(var t=this,r=new Pr,i=Pu.getLines(this._g),a=i.iterator();a.hasNext();){var o=a.next();t.extractPoints(o,e,r)}return r};gw.prototype.computeOffsetPoints=function(e,t,r,i){var a=t.x-e.x,o=t.y-e.y,s=Math.sqrt(a*a+o*o),l=r*a/s,u=r*o/s,h=(t.x+e.x)/2,c=(t.y+e.y)/2;if(this._doLeft){var f=new tt(h-u,c+l);i.add(f)}if(this._doRight){var d=new tt(h+u,c-l);i.add(d)}};gw.prototype.interfaces_=function(){return[]};gw.prototype.getClass=function(){return gw};var Hf=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new Pr;var e=arguments[0],t=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(e,t),this._geom=[e,t,r],this._locFinder=[new n_(this._geom[0],this._boundaryDistanceTolerance),new n_(this._geom[1],this._boundaryDistanceTolerance),new n_(this._geom[2],this._boundaryDistanceTolerance)]},ZJe={TOLERANCE:{configurable:!0}};Hf.prototype.reportResult=function(e,t,r){zu.out.println("Overlay result invalid - A:"+dt.toLocationSymbol(t[0])+" B:"+dt.toLocationSymbol(t[1])+" expected:"+(r?"i":"e")+" actual:"+dt.toLocationSymbol(t[2]))};Hf.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t};Hf.prototype.checkValid=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],r=0;r<this._testCoords.size();r++){var i=e._testCoords.get(r);if(!e.checkValid(t,i))return e._invalidLocation=i,!1}return!0}else if(arguments.length===2){var a=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Hf.hasLocation(this._location,dt.BOUNDARY)?!0:this.isValidResult(a,this._location)}};Hf.prototype.addTestPts=function(e){var t=new gw(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))};Hf.prototype.isValidResult=function(e,t){var r=pi.isResultOfOp(t[0],t[1],e),i=t[2]===dt.INTERIOR,a=!(r^i);return a||this.reportResult(e,t,r),a};Hf.prototype.getInvalidLocation=function(){return this._invalidLocation};Hf.prototype.interfaces_=function(){return[]};Hf.prototype.getClass=function(){return Hf};Hf.hasLocation=function(e,t){for(var r=0;r<3;r++)if(e[r]===t)return!0;return!1};Hf.computeBoundaryDistanceTolerance=function(e,t){return Math.min(tl.computeSizeBasedSnapTolerance(e),tl.computeSizeBasedSnapTolerance(t))};Hf.isValid=function(e,t,r,i){var a=new Hf(e,t,i);return a.isValid(r)};ZJe.TOLERANCE.get=function(){return 1e-6};Object.defineProperties(Hf,ZJe);var Cf=function n(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(e),this._inputGeoms=e};Cf.prototype.extractElements=function(e,t){var r=this;if(e===null)return null;for(var i=0;i<e.getNumGeometries();i++){var a=e.getGeometryN(i);r._skipEmpty&&a.isEmpty()||t.add(a)}};Cf.prototype.combine=function(){for(var e=this,t=new Pr,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();e.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)};Cf.prototype.interfaces_=function(){return[]};Cf.prototype.getClass=function(){return Cf};Cf.combine=function(){if(arguments.length===1){var e=arguments[0],t=new Cf(e);return t.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],a=new Cf(Cf.createList(r,i));return a.combine()}else if(arguments.length===3){var o=arguments[0],s=arguments[1],l=arguments[2],u=new Cf(Cf.createList(o,s,l));return u.combine()}};Cf.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()};Cf.createList=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new Pr;return r.add(e),r.add(t),r}else if(arguments.length===3){var i=arguments[0],a=arguments[1],o=arguments[2],s=new Pr;return s.add(i),s.add(a),s.add(o),s}};var dl=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,this._inputPolys===null&&(this._inputPolys=new Pr)},KJe={STRTREE_NODE_CAPACITY:{configurable:!0}};dl.prototype.reduceToGeometries=function(e){for(var t=this,r=new Pr,i=e.iterator();i.hasNext();){var a=i.next(),o=null;zn(a,wv)?o=t.unionTree(a):a instanceof Gn&&(o=a),r.add(o)}return r};dl.prototype.extractByEnvelope=function(e,t,r){for(var i=new Pr,a=0;a<t.getNumGeometries();a++){var o=t.getGeometryN(a);o.getEnvelopeInternal().intersects(e)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)};dl.prototype.unionOptimized=function(e,t){var r=e.getEnvelopeInternal(),i=t.getEnvelopeInternal();if(!r.intersects(i)){var a=Cf.combine(e,t);return a}if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(e,t,o)};dl.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var e=new kJe(dl.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var r=t.next();e.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=e.itemsTree(),a=this.unionTree(i);return a};dl.prototype.binaryUnion=function(){if(arguments.length===1){var e=arguments[0];return this.binaryUnion(e,0,e.size())}else if(arguments.length===3){var t=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var a=dl.getGeometry(t,r);return this.unionSafe(a,null)}else{if(i-r===2)return this.unionSafe(dl.getGeometry(t,r),dl.getGeometry(t,r+1));var o=Math.trunc((i+r)/2),s=this.binaryUnion(t,r,o),l=this.binaryUnion(t,o,i);return this.unionSafe(s,l)}}};dl.prototype.repeatedUnion=function(e){for(var t=null,r=e.iterator();r.hasNext();){var i=r.next();t===null?t=i.copy():t=t.union(i)}return t};dl.prototype.unionSafe=function(e,t){return e===null&&t===null?null:e===null?t.copy():t===null?e.copy():this.unionOptimized(e,t)};dl.prototype.unionActual=function(e,t){return dl.restrictToPolygons(e.union(t))};dl.prototype.unionTree=function(e){var t=this.reduceToGeometries(e),r=this.binaryUnion(t);return r};dl.prototype.unionUsingEnvelopeIntersection=function(e,t,r){var i=new Pr,a=this.extractByEnvelope(r,e,i),o=this.extractByEnvelope(r,t,i),s=this.unionActual(a,o);i.add(s);var l=Cf.combine(i);return l};dl.prototype.bufferUnion=function(){if(arguments.length===1){var e=arguments[0],t=e.get(0).getFactory(),r=t.buildGeometry(e),i=r.buffer(0);return i}else if(arguments.length===2){var a=arguments[0],o=arguments[1],s=a.getFactory(),l=s.createGeometryCollection([a,o]),u=l.buffer(0);return u}};dl.prototype.interfaces_=function(){return[]};dl.prototype.getClass=function(){return dl};dl.restrictToPolygons=function(e){if(zn(e,S_))return e;var t=im.getPolygons(e);return t.size()===1?t.get(0):e.getFactory().createMultiPolygon(Fi.toPolygonArray(t))};dl.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)};dl.union=function(e){var t=new dl(e);return t.union()};KJe.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(dl,KJe);var X7=function(){};X7.prototype.interfaces_=function(){return[]};X7.prototype.getClass=function(){return X7};X7.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return pi.createEmptyResult(pi.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Kh.overlayOp(e,t,pi.UNION)};function Rw(){return new Y7}function Y7(){this.reset()}Y7.prototype={constructor:Y7,reset:function(){this.s=this.t=0},add:function(n){PLe(V6,n,this.t),PLe(this,V6.s,this.s),this.s?this.t+=V6.t:this.s=V6.t},valueOf:function(){return this.s}};var V6=new Y7;function PLe(n,e,t){var r=n.s=e+t,i=r-e,a=r-i;n.t=e-a+(t-i)}var Us=1e-6,Oo=Math.PI,Yy=Oo/2,OLe=Oo/4,Tm=Oo*2,Ex=180/Oo,vp=Oo/180,$h=Math.abs,Zzr=Math.atan,mI=Math.atan2,Ml=Math.cos,Il=Math.sin,xL=Math.sqrt;function JJe(n){return n>1?0:n<-1?Oo:Math.acos(n)}function z2(n){return n>1?Yy:n<-1?-Yy:Math.asin(n)}function FO(){}function q7(n,e){n&&DLe.hasOwnProperty(n.type)&&DLe[n.type](n,e)}var RLe={Feature:function(n,e){q7(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r<i;)q7(t[r].geometry,e)}},DLe={Sphere:function(n,e){e.sphere()},Point:function(n,e){n=n.coordinates,e.point(n[0],n[1],n[2])},MultiPoint:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)n=t[r],e.point(n[0],n[1],n[2])},LineString:function(n,e){$re(n.coordinates,e,0)},MultiLineString:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)$re(t[r],e,0)},Polygon:function(n,e){NLe(n.coordinates,e)},MultiPolygon:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)NLe(t[r],e)},GeometryCollection:function(n,e){for(var t=n.geometries,r=-1,i=t.length;++r<i;)q7(t[r],e)}};function $re(n,e,t){var r=-1,i=n.length-t,a;for(e.lineStart();++r<i;)a=n[r],e.point(a[0],a[1],a[2]);e.lineEnd()}function NLe(n,e){var t=-1,r=n.length;for(e.polygonStart();++t<r;)$re(n[t],e,1);e.polygonEnd()}function Kzr(n,e){n&&RLe.hasOwnProperty(n.type)?RLe[n.type](n,e):q7(n,e)}Rw();Rw();function Wre(n){return[mI(n[1],n[0]),z2(n[2])]}function _I(n){var e=n[0],t=n[1],r=Ml(t);return[r*Ml(e),r*Il(e),Il(t)]}function $6(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Z7(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function MZ(n,e){n[0]+=e[0],n[1]+=e[1],n[2]+=e[2]}function W6(n,e){return[n[0]*e,n[1]*e,n[2]*e]}function Hre(n){var e=xL(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=e,n[1]/=e,n[2]/=e}Rw();function QJe(n,e){function t(r,i){return r=n(r,i),e(r[0],r[1])}return n.invert&&e.invert&&(t.invert=function(r,i){return r=e.invert(r,i),r&&n.invert(r[0],r[1])}),t}function jre(n,e){return[n>Oo?n-Tm:n<-Oo?n+Tm:n,e]}jre.invert=jre;function Jzr(n,e,t){return(n%=Tm)?e||t?QJe(FLe(n),BLe(e,t)):FLe(n):e||t?BLe(e,t):jre}function kLe(n){return function(e,t){return e+=n,[e>Oo?e-Tm:e<-Oo?e+Tm:e,t]}}function FLe(n){var e=kLe(n);return e.invert=kLe(-n),e}function BLe(n,e){var t=Ml(n),r=Il(n),i=Ml(e),a=Il(e);function o(s,l){var u=Ml(l),h=Ml(s)*u,c=Il(s)*u,f=Il(l),d=f*t+h*r;return[mI(c*i-d*a,h*t-f*r),z2(d*i+c*a)]}return o.invert=function(s,l){var u=Ml(l),h=Ml(s)*u,c=Il(s)*u,f=Il(l),d=f*i-c*a;return[mI(c*i+f*a,h*t+d*r),z2(d*t-h*r)]},o}function Qzr(n,e,t,r,i,a){if(!!t){var o=Ml(e),s=Il(e),l=r*t;i==null?(i=e+r*Tm,a=e-l/2):(i=GLe(o,i),a=GLe(o,a),(r>0?i<a:i>a)&&(i+=r*Tm));for(var u,h=i;r>0?h>a:h<a;h-=l)u=Wre([o,-s*Ml(h),-s*Il(h)]),n.point(u[0],u[1])}}function GLe(n,e){e=_I(e),e[0]-=n,Hre(e);var t=JJe(-e[1]);return((-e[2]<0?-t:t)+Tm-Us)%Tm}function eQe(){var n=[],e;return{point:function(t,r){e.push([t,r])},lineStart:function(){n.push(e=[])},lineEnd:FO,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function eUr(n,e,t,r,i,a){var o=n[0],s=n[1],l=e[0],u=e[1],h=0,c=1,f=l-o,d=u-s,v;if(v=t-o,!(!f&&v>0)){if(v/=f,f<0){if(v<h)return;v<c&&(c=v)}else if(f>0){if(v>c)return;v>h&&(h=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>c)return;v>h&&(h=v)}else if(f>0){if(v<h)return;v<c&&(c=v)}if(v=r-s,!(!d&&v>0)){if(v/=d,d<0){if(v<h)return;v<c&&(c=v)}else if(d>0){if(v>c)return;v>h&&(h=v)}if(v=a-s,!(!d&&v<0)){if(v/=d,d<0){if(v>c)return;v>h&&(h=v)}else if(d>0){if(v<h)return;v<c&&(c=v)}return h>0&&(n[0]=o+h*f,n[1]=s+h*d),c<1&&(e[0]=o+c*f,e[1]=s+c*d),!0}}}}}function M8(n,e){return $h(n[0]-e[0])<Us&&$h(n[1]-e[1])<Us}function H6(n,e,t,r){this.x=n,this.z=e,this.o=t,this.e=r,this.v=!1,this.n=this.p=null}function tQe(n,e,t,r,i){var a=[],o=[],s,l;if(n.forEach(function(v){if(!((p=v.length-1)<=0)){var p,g=v[0],m=v[p],y;if(M8(g,m)){for(i.lineStart(),s=0;s<p;++s)i.point((g=v[s])[0],g[1]);i.lineEnd();return}a.push(y=new H6(g,v,null,!0)),o.push(y.o=new H6(g,null,y,!1)),a.push(y=new H6(m,v,null,!1)),o.push(y.o=new H6(m,null,y,!0))}}),!!a.length){for(o.sort(e),zLe(a),zLe(o),s=0,l=o.length;s<l;++s)o[s].e=t=!t;for(var u=a[0],h,c;;){for(var f=u,d=!0;f.v;)if((f=f.n)===u)return;h=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(s=0,l=h.length;s<l;++s)i.point((c=h[s])[0],c[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(d)for(h=f.p.z,s=h.length-1;s>=0;--s)i.point((c=h[s])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,h=f.z,d=!d}while(!f.v);i.lineEnd()}}}function zLe(n){if(!!(e=n.length)){for(var e,t=0,r=n[0],i;++t<e;)r.n=i=n[t],i.p=r,r=i;r.n=i=n[0],i.p=r}}function rQe(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function tUr(n){return n.length===1&&(n=rUr(n)),{left:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var a=r+i>>>1;n(e[a],t)<0?r=a+1:i=a}return r},right:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var a=r+i>>>1;n(e[a],t)>0?i=a:r=a+1}return r}}}function rUr(n){return function(e,t){return rQe(n(e),t)}}tUr(rQe);function nQe(n){for(var e=n.length,t,r=-1,i=0,a,o;++r<e;)i+=n[r].length;for(a=new Array(i);--e>=0;)for(o=n[e],t=o.length;--t>=0;)a[--i]=o[t];return a}var BO=1e9,j6=-BO;function nUr(n,e,t,r){function i(u,h){return n<=u&&u<=t&&e<=h&&h<=r}function a(u,h,c,f){var d=0,v=0;if(u==null||(d=o(u,c))!==(v=o(h,c))||l(u,h)<0^c>0)do f.point(d===0||d===3?n:t,d>1?r:e);while((d=(d+c+4)%4)!==v);else f.point(h[0],h[1])}function o(u,h){return $h(u[0]-n)<Us?h>0?0:3:$h(u[0]-t)<Us?h>0?2:1:$h(u[1]-e)<Us?h>0?1:0:h>0?3:2}function s(u,h){return l(u.x,h.x)}function l(u,h){var c=o(u,1),f=o(h,1);return c!==f?c-f:c===0?h[1]-u[1]:c===1?u[0]-h[0]:c===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,c=eQe(),f,d,v,p,g,m,y,_,x,S,w,b={point:E,lineStart:M,lineEnd:I,polygonStart:C,polygonEnd:A};function E(k,D){i(k,D)&&h.point(k,D)}function T(){for(var k=0,D=0,G=d.length;D<G;++D)for(var W=d[D],z=1,V=W.length,q=W[0],Y,le,j=q[0],Q=q[1];z<V;++z)Y=j,le=Q,q=W[z],j=q[0],Q=q[1],le<=r?Q>r&&(j-Y)*(r-le)>(Q-le)*(n-Y)&&++k:Q<=r&&(j-Y)*(r-le)<(Q-le)*(n-Y)&&--k;return k}function C(){h=c,f=[],d=[],w=!0}function A(){var k=T(),D=w&&k,G=(f=nQe(f)).length;(D||G)&&(u.polygonStart(),D&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),G&&tQe(f,s,k,a,u),u.polygonEnd()),h=u,f=d=v=null}function M(){b.point=R,d&&d.push(v=[]),S=!0,x=!1,y=_=NaN}function I(){f&&(R(p,g),m&&x&&c.rejoin(),f.push(c.result())),b.point=E,x&&h.lineEnd()}function R(k,D){var G=i(k,D);if(d&&v.push([k,D]),S)p=k,g=D,m=G,S=!1,G&&(h.lineStart(),h.point(k,D));else if(G&&x)h.point(k,D);else{var W=[y=Math.max(j6,Math.min(BO,y)),_=Math.max(j6,Math.min(BO,_))],z=[k=Math.max(j6,Math.min(BO,k)),D=Math.max(j6,Math.min(BO,D))];eUr(W,z,n,e,t,r)?(x||(h.lineStart(),h.point(W[0],W[1])),h.point(z[0],z[1]),G||h.lineEnd(),w=!1):G&&(h.lineStart(),h.point(k,D),w=!1)}y=k,_=D,x=G}return b}}var IZ=Rw();function iUr(n,e){var t=e[0],r=e[1],i=[Il(t),-Ml(t),0],a=0,o=0;IZ.reset();for(var s=0,l=n.length;s<l;++s)if(!!(h=(u=n[s]).length))for(var u,h,c=u[h-1],f=c[0],d=c[1]/2+OLe,v=Il(d),p=Ml(d),g=0;g<h;++g,f=y,v=x,p=S,c=m){var m=u[g],y=m[0],_=m[1]/2+OLe,x=Il(_),S=Ml(_),w=y-f,b=w>=0?1:-1,E=b*w,T=E>Oo,C=v*x;if(IZ.add(mI(C*b*Il(E),p*S+C*Ml(E))),a+=T?w+b*Tm:w,T^f>=t^y>=t){var A=Z7(_I(c),_I(m));Hre(A);var M=Z7(i,A);Hre(M);var I=(T^w>=0?-1:1)*z2(M[2]);(r>I||r===I&&(A[0]||A[1]))&&(o+=T^w>=0?1:-1)}}return(a<-Us||a<Us&&IZ<-Us)^o&1}Rw();function ULe(n){return n}Rw();Rw();var xI=1/0,K7=xI,HN=-xI,J7=HN,VLe={point:aUr,lineStart:FO,lineEnd:FO,polygonStart:FO,polygonEnd:FO,result:function(){var n=[[xI,K7],[HN,J7]];return HN=J7=-(K7=xI=1/0),n}};function aUr(n,e){n<xI&&(xI=n),n>HN&&(HN=n),e<K7&&(K7=e),e>J7&&(J7=e)}Rw();function iQe(n,e,t,r){return function(i,a){var o=e(a),s=i.invert(r[0],r[1]),l=eQe(),u=e(l),h=!1,c,f,d,v={point:p,lineStart:m,lineEnd:y,polygonStart:function(){v.point=_,v.lineStart=x,v.lineEnd=S,f=[],c=[]},polygonEnd:function(){v.point=p,v.lineStart=m,v.lineEnd=y,f=nQe(f);var w=iUr(c,s);f.length?(h||(a.polygonStart(),h=!0),tQe(f,sUr,w,t,a)):w&&(h||(a.polygonStart(),h=!0),a.lineStart(),t(null,null,1,a),a.lineEnd()),h&&(a.polygonEnd(),h=!1),f=c=null},sphere:function(){a.polygonStart(),a.lineStart(),t(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function p(w,b){var E=i(w,b);n(w=E[0],b=E[1])&&a.point(w,b)}function g(w,b){var E=i(w,b);o.point(E[0],E[1])}function m(){v.point=g,o.lineStart()}function y(){v.point=p,o.lineEnd()}function _(w,b){d.push([w,b]);var E=i(w,b);u.point(E[0],E[1])}function x(){u.lineStart(),d=[]}function S(){_(d[0][0],d[0][1]),u.lineEnd();var w=u.clean(),b=l.result(),E,T=b.length,C,A,M;if(d.pop(),c.push(d),d=null,!!T){if(w&1){if(A=b[0],(C=A.length-1)>0){for(h||(a.polygonStart(),h=!0),a.lineStart(),E=0;E<C;++E)a.point((M=A[E])[0],M[1]);a.lineEnd()}return}T>1&&w&2&&b.push(b.pop().concat(b.shift())),f.push(b.filter(oUr))}}return v}}function oUr(n){return n.length>1}function sUr(n,e){return((n=n.x)[0]<0?n[1]-Yy-Us:Yy-n[1])-((e=e.x)[0]<0?e[1]-Yy-Us:Yy-e[1])}const $Le=iQe(function(){return!0},lUr,hUr,[-Oo,-Yy]);function lUr(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(a,o){var s=a>0?Oo:-Oo,l=$h(a-e);$h(l-Oo)<Us?(n.point(e,t=(t+o)/2>0?Yy:-Yy),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(s,t),n.point(a,t),i=0):r!==s&&l>=Oo&&($h(e-r)<Us&&(e-=r*Us),$h(a-s)<Us&&(a-=s*Us),t=uUr(e,t,a,o),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(s,t),i=0),n.point(e=a,t=o),r=s},lineEnd:function(){n.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function uUr(n,e,t,r){var i,a,o=Il(n-t);return $h(o)>Us?Zzr((Il(e)*(a=Ml(r))*Il(t)-Il(r)*(i=Ml(e))*Il(n))/(i*a*o)):(e+r)/2}function hUr(n,e,t,r){var i;if(n==null)i=t*Yy,r.point(-Oo,i),r.point(0,i),r.point(Oo,i),r.point(Oo,0),r.point(Oo,-i),r.point(0,-i),r.point(-Oo,-i),r.point(-Oo,0),r.point(-Oo,i);else if($h(n[0]-e[0])>Us){var a=n[0]<e[0]?Oo:-Oo;i=t*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])}function cUr(n,e){var t=Ml(n),r=t>0,i=$h(t)>Us;function a(h,c,f,d){Qzr(d,n,e,f,h,c)}function o(h,c){return Ml(h)*Ml(c)>t}function s(h){var c,f,d,v,p;return{lineStart:function(){v=d=!1,p=1},point:function(g,m){var y=[g,m],_,x=o(g,m),S=r?x?0:u(g,m):x?u(g+(g<0?Oo:-Oo),m):0;if(!c&&(v=d=x)&&h.lineStart(),x!==d&&(_=l(c,y),(!_||M8(c,_)||M8(y,_))&&(y[0]+=Us,y[1]+=Us,x=o(y[0],y[1]))),x!==d)p=0,x?(h.lineStart(),_=l(y,c),h.point(_[0],_[1])):(_=l(c,y),h.point(_[0],_[1]),h.lineEnd()),c=_;else if(i&&c&&r^x){var w;!(S&f)&&(w=l(y,c,!0))&&(p=0,r?(h.lineStart(),h.point(w[0][0],w[0][1]),h.point(w[1][0],w[1][1]),h.lineEnd()):(h.point(w[1][0],w[1][1]),h.lineEnd(),h.lineStart(),h.point(w[0][0],w[0][1])))}x&&(!c||!M8(c,y))&&h.point(y[0],y[1]),c=y,d=x,f=S},lineEnd:function(){d&&h.lineEnd(),c=null},clean:function(){return p|(v&&d)<<1}}}function l(h,c,f){var d=_I(h),v=_I(c),p=[1,0,0],g=Z7(d,v),m=$6(g,g),y=g[0],_=m-y*y;if(!_)return!f&&h;var x=t*m/_,S=-t*y/_,w=Z7(p,g),b=W6(p,x),E=W6(g,S);MZ(b,E);var T=w,C=$6(b,T),A=$6(T,T),M=C*C-A*($6(b,b)-1);if(!(M<0)){var I=xL(M),R=W6(T,(-C-I)/A);if(MZ(R,b),R=Wre(R),!f)return R;var k=h[0],D=c[0],G=h[1],W=c[1],z;D<k&&(z=k,k=D,D=z);var V=D-k,q=$h(V-Oo)<Us,Y=q||V<Us;if(!q&&W<G&&(z=G,G=W,W=z),Y?q?G+W>0^R[1]<($h(R[0]-k)<Us?G:W):G<=R[1]&&R[1]<=W:V>Oo^(k<=R[0]&&R[0]<=D)){var le=W6(T,(-C+I)/A);return MZ(le,b),[R,Wre(le)]}}}function u(h,c){var f=r?n:Oo-n,d=0;return h<-f?d|=1:h>f&&(d|=2),c<-f?d|=4:c>f&&(d|=8),d}return iQe(o,s,a,r?[0,-n]:[-Oo,n-Oo])}function aQe(n){return function(e){var t=new Xre;for(var r in n)t[r]=n[r];return t.stream=e,t}}function Xre(){}Xre.prototype={constructor:Xre,point:function(n,e){this.stream.point(n,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function oQe(n,e,t){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),a!=null&&n.clipExtent(null),Kzr(t,n.stream(VLe));var o=VLe.result(),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+e[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a!=null&&n.clipExtent(a),n.scale(s*150).translate([l,u])}function fUr(n,e,t){return oQe(n,[[0,0],e],t)}var WLe=16,dUr=Ml(30*vp);function HLe(n,e){return+e?pUr(n,e):vUr(n)}function vUr(n){return aQe({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function pUr(n,e){function t(r,i,a,o,s,l,u,h,c,f,d,v,p,g){var m=u-r,y=h-i,_=m*m+y*y;if(_>4*e&&p--){var x=o+f,S=s+d,w=l+v,b=xL(x*x+S*S+w*w),E=z2(w/=b),T=$h($h(w)-1)<Us||$h(a-c)<Us?(a+c)/2:mI(S,x),C=n(T,E),A=C[0],M=C[1],I=A-r,R=M-i,k=y*I-m*R;(k*k/_>e||$h((m*I+y*R)/_-.5)>.3||o*f+s*d+l*v<dUr)&&(t(r,i,a,o,s,l,A,M,T,x/=b,S/=b,w,p,g),g.point(A,M),t(A,M,T,x,S,w,u,h,c,f,d,v,p,g))}}return function(r){var i,a,o,s,l,u,h,c,f,d,v,p,g={point:m,lineStart:y,lineEnd:x,polygonStart:function(){r.polygonStart(),g.lineStart=S},polygonEnd:function(){r.polygonEnd(),g.lineStart=y}};function m(E,T){E=n(E,T),r.point(E[0],E[1])}function y(){c=NaN,g.point=_,r.lineStart()}function _(E,T){var C=_I([E,T]),A=n(E,T);t(c,f,h,d,v,p,c=A[0],f=A[1],h=E,d=C[0],v=C[1],p=C[2],WLe,r),r.point(c,f)}function x(){g.point=m,r.lineEnd()}function S(){y(),g.point=w,g.lineEnd=b}function w(E,T){_(i=E,T),a=c,o=f,s=d,l=v,u=p,g.point=_}function b(){t(c,f,h,d,v,p,a,o,i,s,l,u,WLe,r),g.lineEnd=x,x()}return g}}var gUr=aQe({point:function(n,e){this.stream.point(n*vp,e*vp)}});function yUr(n){return mUr(function(){return n})()}function mUr(n){var e,t=150,r=480,i=250,a,o,s=0,l=0,u=0,h=0,c=0,f,d,v=null,p=$Le,g=null,m,y,_,x=ULe,S=.5,w=HLe(A,S),b,E;function T(R){return R=d(R[0]*vp,R[1]*vp),[R[0]*t+a,o-R[1]*t]}function C(R){return R=d.invert((R[0]-a)/t,(o-R[1])/t),R&&[R[0]*Ex,R[1]*Ex]}function A(R,k){return R=e(R,k),[R[0]*t+a,o-R[1]*t]}T.stream=function(R){return b&&E===R?b:b=gUr(p(f,w(x(E=R))))},T.clipAngle=function(R){return arguments.length?(p=+R?cUr(v=R*vp,6*vp):(v=null,$Le),I()):v*Ex},T.clipExtent=function(R){return arguments.length?(x=R==null?(g=m=y=_=null,ULe):nUr(g=+R[0][0],m=+R[0][1],y=+R[1][0],_=+R[1][1]),I()):g==null?null:[[g,m],[y,_]]},T.scale=function(R){return arguments.length?(t=+R,M()):t},T.translate=function(R){return arguments.length?(r=+R[0],i=+R[1],M()):[r,i]},T.center=function(R){return arguments.length?(s=R[0]%360*vp,l=R[1]%360*vp,M()):[s*Ex,l*Ex]},T.rotate=function(R){return arguments.length?(u=R[0]%360*vp,h=R[1]%360*vp,c=R.length>2?R[2]%360*vp:0,M()):[u*Ex,h*Ex,c*Ex]},T.precision=function(R){return arguments.length?(w=HLe(A,S=R*R),I()):xL(S)},T.fitExtent=function(R,k){return oQe(T,R,k)},T.fitSize=function(R,k){return fUr(T,R,k)};function M(){d=QJe(f=Jzr(u,h,c),e);var R=e(s,l);return a=r-R[0]*t,o=i+R[1]*t,I()}function I(){return b=E=null,T}return function(){return e=n.apply(this,arguments),T.invert=e.invert&&C,M()}}function sQe(n){return function(e,t){var r=Ml(e),i=Ml(t),a=n(r*i);return[a*i*Il(e),a*Il(t)]}}function lQe(n){return function(e,t){var r=xL(e*e+t*t),i=n(r),a=Il(i),o=Ml(i);return[mI(e*a,r*o),z2(r&&t*a/r)]}}var _Ur=sQe(function(n){return xL(2/(1+n))});_Ur.invert=lQe(function(n){return 2*z2(n/2)});var uQe=sQe(function(n){return(n=JJe(n))&&n/Il(n)});uQe.invert=lQe(function(n){return n});function xUr(){return yUr(uQe).scale(79.4188).clipAngle(180-.001)}function jLe(n,e){return[n,e]}jLe.invert=jLe;function SUr(n,e,t){t=t||{};var r=t.units||"kilometers",i=t.steps||8;if(!n)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var a=[];switch(n.type){case"GeometryCollection":return Pd(n,function(o){var s=I8(o,e,r,i);s&&a.push(s)}),Zn(a);case"FeatureCollection":return uo(n,function(o){var s=I8(o,e,r,i);s&&uo(s,function(l){l&&a.push(l)})}),Zn(a)}return I8(n,e,r,i)}function I8(n,e,t,r){var i=n.properties||{},a=n.type==="Feature"?n.geometry:n;if(a.type==="GeometryCollection"){var o=[];return Pd(n,function(p){var g=I8(p,e,t,r);g&&o.push(g)}),Zn(o)}var s=wUr(a),l={type:a.type,coordinates:cQe(a.coordinates,s)},u=new Ace,h=u.read(l),c=ZM(S2(e,t),"meters"),f=Ou.bufferOp(h,c,r),d=new DJe;if(f=d.write(f),!hQe(f.coordinates)){var v={type:f.type,coordinates:fQe(f.coordinates,s)};return fu(v,i)}}function hQe(n){return Array.isArray(n[0])?hQe(n[0]):isNaN(n[0])}function cQe(n,e){return typeof n[0]!="object"?e(n):n.map(function(t){return cQe(t,e)})}function fQe(n,e){return typeof n[0]!="object"?e.invert(n):n.map(function(t){return fQe(t,e)})}function wUr(n){var e=m$(n).geometry.coordinates,t=[-e[0],-e[1]];return xUr().rotate(t).scale(Au)}function bUr(n,e,t){t===void 0&&(t={});var r=ls(n),i=ls(e),a=t_.union(r.coordinates,i.coordinates);return a.length===0?null:a.length===1?Qi(a[0],t.properties):Ld(a,t.properties)}function jN(n,e,t){t===void 0&&(t={});var r=ls(n),i=ls(e),a=t_.intersection(r.coordinates,i.coordinates);return a.length===0?null:a.length===1?Qi(a[0],t.properties):Ld(a,t.properties)}function EUr(n,e){if(e=e||{},!Io(e))throw new Error("options is invalid");var t=e.propertyName;Y_(n,"Polygon","dissolve");var r=[];if(e.propertyName){var i={};uo(n,function(l){Object.prototype.hasOwnProperty.call(i,l.properties[t])||(i[l.properties[t]]=[]),i[l.properties[t]].push(l)});for(var a=Object.keys(i),o=0;o<a.length;o++){var s=Ld(t_.union.apply(null,i[a[o]].map(function(l){return l.geometry.coordinates})));s.properties[t]=a[o],r.push(s)}}else return Ire(Ld(t_.union.apply(null,n.features.map(function(l){return l.geometry.coordinates}))));return Ire(Zn(r))}function dQe(n,e,t){t===void 0&&(t={});var r=JSON.stringify(t.properties||{}),i=n[0],a=n[1],o=n[2],s=n[3],l=(a+s)/2,u=(i+o)/2,h=e*2/Mo([i,l],[o,l],t),c=h*(o-i),f=e*2/Mo([u,a],[u,s],t),d=f*(s-a),v=c/2,p=v*2,g=Math.sqrt(3)/2*d,m=o-i,y=s-a,_=3/4*p,x=g,S=(m-p)/(p-v/2),w=Math.floor(S),b=(w*_-v/2-m)/2-v/2+_/2,E=Math.floor((y-g)/g),T=(y-E*g)/2,C=E*g-y>g/2;C&&(T-=g/4);for(var A=[],M=[],I=0;I<6;I++){var R=2*Math.PI/6*I;A.push(Math.cos(R)),M.push(Math.sin(R))}for(var k=[],D=0;D<=w;D++)for(var G=0;G<=E;G++){var W=D%2===1;if(!(G===0&&W)&&!(G===0&&C)){var z=D*_+i-b,V=G*x+a+T;if(W&&(V-=g/2),t.triangles===!0)CUr([z,V],c/2,d/2,JSON.parse(r),A,M).forEach(function(Y){t.mask?jN(t.mask,Y)&&k.push(Y):k.push(Y)});else{var q=TUr([z,V],c/2,d/2,JSON.parse(r),A,M);t.mask?jN(t.mask,q)&&k.push(q):k.push(q)}}}return Zn(k)}function TUr(n,e,t,r,i,a){for(var o=[],s=0;s<6;s++){var l=n[0]+e*i[s],u=n[1]+t*a[s];o.push([l,u])}return o.push(o[0].slice()),Qi([o],r)}function CUr(n,e,t,r,i,a){for(var o=[],s=0;s<6;s++){var l=[];l.push(n),l.push([n[0]+e*i[s],n[1]+t*a[s]]),l.push([n[0]+e*i[(s+1)%6],n[1]+t*a[(s+1)%6]]),l.push(n),o.push(Qi([l],r))}return o}function AUr(n,e){var t=IUr(e),r=null;return n.type==="FeatureCollection"?r=MUr(n):r=vQe(t_.union(n.geometry.coordinates)),r.geometry.coordinates.forEach(function(i){t.geometry.coordinates.push(i[0])}),t}function MUr(n){var e=n.features.length===2?t_.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):t_.union.apply(t_,n.features.map(function(t){return t.geometry.coordinates}));return vQe(e)}function vQe(n){return Ld(n)}function IUr(n){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],t=n&&n.geometry.coordinates||e;return Qi(t)}function LUr(n,e,t,r){r===void 0&&(r={});for(var i=[],a=n[0],o=n[1],s=n[2],l=n[3],u=e/Mo([a,o],[s,o],r),h=u*(s-a),c=t/Mo([a,o],[a,l],r),f=c*(l-o),d=s-a,v=l-o,p=Math.floor(d/h),g=Math.floor(v/f),m=(d-p*h)/2,y=(v-g*f)/2,_=a+m,x=0;x<p;x++){for(var S=o+y,w=0;w<g;w++){var b=Qi([[[_,S],[_,S+f],[_+h,S+f],[_+h,S],[_,S]]],r.properties);r.mask?QKe(r.mask,b)&&i.push(b):i.push(b),S+=f}_+=h}return Zn(i)}function pQe(n,e,t){return t===void 0&&(t={}),LUr(n,e,e,t)}function gQe(n,e,t){t===void 0&&(t={});for(var r=[],i=e/Mo([n[0],n[1]],[n[2],n[1]],t),a=i*(n[2]-n[0]),o=e/Mo([n[0],n[1]],[n[0],n[3]],t),s=o*(n[3]-n[1]),l=0,u=n[0];u<=n[2];){for(var h=0,c=n[1];c<=n[3];){var f=null,d=null;l%2===0&&h%2===0?(f=Qi([[[u,c],[u,c+s],[u+a,c],[u,c]]],t.properties),d=Qi([[[u,c+s],[u+a,c+s],[u+a,c],[u,c+s]]],t.properties)):l%2===0&&h%2===1?(f=Qi([[[u,c],[u+a,c+s],[u+a,c],[u,c]]],t.properties),d=Qi([[[u,c],[u,c+s],[u+a,c+s],[u,c]]],t.properties)):h%2===0&&l%2===1?(f=Qi([[[u,c],[u,c+s],[u+a,c+s],[u,c]]],t.properties),d=Qi([[[u,c],[u+a,c+s],[u+a,c],[u,c]]],t.properties)):h%2===1&&l%2===1&&(f=Qi([[[u,c],[u,c+s],[u+a,c],[u,c]]],t.properties),d=Qi([[[u,c+s],[u+a,c+s],[u+a,c],[u,c+s]]],t.properties)),t.mask?(jN(t.mask,f)&&r.push(f),jN(t.mask,d)&&r.push(d)):(r.push(f),r.push(d)),c+=s,h++}l++,u+=a}return Zn(r)}function PUr(n,e,t){if(t=t||{},typeof t!="object")throw new Error("options is invalid");var r=t.gridType,i=t.property,a=t.weight;if(!n)throw new Error("points is required");if(Y_(n,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(a!==void 0&&typeof a!="number")throw new Error("weight must be a number");i=i||"elevation",r=r||"square",a=a||1;var o=yl(n),s;switch(r){case"point":case"points":s=aKe(o,e,t);break;case"square":case"squares":s=pQe(o,e,t);break;case"hex":case"hexes":s=dQe(o,e,t);break;case"triangle":case"triangles":s=gQe(o,e,t);break;default:throw new Error("invalid gridType")}var l=[];return uo(s,function(u){var h=0,c=0;uo(n,function(d){var v=r==="point"?u:ow(u),p=Mo(v,d,t),g;if(i!==void 0&&(g=d.properties[i]),g===void 0&&(g=d.geometry.coordinates[2]),g===void 0)throw new Error("zValue is missing");p===0&&(h=g);var m=1/Math.pow(p,a);c+=m,h+=m*g});var f=Xh(u);f.properties[i]=h/c,l.push(f)}),Zn(l)}const XLe=Object.freeze(Object.defineProperty({__proto__:null,projection:K7r,random:rzr,clusters:nzr,helpers:bZe,invariant:JFr,meta:MZe,isolines:h4r,convex:NZe,pointsWithinPolygon:Sre,within:Sre,concave:o5r,collect:f5r,flip:d5r,simplify:m5r,bezier:NMe,bezierSpline:NMe,tag:T5r,sample:C5r,envelope:WZe,square:HZe,circle:Hhe,midpoint:I5r,center:m$,centerOfMass:jZe,centroid:ow,combine:L5r,distance:Mo,explode:_$,bbox:yl,tesselate:j5r,bboxPolygon:Whe,booleanPointInPolygon:ss,inside:ss,nearest:D7,nearestPoint:D7,nearestPointOnLine:G1,pointOnLine:G1,nearestPointToLine:n6r,planepoint:a6r,tin:kZe,bearing:x_,destination:_m,kinks:o6r,pointOnFeature:UMe,pointOnSurface:UMe,area:Xhe,along:h6r,length:Mre,lineDistance:Mre,lineSlice:c6r,lineSliceAlong:tKe,pointGrid:aKe,truncate:oKe,flatten:Ire,lineIntersect:q_,lineChunk:w6r,unkinkPolygon:I6r,greatCircle:L6r,lineSegment:C2,lineSplit:P6r,lineArc:uKe,polygonToLine:CN,polygonToLineString:CN,lineStringToPolygon:JMe,lineToPolygon:JMe,bboxClip:k6r,lineOverlap:WKe,sector:cGr,rhumbBearing:A2,rhumbDistance:w$,rhumbDestination:QM,polygonTangents:dGr,rewind:gGr,isobands:a9r,transformRotate:HKe,transformScale:jKe,transformTranslate:d9r,lineOffset:x9r,polygonize:O9r,booleanDisjoint:YKe,booleanContains:B9r,booleanCrosses:X9r,booleanClockwise:F7,booleanOverlap:J9r,booleanPointOnLine:yd,booleanEqual:Q9r,booleanWithin:rKe,booleanIntersects:QKe,clone:Xh,cleanCoords:E2,clustersDbscan:i7r,clustersKmeans:v7r,pointToLineDistance:eKe,booleanParallel:p7r,shortestPath:m7r,voronoi:z7r,ellipse:hJe,centerMean:pce,centerMedian:U7r,standardDeviationalEllipse:V7r,angle:$7r,polygonSmooth:W7r,moranIndex:Y7r,distanceWeight:fJe,bearingToAngle:w2,convertDistance:b2,degrees2radians:ku,distanceToDegrees:R7,distanceToRadians:S2,radians2degrees:aw,radiansToDistance:ZM,difference:Ozr,buffer:SUr,union:bUr,intersect:jN,dissolve:EUr,hexGrid:dQe,mask:AUr,squareGrid:pQe,triangleGrid:gQe,interpolate:PUr,toMercator:vJe,toWgs84:pJe,randomPosition:qk,randomPoint:yJe,randomPolygon:mJe,randomLineString:_Je,getCluster:SJe,clusterEach:gce,clusterReduce:wJe,createBins:yce,applyFilter:M$,propertiesContainsFilter:mce,filterProperties:bJe,earthRadius:Au,factors:p$,unitsFactors:vZe,areaFactors:O7,feature:fu,geometry:pZe,point:Vi,points:gZe,polygon:Qi,polygons:yZe,lineString:yo,lineStrings:mZe,featureCollection:Zn,multiLineString:Pw,multiPoint:$k,multiPolygon:Ld,geometryCollection:Lhe,round:_Ze,radiansToLength:ZM,lengthToRadians:S2,lengthToDegrees:R7,bearingToAzimuth:w2,radiansToDegrees:aw,degreesToRadians:ku,convertLength:b2,convertArea:xZe,isNumber:Gu,isObject:Io,validateBBox:SZe,validateId:wZe,getCoord:Wo,getCoords:ri,containsNumber:Bhe,geojsonType:IZe,featureOf:xN,collectionOf:Y_,getGeom:ls,getType:zf,coordAll:KM,coordEach:gl,coordReduce:Phe,featureEach:uo,featureReduce:Rhe,findPoint:AZe,findSegment:CZe,flattenEach:fh,flattenReduce:TZe,geomEach:Pd,geomReduce:Dhe,lineEach:khe,lineReduce:Fhe,propEach:Ohe,propReduce:EZe,segmentEach:B1,segmentReduce:Nhe},Symbol.toStringTag,{value:"Module"}));class OUr extends _f{constructor(e){var t=e||{};super({attributions:t.attributions||"<span>\xA9 turfjs</span> with <span>\xA9 SuperMap iClient</span>",features:t.features,format:t.format,extent:t.extent,logo:br.getOlVersion()==="4"?t.logo:null,projection:t.projection,wrapX:t.wrapX}),this.turfMap={"Measurement.along":["line","distance","units"],"Measurement.area":["geojson"],"Measurement.bbox":["geojson"],"Measurement.bboxPolygon":["bbox"],"Measurement.bearing":["start","end","final"],"Measurement.center":["geojson","properties"],"Measurement.centerOfMass":["geojson","properties"],"Measurement.centroid":["geojson","properties"],"Measurement.destination":["origin","distance","bearing","units"],"Measurement.distance":["from","to","units"],"Measurement.envelope":["geojson"],"Measurement.length":["geojson","units"],"Measurement.midpoint":["point1","point2"],"Measurement.pointOnFeature":["geojson"],"Measurement.polygonTangents":["point","polygon"],"Measurement.rhumbBearing":["start","end","final"],"Measurement.rhumbDestination":["origin","distance","bearing","units"],"Measurement.rhumbDistance":["from","to","units"],"Measurement.square":["bbox"],"Measurement.greatCircle":["start","end","properties","npoints","offset"],"CoordinateMutation.cleanCoords":["geojson","mutate"],"CoordinateMutation.flip":["geojson","mutate"],"CoordinateMutation.rewind":["geojson","reverse","mutate"],"CoordinateMutation.round":["num","precision"],"CoordinateMutation.truncate":["geojson","precision","coordinates","mutate"],"Transformation.bboxClip":["feature","bbox"],"Transformation.bezierSpline":["line","resolution","sharpness"],"Transformation.buffer":["geojson","radius","units","steps"],"Transformation.circle":["center","radius","steps","units","properties"],"Transformation.clone":["geojson"],"Transformation.concave":["points","maxEdge","units"],"Transformation.convex":["geojson","concavity"],"Transformation.difference":["polygon1","polygon2"],"Transformation.dissolve":["featureCollection","propertyName"],"Transformation.intersect":["poly1","poly2"],"Transformation.lineOffset":["geojson","distance","units"],"Transformation.simplify":["feature","tolerance","highQuality"],"Transformation.tesselate":["poly"],"Transformation.transformRotate":["geojson","angle","pivot","mutate"],"Transformation.transformTranslate":["geojson","distance","direction","units","zTranslation","mutate"],"Transformation.transformScale":["geojson","factor","origin","mutate"],"Transformation.union":["A"],"Transformation.voronoi":["points","bbox"],"featureConversion.combine":["fc"],"featureConversion.explode":["geojson"],"featureConversion.flatten":["geojson"],"featureConversion.lineStringToPolygon":["lines","properties","autoComplete","orderCoords"],"featureConversion.polygonize":["geojson"],"featureConversion.polygonToLineString":["polygon","properties"],"Misc.kinks":["featureIn"],"Misc.lineArc":["center","radius","bearing1","bearing2","steps","units"],"Misc.lineChunk":["geojson","segmentLength","units","reverse"],"Misc.lineIntersect":["line1","line2"],"Misc.lineOverlap":["line1","line2"],"Misc.lineSegment":["geojson"],"Misc.lineSlice":["startPt","stopPt","line"],"Misc.lineSliceAlong":["line","startDist","stopDist","units"],"Misc.lineSplit":["line","splitter"],"Misc.mask":["polygon","mask"],"Misc.pointOnLine":["lines","pt","units"],"Misc.sector":["center","radius","bearing1","bearing2","steps","units"],"Misc.shortestPath":["start","end","obstacles","units","resolution"],"Misc.unkinkPolygon":["geojson"],"Helper.featureCollection":["features","bbox","id"],"Helper.feature":["geometry","properties","bbox","id"],"Helper.geometryCollection":["geometries","properties","bbox","id"],"Helper.lineString":["coordinates","properties","bbox","id"],"Helper.multiLineString":["coordinates","properties","bbox","id"],"Helper.multiPoint":["coordinates","properties","bbox","id"],"Helper.multiPolygon":["coordinates","properties","bbox","id"],"Helper.point":["coordinates","properties","bbox","id"],"Helper.polygon":["coordinates","properties","bbox","id"],"Data.sample":["featurecollection","num"],"Interpolation.interpolate":["points","cellSize","gridType","property","units","weight"],"Interpolation.isobands":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.isolines":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.planepoint":["point","triangle"],"Interpolation.tin":["points","z"],"Joins.pointsWithinPolygon":["points","polygons"],"Joins.tag":["points","polygons","field","outField","mask","properties"],"Grids.hexGrid":["bbox","cellSide","units","triangles"],"Grids.pointGrid":["bbox","cellSide","units","mask","properties"],"Grids.squareGrid":["bbox","cellSide","units","mask","properties"],"Grids.triangleGrid":["bbox","cellSide","units","mask","properties"],"Classification.nearestPoint":["targetPoint","points"],"Aggregation.collect":["polygons","points","inProperty","outProperty"],"Aggregation.clustersDbscan":["points","maxDistance","units","minPoints","mutate"],"Aggregation.clustersKmeans":["points","numberOfClusters","mutate"],"Meta.coordAll":["geojson"],"Meta.coordEach":["geojson","callback","excludeWrapCoord"],"Meta.coordReduce":["geojson","callback","initialValue","excludeWrapCoord"],"Meta.featureEach":["geojson","callback"],"Meta.featureReduce":["geojson","callback","initialValue"],"Meta.flattenEach":["geojson","callback"],"Meta.flattenReduce":["geojson","callback","initialValue"],"Meta.getCoord":["coord"],"Meta.getCoords":["coords"],"Meta.getGeom":["geojson"],"Meta.getGeomType":["geojson","name"],"Meta.geomEach":["geojson","callback"],"Meta.geomReduce":["geojson","callback","initialValue"],"Meta.propEach":["geojson","callback"],"Meta.propReduce":["geojson","callback","initialValue"],"Meta.segmentEach":["geojson","callback"],"Meta.segmentReduce":["geojson","callback","initialValue"],"Meta.getCluster":["geojson","filter"],"Meta.clusterEach":["geojson","property","callback"],"Meta.clusterReduce":["geojson","property","callback","initialValue"],"Assertions.collectionOf":["featureCollection","type","name"],"Assertions.containsNumber":["coordinates"],"Assertions.geojsonType":["value","type","name"],"Assertions.featureOf":["feature","type","name"],"Booleans.booleanClockwise":["line"],"Booleans.booleanContains":["feature1","feature2"],"Booleans.booleanCrosses":["feature1","feature2"],"Booleans.booleanDisjoint":["feature1","feature2"],"Booleans.booleanEqual":["feature1","feature2"],"Booleans.booleanOverlap":["feature1","feature2"],"Booleans.booleanParallel":["feature1","feature2"],"Booleans.booleanPointInPolygon":["point","polygon","ignoreBoundary"],"Booleans.booleanPointOnLine":["point","linestring","ignoreEndVertices"],"UnitConversion.bearingToAngle":["bearing"],"UnitConversion.convertArea":["area","originalUnit","finalUnit"],"UnitConversion.convertLength":["length","originalUnit","finalUnit"],"UnitConversion.degreesToradians":["degrees"],"UnitConversion.lengthToRadians":["distance","units"],"UnitConversion.lengthToDegrees":["distance","units"],"UnitConversion.radiansToLength":["radians","units"],"UnitConversion.radiansToDegrees":["radians"],"UnitConversion.toMercator":["geojson","mutate"],"UnitConversion.toWgs84":["geojson","mutate"]},this.turfOptionMap={"Measurement.along":["line","distance",{units:""}],"Measurement.bboxPolygon":["bbox",{properties:"",id:""}],"Measurement.bearing":["start","end",{final:""}],"Measurement.center":["geojson",{properties:""}],"Measurement.destination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.distance":["from","to",{units:""}],"Measurement.length":["geojson",{units:""}],"Measurement.rhumbBearing":["start","end",{final:""}],"Measurement.rhumbDestination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.rhumbDistance":["from","to",{units:""}],"Measurement.greatCircle":["start","end",{properties:"",npoints:"",offset:""}],"CoordinateMutation.cleanCoords":["geojson",{mutate:""}],"CoordinateMutation.flip":["geojson",{mutate:""}],"CoordinateMutation.rewind":["geojson",{mutate:"",reverse:""}],"CoordinateMutation.truncate":["geojson",{precision:"",coordinates:"",mutate:""}],"Transformation.bezierSpline":["line",{resolution:"",sharpness:""}],"Transformation.buffer":["geojson","radius",{units:"",steps:""}],"Transformation.circle":["center","radius",{units:"",steps:"",properties:""}],"Transformation.concave":["points",{maxEdge:"",units:""}],"Transformation.convex":["geojson",{concavity:""}],"Transformation.dissolve":["featureCollection",{propertyName:""}],"Transformation.lineOffset":["geojson","distance",{units:""}],"Transformation.simplify":["geojson",{tolerance:"",highQuality:""}],"Transformation.transformRotate":["geojson","angle",{pivot:"",mutate:""}],"Transformation.transformTranslate":["geojson","distance","direction",{units:"",zTranslation:"",mutate:""}],"Transformation.transformScale":["geojson","factor",{origin:"",mutate:""}],"Transformation.voronoi":["points",{bbox:""}],"featureConversion.lineStringToPolygon":["lines",{properties:"",autoComplete:"",orderCoords:""}],"featureConversion.polygonToLineString":["polygon",{properties:""}],"Misc.lineArc":["center","radius","bearing1","bearing2",{steps:"",units:""}],"Misc.lineChunk":["geojson","segmentLength",{units:"",reverse:""}],"Misc.lineOverlap":["line1","line2",{tolerance:""}],"Misc.lineSliceAlong":["line","startDist","stopDist",{units:""}],"Misc.pointOnLine":["lines","pt",{units:""}],"Misc.sector":["center","radius","bearing1","bearing2",{units:"",steps:"",properties:""}],"Misc.shortestPath":["start","end",{obstacles:"",units:"",resolution:""}],"Helper.feature":["geometry","properties",{bbox:"",id:""}],"Helper.geometryCollection":["geometries","properties",{bbox:"",id:""}],"Helper.lineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiLineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPoint":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPolygon":["coordinates","properties",{bbox:"",id:""}],"Helper.point":["coordinates","properties",{bbox:"",id:""}],"Helper.polygon":["coordinates","properties",{bbox:"",id:""}],"Interpolation.interpolate":["points","cellSize",{gridType:"",property:"",units:"",weight:""}],"Interpolation.isobands":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Interpolation.isolines":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Grids.hexGrid":["bbox","cellSide",{units:"",triangles:"",properties:"",mask:""}],"Grids.pointGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.squareGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.triangleGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Aggregation.clustersDbscan":["points","maxDistance",{units:"",minPoints:"",mutate:""}],"Aggregation.clustersKmeans":["points",{numberOfClusters:"",mutate:""}],"Booleans.booleanPointInPolygon":["point","polygon",{ignoreBoundary:""}],"Booleans.booleanPointOnLine":["point","linestring",{ignoreEndVertices:""}],"UnitConversion.toMercator":["geojson",{mutate:""}],"UnitConversion.toWgs84":["geojson",{mutate:""}]}}process(e,t,r,i){var a;try{a=XLe[e.split(".")[1]].apply(this,this.parse(e,t))}catch{a=XLe[e.split(".")[1]].apply(this,this.parseOption(e,t))}var o=null;try{o=new jc().readFeatures(a)}catch{r&&r(a);return}i=i==null?!0:i,i&&this.addFeatures(o),r&&r(a)}parse(e,t){if(e==="Transformation.union")return t.A;var r=[],i=this.turfMap[e];return i&&i.map(function(a){return r.push(t[a]),t[a]}),r}parseOption(e,t){var r=[],i=this.turfOptionMap[e];return i.map(function(a){if(a instanceof Object){var o=a;Object.keys(o).forEach(function(s){o[s]=t[s]}),r.push(o)}else r.push(t[a]);return t}),r}}class RUr extends AS{constructor(e,t){super(e,t),this.themeField=t.themeField,this.style=t.style,this.styleGroups=t.styleGroups,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,AS.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Vn.transformStyle(this.highlightStyle);for(var i=new f3(e,this,Vn.transformStyle(t),r),a=0;a<i.shapes.length;a++)this.renderer.addShape(i.shapes[a]);return i}getStyleByData(e){var t={},r=e;if(t=H.copyAttributesWithClip(t,this.style),this.themeField&&this.styleGroups&&this.styleGroups.length>0&&r.attributes){var i=this.themeField,a=r.attributes,o=this.styleGroups,s=!1,l=null;for(var u in a)if(i===u){s=!0,l=a[u];break}if(s){for(var h=0,c=o.length;h<c;h++)if(l.toString()===o[h].value.toString()){var f=o[h].style;t=H.copyAttributesWithClip(t,f)}}}return r.style&&this.isAllowFeatureStyle===!0&&(t=H.copyAttributesWithClip(r.style)),t}canvasFunctionInternal_(e,t,r,i,a){return AS.prototype.canvasFunctionInternal_.apply(this,arguments)}}class Ka extends fT{constructor(e){if(super(),!e)return;var t=!1;e.donotNeedServerCartoCss!==void 0&&(t=e.donotNeedServerCartoCss),Ka.setDonotNeedServerCartoCss(t),e.view&&Ka.setView(e.view),e.url&&Ka.setUrl(e.url),e.cartoCss&&Ka.setCartoCss(e.cartoCss);var r=l();e.selectedPointStyle&&(r=e.selectedPointStyle),Ka.setSelectedPointStyle(r);var i=u();e.selectedLineStyle&&(i=e.selectedLineStyle),Ka.setSelectedLineStyle(i);var a=h();e.selectedRegionStyle&&(a=e.selectedRegionStyle),Ka.setSelectedRegionStyle(a);var o=c();e.selectedTextStyle&&(o=e.selectedTextStyle),Ka.setSelectedTextStyle(o);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState==4){for(var f=JSON.parse(s.responseText),d={},v=0,p=f.length;v<p;v++)for(var g=f[v].subLayers.layers,m=0,y=g.length;m<y;m++)g[m].layerIndex=y-m,d[g[m].name]=g[m];if(Ka.setLayersInfo(d),!Ka.getDonotNeedServerCartoCss()){var _=new XMLHttpRequest;_.open("GET",H.urlPathAppend(Ka.getUrl(),"tileFeature/vectorstyles.json"),!1),_.onreadystatechange=function(){if(_.readyState==4){var w=new yz().read(_.responseText),b;if(w.style&&w.type==="cartoCSS"){b=w.style,b=b.replace(/[@]/gi,"___"),b=b.replace(/\\#/gi,"___");var E={};d&&Object.keys(d).sort().forEach(function(A){var M=A.replace(/[@#\s]/gi,"___"),I=A,R=Object.keys(E);for(let k=R.length;k>-1;k--)if(A.indexOf(R[k])>-1){I=A.replace(R[k],E[R[k]]);break}I=I.replace(/[#]/gi,"#"),E[A]=M,b=b.replace(new RegExp(I,"g"),M)}),b=b.replace(/[#]/gi,`
#`),b=b.replace(/\[zoom/gi,"[scale")}var T=new Pt(b).getShaders(),C={};T.forEach(function(A){return C[A.elements[0].clean]=C[A.elements[0].clean]||{},C[A.elements[0].clean][A.attachment]=C[A.elements[0].clean][A.attachment]||[],C[A.elements[0].clean][A.attachment].push(A),A}),Ka.setCartoShaders(C)}},_.send(null)}if(Ka.getCartoCss()){var x=new Pt(Ka.getCartoCss()).getShaders(),S={};x.forEach(function(w){return S[w.elements[0].clean]=S[w.elements[0].clean]||{},S[w.elements[0].clean][w.attachment]=S[w.elements[0].clean][w.attachment]||[],S[w.elements[0].clean][w.attachment].push(w),w}),Ka.setClientCartoShaders(S)}}},s.open("GET",H.urlPathAppend(Ka.getUrl(),"layers.json"),!1),s.send(null),this.on("featureSelected",function(f){Ka.setSelectedId(f.selectedId),Ka.setLayerName(f.layerName)});function l(){return new So({image:new rm({radius:5,fill:new Ko({color:"blue"})})})}function u(){return new So({stroke:new es({color:"blue",width:3})})}function h(){return new So({fill:new Ko({color:[0,0,255,.5]}),stroke:new es({color:"blue",width:3})})}function c(){return new So({text:new J1({font:"15px Microsoft YaHei",fill:new Ko({color:"blue"}),stroke:new es({color:"white",width:1})})})}}static setCartoShaders(e){this.cartoShaders=e}static getCartoShaders(){return this.cartoShaders}static setClientCartoShaders(e){this.clientCartoShaders=e}static getClientCartoShaders(){return this.clientCartoShaders}static setCartoCss(e){this.cartoCss=e}static getCartoCss(){return this.cartoCss}static setDonotNeedServerCartoCss(e){this.donotNeedServerCartoCss=e}static getDonotNeedServerCartoCss(){return this.donotNeedServerCartoCss}static setLayersInfo(e){this.layersInfo=e}static getLayersInfo(){return this.layersInfo}static setUrl(e){this.url=e}static getUrl(){return this.url}static setView(e){this.view=e}static getView(){return this.view}static setSelectedId(e){this.selectedId=e}static getSelectedId(){return this.selectedId}static setLayerName(e){this.layerName=e}static getLayerName(){return this.layerName}static setSelectedPointStyle(e){this.selectedPointStyle=e}static setSelectedLineStyle(e){this.selectedLineStyle=e}static setSelectedRegionStyle(e){this.selectedRegionStyle=e}static setSelectedTextStyle(e){this.selectedTextStyle=e}static getSelectedStyle(e){if(e==="POINT"||e==="MULTIPOINT")return this.selectedPointStyle;if(e==="LINESTRING"||e==="MULTILINESTRING")return this.selectedLineStyle;if(e==="POLYGON"||e==="MULTIPOLYGON")return this.selectedRegionStyle;if(e==="TEXT")return this.selectedTextStyle}static getLayerInfo(e){var t=Ka.getLayersInfo();if(t===void 0)return null;var r=t[e];if(!r)return null;var i={layerIndex:r.layerIndex,ugcLayerType:r.ugcLayerType};switch(r.ugcLayerType){case"VECTOR":i.layerStyle=r.style?r.style:null;break;case"THEME":var a=r.theme;i.layerStyle=a?a.defaultStyle:null,a&&a.type==="LABEL"&&(i.type=a.type,i.textField=a.labelExpression);break;default:r.style&&(i.layerStyle=r.style);break}return i}static getStyle(e,t){var r=Ka.getUrl(),i=Ka.getView(),a=i.getZoom(),o=96,s=br.resolutionToScale(i.getResolution(),o,Wl.METER),l=e.replace(/(@)/gi,"___").replace(/(#)/gi,"___");if(Ka.getCartoCss()&&Ka.getClientCartoShaders()[l])return c(Ka.getClientCartoShaders()[l]);var u=Ka.getLayerInfo(e);if(!Ka.getDonotNeedServerCartoCss()&&Ka.getCartoShaders()[l]){if(t.getProperties().textStyle||t.getProperties().TEXT_FEATURE_CONTENT||u.type=="LABEL"&&u.textField){var h=ts.getValidStyleFromLayerInfo(u,t,r);return t.getGeometry().getType().toUpperCase()==="POINT"&&(h=f(u,t,r)),h}return c(Ka.getCartoShaders()[l])}if(u)return ts.getValidStyleFromLayerInfo(u,t,r);function c(d){var v=[];for(var p in d)d[p].map(function(g){return v.push(ts.getStyleFromCarto(a,s,g,t,!0,r)),g});return v}function f(d,v,p){var g=ts.getValidStyleFromLayerInfo(d,v,p);if(d.type=="LABEL"){v.setProperties({type:"TEXT"});for(var m=c(Ka.getCartoShaders()[l]),y=g.getText(),_=0;_<m.length;_++)y?y.setText(m[_].getText().getText()):y=m[_].getText();return g.setText(y),g}return g}}getFeatureStyle(e){var t,r=e.getProperties().layerName||e.getProperties().layer,i=e.getProperties().id||parseInt(e.getProperties().SmID);if(e.getProperties().type&&e.getProperties().type.toUpperCase()==="TEXT"?(t=Ka.getSelectedStyle(e.getProperties().type.toUpperCase()),e.getProperties().texts?t.getText().text_=e.getProperties().texts[0]:t.getText().text_=""):t=Ka.getSelectedStyle(e.getGeometry().getType().toUpperCase()),t){var a=Ka.getLayerName(),o=Ka.getSelectedId();if(a===r&&i===o)return t}return Ka.getStyle(r,e)}}var DUr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),NUr=function(n){DUr(e,n);function e(t,r,i,a,o,s){var l=n.call(this,t,r,s)||this;return l.extent=null,l.format_=a,l.features_=null,l.loader_,l.projection=null,l.resolution,l.tileLoadFunction_=o,l.url_=i,l.key=i,l}return e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==Xr.IDLE&&(this.setState(Xr.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,r){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Xr.ERROR)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(Xr.LOADED)},e.prototype.setLoader=function(t){this.loader_=t},e}(u$);const kUr=NUr;var FUr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),YLe=[],BUr=function(n){FUr(e,n);function e(t,r,i,a){var o=n.call(this,t,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=a.bind(void 0,o),o.wrappedTileCoord=i,o}return e.prototype.getContext=function(t){var r=vi(t);return r in this.context_||(this.context_[r]=Ad(1,1,YLe)),this.context_[r]},e.prototype.hasContext=function(t){return vi(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var r=vi(t);return r in this.replayState_||(this.replayState_[r]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[r]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var t in this.context_)YLe.push(this.context_[t].canvas),delete this.context_[t];n.prototype.release.call(this)},e}(u$);const GUr=BUr;var zUr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),UUr=function(n){zUr(e,n);function e(t){var r=this,i=t.projection||"EPSG:3857",a=t.extent||h$(i),o=t.tileGrid||Ehe({extent:a,maxResolution:t.maxResolution,maxZoom:t.maxZoom!==void 0?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});return r=n.call(this,{attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,opaque:!1,projection:i,state:t.state,tileGrid:o,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:$Ur,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX===void 0?!0:t.wrapX,transition:t.transition,zDirection:t.zDirection===void 0?1:t.zDirection})||this,r.format_=t.format?t.format:null,r.sourceTileCache=new bhe(r.tileCache.highWaterMark),r.overlaps_=t.overlaps==null?!0:t.overlaps,r.tileClass=t.tileClass?t.tileClass:kUr,r.tileGrids_={},r}return e.prototype.getFeaturesInExtent=function(t){var r=[],i=this.tileCache;if(i.getCount()===0)return r;var a=kqe(i.peekFirstKey())[0],o=this.tileGrid;return i.forEach(function(s){if(!(s.tileCoord[0]!==a||s.getState()!==Xr.LOADED))for(var l=s.getSourceTiles(),u=0,h=l.length;u<h;++u){var c=l[u],f=c.tileCoord;if(Cl(t,o.getTileCoordExtent(f))){var d=c.getFeatures();if(d)for(var v=0,p=d.length;v<p;++v){var g=d[v],m=g.getGeometry();Cl(t,m.getExtent())&&r.push(g)}}}}),r},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(t,r){var i=this.getTileCacheForProjection(t),a=Object.keys(r).reduce(function(o,s){var l=aRr(s);if(i.containsKey(l))for(var u=i.get(l).sourceTiles,h=0,c=u.length;h<c;++h)o[u[h].getKey()]=!0;return o},{});n.prototype.expireCache.call(this,t,r),this.sourceTileCache.expireCache(a)},e.prototype.getSourceTiles=function(t,r,i){var a=this;if(i.getState()===Xr.IDLE){i.setState(Xr.LOADING);var o=i.wrappedTileCoord,s=this.getTileGridForProjection(r),l=s.getTileCoordExtent(o),u=o[0],h=s.getResolution(u);f0(l,-h,l);var c=this.tileGrid,f=c.getExtent();f&&tm(l,f,l);var d=c.getZForResolution(h,1);c.forEachTileCoord(l,d,function(v){var p=a.tileUrlFunction(v,t,r),g=a.sourceTileCache.containsKey(p)?a.sourceTileCache.get(p):new a.tileClass(v,p?Xr.IDLE:Xr.EMPTY,p,a.format_,a.tileLoadFunction);i.sourceTiles.push(g);var m=g.getState();if(m<Xr.LOADED){var y=function(_){a.handleTileChange(_);var x=g.getState();if(x===Xr.LOADED||x===Xr.ERROR){var S=g.getKey();S in i.errorTileKeys?g.getState()===Xr.LOADED&&delete i.errorTileKeys[S]:i.loadingSourceTiles--,x===Xr.ERROR?i.errorTileKeys[S]=!0:g.removeEventListener(Ci.CHANGE,y),i.loadingSourceTiles===0&&i.setState(v2(i.errorTileKeys)?Xr.LOADED:Xr.ERROR)}};g.addEventListener(Ci.CHANGE,y),i.loadingSourceTiles++}m===Xr.IDLE&&(g.extent=c.getTileCoordExtent(v),g.projection=r,g.resolution=c.getResolution(v[0]),a.sourceTileCache.set(p,g),g.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(function(v){return v.getState()===Xr.ERROR})?Xr.ERROR:Xr.LOADED)}return i.sourceTiles},e.prototype.getTile=function(t,r,i,a,o){var s=hL(t,r,i),l=this.getKey(),u;if(this.tileCache.containsKey(s)&&(u=this.tileCache.get(s),u.key===l))return u;var h=[t,r,i],c=this.getTileCoordForTileUrlFunction(h,o),f=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(o);if(c&&f){var v=d.getTileCoordExtent(c);f0(v,-d.getResolution(t),v),Cl(f,v)||(c=null)}var p=!0;if(c!==null){var g=this.tileGrid,m=d.getResolution(t),y=g.getZForResolution(m,1),_=d.getTileCoordExtent(c);f0(_,-m,_),g.forEachTileCoord(_,y,function(S){p=p&&!this.tileUrlFunction(S,a,o)}.bind(this))}var x=new GUr(h,p?Xr.EMPTY:Xr.IDLE,c,this.getSourceTiles.bind(this,a,o));return x.key=l,u?(x.interimTile=u,x.refreshInterimChain(),this.tileCache.replace(s,x)):this.tileCache.set(s,x),x},e.prototype.getTileGridForProjection=function(t){var r=t.getCode(),i=this.tileGrids_[r];if(!i){var a=this.tileGrid;i=Vqe(t,void 0,a?a.getTileSize(a.getMinZoom()):void 0),this.tileGrids_[r]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,r,i){var a=this.getTileGridForProjection(i),o=nh(a.getTileSize(t),this.tmpSize);return[Math.round(o[0]*r),Math.round(o[1]*r)]},e.prototype.updateCacheSize=function(t,r){n.prototype.updateCacheSize.call(this,t*2,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(Hqe);const VUr=UUr;function $Ur(n,e){n.setLoader(function(t,r,i){sXe(e,n.getFormat(),t,r,i,n.onLoad.bind(n),n.onError.bind(n))})}var kce={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */kce.read=function(n,e,t,r,i){var a,o,s=i*8-r-1,l=(1<<s)-1,u=l>>1,h=-7,c=t?i-1:0,f=t?-1:1,d=n[e+c];for(c+=f,a=d&(1<<-h)-1,d>>=-h,h+=s;h>0;a=a*256+n[e+c],c+=f,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=r;h>0;o=o*256+n[e+c],c+=f,h-=8);if(a===0)a=1-u;else{if(a===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-u}return(d?-1:1)*o*Math.pow(2,a-r)};kce.write=function(n,e,t,r,i,a){var o,s,l,u=a*8-i-1,h=(1<<u)-1,c=h>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,v=r?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=f/l:e+=f*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=h?(s=0,o=h):o+c>=1?(s=(e*l-1)*Math.pow(2,i),o=o+c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;n[t+d]=s&255,d+=v,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;n[t+d]=o&255,d+=v,o/=256,u-=8);n[t+d-v]|=p*128};var WUr=Go,X6=kce;function Go(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}Go.Varint=0;Go.Fixed64=1;Go.Bytes=2;Go.Fixed32=5;var Yre=(1<<16)*(1<<16),qLe=1/Yre,HUr=12,yQe=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Go.prototype={destroy:function(){this.buf=null},readFields:function(n,e,t){for(t=t||this.length;this.pos<t;){var r=this.readVarint(),i=r>>3,a=this.pos;this.type=r&7,n(i,e,this),this.pos===a&&this.skip(r)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=Y6(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=KLe(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=Y6(this.buf,this.pos)+Y6(this.buf,this.pos+4)*Yre;return this.pos+=8,n},readSFixed64:function(){var n=Y6(this.buf,this.pos)+KLe(this.buf,this.pos+4)*Yre;return this.pos+=8,n},readFloat:function(){var n=X6.read(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=X6.read(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e=this.buf,t,r;return r=e[this.pos++],t=r&127,r<128||(r=e[this.pos++],t|=(r&127)<<7,r<128)||(r=e[this.pos++],t|=(r&127)<<14,r<128)||(r=e[this.pos++],t|=(r&127)<<21,r<128)?t:(r=e[this.pos],t|=(r&15)<<28,jUr(t,n,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2===1?(n+1)/-2:n/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=HUr&&yQe?oVr(this.buf,e,n):aVr(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==Go.Bytes)return n.push(this.readVarint(e));var t=h1(this);for(n=n||[];this.pos<t;)n.push(this.readVarint(e));return n},readPackedSVarint:function(n){if(this.type!==Go.Bytes)return n.push(this.readSVarint());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readSVarint());return n},readPackedBoolean:function(n){if(this.type!==Go.Bytes)return n.push(this.readBoolean());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readBoolean());return n},readPackedFloat:function(n){if(this.type!==Go.Bytes)return n.push(this.readFloat());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readFloat());return n},readPackedDouble:function(n){if(this.type!==Go.Bytes)return n.push(this.readDouble());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readDouble());return n},readPackedFixed32:function(n){if(this.type!==Go.Bytes)return n.push(this.readFixed32());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readFixed32());return n},readPackedSFixed32:function(n){if(this.type!==Go.Bytes)return n.push(this.readSFixed32());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readSFixed32());return n},readPackedFixed64:function(n){if(this.type!==Go.Bytes)return n.push(this.readFixed64());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readFixed64());return n},readPackedSFixed64:function(n){if(this.type!==Go.Bytes)return n.push(this.readSFixed64());var e=h1(this);for(n=n||[];this.pos<e;)n.push(this.readSFixed64());return n},skip:function(n){var e=n&7;if(e===Go.Varint)for(;this.buf[this.pos++]>127;);else if(e===Go.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Go.Fixed32)this.pos+=4;else if(e===Go.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e<this.pos+n;)e*=2;if(e!==this.length){var t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(n){this.realloc(4),DC(this.buf,n,this.pos),this.pos+=4},writeSFixed32:function(n){this.realloc(4),DC(this.buf,n,this.pos),this.pos+=4},writeFixed64:function(n){this.realloc(8),DC(this.buf,n&-1,this.pos),DC(this.buf,Math.floor(n*qLe),this.pos+4),this.pos+=8},writeSFixed64:function(n){this.realloc(8),DC(this.buf,n&-1,this.pos),DC(this.buf,Math.floor(n*qLe),this.pos+4),this.pos+=8},writeVarint:function(n){if(n=+n||0,n>268435455||n<0){XUr(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))},writeSVarint:function(n){this.writeVarint(n<0?-n*2-1:n*2)},writeBoolean:function(n){this.writeVarint(Boolean(n))},writeString:function(n){n=String(n),this.realloc(n.length*4),this.pos++;var e=this.pos;this.pos=sVr(this.buf,n,this.pos);var t=this.pos-e;t>=128&&ZLe(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(n){this.realloc(4),X6.write(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),X6.write(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var t=0;t<e;t++)this.buf[this.pos++]=n[t]},writeRawMessage:function(n,e){this.pos++;var t=this.pos;n(e,this);var r=this.pos-t;r>=128&&ZLe(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeMessage:function(n,e,t){this.writeTag(n,Go.Bytes),this.writeRawMessage(e,t)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,ZUr,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,KUr,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,eVr,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,JUr,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,QUr,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,tVr,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,rVr,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,nVr,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,iVr,e)},writeBytesField:function(n,e){this.writeTag(n,Go.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,Go.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,Go.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,Go.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,Go.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,Go.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,Go.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,Go.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,Go.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,Go.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,Boolean(e))}};function jUr(n,e,t){var r=t.buf,i,a;if(a=r[t.pos++],i=(a&112)>>4,a<128||(a=r[t.pos++],i|=(a&127)<<3,a<128)||(a=r[t.pos++],i|=(a&127)<<10,a<128)||(a=r[t.pos++],i|=(a&127)<<17,a<128)||(a=r[t.pos++],i|=(a&127)<<24,a<128)||(a=r[t.pos++],i|=(a&1)<<31,a<128))return RC(n,i,e);throw new Error("Expected varint not more than 10 bytes")}function h1(n){return n.type===Go.Bytes?n.readVarint()+n.pos:n.pos+1}function RC(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function XUr(n,e){var t,r;if(n>=0?(t=n%4294967296|0,r=n/4294967296|0):(t=~(-n%4294967296),r=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,r=r+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),YUr(t,r,e),qUr(r,e)}function YUr(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function qUr(n,e){var t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function ZLe(n,e,t){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(r);for(var i=t.pos-1;i>=n;i--)t.buf[i+r]=t.buf[i]}function ZUr(n,e){for(var t=0;t<n.length;t++)e.writeVarint(n[t])}function KUr(n,e){for(var t=0;t<n.length;t++)e.writeSVarint(n[t])}function JUr(n,e){for(var t=0;t<n.length;t++)e.writeFloat(n[t])}function QUr(n,e){for(var t=0;t<n.length;t++)e.writeDouble(n[t])}function eVr(n,e){for(var t=0;t<n.length;t++)e.writeBoolean(n[t])}function tVr(n,e){for(var t=0;t<n.length;t++)e.writeFixed32(n[t])}function rVr(n,e){for(var t=0;t<n.length;t++)e.writeSFixed32(n[t])}function nVr(n,e){for(var t=0;t<n.length;t++)e.writeFixed64(n[t])}function iVr(n,e){for(var t=0;t<n.length;t++)e.writeSFixed64(n[t])}function Y6(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+n[e+3]*16777216}function DC(n,e,t){n[t]=e,n[t+1]=e>>>8,n[t+2]=e>>>16,n[t+3]=e>>>24}function KLe(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}function aVr(n,e,t){for(var r="",i=e;i<t;){var a=n[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>t)break;var l,u,h;s===1?a<128&&(o=a):s===2?(l=n[i+1],(l&192)===128&&(o=(a&31)<<6|l&63,o<=127&&(o=null))):s===3?(l=n[i+1],u=n[i+2],(l&192)===128&&(u&192)===128&&(o=(a&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(l=n[i+1],u=n[i+2],h=n[i+3],(l&192)===128&&(u&192)===128&&(h&192)===128&&(o=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),r+=String.fromCharCode(o),i+=s}return r}function oVr(n,e,t){return yQe.decode(n.subarray(e,t))}function sVr(n,e,t){for(var r=0,i,a;r<e.length;r++){if(i=e.charCodeAt(r),i>55295&&i<57344)if(a)if(i<56320){n[t++]=239,n[t++]=191,n[t++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||r+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):a=i;continue}else a&&(n[t++]=239,n[t++]=191,n[t++]=189,a=null);i<128?n[t++]=i:(i<2048?n[t++]=i>>6|192:(i<65536?n[t++]=i>>12|224:(n[t++]=i>>18|240,n[t++]=i>>12&63|128),n[t++]=i>>6&63|128),n[t++]=i&63|128)}return t}var JLe=Nu(),XN=function(){function n(e,t,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=i}return n.prototype.get=function(e){return this.properties_[e]},n.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Kr.POINT?zje(this.flatCoordinates_):lue(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},n.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var e=kf(this.getExtent());this.flatInteriorPoints_=mhe(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_},n.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var e=Aqe(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=dqe(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_},n.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=S7(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},n.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var e=this.flatCoordinates_,t=0,r=this.ends_,i=0,a=r.length;i<a;++i){var o=r[i],s=S7(e,t,o,2,.5);em(this.flatMidpoints_,s),t=o}}return this.flatMidpoints_},n.prototype.getId=function(){return this.id_},n.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},n.prototype.getGeometry=function(){return this},n.prototype.getSimplifiedGeometry=function(e){return this},n.prototype.simplifyTransformed=function(e,t){return this},n.prototype.getProperties=function(){return this.properties_},n.prototype.getStride=function(){return 2},n.prototype.getStyleFunction=function(){return this.styleFunction},n.prototype.getType=function(){return this.type_},n.prototype.transform=function(e){e=ya(e);var t=e.getExtent(),r=e.getWorldExtent();if(t&&r){var i=lh(r)/lh(t);Id(JLe,r[0],r[3],i,-i,0,0,0),ES(this.flatCoordinates_,0,this.flatCoordinates_.length,2,JLe,this.flatCoordinates_)}},n.prototype.getEnds=function(){return this.ends_},n}();XN.prototype.getEndss=XN.prototype.getEnds;XN.prototype.getFlatCoordinates=XN.prototype.getOrientedFlatCoordinates;const qre=XN;var lVr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),uVr=function(n){lVr(e,n);function e(t){var r=n.call(this)||this,i=t||{};return r.dataProjection=new ew({code:"",units:$c.TILE_PIXELS}),r.featureClass_=i.featureClass?i.featureClass:qre,r.geometryName_=i.geometryName,r.layerName_=i.layerName?i.layerName:"layer",r.layers_=i.layers?i.layers:null,r.idProperty_=i.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return e.prototype.readRawGeometry_=function(t,r,i,a){t.pos=r.geometry;for(var o=t.readVarint()+t.pos,s=1,l=0,u=0,h=0,c=0,f=0;t.pos<o;){if(!l){var d=t.readVarint();s=d&7,l=d>>3}l--,s===1||s===2?(u+=t.readSVarint(),h+=t.readSVarint(),s===1&&c>f&&(a.push(c),f=c),i.push(u,h),c+=2):s===7?c>f&&(i.push(i[f],i[f+1]),c+=2):ki(!1,59)}c>f&&(a.push(c),f=c)},e.prototype.createFeature_=function(t,r,i){var a=r.type;if(a===0)return null;var o,s=r.properties,l;this.idProperty_?(l=s[this.idProperty_],delete s[this.idProperty_]):l=r.id,s[this.layerName_]=r.layer.name;var u=[],h=[];this.readRawGeometry_(t,r,u,h);var c=vVr(a,h.length);if(this.featureClass_===qre)o=new this.featureClass_(c,u,h,s,l),o.transform(i.dataProjection);else{var f=void 0;if(c==Kr.POLYGON){var d=wPr(u,h);f=d.length>1?new Mqe(u,Ro.XY,d):new m2(u,Ro.XY,h)}else f=c===Kr.POINT?new Qs(u,Ro.XY):c===Kr.LINE_STRING?new gm(u,Ro.XY):c===Kr.POLYGON?new m2(u,Ro.XY,h):c===Kr.MULTI_POINT?new whe(u,Ro.XY):c===Kr.MULTI_LINE_STRING?new Cqe(u,Ro.XY,h):null;var v=this.featureClass_;o=new v,this.geometryName_&&o.setGeometryName(this.geometryName_);var p=The(f,!1,i);o.setGeometry(p),l!==void 0&&o.setId(l),o.setProperties(s,!0)}return o},e.prototype.getType=function(){return qb.ARRAY_BUFFER},e.prototype.readFeatures=function(t,r){var i=this.layers_,a=this.adaptOptions(r),o=ya(a.dataProjection);o.setWorldExtent(a.extent),a.dataProjection=o;var s=new WUr(t),l=s.readFields(hVr,{}),u=[];for(var h in l)if(!(i&&i.indexOf(h)==-1)){var c=l[h],f=c?[0,0,c.extent,c.extent]:null;o.setExtent(f);for(var d=0,v=c.length;d<v;++d){var p=dVr(s,c,d),g=this.createFeature_(s,p,a);g!==null&&u.push(g)}}return u},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Yqe);function hVr(n,e,t){if(n===3){var r={keys:[],values:[],features:[]},i=t.readVarint()+t.pos;t.readFields(cVr,r,i),r.length=r.features.length,r.length&&(e[r.name]=r)}}function cVr(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){for(var r=null,i=t.readVarint()+t.pos;t.pos<i;)n=t.readVarint()>>3,r=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(r)}}function fVr(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2)for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e.layer.keys[t.readVarint()],a=e.layer.values[t.readVarint()];e.properties[i]=a}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function dVr(n,e,t){n.pos=e.features[t];var r=n.readVarint()+n.pos,i={layer:e,type:0,properties:{}};return n.readFields(fVr,i,r),i}function vVr(n,e){var t;return n===1?t=e===1?Kr.POINT:Kr.MULTI_POINT:n===2?t=e===1?Kr.LINE_STRING:Kr.MULTI_LINE_STRING:n===3&&(t=Kr.POLYGON),t}const w1=uVr;class Zre extends VUr{constructor(e){e.url===void 0&&e.style===void 0&&console.error("one of 'options.style' or 'options.style' is required");var t=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,a=/\{-y\}/g;e.attributions=e.attributions||"Tile Data <span>\xA9 SuperMap iServer</span> with <span>\xA9 SuperMap iClient</span>",["4","5"].indexOf(br.getOlVersion())<0&&(e.tileSize=e.format instanceof w1&&e.style?512:256),super({attributions:e.attributions,cacheSize:e.cacheSize,format:e.format||new jc,logo:br.getOlVersion()==="4"?e.logo:null,overlaps:e.overlaps,projection:e.projection,state:e.format instanceof w1&&e.style&&Object.prototype.toString.call(e.style)=="[object String]"?"loading":e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction||(e.format instanceof w1&&e.style?u:l),tileLoadFunction:e.tileLoadFunction||(e.format instanceof w1?c:h),wrapX:e.wrapX!==void 0?e.wrapX:!1,tileSize:e.tileSize||null,zDirection:["4","5"].indexOf(br.getOlVersion())>-1?null:0});var o=this;if(o.withCredentials=e.withCredentials,o._tileType=e.tileType||"ScaleXY",this.vectorTileStyles=new Ka,e.format instanceof w1&&e.style)if(Object.prototype.toString.call(e.style)=="[object String]"){var s=xs.appendCredential(e.style);li.get(s,null,{withCredentials:e.withCredentials}).then(f=>f.json()).then(f=>{this._fillByStyleJSON(f,e.source),this.setState("ready")})}else this._fillByStyleJSON(e.style,e.source);else this._fillByRestMapOptions(e.url,e);function l(f,d,v){o.tileGrid||(o.tileGrid=o.getTileGridForProjection(v));var p=f[0],g=f[1],m=["4","5"].indexOf(br.getOlVersion())>-1?-f[2]-1:f[2],y=nh(o.tileGrid.getTileSize(p,o.tmpSize)),_="";if(o.tileType==="ZXY")_="&width="+y[0]+"&height="+y[1]+"&x="+g+"&y="+m+"&z="+p;else if(o.tileType==="ViewBounds"){var x=o.tileGrid.getTileCoordExtent(f);_="&width="+y[0]+"&height="+y[1]+"&viewBounds="+x[0]+","+x[1]+","+x[2]+","+x[3]}else{var S=o.tileGrid.getOrigin(p),w=o.tileGrid.getResolution(p),b=96,E=v.getUnits()||"degrees";E==="degrees"&&(E=Wl.DEGREE),E==="m"&&(E=Wl.METER);var T=br.resolutionToScale(w,b,E);_="&x="+g+"&y="+m+"&width="+y[0]+"&height="+y[1]+"&scale="+T+"&origin={'x':"+S[0]+",'y':"+S[1]+"}"}return o._tileUrl+encodeURI(_)}function u(f){if(f)return o._tileUrl.replace(t,f[0].toString()).replace(r,f[1].toString()).replace(i,function(){var d=["4","5"].indexOf(br.getOlVersion())>-1?-f[2]-1:f[2];return d.toString()}).replace(a,function(){var d=f[0],v=o.tileGrid.getFullTileRange(d),p=v.getHeight()+f[2];return p.toString()})}function h(f,d){var v=new RegExp("(^|\\?|&)width=([^&]*)(\\s|&|$)"),p=new RegExp("(^|\\?|&)height=([^&]*)(\\s|&|$)"),g=Number(d.match(v)[2]),m=Number(d.match(p)[2]);f.setLoader(function(y,_,x){li.get(d).then(function(S){if(f.getFormat()instanceof jc)return S.json()}).then(function(S){var w=[];if(f.getFormat()instanceof jc){S.recordsets.map(function(E){return E.features.map(function(T){for(var C=[],A=0,M=0;M<T.geometry.parts.length;M++){for(var I=T.geometry.parts[M]*2,R=0,k=A;R<I;R+=2,k+=2)C.push(new Ki(T.geometry.points[k],T.geometry.points[k+1]));A+=I}return T.geometry.points=C,T}),E}),S.recordsets.map(function(E){return E.features.map(function(T){return T.layerName=E.layerName,T.type=T.geometry.type,w.push(T),T}),E});let b=new ew({extent:[0,0,256,256],code:"TILE_PIXELS",units:"tile-pixels"});["4","5"].indexOf(br.getOlVersion())>-1?(f.setExtent([0,0,g,m]),f.setProjection(b),w=f.getFormat().readFeatures(br.toGeoJSON(w))):w=f.getFormat().readFeatures(br.toGeoJSON(w),{extent:y,dataProjection:b,featureProjection:x}),f.setFeatures(w)}})})}function c(f,d){const v=f.getFormat(),p=f.onLoad.bind(f),g=f.onError.bind(f);f.setLoader(function(m,y,_){const x=new XMLHttpRequest;x.open("GET",typeof d=="function"?d(m,y,_):d,!0),v.getType()=="arraybuffer"&&(x.responseType="arraybuffer"),x.withCredentials=o.withCredentials,x.onload=function(){if(!x.status||x.status>=200&&x.status<300){const S=v.getType();let w;S==="json"||S==="text"?w=x.responseText:S==="xml"?(w=x.responseXML,w||(w=new DOMParser().parseFromString(x.responseText,"application/xml"))):S==="arraybuffer"&&(w=x.response),w?["4","5"].indexOf(br.getOlVersion())>-1?p.call(this,v.readFeatures(w,{featureProjection:_}),v.readProjection(w),v.getLastExtent()):p.call(this,v.readFeatures(w,{extent:m,featureProjection:_}),v.readProjection(w)):g.call(this)}else g.call(this)}.bind(this),x.onerror=function(){g.call(this)}.bind(this),x.send()})}}_fillByStyleJSON(e,t){if(t||(t=Object.keys(e.sources)[0]),e.sources&&e.sources[t]&&(this._tileUrl=xs.appendCredential(e.sources[t].tiles[0])),e.metadata&&e.metadata.indexbounds){const i=e.metadata.indexbounds;var r=Math.max(i[2]-i[0],i[3]-i[1]);const a=[];for(let o=0;o<30;o++)a.push(r/512/Math.pow(2,o));this.tileGrid=new ym({extent:e.metadata.indexbounds,resolutions:a,tileSize:[512,512]})}}_fillByRestMapOptions(e,t){this._tileUrl=H.urlPathAppend(t.url,"tileFeature.json"),t.format instanceof w1&&(this._tileUrl=H.urlPathAppend(t.url,"tileFeature.mvt")),this._tileUrl=xs.appendCredential(this._tileUrl);var r=!0;t.returnAttributes!==void 0&&(r=t.returnAttributes);var i={};i.returnAttributes=r,t._cache!==void 0&&(i._cache=t._cache),t.layersID!==void 0&&(i.layersID=t.layersID),t.layerNames!==void 0&&(i.layerNames=t.layerNames),t.expands!==void 0&&(i.expands=t.expands),t.compressTolerance!==void 0&&(i.compressTolerance=t.compressTolerance),t.coordinateType!==void 0&&(i.coordinateType=t.coordinateType),t.returnCutEdges!==void 0&&(i.returnCutEdges=t.returnCutEdges),this._tileUrl=H.urlAppend(this._tileUrl,H.getParameterString(i))}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var i=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],a=o();function o(){var l=17,u=96,h=i[2]-i[0],c=i[3]-i[1],f=h>=c?h:c,d;f===h?d=f/t.viewer.width:d=f/t.viewer.height;var v=[],p=Wl.METER;if(t.coordUnit===Wl.DEGREE&&(p=Wl.DEGREE),t.visibleScales.length>0){var g=s(t);for(let m=0;m<g.length;m++)v.push(br.scaleToResolution(g[m],u,p))}else for(let m=0;m<l;m++)v.push(d/Math.pow(2,m));return v}function s(l){var u=l.visibleScales;if(!u)return null;var h=l.viewBounds,c=l.coordUnit,f=l.viewer,d=l.scale,v=l.datumAxis;h=new po(h.left,h.bottom,h.right,h.top),f=new a3(f.rightBottom.x,f.rightBottom.y),c=c.toLowerCase(),v=v||6378137;var p=c,g=H.calculateDpi(h,f,d,p,v),m=x(u),y=m.length;u=[y];for(var _=0;_<y;_++)u[_]=H.getScaleFromResolutionDpi(m[_],g,p,v);function x(S){if(S!==null){var w,b;b=S.length,w=[b];for(var E=0;E<b;E++)w[E]=H.getResolutionFromScaleDpi(S[E],g,p,v);return w}}return u}return r.tileGrid=new ym({extent:i,resolutions:a}),r}}class pVr extends d${constructor(e,t){var r=t||{};super({attributions:r.attributions||"Map Data <span>\xA9 SuperMap iServer</span> with <span>\xA9 SuperMap iClient</span>",canvasFunction:i,logo:br.getOlVersion()==="4"?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state});function i(o,s,l,u,h){var c=u[0]*l,f=u[1]*l;if(this.rootCanvas.width=this.maxWidth=c,this.rootCanvas.height=this.maxHeight=f,!this.features)return this.rootCanvas;this.pixelRatio=l;var d=this.map.getSize()[0]*l,v=this.map.getSize()[1]*l;return this.offset=[(c-d)/2/l,(f-v)/2/l],this.updateHeatPoints(s),this.rootCanvas}if(this.canvasFunctionInternal_=i,this.features=[],this.name=e,!r.map)throw new Error("options.map is not found.");this.map=r.map,this.id=r.id?r.id:H.createUniqueID("HeatMapSource_"),this.opacity=r.opacity?r.opacity:1,this.colors=r.colors?r.colors:["blue","cyan","lime","yellow","red"],this.useGeoUnit=r.useGeoUnit?r.useGeoUnit:!1,this.radius=r.radius?r.radius:50,this.featureWeight=r.featureWeight?r.featureWeight:null,this.maxWeight=null,this.minWeight=null,this.maxWidth=null,this.maxHeight=null,this.rootCanvas=document.createElement("canvas");var a=this.map.getSize();this.rootCanvas.width=this.maxWidth=parseInt(a[0]),this.rootCanvas.height=this.maxHeight=parseInt(a[1]),H.modifyDOMElement(this.rootCanvas,null,null,null,null,null,null,this.opacity),this.canvasContext=this.rootCanvas.getContext("2d")}addFeatures(e){this.features=this.toiClientFeature(e),this.changed()}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.rootCanvas;H.modifyDOMElement(t,null,null,null,null,null,null,e),this.map!==null&&this.changed()}}updateHeatPoints(e){this.features&&this.features.length>0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}convertFastToPixelPoints(e){var t=[],r,i,a,o,s,l;this.useRadius=this.useGeoUnit?parseInt(this.radius/e):this.radius;for(var u=0;u<this.features.length;u++){var h=this.features[u],c=h.geometry,f=this.getLocalXY(new vd(c.x,c.y));this.featureWeight?(f.weight=h.attributes[this.featureWeight],this.maxWeight||(o=o||f.weight,s=s||f.weight,o=Math.max(o,f.weight),s=Math.min(s,f.weight))):f.weight=1,r=Math.floor(f[0]),i=Math.floor(f[1]),a=f.weight,t.push([r,i,a])}this.maxWeight?this.draw(t,this.maxWeight):(o&&s?l=(o+s)/2:l=1,this.draw(t,l))}draw(e,t){if(this.maxHeight>0&&this.maxWidth>0){var r=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var i=0;i<e.length;i++){var a=e[i];this.canvasContext.globalAlpha=Math.max(a[2]/t,.05),this.canvasContext.drawImage(this.circle,a[0]-this.useRadius,a[1]-this.useRadius)}var o=r.getImageData(0,0,this.maxWidth,this.maxHeight);this.colorize(o.data,this.grad),r.putImageData(o,0,0)}else return!1}colorize(e,t){for(var r=0,i;r<e.length;r+=4)i=e[r+3]*4,i&&(e[r]=t[i],e[r+1]=t[i+1],e[r+2]=t[i+2])}drawCircle(e){var t=e/2,r=this.circle=document.createElement("canvas"),i=r.getContext("2d");r.height=2*e,r.width=2*e,i.shadowOffsetX=i.shadowOffsetY=2*e,i.shadowBlur=t,i.shadowColor="#000000",i.beginPath(),i.arc(-e,-e,e/2,0,Math.PI*2,!0),i.closePath(),i.fill()}createGradient(){var e=this.colors,t=document.createElement("canvas"),r=t.getContext("2d"),i=r.createLinearGradient(0,0,0,256);t.height=256,t.width=1;for(var a=1,o=0,s=e.length;o<s;o++)i.addColorStop(a/s,e[o]),a++;r.fillStyle=i,r.fillRect(0,0,1,256),this.grad=r.getImageData(0,0,1,256).data}getLocalXY(e){var t,r=this.map;(e instanceof Ki||e instanceof O_)&&(t=r.getPixelFromCoordinate([e.x,e.y])),e instanceof vd&&(t=r.getPixelFromCoordinate([e.lon,e.lat]));var i=-r.getView().getRotation(),a=r.getPixelFromCoordinate(r.getView().getCenter()),o=t;return this.pixelRatio&&(o=this.scale(t,a,this.pixelRatio)),t&&a&&(o=this.rotate(o,i,a)),this.offset&&o?[o[0]+this.offset[0],o[1]+this.offset[1]]:o}rotate(e,t,r){var i=Math.cos(t)*(e[0]-r[0])-Math.sin(t)*(e[1]-r[1])+r[0],a=Math.sin(t)*(e[0]-r[0])+Math.cos(t)*(e[1]-r[1])+r[1];return[i,a]}scale(e,t,r){var i=(e[0]-t[0])*r+t[0],a=(e[1]-t[1])*r+t[1];return[i,a]}removeFeatures(e){if(!(!e||e.length===0||!this.features||this.features.length===0)){if(e===this.features)return this.removeAllFeatures();H.isArray(e)||(e=[e]);for(var t,r,i=[],a=0,o=e.length;a<o;a++){if(t=e[a],r=H.indexOf(this.features,t),r===-1){i.push(t);continue}this.features.splice(r,1)}var s=i.length==0;this.dispatchEvent({type:"featuresremoved",value:{features:i,succeed:s}}),this.changed()}}removeAllFeatures(){this.features=[],this.changed()}toiClientFeature(e){br.isArray(e)||(e=[e]);let t=[],r,i;for(let a=0,o=e.length;a<o;a++)if(e[a]instanceof d0)e[a].getGeometry()instanceof Qs&&(r=new Ki(e[a].getGeometry().getCoordinates()[0],e[a].getGeometry().getCoordinates()[1]),i=e[a].getProperties().Properties?e[a].getProperties().Properties:{},t.push(new sc(r,i)));else if(["FeatureCollection","Feature","Geometry"].indexOf(e[a].type)!=-1){let s=new uh;t=t.concat(s.read(e[a]))}else if(e[a].geometry&&e[a].geometry.parts)t.push(u3.fromJson(e[a]).toFeature());else throw new Error(`Features[${a}]'s type does not match, please check.`);return t}}var Dh;(function(n){n[n.Unknown=0]="Unknown",n[n.Point=1]="Point",n[n.LineString=2]="LineString",n[n.Polygon=3]="Polygon",n[n.MultiPoint=4]="MultiPoint",n[n.MultiLineString=5]="MultiLineString",n[n.MultiPolygon=6]="MultiPolygon",n[n.GeometryCollection=7]="GeometryCollection",n[n.CircularString=8]="CircularString",n[n.CompoundCurve=9]="CompoundCurve",n[n.CurvePolygon=10]="CurvePolygon",n[n.MultiCurve=11]="MultiCurve",n[n.MultiSurface=12]="MultiSurface",n[n.Curve=13]="Curve",n[n.Surface=14]="Surface",n[n.PolyhedralSurface=15]="PolyhedralSurface",n[n.TIN=16]="TIN",n[n.Triangle=17]="Triangle"})(Dh||(Dh={}));const YP=4,qP=4,iF=4,Wx=new Int32Array(2),QLe=new Float32Array(Wx.buffer),ePe=new Float64Array(Wx.buffer),q6=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Kre;(function(n){n[n.UTF8_BYTES=1]="UTF8_BYTES",n[n.UTF16_STRING=2]="UTF16_STRING"})(Kre||(Kre={}));class L_{constructor(e){this.bytes_=e,this.position_=0}static allocate(e){return new L_(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Wx[0]=this.readInt32(e),QLe[0]}readFloat64(e){return Wx[q6?0:1]=this.readInt32(e),Wx[q6?1:0]=this.readInt32(e+4),ePe[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){QLe[0]=t,this.writeInt32(e,Wx[0])}writeFloat64(e,t){ePe[0]=t,this.writeInt32(e,Wx[q6?0:1]),this.writeInt32(e+4,Wx[q6?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+YP+qP)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<qP;t++)e+=String.fromCharCode(this.readInt8(this.position_+YP+t));return e}__offset(e,t){const r=e-this.readInt32(e);return t<this.readInt16(r)?this.readInt16(r+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);const r=this.readInt32(e);let i="",a=0;if(e+=YP,t===Kre.UTF8_BYTES)return this.bytes_.subarray(e,e+r);for(;a<r;){let o;const s=this.readUint8(e+a++);if(s<192)o=s;else{const l=this.readUint8(e+a++);if(s<224)o=(s&31)<<6|l&63;else{const u=this.readUint8(e+a++);if(s<240)o=(s&15)<<12|(l&63)<<6|u&63;else{const h=this.readUint8(e+a++);o=(s&7)<<18|(l&63)<<12|(u&63)<<6|h&63}}}o<65536?i+=String.fromCharCode(o):(o-=65536,i+=String.fromCharCode((o>>10)+55296,(o&(1<<10)-1)+56320))}return i}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+YP}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=qP)throw new Error("FlatBuffers: file identifier must be length "+qP);for(let t=0;t<qP;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+YP+t))return!1;return!0}createScalarList(e,t){const r=[];for(let i=0;i<t;++i)e(i)!==null&&r.push(e(i));return r}createObjList(e,t){const r=[];for(let i=0;i<t;++i){const a=e(i);a!==null&&r.push(a.unpack())}return r}}class gf{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsGeometry(e,t){return(t||new gf).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGeometry(e,t){return e.setPosition(e.position()+iF),(t||new gf).__init(e.readInt32(e.position())+e.position(),e)}ends(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+e*4):0}endsLength(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}endsArray(){const e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}xy(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+e*8):0}xyLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}xyArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}z(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+e*8):0}zLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}zArray(){const e=this.bb.__offset(this.bb_pos,8);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}m(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+e*8):0}mLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}mArray(){const e=this.bb.__offset(this.bb_pos,10);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}t(e){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+e*8):0}tLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}tArray(){const e=this.bb.__offset(this.bb_pos,12);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}tm(e){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}tmLength(){const e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}type(){const e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readUint8(this.bb_pos+e):Dh.Unknown}parts(e,t){const r=this.bb.__offset(this.bb_pos,18);return r?(t||new gf).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}partsLength(){const e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGeometry(e){e.startObject(8)}static addEnds(e,t){e.addFieldOffset(0,t,0)}static createEndsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addInt32(t[r]);return e.endVector()}static startEndsVector(e,t){e.startVector(4,t,4)}static addXy(e,t){e.addFieldOffset(1,t,0)}static createXyVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startXyVector(e,t){e.startVector(8,t,8)}static addZ(e,t){e.addFieldOffset(2,t,0)}static createZVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startZVector(e,t){e.startVector(8,t,8)}static addM(e,t){e.addFieldOffset(3,t,0)}static createMVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startMVector(e,t){e.startVector(8,t,8)}static addT(e,t){e.addFieldOffset(4,t,0)}static createTVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startTVector(e,t){e.startVector(8,t,8)}static addTm(e,t){e.addFieldOffset(5,t,0)}static createTmVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}static startTmVector(e,t){e.startVector(8,t,8)}static addType(e,t){e.addFieldInt8(6,t,Dh.Unknown)}static addParts(e,t){e.addFieldOffset(7,t,0)}static createPartsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startPartsVector(e,t){e.startVector(4,t,4)}static endGeometry(e){return e.endObject()}static createGeometry(e,t,r,i,a,o,s,l,u){return gf.startGeometry(e),gf.addEnds(e,t),gf.addXy(e,r),gf.addZ(e,i),gf.addM(e,a),gf.addT(e,o),gf.addTm(e,s),gf.addType(e,l),gf.addParts(e,u),gf.endGeometry(e)}}function Jre(n,e){const t=[];for(let r=0;r<n.length;r+=2){const i=[n[r],n[r+1]];e&&i.push(e[r>>1]),t.push(i)}return t}function tPe(n,e,t){if(!t||t.length===0)return[Jre(n,e)];let r=0;const i=Array.from(t).map(o=>n.slice(r,r=o<<1));let a;return e&&(r=0,a=Array.from(t).map(o=>e.slice(r,r=o))),i.map((o,s)=>Jre(o,a?a[s]:void 0))}function gVr(n,e){const t=n.xyArray(),r=n.zArray();switch(e){case Dh.Point:{const i=Array.from(t);return r&&i.push(r[0]),i}case Dh.MultiPoint:case Dh.LineString:return Jre(t,r);case Dh.MultiLineString:return tPe(t,r,n.endsArray());case Dh.Polygon:return tPe(t,r,n.endsArray())}}function Qre(n,e){let t=e;if(t===Dh.Unknown&&(t=n.type()),t===Dh.GeometryCollection){const i=[];for(let a=0;a<n.partsLength();a++){const o=n.parts(a),s=o.type();i.push(Qre(o,s))}return{type:Dh[t],geometries:i}}else if(t===Dh.MultiPolygon){const i=[];for(let a=0;a<n.partsLength();a++)i.push(Qre(n.parts(a),Dh.Polygon));return{type:Dh[t],coordinates:i.map(a=>a.coordinates)}}const r=gVr(n,t);return{type:Dh[t],coordinates:r}}var Ch;(function(n){n[n.Byte=0]="Byte",n[n.UByte=1]="UByte",n[n.Bool=2]="Bool",n[n.Short=3]="Short",n[n.UShort=4]="UShort",n[n.Int=5]="Int",n[n.UInt=6]="UInt",n[n.Long=7]="Long",n[n.ULong=8]="ULong",n[n.Float=9]="Float",n[n.Double=10]="Double",n[n.String=11]="String",n[n.Json=12]="Json",n[n.DateTime=13]="DateTime",n[n.Binary=14]="Binary"})(Ch||(Ch={}));class Th{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsColumn(e,t){return(t||new Th).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsColumn(e,t){return e.setPosition(e.position()+iF),(t||new Th).__init(e.readInt32(e.position())+e.position(),e)}name(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}type(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):Ch.Byte}title(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}description(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}width(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt32(this.bb_pos+e):-1}precision(){const e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt32(this.bb_pos+e):-1}scale(){const e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):-1}nullable(){const e=this.bb.__offset(this.bb_pos,18);return e?!!this.bb.readInt8(this.bb_pos+e):!0}unique(){const e=this.bb.__offset(this.bb_pos,20);return e?!!this.bb.readInt8(this.bb_pos+e):!1}primaryKey(){const e=this.bb.__offset(this.bb_pos,22);return e?!!this.bb.readInt8(this.bb_pos+e):!1}metadata(e){const t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__string(this.bb_pos+t,e):null}static startColumn(e){e.startObject(11)}static addName(e,t){e.addFieldOffset(0,t,0)}static addType(e,t){e.addFieldInt8(1,t,Ch.Byte)}static addTitle(e,t){e.addFieldOffset(2,t,0)}static addDescription(e,t){e.addFieldOffset(3,t,0)}static addWidth(e,t){e.addFieldInt32(4,t,-1)}static addPrecision(e,t){e.addFieldInt32(5,t,-1)}static addScale(e,t){e.addFieldInt32(6,t,-1)}static addNullable(e,t){e.addFieldInt8(7,+t,1)}static addUnique(e,t){e.addFieldInt8(8,+t,0)}static addPrimaryKey(e,t){e.addFieldInt8(9,+t,0)}static addMetadata(e,t){e.addFieldOffset(10,t,0)}static endColumn(e){const t=e.endObject();return e.requiredField(t,4),t}static createColumn(e,t,r,i,a,o,s,l,u,h,c,f){return Th.startColumn(e),Th.addName(e,t),Th.addType(e,r),Th.addTitle(e,i),Th.addDescription(e,a),Th.addWidth(e,o),Th.addPrecision(e,s),Th.addScale(e,l),Th.addNullable(e,u),Th.addUnique(e,h),Th.addPrimaryKey(e,c),Th.addMetadata(e,f),Th.endColumn(e)}}class $g{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFeature(e,t){return(t||new $g).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFeature(e,t){return e.setPosition(e.position()+iF),(t||new $g).__init(e.readInt32(e.position())+e.position(),e)}geometry(e){const t=this.bb.__offset(this.bb_pos,4);return t?(e||new gf).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}properties(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}propertiesLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}propertiesArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}columns(e,t){const r=this.bb.__offset(this.bb_pos,8);return r?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}columnsLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFeature(e){e.startObject(3)}static addGeometry(e,t){e.addFieldOffset(0,t,0)}static addProperties(e,t){e.addFieldOffset(1,t,0)}static createPropertiesVector(e,t){e.startVector(1,t.length,1);for(let r=t.length-1;r>=0;r--)e.addInt8(t[r]);return e.endVector()}static startPropertiesVector(e,t){e.startVector(1,t,1)}static addColumns(e,t){e.addFieldOffset(2,t,0)}static createColumnsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startColumnsVector(e,t){e.startVector(4,t,4)}static endFeature(e){return e.endObject()}static finishFeatureBuffer(e,t){e.finish(t)}static finishSizePrefixedFeatureBuffer(e,t){e.finish(t,void 0,!0)}static createFeature(e,t,r,i){return $g.startFeature(e),$g.addGeometry(e,t),$g.addProperties(e,r),$g.addColumns(e,i),$g.endFeature(e)}}new TextEncoder;const rPe=new TextDecoder;function yVr(n,e){const t={};if(!e||e.length===0)return t;const r=n.propertiesArray();if(!r)return t;const i=new DataView(r.buffer,r.byteOffset),a=n.propertiesLength();let o=0;for(;o<a;){const s=i.getUint16(o,!0);o+=2;const l=e[s],u=l.name;switch(l.type){case Ch.Bool:{t[u]=!!i.getUint8(o),o+=1;break}case Ch.Byte:{t[u]=i.getInt8(o),o+=1;break}case Ch.UByte:{t[u]=i.getUint8(o),o+=1;break}case Ch.Short:{t[u]=i.getInt16(o,!0),o+=2;break}case Ch.UShort:{t[u]=i.getUint16(o,!0),o+=2;break}case Ch.Int:{t[u]=i.getInt32(o,!0),o+=4;break}case Ch.UInt:{t[u]=i.getUint32(o,!0),o+=4;break}case Ch.Long:{t[u]=Number(i.getBigInt64(o,!0)),o+=8;break}case Ch.ULong:{t[u]=Number(i.getBigUint64(o,!0)),o+=8;break}case Ch.Float:{t[u]=i.getFloat32(o,!0),o+=4;break}case Ch.Double:{t[u]=i.getFloat64(o,!0),o+=8;break}case Ch.DateTime:case Ch.String:{const h=i.getUint32(o,!0);o+=4,t[u]=rPe.decode(r.subarray(o,o+h)),o+=h;break}case Ch.Json:{const h=i.getUint32(o,!0);o+=4;const c=rPe.decode(r.subarray(o,o+h));t[u]=JSON.parse(c),o+=h;break}default:throw new Error("Unknown type "+l.type)}}return t}function Fce(n,e){const t=e.columns;return{type:"Feature",geometry:Qre(n.geometry(),e.geometryType),properties:yVr(n,t)}}const Bce=new Uint8Array(0);function mVr(){return this._source.cancel()}function _Vr(n,e){if(!n.length)return e;if(!e.length)return n;var t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function xVr(){var n=this,e=n._array.subarray(n._index);return n._source.read().then(function(t){return n._array=Bce,n._index=0,t.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:_Vr(e,t.value)}})}function SVr(n){if((n|=0)<0)throw new Error("invalid length");var e=this,t=this._array.length-this._index;if(this._index+n<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=n));var r=new Uint8Array(n);return r.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(a){return a.done?(e._array=Bce,e._index=0,t>0?r.subarray(0,t):null):t+a.value.length>=n?(e._array=a.value,e._index=n-t,r.set(a.value.subarray(0,n-t),t),r):(r.set(a.value,t),t+=a.value.length,i())})}()}function wVr(n){return typeof n.slice=="function"?n:new U$(typeof n.read=="function"?n:n.getReader())}function U$(n){this._source=n,this._array=Bce,this._index=0}U$.prototype.read=xVr;U$.prototype.slice=SVr;U$.prototype.cancel=mVr;class op{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsCrs(e,t){return(t||new op).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsCrs(e,t){return e.setPosition(e.position()+iF),(t||new op).__init(e.readInt32(e.position())+e.position(),e)}org(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}code(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}name(e){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}description(e){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}wkt(e){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}codeString(e){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}static startCrs(e){e.startObject(6)}static addOrg(e,t){e.addFieldOffset(0,t,0)}static addCode(e,t){e.addFieldInt32(1,t,0)}static addName(e,t){e.addFieldOffset(2,t,0)}static addDescription(e,t){e.addFieldOffset(3,t,0)}static addWkt(e,t){e.addFieldOffset(4,t,0)}static addCodeString(e,t){e.addFieldOffset(5,t,0)}static endCrs(e){return e.endObject()}static createCrs(e,t,r,i,a,o,s){return op.startCrs(e),op.addOrg(e,t),op.addCode(e,r),op.addName(e,i),op.addDescription(e,a),op.addWkt(e,o),op.addCodeString(e,s),op.endCrs(e)}}class Q7{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsHeader(e,t){return(t||new Q7).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsHeader(e,t){return e.setPosition(e.position()+iF),(t||new Q7).__init(e.readInt32(e.position())+e.position(),e)}name(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}envelope(e){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+e*8):0}envelopeLength(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}envelopeArray(){const e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}geometryType(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Dh.Unknown}hasZ(){const e=this.bb.__offset(this.bb_pos,10);return e?!!this.bb.readInt8(this.bb_pos+e):!1}hasM(){const e=this.bb.__offset(this.bb_pos,12);return e?!!this.bb.readInt8(this.bb_pos+e):!1}hasT(){const e=this.bb.__offset(this.bb_pos,14);return e?!!this.bb.readInt8(this.bb_pos+e):!1}hasTm(){const e=this.bb.__offset(this.bb_pos,16);return e?!!this.bb.readInt8(this.bb_pos+e):!1}columns(e,t){const r=this.bb.__offset(this.bb_pos,18);return r?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}columnsLength(){const e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}featuresCount(){const e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}indexNodeSize(){const e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}crs(e){const t=this.bb.__offset(this.bb_pos,24);return t?(e||new op).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}title(e){const t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__string(this.bb_pos+t,e):null}description(e){const t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__string(this.bb_pos+t,e):null}metadata(e){const t=this.bb.__offset(this.bb_pos,30);return t?this.bb.__string(this.bb_pos+t,e):null}static startHeader(e){e.startObject(14)}static addName(e,t){e.addFieldOffset(0,t,0)}static addEnvelope(e,t){e.addFieldOffset(1,t,0)}static createEnvelopeVector(e,t){e.startVector(8,t.length,8);for(let r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}static startEnvelopeVector(e,t){e.startVector(8,t,8)}static addGeometryType(e,t){e.addFieldInt8(2,t,Dh.Unknown)}static addHasZ(e,t){e.addFieldInt8(3,+t,0)}static addHasM(e,t){e.addFieldInt8(4,+t,0)}static addHasT(e,t){e.addFieldInt8(5,+t,0)}static addHasTm(e,t){e.addFieldInt8(6,+t,0)}static addColumns(e,t){e.addFieldOffset(7,t,0)}static createColumnsVector(e,t){e.startVector(4,t.length,4);for(let r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}static startColumnsVector(e,t){e.startVector(4,t,4)}static addFeaturesCount(e,t){e.addFieldInt64(8,t,BigInt("0"))}static addIndexNodeSize(e,t){e.addFieldInt16(9,t,16)}static addCrs(e,t){e.addFieldOffset(10,t,0)}static addTitle(e,t){e.addFieldOffset(11,t,0)}static addDescription(e,t){e.addFieldOffset(12,t,0)}static addMetadata(e,t){e.addFieldOffset(13,t,0)}static endHeader(e){return e.endObject()}static finishHeaderBuffer(e,t){e.finish(t)}static finishSizePrefixedHeaderBuffer(e,t){e.finish(t,void 0,!0)}}function Gce(n){const e=Q7.getRootAsHeader(n),t=e.featuresCount(),r=e.indexNodeSize(),i=[];for(let l=0;l<e.columnsLength();l++){const u=e.columns(l);if(!u)throw new Error("Column unexpectedly missing");if(!u.name())throw new Error("Column name unexpectedly missing");i.push({name:u.name(),type:u.type(),title:u.title(),description:u.description(),width:u.width(),precision:u.precision(),scale:u.scale(),nullable:u.nullable(),unique:u.unique(),primary_key:u.primaryKey()})}const a=e.crs(),o=a?{org:a.org(),code:a.code(),name:a.name(),description:a.description(),wkt:a.wkt(),code_string:a.codeString()}:null;return{geometryType:e.geometryType(),columns:i,envelope:null,featuresCount:Number(t),indexNodeSize:r,crs:o,title:e.title(),description:e.description(),metadata:e.metadata()}}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ene=function(n,e){return ene=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},ene(n,e)};function bVr(n,e){ene(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function SI(n,e,t,r){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(h){try{u(r.next(h))}catch(c){o(c)}}function l(h){try{u(r.throw(h))}catch(c){o(c)}}function u(h){h.done?a(h.value):i(h.value).then(s,l)}u((r=r.apply(n,e||[])).next())})}function yw(n,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(h){return l([u,h])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(h){u=[6,h],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function SL(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function YN(n){return this instanceof YN?(this.v=n,this):new YN(n)}function EVr(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(d){return new Promise(function(v,p){a.push([f,d,v,p])>1||s(f,d)})})}function s(f,d){try{l(r[f](d))}catch(v){c(a[0][3],v)}}function l(f){f.value instanceof YN?Promise.resolve(f.value.v).then(u,h):c(a[0][2],f)}function u(f){s("next",f)}function h(f){s("throw",f)}function c(f,d){f(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}var mQe=function(n){bVr(e,n);function e(t){var r=n.call(this,t)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(r,r.constructor),r}return e}(Error);(function(){function n(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(n.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),n.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},n.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},n})();(function(){function n(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(n.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},n.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},n})();(function(){function n(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(n.prototype,"empty",{get:function(){return this._q.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.add=function(e){this._q.length<this._c&&this._q.push(e)},n.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},n})();function tne(n){n!=null&&typeof n.then=="function"&&n.then(rz,rz)}var LZ=0,nPe=1,U2=2,ez=3,rne=4,tz=1024,rz=function(){};function lM(n){var e=n.err,t=Promise.resolve(n.execution).then(function(r){if(e!=null)throw e;return r});return n.err=void 0,n.execution=t.then(function(){},function(){}),n.pending===void 0?t:n.pending.then(function(){return t})}function Jb(n,e){var t=n.state>=ez;return Promise.resolve(e).then(function(r){return!t&&n.state>=rne?lM(n).then(function(i){return{value:i,done:!0}}):{value:r,done:t}})}function zce(n,e){var t,r;if(!(n.state>=U2))if(n.state=U2,n.onnext(),n.onstop(),n.err==null&&(n.err=e),n.pushes.length===0&&(typeof n.buffer>"u"||n.buffer.empty))kR(n);else try{for(var i=SL(n.pushes),a=i.next();!a.done;a=i.next()){var o=a.value;o.resolve()}}catch(s){t={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}function kR(n){var e,t;if(!(n.state>=ez)){n.state<U2&&zce(n),n.state=ez,n.buffer=void 0;try{for(var r=SL(n.nexts),i=r.next();!i.done;i=r.next()){var a=i.value,o=n.pending===void 0?lM(n):n.pending.then(function(){return lM(n)});a.resolve(Jb(n,o))}}catch(s){e={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}n.pushes=[],n.nexts=[]}}function iPe(n){n.state>=rne||(n.state<ez&&kR(n),n.state=rne)}function TVr(n,e){if(tne(e),n.pushes.length>=tz)throw new mQe("No more than "+tz+" pending calls to push are allowed on a single repeater.");if(n.state>=U2)return Promise.resolve(void 0);var t=n.pending===void 0?Promise.resolve(e):n.pending.then(function(){return e});t=t.catch(function(l){n.state<U2&&(n.err=l),iPe(n)});var r;if(n.nexts.length){var i=n.nexts.shift();i.resolve(Jb(n,t)),n.nexts.length?r=Promise.resolve(n.nexts[0].value):r=new Promise(function(l){return n.onnext=l})}else typeof n.buffer<"u"&&!n.buffer.full?(n.buffer.add(t),r=Promise.resolve(void 0)):r=new Promise(function(l){return n.pushes.push({resolve:l,value:t})});var a=!0,o={},s=r.catch(function(l){if(a)throw l});return o.then=function(l,u){return a=!1,Promise.prototype.then.call(r,l,u)},o.catch=function(l){return a=!1,Promise.prototype.catch.call(r,l)},o.finally=r.finally.bind(r),n.pending=t.then(function(){return s}).catch(function(l){n.err=l,iPe(n)}),o}function CVr(n){var e=zce.bind(null,n),t=new Promise(function(r){return n.onstop=r});return e.then=t.then.bind(t),e.catch=t.catch.bind(t),e.finally=t.finally.bind(t),e}function AVr(n){if(!(n.state>=nPe)){n.state=nPe;var e=TVr.bind(null,n),t=CVr(n);n.execution=new Promise(function(r){return r(n.executor(e,t))}),n.execution.catch(function(){return zce(n)})}}var Z6=new WeakMap,aF=function(){function n(e,t){Z6.set(this,{executor:e,buffer:t,err:void 0,state:LZ,pushes:[],nexts:[],pending:void 0,execution:void 0,onnext:rz,onstop:rz})}return n.prototype.next=function(e){tne(e);var t=Z6.get(this);if(t===void 0)throw new Error("WeakMap error");if(t.nexts.length>=tz)throw new mQe("No more than "+tz+" pending calls to next are allowed on a single repeater.");if(t.state<=LZ&&AVr(t),t.onnext(e),typeof t.buffer<"u"&&!t.buffer.empty){var r=Jb(t,t.buffer.remove());if(t.pushes.length){var i=t.pushes.shift();t.buffer.add(i.value),t.onnext=i.resolve}return r}else if(t.pushes.length){var a=t.pushes.shift();return t.onnext=a.resolve,Jb(t,a.value)}else if(t.state>=U2)return kR(t),Jb(t,lM(t));return new Promise(function(o){return t.nexts.push({resolve:o,value:e})})},n.prototype.return=function(e){tne(e);var t=Z6.get(this);if(t===void 0)throw new Error("WeakMap error");return kR(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),Jb(t,lM(t))},n.prototype.throw=function(e){var t=Z6.get(this);if(t===void 0)throw new Error("WeakMap error");return t.state<=LZ||t.state>=U2||typeof t.buffer<"u"&&!t.buffer.empty?(kR(t),t.err==null&&(t.err=e),Jb(t,lM(t))):this.next(Promise.reject(e))},n.prototype[Symbol.asyncIterator]=function(){return this},n.race=MVr,n.merge=IVr,n.zip=LVr,n.latest=PVr,n}();function V$(n,e){var t,r,i=[],a=function(u){u!=null&&typeof u[Symbol.asyncIterator]=="function"?i.push(u[Symbol.asyncIterator]()):u!=null&&typeof u[Symbol.iterator]=="function"?i.push(u[Symbol.iterator]()):i.push(function(){return EVr(this,arguments,function(){return yw(this,function(f){switch(f.label){case 0:return e.yieldValues?[4,YN(u)]:[3,3];case 1:return[4,f.sent()];case 2:f.sent(),f.label=3;case 3:return e.returnValues?[4,YN(u)]:[3,5];case 4:return[2,f.sent()];case 5:return[2]}})})}())};try{for(var o=SL(n),s=o.next();!s.done;s=o.next()){var l=s.value;a(l)}}catch(u){t={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}function MVr(n){var e=this,t=V$(n,{returnValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l,u,h;return yw(this,function(c){switch(c.label){case 0:if(!t.length)return i(),[2];o=!1,i.then(function(){a(),o=!0}),c.label=1;case 1:c.trys.push([1,,5,7]),l=void 0,u=0,h=function(){var f,d,v,p,g,m;return yw(this,function(y){switch(y.label){case 0:f=u;try{for(d=(g=void 0,SL(t)),v=d.next();!v.done;v=d.next())p=v.value,Promise.resolve(p.next()).then(function(_){_.done?(i(),s===void 0&&(s=_)):u===f&&(u++,a(_))},function(_){return i(_)})}catch(_){g={error:_}}finally{try{v&&!v.done&&(m=d.return)&&m.call(d)}finally{if(g)throw g.error}}return[4,new Promise(function(_){return a=_})];case 1:return l=y.sent(),l===void 0?[3,3]:[4,r(l.value)];case 2:y.sent(),y.label=3;case 3:return[2]}})},c.label=2;case 2:return o?[3,4]:[5,h()];case 3:return c.sent(),[3,2];case 4:return[2,s&&s.value];case 5:return i(),[4,Promise.race(t.map(function(f){return f.return&&f.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}function IVr(n){var e=this,t=V$(n,{yieldValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l=this;return yw(this,function(u){switch(u.label){case 0:if(!t.length)return i(),[2];a=[],o=!1,i.then(function(){var h,c;o=!0;try{for(var f=SL(a),d=f.next();!d.done;d=f.next()){var v=d.value;v()}}catch(p){h={error:p}}finally{try{d&&!d.done&&(c=f.return)&&c.call(f)}finally{if(h)throw h.error}}}),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,Promise.all(t.map(function(h,c){return SI(l,void 0,void 0,function(){var f,d;return yw(this,function(v){switch(v.label){case 0:v.trys.push([0,,6,9]),v.label=1;case 1:return o?[3,5]:(Promise.resolve(h.next()).then(function(p){return a[c](p)},function(p){return i(p)}),[4,new Promise(function(p){a[c]=p})]);case 2:return f=v.sent(),f===void 0?[3,4]:f.done?(s=f,[2]):[4,r(f.value)];case 3:v.sent(),v.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return d=h.return,d?[4,h.return()]:[3,8];case 7:d=v.sent(),v.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return u.sent(),[2,s&&s.value];case 3:return i(),[7];case 4:return[2]}})})})}function LVr(n){var e=this,t=V$(n,{returnValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l;return yw(this,function(u){switch(u.label){case 0:if(!t.length)return i(),[2,[]];o=!1,i.then(function(){a(),o=!0}),u.label=1;case 1:u.trys.push([1,,6,8]),u.label=2;case 2:return o?[3,5]:(Promise.all(t.map(function(h){return h.next()})).then(function(h){return a(h)},function(h){return i(h)}),[4,new Promise(function(h){return a=h})]);case 3:return s=u.sent(),s===void 0?[2]:(l=s.map(function(h){return h.value}),s.some(function(h){return h.done})?[2,l]:[4,r(l)]);case 4:return u.sent(),[3,2];case 5:return[3,8];case 6:return i(),[4,Promise.all(t.map(function(h){return h.return&&h.return()}))];case 7:return u.sent(),[7];case 8:return[2]}})})})}function PVr(n){var e=this,t=V$(n,{yieldValues:!0,returnValues:!0});return new aF(function(r,i){return SI(e,void 0,void 0,function(){var a,o,s,l,u,h=this;return yw(this,function(c){switch(c.label){case 0:if(!t.length)return i(),[2,[]];o=[],s=!1,i.then(function(){var f,d;a();try{for(var v=SL(o),p=v.next();!p.done;p=v.next()){var g=p.value;g()}}catch(m){f={error:m}}finally{try{p&&!p.done&&(d=v.return)&&d.call(v)}finally{if(f)throw f.error}}s=!0}),c.label=1;case 1:return c.trys.push([1,,5,7]),Promise.all(t.map(function(f){return f.next()})).then(function(f){return a(f)},function(f){return i(f)}),[4,new Promise(function(f){return a=f})];case 2:return l=c.sent(),l===void 0?[2]:(u=l.map(function(f){return f.value}),l.every(function(f){return f.done})?[2,u]:[4,r(u.slice())]);case 3:return c.sent(),[4,Promise.all(t.map(function(f,d){return SI(h,void 0,void 0,function(){var v;return yw(this,function(p){switch(p.label){case 0:if(l[d].done)return[2,l[d].value];p.label=1;case 1:return s?[3,4]:(Promise.resolve(f.next()).then(function(g){return o[d](g)},function(g){return i(g)}),[4,new Promise(function(g){return o[d]=g})]);case 2:return v=p.sent(),v===void 0?[2,l[d].value]:v.done?[2,v.value]:(u[d]=v.value,[4,r(u.slice())]);case 3:return p.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,c.sent()];case 5:return i(),[4,Promise.all(t.map(function(f){return f.return&&f.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}class qN{constructor(){this._extraRequestThreshold=256*1024}extraRequestThreshold(){return this._extraRequestThreshold}setExtraRequestThreshold(e){if(e<0)throw new Error("extraRequestThreshold cannot be negative");this._extraRequestThreshold=e}}qN.global=new qN;var Ug;(function(n){n[n.Debug=0]="Debug",n[n.Info=1]="Info",n[n.Warn=2]="Warn",n[n.Error=3]="Error"})(Ug||(Ug={}));class Nh{static debug(...e){this.log(Ug.Debug,...e)}static info(...e){this.log(Ug.Info,...e)}static warn(...e){this.log(Ug.Warn,...e)}static error(...e){this.log(Ug.Error,...e)}static log(e,...t){if(!(this.logLevel>e))switch(e){case Ug.Debug:{console.debug(...t);break}case Ug.Info:{console.info(...t);break}case Ug.Warn:{console.warn(...t);break}case Ug.Error:{console.error(...t);break}}}}Nh.logLevel=Ug.Info;const FR=8*4+8,OVr=16;function Uce(n,e){e=Math.min(Math.max(+e,2),65535);let t=n,r=t;do t=Math.ceil(t/e),r+=t;while(t!==1);return r*FR}function RVr(n,e){if(e<2)throw new Error("Node size must be at least 2");if(n===0)throw new Error("Number of items must be greater than 0");let t=n,r=t;const i=[t];do t=Math.ceil(t/e),r+=t,i.push(t);while(t!==1);const a=[];t=r;for(const s of i)a.push(t-s),t-=s;a.reverse(),i.reverse();const o=[];for(let s=0;s<i.length;s++)o.push([a[s],a[s]+i[s]]);return o.reverse(),o}async function*DVr(n,e,t,r){class i{constructor(v,p){this._level=p,this.nodes=v}level(){return this._level}startNode(){return this.nodes[0]}endNode(){return this.nodes[1]}extendEndNodeToNewOffset(v){console.assert(v>this.nodes[1]),this.nodes[1]=v}toString(){return`[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`}}const{minX:a,minY:o,maxX:s,maxY:l}=t;Nh.info(`tree items: ${n}, nodeSize: ${e}`);const u=RVr(n,e),h=u[0][0],f=[(()=>{const d=[0,1],v=u.length-1;return new i(d,v)})()];for(Nh.debug(`starting stream search with queue: ${f}, numItems: ${n}, nodeSize: ${e}, levelBounds: ${u}`);f.length!=0;){const d=f.shift();Nh.debug(`popped node: ${d}, queueLength: ${f.length}`);const v=d.startNode(),p=v>=h,[,g]=u[d.level()],m=Math.min(d.endNode()+e,g),y=m-v,_=await r(v*FR,y*FR),x=new Float64Array(_),S=new Uint32Array(_);for(let w=v;w<m;w++){const b=(w-v)*5;if(s<x[b+0]||l<x[b+1]||a>x[b+2]||o>x[b+3])continue;const E=S[(b<<1)+8],T=S[(b<<1)+9],C=aPe(T,E);if(p){const R=(()=>{if(w<n-1){const k=(w-v+1)*5,D=S[(k<<1)+8],G=S[(k<<1)+9];return aPe(G,D)-C}else return null})();yield[C,w-h,R];continue}const A=qN.global.extraRequestThreshold()/FR,M=f[f.length-1];if(M!==void 0&&M.level()==d.level()-1&&C<M.endNode()+A){Nh.debug(`Merging "nodeRange" request into existing range: ${M}, newOffset: ${M.endNode()} -> ${C}`),M.extendEndNodeToNewOffset(C);continue}const I=(()=>{const R=d.level()-1,k=[C,C+1];return new i(k,R)})();M!==void 0&&M.level()==I.level()?Nh.info(`Same level, but too far away. Pushing new request at offset: ${C} rather than merging with distant ${M}`):Nh.info(`Pushing new level for ${I} onto queue with nearestNodeRange: ${M} since there's not already a range for this level.`),f.push(I)}}}function aPe(n,e){if((n&4293918720)!=0)throw Error("integer is too large to be safely represented");return e+n*2**32}const vS=new Uint8Array([102,103,98,3,102,103,98,0]),U1=4;class Vce{constructor(e,t,r,i){this.headerClient=e,this.header=t,this.headerLength=r,this.indexLength=i}static async open(e){const r=new oPe(e),i=(()=>{const c=OVr,f=3;let d=0,v;for(v=0;v<f;v++){const p=c**v*FR;d+=p}return d})(),a=2024+i;Nh.debug(`fetching header. minReqLength: ${a} (assumedHeaderLength: ${2024}, assumedIndexLength: ${i})`);{const c=new Uint8Array(await r.getRange(0,8,a,"header"));if(!c.subarray(0,3).every((f,d)=>vS[d]===f))throw Nh.error(`bytes: ${c} != ${vS}`),new Error("Not a FlatGeobuf file");Nh.debug("magic bytes look good")}let o;{const c=await r.getRange(8,4,a,"header");o=new DataView(c).getUint32(0,!0);const f=1048576*10;if(o>f||o<8)throw new Error("Invalid header size");Nh.debug(`headerLength: ${o}`)}const s=await r.getRange(12,o,a,"header"),l=new L_(new Uint8Array(s)),u=Gce(l),h=Uce(u.featuresCount,u.indexNodeSize);return Nh.debug("completed: opening http reader"),new Vce(r,u,o,h)}async*selectBbox(e){const t=this.lengthBeforeTree(),r=this.headerClient,i=async function(l,u){return r.getRange(t+l,u,0,"index")},a=[];let o=[];for await(const l of DVr(this.header.featuresCount,this.header.indexNodeSize,e,i)){const[u,,]=l;let[,,h]=l;if(h||(Nh.info("final feature"),h=qN.global.extraRequestThreshold()),o.length==0){o.push([u,h]);continue}const c=o[o.length-1],f=u-(c[0]+c[1]);f>qN.global.extraRequestThreshold()&&(Nh.info(`Pushing new feature batch, since gap ${f} was too large`),a.push(o),o=[]),o.push([u,h])}this.headerClient.logUsage("header+index"),o.length>0&&a.push(o);const s=a.flatMap(l=>this.readFeatureBatch(l));yield*aF.merge(s)}lengthBeforeTree(){return vS.length+U1+this.headerLength}lengthBeforeFeatures(){return this.lengthBeforeTree()+this.indexLength}buildFeatureClient(){return new oPe(this.headerClient.httpClient)}async*readFeatureBatch(e){const[t]=e[0],[r,i]=e[e.length-1],a=t,s=r+i-a,l=this.buildFeatureClient();for(const[u]of e)yield await this.readFeature(l,u,s);l.logUsage("feature")}async readFeature(e,t,r){const i=t+this.lengthBeforeFeatures();let a;{const h=await e.getRange(i,4,r,"feature length");a=new DataView(h).getUint32(0,!0)}const o=await e.getRange(i+4,a,r,"feature data"),s=new Uint8Array(o),l=new Uint8Array(a+U1);l.set(s,U1);const u=new L_(l);return u.setPosition(U1),$g.getRootAsFeature(u)}}class oPe{constructor(e){this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,typeof e=="string"?this.httpClient=new NVr(e):this.httpClient=e}async getRange(e,t,r,i){this.bytesEverUsed+=t;const a=e-this.head,o=a+t;if(a>=0&&o<=this.buffer.byteLength)return this.buffer.slice(a,o);const s=Math.max(t,r);return this.bytesEverFetched+=s,Nh.debug(`requesting for new Range: ${e}-${e+t-1}`),this.buffer=await this.httpClient.getRange(e,s,i),this.head=e,this.buffer.slice(0,t)}logUsage(e){const t=e.split(" ")[0],r=this.bytesEverUsed,i=this.bytesEverFetched,a=(100*r/i).toFixed(2);Nh.info(`${t} bytes used/requested: ${r} / ${i} = ${a}%`)}}class NVr{constructor(e){this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e}async getRange(e,t,r){this.requestsEverMade+=1,this.bytesEverRequested+=t;const i=`bytes=${e}-${e+t-1}`;return Nh.info(`request: #${this.requestsEverMade}, purpose: ${r}), bytes: (this_request: ${t}, ever: ${this.bytesEverRequested}), Range: ${i}`),(await fetch(this.url,{headers:{Range:i}})).arrayBuffer()}}function kVr(n,e,t){if(!n.subarray(0,3).every((h,c)=>vS[c]===h))throw new Error("Not a FlatGeobuf file");const r=new L_(n),i=r.readUint32(vS.length);r.setPosition(vS.length+U1);const a=Gce(r);t&&t(a);let o=vS.length+U1+i;const{indexNodeSize:s,featuresCount:l}=a;s>0&&(o+=Uce(l,s));const u=[];for(;o<r.capacity();){const h=r.readUint32(o);r.setPosition(o+U1);const c=$g.getRootAsFeature(r);u.push(e(c,a)),o+=U1+h}return u}async function*FVr(n,e,t){const r=wVr(n),i=async f=>await r.slice(f);let a=new Uint8Array(await i(8));if(!a.subarray(0,3).every((f,d)=>vS[d]===f))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await i(4));let o=new L_(a);const s=o.readUint32(0);a=new Uint8Array(await i(s)),o=new L_(a);const l=Gce(o);t&&t(l);const{indexNodeSize:u,featuresCount:h}=l;if(u>0){const f=Uce(h,u);await i(f)}let c;for(;c=await GVr(i,l,e);)yield c}async function*BVr(n,e,t,r){const i=await Vce.open(n);Nh.debug("opened reader"),r&&r(i.header);for await(const a of i.selectBbox(e))yield t(a,i.header)}async function GVr(n,e,t){let r=new Uint8Array(await n(4,"feature length"));if(r.byteLength===0)return;let i=new L_(r);const a=i.readUint32(0);r=new Uint8Array(await n(a,"feature data"));const o=new Uint8Array(a+4);o.set(r,4),i=new L_(o),i.setPosition(U1);const s=$g.getRootAsFeature(i);return t(s,e)}function zVr(n,e){return{type:"FeatureCollection",features:kVr(n,Fce,e)}}function UVr(n,e){return FVr(n,Fce,e)}function VVr(n,e,t){return BVr(n,e,Fce,t)}function $Vr(n,e,t){return n instanceof Uint8Array?zVr(n,t):n instanceof ReadableStream?UVr(n,t):VVr(n,e,t)}class WVr extends _f{constructor(e){const t=Object.assign({strategy:uTe},e);delete t.url,delete t.extent,delete t.idField,super(t),this.options=e||{},this.strategy=t.strategy,this.url=this.options.url,this.extent=this.options.extent,this._idField=this.options.idField||"SmID",this._validatedId=!1,this._checked=!1,this.setLoader(async function(r){if(this.strategy===uTe&&(this._validatedId||this.clear(),this.extent)){const a=Bot(this.extent,r);r=a&&a.length?a:this.extent}!this.extent&&(this.strategy===oXe||!isFinite(r[0]))&&(r=[]);let i;Object.keys(r).length||(i=await this._getStream(this.url)),this._handleFeatures(i&&i.body||this.url,r)})}async _handleFeatures(e,t){let r={};t&&t.length&&(r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]});const i=$Vr(e,r);for await(let a of i){let o=a.properties[this._idField];o&&!this._validatedId&&(this._validatedId=!0,this._checked=!0),a=new jc().readFeature(a),o&&this._checked&&a.setId(o),this.options.featureLoader&&typeof this.options.featureLoader=="function"&&(a=this.options.featureLoader(a)),this.addFeature(a)}}async _getStream(e){return await li.get(e,{},{withoutFormatSuffix:!0}).then(function(t){return t})}}class _Qe extends _l{constructor(e,t){super(e,t),this._knowledgeGraphService=new Eot(e,t)}query(e,t){return this._knowledgeGraphService.query(e,t)}getGraphMaps(e){return this._knowledgeGraphService.getGraphMaps(e)}getGraphMap(e,t){return this._knowledgeGraphService.getGraphMap(e,t)}async getGraphMapData(e){return await this._knowledgeGraphService.getGraphMapData(e)}}class HVr extends fT{constructor(e,t){super(),this.graph=null,this.EVENT_TYPES=["loaded"],this.url=e,this.options=t;const r=e.split("/").pop();this.url=e.replace(`/graphmaps/${r}`,""),this.createGraphMap(r,t)}async createGraphMap(e,t){this.knowledgeGraphService=this.createKnowledgeGraphService(this.url,t);const r=await this.knowledgeGraphService.getGraphMapData(e),i=mte.dataFromGraphMap(r.data,r.graphMap);this.graph=new mte(t&&t.config),this.graph.on("beforelayout",()=>{this.dispatchEvent(this.EVENT_TYPES[0])}),this.graph.setData(i),this.graph.handleNodeStatus(G4t(r.graphMap))}createKnowledgeGraphService(e,t){return new _Qe(e,t)}}var xQe=function(n){if(gm.prototype.getFlatMidpoint||(gm.prototype.getFlatMidpoint=function(){return this.getCoordinateAt(.5)}),br.getOlVersion()==="4"&&window&&window.ol&&window.ol.geom.flat){window.targetMapCache=n;let e=window.ol;e.format.MVT.prototype.readProjection=function(t){return new e.proj.Projection({code:"",units:e.proj.Units.TILE_PIXELS})},e.format.MVT.prototype.readProjection=function(t){return new e.proj.Projection({code:"",units:e.proj.Units.TILE_PIXELS})},e.render.canvas.Replay.prototype.applyFill=function(t,r){var i=t.fillStyle,a=[e.render.canvas.Instruction.SET_FILL_STYLE,i];if(typeof i!="string"){var o=window.targetMapCache.getView().getProjection().getExtent();a.push([o[0],o[3]])}this.instructions.push(a)},e.render.canvas.Replay.prototype.applyFill=function(t,r){var i=t.fillStyle,a=[e.render.canvas.Instruction.SET_FILL_STYLE,i];if(typeof i!="string"){var o=window.targetMapCache.getView().getProjection().getExtent();a.push([o[0],o[3]])}this.instructions.push(a)},e.format.MVT.prototype.createFeature_=function(t,r,i){var a=r.type;if(a===0)return null;var o,s=r.id,l=r.properties;l[this.layerName_]=r.layer.name;var u=[],h=[];e.format.MVT.readRawGeometry_(t,r,u,h);var c=e.format.MVT.getGeometryType_(a,h.length);if(this.featureClass_===e.render.Feature)o=new this.featureClass_(c,u,h,l,s);else{var f;if(c==e.geom.GeometryType.POLYGON){for(var d=[],v=0,p=0,g=0,m=h.length;g<m;++g){var y=h[g];e.geom.flat.orient.linearRingIsClockwise(u,v,y,2)||(d.push(h.slice(p,g+1)),p=g+1),v=y}d.length>1?(h=d,f=new e.geom.MultiPolygon(null)):f=new e.geom.Polygon(null)}else f=c===e.geom.GeometryType.POINT?new e.geom.Point(null):c===e.geom.GeometryType.LINE_STRING?new e.geom.LineString(null):c===e.geom.GeometryType.POLYGON?new e.geom.Polygon(null):c===e.geom.GeometryType.MULTI_POINT?new e.geom.MultiPoint(null):c===e.geom.GeometryType.MULTI_LINE_STRING?new e.geom.MultiLineString(null):null;if(f){f.setFlatCoordinates(e.geom.GeometryLayout.XY,u,h),o=new this.featureClass_,this.geometryName_&&o.setGeometryName(this.geometryName_);var _=e.format.Feature.transformWithOptions(f,!1,this.adaptOptions(i));o.setGeometry(_),o.setId(s),o.setProperties(l)}}return o},e.geom.flat.textpath.lineString=function(t,r,i,a,o,s,l,u){var h=[],c=Math.atan2(t[i-a+1]-t[r+1],t[i-a]-t[r]),f=c<-.785||c>2.356,d=c<-.785&&c>-2.356||c>.785&&c<2.356,v=o.length,p=t[r],g=t[r+1];r+=a;for(var m=t[r],y=t[r+1],_=0,x=Math.sqrt(Math.pow(m-p,2)+Math.pow(y-g,2));r<i-a&&_+x<l;)p=m,g=y,r+=a,m=t[r],y=t[r+1],_+=x,x=Math.sqrt(Math.pow(m-p,2)+Math.pow(y-g,2));for(var S=(l-_)/x,w=e.math.lerp(p,m,S),b=e.math.lerp(g,y,S),E="",T=0,C,A,M,I,R=0;R<v;++R){A=f?v-R-1:R;var k=o.charAt(A),D=k.charCodeAt(0),G=D>=19968&&D<=40907;E=f?k+E:E+k;var W=s(E)-T;for(T+=W;r<i-a&&Math.sqrt(Math.pow(m-w,2)+Math.pow(y-b,2))<W/2;)p=m,g=y,r+=a,m=t[r],y=t[r+1];var z=Math.pow(m-p,2)+Math.pow(y-g,2),V=2*(m-p)*(p-w)+2*(y-g)*(g-b),q=Math.pow(p-w,2)+Math.pow(g-b,2)-Math.pow(W/2,2),Y=(-V+Math.sqrt(V*V-4*z*q))/(2*z),le=(-V-Math.sqrt(V*V-4*z*q))/(2*z);S=Y<0||Y>1?le:le<0||le>1?Y:Y<le?le:Y;for(var j=e.math.lerp(p,m,S),Q=e.math.lerp(g,y,S);r<i-a&&Math.sqrt(Math.pow(m-j,2)+Math.pow(y-Q,2))<W/2;)p=m,g=y,r+=a,m=t[r],y=t[r+1];z=Math.pow(m-p,2)+Math.pow(y-g,2),V=2*(m-p)*(p-j)+2*(y-g)*(g-Q),q=Math.pow(p-j,2)+Math.pow(g-Q,2)-Math.pow(W/2,2),Y=(-V+Math.sqrt(V*V-4*z*q))/(2*z),le=(-V-Math.sqrt(V*V-4*z*q))/(2*z),S=Y<0||Y>1?le:le<0||le>1?Y:Y<le?le:Y;var ie=e.math.lerp(p,m,S),oe=e.math.lerp(g,y,S),se=Math.atan2(oe-b,ie-w);if(f&&(se+=se>0?-Math.PI:Math.PI),G&&d&&(se+=se>0?-Math.PI/2:Math.PI/2),M!==void 0){var me=se-M;if(me+=me>Math.PI?-2*Math.PI:me<-Math.PI?2*Math.PI:0,G===I?Math.abs(me)>u:Math.abs(me)>u+Math.PI/2)return null}M==se&&!d?(f&&(C[0]=j,C[1]=Q,C[2]=W/2),C[4]=E):(E=k,T=W,C=[j,Q,W/2,se,E],f?h.unshift(C):h.push(C),M=se,I=G),w=ie,b=oe,l+=W}return h},e.layer.VectorTile.prototype.setFastRender=function(t){return this.fastRender=t},e.renderer.canvas.VectorTileLayer.prototype.postCompose=function(t,r,i){var a=this.getLayer(),o=a.getDeclutter()?{}:null,s=a.getSource(),l=a.getRenderMode(),u=e.renderer.canvas.VectorTileLayer.VECTOR_REPLAYS[l],h=r.pixelRatio,c=r.viewState.rotation,f=r.size,d,v;c&&(d=Math.round(h*f[0]/2),v=Math.round(h*f[1]/2),e.render.canvas.rotateAtOffset(t,-c,d,v)),o&&this.declutterTree_.clear();for(var p=this.renderedTiles,g=s.getTileGridForProjection(r.viewState.projection),m=[],y=[],_=p.length-1;_>=0;--_){var x=p[_];if(x.getState()!=e.TileState.ABORT)for(var S=x.tileCoord,w=g.getTileCoordExtent(S)[0]-g.getTileCoordExtent(x.wrappedTileCoord)[0],b=void 0,E=0,T=x.tileKeys.length;E<T;++E){var C=x.getTile(x.tileKeys[E]);if(C.getState()!=e.TileState.ERROR){var A=C.getReplayGroup(a,S.toString());if(l!=e.layer.VectorTileRenderType.VECTOR&&(!A||!A.hasReplays(u))){a.fastRender===!0&&(C.replayGroups_={},C.features_=[]);continue}b||(b=this.getTransform(r,w));var M=C.tileCoord[0],I=A.getClipCoords(b);t.save(),t.globalAlpha=i.opacity;for(var R=0,k=m.length;R<k;++R){var D=m[R];M<y[R]&&(t.beginPath(),t.moveTo(I[0],I[1]),t.lineTo(I[2],I[3]),t.lineTo(I[4],I[5]),t.lineTo(I[6],I[7]),t.moveTo(D[6],D[7]),t.lineTo(D[4],D[5]),t.lineTo(D[2],D[3]),t.lineTo(D[0],D[1]),t.clip())}A.replay(t,b,c,{},u,o),t.restore(),m.push(I),y.push(M)}}}o&&e.render.canvas.ReplayGroup.replayDeclutter(o,t,c),c&&e.render.canvas.rotateAtOffset(t,c,d,v),e.renderer.canvas.TileLayer.prototype.postCompose.apply(this,arguments)}}};window.olExtends=xQe;var nne={exports:{}};(function(n,e){var t=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,o=2,s=1/0,l=9007199254740991,u="[object Arguments]",h="[object Array]",c="[object Boolean]",f="[object Date]",d="[object Error]",v="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Object]",_="[object Promise]",x="[object RegExp]",S="[object Set]",w="[object String]",b="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",C="[object DataView]",A="[object Float32Array]",M="[object Float64Array]",I="[object Int8Array]",R="[object Int16Array]",k="[object Int32Array]",D="[object Uint8Array]",G="[object Uint8ClampedArray]",W="[object Uint16Array]",z="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,Y=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,ie=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,se={};se[A]=se[M]=se[I]=se[R]=se[k]=se[D]=se[G]=se[W]=se[z]=!0,se[u]=se[h]=se[T]=se[c]=se[C]=se[f]=se[d]=se[v]=se[g]=se[m]=se[y]=se[x]=se[S]=se[w]=se[E]=!1;var me=typeof at=="object"&&at&&at.Object===Object&&at,Ce=typeof self=="object"&&self&&self.Object===Object&&self,Le=me||Ce||Function("return this")(),re=e&&!e.nodeType&&e,yt=re&&!0&&n&&!n.nodeType&&n,je=yt&&yt.exports===re,st=je&&me.process,Nt=function(){try{return st&&st.binding("util")}catch{}}(),Zt=Nt&&Nt.isTypedArray;function qe(ne,ye){for(var Ue=-1,Bt=ne?ne.length:0;++Ue<Bt;)if(ye(ne[Ue],Ue,ne))return!0;return!1}function ur(ne){return function(ye){return ye==null?void 0:ye[ne]}}function Dt(ne,ye){for(var Ue=-1,Bt=Array(ne);++Ue<ne;)Bt[Ue]=ye(Ue);return Bt}function ft(ne){return function(ye){return ne(ye)}}function Oe(ne,ye){return ne==null?void 0:ne[ye]}function J(ne){var ye=!1;if(ne!=null&&typeof ne.toString!="function")try{ye=!!(ne+"")}catch{}return ye}function We(ne){var ye=-1,Ue=Array(ne.size);return ne.forEach(function(Bt,$t){Ue[++ye]=[$t,Bt]}),Ue}function Tt(ne,ye){return function(Ue){return ne(ye(Ue))}}function Qe(ne){var ye=-1,Ue=Array(ne.size);return ne.forEach(function(Bt){Ue[++ye]=Bt}),Ue}var zt=Array.prototype,mt=Function.prototype,wt=Object.prototype,pt=Le["__core-js_shared__"],ar=function(){var ne=/[^.]+$/.exec(pt&&pt.keys&&pt.keys.IE_PROTO||"");return ne?"Symbol(src)_1."+ne:""}(),kt=mt.toString,Dr=wt.hasOwnProperty,Sr=wt.toString,jr=RegExp("^"+kt.call(Dr).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pn=Le.Symbol,Jn=Le.Uint8Array,Rn=wt.propertyIsEnumerable,hi=zt.splice,yn=Tt(Object.keys,Object),Oi=tc(Le,"DataView"),oi=tc(Le,"Map"),Gi=tc(Le,"Promise"),ws=tc(Le,"Set"),Sl=tc(Le,"WeakMap"),Os=tc(Object,"create"),no=_u(Oi),vo=_u(oi),No=_u(Gi),Jo=_u(ws),Lo=_u(Sl),hs=pn?pn.prototype:void 0,Rs=hs?hs.valueOf:void 0,Pn=hs?hs.toString:void 0;function mo(ne){var ye=-1,Ue=ne?ne.length:0;for(this.clear();++ye<Ue;){var Bt=ne[ye];this.set(Bt[0],Bt[1])}}function ue(){this.__data__=Os?Os(null):{}}function xe(ne){return this.has(ne)&&delete this.__data__[ne]}function ce(ne){var ye=this.__data__;if(Os){var Ue=ye[ne];return Ue===i?void 0:Ue}return Dr.call(ye,ne)?ye[ne]:void 0}function pe(ne){var ye=this.__data__;return Os?ye[ne]!==void 0:Dr.call(ye,ne)}function we(ne,ye){var Ue=this.__data__;return Ue[ne]=Os&&ye===void 0?i:ye,this}mo.prototype.clear=ue,mo.prototype.delete=xe,mo.prototype.get=ce,mo.prototype.has=pe,mo.prototype.set=we;function Me(ne){var ye=-1,Ue=ne?ne.length:0;for(this.clear();++ye<Ue;){var Bt=ne[ye];this.set(Bt[0],Bt[1])}}function nt(){this.__data__=[]}function It(ne){var ye=this.__data__,Ue=js(ye,ne);if(Ue<0)return!1;var Bt=ye.length-1;return Ue==Bt?ye.pop():hi.call(ye,Ue,1),!0}function ot(ne){var ye=this.__data__,Ue=js(ye,ne);return Ue<0?void 0:ye[Ue][1]}function ht(ne){return js(this.__data__,ne)>-1}function ut(ne,ye){var Ue=this.__data__,Bt=js(Ue,ne);return Bt<0?Ue.push([ne,ye]):Ue[Bt][1]=ye,this}Me.prototype.clear=nt,Me.prototype.delete=It,Me.prototype.get=ot,Me.prototype.has=ht,Me.prototype.set=ut;function qt(ne){var ye=-1,Ue=ne?ne.length:0;for(this.clear();++ye<Ue;){var Bt=ne[ye];this.set(Bt[0],Bt[1])}}function fr(){this.__data__={hash:new mo,map:new(oi||Me),string:new mo}}function Wr(ne){return Es(this,ne).delete(ne)}function gr(ne){return Es(this,ne).get(ne)}function Ar(ne){return Es(this,ne).has(ne)}function $n(ne,ye){return Es(this,ne).set(ne,ye),this}qt.prototype.clear=fr,qt.prototype.delete=Wr,qt.prototype.get=gr,qt.prototype.has=Ar,qt.prototype.set=$n;function bi(ne){var ye=-1,Ue=ne?ne.length:0;for(this.__data__=new qt;++ye<Ue;)this.add(ne[ye])}function qa(ne){return this.__data__.set(ne,i),this}function Qo(ne){return this.__data__.has(ne)}bi.prototype.add=bi.prototype.push=qa,bi.prototype.has=Qo;function Ds(ne){this.__data__=new Me(ne)}function af(){this.__data__=new Me}function mh(ne){return this.__data__.delete(ne)}function Zl(ne){return this.__data__.get(ne)}function jd(ne){return this.__data__.has(ne)}function Nl(ne,ye){var Ue=this.__data__;if(Ue instanceof Me){var Bt=Ue.__data__;if(!oi||Bt.length<t-1)return Bt.push([ne,ye]),this;Ue=this.__data__=new qt(Bt)}return Ue.set(ne,ye),this}Ds.prototype.clear=af,Ds.prototype.delete=mh,Ds.prototype.get=Zl,Ds.prototype.has=jd,Ds.prototype.set=Nl;function ec(ne,ye){var Ue=O(ne)||B(ne)?Dt(ne.length,String):[],Bt=Ue.length,$t=!!Bt;for(var ee in ne)(ye||Dr.call(ne,ee))&&!($t&&(ee=="length"||zv(ee,Bt)))&&Ue.push(ee);return Ue}function js(ne,ye){for(var Ue=ne.length;Ue--;)if(gt(ne[Ue][0],ye))return Ue;return-1}function fg(ne,ye){ye=bc(ye,ne)?[ye]:lf(ye);for(var Ue=0,Bt=ye.length;ne!=null&&Ue<Bt;)ne=ne[hf(ye[Ue++])];return Ue&&Ue==Bt?ne:void 0}function dg(ne){return Sr.call(ne)}function Xd(ne,ye){return ne!=null&&ye in Object(ne)}function Yd(ne,ye,Ue,Bt,$t){return ne===ye?!0:ne==null||ye==null||!Z(ne)&&!Ae(ye)?ne!==ne&&ye!==ye:vg(ne,ye,Yd,Ue,Bt,$t)}function vg(ne,ye,Ue,Bt,$t,ee){var Se=O(ne),Ze=O(ye),Ct=h,vr=h;Se||(Ct=Xs(ne),Ct=Ct==u?y:Ct),Ze||(vr=Xs(ye),vr=vr==u?y:vr);var Cr=Ct==y&&!J(ne),Jr=vr==y&&!J(ye),nn=Ct==vr;if(nn&&!Cr)return ee||(ee=new Ds),Se||Be(ne)?gg(ne,ye,Ue,Bt,$t,ee):Wm(ne,ye,Ct,Ue,Bt,$t,ee);if(!($t&o)){var Dn=Cr&&Dr.call(ne,"__wrapped__"),si=Jr&&Dr.call(ye,"__wrapped__");if(Dn||si){var An=Dn?ne.value():ne,qi=si?ye.value():ye;return ee||(ee=new Ds),Ue(An,qi,Bt,$t,ee)}}return nn?(ee||(ee=new Ds),ho(ne,ye,Ue,Bt,$t,ee)):!1}function qf(ne,ye,Ue,Bt){var $t=Ue.length,ee=$t,Se=!Bt;if(ne==null)return!ee;for(ne=Object(ne);$t--;){var Ze=Ue[$t];if(Se&&Ze[2]?Ze[1]!==ne[Ze[0]]:!(Ze[0]in ne))return!1}for(;++$t<ee;){Ze=Ue[$t];var Ct=Ze[0],vr=ne[Ct],Cr=Ze[1];if(Se&&Ze[2]){if(vr===void 0&&!(Ct in ne))return!1}else{var Jr=new Ds;if(Bt)var nn=Bt(vr,Cr,Ct,ne,ye,Jr);if(!(nn===void 0?Yd(Cr,vr,Bt,a|o,Jr):nn))return!1}}return!0}function Zf(ne){if(!Z(ne)||uf(ne))return!1;var ye=U(ne)||J(ne)?jr:ie;return ye.test(_u(ne))}function pg(ne){return Ae(ne)&&X(ne.length)&&!!se[Sr.call(ne)]}function Kf(ne){return typeof ne=="function"?ne:ne==null?Ht:typeof ne=="object"?O(ne)?Y0(ne[0],ne[1]):X0(ne):Yt(ne)}function of(ne){if(!Ec(ne))return yn(ne);var ye=[];for(var Ue in Object(ne))Dr.call(ne,Ue)&&Ue!="constructor"&&ye.push(Ue);return ye}function X0(ne){var ye=q0(ne);return ye.length==1&&ye[0][2]?Uv(ye[0][0],ye[0][1]):function(Ue){return Ue===ne||qf(Ue,ne,ye)}}function Y0(ne,ye){return bc(ne)&&mg(ye)?Uv(hf(ne),ye):function(Ue){var Bt=Xe(Ue,ne);return Bt===void 0&&Bt===ye?_t(Ue,ne):Yd(ye,Bt,void 0,a|o)}}function Kl(ne){return function(ye){return fg(ye,ne)}}function sf(ne,ye){for(var Ue=ne?ye.length:0,Bt=Ue-1;Ue--;){var $t=ye[Ue];if(Ue==Bt||$t!==ee){var ee=$t;if(zv($t))hi.call(ne,$t,1);else if(bc($t,ne))delete ne[hf($t)];else{var Se=lf($t),Ze=_h(ne,Se);Ze!=null&&delete Ze[hf($v(Se))]}}}return ne}function mu(ne,ye,Ue){var Bt=-1,$t=ne.length;ye<0&&(ye=-ye>$t?0:$t+ye),Ue=Ue>$t?$t:Ue,Ue<0&&(Ue+=$t),$t=ye>Ue?0:Ue-ye>>>0,ye>>>=0;for(var ee=Array($t);++Bt<$t;)ee[Bt]=ne[Bt+ye];return ee}function bs(ne){if(typeof ne=="string")return ne;if(Re(ne))return Pn?Pn.call(ne):"";var ye=ne+"";return ye=="0"&&1/ne==-s?"-0":ye}function lf(ne){return O(ne)?ne:Vv(ne)}function gg(ne,ye,Ue,Bt,$t,ee){var Se=$t&o,Ze=ne.length,Ct=ye.length;if(Ze!=Ct&&!(Se&&Ct>Ze))return!1;var vr=ee.get(ne);if(vr&&ee.get(ye))return vr==ye;var Cr=-1,Jr=!0,nn=$t&a?new bi:void 0;for(ee.set(ne,ye),ee.set(ye,ne);++Cr<Ze;){var Dn=ne[Cr],si=ye[Cr];if(Bt)var An=Se?Bt(si,Dn,Cr,ye,ne,ee):Bt(Dn,si,Cr,ne,ye,ee);if(An!==void 0){if(An)continue;Jr=!1;break}if(nn){if(!qe(ye,function(qi,_o){if(!nn.has(_o)&&(Dn===qi||Ue(Dn,qi,Bt,$t,ee)))return nn.add(_o)})){Jr=!1;break}}else if(!(Dn===si||Ue(Dn,si,Bt,$t,ee))){Jr=!1;break}}return ee.delete(ne),ee.delete(ye),Jr}function Wm(ne,ye,Ue,Bt,$t,ee,Se){switch(Ue){case C:if(ne.byteLength!=ye.byteLength||ne.byteOffset!=ye.byteOffset)return!1;ne=ne.buffer,ye=ye.buffer;case T:return!(ne.byteLength!=ye.byteLength||!Bt(new Jn(ne),new Jn(ye)));case c:case f:case m:return gt(+ne,+ye);case d:return ne.name==ye.name&&ne.message==ye.message;case x:case w:return ne==ye+"";case g:var Ze=We;case S:var Ct=ee&o;if(Ze||(Ze=Qe),ne.size!=ye.size&&!Ct)return!1;var vr=Se.get(ne);if(vr)return vr==ye;ee|=a,Se.set(ne,ye);var Cr=gg(Ze(ne),Ze(ye),Bt,$t,ee,Se);return Se.delete(ne),Cr;case b:if(Rs)return Rs.call(ne)==Rs.call(ye)}return!1}function ho(ne,ye,Ue,Bt,$t,ee){var Se=$t&o,Ze=rt(ne),Ct=Ze.length,vr=rt(ye),Cr=vr.length;if(Ct!=Cr&&!Se)return!1;for(var Jr=Ct;Jr--;){var nn=Ze[Jr];if(!(Se?nn in ye:Dr.call(ye,nn)))return!1}var Dn=ee.get(ne);if(Dn&&ee.get(ye))return Dn==ye;var si=!0;ee.set(ne,ye),ee.set(ye,ne);for(var An=Se;++Jr<Ct;){nn=Ze[Jr];var qi=ne[nn],_o=ye[nn];if(Bt)var cs=Se?Bt(_o,qi,nn,ye,ne,ee):Bt(qi,_o,nn,ne,ye,ee);if(!(cs===void 0?qi===_o||Ue(qi,_o,Bt,$t,ee):cs)){si=!1;break}An||(An=nn=="constructor")}if(si&&!An){var wl=ne.constructor,xu=ye.constructor;wl!=xu&&"constructor"in ne&&"constructor"in ye&&!(typeof wl=="function"&&wl instanceof wl&&typeof xu=="function"&&xu instanceof xu)&&(si=!1)}return ee.delete(ne),ee.delete(ye),si}function Es(ne,ye){var Ue=ne.__data__;return yg(ye)?Ue[typeof ye=="string"?"string":"hash"]:Ue.map}function q0(ne){for(var ye=rt(ne),Ue=ye.length;Ue--;){var Bt=ye[Ue],$t=ne[Bt];ye[Ue]=[Bt,$t,mg($t)]}return ye}function tc(ne,ye){var Ue=Oe(ne,ye);return Zf(Ue)?Ue:void 0}var Xs=dg;(Oi&&Xs(new Oi(new ArrayBuffer(1)))!=C||oi&&Xs(new oi)!=g||Gi&&Xs(Gi.resolve())!=_||ws&&Xs(new ws)!=S||Sl&&Xs(new Sl)!=E)&&(Xs=function(ne){var ye=Sr.call(ne),Ue=ye==y?ne.constructor:void 0,Bt=Ue?_u(Ue):void 0;if(Bt)switch(Bt){case no:return C;case vo:return g;case No:return _;case Jo:return S;case Lo:return E}return ye});function Hm(ne,ye,Ue){ye=bc(ye,ne)?[ye]:lf(ye);for(var Bt,$t=-1,Se=ye.length;++$t<Se;){var ee=hf(ye[$t]);if(!(Bt=ne!=null&&Ue(ne,ee)))break;ne=ne[ee]}if(Bt)return Bt;var Se=ne?ne.length:0;return!!Se&&X(Se)&&zv(ee,Se)&&(O(ne)||B(ne))}function zv(ne,ye){return ye=ye==null?l:ye,!!ye&&(typeof ne=="number"||oe.test(ne))&&ne>-1&&ne%1==0&&ne<ye}function bc(ne,ye){if(O(ne))return!1;var Ue=typeof ne;return Ue=="number"||Ue=="symbol"||Ue=="boolean"||ne==null||Re(ne)?!0:q.test(ne)||!V.test(ne)||ye!=null&&ne in Object(ye)}function yg(ne){var ye=typeof ne;return ye=="string"||ye=="number"||ye=="symbol"||ye=="boolean"?ne!=="__proto__":ne===null}function uf(ne){return!!ar&&ar in ne}function Ec(ne){var ye=ne&&ne.constructor,Ue=typeof ye=="function"&&ye.prototype||wt;return ne===Ue}function mg(ne){return ne===ne&&!Z(ne)}function Uv(ne,ye){return function(Ue){return Ue==null?!1:Ue[ne]===ye&&(ye!==void 0||ne in Object(Ue))}}function _h(ne,ye){return ye.length==1?ne:fg(ne,mu(ye,0,-1))}var Vv=Te(function(ne){ne=Je(ne);var ye=[];return Y.test(ne)&&ye.push(""),ne.replace(le,function(Ue,Bt,$t,ee){ye.push($t?ee.replace(Q,"$1"):Bt||Ue)}),ye});function hf(ne){if(typeof ne=="string"||Re(ne))return ne;var ye=ne+"";return ye=="0"&&1/ne==-s?"-0":ye}function _u(ne){if(ne!=null){try{return kt.call(ne)}catch{}try{return ne+""}catch{}}return""}function $v(ne){var ye=ne?ne.length:0;return ye?ne[ye-1]:void 0}function _g(ne,ye){var Ue=[];if(!(ne&&ne.length))return Ue;var Bt=-1,$t=[],ee=ne.length;for(ye=Kf(ye);++Bt<ee;){var Se=ne[Bt];ye(Se,Bt,ne)&&(Ue.push(Se),$t.push(Bt))}return sf(ne,$t),Ue}function Te(ne,ye){if(typeof ne!="function"||ye&&typeof ye!="function")throw new TypeError(r);var Ue=function(){var Bt=arguments,$t=ye?ye.apply(this,Bt):Bt[0],ee=Ue.cache;if(ee.has($t))return ee.get($t);var Se=ne.apply(this,Bt);return Ue.cache=ee.set($t,Se),Se};return Ue.cache=new(Te.Cache||qt),Ue}Te.Cache=qt;function gt(ne,ye){return ne===ye||ne!==ne&&ye!==ye}function B(ne){return N(ne)&&Dr.call(ne,"callee")&&(!Rn.call(ne,"callee")||Sr.call(ne)==u)}var O=Array.isArray;function F(ne){return ne!=null&&X(ne.length)&&!U(ne)}function N(ne){return Ae(ne)&&F(ne)}function U(ne){var ye=Z(ne)?Sr.call(ne):"";return ye==v||ye==p}function X(ne){return typeof ne=="number"&&ne>-1&&ne%1==0&&ne<=l}function Z(ne){var ye=typeof ne;return!!ne&&(ye=="object"||ye=="function")}function Ae(ne){return!!ne&&typeof ne=="object"}function Re(ne){return typeof ne=="symbol"||Ae(ne)&&Sr.call(ne)==b}var Be=Zt?ft(Zt):pg;function Je(ne){return ne==null?"":bs(ne)}function Xe(ne,ye,Ue){var Bt=ne==null?void 0:fg(ne,ye);return Bt===void 0?Ue:Bt}function _t(ne,ye){return ne!=null&&Hm(ne,ye,Xd)}function rt(ne){return F(ne)?ec(ne):of(ne)}function Ht(ne){return ne}function Yt(ne){return bc(ne)?ur(hf(ne)):Kl(ne)}n.exports=_g})(nne,nne.exports);const jVr=nne.exports;class SQe extends fT{constructor(e){super(),e=e||{},this.spriteRegEx=/^(.*)(\?.*)$/,this.defaultFont=["DIN Offc Pro Medium","Arial Unicode MS Regular"],this.map=e.map,this.source=e.source,this.styleTarget=e.style||H.urlAppend(H.urlPathAppend(e.url,"tileFeature/vectorstyles"),"type=MapBox_GL&styleonly=true"),this.resolutions=e.resolutions,this.withCredentials=e.withCredentials,this.selectedObjects=[],this.selectedStyle=e.selectedStyle||function(){return new So({fill:new Ko({color:"rgba(255, 0, 0, 1)"}),stroke:new es({color:"rgba(255, 0, 0, 1)",width:10}),text:new J1({font:'normal 400 11.19px "Microsoft YaHei"',placement:"point",fill:new Ko({color:"blue"})}),image:new rm({radius:5,fill:new Ko({color:"blue"})})})},this.layersBySourceLayer={},xQe(this.map),this._loadStyle(this.styleTarget)}getStyleFunction(){return this.featureStyleFuntion}getStylesBySourceLayer(e){if(this.layersBySourceLayer[e])return this.layersBySourceLayer[e];const t=[];for(let r=0;r<this._mbStyle.layers.length;r++){const i=this._mbStyle.layers[r];i["source-layer"]===e&&t.push(i)}return this.layersBySourceLayer[e]=t,t}setSelectedId(e,t){this.selectedObjects=[],this.selectedObjects.push({id:e,sourceLayer:t})}setSelectedObjects(e){Array.isArray(e)||(e=[e]),this.selectedObjects=[],this.selectedObjects=e}addSelectedObjects(e){Array.isArray(e)||(e=[e]),this.selectedObjects.push(...e)}removeSelectedObjects(e){Array.isArray(e)||(e=[e]),e.forEach(t=>{jVr(this.selectedObjects,r=>t.id===r.id&&t.sourceLayer===r.sourceLayer)})}clearSelectedObjects(){this.selectedObjects=[]}updateStyles(e){Object.prototype.toString.call(e)!=="[object Array]"&&(e=[e]);const t={};e.forEach(i=>{t[i.id]=i});let r=0;for(const i in this._mbStyle.layers){const a=this._mbStyle.layers[i];if(r>=e.length)break;if(!t[a.id])continue;const o=JSON.parse(JSON.stringify(t[a.id]));o.paint&&(o.paint=Object.assign({},a.paint,o.paint)),o.layout&&(o.layout=Object.assign({},a.layout,o.layout)),Object.assign(a,o),r++}this._createStyleFunction()}setStyle(e){this.layersBySourceLayer={},this._loadStyle(e)}_loadStyle(e){if(Object.prototype.toString.call(e)=="[object Object]")this._mbStyle=e,this._resolve();else{var t=xs.appendCredential(e);li.get(t,null,{withCredentials:this.withCredentials}).then(r=>r.json()).then(r=>{this._mbStyle=r,this._resolve()})}}_resolve(){if(this.source||(this.source=Object.keys(this._mbStyle.sources)[0]),this._mbStyle.sprite){const t=(window.devicePixelRatio>=1.5?.5:1)==.5?"@2x":"";this._mbStyle.sprite=this._mbStyle.sprite.replace("@2x","");const r=this._toSpriteUrl(this._mbStyle.sprite,this.path,t+".json");li.get(xs.appendCredential(r),null,{withCredentials:this.withCredentials}).then(i=>i.json()).then(i=>{this._spriteData=i,this._spriteImageUrl=xs.appendCredential(this._toSpriteUrl(this._mbStyle.sprite,this.path,t+".png")),this._spriteImage=null;const a=new Image;a.crossOrigin=this.withCredentials?"use-credentials":"anonymous",a.onload=()=>{this._spriteImage=a,this._initStyleFunction()},a.onerror=()=>{this._spriteImage=null,this._initStyleFunction()},a.src=this._spriteImageUrl}).catch(i=>{console.log(i),this._spriteImage=null,this._initStyleFunction()})}else this._initStyleFunction()}_initStyleFunction(){if(!this.resolutions&&this._mbStyle.metadata&&this._mbStyle.metadata.indexbounds){const t=this._mbStyle.metadata.indexbounds;var e=Math.max(t[2]-t[0],t[3]-t[1]);const r=[];for(let i=0;i<30;i++)r.push(e/512/Math.pow(2,i));this.resolutions=r}this._createStyleFunction(),this.dispatchEvent("styleloaded")}_createStyleFunction(){this.map&&window.olms.applyBackground(this.map,this._mbStyle),this.featureStyleFuntion=this._getStyleFunction()}_getStyleFunction(){return this.fun=window.olms.stylefunction({setStyle:function(){},set:function(){},changed:function(){}},this._mbStyle,this.source,this.resolutions,this._spriteData,"",this._spriteImage),(e,t)=>{const r=this.fun(e,t);if(this.selectedObjects.length>0&&this.selectedObjects.find(i=>i.id===e.getId()&&i.sourceLayer===e.get("layer"))){const i=r&&r[0]?r[0].getZIndex():99999;let a=this.selectedStyle(e,t);Array.isArray(a)||(a=[a]);for(let o=0;o<a.length;o++){const s=a[o];e.getGeometry().getType()==="Point"&&r[0].getText()&&s.getText()&&(s.setFill(null),s.setStroke(null),s.setImage(),s.getText().setText(r[0].getText().getText())),s.setZIndex(i)}return a}return r}}_withPath(e,t){return t&&e.indexOf("http")!=0&&(e=t+e),e}_toSpriteUrl(e,t,r){e=this._withPath(e,t);const i=e.match(this.spriteRegEx);return i?i[1]+r+(i.length>2?i[2]:""):e+r}}class XVr extends _l{constructor(e,t){super(e,t),this._addressMatchService=new jOe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}code(e,t){return this._addressMatchService.code(H.urlPathAppend(this.url,"geocoding"),e,t)}decode(e,t){return this._addressMatchService.decode(H.urlPathAppend(this.url,"geodecoding"),e,t)}}class YVr{constructor(e,t){this.url=e,this.options=t||{}}queryChart(e,t,r){var i=this,a=e,o=i._processFormat(r),s=new nRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:o});return s.processAsync(a,t)}getChartFeatureInfo(e){var t=this,r=H.urlPathAppend(t.url,"chartFeatureInfoSpecs"),i=new eRe(r,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers});return i.processAsync(e)}_processFormat(e){return e||Ni.GEOJSON}}class qVr extends _l{constructor(e,t){super(e,t),this._chartService=new YVr(e,t)}queryChart(e,t,r){return e=this._processParams(e),this._chartService.queryChart(e,t,r)}getChartFeatureInfo(e){return this._chartService.getChartFeatureInfo(e)}_processParams(e){if(!e)return{};e.returnContent=e.returnContent==null?!0:e.returnContent,e.filter&&(e.chartQueryFilterParameters=br.isArray(e.filter)?e.filter:[e.filter]),e.bounds&&(e.bounds=new po(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3]))}}class ZVr{constructor(e,t){this.url=e,this.options=t||{}}getFields(e,t){var r=this,i=new QRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,datasource:e.datasource,dataset:e.dataset});return i.processAsync(t)}getFieldStatisticsInfo(e,t){if(e instanceof CRe){var r=this,i=e.fieldName,a=e.statisticMode;a&&!Array.isArray(a)&&(a=[a]),r.currentStatisticResult={fieldName:i},r._statisticsCallback=t,a.forEach(o=>{r.currentStatisticResult[o]=null,r._fieldStatisticRequest(e.datasource,e.dataset,i,o)})}}_fieldStatisticRequest(e,t,r,i){var a=this,o=new ARe(a.url,{datasource:e,dataset:t,field:r,statisticMode:i,crossOrigin:a.options.crossOrigin,headers:a.options.headers});o.processAsync(a._processCompleted.bind(a))}_processCompleted(e){var t=this;if(e.error){t._statisticsCallback(e);return}var r=!0,i=e.result;this.currentStatisticResult&&t.currentStatisticResult[i.mode]==null&&(this.currentStatisticResult[i.mode]=i.result);for(var a in t.currentStatisticResult)if(t.currentStatisticResult[a]==null){r=!1;break}r&&t._statisticsCallback({result:t.currentStatisticResult})}}class KVr extends _l{constructor(e,t){super(e,t),this._fieldService=new ZVr(e,t)}getFields(e,t){return this._fieldService.getFields(e,t)}getFieldStatisticsInfo(e,t){return this._fieldService.getFieldStatisticsInfo(e,t)}}class JVr extends _l{constructor(e,t){super(e,t),this._datasetService=new jRe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getDatasets(e,t){if(!!e)return this._datasetService.getDatasetsService(e,t)}getDataset(e,t,r){if(!(!e||!t))return this._datasetService.getDatasetService(e,t,r)}setDataset(e,t){if(!(!(e instanceof xK)&&!(e instanceof SK))){if(e instanceof xK)var r={datasetType:e.datasetType,datasetName:e.datasetName,datasourceName:e.datasourceName};else e instanceof SK&&(r={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});return this._datasetService.setDatasetService(r,t)}}deleteDataset(e,t,r){return this._datasetService.deleteDatasetService(e,t,r)}}class QVr extends _l{constructor(e,t){super(e,t),this._datasourceService=new cRe(this.url,{proxy:this.proxy,withCredentials:this.withCredentials,crossOrigin:this.crossOrigin,headers:this.headers})}getDatasources(e){return this._datasourceService.getDatasourcesService(e)}getDatasource(e,t){if(!!e)return this._datasourceService.getDatasourceService(e,t)}setDatasource(e,t){if(!(e instanceof $De))return;const r={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};return this._datasourceService.setDatasourceService(r,t)}}class e$r extends _l{constructor(e,t){super(e,t),this._gridCellQueryService=new tDe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getGridCellInfos(e,t){return e?this._gridCellQueryService.processAsync(e,t):null}}class t$r extends _l{constructor(e,t){super(e,t),this.headers=!0,this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0,this._geoprocessingJobsService=new $Re(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getTools(e){return this._geoprocessingJobsService.getTools(e)}getTool(e,t){return this._geoprocessingJobsService.getTool(e,t)}execute(e,t,r,i){return this._geoprocessingJobsService.execute(e,t,r,i)}submitJob(e,t,r,i){return this._geoprocessingJobsService.submitJob(e,t,r,i)}waitForJobCompletion(e,t,r,i){return this._geoprocessingJobsService.waitForJobCompletion(e,t,r,i)}getJobInfo(e,t,r){return this._geoprocessingJobsService.getJobInfo(e,t,r)}cancelJob(e,t,r){return this._geoprocessingJobsService.cancelJob(e,t,r)}getJobs(e,t){return this._geoprocessingJobsService.getJobs(e,t)}getResults(e,t,r,i){return this._geoprocessingJobsService.getResults(e,t,r,i)}}class r$r{constructor(e,t){this.url=e,this.options=t||{}}getLayersInfo(e){var t=this,r=new lDe(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers});return r.processAsync(e)}getLayersLegendInfo(e,t){var r=this,i=new FDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}setLayerInfo(e,t){if(!!e){var r=this,i=e.resourceID,a=e.tempLayerName,o=e.layerInfo;if(!(!i||!a)){var s=H.urlPathAppend(r.url,"tempLayersSet/"+i+"/"+a),l=new WDe(s,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return l.processAsync(o,t)}}}setLayersInfo(e,t){if(!!e){var r=this,i=e.resourceID,a=e.isTempLayers?e.isTempLayers:!1,o=e.layersInfo;if(!(a&&!i||!o)){var s=new HDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,resourceID:i,isTempLayers:a});return s.processAsync(o,t)}}}setLayerStatus(e,t){if(!!e){var r=this,i=new XDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}}}class n$r extends _l{constructor(e,t){super(e,t),this._layerInfoService=new r$r(e,t)}getLayersInfo(e){return this._layerInfoService.getLayersInfo(e)}getLayersLegendInfo(e,t){return this._layerInfoService.getLayersLegendInfo(e,t)}setLayerInfo(e,t){return this._layerInfoService.setLayerInfo(e,t)}setLayersInfo(e,t){return this._layerInfoService.setLayersInfo(e,t)}setLayerStatus(e,t){return this._layerInfoService.setLayerStatus(e,t)}}class i$r extends _l{constructor(e,t){super(e,t)}measureDistance(e,t){return this.measure(e,"DISTANCE",t)}measureArea(e,t){return this.measure(e,"AREA",t)}measure(e,t,r){var i=this,a=new yDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,measureMode:t});return a.processAsync(i._processParam(e),r)}_processParam(e){return e&&e.geometry&&(e.geometry=br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e.geometry)))),e}}class a$r{constructor(e,t){this.url=e,this.options=t||{}}sinksFacilityAnalyst(e,t){var r=this,i=new vRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}sourcesFacilityAnalyst(e,t){var r=this,i=new gRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}traceUpFacilityAnalyst(e,t){var r=this,i=new wRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}traceDownFacilityAnalyst(e,t){var r=this,i=new xRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}upstreamFacilityAnalyst(e,t){var r=this,i=new ERe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}}class o$r extends _l{constructor(e,t){super(e,t),this._networkAnalyst3DService=new a$r(e,t)}sinksFacilityAnalyst(e,t){return this._networkAnalyst3DService.sinksFacilityAnalyst(e,t)}sourcesFacilityAnalyst(e,t){return this._networkAnalyst3DService.sourcesFacilityAnalyst(e,t)}traceUpFacilityAnalyst(e,t){return this._networkAnalyst3DService.traceUpFacilityAnalyst(e,t)}traceDownFacilityAnalyst(e,t){return this._networkAnalyst3DService.traceDownFacilityAnalyst(e,t)}upstreamFacilityAnalyst(e,t){return this._networkAnalyst3DService.upstreamFacilityAnalyst(e,t)}}class s$r{constructor(e,t){this.url=e,this.options=t||{}}burstPipelineAnalyst(e,t){var r=this,i=new QOe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}computeWeightMatrix(e,t){var r=this,i=new sRe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}findClosestFacilities(e,t,r){var i=this,a=new IRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}traceAnalyst(e,t,r){var i=this,a=new DDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}connectedEdgesAnalyst(e,t,r){var i=this,a=new kDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}streamFacilityAnalyst(e,t,r){var i=this,a=new mRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findLocation(e,t,r){var i=this,a=new PRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findPath(e,t,r){var i=this,a=new NRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findTSPPaths(e,t,r){var i=this,a=new GRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findMTSPPaths(e,t,r){var i=this,a=new RRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}findServiceAreas(e,t,r){var i=this,a=new FRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}updateEdgeWeight(e,t){var r=this,i=new dNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}updateTurnNodeWeight(e,t){var r=this,i=new pNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}_processFormat(e){return e||Ni.GEOJSON}}class l$r extends _l{constructor(e,t){super(e,t),this._networkAnalystService=new s$r(e,t)}burstPipelineAnalyst(e,t){return e=this._processParams(e),this._networkAnalystService.burstPipelineAnalyst(e,t)}computeWeightMatrix(e,t){return e=this._processParams(e),this._networkAnalystService.computeWeightMatrix(e,t)}findClosestFacilities(e,t,r){return e=this._processParams(e),this._networkAnalystService.findClosestFacilities(e,t,r)}traceAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.traceAnalyst(e,t,r)}connectedEdgesAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.connectedEdgesAnalyst(e,t,r)}streamFacilityAnalyst(e,t,r){return e=this._processParams(e),this._networkAnalystService.streamFacilityAnalyst(e,t,r)}findLocation(e,t,r){return e=this._processParams(e),this._networkAnalystService.findLocation(e,t,r)}findPath(e,t,r){return e=this._processParams(e),this._networkAnalystService.findPath(e,t,r)}findTSPPaths(e,t,r){return e=this._processParams(e),this._networkAnalystService.findTSPPaths(e,t,r)}findMTSPPaths(e,t,r){return e=this._processParams(e),this._networkAnalystService.findMTSPPaths(e,t,r)}findServiceAreas(e,t,r){return e=this._processParams(e),this._networkAnalystService.findServiceAreas(e,t,r)}updateEdgeWeight(e,t){return this._networkAnalystService.updateEdgeWeight(e,t)}updateTurnNodeWeight(e,t){return this._networkAnalystService.updateTurnNodeWeight(e,t)}_processParams(e){if(!e)return{};if(e.centers&&br.isArray(e.centers)&&e.centers.map(function(r,i){return e.centers[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.centers[i]}),e.nodes&&br.isArray(e.nodes)&&e.nodes.map(function(r,i){return e.nodes[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.nodes[i]}),e.event&&e.event instanceof Qs&&(e.event={x:e.event.getCoordinates()[0],y:e.event.getCoordinates()[1]}),e.facilities&&br.isArray(e.facilities)&&e.facilities.map(function(r,i){return e.facilities[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.facilities[i]}),e.parameter&&e.parameter.barrierPoints){var t=e.parameter.barrierPoints;br.isArray(t)?t.map(function(r,i){return e.parameter.barrierPoints[i]=r instanceof Qs?{x:r.getCoordinates()[0],y:r.getCoordinates()[1]}:r,e.parameter.barrierPoints[i]}):e.parameter.barrierPoints=[t instanceof Qs?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t]}return e}_processFormat(e){return e||Ni.GEOJSON}}class u$r{constructor(e,t){this.url=e,this.options=t||{},this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={}}getKernelDensityJobs(e,t){var r=this,i=r._processFormat(t),a=new oB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getKernelDensityJobs(e)}getKernelDensityJob(e,t,r){var i=this,a=i._processFormat(r),o=new oB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getKernelDensityJob(e,t)}addKernelDensityJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new oB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addKernelDensityJob(e,r,t,function(l){a.kernelDensityJobs[l.id]=l.state})}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var r=this,i=r._processFormat(t),a=new hB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getSummaryMeshJobs(e)}getSummaryMeshJob(e,t,r){var i=this,a=i._processFormat(r),o=new hB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getSummaryMeshJob(e,t)}addSummaryMeshJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new hB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addSummaryMeshJob(e,r,t,function(l){a.summaryMeshJobs[l.id]=l.state})}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var r=this,i=r._processFormat(t),a=new lB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getQueryJobs(e)}getQueryJob(e,t,r){var i=this,a=i._processFormat(r),o=new lB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getQueryJob(e,t)}addQueryJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new lB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addQueryJob(e,r,t,function(l){a.queryJobs[l.id]=l.state})}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var r=this,i=r._processFormat(t),a=new cB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getSummaryRegionJobs(e)}getSummaryRegionJob(e,t,r){var i=this,a=i._processFormat(r),o=new cB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getSummaryRegionJob(e,t)}addSummaryRegionJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new cB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addSummaryRegionJob(e,r,t,function(l){a.summaryRegionJobs[l.id]=l.state})}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var r=this,i=r._processFormat(t),a=new dB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getVectorClipJobs(e)}getVectorClipJob(e,t,r){var i=this,a=i._processFormat(r),o=new dB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getVectorClipJob(e,t)}addVectorClipJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new dB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addVectorClipJob(e,r,t,function(l){a.vectorClipJobs[l.id]=l.state})}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var r=this,i=r._processFormat(t),a=new sB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getOverlayGeoJobs(e)}getOverlayGeoJob(e,t,r){var i=this,a=i._processFormat(r),o=new sB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getOverlayGeoJob(e,t)}addOverlayGeoJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new sB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addOverlayGeoJob(e,r,t,function(l){a.overlayGeoJobs[l.id]=l.state})}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var r=this,i=r._processFormat(t),a=new aB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getBuffersJobs(e)}getBuffersJob(e,t,r){var i=this,a=i._processFormat(r),o=new aB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getBuffersJob(e,t)}addBuffersJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new aB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addBuffersJob(e,r,t,function(l){a.buffersJobs[l.id]=l.state})}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var r=this,i=r._processFormat(t),a=new fB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getTopologyValidatorJobs(e)}getTopologyValidatorJob(e,t,r){var i=this,a=i._processFormat(r),o=new fB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getTopologyValidatorJob(e,t)}addTopologyValidatorJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new fB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addTopologyValidatorJob(e,r,t,function(l){a.topologyValidatorJobs[l.id]=l.state})}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var r=this,i=r._processFormat(t),a=new uB(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,format:i});return a.getSummaryAttributesJobs(e)}getSummaryAttributesJob(e,t,r){var i=this,a=i._processFormat(r),o=new uB(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:a});return o.getSummaryAttributesJob(e,t)}addSummaryAttributesJob(e,t,r,i){var a=this,o=a._processFormat(i),s=new uB(a.url,{proxy:a.options.proxy,withCredentials:a.options.withCredentials,crossOrigin:a.options.crossOrigin,headers:a.options.headers,format:o});return s.addSummaryAttributesJob(e,r,t,function(l){a.summaryAttributesJobs[l.id]=l.state})}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||Ni.GEOJSON}}class h$r extends _l{constructor(e,t){super(e,t),this._processingService=new u$r(e,t)}getKernelDensityJobs(e,t){return this._processingService.getKernelDensityJobs(e,t)}getKernelDensityJob(e,t,r){return this._processingService.getKernelDensityJob(e,t,r)}addKernelDensityJob(e,t,r,i){return e=this._processParams(e),this._processingService.addKernelDensityJob(e,t,r,i)}getKernelDensityJobState(e){return this._processingService.getKernelDensityJobState(e)}getSummaryMeshJobs(e,t){return this._processingService.getSummaryMeshJobs(e,t)}getSummaryMeshJob(e,t,r){return this._processingService.getSummaryMeshJob(e,t,r)}addSummaryMeshJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryMeshJob(e,t,r,i)}getSummaryMeshJobState(e){return this._processingService.getSummaryMeshJobState(e)}getQueryJobs(e,t){return this._processingService.getQueryJobs(e,t)}getQueryJob(e,t,r){return this._processingService.getQueryJob(e,t,r)}addQueryJob(e,t,r,i){return e=this._processParams(e),this._processingService.addQueryJob(e,t,r,i)}getQueryJobState(e){return this._processingService.getQueryJobState(e)}getSummaryRegionJobs(e,t){return this._processingService.getSummaryRegionJobs(e,t)}getSummaryRegionJob(e,t,r){return this._processingService.getSummaryRegionJob(e,t,r)}addSummaryRegionJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryRegionJob(e,t,r,i)}getSummaryRegionJobState(e){return this._processingService.getSummaryRegionJobState(e)}getVectorClipJobs(e,t){return this._processingService.getVectorClipJobs(e,t)}getVectorClipJob(e,t,r){return this._processingService.getVectorClipJob(e,t,r)}addVectorClipJob(e,t,r,i){return e=this._processParams(e),this._processingService.addVectorClipJob(e,t,r,i)}getVectorClipJobState(e){return this._processingService.getVectorClipJobState(e)}getOverlayGeoJobs(e,t){return this._processingService.getOverlayGeoJobs(e,t)}getOverlayGeoJob(e,t,r){return this._processingService.getOverlayGeoJob(e,t,r)}addOverlayGeoJob(e,t,r,i){return e=this._processParams(e),this._processingService.addOverlayGeoJob(e,t,r,i)}getoverlayGeoJobState(e){return this._processingService.getoverlayGeoJobState(e)}getBuffersJobs(e,t){return this._processingService.getBuffersJobs(e,t)}getBuffersJob(e,t,r){return this._processingService.getBuffersJob(e,t,r)}addBuffersJob(e,t,r,i){return e=this._processParams(e),this._processingService.addBuffersJob(e,t,r,i)}getBuffersJobState(e){return this._processingService.getBuffersJobState(e)}getTopologyValidatorJobs(e,t){return this._processingService.getTopologyValidatorJobs(e,t)}getTopologyValidatorJob(e,t,r){return this._processingService.getTopologyValidatorJob(e,t,r)}addTopologyValidatorJob(e,t,r,i){return e=this._processParams(e),this._processingService.addTopologyValidatorJob(e,t,r,i)}getTopologyValidatorJobState(e){return this._processingService.getTopologyValidatorJobState(e)}getSummaryAttributesJobs(e,t){return this._processingService.getSummaryAttributesJobs(e,t)}getSummaryAttributesJob(e,t,r){return this._processingService.getSummaryAttributesJob(e,t,r)}addSummaryAttributesJob(e,t,r,i){return e=this._processParams(e),this._processingService.addSummaryAttributesJob(e,t,r,i)}getSummaryAttributesJobState(e){return this._processingService.getSummaryAttributesJobState(e)}_processFormat(e){return e||Ni.GEOJSON}_processParams(e){return e?(e.bounds&&(e.bounds=br.toSuperMapBounds(e.bounds)),e.query&&(e.query=br.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=br.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=br.toProcessingParam(e.geometryClip)),e):{}}}class c$r{constructor(e,t){this.url=e,this.options=t||{}}getAreaSolarRadiationResult(e,t,r){var i=this,a=new YOe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}bufferAnalysis(e,t,r){var i=this,a=new ZOe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}densityAnalysis(e,t,r){var i=this,a=new fRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}generateSpatialData(e,t,r){var i=this,a=new URe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}geoRelationAnalysis(e,t,r){var i=this,a=new HRe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}interpolationAnalysis(e,t,r){var i=this,a=new dDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}mathExpressionAnalysis(e,t,r){var i=this,a=new pDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}overlayAnalysis(e,t,r){var i=this,a=new mDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}routeCalculateMeasure(e,t,r){var i=this,a=new zDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}routeLocate(e,t,r){var i=this,a=new VDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}surfaceAnalysis(e,t,r){var i=this,a=new eNe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainCurvatureCalculate(e,t,r){var i=this,a=new tNe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainCutFillCalculate(e,t,r){var i=this,a=new IDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainAspectCalculate(e,t,r){var i=this,a=new LDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}terrainSlopeCalculate(e,t,r){var i=this,a=new PDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}thiessenAnalysis(e,t,r){var i=this,a=new iNe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}minDistanceAnalysis(e,t,r){var i=this,a=new MDe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}convexHullAnalysis(e,t,r){var i=this,a=new ODe(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,format:i._processFormat(r)});return a.processAsync(e,t)}geometrybatchAnalysis(e,t,r){for(var i=this,a=new aNe(i.url,{format:i._processFormat(r)}),o=[],s=0;s<e.length;s++){var l=e[s];o.push({analystName:l.analystName,param:l.param})}return a.processAsync(o,t)}_processFormat(e){return e||Ni.GEOJSON}}class f$r extends _l{constructor(e,t){super(e,t),this._spatialAnalystService=new c$r(e,t)}getAreaSolarRadiationResult(e,t,r){return this._spatialAnalystService.getAreaSolarRadiationResult(e,t,r)}bufferAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.bufferAnalysis(e,t,r)}densityAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.densityAnalysis(e,t,r)}generateSpatialData(e,t,r){return this._spatialAnalystService.generateSpatialData(e,t,r)}geoRelationAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.geoRelationAnalysis(e,t,r)}interpolationAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.interpolationAnalysis(e,t,r)}mathExpressionAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.mathExpressionAnalysis(e,t,r)}overlayAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.overlayAnalysis(e,t,r)}routeCalculateMeasure(e,t,r){return e=this._processParams(e),this._spatialAnalystService.routeCalculateMeasure(e,t,r)}routeLocate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.routeLocate(e,t,r)}surfaceAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.surfaceAnalysis(e,t,r)}terrainCurvatureCalculate(e,t,r){return this._spatialAnalystService.terrainCurvatureCalculate(e,t,r)}terrainCutFillCalculate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.terrainCutFillCalculate(e,t,r)}terrainAspectCalculate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.terrainAspectCalculate(e,t,r)}terrainSlopeCalculate(e,t,r){return e=this._processParams(e),this._spatialAnalystService.terrainSlopeCalculate(e,t,r)}thiessenAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.thiessenAnalysis(e,t,r)}minDistanceAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.minDistanceAnalysis(e,t,r)}convexHullAnalysis(e,t,r){return e=this._processParams(e),this._spatialAnalystService.convexHullAnalysis(e,t,r)}geometrybatchAnalysis(e,t,r){for(var i=0;i<e.length;i++)e[i].param=this._processParams(e[i].param);return this._spatialAnalystService.geometrybatchAnalysis(e,t,r)}_processParams(e){if(!e)return{};if(e.bounds&&(e.bounds=br.toSuperMapBounds(e.bounds)),e.inputPoints)for(let f=0;f<e.inputPoints.length;f++){var t=e.inputPoints[f];br.isArray(t)?e.inputPoints[f]={x:t[0],y:t[1],tag:t[2]}:e.inputPoints[f]={x:t.getCoordinates()[0],y:t.getCoordinates()[1],tag:t.tag}}if(e.points)for(let f=0;f<e.points.length;f++){let d=e.points[f];br.isArray(d)&&d.setCoordinates(d),e.points[f]=new Ki(d.getCoordinates()[0],d.getCoordinates()[1])}if(e.point){let f=e.point;br.isArray(f)&&f.setCoordinates(f),e.point=new Ki(f.getCoordinates()[0],f.getCoordinates()[1])}if(e.extractRegion&&(e.extractRegion=this.convertGeometry(e.extractRegion)),e.extractParameter&&e.extractParameter.clipRegion&&(e.extractParameter.clipRegion=this.convertGeometry(e.extractParameter.clipRegion)),e.clipParam&&e.clipParam.clipRegion&&(e.clipParam.clipRegion=this.convertGeometry(e.clipParam.clipRegion)),e.sourceGeometry){var r=null;e.sourceGeometrySRID&&(r=e.sourceGeometrySRID),e.sourceGeometry=this.convertGeometry(e.sourceGeometry),r&&(e.sourceGeometry.SRID=r),delete e.sourceGeometry.sourceGeometrySRID}if(e.operateGeometry&&(e.operateGeometry=this.convertGeometry(e.operateGeometry)),e.sourceGeometries){for(var i=[],a=0;a<e.sourceGeometries.length;a++)i.push(this.convertGeometry(e.sourceGeometries[a]));e.sourceGeometries=i}if(e.operateGeometries){for(var o=[],s=0;s<e.operateGeometries.length;s++)o.push(this.convertGeometry(e.operateGeometries[s]));e.operateGeometries=o}if(e.inputGeometries){for(var l=[],u=0;u<e.inputGeometries.length;u++)l.push(this.convertGeometry(e.inputGeometries[u]));e.inputGeometries=l}if(e.sourceRoute&&e.sourceRoute instanceof gm&&e.sourceRoute.getCoordinates()){var h={};h.type="LINEM",h.parts=[e.sourceRoute.getCoordinates()[0].length],h.points=[];for(let f=0;f<e.sourceRoute.getCoordinates()[0].length;f++){let d=e.sourceRoute.getCoordinates()[0][f];h.points=h.points.concat({x:d[0],y:d[1],measure:d[2]})}e.sourceRoute=h}var c=this;return e.operateRegions&&br.isArray(e.operateRegions)&&e.operateRegions.map(function(f,d){return e.operateRegions[d]=c.convertGeometry(f),e.operateRegions[d]}),e.sourceRoute&&e.sourceRoute.components&&br.isArray(e.sourceRoute.components)&&e.sourceRoute.components.map(function(f,d){return e.sourceRoute.components[d]=c.convertGeometry(f),e.sourceRoute.components[d]}),e}_processFormat(e){return e||Ni.GEOJSON}convertGeometry(e){return["FeatureCollection","Feature","Geometry"].indexOf(e.type)!=-1?br.toSuperMapGeometry(e):br.toSuperMapGeometry(JSON.parse(new jc().writeGeometry(e)))}}class d$r extends _l{constructor(e,t){super(e,t);var r=this;this._themeService=new nNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers})}getThemeInfo(e,t){return this._themeService.processAsync(e,t)}}class v$r{constructor(e,t){this.url=e,this.options=t||{}}queryStop(e,t){var r=this,i=new ZDe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}analysisTransferPath(e,t){var r=this,i=new uNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}analysisTransferSolution(e,t){var r=this,i=new cNe(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers});return i.processAsync(e,t)}}class p$r extends _l{constructor(e,t){super(e,t),this._commonTrafficTransferAnalystService=new v$r(e,t)}queryStop(e,t){return this._commonTrafficTransferAnalystService.queryStop(e,t)}analysisTransferPath(e,t){return e=this._processParams(e),this._commonTrafficTransferAnalystService.analysisTransferPath(e,t)}analysisTransferSolution(e,t){return e=this._processParams(e),this._commonTrafficTransferAnalystService.analysisTransferSolution(e,t)}_processParams(e){return e?(e.transferLines&&!br.isArray(e.transferLines)&&(e.transferLines=[e.transferLines]),e.points&&br.isArray(e.points)&&e.points.map(function(t,r){return e.points[r]=t instanceof Qs?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.points[r]}),e):{}}}class g$r extends _l{constructor(e,t){super(e,t),this._webPrintingService=new CNe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}createWebPrintingJob(e,t){if(!!e)return this._webPrintingService.createWebPrintingJob(this._processParams(e),t)}getPrintingJob(e,t){return this._webPrintingService.getPrintingJob(e,t)}getPrintingJobResult(e,t){return this._webPrintingService.getPrintingJobResult(e,t)}getLayoutTemplates(e){return this._webPrintingService.getLayoutTemplates(e)}_processParams(e){return e.layoutOptions&&e.layoutOptions.littleMapOptions&&(e.layoutOptions.littleMapOptions.center=this._toPointObject(e.layoutOptions.littleMapOptions.center)),e.exportOptions&&(e.exportOptions.center=this._toPointObject(e.exportOptions.center)),e}_toPointObject(e){return Array.isArray(e)?{x:e[0],y:e[1]}:e instanceof Ki||e instanceof Qs?{x:e.x,y:e.y}:e}}class y$r extends _l{constructor(e,t){super(e,t),this._imageService=new MNe(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getCollections(e){return this._imageService.getCollections(e)}getCollectionByID(e,t){return this._imageService.getCollectionByID(e,t)}search(e,t){return this._imageService.search(e,t)}}class m$r extends _l{constructor(e,t){super(e,t),this._imageCollectionService=new ANe(this.url,{collectionId:this.options.collectionId,proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getLegend(e,t){return this._imageCollectionService.getLegend(e,t)}getStatistics(e){return this._imageCollectionService.getStatistics(e)}getTileInfo(e){return this._imageCollectionService.getTileInfo(e)}deleteItemByID(e,t){return this._imageCollectionService.deleteItemByID(e,t)}getItemByID(e,t){return this._imageCollectionService.getItemByID(e,t)}}const _$r=[{name:"\u9ED1\u9F99\u6C5F\u7701",coord:[127.64559817675396,48.48668098449708]},{name:"\u5185\u8499\u53E4\u81EA\u6CBB\u533A",coord:[118.34519572208615,45.370218276977525]},{name:"\u65B0\u7586\u7EF4\u543E\u5C14\u81EA\u6CBB\u533A",coord:[87.13479065593184,41.75497055053711]},{name:"\u5409\u6797\u7701",coord:[126.12985278813787,43.57983207702637]},{name:"\u8FBD\u5B81\u7701",coord:[124.02494773936439,41.105743408203125]},{name:"\u7518\u8083\u7701",coord:[102.87785725633012,37.69582366943361]},{name:"\u6CB3\u5317\u7701",coord:[115.66327227481898,39.33383178710938]},{name:"\u5317\u4EAC\u5E02",coord:[116.62199343603638,40.25053787231445]},{name:"\u5C71\u897F\u7701",coord:[112.45180235808988,37.666561126708984]},{name:"\u5929\u6D25\u5E02",coord:[117.35711842642581,39.406789779663086]},{name:"\u9655\u897F\u7701",coord:[109.56294003056632,35.64754199981689]},{name:"\u5B81\u590F\u56DE\u65CF\u81EA\u6CBB\u533A",coord:[105.96110877640074,37.3081169128418]},{name:"\u9752\u6D77\u7701",coord:[96.07301048277901,35.44417190551758]},{name:"\u5C71\u4E1C\u7701",coord:[118.03833752951093,36.29800605773925]},{name:"\u897F\u85CF\u81EA\u6CBB\u533A",coord:[87.47361520439412,31.6703872680664]},{name:"\u6CB3\u5357\u7701",coord:[113.07832397097275,33.87751102447509]},{name:"\u6C5F\u82CF\u7701",coord:[119.93926538201052,32.945452690124505]},{name:"\u5B89\u5FBD\u7701",coord:[117.15146765881019,32.024482727050774]},{name:"\u56DB\u5DDD\u7701",coord:[102.28998890142759,30.182161331176758]},{name:"\u6E56\u5317\u7701",coord:[112.87798261431585,31.157071113586426]},{name:"\u91CD\u5E86\u5E02",coord:[107.870126637831,30.188085556030266]},{name:"\u4E0A\u6D77\u5E02",coord:[121.42561166015514,31.276043891906745]},{name:"\u6D59\u6C5F\u7701",coord:[119.75337092707514,29.175934791564945]},{name:"\u6E56\u5357\u7701",coord:[111.52770282777405,27.38110256195069]},{name:"\u6C5F\u897F\u7701",coord:[115.51091280655628,27.283511161804206]},{name:"\u4E91\u5357\u7701",coord:[101.27053825991308,25.19783210754396]},{name:"\u8D35\u5DDE\u7701",coord:[106.49672346773299,26.92267990112305]},{name:"\u798F\u5EFA\u7701",coord:[117.9976766946587,25.939599990844727]},{name:"\u5E7F\u897F\u58EE\u65CF\u81EA\u6CBB\u533A",coord:[108.98706831086302,23.891559600830078]},{name:"\u53F0\u6E7E\u7701",coord:[120.82468432537434,23.602651596069336]},{name:"\u9999\u6E2F\u7279\u522B\u884C\u653F\u533A",coord:[114.21036850371561,22.374858856201172]},{name:"\u6D77\u5357\u7701",coord:[109.62792940960824,19.163116455078125]},{name:"\u5E7F\u4E1C\u7701",coord:[113.32127888266032,22.873867034912106]},{name:"\u6FB3\u95E8\u7279\u522B\u884C\u653F\u533A",coord:[113.56819996291901,22.160347992976]}],x$r=[{name:"\u514B\u62C9\u739B\u4F9D\u5E02",coord:[85.01486759299489,45.406422237230046]},{name:"\u660C\u5409\u56DE\u65CF\u81EA\u6CBB\u5DDE",coord:[88.7154624754753,44.26991024636568]},{name:"\u77F3\u6CB3\u5B50\u5E02",coord:[86.0208600035924,44.239045558096805]},{name:"\u970D\u6797\u90ED\u52D2\u5E02",coord:[114.73479243733115,44.16058374713977]},{name:"\u672C\u6EAA\u5E02",coord:[124.64357865201586,41.177197783134275]},{name:"\u5609\u5CEA\u5173\u5E02",coord:[98.16891560537093,39.76279786284264]},{name:"\u83B1\u829C\u5E02",coord:[117.65723565456207,36.27916499211527]},{name:"\u795E\u519C\u67B6\u6797\u533A",coord:[110.48296222218153,31.581260143666697]},{name:"\u5929\u95E8\u5E02",coord:[113.00615321481195,30.64105781887143]},{name:"\u9102\u5DDE\u5E02",coord:[114.94764081970385,30.325634953844585]},{name:"\u6F5C\u6C5F\u5E02",coord:[112.70703817700621,30.349210666019893]},{name:"\u4ED9\u6843\u5E02",coord:[113.34688900729822,30.315951161935402]},{name:"\u840D\u4E61\u5E02",coord:[113.88072263074415,27.47193090553213]},{name:"\u53F0\u6E7E\u7701",coord:[120.14338943402045,23.596002465926095]},{name:"\u4E1C\u839E\u5E02",coord:[113.89443658529342,22.897826158636448]},{name:"\u4E2D\u5C71\u5E02",coord:[113.37118387764659,22.501478858616522]},{name:"\u73E0\u6D77\u5E02",coord:[113.21799258934986,22.23782602992192]},{name:"\u5317\u6D77\u5E02",coord:[109.18248083043899,21.695773689750148]},{name:"\u9999\u6E2F",coord:[114.20689279508653,22.36016760139811]},{name:"\u821F\u5C71\u5E02",coord:[122.22514712841459,30.338633120695956]},{name:"\u514B\u5B5C\u52D2\u82CF\u67EF\u5C14\u514B\u5B5C",coord:[74.62910472637343,39.59886016069875]},{name:"\u5580\u4EC0\u5730\u533A",coord:[77.19899922143753,37.85462871211595]},{name:"\u963F\u514B\u82CF\u5730\u533A",coord:[81.43930290016381,41.067304799230456]},{name:"\u548C\u7530\u5730\u533A",coord:[80.69780509160952,36.95287032287055]},{name:"\u963F\u91CC\u5730\u533A",coord:[82.536487505389,32.69566569631762]},{name:"\u65E5\u5580\u5219\u5730\u533A",coord:[86.5996831353606,29.54861754814263]},{name:"\u90A3\u66F2\u5730\u533A",coord:[88.32523292667608,33.20600450932715]},{name:"\u7389\u6811\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[95.2107128446203,33.90320387919257]},{name:"\u8FEA\u5E86\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[99.42465312188943,28.052797714348895]},{name:"\u6012\u6C5F\u5088\u5088\u65CF\u81EA\u6CBB\u5DDE",coord:[98.85737910439825,26.98345757528851]},{name:"\u5927\u7406\u767D\u65CF\u81EA\u6CBB\u5DDE",coord:[99.93934374816013,25.684737357453045]},{name:"\u5FB7\u5B8F\u50A3\u65CF\u666F\u9887\u65CF\u81EA",coord:[98.13830877778075,24.593421919561205]},{name:"\u4FDD\u5C71\u5E02",coord:[99.19031013453166,24.979380341662]},{name:"\u4E34\u6CA7\u5E02",coord:[99.62483778975081,24.058807858948214]},{name:"\u666E\u6D31\u5E02",coord:[100.94440267992684,23.44121660743221]},{name:"\u897F\u53CC\u7248\u7EB3\u50A3\u65CF\u81EA\u6CBB",coord:[100.86105801845994,21.882475641324206]},{name:"\u62C9\u8428\u5E02",coord:[91.3684790613129,30.14176592960237]},{name:"\u5C71\u5357\u5730\u533A",coord:[92.11665242621062,28.33000201578789]},{name:"\u6797\u829D\u5730\u533A",coord:[94.9307847458166,29.125110156601963]},{name:"\u660C\u90FD\u5730\u533A",coord:[97.33912235873476,30.48520825551814]},{name:"\u4E3D\u6C5F\u5E02",coord:[100.65713436205135,26.96190318191959]},{name:"\u6500\u679D\u82B1\u5E02",coord:[101.73355913301131,26.714486678752795]},{name:"\u51C9\u5C71\u5F5D\u65CF\u81EA\u6CBB\u5DDE",coord:[102.08678551422615,27.683020519860396]},{name:"\u695A\u96C4\u5F5D\u65CF\u81EA\u6CBB\u5DDE",coord:[101.68264761198458,25.369603845264024]},{name:"\u7EA2\u6CB3\u54C8\u5C3C\u65CF\u5F5D\u65CF\u81EA",coord:[102.95101719613119,23.624860095239875]},{name:"\u6587\u5C71\u58EE\u65CF\u82D7\u65CF\u81EA\u6CBB",coord:[104.8708359910614,23.579587266862504]},{name:"\u767E\u8272\u5E02",coord:[106.69546907589859,23.98220841166522]},{name:"\u5D07\u5DE6\u5E02",coord:[107.3277087317123,22.49769755349952]},{name:"\u9632\u57CE\u6E2F\u5E02",coord:[107.88939931155171,21.94550204069006]},{name:"\u5357\u5B81\u5E02",coord:[108.67078983716917,23.12207641861882]},{name:"\u94A6\u5DDE\u5E02",coord:[108.8532307305186,22.157690108421384]},{name:"\u7389\u6797\u5E02",coord:[110.26918466489103,22.391823643610415]},{name:"\u6E5B\u6C5F\u5E02",coord:[109.93033457863683,21.086751055633457]},{name:"\u8302\u540D\u5E02",coord:[110.80336192333934,22.069184739040775]},{name:"\u9633\u6C5F\u5E02",coord:[111.70471342186183,22.108751366417575]},{name:"\u6C5F\u95E8\u5E02",coord:[112.53715618649149,22.297368082806777]},{name:"\u5E7F\u5DDE\u5E02",coord:[113.4949302208309,23.28359314707863]},{name:"\u6E05\u8FDC\u5E02",coord:[113.10957368131268,24.334444053233856]},{name:"\u8087\u5E86\u5E02",coord:[112.11117530204233,23.60241158796112]},{name:"\u68A7\u5DDE\u5E02",coord:[111.01709510772797,23.518132876753846]},{name:"\u8D3A\u5DDE\u5E02",coord:[111.50423061842756,24.4095096817199]},{name:"\u6842\u6797\u5E02",coord:[110.44046163393094,25.353966673735407]},{name:"\u67F3\u5DDE\u5E02",coord:[109.34854449214147,24.972408051485047]},{name:"\u6CB3\u6C60\u5E02",coord:[107.81191841865586,24.649291651298164]},{name:"\u9ED4\u4E1C\u5357\u82D7\u65CF\u4F97\u65CF\u81EA",coord:[108.39952601614591,26.429286420465576]},{name:"\u8D35\u9633\u5E02",coord:[106.59784062851153,26.797907456479816]},{name:"\u5B89\u987A\u5E02",coord:[105.76161265300635,25.988644902171018]},{name:"\u9ED4\u897F\u5357\u5E03\u4F9D\u65CF\u82D7\u65CF",coord:[105.5954078788574,25.404850939549405]},{name:"\u66F2\u9756\u5E02",coord:[103.9164335632742,25.697243690315265]},{name:"\u516D\u76D8\u6C34\u5E02",coord:[104.77723228072432,26.15402255629164]},{name:"\u6BD5\u8282\u5730\u533A",coord:[105.03867422931839,27.077913968069666]},{name:"\u662D\u901A\u5E02",coord:[104.29730513046874,27.62418247971078]},{name:"\u5B9C\u5BBE\u5E02",coord:[104.76748901448207,28.553501804266475]},{name:"\u4E50\u5C71\u5E02",coord:[103.56027669102787,29.160754519210577]},{name:"\u81EA\u8D21\u5E02",coord:[104.63272827056402,29.273152614922402]},{name:"\u5185\u6C5F\u5E02",coord:[104.82644562304716,29.61272653799929]},{name:"\u9075\u4E49\u5E02",coord:[106.82413636302059,28.191847588570702]},{name:"\u8FBE\u5DDE\u5E02",coord:[107.59704170009518,31.32138258839703]},{name:"\u9042\u5B81\u5E02",coord:[105.48979445433736,30.677687821242678]},{name:"\u5E7F\u5B89\u5E02",coord:[106.56708164098042,30.43500706741521]},{name:"\u6CF8\u5DDE\u5E02",coord:[105.42591761727707,28.50277238478137]},{name:"\u8D44\u9633\u5E02",coord:[104.97995126874034,30.154251886139654]},{name:"\u96C5\u5B89\u5E02",coord:[102.69931299964517,29.892630706195035]},{name:"\u7709\u5C71\u5E02",coord:[104.07052881858888,29.894202166560405]},{name:"\u7518\u5B5C\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[100.50721042614238,30.975216556269658]},{name:"\u679C\u6D1B\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[99.30775565051923,34.03539865224808]},{name:"\u6D77\u5357\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[100.39969108016373,35.90048272566899]},{name:"\u9EC4\u5357\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[101.5360706381689,35.10286360841902]},{name:"\u8D63\u5357\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[102.97083885806067,34.326752803339026]},{name:"\u9647\u5357\u5E02",coord:[105.24780098912132,33.57031117443431]},{name:"\u5929\u6C34\u5E02",coord:[105.53503634660417,34.62320421368087]},{name:"\u5B9A\u897F\u5E02",coord:[104.58787768541339,35.08900966621695]},{name:"\u4E34\u590F\u56DE\u65CF\u81EA\u6CBB\u5DDE",coord:[103.2612870434902,35.591577124455235]},{name:"\u897F\u5B81\u5E02",coord:[101.57680657999033,36.84800271717157]},{name:"\u6D77\u4E1C\u5730\u533A",coord:[102.30909850729282,36.287400615025646]},{name:"\u6D77\u5317\u85CF\u65CF\u81EA\u6CBB\u5DDE",coord:[100.27122484450717,37.892557516083826]},{name:"\u91D1\u660C\u5E02",coord:[102.02244049169511,38.497330414886164]},{name:"\u9152\u6CC9\u5E02",coord:[95.94486678270127,40.56891536586272]},{name:"\u6D77\u897F\u8499\u53E4\u65CF\u85CF\u65CF\u81EA",coord:[94.67143298050689,36.022725148503724]},{name:"\u5DF4\u97F3\u90ED\u695E\u8499\u53E4\u81EA\u6CBB",coord:[88.18116214759745,39.556478810319916]},{name:"\u54C8\u5BC6\u5730\u533A",coord:[93.84302392518026,42.95015211178875]},{name:"\u53F6\u9C81\u756A\u5730\u533A",coord:[89.82035217277885,42.399368632283505]},{name:"\u4E4C\u9C81\u6728\u9F50\u5E02",coord:[88.00048109561487,43.549986370786]},{name:"\u963F\u52D2\u6CF0\u5730\u533A",coord:[88.11213933257655,47.05593413019629]},{name:"\u535A\u5C14\u5854\u62C9\u8499\u53E4\u81EA\u6CBB",coord:[82.26402238163408,44.671135542630864]},{name:"\u4F0A\u7281\u54C8\u8428\u514B\u81EA\u6CBB\u5DDE",coord:[82.80778717477179,43.53783381365267]},{name:"\u963F\u62C9\u5584\u76DF",coord:[103.29923966842289,40.10955801781495]},{name:"\u6B66\u5A01\u5E02",coord:[102.73362058791429,37.94211141321436]},{name:"\u5170\u5DDE\u5E02",coord:[103.73793563506032,36.27379827886003]},{name:"\u4E2D\u536B\u5E02",coord:[105.6943786030716,37.20654236148948]},{name:"\u94F6\u5DDD\u5E02",coord:[106.20022174140034,38.52103167597483]},{name:"\u77F3\u5634\u5C71\u5E02",coord:[106.41544011793628,38.84054137571417]},{name:"\u4E4C\u6D77\u5E02",coord:[106.8984175998405,39.54616572239788]},{name:"\u9102\u5C14\u591A\u65AF\u5E02",coord:[108.43285571424619,39.24036799350715]},{name:"\u5DF4\u5F66\u6DD6\u5C14\u5E02",coord:[107.45840392808307,41.30159860424196]},{name:"\u5305\u5934\u5E02",coord:[110.46472193224272,41.48017783644221]},{name:"\u547C\u548C\u6D69\u7279\u5E02",coord:[111.48365173603975,40.498363056149884]},{name:"\u4E4C\u5170\u5BDF\u5E03\u5E02",coord:[112.61568977597707,41.75789561273154]},{name:"\u5927\u540C\u5E02",coord:[113.7107192749083,39.898956799744184]},{name:"\u6714\u5DDE\u5E02",coord:[112.65428748167508,39.681772914701924]},{name:"\u5FFB\u5DDE\u5E02",coord:[112.36127575589583,38.88990233614568]},{name:"\u6986\u6797\u5E02",coord:[109.68473112169593,38.19921027134876]},{name:"\u5EF6\u5B89\u5E02",coord:[109.52425222161318,36.406522726136814]},{name:"\u5E86\u9633\u5E02",coord:[107.73052193155061,36.183821532624464]},{name:"\u56FA\u539F\u5E02",coord:[106.20191575442442,36.11634909496382]},{name:"\u767D\u94F6\u5E02",coord:[104.68634478137065,36.51582865625868]},{name:"\u5B9D\u9E21\u5E02",coord:[107.33534779230747,34.3387216485855]},{name:"\u6C49\u4E2D\u5E02",coord:[107.03534754266246,33.00142998064871]},{name:"\u5E7F\u5143\u5E02",coord:[105.92928137563939,32.21872447205537]},{name:"\u5DF4\u4E2D\u5E02",coord:[107.03422410306194,31.99874720836291]},{name:"\u5357\u5145\u5E02",coord:[106.32964805032347,31.156657700184095]},{name:"\u7EF5\u9633\u5E02",coord:[104.58949560201106,31.88628780630976]},{name:"\u5FB7\u9633\u5E02",coord:[104.41542984932845,31.110558133718676]},{name:"\u6210\u90FD\u5E02",coord:[103.8852290010473,30.777258040348634]},{name:"\u963F\u575D\u85CF\u65CF\u7F8C\u65CF\u81EA\u6CBB",coord:[102.26209319552814,32.45725845387284]},{name:"\u5B89\u5EB7\u5E02",coord:[109.14236501848015,32.77467694678074]},{name:"\u5341\u5830\u5E02",coord:[110.39934083416314,32.376209039347906]},{name:"\u8944\u9633\u5E02",coord:[111.97539147094662,31.93399822417465]},{name:"\u5B9C\u660C\u5E02",coord:[111.22204852395754,30.772457669035354]},{name:"\u6069\u65BD\u5E02",coord:[109.42158366502872,30.260366574390105]},{name:"\u5F20\u5BB6\u754C\u5E02",coord:[110.59760006538717,29.330107409240718]},{name:"\u5409\u9996\u5E02",coord:[109.72176899848378,28.681903937242495]},{name:"\u94DC\u4EC1\u5730\u533A",coord:[108.54247523485463,28.11736237519646]},{name:"\u91CD\u5E86\u5E02",coord:[107.86007108564992,30.186253395053196]},{name:"\u6000\u5316\u5E02",coord:[109.94325166787243,27.43919084801186]},{name:"\u76CA\u9633\u5E02",coord:[112.43060358108062,28.75127294553697]},{name:"\u5A04\u5E95\u5E02",coord:[111.41891416951897,27.696312460064604]},{name:"\u5E38\u5FB7\u5E02",coord:[111.72571610131646,29.27189463838195]},{name:"\u8346\u5DDE\u5E02",coord:[112.65896596965268,30.05161542755362]},{name:"\u8346\u95E8\u5E02",coord:[112.6586855902184,31.01267124474617]},{name:"\u5CB3\u9633\u5E02",coord:[113.2595036144316,29.106247116930163]},{name:"\u957F\u6C99\u5E02",coord:[113.15415586456598,28.222934680488425]},{name:"\u6E58\u6F6D\u5E02",coord:[112.51092596317824,27.69881544105668]},{name:"\u682A\u5DDE\u5E02",coord:[113.49665538546823,27.03993794610501]},{name:"\u8861\u9633\u5E02",coord:[112.48849636578527,26.783613569970782]},{name:"\u90B5\u9633\u5E02",coord:[110.6723832117475,26.81652287086792]},{name:"\u6C38\u5DDE\u5E02",coord:[111.8565364154186,25.768488267811968]},{name:"\u97F6\u5173\u5E02",coord:[113.53420325850979,24.69848878771937]},{name:"\u60E0\u5DDE\u5E02",coord:[114.32029589634925,23.25504544231892]},{name:"\u4F5B\u5C71\u5E02",coord:[112.95925897403649,23.10116677189257]},{name:"\u4E91\u6D6E\u5E02",coord:[111.78042514904234,22.840400494105687]},{name:"\u6DF1\u5733\u5E02",coord:[114.13138648919008,22.649563063468342]},{name:"\u6C55\u5C3E\u5E02",coord:[115.57412892884373,23.06989642104901]},{name:"\u6CB3\u6E90\u5E02",coord:[114.89746229844398,23.97971937124767]},{name:"\u63ED\u9633\u5E02",coord:[116.04290004239446,23.304802704715357]},{name:"\u6C55\u5934\u5E02",coord:[116.7008461897183,23.35898625947344]},{name:"\u6F6E\u5DDE\u5E02",coord:[116.75405548481658,23.854381508863064]},{name:"\u6885\u5DDE\u5E02",coord:[116.13719397345734,24.15633544812716]},{name:"\u6F33\u5DDE\u5E02",coord:[117.38279760543345,24.41111215459575]},{name:"\u53A6\u95E8\u5E02",coord:[118.04275971554665,24.675908246507944]},{name:"\u9F99\u5CA9\u5E02",coord:[116.69341144552507,25.20284542644492]},{name:"\u6CC9\u5DDE\u5E02",coord:[118.12035864630246,25.22984144365049]},{name:"\u8386\u7530\u5E02",coord:[118.82439690138142,25.439653480972687]},{name:"\u798F\u5DDE\u5E02",coord:[119.1608285845262,25.99117532466728]},{name:"\u4E09\u660E\u5E02",coord:[117.51188176216434,26.318292906961602]},{name:"\u5357\u5E73\u5E02",coord:[118.16153136678187,27.306303151805437]},{name:"\u629A\u5DDE\u5E02",coord:[116.3455359885574,27.487043655935366]},{name:"\u9E70\u6F6D\u5E02",coord:[117.01082360702333,28.241253742969946]},{name:"\u5409\u5B89\u5E02",coord:[114.91377151807418,26.957486660664525]},{name:"\u8D63\u5DDE\u5E02",coord:[115.046455717572,25.81565075681663]},{name:"\u90F4\u5DDE\u5E02",coord:[113.1544526703492,25.871927095452524]},{name:"\u65B0\u4F59\u5E02",coord:[114.94161795877827,27.79044654578371]},{name:"\u5B9C\u6625\u5E02",coord:[115.04574494880995,28.306428044943356]},{name:"\u5357\u660C\u5E02",coord:[115.9963824234495,28.664803351584705]},{name:"\u4E5D\u6C5F\u5E02",coord:[115.53225905704193,29.362905920276297]},{name:"\u4E0A\u9976\u5E02",coord:[117.8595355766598,28.765755150094634]},{name:"\u666F\u5FB7\u9547\u5E02",coord:[117.25387030721845,29.33426823662448]},{name:"\u9EC4\u5C71\u5E02",coord:[117.85476357809696,29.969632034273722]},{name:"\u6C60\u5DDE\u5E02",coord:[117.34517113140791,30.208089337922335]},{name:"\u94DC\u9675\u5E02",coord:[117.93160431300694,30.926442655001676]},{name:"\u5B89\u5E86\u5E02",coord:[116.54307680610799,30.524265461641296]},{name:"\u9EC4\u77F3\u5E02",coord:[115.02354597728443,29.924060229331015]},{name:"\u54B8\u5B81\u5E02",coord:[114.26967602231792,29.652174021136048]},{name:"\u9EC4\u5188\u5E02",coord:[115.2859016705373,30.65856897065683]},{name:"\u6B66\u6C49\u5E02",coord:[114.34552076948799,30.68836237966767]},{name:"\u968F\u5DDE\u5E02",coord:[113.3850627838818,31.87891659924412]},{name:"\u4FE1\u9633\u5E02",coord:[114.81374730587638,32.0309685135914]},{name:"\u9A7B\u9A6C\u5E97\u5E02",coord:[114.07756451509235,32.896720987266114]},{name:"\u5546\u6D1B\u5E02",coord:[109.82044421310393,33.77403373563189]},{name:"\u897F\u5B89\u5E02",coord:[109.11839808451401,34.225257215515896]},{name:"\u6E2D\u5357\u5E02",coord:[109.75732444226935,35.025913644359306]},{name:"\u94DC\u5DDD\u5E02",coord:[108.98695328111377,35.19235092947735]},{name:"\u54B8\u9633\u5E02",coord:[108.36398776446165,34.84311348287181]},{name:"\u4E09\u95E8\u5CE1\u5E02",coord:[110.80049688104964,34.31818709571671]},{name:"\u8FD0\u57CE\u5E02",coord:[111.1736679525165,35.19010372283576]},{name:"\u6D1B\u9633\u5E02",coord:[111.87577573098216,34.33379926109848]},{name:"\u5E73\u9876\u5C71\u5E02",coord:[112.80931281928427,33.759895800153096]},{name:"\u6F2F\u6CB3\u5E02",coord:[113.83505724178012,33.70034266174508]},{name:"\u8BB8\u660C\u5E02",coord:[113.78762484088509,34.051835688452435]},{name:"\u90D1\u5DDE\u5E02",coord:[113.49619951867594,34.61181797865449]},{name:"\u7126\u4F5C\u5E02",coord:[113.13404280173008,35.134167097471625]},{name:"\u664B\u57CE\u5E02",coord:[112.7495732073233,35.63186423091449]},{name:"\u957F\u6CBB\u5E02",coord:[112.85900842873183,36.45872910742828]},{name:"\u4E34\u6C7E\u5E02",coord:[111.49379787924448,36.22810800777857]},{name:"\u592A\u539F\u5E02",coord:[112.15628804033796,37.91704444063036]},{name:"\u5415\u6881\u5E02",coord:[111.31901105774872,37.712740463356496]},{name:"\u664B\u4E2D\u5E02",coord:[113.08199599739676,37.36532613794343]},{name:"\u90AF\u90F8\u5E02",coord:[114.41824047234618,36.530119932543315]},{name:"\u5B89\u9633\u5E02",coord:[113.88883283163116,35.7797611183252]},{name:"\u9E64\u58C1\u5E02",coord:[114.3654094911545,35.75770487428472]},{name:"\u65B0\u4E61\u5E02",coord:[113.9184107718167,35.348471214026716]},{name:"\u5F00\u5C01\u5E02",coord:[114.52801677500626,34.61371216679872]},{name:"\u5468\u53E3\u5E02",coord:[114.88509782391864,33.69999759722657]},{name:"\u961C\u9633\u5E02",coord:[115.44595951398213,32.98060371610532]},{name:"\u6DEE\u5357\u5E02",coord:[116.68941991880993,32.79972275772595]},{name:"\u868C\u57E0\u5E02",coord:[117.38594715783302,33.106729536033896]},{name:"\u6DEE\u5317\u5E02",coord:[116.69651711889378,33.69527529383458]},{name:"\u5BBF\u5DDE\u5E02",coord:[117.30175405886838,33.943330421260015]},{name:"\u4EB3\u5DDE\u5E02",coord:[116.12410804185097,33.46769392946132]},{name:"\u5546\u4E18\u5E02",coord:[115.59575176872548,34.28339840831147]},{name:"\u83CF\u6CFD\u5E02",coord:[115.53631974831816,35.197319393220624]},{name:"\u6FEE\u9633\u5E02",coord:[115.3070485514902,35.775883510964334]},{name:"\u804A\u57CE\u5E02",coord:[115.8870069012884,36.40529594548765]},{name:"\u90A2\u53F0\u5E02",coord:[114.74259008644859,37.251396750084155]},{name:"\u77F3\u5BB6\u5E84\u5E02",coord:[114.56923838363613,38.13141710980106]},{name:"\u9633\u6CC9\u5E02",coord:[113.39216149668508,38.09075470547468]},{name:"\u4FDD\u5B9A\u5E02",coord:[115.261524468934,39.09118520781398]},{name:"\u8861\u6C34\u5E02",coord:[115.8182936677897,37.715661598187154]},{name:"\u5FB7\u5DDE\u5E02",coord:[116.4582273790399,37.19372347888644]},{name:"\u6CA7\u5DDE\u5E02",coord:[116.76192710911863,38.20240042039232]},{name:"\u5ECA\u574A\u5E02",coord:[116.50410772133856,39.27896741763884]},{name:"\u5929\u6D25\u5E02",coord:[117.31988934444873,39.37154482470619]},{name:"\u5317\u4EAC\u5E02",coord:[116.59734730757869,40.237112944270976]},{name:"\u5F20\u5BB6\u53E3\u5E02",coord:[115.1823606483226,40.83732566607167]},{name:"\u5510\u5C71\u5E02",coord:[117.8693184261954,39.71862889477249]},{name:"\u79E6\u7687\u5C9B\u5E02",coord:[119.30467355367742,39.990574652162564]},{name:"\u627F\u5FB7\u5E02",coord:[117.16275671911026,41.36623845548547]},{name:"\u846B\u82A6\u5C9B\u5E02",coord:[119.9342336210531,40.5628822626519]},{name:"\u671D\u9633\u5E02",coord:[120.11853493535794,41.471852354885755]},{name:"\u8D64\u5CF0\u5E02",coord:[118.50943546234379,43.25452976059767]},{name:"\u9526\u5DDE\u5E02",coord:[121.5167549323861,41.45933087433065]},{name:"\u8425\u53E3\u5E02",coord:[122.58571915054674,40.42093503997384]},{name:"\u4E39\u4E1C\u5E02",coord:[124.33549382902183,40.46369290272115]},{name:"\u8FBD\u9633\u5E02",coord:[123.34064798039414,41.152331397771356]},{name:"\u76D8\u9526\u5E02",coord:[122.06718005354679,41.05573599862555]},{name:"\u961C\u65B0\u5E02",coord:[121.93889757908204,42.27641773244204]},{name:"\u978D\u5C71\u5E02",coord:[122.78904432242356,40.77781183142038]},{name:"\u6C88\u9633\u5E02",coord:[122.99508899709724,42.1162195010079]},{name:"\u94C1\u5CAD\u5E02",coord:[124.23100515588399,42.72666083611828]},{name:"\u6276\u987A\u5E02",coord:[124.46027188217573,41.82955407638859]},{name:"\u901A\u8FBD\u5E02",coord:[122.0729370657937,43.90889130864869]},{name:"\u5174\u5B89\u76DF",coord:[120.79456431092532,45.92003249442161]},{name:"\u767D\u57CE\u5E02",coord:[123.10619907715235,45.25475749267784]},{name:"\u9F50\u9F50\u54C8\u5C14\u5E02",coord:[124.5462214659102,47.55395009317394]},{name:"\u5927\u5174\u5B89\u5CAD\u5730\u533A",coord:[124.50992855161529,52.18438447846694]},{name:"\u9ED1\u6CB3\u5E02",coord:[127.14721400335922,49.25080134026901]},{name:"\u5927\u5E86\u5E02",coord:[124.40329830095243,46.401048760966745]},{name:"\u7EE5\u5316\u5E02",coord:[126.5214484055605,46.76992452194825]},{name:"\u677E\u539F\u5E02",coord:[124.21244334807682,44.75779381338502]},{name:"\u56DB\u5E73\u5E02",coord:[124.27839350328821,43.52139065090318]},{name:"\u901A\u5316\u5E02",coord:[125.67392830706305,41.91771808663852]},{name:"\u8FBD\u6E90\u5E02",coord:[125.33529527643432,42.758340204944986]},{name:"\u5409\u6797\u5E02",coord:[126.83350281902375,43.60730120049175]},{name:"\u957F\u6625\u5E02",coord:[125.53597875970374,44.24624314701737]},{name:"\u767D\u5C71\u5E02",coord:[127.16780160322108,42.093893880305075]},{name:"\u54C8\u5C14\u6EE8\u5E02",coord:[127.39125008786029,45.36200668820575]},{name:"\u9E64\u5C97\u5E02",coord:[130.4703811258197,47.66520688940109]},{name:"\u4F0A\u6625\u5E02",coord:[128.91240831703635,47.93833794565277]},{name:"\u4E03\u53F0\u6CB3\u5E02",coord:[131.2677920224311,45.945099776108584]},{name:"\u9E21\u897F\u5E02",coord:[132.38059153660274,45.722934218318535]},{name:"\u53CC\u9E2D\u5C71\u5E02",coord:[132.3184817002743,46.65813679030265]},{name:"\u4F73\u6728\u65AF\u5E02",coord:[132.26174446608726,47.17569713691394]},{name:"\u547C\u4F26\u8D1D\u5C14\u5E02",coord:[122.3210739998419,50.18176996070858]},{name:"\u5B5D\u611F\u5E02",coord:[113.83749892135485,31.11757234692128]},{name:"\u8D35\u6E2F\u5E02",coord:[110.07354588052804,23.380735604767374]},{name:"\u9ED4\u5357\u5E03\u4F9D\u65CF\u82D7\u65CF\u81EA",coord:[107.30931767543106,26.2976919432269]},{name:"\u5B81\u5FB7\u5E02",coord:[119.52482556634342,27.013151692716413]},{name:"\u6E29\u5DDE\u5E02",coord:[120.30037042732202,27.8699145504001]},{name:"\u53F0\u5DDE\u5E02",coord:[120.88886782713843,28.670799172772313]},{name:"\u4E3D\u6C34\u5E02",coord:[119.56796851966463,28.170268394477755]},{name:"\u8862\u5DDE\u5E02",coord:[118.79479802644406,28.865874397158763]},{name:"\u91D1\u534E\u5E02",coord:[119.99381920686633,29.093455548185744]},{name:"\u7ECD\u5174\u5E02",coord:[120.46546691682343,29.69382513836818]},{name:"\u5B81\u6CE2\u5E02",coord:[121.42142987830871,29.70001162878972]},{name:"\u676D\u5DDE\u5E02",coord:[119.4405685790891,29.87218307296989]},{name:"\u5BA3\u57CE\u5E02",coord:[118.68748382914703,30.628143499626418]},{name:"\u6E56\u5DDE\u5E02",coord:[119.98261306633574,30.7945175862809]},{name:"\u5609\u5174\u5E02",coord:[120.83889215988998,30.67538495499343]},{name:"\u4E0A\u6D77\u5E02",coord:[121.37534147322967,31.25628247908459]},{name:"\u82CF\u5DDE\u5E02",coord:[120.6906182622391,31.381280695137775]},{name:"\u65E0\u9521\u5E02",coord:[120.32182300914366,31.54113306724517]},{name:"\u5E38\u5DDE\u5E02",coord:[119.61953292830165,31.611878565375576]},{name:"\u5357\u4EAC\u5E02",coord:[118.71890548838064,31.910863187910323]},{name:"\u9547\u6C5F\u5E02",coord:[119.42349332902813,31.97942313430778]},{name:"\u5408\u80A5\u5E02",coord:[117.30651975617157,31.79407863049138]},{name:"\u516D\u5B89\u5E02",coord:[116.24668220575353,31.820846193819513]},{name:"\u6EC1\u5DDE\u5E02",coord:[117.88422385307969,32.51792621904418]},{name:"\u6CF0\u5DDE\u5E02",coord:[120.03124303305091,32.56503102346783]},{name:"\u5357\u901A\u5E02",coord:[120.85599446760912,32.18496706099728]},{name:"\u76D0\u57CE\u5E02",coord:[120.01812490612667,33.54219948734023]},{name:"\u6DEE\u5B89\u5E02",coord:[119.0749424205415,33.39203631772854]},{name:"\u5BBF\u8FC1\u5E02",coord:[118.45404943216346,33.666258719120265]},{name:"\u5F90\u5DDE\u5E02",coord:[117.77482249295966,34.30847766157078]},{name:"\u6D4E\u5B81\u5E02",coord:[116.74147276546373,35.27488504351119]},{name:"\u67A3\u5E84\u5E02",coord:[117.43359942491492,34.884162021736]},{name:"\u8FDE\u4E91\u6E2F\u5E02",coord:[119.01553213785074,34.54316517587849]},{name:"\u4E34\u6C82\u5E02",coord:[118.31478835349617,35.28173079028279]},{name:"\u65E5\u7167\u5E02",coord:[119.14265350444272,35.54479073199592]},{name:"\u9752\u5C9B\u5E02",coord:[120.27779044405756,36.3464117375903]},{name:"\u5A01\u6D77\u5E02",coord:[122.12963327195605,37.13879077904251]},{name:"\u70DF\u53F0\u5E02",coord:[120.7689567423966,37.19772002195597]},{name:"\u6F4D\u574A\u5E02",coord:[119.02178548592039,36.49292234053931]},{name:"\u6DC4\u535A\u5E02",coord:[117.92936024367185,36.60871347163638]},{name:"\u6CF0\u5B89\u5E02",coord:[116.93810893944303,36.0423330118612]},{name:"\u6D4E\u5357\u5E02",coord:[117.34560282551296,36.769574973846304]},{name:"\u4E1C\u8425\u5E02",coord:[118.4915054457184,37.52194690335787]},{name:"\u6EE8\u5DDE\u5E02",coord:[117.67610299757533,37.4439597758601]},{name:"\u6606\u660E\u5E02",coord:[102.93100245594789,25.481300763922075]},{name:"\u7389\u6EAA\u5E02",coord:[102.23080854291823,24.156168324611663]},{name:"\u5854\u57CE\u5730\u533A",coord:[83.60908162840168,45.3721852373893]},{name:"\u5F20\u6396\u5E02",coord:[100.47710030600572,38.704239320458385]},{name:"\u5357\u9633\u5E02",coord:[112.1400670951149,33.03033276715801]},{name:"\u626C\u5DDE\u5E02",coord:[119.48949608990988,32.80956776339646]},{name:"\u5EF6\u8FB9\u671D\u9C9C\u65CF\u81EA\u6CBB\u5DDE",coord:[129.3577692895626,43.24968794080283]},{name:"\u7261\u4E39\u6C5F\u5E02",coord:[129.87240796405672,44.7073040108322]},{name:"\u6FB3\u95E8",coord:[113.56289691515346,22.14602596262204]},{name:"\u5434\u5FE0\u5E02",coord:[106.76894508116403,37.72566765880316]},{name:"\u6765\u5BBE\u5E02",coord:[109.25592217010114,23.86346274681084]},{name:"\u5E73\u51C9\u5E02",coord:[107.0708132782897,35.30329631658711]},{name:"\u9A6C\u978D\u5C71\u5E02",coord:[118.27245878467022,31.657727937739004]},{name:"\u829C\u6E56\u5E02",coord:[118.32992684415504,31.081688223101658]},{name:"\u6F84\u8FC8\u53BF",coord:[110.04198076060266,19.694955078668105]},{name:"\u4FDD\u4EAD\u9ECE\u65CF\u82D7\u65CF\u81EA\u6CBB",coord:[109.6055304964257,18.6101488675304]},{name:"\u4E50\u4E1C\u9ECE\u65CF\u81EA\u6CBB\u53BF",coord:[109.04051999525574,18.643137437909203]},{name:"\u510B\u5DDE\u5E02",coord:[109.3431358337404,19.550974957403195]},{name:"\u5B9A\u5B89\u53BF",coord:[110.38744429685676,19.47557074114284]},{name:"\u5C6F\u660C\u53BF",coord:[110.00574767630334,19.367175093044388]},{name:"\u767D\u6C99\u9ECE\u65CF\u81EA\u6CBB\u53BF",coord:[109.36860737761768,19.214416393082217]},{name:"\u743C\u4E2D\u9ECE\u65CF\u82D7\u65CF\u81EA\u6CBB",coord:[109.86691465937548,19.073671135862682]},{name:"\u4E1C\u65B9\u5E02",coord:[108.86903802405428,19.017352815445214]},{name:"\u660C\u6C5F\u9ECE\u65CF\u81EA\u6CBB\u53BF",coord:[108.9686431884767,19.182594167127824]},{name:"\u6D77\u53E3\u5E02",coord:[110.420654296875,19.806565564640795]},{name:"\u6D4E\u6E90\u5E02",coord:[112.38051465474433,35.07958362422394]},{name:"\u4E94\u6307\u5C71\u5E02",coord:[109.53595187364496,18.832908264613966]},{name:"\u5927\u8FDE\u5E02",coord:[121.96662235866603,39.444150542439914]},{name:"\u6587\u660C\u5E02\u4E09\u6C99\u5E02",coord:[110.81828537536748,19.756501444162936]},{name:"\u4E09\u4E9A\u5E02",coord:[109.38424600793707,18.39186315877128]},{name:"\u4E07\u5B81\u5E02",coord:[110.28485046979574,18.860240588635115]},{name:"\u9675\u6C34\u9ECE\u65CF\u81EA\u6CBB\u53BF",coord:[109.95577603229562,18.594712684620465]},{name:"\u4E34\u9AD8\u53BF",coord:[109.71915395436967,19.79420403032508]},{name:"\u743C\u6D77\u5E02",coord:[110.41650700703043,19.22315873149372]}],S$r=[{id:"SalesJan2009",fileName:"SalesJan2009",xField:"Longitude",yField:"Latitude",type:"POINT"},{id:"Sacramentorealestatetransactions",fileName:"Ealestate transactions",xField:"longitude",yField:"latitude",type:"POINT"},{id:"BeijingResidentialDistrict",fileName:"\u5317\u4EAC\u5E02\u4F4F\u5B85\u5C0F\u533A",xField:"SmX",yField:"SmY",type:"POINT"},{id:"GlobalRecordOfOver7Earthquakes",fileName:"\u5168\u7403\u5386\u53F27\u7EA7\u4EE5\u4E0A\u5730\u9707\u8BB0\u5F55",xField:"\u7ECF\u5EA6",yField:"\u7EAC\u5EA6",type:"POINT"},{id:"ChinaRecordOfOver6Earthquakes",fileName:"\u4E2D\u56FD\u5386\u53F26\u7EA7\u4EE5\u4E0A\u5730\u9707\u8BB0\u5F55",xField:"\u7ECF\u5EA6",yField:"\u7EAC\u5EA6",type:"POINT"},{id:"ChinaMeteorologicalObservationStation",fileName:"\u4E2D\u56FD\u6C14\u8C61\u89C2\u6D4B\u7AD9",xField:"\u7ECF\u5EA6",yField:"\u7EAC\u5EA6",type:"POINT"},{id:"BeijingSubwayLine",fileName:"\u5317\u4EAC\u5E02\u5730\u94C1\u4EA4\u901A\u7EBF\u8DEF",type:"LINE"},{id:"ChinaEarthquakeIntensityZone",fileName:"\u4E2D\u56FD\u5730\u9707\u70C8\u5EA6\u533A\u5212\u9762",type:"POLYGON"}];function ZN(n){var e=Object.keys(n.defs),t=e.length,r,i;for(r=0;r<t;++r){var a=e[r];if(!ya(a)){var o=n.defs(a),s=o.units;!s&&o.projName==="longlat"&&(s=$c.DEGREES),fue(new ew({code:a,axisOrientation:o.axis,metersPerUnit:o.to_meter,units:s}))}}for(r=0;r<t;++r){var l=e[r],u=ya(l);for(i=0;i<t;++i){var h=e[i],c=ya(h);if(!Bje(l,h))if(n.defs[l]===n.defs[h])Tte([u,c]);else{var f=n(l,h);Myr(u,c,K2e(u,c,f.forward),K2e(c,u,f.inverse))}}}}const wQe=Object.freeze(Object.defineProperty({__proto__:null,register:ZN},Symbol.toStringTag,{value:"Module"}));function bQe(n,e,t){for(var r=[],i=n(0),a=n(1),o=e(i),s=e(a),l=[a,i],u=[s,o],h=[1,0],c={},f=1e5,d,v,p,g,m,y;--f>0&&h.length>0;)p=h.pop(),i=l.pop(),o=u.pop(),y=p.toString(),y in c||(r.push(o[0],o[1]),c[y]=!0),g=h.pop(),a=l.pop(),s=u.pop(),m=(p+g)/2,d=n(m),v=e(d),kje(v[0],v[1],o[0],o[1],s[0],s[1])<t?(r.push(s[0],s[1]),y=g.toString(),c[y]=!0):(h.push(g,m,m,p),u.push(s,v,v,o),l.push(a,d,d,i));return r}function w$r(n,e,t,r,i){var a=ya("EPSG:4326");return bQe(function(o){return[n,e+(t-e)*o]},__(a,r),i)}function b$r(n,e,t,r,i){var a=ya("EPSG:4326");return bQe(function(o){return[e+(t-e)*o,n]},__(a,r),i)}var E$r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),T$r=new es({color:"rgba(0,0,0,0.2)"}),C$r=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],A$r=function(n){E$r(e,n);function e(t){var r=this,i=t||{},a=Ao({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},i);return delete a.maxLines,delete a.strokeStyle,delete a.targetSize,delete a.showLabels,delete a.lonLabelFormatter,delete a.latLabelFormatter,delete a.lonLabelPosition,delete a.latLabelPosition,delete a.lonLabelStyle,delete a.latLabelStyle,delete a.intervals,r=n.call(this,a)||this,r.projection_=null,r.maxLat_=1/0,r.maxLon_=1/0,r.minLat_=-1/0,r.minLon_=-1/0,r.maxX_=1/0,r.maxY_=1/0,r.minX_=-1/0,r.minY_=-1/0,r.targetSize_=i.targetSize!==void 0?i.targetSize:100,r.maxLines_=i.maxLines!==void 0?i.maxLines:100,r.meridians_=[],r.parallels_=[],r.strokeStyle_=i.strokeStyle!==void 0?i.strokeStyle:T$r,r.fromLonLatTransform_=void 0,r.toLonLatTransform_=void 0,r.projectionCenterLonLat_=null,r.bottomLeft_=null,r.bottomRight_=null,r.topLeft_=null,r.topRight_=null,r.meridiansLabels_=null,r.parallelsLabels_=null,i.showLabels&&(r.lonLabelFormatter_=i.lonLabelFormatter==null?Y2e.bind(r,"EW"):i.lonLabelFormatter,r.latLabelFormatter_=i.latLabelFormatter==null?Y2e.bind(r,"NS"):i.latLabelFormatter,r.lonLabelPosition_=i.lonLabelPosition==null?0:i.lonLabelPosition,r.latLabelPosition_=i.latLabelPosition==null?1:i.latLabelPosition,r.lonLabelStyleBase_=new So({text:i.lonLabelStyle!==void 0?i.lonLabelStyle.clone():new J1({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Ko({color:"rgba(0,0,0,1)"}),stroke:new es({color:"rgba(255,255,255,1)",width:3})})}),r.lonLabelStyle_=function(o){var s=o.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(s),this.lonLabelStyleBase_}.bind(r),r.latLabelStyleBase_=new So({text:i.latLabelStyle!==void 0?i.latLabelStyle.clone():new J1({font:"12px Calibri,sans-serif",textAlign:"right",fill:new Ko({color:"rgba(0,0,0,1)"}),stroke:new es({color:"rgba(255,255,255,1)",width:3})})}),r.latLabelStyle_=function(o){var s=o.get("graticule_label");return this.latLabelStyleBase_.getText().setText(s),this.latLabelStyleBase_}.bind(r),r.meridiansLabels_=[],r.parallelsLabels_=[],r.addEventListener(Tf.POSTRENDER,r.drawLabels_.bind(r))),r.intervals_=i.intervals!==void 0?i.intervals:C$r,r.setSource(new _f({loader:r.loaderFunction.bind(r),strategy:r.strategyFunction.bind(r),features:new gd,overlaps:!1,useSpatialIndex:!1,wrapX:i.wrapX})),r.featurePool_=[],r.lineStyle_=new So({stroke:r.strokeStyle_}),r.loadedExtent_=null,r.renderedExtent_=null,r.renderedResolution_=null,r.setRenderOrder(null),r}return e.prototype.strategyFunction=function(t,r){var i=t.slice();return this.projection_&&this.getSource().getWrapX()&&Wje(i,this.projection_),this.loadedExtent_&&(pyr(this.loadedExtent_,i,r)?i=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[i]},e.prototype.loaderFunction=function(t,r,i){this.loadedExtent_=t;var a=this.getSource(),o=this.getExtent()||[-1/0,-1/0,1/0,1/0],s=tm(o,t);if(!(this.renderedExtent_&&m_(this.renderedExtent_,s)&&this.renderedResolution_===r)&&(this.renderedExtent_=s,this.renderedResolution_=r,!Sk(s))){var l=kf(s),u=r*r/4,h=!this.projection_||!Ry(this.projection_,i);h&&this.updateProjectionInfo_(i),this.createGraticule_(s,l,r,u);var c=this.meridians_.length+this.parallels_.length;this.meridiansLabels_&&(c+=this.meridians_.length),this.parallelsLabels_&&(c+=this.parallels_.length);for(var f;c>this.featurePool_.length;)f=new d0,this.featurePool_.push(f);var d=a.getFeaturesCollection();d.clear();var v=0,p,g;for(p=0,g=this.meridians_.length;p<g;++p)f=this.featurePool_[v++],f.setGeometry(this.meridians_[p]),f.setStyle(this.lineStyle_),d.push(f);for(p=0,g=this.parallels_.length;p<g;++p)f=this.featurePool_[v++],f.setGeometry(this.parallels_[p]),f.setStyle(this.lineStyle_),d.push(f)}},e.prototype.addMeridian_=function(t,r,i,a,o,s){var l=this.getMeridian_(t,r,i,a,s);if(Cl(l.getExtent(),o)){if(this.meridiansLabels_){var u=this.lonLabelFormatter_(t);s in this.meridiansLabels_?this.meridiansLabels_[s].text=u:this.meridiansLabels_[s]={geom:new Qs([]),text:u}}this.meridians_[s++]=l}return s},e.prototype.addParallel_=function(t,r,i,a,o,s){var l=this.getParallel_(t,r,i,a,s);if(Cl(l.getExtent(),o)){if(this.parallelsLabels_){var u=this.latLabelFormatter_(t);s in this.parallelsLabels_?this.parallelsLabels_[s].text=u:this.parallelsLabels_[s]={geom:new Qs([]),text:u}}this.parallels_[s++]=l}return s},e.prototype.drawLabels_=function(t){var r=t.frameState.viewState.rotation,i=t.frameState.viewState.resolution,a=t.frameState.size,o=t.frameState.extent,s=kf(o),l=o;if(r){var u=a[0]*i,h=a[1]*i;l=[s[0]-u/2,s[1]-h/2,s[0]+u/2,s[1]+h/2]}var c=0,f=0,d=this.latLabelPosition_<.5,v=this.projection_.getExtent(),p=Co(v);if(this.getSource().getWrapX()&&this.projection_.canWrapX()&&!vv(v,o)){c=Math.floor((o[0]-v[0])/p),f=Math.ceil((o[2]-v[2])/p);var g=Math.abs(r)>Math.PI/2;d=d!==g}for(var m=rXe(t),y=c;y<=f;++y){var _=this.meridians_.length+this.parallels_.length,x=void 0,S=void 0,w=void 0,b=void 0;if(this.meridiansLabels_)for(S=0,w=this.meridiansLabels_.length;S<w;++S){var E=this.meridians_[S];if(!r&&y===0)b=this.getMeridianPoint_(E,o,S);else{var T=E.clone();T.translate(y*p,0),T.rotate(-r,s),b=this.getMeridianPoint_(T,l,S),b.rotate(r,s)}x=this.featurePool_[_++],x.setGeometry(b),x.set("graticule_label",this.meridiansLabels_[S].text),m.drawFeature(x,this.lonLabelStyle_(x))}if(this.parallelsLabels_&&(y===c&&d||y===f&&!d))for(S=0,w=this.parallels_.length;S<w;++S){var E=this.parallels_[S];if(!r&&y===0)b=this.getParallelPoint_(E,o,S);else{var T=E.clone();T.translate(y*p,0),T.rotate(-r,s),b=this.getParallelPoint_(T,l,S),b.rotate(r,s)}x=this.featurePool_[_++],x.setGeometry(b),x.set("graticule_label",this.parallelsLabels_[S].text),m.drawFeature(x,this.latLabelStyle_(x))}}},e.prototype.createGraticule_=function(t,r,i,a){var o=this.getInterval_(i);if(o==-1){this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),this.parallelsLabels_&&(this.parallelsLabels_.length=0);return}var s=!1,l=this.projection_.getExtent(),u=Co(l);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!vv(l,t)&&(Co(t)>=u?(t[0]=l[0],t[2]=l[2]):s=!0);var h=[Ui(r[0],this.minX_,this.maxX_),Ui(r[1],this.minY_,this.maxY_)],c=this.toLonLatTransform_(h);isNaN(c[1])&&(c[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var f=Ui(c[0],this.minLon_,this.maxLon_),d=Ui(c[1],this.minLat_,this.maxLat_),v=this.maxLines_,p,g,m,y,_=t;s||(_=[Ui(t[0],this.minX_,this.maxX_),Ui(t[1],this.minY_,this.maxY_),Ui(t[2],this.minX_,this.maxX_),Ui(t[3],this.minY_,this.maxY_)]);var x=bte(_,this.toLonLatTransform_,void 0,8),S=x[3],w=x[2],b=x[1],E=x[0];if(s||(dv(_,this.bottomLeft_)&&(E=this.minLon_,b=this.minLat_),dv(_,this.bottomRight_)&&(w=this.maxLon_,b=this.minLat_),dv(_,this.topLeft_)&&(E=this.minLon_,S=this.maxLat_),dv(_,this.topRight_)&&(w=this.maxLon_,S=this.maxLat_),S=Ui(S,d,this.maxLat_),w=Ui(w,f,this.maxLon_),b=Ui(b,this.minLat_,d),E=Ui(E,this.minLon_,f)),f=Math.floor(f/o)*o,y=Ui(f,this.minLon_,this.maxLon_),g=this.addMeridian_(y,b,S,a,t,0),p=0,s)for(;(y-=o)>=E&&p++<v;)g=this.addMeridian_(y,b,S,a,t,g);else for(;y!=this.minLon_&&p++<v;)y=Math.max(y-o,this.minLon_),g=this.addMeridian_(y,b,S,a,t,g);if(y=Ui(f,this.minLon_,this.maxLon_),p=0,s)for(;(y+=o)<=w&&p++<v;)g=this.addMeridian_(y,b,S,a,t,g);else for(;y!=this.maxLon_&&p++<v;)y=Math.min(y+o,this.maxLon_),g=this.addMeridian_(y,b,S,a,t,g);for(this.meridians_.length=g,this.meridiansLabels_&&(this.meridiansLabels_.length=g),d=Math.floor(d/o)*o,m=Ui(d,this.minLat_,this.maxLat_),g=this.addParallel_(m,E,w,a,t,0),p=0;m!=this.minLat_&&p++<v;)m=Math.max(m-o,this.minLat_),g=this.addParallel_(m,E,w,a,t,g);for(m=Ui(d,this.minLat_,this.maxLat_),p=0;m!=this.maxLat_&&p++<v;)m=Math.min(m+o,this.maxLat_),g=this.addParallel_(m,E,w,a,t,g);this.parallels_.length=g,this.parallelsLabels_&&(this.parallelsLabels_.length=g)},e.prototype.getInterval_=function(t){for(var r=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1],a=-1,o=Math.pow(this.targetSize_*t,2),s=[],l=[],u=0,h=this.intervals_.length;u<h;++u){var c=Ui(this.intervals_[u]/2,0,90),f=Ui(i,-90+c,90-c);s[0]=r-c,s[1]=f-c,l[0]=r+c,l[1]=f+c,this.fromLonLatTransform_(s,s),this.fromLonLatTransform_(l,l);var d=Math.pow(l[0]-s[0],2)+Math.pow(l[1]-s[1],2);if(d<=o)break;a=this.intervals_[u]}return a},e.prototype.getMeridian_=function(t,r,i,a,o){var s=w$r(t,r,i,this.projection_,a),l=this.meridians_[o];return l?(l.setFlatCoordinates(Ro.XY,s),l.changed()):(l=new gm(s,Ro.XY),this.meridians_[o]=l),l},e.prototype.getMeridianPoint_=function(t,r,i){var a=t.getFlatCoordinates(),o=1,s=a.length-1;a[o]>a[s]&&(o=s,s=1);var l=Math.max(r[1],a[o]),u=Math.min(r[3],a[s]),h=Ui(r[1]+Math.abs(r[1]-r[3])*this.lonLabelPosition_,l,u),c=a[o-1]+(a[s-1]-a[o-1])*(h-a[o])/(a[s]-a[o]),f=[c,h],d=this.meridiansLabels_[i].geom;return d.setCoordinates(f),d},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,r,i,a,o){var s=b$r(t,r,i,this.projection_,a),l=this.parallels_[o];return l?(l.setFlatCoordinates(Ro.XY,s),l.changed()):l=new gm(s,Ro.XY),l},e.prototype.getParallelPoint_=function(t,r,i){var a=t.getFlatCoordinates(),o=0,s=a.length-2;a[o]>a[s]&&(o=s,s=0);var l=Math.max(r[0],a[o]),u=Math.min(r[2],a[s]),h=Ui(r[0]+Math.abs(r[0]-r[2])*this.latLabelPosition_,l,u),c=a[o+1]+(a[s+1]-a[o+1])*(h-a[o])/(a[s]-a[o]),f=[h,c],d=this.parallelsLabels_[i].geom;return d.setCoordinates(f),d},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var r=ya("EPSG:4326"),i=t.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];var a=__(t,r);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=a;else{var o=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(l,u,h){for(var c=h||2,f=a(l,u,c),d=0,v=f.length;d<v;d+=c)f[d]<o&&(f[d]+=360);return f}}this.fromLonLatTransform_=__(r,t);var s=bte([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=s[0],this.maxX_=s[2],this.minY_=s[1],this.maxY_=s[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(kf(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},e}(Sy);const M$r=A$r;var nz=34962,$ce=34963,I$r=35040,L$r=35044,L8=35048,P$r=5121,O$r=5123,R$r=5125,EQe=5126,sPe=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function TQe(n,e){for(var t=Ao({preserveDrawingBuffer:!0,antialias:!V0r},e),r=sPe.length,i=0;i<r;++i)try{var a=n.getContext(sPe[i],t);if(a)return a}catch{}return null}var D$r={STATIC_DRAW:L$r,STREAM_DRAW:I$r,DYNAMIC_DRAW:L8},N$r=function(){function n(e,t){this.array=null,this.type=e,ki(e===nz||e===$ce,62),this.usage=t!==void 0?t:D$r.STATIC_DRAW}return n.prototype.ofSize=function(e){this.array=new(PZ(this.type))(e)},n.prototype.fromArray=function(e){var t=PZ(this.type);this.array=t.from?t.from(e):new t(e)},n.prototype.fromArrayBuffer=function(e){this.array=new(PZ(this.type))(e)},n.prototype.getType=function(){return this.type},n.prototype.getArray=function(){return this.array},n.prototype.getUsage=function(){return this.usage},n.prototype.getSize=function(){return this.array?this.array.length:0},n}();function PZ(n){switch(n){case nz:return Float32Array;case $ce:return Uint32Array;default:return Float32Array}}const OZ=N$r,K6={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};var k$r=`
precision mediump float;
attribute vec2 a_position;
varying vec2 v_texCoord;
varying vec2 v_screenCoord;
uniform vec2 u_screenSize;
void main() {
v_texCoord = a_position * 0.5 + 0.5;
v_screenCoord = v_texCoord * u_screenSize;
gl_Position = vec4(a_position, 0.0, 1.0);
}
`,F$r=`
precision mediump float;
uniform sampler2D u_image;
uniform float u_opacity;
varying vec2 v_texCoord;
void main() {
gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
}
`,B$r=function(){function n(e){this.gl_=e.webGlContext;var t=this.gl_;this.scaleRatio_=e.scaleRatio||1,this.renderTargetTexture_=t.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=t.createFramebuffer();var r=t.createShader(t.VERTEX_SHADER);t.shaderSource(r,e.vertexShader||k$r),t.compileShader(r);var i=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(i,e.fragmentShader||F$r),t.compileShader(i),this.renderTargetProgram_=t.createProgram(),t.attachShader(this.renderTargetProgram_,r),t.attachShader(this.renderTargetProgram_,i),t.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=t.createBuffer();var a=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];t.bindBuffer(t.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),t.bufferData(t.ARRAY_BUFFER,new Float32Array(a),t.STATIC_DRAW),this.renderTargetAttribLocation_=t.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],e.uniforms&&Object.keys(e.uniforms).forEach(function(o){this.uniforms_.push({value:e.uniforms[o],location:t.getUniformLocation(this.renderTargetProgram_,o)})}.bind(this))}return n.prototype.getGL=function(){return this.gl_},n.prototype.init=function(e){var t=this.getGL(),r=[t.drawingBufferWidth*this.scaleRatio_,t.drawingBufferHeight*this.scaleRatio_];if(t.bindFramebuffer(t.FRAMEBUFFER,this.getFrameBuffer()),t.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var i=0,a=t.RGBA,o=0,s=t.RGBA,l=t.UNSIGNED_BYTE,u=null;t.bindTexture(t.TEXTURE_2D,this.renderTargetTexture_),t.texImage2D(t.TEXTURE_2D,i,a,r[0],r[1],o,s,l,u),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.renderTargetTexture_,0)}},n.prototype.apply=function(e,t,r,i){var a=this.getGL(),o=e.size;if(a.bindFramebuffer(a.FRAMEBUFFER,t?t.getFrameBuffer():null),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,this.renderTargetTexture_),!t){var s=vi(a.canvas);if(!e.renderTargets[s]){var l=a.getContextAttributes();l&&l.preserveDrawingBuffer&&(a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT)),e.renderTargets[s]=!0}}a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight),a.bindBuffer(a.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),a.useProgram(this.renderTargetProgram_),a.enableVertexAttribArray(this.renderTargetAttribLocation_),a.vertexAttribPointer(this.renderTargetAttribLocation_,2,a.FLOAT,!1,0,0),a.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),a.uniform1i(this.renderTargetTextureLocation_,0);var u=e.layerStatesArray[e.layerIndex].opacity;a.uniform1f(this.renderTargetOpacityLocation_,u),this.applyUniforms(e),r&&r(a,e),a.drawArrays(a.TRIANGLES,0,6),i&&i(a,e)},n.prototype.getFrameBuffer=function(){return this.frameBuffer_},n.prototype.applyUniforms=function(e){var t=this.getGL(),r,i=1;this.uniforms_.forEach(function(a){if(r=typeof a.value=="function"?a.value(e):a.value,r instanceof HTMLCanvasElement||r instanceof ImageData)a.texture||(a.texture=t.createTexture()),t.activeTexture(t["TEXTURE".concat(i)]),t.bindTexture(t.TEXTURE_2D,a.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r instanceof ImageData?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,r.width,r.height,0,t.UNSIGNED_BYTE,new Uint8Array(r.data)):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.uniform1i(a.location,i++);else if(Array.isArray(r))switch(r.length){case 2:t.uniform2f(a.location,r[0],r[1]);return;case 3:t.uniform3f(a.location,r[0],r[1],r[2]);return;case 4:t.uniform4f(a.location,r[0],r[1],r[2],r[3]);return;default:return}else typeof r=="number"&&t.uniform1f(a.location,r)})},n}();const lPe=B$r;function G$r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function RZ(n,e){return n[0]=e[0],n[1]=e[1],n[4]=e[2],n[5]=e[3],n[12]=e[4],n[13]=e[5],n}var z$r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),oA={PROJECTION_MATRIX:"u_projectionMatrix",OFFSET_SCALE_MATRIX:"u_offsetScaleMatrix",OFFSET_ROTATION_MATRIX:"u_offsetRotateMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution"},Wg={UNSIGNED_BYTE:P$r,UNSIGNED_SHORT:O$r,UNSIGNED_INT:R$r,FLOAT:EQe},iz={};function uPe(n){return"shared/"+n}var hPe=0;function U$r(){var n="unique/"+hPe;return hPe+=1,n}function V$r(n){var e=iz[n];if(!e){var t=document.createElement("canvas");t.style.position="absolute",t.style.left="0",e={users:0,canvas:t},iz[n]=e}return e.users+=1,e.canvas}function $$r(n){var e=iz[n];if(!!e&&(e.users-=1,!(e.users>0))){var t=e.canvas,r=TQe(t),i=r.getExtension("WEBGL_lose_context");i&&i.loseContext(),delete iz[n]}}var W$r=function(n){z$r(e,n);function e(t){var r=n.call(this)||this,i=t||{};r.boundHandleWebGLContextLost_=r.handleWebGLContextLost.bind(r),r.boundHandleWebGLContextRestored_=r.handleWebGLContextRestored.bind(r),r.canvasCacheKey_=i.canvasCacheKey?uPe(i.canvasCacheKey):U$r(),r.canvas_=V$r(r.canvasCacheKey_),r.gl_=TQe(r.canvas_),r.bufferCache_={},r.extensionCache_={},r.currentProgram_=null,r.canvas_.addEventListener(K6.LOST,r.boundHandleWebGLContextLost_),r.canvas_.addEventListener(K6.RESTORED,r.boundHandleWebGLContextRestored_),r.offsetRotateMatrix_=Nu(),r.offsetScaleMatrix_=Nu(),r.tmpMat4_=G$r(),r.uniformLocations_={},r.attribLocations_={},r.uniforms_=[],i.uniforms&&r.setUniforms(i.uniforms);var a=r.getGL();return r.postProcessPasses_=i.postProcesses?i.postProcesses.map(function(o){return new lPe({webGlContext:a,scaleRatio:o.scaleRatio,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,uniforms:o.uniforms})}):[new lPe({webGlContext:a})],r.shaderCompileErrors_=null,r.startTime_=Date.now(),r}return e.prototype.setUniforms=function(t){this.uniforms_=[];for(var r in t)this.uniforms_.push({name:r,value:t[r]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===uPe(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var r=this.gl_.getExtension(t);return this.extensionCache_[t]=r,r},e.prototype.bindBuffer=function(t){var r=this.getGL(),i=vi(t),a=this.bufferCache_[i];if(!a){var o=r.createBuffer();a={buffer:t,webGlBuffer:o},this.bufferCache_[i]=a}r.bindBuffer(t.getType(),a.webGlBuffer)},e.prototype.flushBufferData=function(t){var r=this.getGL();this.bindBuffer(t),r.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var r=this.getGL(),i=vi(t),a=this.bufferCache_[i];a&&!r.isContextLost()&&r.deleteBuffer(a.webGlBuffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(K6.LOST,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(K6.RESTORED,this.boundHandleWebGLContextRestored_),$$r(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,r){var i=this.getGL(),a=this.getCanvas(),o=t.size,s=t.pixelRatio;a.width=o[0]*s,a.height=o[1]*s,a.style.width=o[0]+"px",a.style.height=o[1]+"px",i.useProgram(this.currentProgram_);for(var l=this.postProcessPasses_.length-1;l>=0;l--)this.postProcessPasses_[l].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,r?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,r,i){var a=this.getGL(),o=r.getSize();a.bindFramebuffer(a.FRAMEBUFFER,r.getFramebuffer()),a.viewport(0,0,o[0],o[1]),a.bindTexture(a.TEXTURE_2D,r.getTexture()),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),a.enable(a.BLEND),a.blendFunc(a.ONE,i?a.ZERO:a.ONE_MINUS_SRC_ALPHA),a.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,r){var i=this.getGL();this.getExtension("OES_element_index_uint");var a=i.UNSIGNED_INT,o=4,s=r-t,l=t*o;i.drawElements(i.TRIANGLES,s,a,l)},e.prototype.finalizeDraw=function(t,r,i){for(var a=0,o=this.postProcessPasses_.length;a<o;a++)a===o-1?this.postProcessPasses_[a].apply(t,null,r,i):this.postProcessPasses_[a].apply(t,this.postProcessPasses_[a+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var r=t.size,i=t.viewState.rotation,a=IR(this.offsetScaleMatrix_);LR(a,2/r[0],2/r[1]);var o=IR(this.offsetRotateMatrix_);i!==0&&zyr(o,-i),this.setUniformMatrixValue(oA.OFFSET_SCALE_MATRIX,RZ(this.tmpMat4_,a)),this.setUniformMatrixValue(oA.OFFSET_ROTATION_MATRIX,RZ(this.tmpMat4_,o)),this.setUniformFloatValue(oA.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(oA.ZOOM,t.viewState.zoom),this.setUniformFloatValue(oA.RESOLUTION,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var r=this.getGL(),i,a=0;this.uniforms_.forEach(function(o){if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData){o.texture||(o.prevValue=void 0,o.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(a)]),r.bindTexture(r.TEXTURE_2D,o.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);var s=!(i instanceof HTMLImageElement)||i.complete;s&&o.prevValue!==i&&(o.prevValue=i,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i)),r.uniform1i(this.getUniformLocation(o.name),a++)}else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(o.name,RZ(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:r.uniform2f(this.getUniformLocation(o.name),i[0],i[1]);return;case 3:r.uniform3f(this.getUniformLocation(o.name),i[0],i[1],i[2]);return;case 4:r.uniform4f(this.getUniformLocation(o.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&r.uniform1f(this.getUniformLocation(o.name),i)}.bind(this))},e.prototype.useProgram=function(t){if(t==this.currentProgram_)return!1;var r=this.getGL();return r.useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0},e.prototype.compileShader=function(t,r){var i=this.getGL(),a=i.createShader(r);return i.shaderSource(a,t),i.compileShader(a),a},e.prototype.getProgram=function(t,r){var i=this.getGL(),a=this.compileShader(t,i.FRAGMENT_SHADER),o=this.compileShader(r,i.VERTEX_SHADER),s=i.createProgram();if(i.attachShader(s,a),i.attachShader(s,o),i.linkProgram(s),!i.getShaderParameter(a,i.COMPILE_STATUS)){var l="Fragment shader compliation failed: ".concat(i.getShaderInfoLog(a));throw new Error(l)}if(i.deleteShader(a),!i.getShaderParameter(o,i.COMPILE_STATUS)){var l="Vertex shader compilation failed: ".concat(i.getShaderInfoLog(o));throw new Error(l)}if(i.deleteShader(o),!i.getProgramParameter(s,i.LINK_STATUS)){var l="GL program linking failed: ".concat(i.getShaderInfoLog(o));throw new Error(l)}return s},e.prototype.getUniformLocation=function(t){return this.uniformLocations_[t]===void 0&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return this.attribLocations_[t]===void 0&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,r){var i=t.size,a=t.viewState.rotation,o=t.viewState.resolution,s=t.viewState.center;return IR(r),Id(r,0,0,2/(o*i[0]),2/(o*i[1]),-a,-s[0],-s[1]),r},e.prototype.setUniformFloatValue=function(t,r){this.getGL().uniform1f(this.getUniformLocation(t),r)},e.prototype.setUniformFloatVec4=function(t,r){this.getGL().uniform4fv(this.getUniformLocation(t),r)},e.prototype.setUniformMatrixValue=function(t,r){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,r)},e.prototype.enableAttributeArray_=function(t,r,i,a,o){var s=this.getAttributeLocation(t);s<0||(this.getGL().enableVertexAttribArray(s),this.getGL().vertexAttribPointer(s,r,i,!1,a,o))},e.prototype.enableAttributes=function(t){for(var r=H$r(t),i=0,a=0;a<t.length;a++){var o=t[a];this.enableAttributeArray_(o.name,o.size,o.type||EQe,r,i),i+=o.size*CQe(o.type)}},e.prototype.handleWebGLContextLost=function(){QI(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,r,i){var a=this.getGL(),o=i||a.createTexture(),s=0,l=a.RGBA,u=0,h=a.RGBA,c=a.UNSIGNED_BYTE;return a.bindTexture(a.TEXTURE_2D,o),r?a.texImage2D(a.TEXTURE_2D,s,l,h,c,r):a.texImage2D(a.TEXTURE_2D,s,l,t[0],t[1],u,h,c,null),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),o},e}(PV);function H$r(n){for(var e=0,t=0;t<n.length;t++){var r=n[t];e+=r.size*CQe(r.type)}return e}function CQe(n){switch(n){case Wg.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Wg.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Wg.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Wg.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var j$r=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),DZ={GENERATE_BUFFERS:"GENERATE_BUFFERS"},X$r=function(n){j$r(e,n);function e(t,r){var i=n.call(this,t)||this,a=r||{};return i.inversePixelTransform_=Nu(),i.pixelContext_=null,i.postProcesses_=a.postProcesses,i.uniforms_=a.uniforms,i.helper,t.addChangeListener(jo.MAP,i.removeHelper.bind(i)),i.dispatchPreComposeEvent=i.dispatchPreComposeEvent.bind(i),i.dispatchPostComposeEvent=i.dispatchPostComposeEvent.bind(i),i}return e.prototype.dispatchPreComposeEvent=function(t,r){var i=this.getLayer();if(i.hasListener(Tf.PRECOMPOSE)){var a=new PR(Tf.PRECOMPOSE,void 0,r,t);i.dispatchEvent(a)}},e.prototype.dispatchPostComposeEvent=function(t,r){var i=this.getLayer();if(i.hasListener(Tf.POSTCOMPOSE)){var a=new PR(Tf.POSTCOMPOSE,void 0,r,t);i.dispatchEvent(a)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var r=!0,i=-1,a=void 0,o=0,s=t.layerStatesArray.length;o<s;o++){var l=t.layerStatesArray[o].layer,u=l.getRenderer();if(!(u instanceof e)){r=!0;continue}var h=l.getClassName();if((r||h!==a)&&(i+=1,r=!1),a=h,u===this)break}var c="map/"+t.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(c))&&(this.removeHelper(),this.helper=new W$r({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:c}),a&&(this.helper.getCanvas().className=a),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper(),n.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,r,i){var a=this.getLayer();if(a.hasListener(t)){Id(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);var o=new PR(t,this.inversePixelTransform_,i,r);a.dispatchEvent(o)}},e.prototype.preRender=function(t,r){this.dispatchRenderEvent_(Tf.PRERENDER,t,r)},e.prototype.postRender=function(t,r){this.dispatchRenderEvent_(Tf.POSTRENDER,t,r)},e.prototype.getDataAtPixel=function(t,r,i){var a=ks([r.pixelRatio,0,0,r.pixelRatio,0,0],t.slice()),o=this.helper.getGL();if(!o)return null;var s=this.getLayer(),l=s.getExtent();if(l){var u=ks(r.pixelToCoordinateTransform,t.slice());if(!dv(l,u))return null}var h=o.getContextAttributes();if(!h||!h.preserveDrawingBuffer)return new Uint8Array;var c=Math.round(a[0]),f=Math.round(a[1]),d=this.pixelContext_;if(!d){var v=document.createElement("canvas");v.width=1,v.height=1,d=v.getContext("2d"),this.pixelContext_=d}d.clearRect(0,0,1,1);var p;try{d.drawImage(o.canvas,c,f,1,1,0,0,1,1),p=d.getImageData(0,0,1,1).data}catch{return p}return p[3]===0?null:p},e}(pXe);function Y$r(n,e){var t=e||[],r=256,i=r-1;return t[0]=Math.floor(n/r/r/r)/i,t[1]=Math.floor(n/r/r)%r/i,t[2]=Math.floor(n/r)%r/i,t[3]=n%r/i,t}function q$r(n){var e=0,t=256,r=t-1;return e+=Math.round(n[0]*t*t*t*r),e+=Math.round(n[1]*t*t*r),e+=Math.round(n[2]*t*r),e+=Math.round(n[3]*r),e}const Z$r=X$r;var dy=new Uint8Array(4),K$r=function(){function n(e,t){this.helper_=e;var r=e.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=t||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return n.prototype.setSize=function(e){Iw(e,this.size_)||(this.size_[0]=e[0],this.size_[1]=e[1],this.updateSize_())},n.prototype.getSize=function(){return this.size_},n.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},n.prototype.readAll=function(){if(this.dataCacheDirty_){var e=this.size_,t=this.helper_.getGL();t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.readPixels(0,0,e[0],e[1],t.RGBA,t.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},n.prototype.readPixel=function(e,t){if(e<0||t<0||e>this.size_[0]||t>=this.size_[1])return dy[0]=0,dy[1]=0,dy[2]=0,dy[3]=0,dy;this.readAll();var r=Math.floor(e)+(this.size_[1]-Math.floor(t)-1)*this.size_[0];return dy[0]=this.data_[r*4],dy[1]=this.data_[r*4+1],dy[2]=this.data_[r*4+2],dy[3]=this.data_[r*4+3],dy},n.prototype.getTexture=function(){return this.texture_},n.prototype.getFramebuffer=function(){return this.framebuffer_},n.prototype.updateSize_=function(){var e=this.size_,t=this.helper_.getGL();this.texture_=this.helper_.createTexture(e,null,this.texture_),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.viewport(0,0,e[0],e[1]),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(e[0]*e[1]*4)},n}();const J$r=K$r;function Q$r(){var n='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker(typeof Blob>"u"?"data:application/javascript;base64,"+Buffer.from(n,"binary").toString("base64"):URL.createObjectURL(new Blob([n],{type:"application/javascript"})))}var eWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),tWr=function(n){eWr(e,n);function e(t,r){var i=this,a=r.uniforms||{},o=Nu();a[oA.PROJECTION_MATRIX]=o,i=n.call(this,t,{uniforms:a,postProcesses:r.postProcesses})||this,i.ready=!1,i.sourceRevision_=-1,i.verticesBuffer_=new OZ(nz,L8),i.hitVerticesBuffer_=new OZ(nz,L8),i.indicesBuffer_=new OZ($ce,L8),i.vertexShader_=r.vertexShader,i.fragmentShader_=r.fragmentShader,i.program_,i.hitDetectionEnabled_=!!(r.hitFragmentShader&&r.hitVertexShader),i.hitVertexShader_=r.hitVertexShader,i.hitFragmentShader_=r.hitFragmentShader,i.hitProgram_;var s=r.attributes?r.attributes.map(function(u){return{name:"a_"+u.name,size:1,type:Wg.FLOAT}}):[];i.attributes=[{name:"a_position",size:2,type:Wg.FLOAT},{name:"a_index",size:1,type:Wg.FLOAT}].concat(s),i.hitDetectionAttributes=[{name:"a_position",size:2,type:Wg.FLOAT},{name:"a_index",size:1,type:Wg.FLOAT},{name:"a_hitColor",size:4,type:Wg.FLOAT},{name:"a_featureUid",size:1,type:Wg.FLOAT}].concat(s),i.customAttributes=r.attributes?r.attributes:[],i.previousExtent_=Md(),i.currentTransform_=o,i.renderTransform_=Nu(),i.invertRenderTransform_=Nu(),i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_,i.generateBuffersRun_=0,i.worker_=Q$r(),i.worker_.addEventListener("message",function(u){var h=u.data;if(h.type===DZ.GENERATE_BUFFERS){var c=h.projectionTransform;h.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(h.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(h.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(h.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=c,bk(this.invertRenderTransform_,this.renderTransform_),h.hitDetection?this.hitRenderInstructions_=new Float32Array(u.data.renderInstructions):(this.renderInstructions_=new Float32Array(u.data.renderInstructions),h.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var l=i.getLayer().getSource();return i.sourceListenKeys_=[pa(l,yf.ADDFEATURE,i.handleSourceFeatureAdded_,i),pa(l,yf.CHANGEFEATURE,i.handleSourceFeatureChanged_,i),pa(l,yf.REMOVEFEATURE,i.handleSourceFeatureDelete_,i),pa(l,yf.CLEAR,i.handleSourceFeatureClear_,i)],l.forEachFeature(function(u){this.featureCache_[vi(u)]={feature:u,properties:u.getProperties(),geometry:u.getGeometry()},this.featureCount_++}.bind(i)),i}return e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new J$r(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var r=t.feature;this.featureCache_[vi(r)]={feature:r,properties:r.getProperties(),geometry:r.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var r=t.feature;this.featureCache_[vi(r)]={feature:r,properties:r.getProperties(),geometry:r.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var r=t.feature;delete this.featureCache_[vi(r)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var r=this.helper.getGL();this.preRender(r,t);var i=this.indicesBuffer_.getSize();this.helper.drawElements(0,i),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var a=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(r,t),a},e.prototype.prepareFrameInternal=function(t){var r=this.getLayer(),i=r.getSource(),a=t.viewState,o=!t.viewHints[Gs.ANIMATING]&&!t.viewHints[Gs.INTERACTING],s=!m_(this.previousExtent_,t.extent),l=this.sourceRevision_<i.getRevision();if(l&&(this.sourceRevision_=i.getRevision()),o&&(s||l)){var u=a.projection,h=a.resolution,c=r instanceof GV?r.getRenderBuffer():0,f=f0(t.extent,c*h);i.loadFeatures(f,h,u),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),nL(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var r=Nu();this.helper.makeProjectionTransform(t,r);var i=(2+this.customAttributes.length)*this.featureCount_;if((!this.renderInstructions_||this.renderInstructions_.length!==i)&&(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var a=(7+this.customAttributes.length)*this.featureCount_;(!this.hitRenderInstructions_||this.hitRenderInstructions_.length!==a)&&(this.hitRenderInstructions_=new Float32Array(a))}var o,s,l=[],u=[],h=0,c=0,f;for(var d in this.featureCache_)if(o=this.featureCache_[d],s=o.geometry,!(!s||s.getType()!==Kr.POINT)){l[0]=s.getFlatCoordinates()[0],l[1]=s.getFlatCoordinates()[1],ks(r,l),f=Y$r(c+6,u),this.renderInstructions_[h++]=l[0],this.renderInstructions_[h++]=l[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[c++]=l[0],this.hitRenderInstructions_[c++]=l[1],this.hitRenderInstructions_[c++]=f[0],this.hitRenderInstructions_[c++]=f[1],this.hitRenderInstructions_[c++]=f[2],this.hitRenderInstructions_[c++]=f[3],this.hitRenderInstructions_[c++]=Number(d));for(var v=void 0,p=0;p<this.customAttributes.length;p++)v=this.customAttributes[p].callback(o.feature,o.properties),this.renderInstructions_[h++]=v,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[c++]=v)}var g={type:DZ.GENERATE_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(g.projectionTransform=r,g.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(g,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:DZ.GENERATE_BUFFERS,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=r,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o){if(ki(this.hitDetectionEnabled_,66),!!this.hitRenderInstructions_){var s=ks(r.coordinateToPixelTransform,t.slice()),l=this.hitRenderTarget_.readPixel(s[0]/2,s[1]/2),u=[l[0]/255,l[1]/255,l[2]/255,l[3]/255],h=q$r(u),c=this.hitRenderInstructions_[h],f=Math.floor(c).toString(),d=this.getLayer().getSource(),v=d.getFeatureByUid(f);if(v)return a(v,this.getLayer(),null)}},e.prototype.renderHitDetection=function(t){if(!!this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var r=this.indicesBuffer_.getSize();this.helper.drawElements(0,r)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(t){Ms(t)}),this.sourceListenKeys_=null,n.prototype.disposeInternal.call(this)},e}(Z$r);const rWr=tWr;var nWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Lg={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},iWr=["#00f","#0ff","#0f0","#ff0","#f00"],aWr=function(n){nWr(e,n);function e(t){var r=this,i=t||{},a=Ao({},i);delete a.gradient,delete a.radius,delete a.blur,delete a.weight,r=n.call(this,a)||this,r.gradient_=null,r.addChangeListener(Lg.GRADIENT,r.handleGradientChanged_),r.setGradient(i.gradient?i.gradient:iWr),r.setBlur(i.blur!==void 0?i.blur:15),r.setRadius(i.radius!==void 0?i.radius:8);var o=i.weight?i.weight:"weight";return typeof o=="string"?r.weightFunction_=function(s){return s.get(o)}:r.weightFunction_=o,r.setRenderOrder(null),r}return e.prototype.getBlur=function(){return this.get(Lg.BLUR)},e.prototype.getGradient=function(){return this.get(Lg.GRADIENT)},e.prototype.getRadius=function(){return this.get(Lg.RADIUS)},e.prototype.handleGradientChanged_=function(){this.gradient_=oWr(this.getGradient())},e.prototype.setBlur=function(t){this.set(Lg.BLUR,t)},e.prototype.setGradient=function(t){this.set(Lg.GRADIENT,t)},e.prototype.setRadius=function(t){this.set(Lg.RADIUS,t)},e.prototype.createRenderer=function(){return new rWr(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var r=this.weightFunction_(t);return r!==void 0?Ui(r,0,1):1}.bind(this)}],vertexShader:`
precision mediump float;
uniform mat4 u_projectionMatrix;
uniform mat4 u_offsetScaleMatrix;
uniform float u_size;
attribute vec2 a_position;
attribute float a_index;
attribute float a_weight;
varying vec2 v_texCoord;
varying float v_weight;
void main(void) {
mat4 offsetMatrix = u_offsetScaleMatrix;
float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;
float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;
v_texCoord = vec2(u, v);
v_weight = a_weight;
}`,fragmentShader:`
precision mediump float;
uniform float u_blurSlope;
varying vec2 v_texCoord;
varying float v_weight;
void main(void) {
vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
float alpha = smoothstep(0.0, 1.0, value) * v_weight;
gl_FragColor = vec4(alpha, alpha, alpha, alpha);
}`,hitVertexShader:`
precision mediump float;
uniform mat4 u_projectionMatrix;
uniform mat4 u_offsetScaleMatrix;
uniform float u_size;
attribute vec2 a_position;
attribute float a_index;
attribute float a_weight;
attribute vec4 a_hitColor;
varying vec2 v_texCoord;
varying float v_weight;
varying vec4 v_hitColor;
void main(void) {
mat4 offsetMatrix = u_offsetScaleMatrix;
float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;
float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;
v_texCoord = vec2(u, v);
v_hitColor = a_hitColor;
v_weight = a_weight;
}`,hitFragmentShader:`
precision mediump float;
uniform float u_blurSlope;
varying vec2 v_texCoord;
varying float v_weight;
varying vec4 v_hitColor;
void main(void) {
vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
float alpha = smoothstep(0.0, 1.0, value) * v_weight;
if (alpha < 0.05) {
discard;
}
gl_FragColor = v_hitColor;
}`,uniforms:{u_size:function(){return(this.get(Lg.RADIUS)+this.get(Lg.BLUR))*2}.bind(this),u_blurSlope:function(){return this.get(Lg.RADIUS)/Math.max(1,this.get(Lg.BLUR))}.bind(this)},postProcesses:[{fragmentShader:`
precision mediump float;
uniform sampler2D u_image;
uniform sampler2D u_gradientTexture;
uniform float u_opacity;
varying vec2 v_texCoord;
void main() {
vec4 color = texture2D(u_image, v_texCoord);
gl_FragColor.a = color.a * u_opacity;
gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
gl_FragColor.rgb *= gl_FragColor.a;
}`,uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(GV);function oWr(n){for(var e=1,t=256,r=Ad(e,t),i=r.createLinearGradient(0,0,e,t),a=1/(n.length-1),o=0,s=n.length;o<s;++o)i.addColorStop(o*a,n[o]);return r.fillStyle=i,r.fillRect(0,0,e,t),r.canvas}const cPe=aWr;var sWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),lWr=function(n){sWr(e,n);function e(t){var r=n.call(this,t)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Md(),r.tmpTileRange_=new Gqe(0,0,0,0),r}return e.prototype.isDrawableTile=function(t){var r=this.getLayer(),i=t.getState(),a=r.getUseInterimTilesOnError();return i==Xr.LOADED||i==Xr.EMPTY||i==Xr.ERROR&&!a},e.prototype.getTile=function(t,r,i,a){var o=a.pixelRatio,s=a.viewState.projection,l=this.getLayer(),u=l.getSource(),h=u.getTile(t,r,i,o,s);return h.getState()==Xr.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):h.setState(Xr.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},e.prototype.getData=function(t){var r=this.frameState;if(!r)return null;var i=this.getLayer(),a=ks(r.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!dv(o,a))return null;for(var s=r.pixelRatio,l=r.viewState.projection,u=r.viewState,h=i.getRenderSource(),c=h.getTileGridForProjection(u.projection),f=h.getTilePixelRatio(r.pixelRatio),d=c.getZForResolution(u.resolution);d>=c.getMinZoom();--d){var v=c.getTileCoordForCoordAndZ(a,d),p=h.getTile(d,v[1],v[2],s,l);if(!(p instanceof Iqe||p instanceof Dqe))return null;if(p.getState()===Xr.LOADED){var g=c.getOrigin(d),m=nh(c.getTileSize(d)),y=c.getResolution(d),_=Math.floor(f*((a[0]-g[0])/y-v[1]*m[0])),x=Math.floor(f*((g[1]-a[1])/y-v[2]*m[1]));return this.getImageData(p.getImage(),_,x)}}return null},e.prototype.loadedTileCallback=function(t,r,i){return this.isDrawableTile(i)?n.prototype.loadedTileCallback.call(this,t,r,i):!1},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,r){var i=t.layerStatesArray[t.layerIndex],a=t.viewState,o=a.projection,s=a.resolution,l=a.center,u=a.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),d=f.getRevision(),v=f.getTileGridForProjection(o),p=v.getZForResolution(s,f.zDirection),g=v.getResolution(p),m=t.extent,y=i.extent&&F1(i.extent);y&&(m=tm(m,F1(i.extent)));var _=f.getTilePixelRatio(h),x=Math.round(t.size[0]*_),S=Math.round(t.size[1]*_);if(u){var w=Math.round(Math.sqrt(x*x+S*S));x=w,S=w}var b=g*x/2/_,E=g*S/2/_,T=[l[0]-b,l[1]-E,l[0]+b,l[1]+E],C=v.getTileRangeForExtentAndZ(m,p),A={};A[p]={};var M=this.createLoadedTileFinder(f,o,A),I=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var k=C.minX;k<=C.maxX;++k)for(var D=C.minY;D<=C.maxY;++D){var G=this.getTile(p,k,D,t);if(this.isDrawableTile(G)){var W=vi(this);if(G.getState()==Xr.LOADED){A[p][G.tileCoord.toString()]=G;var z=G.inTransition(W);!this.newTiles_&&(z||this.renderedTiles.indexOf(G)===-1)&&(this.newTiles_=!0)}if(G.getAlpha(W,t.time)===1)continue}var V=v.getTileCoordChildTileRange(G.tileCoord,R,I),q=!1;V&&(q=M(p+1,V)),q||v.forEachTileCoordParentTileRange(G.tileCoord,M,R,I)}var Y=g/s;Id(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/_,1/_,u,-x/2,-S/2);var le=gue(this.pixelTransform);this.useContainer(r,le,i.opacity,this.getBackground(t));var j=this.context,Q=j.canvas;bk(this.inversePixelTransform,this.pixelTransform),Id(this.tempTransform,x/2,S/2,Y,Y,0,-x/2,-S/2),Q.width!=x||Q.height!=S?(Q.width=x,Q.height=S):this.containerReused||j.clearRect(0,0,x,S),y&&this.clipUnrotated(j,t,y),f.getInterpolate()||Ao(j,w7),this.preRender(j,t),this.renderedTiles.length=0;var ie=Object.keys(A).map(Number);ie.sort(f2);var oe,se,me;i.opacity===1&&(!this.containerReused||f.getOpaque(t.viewState.projection))?ie=ie.reverse():(oe=[],se=[]);for(var Ce=ie.length-1;Ce>=0;--Ce){var Le=ie[Ce],re=f.getTilePixelSize(Le,h,o),yt=v.getResolution(Le),je=yt/g,st=re[0]*je*Y,Nt=re[1]*je*Y,Zt=v.getTileCoordForCoordAndZ(Lw(T),Le),qe=v.getTileCoordExtent(Zt),ur=ks(this.tempTransform,[_*(qe[0]-T[0])/g,_*(T[3]-qe[3])/g]),Dt=_*f.getGutterForProjection(o),ft=A[Le];for(var Oe in ft){var G=ft[Oe],J=G.tileCoord,We=Zt[1]-J[1],Tt=Math.round(ur[0]-(We-1)*st),Qe=Zt[2]-J[2],zt=Math.round(ur[1]-(Qe-1)*Nt),k=Math.round(ur[0]-We*st),D=Math.round(ur[1]-Qe*Nt),mt=Tt-k,wt=zt-D,pt=p===Le,z=pt&&G.getAlpha(vi(this),t.time)!==1,ar=!1;if(!z)if(oe){me=[k,D,k+mt,D,k+mt,D+wt,k,D+wt];for(var kt=0,Dr=oe.length;kt<Dr;++kt)if(p!==Le&&Le<se[kt]){var Sr=oe[kt];Cl([k,D,k+mt,D+wt],[Sr[0],Sr[3],Sr[4],Sr[7]])&&(ar||(j.save(),ar=!0),j.beginPath(),j.moveTo(me[0],me[1]),j.lineTo(me[2],me[3]),j.lineTo(me[4],me[5]),j.lineTo(me[6],me[7]),j.moveTo(Sr[6],Sr[7]),j.lineTo(Sr[4],Sr[5]),j.lineTo(Sr[2],Sr[3]),j.lineTo(Sr[0],Sr[1]),j.clip())}oe.push(me),se.push(Le)}else j.clearRect(k,D,mt,wt);this.drawTileImage(G,t,k,D,mt,wt,Dt,pt),oe&&!z?(ar&&j.restore(),this.renderedTiles.unshift(G)):this.renderedTiles.push(G),this.updateUsedTiles(t.usedTiles,f,G)}}this.renderedRevision=d,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!m_(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=h,this.renderedProjection=o,this.manageTilePyramid(t,f,v,h,o,m,p,c.getPreload()),this.scheduleExpireCache(t,f),this.postRender(j,t),i.extent&&j.restore(),Ao(j,Oqe),le!==Q.style.transform&&(Q.style.transform=le);var jr=Nje(i.opacity),pn=this.container;return jr!==pn.style.opacity&&(pn.style.opacity=jr),this.container},e.prototype.drawTileImage=function(t,r,i,a,o,s,l,u){var h=this.getTileImage(t);if(!!h){var c=vi(this),f=u?t.getAlpha(c,r.time):1,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(h,l,l,h.width-2*l,h.height-2*l,i,a,o,s),d&&this.context.restore(),f!==1?r.animate=!0:u&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,r){if(r.canExpireCache()){var i=function(a,o,s){var l=vi(a);l in s.usedTiles&&a.expireCache(s.viewState.projection,s.usedTiles[l])}.bind(null,r);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,r,i){var a=vi(r);a in t||(t[a]={}),t[a][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,r,i,a,o,s,l,u,h){var c=vi(r);c in t.wantedTiles||(t.wantedTiles[c]={});var f=t.wantedTiles[c],d=t.tileQueue,v=i.getMinZoom(),p=0,g,m,y,_,x,S;for(S=v;S<=l;++S)for(m=i.getTileRangeForExtentAndZ(s,S,m),y=i.getResolution(S),_=m.minX;_<=m.maxX;++_)for(x=m.minY;x<=m.maxY;++x)l-S<=u?(++p,g=r.getTile(S,_,x,a,o),g.getState()==Xr.IDLE&&(f[g.getKey()]=!0,d.isKeyQueued(g.getKey())||d.enqueue([g,c,i.getTileCoordCenter(g.tileCoord),y])),h!==void 0&&h(g)):r.useTile(S,_,x,o);r.updateCacheSize(p,o)},e}(Sue);const AQe=lWr,pS={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};var uWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),hWr={image:[ga.POLYGON,ga.CIRCLE,ga.LINE_STRING,ga.IMAGE,ga.TEXT],hybrid:[ga.POLYGON,ga.LINE_STRING],vector:[]},cWr={hybrid:[ga.IMAGE,ga.TEXT,ga.DEFAULT],vector:[ga.POLYGON,ga.CIRCLE,ga.LINE_STRING,ga.IMAGE,ga.TEXT,ga.DEFAULT]},fWr=function(n){uWr(e,n);function e(t){var r=n.call(this,t)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=Nu(),r}return e.prototype.prepareTile=function(t,r,i){var a,o=t.getState();return(o===Xr.LOADED||o===Xr.ERROR)&&(this.updateExecutorGroup_(t,r,i),this.tileImageNeedsRender_(t)&&(a=!0)),a},e.prototype.getTile=function(t,r,i,a){var o=a.pixelRatio,s=a.viewState,l=s.resolution,u=s.projection,h=this.getLayer(),c=h.getSource().getTile(t,r,i,o,u),f=a.viewHints,d=!(f[Gs.ANIMATING]||f[Gs.INTERACTING]);(d||!c.wantedResolution)&&(c.wantedResolution=l);var v=this.prepareTile(c,o,u);return v&&(d||Date.now()-a.time<8)&&h.getRenderMode()!==pS.VECTOR&&this.renderTileImage_(c,a),n.prototype.getTile.call(this,t,r,i,a)},e.prototype.isDrawableTile=function(t){var r=this.getLayer();return n.prototype.isDrawableTile.call(this,t)&&(r.getRenderMode()===pS.VECTOR?vi(r)in t.executorGroups:t.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(t){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,n.prototype.prepareFrame.call(this,t)},e.prototype.updateExecutorGroup_=function(t,r,i){var a=this.getLayer(),o=a.getRevision(),s=a.getRenderOrder()||null,l=t.wantedResolution,u=t.getReplayState(a);if(!(!u.dirty&&u.renderedResolution===l&&u.renderedRevision==o&&u.renderedRenderOrder==s)){var h=a.getSource(),c=a.getDeclutter(),f=h.getTileGrid(),d=h.getTileGridForProjection(i),v=d.getTileCoordExtent(t.wrappedTileCoord),p=h.getSourceTiles(r,i,t),g=vi(a);delete t.hitDetectionImageData[g],t.executorGroups[g]=[],c&&(t.declutterExecutorGroups[g]=[]);for(var m=function(S,w){var b=p[S];if(b.getState()!=Xr.LOADED)return"continue";var E=b.tileCoord,T=f.getTileCoordExtent(E),C=tm(v,T),A=f0(C,a.getRenderBuffer()*l,y.tmpExtent),M=m_(T,C)?null:A;u.dirty=!1;var I=new c7(0,A,l,r),R=c?new c7(0,C,l,r):void 0,k=mue(l,r),D=function(Q){var ie,oe=Q.getStyleFunction()||a.getStyleFunction();if(oe&&(ie=oe(Q,l)),ie){var se=this.renderFeature(Q,k,ie,I,R);this.dirty_=this.dirty_||se,u.dirty=u.dirty||se}},G=b.getFeatures();s&&s!==u.renderedRenderOrder&&G.sort(s);for(var W=0,z=G.length;W<z;++W){var V=G[W];(!M||Cl(M,V.getGeometry().getExtent()))&&D.call(y,V)}var q=I.finish(),Y=a.getRenderMode()!==pS.VECTOR&&c&&p.length===1?null:C,le=new f7(Y,l,r,h.getOverlaps(),q,a.getRenderBuffer());if(t.executorGroups[g].push(le),R){var j=new f7(null,l,r,h.getOverlaps(),R.finish(),a.getRenderBuffer());t.declutterExecutorGroups[g].push(j)}},y=this,_=0,x=p.length;_<x;++_)m(_);u.renderedRevision=o,u.renderedRenderOrder=s,u.renderedResolution=l}},e.prototype.forEachFeatureAtCoordinate=function(t,r,i,a,o){var s=r.viewState.resolution,l=r.viewState.rotation;i=i==null?0:i;var u=this.getLayer(),h=u.getSource(),c=h.getTileGridForProjection(r.viewState.projection),f=e7([t]);f0(f,s*i,f);for(var d={},v=function(x,S,w){var b=x.getId();b===void 0&&(b=vi(x));var E=d[b];if(E){if(E!==!0&&w<E.distanceSq){if(w===0)return d[b]=!0,o.splice(o.lastIndexOf(E),1),a(x,u,S);E.geometry=S,E.distanceSq=w}}else{if(w===0)return d[b]=!0,a(x,u,S);o.push(d[b]={feature:x,layer:u,geometry:S,distanceSq:w,callback:a})}},p=this.renderedTiles,g,m=function(x,S){var w=p[x],b=c.getTileCoordExtent(w.wrappedTileCoord);if(!Cl(b,f))return"continue";var E=vi(u),T=[w.executorGroups[E]],C=w.declutterExecutorGroups[E];C&&T.push(C),T.some(function(A){for(var M=A===C?r.declutterTree.all().map(function(D){return D.value}):null,I=0,R=A.length;I<R;++I){var k=A[I];if(g=k.forEachFeatureAtCoordinate(t,s,l,i,v,M),g)return!0}})},y=0,_=p.length;!g&&y<_;++y)m(y);return g},e.prototype.getFeatures=function(t){return new Promise(function(r,i){for(var a=this.getLayer(),o=vi(a),s=a.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=s.getTileGridForProjection(l),f=ks(this.renderedPixelToCoordinateTransform_,t.slice()),d=c.getTileCoordForCoordAndResolution(f,h),v,p=0,g=this.renderedTiles.length;p<g;++p)if(d.toString()===this.renderedTiles[p].tileCoord.toString()){if(v=this.renderedTiles[p],v.getState()===Xr.LOADED){var m=c.getTileCoordExtent(v.tileCoord);s.getWrapX()&&l.canWrapX()&&!vv(u,m)&&hue(f,l);break}v=void 0}if(!v||v.loadingSourceTiles>0){r([]);return}var y=c.getTileCoordExtent(v.wrappedTileCoord),_=Lw(y),x=[(f[0]-_[0])/h,(_[1]-f[1])/h],S=v.getSourceTiles().reduce(function(C,A){return C.concat(A.getFeatures())},[]),w=v.hitDetectionImageData[o];if(!w&&!this.animatingOrInteracting_){var b=nh(c.getTileSize(c.getZForResolution(h))),E=this.renderedRotation_,T=[this.getRenderTransform(c.getTileCoordCenter(v.wrappedTileCoord),h,0,uv,b[0]*uv,b[1]*uv,0)];w=yXe(b,T,S,a.getStyleFunction(),c.getTileCoordExtent(v.wrappedTileCoord),v.getReplayState(a).renderedResolution,E),v.hitDetectionImageData[o]=w}r(mXe(x,S,w))}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var r=this.context,i=r.globalAlpha;r.globalAlpha=this.getLayer().getOpacity();for(var a=t.viewHints,o=!(a[Gs.ANIMATING]||a[Gs.INTERACTING]),s=this.renderedTiles,l=0,u=s.length;l<u;++l){var h=s[l],c=h.declutterExecutorGroups[vi(this.getLayer())];if(c)for(var f=c.length-1;f>=0;--f)c[f].execute(this.context,1,this.getTileRenderTransform(h,t),t.viewState.rotation,o,void 0,t.declutterTree)}r.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,r){var i=r.pixelRatio,a=r.viewState,o=a.center,s=a.resolution,l=a.rotation,u=r.size,h=Math.round(u[0]*i),c=Math.round(u[1]*i),f=this.getLayer().getSource(),d=f.getTileGridForProjection(r.viewState.projection),v=t.tileCoord,p=d.getTileCoordExtent(t.wrappedTileCoord),g=d.getTileCoordExtent(v,this.tmpExtent)[0]-p[0],m=nL(LR(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(o,s,l,i,h,c,g));return m},e.prototype.renderFrame=function(t,r){var i=t.viewHints,a=!(i[Gs.ANIMATING]||i[Gs.INTERACTING]);n.prototype.renderFrame.call(this,t,r),this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation;var o=this.getLayer(),s=o.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=o.getOpacity();for(var h=cWr[s],c=t.viewState,f=c.rotation,d=o.getSource(),v=d.getTileGridForProjection(c.projection),p=v.getZForResolution(c.resolution,d.zDirection),g=this.renderedTiles,m=[],y=[],_=g.length-1;_>=0;--_){var x=g[_],S=x.executorGroups[vi(o)].filter(function(D){return D.hasExecutors(h)});if(S.length!==0){for(var w=this.getTileRenderTransform(x,t),b=x.tileCoord[0],E=!1,T=S[0].getClipCoords(w),C=0,A=m.length;C<A;++C)if(p!==b&&b<y[C]){var M=m[C];Cl([T[0],T[3],T[4],T[7]],[M[0],M[3],M[4],M[7]])&&(E||(l.save(),E=!0),l.beginPath(),l.moveTo(T[0],T[1]),l.lineTo(T[2],T[3]),l.lineTo(T[4],T[5]),l.lineTo(T[6],T[7]),l.moveTo(M[6],M[7]),l.lineTo(M[4],M[5]),l.lineTo(M[2],M[3]),l.lineTo(M[0],M[1]),l.clip())}m.push(T),y.push(b);for(var I=0,R=S.length;I<R;++I){var k=S[I];k.execute(l,1,w,f,a,h)}E&&l.restore()}}return l.globalAlpha=u,this.container},e.prototype.renderFeature=function(t,r,i,a,o){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var l=0,u=i.length;l<u;++l)s=s7(a,t,i[l],r,this.boundHandleStyleImageChange_,void 0,o)||s;else s=s7(a,t,i,r,this.boundHandleStyleImageChange_,void 0,o);return s},e.prototype.tileImageNeedsRender_=function(t){var r=this.getLayer();if(r.getRenderMode()===pS.VECTOR)return!1;var i=t.getReplayState(r),a=r.getRevision(),o=t.wantedResolution;return i.renderedTileResolution!==o||i.renderedTileRevision!==a},e.prototype.renderTileImage_=function(t,r){var i=this.getLayer(),a=t.getReplayState(i),o=i.getRevision(),s=t.executorGroups[vi(i)];a.renderedTileRevision=o;var l=t.wrappedTileCoord,u=l[0],h=i.getSource(),c=r.pixelRatio,f=r.viewState,d=f.projection,v=h.getTileGridForProjection(d),p=v.getResolution(t.tileCoord[0]),g=r.pixelRatio/t.wantedResolution*p,m=v.getResolution(u),y=t.getContext(i);c=Math.round(Math.max(c,g/c));var _=h.getTilePixelSize(u,c,d);y.canvas.width=_[0],y.canvas.height=_[1];var x=c/g;if(x!==1){var S=IR(this.tmpTransform_);LR(S,x,x),y.setTransform.apply(y,S)}var w=v.getTileCoordExtent(l,this.tmpExtent),b=g/m,E=IR(this.tmpTransform_);LR(E,b,-b),Vyr(E,-w[0],-w[3]);for(var T=0,C=s.length;T<C;++T){var A=s[T];A.execute(y,x,E,0,!0,hWr[i.getRenderMode()])}a.renderedTileResolution=t.wantedResolution},e}(AQe);const dWr=fWr,gS={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var vWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),pWr=function(n){vWr(e,n);function e(t){var r=this,i=t||{},a=Ao({},i);delete a.preload,delete a.useInterimTilesOnError,r=n.call(this,a)||this,r.on,r.once,r.un,i.renderMode===pS.IMAGE&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),i.renderMode=void 0);var o=i.renderMode||pS.HYBRID;return ki(o==pS.HYBRID||o==pS.VECTOR,28),r.renderMode_=o,r.setPreload(i.preload?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r.getBackground,r.setBackground,r}return e.prototype.createRenderer=function(){return new dWr(this)},e.prototype.getFeatures=function(t){return n.prototype.getFeatures.call(this,t)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(gS.PRELOAD)},e.prototype.getUseInterimTilesOnError=function(){return this.get(gS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setPreload=function(t){this.set(gS.PRELOAD,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(gS.USE_INTERIM_TILES_ON_ERROR,t)},e}(GV);const fPe=pWr;var gWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),yWr=function(n){gWr(e,n);function e(t){var r=this,i=t||{},a=Ao({},i);return delete a.preload,delete a.useInterimTilesOnError,r=n.call(this,a)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(gS.PRELOAD)},e.prototype.setPreload=function(t){this.set(gS.PRELOAD,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(gS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(t){this.set(gS.USE_INTERIM_TILES_ON_ERROR,t)},e.prototype.getData=function(t){return n.prototype.getData.call(this,t)},e}(Ek);const mWr=yWr;var _Wr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),xWr=function(n){_Wr(e,n);function e(t){return n.call(this,t)||this}return e.prototype.createRenderer=function(){return new AQe(this)},e}(mWr);const P8=xWr;function Wce(n,e){return MQe(n,e,[]).join("")}function MQe(n,e,t){if(n.nodeType==Node.CDATA_SECTION_NODE||n.nodeType==Node.TEXT_NODE)e?t.push(String(n.nodeValue).replace(/(\r\n|\r|\n)/g,"")):t.push(n.nodeValue);else{var r=void 0;for(r=n.firstChild;r;r=r.nextSibling)MQe(r,e,t)}return t}function SWr(n){return"documentElement"in n}function wWr(n){return new DOMParser().parseFromString(n,"application/xml")}function KN(n,e){return function(t,r){var i=n.call(e!==void 0?e:this,t,r);if(i!==void 0){var a=r[r.length-1];a.push(i)}}}function Fs(n,e,t){return function(r,i){var a=n.call(t!==void 0?t:this,r,i);if(a!==void 0){var o=i[i.length-1],s=e!==void 0?e:r.localName,l=void 0;s in o?l=o[s]:(l=[],o[s]=l),l.push(a)}}}function sr(n,e,t){return function(r,i){var a=n.call(t!==void 0?t:this,r,i);if(a!==void 0){var o=i[i.length-1],s=e!==void 0?e:r.localName;o[s]=a}}}function wi(n,e,t){var r=t!==void 0?t:{},i,a;for(i=0,a=n.length;i<a;++i)r[n[i]]=e;return r}function bWr(n,e,t,r){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var a=n[i.namespaceURI];if(a!==void 0){var o=a[i.localName];o!==void 0&&o.call(r,i,t)}}}function $i(n,e,t,r,i){return r.push(n),bWr(e,t,r,i),r.pop()}var EWr=function(){function n(){}return n.prototype.read=function(e){if(e)if(typeof e=="string"){var t=wWr(e);return this.readFromDocument(t)}else return SWr(e)?this.readFromDocument(e):this.readFromNode(e);else return null},n.prototype.readFromDocument=function(e){for(var t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFromNode(t);return null},n.prototype.readFromNode=function(e){},n}();const Hce=EWr;var TWr="http://www.w3.org/1999/xlink";function wL(n){return n.getAttributeNS(TWr,"href")}function uM(n){var e=/^\s*(true|1)|(false|0)\s*$/.exec(n);if(e)return e[1]!==void 0||!1}function mE(n){var e=Wce(n,!1);return b1(e)}function b1(n){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n);if(e)return parseFloat(e[1])}function s0(n){var e=Wce(n,!1);return az(e)}function az(n){var e=/^\s*(\d+)\s*$/.exec(n);if(e)return parseInt(e[1],10)}function xn(n){return Wce(n,!1).trim()}var CWr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Hd=[null,"http://www.opengis.net/ows/1.1"],AWr=wi(Hd,{ServiceIdentification:sr(JWr),ServiceProvider:sr(eHr),OperationsMetadata:sr(ZWr)}),MWr=function(n){CWr(e,n);function e(){return n.call(this)||this}return e.prototype.readFromNode=function(t){var r=$i({},AWr,t,[]);return r||null},e}(Hce),IWr=wi(Hd,{DeliveryPoint:sr(xn),City:sr(xn),AdministrativeArea:sr(xn),PostalCode:sr(xn),Country:sr(xn),ElectronicMailAddress:sr(xn)}),LWr=wi(Hd,{Value:Fs(tHr)}),PWr=wi(Hd,{AllowedValues:sr($Wr)}),OWr=wi(Hd,{Phone:sr(KWr),Address:sr(VWr)}),RWr=wi(Hd,{HTTP:sr(YWr)}),DWr=wi(Hd,{Get:Fs(XWr),Post:void 0}),NWr=wi(Hd,{DCP:sr(jWr)}),kWr=wi(Hd,{Operation:qWr}),FWr=wi(Hd,{Voice:sr(xn),Facsimile:sr(xn)}),BWr=wi(Hd,{Constraint:Fs(WWr)}),GWr=wi(Hd,{IndividualName:sr(xn),PositionName:sr(xn),ContactInfo:sr(HWr)}),zWr=wi(Hd,{Abstract:sr(xn),AccessConstraints:sr(xn),Fees:sr(xn),Title:sr(xn),ServiceTypeVersion:sr(xn),ServiceType:sr(xn)}),UWr=wi(Hd,{ProviderName:sr(xn),ProviderSite:sr(wL),ServiceContact:sr(QWr)});function VWr(n,e){return $i({},IWr,n,e)}function $Wr(n,e){return $i({},LWr,n,e)}function WWr(n,e){var t=n.getAttribute("name");if(!!t)return $i({name:t},PWr,n,e)}function HWr(n,e){return $i({},OWr,n,e)}function jWr(n,e){return $i({},RWr,n,e)}function XWr(n,e){var t=wL(n);if(!!t)return $i({href:t},BWr,n,e)}function YWr(n,e){return $i({},DWr,n,e)}function qWr(n,e){var t=n.getAttribute("name"),r=$i({},NWr,n,e);if(!!r){var i=e[e.length-1];i[t]=r}}function ZWr(n,e){return $i({},kWr,n,e)}function KWr(n,e){return $i({},FWr,n,e)}function JWr(n,e){return $i({},zWr,n,e)}function QWr(n,e){return $i({},GWr,n,e)}function eHr(n,e){return $i({},UWr,n,e)}function tHr(n,e){return xn(n)}const rHr=MWr;var nHr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Vm=[null,"http://www.opengis.net/wmts/1.0"],bL=[null,"http://www.opengis.net/ows/1.1"],iHr=wi(Vm,{Contents:sr(gHr)}),aHr=function(n){nHr(e,n);function e(){var t=n.call(this)||this;return t.owsParser_=new rHr,t}return e.prototype.readFromNode=function(t){var r=t.getAttribute("version");r&&(r=r.trim());var i=this.owsParser_.readFromNode(t);return i?(i.version=r,i=$i(i,iHr,t,[]),i||null):null},e}(Hce),oHr=wi(Vm,{Layer:Fs(yHr),TileMatrixSet:Fs(mHr)}),sHr=wi(Vm,{Style:Fs(_Hr),Format:Fs(xn),TileMatrixSetLink:Fs(xHr),Dimension:Fs(SHr),ResourceURL:Fs(wHr)},wi(bL,{Title:sr(xn),Abstract:sr(xn),WGS84BoundingBox:sr(IQe),Identifier:sr(xn)})),lHr=wi(Vm,{LegendURL:Fs(bHr)},wi(bL,{Title:sr(xn),Identifier:sr(xn)})),uHr=wi(Vm,{TileMatrixSet:sr(xn),TileMatrixSetLimits:sr(THr)}),hHr=wi(Vm,{TileMatrixLimits:KN(CHr)}),cHr=wi(Vm,{TileMatrix:sr(xn),MinTileRow:sr(s0),MaxTileRow:sr(s0),MinTileCol:sr(s0),MaxTileCol:sr(s0)}),fHr=wi(Vm,{Default:sr(xn),Value:Fs(xn)},wi(bL,{Identifier:sr(xn)})),dHr=wi(bL,{LowerCorner:KN(ine),UpperCorner:KN(ine)}),vHr=wi(Vm,{WellKnownScaleSet:sr(xn),TileMatrix:Fs(EHr)},wi(bL,{SupportedCRS:sr(xn),Identifier:sr(xn),BoundingBox:sr(IQe)})),pHr=wi(Vm,{TopLeftCorner:sr(ine),ScaleDenominator:sr(mE),TileWidth:sr(s0),TileHeight:sr(s0),MatrixWidth:sr(s0),MatrixHeight:sr(s0)},wi(bL,{Identifier:sr(xn)}));function gHr(n,e){return $i({},oHr,n,e)}function yHr(n,e){return $i({},sHr,n,e)}function mHr(n,e){return $i({},vHr,n,e)}function _Hr(n,e){var t=$i({},lHr,n,e);if(!!t){var r=n.getAttribute("isDefault")==="true";return t.isDefault=r,t}}function xHr(n,e){return $i({},uHr,n,e)}function SHr(n,e){return $i({},fHr,n,e)}function wHr(n,e){var t=n.getAttribute("format"),r=n.getAttribute("template"),i=n.getAttribute("resourceType"),a={};return t&&(a.format=t),r&&(a.template=r),i&&(a.resourceType=i),a}function IQe(n,e){var t=$i([],dHr,n,e);if(t.length==2)return e7(t)}function bHr(n,e){var t={};return t.format=n.getAttribute("format"),t.href=wL(n),t}function ine(n,e){var t=xn(n).split(/\s+/);if(!(!t||t.length!=2)){var r=+t[0],i=+t[1];if(!(isNaN(r)||isNaN(i)))return[r,i]}}function EHr(n,e){return $i({},pHr,n,e)}function THr(n,e){return $i([],hHr,n,e)}function CHr(n,e){return $i({},cHr,n,e)}const dPe=aHr;var AHr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),wc=[null,"http://www.opengis.net/wms"],MHr=wi(wc,{Service:sr(qHr),Capability:sr(YHr)}),IHr=wi(wc,{Request:sr(rjr),Exception:sr(QHr),Layer:sr(ejr)}),LHr=function(n){AHr(e,n);function e(){var t=n.call(this)||this;return t.version=void 0,t}return e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var r=$i({version:this.version},MHr,t,[]);return r||null},e}(Hce),PHr=wi(wc,{Name:sr(xn),Title:sr(xn),Abstract:sr(xn),KeywordList:sr(RQe),OnlineResource:sr(wL),ContactInformation:sr(ZHr),Fees:sr(xn),AccessConstraints:sr(xn),LayerLimit:sr(s0),MaxWidth:sr(s0),MaxHeight:sr(s0)}),OHr=wi(wc,{ContactPersonPrimary:sr(KHr),ContactPosition:sr(xn),ContactAddress:sr(JHr),ContactVoiceTelephone:sr(xn),ContactFacsimileTelephone:sr(xn),ContactElectronicMailAddress:sr(xn)}),RHr=wi(wc,{ContactPerson:sr(xn),ContactOrganization:sr(xn)}),DHr=wi(wc,{AddressType:sr(xn),Address:sr(xn),City:sr(xn),StateOrProvince:sr(xn),PostCode:sr(xn),Country:sr(xn)}),NHr=wi(wc,{Format:KN(xn)}),LQe=wi(wc,{Name:sr(xn),Title:sr(xn),Abstract:sr(xn),KeywordList:sr(RQe),CRS:Fs(xn),EX_GeographicBoundingBox:sr(XHr),BoundingBox:Fs(jHr),Dimension:Fs(tjr),Attribution:sr(HHr),AuthorityURL:Fs(ajr),Identifier:Fs(xn),MetadataURL:Fs(ojr),DataURL:Fs(P_),FeatureListURL:Fs(P_),Style:Fs(sjr),MinScaleDenominator:sr(mE),MaxScaleDenominator:sr(mE),Layer:Fs(PQe)}),kHr=wi(wc,{Title:sr(xn),OnlineResource:sr(wL),LogoURL:sr(OQe)}),FHr=wi(wc,{westBoundLongitude:sr(mE),eastBoundLongitude:sr(mE),southBoundLatitude:sr(mE),northBoundLatitude:sr(mE)}),BHr=wi(wc,{GetCapabilities:sr(NZ),GetMap:sr(NZ),GetFeatureInfo:sr(NZ)}),GHr=wi(wc,{Format:Fs(xn),DCPType:Fs(njr)}),zHr=wi(wc,{HTTP:sr(ijr)}),UHr=wi(wc,{Get:sr(P_),Post:sr(P_)}),VHr=wi(wc,{Name:sr(xn),Title:sr(xn),Abstract:sr(xn),LegendURL:Fs(OQe),StyleSheetURL:sr(P_),StyleURL:sr(P_)}),$Hr=wi(wc,{Format:sr(xn),OnlineResource:sr(wL)}),WHr=wi(wc,{Keyword:KN(xn)});function HHr(n,e){return $i({},kHr,n,e)}function jHr(n,e){var t=[b1(n.getAttribute("minx")),b1(n.getAttribute("miny")),b1(n.getAttribute("maxx")),b1(n.getAttribute("maxy"))],r=[b1(n.getAttribute("resx")),b1(n.getAttribute("resy"))];return{crs:n.getAttribute("CRS"),extent:t,res:r}}function XHr(n,e){var t=$i({},FHr,n,e);if(!!t){var r=t.westBoundLongitude,i=t.southBoundLatitude,a=t.eastBoundLongitude,o=t.northBoundLatitude;if(!(r===void 0||i===void 0||a===void 0||o===void 0))return[r,i,a,o]}}function YHr(n,e){return $i({},IHr,n,e)}function qHr(n,e){return $i({},PHr,n,e)}function ZHr(n,e){return $i({},OHr,n,e)}function KHr(n,e){return $i({},RHr,n,e)}function JHr(n,e){return $i({},DHr,n,e)}function QHr(n,e){return $i([],NHr,n,e)}function ejr(n,e){var t=$i({},LQe,n,e);return t.Layer===void 0?Object.assign(t,PQe(n,e)):t}function PQe(n,e){var t=e[e.length-1],r=$i({},LQe,n,e);if(!!r){var i=uM(n.getAttribute("queryable"));i===void 0&&(i=t.queryable),r.queryable=i!==void 0?i:!1;var a=az(n.getAttribute("cascaded"));a===void 0&&(a=t.cascaded),r.cascaded=a;var o=uM(n.getAttribute("opaque"));o===void 0&&(o=t.opaque),r.opaque=o!==void 0?o:!1;var s=uM(n.getAttribute("noSubsets"));s===void 0&&(s=t.noSubsets),r.noSubsets=s!==void 0?s:!1;var l=b1(n.getAttribute("fixedWidth"));l||(l=t.fixedWidth),r.fixedWidth=l;var u=b1(n.getAttribute("fixedHeight"));u||(u=t.fixedHeight),r.fixedHeight=u;var h=["Style","CRS","AuthorityURL"];h.forEach(function(f){if(f in t){var d=r[f]||[];r[f]=d.concat(t[f])}});var c=["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"];return c.forEach(function(f){if(!(f in r)){var d=t[f];r[f]=d}}),r}}function tjr(n,e){var t={name:n.getAttribute("name"),units:n.getAttribute("units"),unitSymbol:n.getAttribute("unitSymbol"),default:n.getAttribute("default"),multipleValues:uM(n.getAttribute("multipleValues")),nearestValue:uM(n.getAttribute("nearestValue")),current:uM(n.getAttribute("current")),values:xn(n)};return t}function P_(n,e){return $i({},$Hr,n,e)}function rjr(n,e){return $i({},BHr,n,e)}function njr(n,e){return $i({},zHr,n,e)}function ijr(n,e){return $i({},UHr,n,e)}function NZ(n,e){return $i({},GHr,n,e)}function OQe(n,e){var t=P_(n,e);if(t){var r=[az(n.getAttribute("width")),az(n.getAttribute("height"))];return t.size=r,t}}function ajr(n,e){var t=P_(n,e);if(t)return t.name=n.getAttribute("name"),t}function ojr(n,e){var t=P_(n,e);if(t)return t.type=n.getAttribute("type"),t}function sjr(n,e){return $i({},VHr,n,e)}function RQe(n,e){return $i([],WHr,n,e)}const ljr=LHr;var J6="1.3.0";const Q6={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"};var ujr=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),hjr=function(n){ujr(e,n);function e(t){var r=this,i=t||{},a=i.imageSmoothing!==void 0?i.imageSmoothing:!0;i.interpolate!==void 0&&(a=i.interpolate);var o=i.params||{},s="TRANSPARENT"in o?o.TRANSPARENT:!0;return r=n.call(this,{attributions:i.attributions,attributionsCollapsible:i.attributionsCollapsible,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,interpolate:a,opaque:!s,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:i.wrapX!==void 0?i.wrapX:!0,transition:i.transition,zDirection:i.zDirection})||this,r.gutter_=i.gutter!==void 0?i.gutter:0,r.params_=o,r.v13_=!0,r.serverType_=i.serverType,r.hidpi_=i.hidpi!==void 0?i.hidpi:!0,r.tmpExtent_=Md(),r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return e.prototype.getFeatureInfoUrl=function(t,r,i,a){var o=ya(i),s=this.getProjection(),l=this.getTileGrid();l||(l=this.getTileGridForProjection(o));var u=l.getZForResolution(r,this.zDirection),h=l.getTileCoordForCoordAndZ(t,u);if(!(l.getResolutions().length<=h[0])){var c=l.getResolution(h[0]),f=l.getTileCoordExtent(h,this.tmpExtent_),d=nh(l.getTileSize(h[0]),this.tmpSize),v=this.gutter_;v!==0&&(d=cTe(d,v,this.tmpSize),f=f0(f,c*v,f)),s&&s!==o&&(c=b7(s,o,t,c),f=Cte(f,o,s),t=r7(t,o,s));var p={SERVICE:"WMS",VERSION:J6,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};Ao(p,this.params_,a);var g=Math.floor((t[0]-f[0])/c),m=Math.floor((f[3]-t[1])/c);return p[this.v13_?"I":"X"]=g,p[this.v13_?"J":"Y"]=m,this.getRequestUrl_(h,d,f,1,s||o,p)}},e.prototype.getLegendUrl=function(t,r){if(this.urls[0]!==void 0){var i={SERVICE:"WMS",VERSION:J6,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(r===void 0||r.LAYER===void 0){var a=this.params_.LAYERS,o=!Array.isArray(a)||a.length===1;if(!o)return;i.LAYER=a}if(t!==void 0){var s=this.getProjection()?this.getProjection().getMetersPerUnit():1,l=28e-5;i.SCALE=t*s/l}return Ao(i,r),T7(this.urls[0],i)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,r,i,a,o,s){var l=this.urls;if(!!l){if(s.WIDTH=r[0],s.HEIGHT=r[1],s[this.v13_?"CRS":"SRS"]=o.getCode(),"STYLES"in this.params_||(s.STYLES=""),a!=1)switch(this.serverType_){case Q6.GEOSERVER:var u=90*a+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+u:s.FORMAT_OPTIONS="dpi:"+u;break;case Q6.MAPSERVER:s.MAP_RESOLUTION=90*a;break;case Q6.CARMENTA_SERVER:case Q6.QGIS:s.DPI=90*a;break;default:ki(!1,52);break}var h=o.getAxisOrientation(),c=i;if(this.v13_&&h.substr(0,2)=="ne"){var f=void 0;f=i[0],c[0]=i[1],c[1]=f,f=i[2],c[2]=i[3],c[3]=f}s.BBOX=c.join(",");var d;if(l.length==1)d=l[0];else{var v=bS(Fqe(t),l.length);d=l[v]}return T7(d,s)}},e.prototype.getTilePixelRatio=function(t){return!this.hidpi_||this.serverType_===void 0?1:t},e.prototype.getKeyForParams_=function(){var t=0,r=[];for(var i in this.params_)r[t++]=i+"-"+this.params_[i];return r.join("/")},e.prototype.updateParams=function(t){Ao(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||J6;this.v13_=Syr(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,r,i){var a=this.getTileGrid();if(a||(a=this.getTileGridForProjection(i)),!(a.getResolutions().length<=t[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var o=a.getResolution(t[0]),s=a.getTileCoordExtent(t,this.tmpExtent_),l=nh(a.getTileSize(t[0]),this.tmpSize),u=this.gutter_;u!==0&&(l=cTe(l,u,this.tmpSize),s=f0(s,o*u,s)),r!=1&&(l=hXe(l,r,this.tmpSize));var h={SERVICE:"WMS",VERSION:J6,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return Ao(h,this.params_),this.getRequestUrl_(t,l,s,r,i,h)}},e}(Fk);const cjr=hjr;var fjr=200,jce="__lodash_hash_undefined__",djr=9007199254740991,vjr="[object Arguments]",pjr="[object Function]",gjr="[object GeneratorFunction]",yjr=/[\\^$.*+?()[\]{}|]/g,mjr=/^\[object .+?Constructor\]$/,_jr=typeof at=="object"&&at&&at.Object===Object&&at,xjr=typeof self=="object"&&self&&self.Object===Object&&self,Xce=_jr||xjr||Function("return this")();function Sjr(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function wjr(n,e){var t=n?n.length:0;return!!t&&Ajr(n,e,0)>-1}function bjr(n,e,t){for(var r=-1,i=n?n.length:0;++r<i;)if(t(e,n[r]))return!0;return!1}function Ejr(n,e){for(var t=-1,r=n?n.length:0,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}function Tjr(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}function Cjr(n,e,t,r){for(var i=n.length,a=t+(r?1:-1);r?a--:++a<i;)if(e(n[a],a,n))return a;return-1}function Ajr(n,e,t){if(e!==e)return Cjr(n,Mjr,t);for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function Mjr(n){return n!==n}function Ijr(n){return function(e){return n(e)}}function Ljr(n,e){return n.has(e)}function Pjr(n,e){return n==null?void 0:n[e]}function Ojr(n){var e=!1;if(n!=null&&typeof n.toString!="function")try{e=!!(n+"")}catch{}return e}var Rjr=Array.prototype,Djr=Function.prototype,Yce=Object.prototype,kZ=Xce["__core-js_shared__"],vPe=function(){var n=/[^.]+$/.exec(kZ&&kZ.keys&&kZ.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),DQe=Djr.toString,$$=Yce.hasOwnProperty,NQe=Yce.toString,Njr=RegExp("^"+DQe.call($$).replace(yjr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pPe=Xce.Symbol,kjr=Yce.propertyIsEnumerable,Fjr=Rjr.splice,gPe=pPe?pPe.isConcatSpreadable:void 0,yPe=Math.max,Bjr=FQe(Xce,"Map"),JN=FQe(Object,"create");function V2(n){var e=-1,t=n?n.length:0;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Gjr(){this.__data__=JN?JN(null):{}}function zjr(n){return this.has(n)&&delete this.__data__[n]}function Ujr(n){var e=this.__data__;if(JN){var t=e[n];return t===jce?void 0:t}return $$.call(e,n)?e[n]:void 0}function Vjr(n){var e=this.__data__;return JN?e[n]!==void 0:$$.call(e,n)}function $jr(n,e){var t=this.__data__;return t[n]=JN&&e===void 0?jce:e,this}V2.prototype.clear=Gjr;V2.prototype.delete=zjr;V2.prototype.get=Ujr;V2.prototype.has=Vjr;V2.prototype.set=$jr;function EL(n){var e=-1,t=n?n.length:0;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Wjr(){this.__data__=[]}function Hjr(n){var e=this.__data__,t=W$(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Fjr.call(e,t,1),!0}function jjr(n){var e=this.__data__,t=W$(e,n);return t<0?void 0:e[t][1]}function Xjr(n){return W$(this.__data__,n)>-1}function Yjr(n,e){var t=this.__data__,r=W$(t,n);return r<0?t.push([n,e]):t[r][1]=e,this}EL.prototype.clear=Wjr;EL.prototype.delete=Hjr;EL.prototype.get=jjr;EL.prototype.has=Xjr;EL.prototype.set=Yjr;function TL(n){var e=-1,t=n?n.length:0;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function qjr(){this.__data__={hash:new V2,map:new(Bjr||EL),string:new V2}}function Zjr(n){return H$(this,n).delete(n)}function Kjr(n){return H$(this,n).get(n)}function Jjr(n){return H$(this,n).has(n)}function Qjr(n,e){return H$(this,n).set(n,e),this}TL.prototype.clear=qjr;TL.prototype.delete=Zjr;TL.prototype.get=Kjr;TL.prototype.has=Jjr;TL.prototype.set=Qjr;function oz(n){var e=-1,t=n?n.length:0;for(this.__data__=new TL;++e<t;)this.add(n[e])}function eXr(n){return this.__data__.set(n,jce),this}function tXr(n){return this.__data__.has(n)}oz.prototype.add=oz.prototype.push=eXr;oz.prototype.has=tXr;function W$(n,e){for(var t=n.length;t--;)if(hXr(n[t][0],e))return t;return-1}function rXr(n,e,t,r){var i=-1,a=wjr,o=!0,s=n.length,l=[],u=e.length;if(!s)return l;t&&(e=Ejr(e,Ijr(t))),r?(a=bjr,o=!1):e.length>=fjr&&(a=Ljr,o=!1,e=new oz(e));e:for(;++i<s;){var h=n[i],c=t?t(h):h;if(h=r||h!==0?h:0,o&&c===c){for(var f=u;f--;)if(e[f]===c)continue e;l.push(h)}else a(e,c,r)||l.push(h)}return l}function kQe(n,e,t,r,i){var a=-1,o=n.length;for(t||(t=aXr),i||(i=[]);++a<o;){var s=n[a];e>0&&t(s)?e>1?kQe(s,e-1,t,r,i):Tjr(i,s):r||(i[i.length]=s)}return i}function nXr(n){if(!GQe(n)||sXr(n))return!1;var e=BQe(n)||Ojr(n)?Njr:mjr;return e.test(lXr(n))}function iXr(n,e){return e=yPe(e===void 0?n.length-1:e,0),function(){for(var t=arguments,r=-1,i=yPe(t.length-e,0),a=Array(i);++r<i;)a[r]=t[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=t[r];return o[e]=a,Sjr(n,this,o)}}function H$(n,e){var t=n.__data__;return oXr(e)?t[typeof e=="string"?"string":"hash"]:t.map}function FQe(n,e){var t=Pjr(n,e);return nXr(t)?t:void 0}function aXr(n){return fXr(n)||cXr(n)||!!(gPe&&n&&n[gPe])}function oXr(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function sXr(n){return!!vPe&&vPe in n}function lXr(n){if(n!=null){try{return DQe.call(n)}catch{}try{return n+""}catch{}}return""}var uXr=iXr(function(n,e){return ane(n)?rXr(n,kQe(e,1,ane,!0)):[]});function hXr(n,e){return n===e||n!==n&&e!==e}function cXr(n){return ane(n)&&$$.call(n,"callee")&&(!kjr.call(n,"callee")||NQe.call(n)==vjr)}var fXr=Array.isArray;function dXr(n){return n!=null&&vXr(n.length)&&!BQe(n)}function ane(n){return pXr(n)&&dXr(n)}function BQe(n){var e=GQe(n)?NQe.call(n):"";return e==pjr||e==gjr}function vXr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=djr}function GQe(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function pXr(n){return!!n&&typeof n=="object"}var gXr=uXr;window.proj4=Bu;window.Proj4js=Bu;const eB=new jc,yXr=1e3,mPe={DEGREES:2*Math.PI*6370997/360,DEGREE:2*Math.PI*6370997/360,FEET:.3048,METERS:1,METER:1,M:1,USFEET:1200/3937},ZP={default:96,iServerWMTS:90.7142857142857};class mXr extends fT{constructor(e,t){super(),br.isObject(e)?(t=e,this.mapId=t.id):this.mapId=e,t=t||{},this.server=t.server,this.successCallback=t.successCallback,this.errorCallback=t.errorCallback,this.credentialKey=t.credentialKey,this.credentialValue=t.credentialValue,this.withCredentials=t.withCredentials||!1,this.target=t.target||"map",this.excludePortalProxyUrl=t.excludePortalProxyUrl||!1,this.serviceProxy=t.serviceProxy||null,this.tiandituKey=t.tiandituKey,this.googleMapsAPIKey=t.googleMapsAPIKey||"",this.proxy=t.proxy,this.layerAdded=0,this.layers=[],this.events=new y0(this,null,["updateDataflowFeature"],!0),this.webMap=t.webMap,this.tileFormat=t.tileFormat&&t.tileFormat.toLowerCase(),this.restDataSingleRequestCount=t.restDataSingleRequestCount||1e3,this.createMap(t.mapSetting),this.webMap?br.isString(this.webMap)?this.createWebmap(this.webMap):this.getMapInfoSuccess(t.webMap):this.createWebmap()}_removeBaseLayer(){const e=this.map,{layer:t,labelLayer:r}=this.baseLayer;r&&e.removeLayer(r),t&&e.removeLayer(t),this.baseLayer=null}_removeLayers(){const e=this.map;this.layers.forEach(({layerType:t,layer:r,labelLayer:i,pathLayer:a,dataflowService:o})=>{if(!!r){if(t==="MIGRATION"){r.remove();return}(t==="DATAFLOW_POINT_TRACK"||t==="DATAFLOW_HEAT")&&(a&&e.removeLayer(a),o&&o.unSubscribe()),i&&e.removeLayer(i),e.removeLayer(r)}}),this.layers=[]}_clear(){this.scales=[],this.resolutionArray=[],this.resolutions={},this.layerAdded=0,this._removeBaseLayer(),this._removeLayers()}refresh(){this._clear(),this.createWebmap()}createMap(e){let t,r,i;e&&(i=e.interactions,t=e.overlays,r=e.controls),this.map=new EA({interactions:i,overlays:t,controls:r,target:this.target}),e&&this.registerMapEvent({mapClickCallback:e.mapClickCallback})}registerMapEvent(e){this.map.on("click",function(r){e.mapClickCallback&&e.mapClickCallback(r)})}createWebmap(e){let t;if(e)t=e;else{let r=this.server.split("");r[r.length-1]!=="/"&&(this.server+="/"),t=this.server+"web/maps/"+this.mapId+"/map";let i="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.server.indexOf(i)>-1){let a=this.server.split(i);a.length>1&&(t=a[0]+i+this.server+"web/maps/"+this.mapId+"/map.json")}}this.getMapInfo(t)}getMapInfo(e){let t=this,r=e;e.indexOf(".json")===-1&&(e=this.handleJSONSuffix(e),r=e),li.get(t.getRequestUrl(r),null,{withCredentials:this.withCredentials}).then(function(i){return i.json()}).then(function(i){t.getMapInfoSuccess(i)}).catch(function(i){t.errorCallback&&t.errorCallback(i,"getMapFaild",t.map)})}async getMapInfoSuccess(e){let t=this;if(e.succeed===!1){t.errorCallback&&t.errorCallback(e.error,"getMapFaild",t.map);return}let r=await t.handleCRS(e.projection,e.baseLayer.url);if(t.mapParams={title:e.title,description:e.description},r.action==="BrowseMap")t.createSpecLayer(e);else if(r.action==="OpenMap")t.baseProjection=r.newCrs||e.projection,t.webMapVersion=e.version,t.baseLayer=e.baseLayer,t.isHaveGraticule=e.grid&&e.grid.graticule,e.baseLayer&&e.baseLayer.layerType==="MAPBOXSTYLE"?t.addMVTMapLayer(e,e.baseLayer,0).then(async()=>{t.createView(e),!e.layers||e.layers.length===0?t.sendMapToUser(0):await t.addLayers(e),t.addGraticule(e)}).catch(function(i){t.errorCallback&&t.errorCallback(i,"getMapFaild",t.map)}):(await t.addBaseMap(e),!e.layers||e.layers.length===0?t.sendMapToUser(0):await t.addLayers(e),t.addGraticule(e));else{t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${e.projection}`},"getMapFaild",t.map);return}}async handleCRS(e,t){let r=this,i={},a=e,o="OpenMap";return this.isCustomProjection(e)?await li.get(r.getRequestUrl(`${t}/prjCoordSys.wkt`),null,{withCredentials:r.withCredentials,withoutFormatSuffix:!0}).then(function(s){return s.text()}).then(async function(s){if(s.indexOf("<!doctype html>")===-1)r.addProjctionFromWKT(s,e),i={action:o,newCrs:a};else throw"ERROR"}).catch(function(){o="BrowseMap",i={action:o,newCrs:a}}):(e.indexOf("EPSG")===0&&e.split(":")[1]<=0?o="BrowseMap":e==="EPSG:910111"||e==="EPSG:910112"?a="EPSG:3857":e==="EPSG:910101"||e==="EPSG:910102"?a="EPSG:4326":e.indexOf("EPSG")!==0&&(r.addProjctionFromWKT(a),a=r.getEpsgInfoFromWKT(e)),i={action:o,newCrs:a}),i}getScales(e){let t=[],r={},i,a,o=[],s=e.coordUnit||ya(e.projection).getUnits();if(s||(s=this.baseProjection=="EPSG:3857"?"m":"degree"),e.visibleScales&&e.visibleScales.length>0)e.visibleScales.forEach(l=>{let u=1/l;i=this.getResFromScale(u,s),l=`1:${u}`,r[this.formatScale(l)]=i,o.push(i),t.push(l)},this);else if(e.layerType==="WMTS")e.scales.forEach(l=>{i=this.getResFromScale(l,s,90.7),l=`1:${l}`,r[this.formatScale(l)]=i,o.push(i),t.push(l)},this);else{let{minZoom:l=0,maxZoom:u=22}=e,h=this.map.getView();for(let c=l;c<=u;c++)if(i=h.getResolutionForZoom(c),a=this.getScaleFromRes(i,s),t.indexOf(a)===-1){t.push(a);let f=a.replace(/,/g,"");r[f]=i,o.push(i)}}this.scales=t,this.resolutions=r,this.resolutionArray=o}getResFromScale(e,t="DEGREE",r=96){let i=mPe[t.toUpperCase()];return e*.0254/r/i}getScaleFromRes(e,t="DEGREE",r=96){let i,a=mPe[t.toUpperCase()];return i=e*r*a/.0254,"1:"+i}formatScale(e){return e.replace(/,/g,"")}createSpecLayer(e){let t=this,r=e.baseLayer,i=r.url,a=r.layerType,o=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],s=new ew({extent:o,units:"m",code:"EPSG:0"});fue(s);let l={center:e.center,level:0};t.baseProjection=s;let u={center:l.center?[l.center.x,l.center.y]:[0,0],zoom:0,projection:s};["4","5"].indexOf(br.getOlVersion())<0&&(u.multiWorld=!0);let h=new Lp(u);t.map.setView(h),t.mapParams&&(t.mapParams.extent=o,t.mapParams.projection=e.projection),i&&i.indexOf("?token=")>-1&&(t.credentialKey="token",t.credentialValue=e.baseLayer.credential=i.split("?token=")[1],i=i.split("?token=")[0]);let c;a==="TILE"?(i=this.handleJSONSuffix(i),li.get(t.getRequestUrl(i),null,{withCredentials:this.withCredentials}).then(function(f){return f.json()}).then(function(f){r.originResult=f;let d="IPORTAL",v=r.credential,p="Token",g=r.url;(r.url.indexOf("www.supermapol.com")>-1||r.url.indexOf("itest.supermapol.com")>-1)&&(p="Key",g=[g],d="ONLINE"),v&&xs[`register${p}`](g,v);let m={serverType:d,url:i,tileGrid:Bp.optionsFromMapJSON(i,f).tileGrid};i&&!H.isInTheSameDomain(i)&&!this.isIportalProxyServiceUrl(i)&&(m.tileProxy=t.server+"apps/viewer/getUrlResource.png?url="),c=new Bp(m),t.addSpecToMap(c)}).catch(function(f){t.errorCallback&&t.errorCallback(f,"getMapFaild",t.map)})):a==="WMS"?(c=t.createWMSSource(r),t.addSpecToMap(c)):a==="WMTS"?li.get(t.getRequestUrl(i,!0),null,{withCredentials:this.withCredentials}).then(function(f){return f.text()}).then(function(f){r.extent=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],r.scales=t.getWMTSScales(r.tileMatrixSet,f),r.dpi=ZP.iServerWMTS,c=t.createWMTSSource(r),t.addSpecToMap(c)}).catch(function(f){t.errorCallback&&t.errorCallback(f,"getMapFaild",t.map)}):t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${a}`},"getMapFaild",t.map),h&&h.fit(o)}addSpecToMap(e){let t=new P8({source:e,zIndex:0});this.map.addLayer(t),this.sendMapToUser(0)}getWMTSScales(e,t){let o=new dPe().read(t).Contents.TileMatrixSet,s=[];for(let l=0;l<o.length;l++)if(o[l].Identifier===e){for(let u=0;u<o[l].TileMatrix.length;u++)s.push(o[l].TileMatrix[u].ScaleDenominator);break}return s}async addBaseMap(e){let{baseLayer:t}=e,r=t.layerType;r!=="TILE"&&r!=="WMS"&&r!=="WMTS"?this.getInternetMapInfo(t):r==="WMTS"?await this.getWmtsInfo(t):r==="TILE"?await this.getTileInfo(t):r==="WMS"&&await this.getWmsInfo(t),t.projection=e.projection,t.extent||(t.extent=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y]),this.createView(e);let i=this.createBaseLayer(t,0,null,null,!0);if(i.setProperties({layerType:r}),this.map.addLayer(i),this.mapParams&&(this.mapParams.extent=t.extent,this.mapParams.projection=e.projection),t.labelLayerVisible){let a=new P8({source:this.createTiandituSource(t.layerType,e.projection,!0),zIndex:t.zIndex||1,visible:t.visible});this.map.addLayer(a),t.labelLayer=a}this.limitScale(e,t)}validScale(e){if(!e)return!1;const t=e.split(":")[1];if(!t)return!1;const r=1/+t;return!(r===1/0||r>=1)}limitScale(e,t){if(this.validScale(e.minScale)&&this.validScale(e.maxScale)){let r,i,a;if(t.layerType==="WMTS")r=t.scales,i=+e.minScale.split(":")[1],a=+e.maxScale.split(":")[1];else{const h=this.scales.map(c=>1/c.split(":")[1]);Array.isArray(t.visibleScales)&&t.visibleScales.length&&t.visibleScales?r=t.visibleScales:r=h,i=1/+e.minScale.split(":")[1],a=1/+e.maxScale.split(":")[1]}const o=this.findNearest(r,i),s=this.findNearest(r,a);let l=r.indexOf(o),u=r.indexOf(s);l>u&&([l,u]=[u,l]),(l!==0||u!==r.length-1)&&(this.map.setView(new Lp(Object.assign({},this.map.getView().options_,{maxResolution:void 0,minResolution:void 0,minZoom:l,maxZoom:u,constrainResolution:!1}))),this.map.addInteraction(new Tqe({constrainResolution:!0})))}}parseNumber(e){return Number(e.split(":")[1])}findNearest(e,t){let r=0,i=t;for(let a=1,o=e.length;a<o;a++)Math.abs(e[a]-i)<Math.abs(e[r]-i)&&(r=a);return e[r]}addMVTMapLayer(e,t,r){return t.zIndex=r,this.getMapboxStyleLayerInfo(e,t).then(i=>this.createMVTLayer(i).then(a=>{let o=br.newGuid(8);t.name&&a.setProperties({name:t.name,layerID:o,layerType:"VECTOR_TILE"}),t.visibleScale&&this.setVisibleScales(a,t.visibleScale),t.layer=a,t.layerID=o,this.map.addLayer(a)})).catch(function(i){throw i})}createView(e){let t=e.center,r=e.level!==void 0?e.level:1,i=e.maxZoom||22,a,o=this.baseProjection,s=[];for(let c in t)s.push(t[c]);s.length===0&&(s=[0,0]),this.baseLayerExtent=a=e.baseLayer&&e.baseLayer.extent,this.mapParams&&(this.mapParams.extent=a,this.mapParams.projection=o),!dv(a,s)&&(s=kf(a));let l=e.baseLayer,u;if(l.visibleScales&&l.visibleScales.length>0||l.scales&&l.scales.length>0)this.getScales(l);else if(e.baseLayer&&a&&a.length===4){let c=a[2]-a[0],f=a[3]-a[1],d=c/512,v=f/512;u=Math.max(d,v)}this.map.setView(new Lp({zoom:r,center:s,projection:o,maxZoom:i,maxResolution:u}));let h={};if(l.scales&&l.scales.length>0&&l.layerType==="WMTS"||this.resolutionArray&&this.resolutionArray.length>0?h={zoom:r,center:s,projection:o,resolutions:this.resolutionArray,maxZoom:i}:l.layerType==="WMTS"?(h={zoom:r,center:s,projection:o,maxZoom:i},this.getScales(l)):(h={zoom:r,center:s,projection:o,maxResolution:u,maxZoom:i},this.getScales(l)),["4","5"].indexOf(br.getOlVersion())<0&&(h.multiWorld=!0,h.showFullExtent=!0,h.enableRotation=!1,h.constrainResolution=!0),this.map.setView(new Lp(h)),e.visibleExtent){const c=this.map.getView(),f=c.getResolutionForExtent(e.visibleExtent,this.map.getSize());c.setResolution(f),c.setCenter(kf(e.visibleExtent))}}createBaseLayer(e,t,r,i,a){let o,s=this;i&&(s=i);let l=e.layerType;switch((l.indexOf("TIANDITU_VEC")>-1||l.indexOf("TIANDITU_IMG")>-1||l.indexOf("TIANDITU_TER")>-1)&&(l=l.substr(0,12)),l){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":o=this.createTiandituSource(l,e.projection);break;case"BAIDU":o=this.createBaiduSource();break;case"BING":o=this.createBingSource(e,e.projection);break;case"WMS":o=this.createWMSSource(e);break;case"WMTS":o=s.createWMTSSource(e);break;case"TILE":case"SUPERMAP_REST":o=s.createDynamicTiledSource(e,a);break;case"CLOUD":case"CLOUD_BLACK":case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":o=this.createXYZSource(e);break}var u=new P8({source:o,zIndex:e.zIndex||1,visible:e.visible}),h=br.newGuid(8);e.name&&u.setProperties({name:e.name,layerID:h}),(e.visible===void 0||e.visible===null)&&(e.visible=!0),u.setVisible(e.visible),e.opacity&&u.setOpacity(e.opacity),t&&u.setZIndex(t),e.layer=u,e.layerID=h;let{visibleScale:c,autoUpdateTime:f}=e,d,v;return c&&(v=this.resolutions[c.minScale],d=this.resolutions[c.maxScale],v>1?u.setMaxResolution(Math.ceil(v)):u.setMaxResolution(v*1.1),u.setMinResolution(d)),f&&!e.autoUpdateInterval&&(e.autoUpdateInterval=setInterval(()=>{s.updateTileToMap(e,t)},f)),r&&(u.setZIndex(0),s.map.addLayer(u)),u}updateTileToMap(e,t){this.map.removeLayer(e.layer),this.map.addLayer(this.createBaseLayer(e,t))}getInternetMapInfo(e){const t=[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7],r=[-180,-90,180,90],i=[-2003750834e-2,-2003750834e-2,2003750834e-2,2003750834e-2],a=[1255566753929e-5,128185298656e-5,1752590886651e-5,748487070596e-5],o=[-1974111714519e-5,-1000392136848e-5,1998167771404e-5,1966098356089e-5];switch(e.units="m",e.layerType){case"BAIDU":e.iServerUrl="https://map.baidu.com/",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=t;break;case"CLOUD":e.url="http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"CLOUD_BLACK":e.url="http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"tencent":e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"TIANDITU_VEC_3857":case"TIANDITU_IMG_3857":case"TIANDITU_TER_3857":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:3857",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=t,e.layerType==="TIANDITU_TER_3857"&&(e.maxZoom=14);break;case"TIANDITU_VEC_4326":case"TIANDITU_IMG_4326":case"TIANDITU_TER_4326":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:4326",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=r,e.layerType==="TIANDITU_TER_4326"&&(e.maxZoom=14);break;case"OSM":e.url="http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=i,e.iserverUrl="https://www.openstreetmap.org";break;case"GOOGLE":e.url=`https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s${this.getLang()}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key=${this.googleMapsAPIKey}`,e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=22,e.level=1,e.extent=i,e.iserverUrl="https://www.google.cn/maps";break;case"JAPAN_STD":e.url="https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=0,e.extent=i;break;case"JAPAN_PALE":e.url="https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=19,e.level=2,e.extent=i;break;case"JAPAN_RELIEF":e.url="https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=5,e.maxZoom=14,e.level=5,e.extent=a;break;case"JAPAN_ORT":e.url="https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=12,e.level=2,e.extent=o;break}}createDynamicTiledSource(e,t){let r="IPORTAL",i=e.credential?e.credential.token:void 0,a="Token",o=e.url;(e.url.indexOf("www.supermapol.com")>-1||e.url.indexOf("itest.supermapol.com")>-1)&&(a="Key",o=[o],r="ONLINE"),i&&xs[`register${a}`](o,i);let s={transparent:!0,url:e.url,wrapX:!1,serverType:r,format:e.format};if(!t&&!this.isCustomProjection(this.baseProjection)&&(s.prjCoordSys={epsgCode:this.baseProjection.split(":")[1]}),e.visibleScales&&e.visibleScales.length>0){let u=[];for(let c in e.visibleScales){let f=br.scaleToResolution(e.visibleScales[c],ZP.default,e.coordUnit);u.push(f)}e.visibleResolutions=u;let h=new ym({extent:e.extent,resolutions:u});s.tileGrid=h}else{s.extent=this.baseLayerExtent;let u=new ym({extent:e.extent,resolutions:this.getResolutionsFromBounds(e.extent)});s.tileGrid=u}e.url&&!H.isInTheSameDomain(e.url)&&!this.isIportalProxyServiceUrl(e.url)&&e.format!=="webp"&&(s.tileProxy=this.server+"apps/viewer/getUrlResource.png?url=");let l=new Bp(s);return xs[`register${a}`](e.url),l}getResolutionsFromBounds(e){let t=[],r=Math.abs(e[0]-e[2])/512;for(let i=0;i<22;i++){if(i===0){t[i]=r;continue}r=r/2,t[i]=r}return t}createTiandituSource(e,t,r){let i={layerType:e.split("_")[1].toLowerCase(),isLabel:r||!1,projection:t,url:`https://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?tk=${this.tiandituKey}`};return new rM(i)}createBaiduSource(){return new c$}createBingSource(e,t){let r="https://dynamic.t0.tiles.ditu.live.com/comp/ch/{quadKey}?it=G,TW,L,LA&mkt=zh-cn&og=109&cstl=w4c&ur=CN&n=z";return new E7({wrapX:!1,projection:t,crossOrigin:"anonymous",tileUrlFunction:function(i){let[a,o,s]=[...i];s=s>0?s-1:-s-1;let l="";for(let u=a;u>0;u--){let h=0,c=1<<u-1;(o&c)!==0&&h++,(s&c)!==0&&(h+=2),l+=h.toString()}return r.replace("{quadKey}",l)}})}createXYZSource(e){return new E7({url:e.url,wrapX:!1,crossOrigin:"anonymous"})}createWMSSource(e){let t=this;return new cjr({url:e.url,wrapX:!1,params:{LAYERS:e.layers?e.layers[0]:"0",FORMAT:"image/png",VERSION:e.version||"1.3.0"},projection:e.projection||t.baseProjection,tileLoadFunction:function(r,i){r.getImage().src=i}})}async getTileLayerExtent(e,t,r){let i=this,a=await i.getTileLayerExtentInfo(e);if(a.succeed===!1)if(a.error.code===400){let o=await i.getTileLayerExtentInfo(e,!1);o.succeed===!1?r():(Object.assign(e,o),t(e))}else r();else Object.assign(e,a),t(e)}getTileLayerExtentInfo(e,t=!0){let r=this,i,a=e.url.trim(),o=e.credential,s={withCredentials:this.withCredentials,withoutFormatSuffix:!0};if(t){let l={epsgCode:r.baseProjection.split(":")[1]};r.isCustomProjection(r.baseProjection)||(a+=".json?prjCoordSys="+encodeURI(JSON.stringify(l)))}return o&&(a=`${a}&token=${encodeURI(o.token)}`,i=o.token),a=this.handleJSONSuffix(a),li.get(r.getRequestUrl(a),null,s).then(function(l){return l.json()}).then(async l=>{if(l.succeed===!1)return l;let u="png";return r.tileFormat==="webp"&&(u=await r.isSupportWebp(e.url,i)?"webp":"png"),{units:l.coordUnit&&l.coordUnit.toLowerCase(),coordUnit:l.coordUnit,visibleScales:l.visibleScales,extent:[l.bounds.left,l.bounds.bottom,l.bounds.right,l.bounds.top],projection:`EPSG:${l.prjCoordSys.epsgCode}`,format:u}}).catch(l=>({succeed:!1,error:l}))}getTileInfo(e,t,r){let i=this,a={withCredentials:this.withCredentials,withoutFormatSuffix:!0};e.url.indexOf("?token=")>-1&&(i.credentialKey="token",i.credentialValue=e.credential=e.url.split("?token=")[1],e.url=e.url.split("?token=")[0]);let o=this.handleJSONSuffix(e.url);return li.get(i.getRequestUrl(o),null,a).then(function(s){return s.json()}).then(async function(s){if(s&&s.code&&s.code!==200)throw s;s.visibleScales&&(e.visibleScales=s.visibleScales,e.coordUnit=s.coordUnit),e.maxZoom=s.maxZoom,e.maxZoom=s.minZoom;let l=e.credential?e.credential.token:void 0;if(e.format="png",i.tileFormat==="webp"&&e.url!=="https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark"){const u=await i.isSupportWebp(e.url,l);e.format=u?"webp":"png"}r?t&&t(r,null,!0,i):t&&t(e)}).catch(function(s){i.errorCallback&&i.errorCallback(s,"getTileInfo",i.map)})}getWMTSUrl(e,t){let r="?";return e.indexOf("?")>-1&&(r="&"),t?e+=r+"SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities":e+=r+"/1.0.0/WMTSCapabilities.xml",this.getRequestUrl(e,!0)}getWmtsInfo(e,t){let r=this,i={withCredentials:r.withCredentials,withoutFormatSuffix:!0};const a=!e.requestEncoding||e.requestEncoding==="KVP";return li.get(r.getWMTSUrl(e.url,a),null,i).then(function(o){return o.text()}).then(function(o){let l=new dPe().read(o);if(r.isValidResponse(l)){let h=l.Contents,c=h.TileMatrixSet,f=h.Layer,d,v,p,g="default";for(let S=0;S<f.length;S++)if(f[S].Identifier===e.layer){v=S,d=f[v],p=d.Format[0];var u=d.WGS84BoundingBox;break}d&&d.Style&&d.Style.forEach(S=>{S.isDefault&&(g=S.Identifier)});let m=[],y=[];for(let S=0;S<c.length;S++)if(c[S].Identifier===e.tileMatrixSet){let w=`EPSG:${c[S].SupportedCRS.split("::")[1]}`;for(let E=0;E<c[S].TileMatrix.length;E++)m.push(c[S].TileMatrix[E].ScaleDenominator),y.push(c[S].TileMatrix[E].Identifier);let b=c[S].TileMatrix[0].TopLeftCorner;e.origin=["EPSG:4326","EPSG:4490"].indexOf(w)>-1?[b[1],b[0]]:b;break}let _=e.name,x;u?(u[0]<-180&&(u[0]=-180),u[1]<-90&&(u[1]=-90),u[2]>180&&(u[2]=180),u[3]>90&&(u[3]=90),x=Cte(u,"EPSG:4326",r.baseProjection)):x=ya(r.baseProjection).getExtent(),e.tileUrl=r.getTileUrl(l.OperationsMetadata.GetTile.DCP.HTTP.Get,d,p,a),e.extent=x,e.name=_,e.orginEpsgCode=e.projection,e.overLayer=!0,e.scales=m,e.style=g,e.title=_,e.unit="m",e.layerFormat=p,e.matrixIds=y,t&&t(e)}}).catch(function(o){r.errorCallback&&r.errorCallback(o,"getWmtsFaild",r.map)})}getWmsInfo(e){let t=this,r=e.url.trim();r+=r.indexOf("?")>-1?"&SERVICE=WMS&REQUEST=GetCapabilities":"?SERVICE=WMS&REQUEST=GetCapabilities";let i={withCredentials:t.withCredentials,withoutFormatSuffix:!0};return new Promise(function(o){return li.get(t.getRequestUrl(r,!0),null,i).then(function(s){return s.text()}).then(async function(s){let u=new ljr().read(s);if(u){let h=u.Capability.Layer.Layer,c=e.projection;e.subLayers=e.layers[0],e.version=u.version;for(let f=0;f<h.length;f++)if(e.layers[0]===h[f].name){let d=h[f];if(d.bbox[c]){let v=d.bbox[c].bbox;e.version==="1.3.0"&&e.projection==="EPSG:4326"||e.version==="1.3.0"&&e.projection==="EPSG:4490"?e.extent=[v[1],v[0],v[3],v[2]]:e.extent=v;break}}}o()}).catch(function(s){t.errorCallback&&t.errorCallback(s,"getWMSFaild",t.map),o()})})}getTileUrl(e,t,r,i){let a;return i?e.forEach(o=>{o.Constraint[0].AllowedValues.Value[0].toUpperCase()==="KVP"&&(a=o.href)}):a=t.ResourceURL.filter(s=>s.format===r)[0].template,a}createWMTSSource(e){let t=e.extent||ya(e.projection).getExtent(),r=ya(this.baseProjection).getUnits();return new qqe({url:e.tileUrl||e.url,layer:e.layer,format:e.layerFormat,style:e.style,matrixSet:e.tileMatrixSet,requestEncoding:e.requestEncoding||"KVP",tileGrid:this.getWMTSTileGrid(t,e.scales,r,e.dpi,e.origin,e.matrixIds),tileLoadFunction:function(i,a){if(a.indexOf("tianditu.gov.cn")>=0){i.getImage().src=`${a}&tk=${H.getParameters(e.url).tk}`;return}i.getImage().src=a}})}getWMTSTileGrid(e,t,r,i,a,o){let s=this.getReslutionsFromScales(t,i||ZP.iServerWMTS,r);return new pre({origin:a,extent:e,resolutions:s.res,matrixIds:o||s.matrixIds})}getReslutionsFromScales(e,t,r,i){r=r&&r.toLowerCase()||"degrees",t=t||ZP.iServerWMTS,i=i||6378137;let a=[],o=[];if(br.isArray(e))e&&e.forEach(function(s,l){s>1&&(o.push(l),a.push(this.getResolutionFromScale(s,t,r,i)))},this);else{let s=e.TileMatrix;s&&s.forEach(function(l){o.push(l.Identifier),a.push(this.getResolutionFromScale(l.ScaleDenominator,t,r,i))},this)}return{res:a,matrixIds:o}}getResolutionFromScale(e,t=ZP.default,r,i){let a;return e=+e,e=e>1?1/e:e,r==="degrees"||r==="dd"||r==="degree"?a=.0254*1e4/t/e/(Math.PI*2*i/360)/1e4:a=.0254*1e4/t/e/1e4,a}isValidResponse(e){let t=["Contents","OperationsMetadata"],r=!0;for(let i=0;i<t.length;i++)if(!e[t[i]]||e.error){r=!1;break}return r}async addLayers(e){let t=e.layers,r=this,i=[],a=t.length;if(a>0){this.layers=t;for(let o=0;o<t.length;o++){const s=t[o];let l=o+1,u=s.dataSource,h=u&&u.type==="SAMPLE_DATA"&&!!u.name;if(s.layerType==="MAPBOXSTYLE")r.addMVTMapLayer(e,s,l).then(()=>{r.layerAdded++,r.sendMapToUser(a)}).catch(function(c){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(c,"getLayerFaild",r.map)});else if(u&&u.serverId||s.layerType==="MARKER"||s.layerType==="HOSTED_TILE"||h){let c=s.dataSource,f=c?c.serverId:s.serverId;if(!f&&!h){await r.addLayer(s,null,l),r.layerAdded++,r.sendMapToUser(a);return}if(s.layerType==="MARKER"||c&&(!c.accessType||c.accessType==="DIRECT")||h){let d=h?`${r.server}apps/dataviz/libs/sample-datas/${c.name}.json`:`${r.server}web/datas/${f}/content.json?pageSize=9999999&currentPage=1`;d=r.getRequestUrl(d),li.get(d,null,{withCredentials:this.withCredentials}).then(function(v){return v.json()}).then(async function(v){if(v.succeed===!1){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(v.error,"getLayerFaild",r.map);return}if(v&&v.type){if(v.type==="JSON"||v.type==="GEOJSON")v.content=v.content.type?v.content:JSON.parse(v.content),i=r.geojsonToFeature(v.content,s);else if(v.type==="EXCEL"||v.type==="CSV")if(s.dataSource&&s.dataSource.administrativeInfo){v.content.rows.unshift(v.content.colTitles);let{divisionType:p,divisionField:g}=s.dataSource.administrativeInfo,m=r.excelData2FeatureByDivision(v.content,p,g);i=r._parseGeoJsonData2Feature({allDatas:{features:m.features},fileCode:s.projection})}else i=await r.excelData2Feature(v.content,s);else if(v.type==="SHP"){let p=JSON.parse(v.content);v.content=p.layers[0],i=r.geojsonToFeature(v.content,s)}await r.addLayer(s,i,l),r.layerAdded++,r.sendMapToUser(a)}}).catch(function(v){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(v,"getLayerFaild",r.map)})}else{let d=s.layerType==="HOSTED_TILE",v=c?c.serverId:s.serverId;r.checkUploadToRelationship(v).then(function(p){if(p&&p.length>0){let g=p[0].name,m=p[0].type.toUpperCase();r.getDataService(v,g).then(async function(y){let _=y.dataItemServices;if(_.length===0){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map);return}if(d){let x=r.getService(_,"RESTDATA");r.isMvt(x.address,g).then(async S=>{await r.getServiceInfoFromLayer(l,a,s,_,g,m,S)}).catch(async()=>{await r.getServiceInfoFromLayer(l,a,s,_,g,m)})}else await r.getServiceInfoFromLayer(l,a,s,_,g,m)})}else r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map)}).catch(function(p){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(p,"getLayerFaild",r.map)})}}else u&&u.type==="USER_DATA"?r.addGeojsonFromUrl(s,a,l,!1):s.layerType==="TILE"?r.getTileLayerExtent(s,function(c){r.map.addLayer(r.createBaseLayer(c,l)),r.layerAdded++,r.sendMapToUser(a)},function(c){r.layerAdded++,r.sendMapToUser(a),r.errorCallback&&r.errorCallback(c,"getLayerFaild",r.map)}):s.layerType==="SUPERMAP_REST"||s.layerType==="WMS"||s.layerType==="WMTS"?s.layerType==="WMTS"?r.getWmtsInfo(s,function(c){r.map.addLayer(r.createBaseLayer(c,l)),r.layerAdded++,r.sendMapToUser(a)}):s.layerType==="WMS"?r.getWmsInfo(s).then(()=>{r.map.addLayer(r.createBaseLayer(s,l)),r.layerAdded++,r.sendMapToUser(a)}):(s.projection=r.baseProjection,r.map.addLayer(r.createBaseLayer(s,l)),r.layerAdded++,r.sendMapToUser(a)):u&&u.type==="REST_DATA"?r.getFeaturesFromRestData(s,l,a):u&&u.type==="REST_MAP"&&u.url?vMe(u.url,u.layerName,"smid=1",null,null,function(c){var f=c&&c.result.recordsets,d=f&&f[0],v=d.fields;if(d&&v){let m=[];for(var p in v){var g=v[p];(g.indexOf("Sm")!==0||g==="SmID")&&m.push(g)}r.getFeatures(m,s,async function(y){await r.addLayer(s,y,l),r.layerAdded++,r.sendMapToUser(a)},function(y){r.layerAdded++,r.errorCallback&&r.errorCallback(y,"getFeatureFaild",r.map)})}},function(c){r.errorCallback&&r.errorCallback(c,"getFeatureFaild",r.map)}):(s.layerType==="DATAFLOW_POINT_TRACK"||s.layerType==="DATAFLOW_HEAT")&&r.getDataflowInfo(s,async function(){await r.addLayer(s,i,l),r.layerAdded++,r.sendMapToUser(a)},function(c){r.layerAdded++,r.errorCallback&&r.errorCallback(c,"getFeatureFaild",r.map)})}}}addGeojsonFromUrl(e,t,r,i=this.withCredentials){let{dataSource:a}=e,{url:o}=a,s=this;li.get(o,null,{withCredentials:i,withoutFormatSuffix:!0}).then(function(l){return l.json()}).then(async function(l){if(!l||l.succeed===!1){t?s.errorCallback&&s.errorCallback(l.error,"autoUpdateFaild",s.map):(s.layerAdded++,s.sendMapToUser(t),s.errorCallback&&s.errorCallback(l.error,"getLayerFaild",s.map));return}var u;if(l.type==="CSV"||l.type==="EXCEL")if(e.dataSource&&e.dataSource.administrativeInfo){l.content.rows.unshift(l.content.colTitles);let{divisionType:c,divisionField:f}=e.dataSource.administrativeInfo,d=s.excelData2FeatureByDivision(l.content,c,f);u=s._parseGeoJsonData2Feature({allDatas:{features:d.features},fileCode:e.projection})}else u=await s.excelData2Feature(l.content,e);else{var h=l.content?JSON.parse(l.content):l;u=s.geojsonToFeature(h,e)}t?(await s.addLayer(e,u,r),s.layerAdded++,s.sendMapToUser(t)):(s.map.removeLayer(e.layer),e.labelLayer&&s.map.removeLayer(e.labelLayer),await s.addLayer(e,u,r))}).catch(function(l){s.layerAdded++,s.sendMapToUser(t),s.errorCallback&&s.errorCallback(l,"getLayerFaild",s.map)})}async getServiceInfoFromLayer(e,t,r,i,a,o,s){let l=this,u=s?!s.isMvt:r.layerType==="HOSTED_TILE",h=!1;for(let c=0;c<i.length;c++){const f=i[c];if(h)return;if(f&&u&&f.serviceType==="RESTMAP")h=!0,l.getTileLayerInfo(f.address).then(function(d){d.forEach(function(v){let p=v.bounds;r.layerType="TILE",r.orginEpsgCode=l.baseProjection,r.units=v.coordUnit&&v.coordUnit.toLowerCase(),r.extent=[p.left,p.bottom,p.right,p.top],r.visibleScales=v.visibleScales,r.url=v.url,r.sourceType="TILE",l.map.addLayer(l.createBaseLayer(r,e)),l.layerAdded++,l.sendMapToUser(t)})});else if(f&&!u&&f.serviceType==="RESTDATA")if(h=!0,s&&s.isMvt){let d=s.bounds;r=Object.assign(r,{layerType:"VECTOR_TILE",epsgCode:s.epsgCode,projection:`EPSG:${s.epsgCode}`,bounds:d,extent:[d.left,d.bottom,d.right,d.top],name:r.name,url:s.url,visible:r.visible,featureType:o,serverId:r.serverId.toString()}),l.map.addLayer(await l.addVectorTileLayer(r,e,"RESTDATA")),l.layerAdded++,l.sendMapToUser(t)}else h=!0,l.getDatasources(f.address).then(function(d){r.dataSource.dataSourceName=d+":"+a,r.dataSource.url=`${f.address}/data`,l.getFeaturesFromRestData(r,e,t)})}h||(l.layerAdded++,l.sendMapToUser(t),l.errorCallback&&l.errorCallback(null,"getLayerFaild",l.map))}getDataflowInfo(e,t,r){let i=this,a=e.url,o;a=this.handleJSONSuffix(a);let s=i.getRequestUrl(a,!1);e.credential&&e.credential.token&&(o=e.credential.token,s+=`?token=${o}`),li.get(s,null,{withCredentials:this.withCredentials}).then(function(l){return l.json()}).then(function(l){e.featureType="POINT",l&&l.featureMetaData&&(e.featureType=l.featureMetaData.featureType.toUpperCase()),e.wsUrl=l.urls[0].url,t()}).catch(function(){r()})}getFeaturesFromRestData(e,t,r){let i=this,a=e.dataSource,o=e.dataSource.url,s=a.dataSourceName||e.name,l=i.formatUrlWithCredential(o),u={};if(u.withCredentials=this.withCredentials,!this.excludePortalProxyUrl&&!H.isInTheSameDomain(l)&&(u.proxy=this.getProxy()),["EPSG:0"].includes(e.projection)){i.layerAdded++,i.sendMapToUser(r),i.errorCallback&&i.errorCallback({},"getFeatureFaild",i.map);return}dMe(l,[decodeURIComponent(s)],u,async function(h){let c=i.parseGeoJsonData2Feature({allDatas:{features:h.result.features.features},fileCode:i.baseProjection,featureProjection:i.baseProjection});await i.addLayer(e,c,t),i.layerAdded++,i.sendMapToUser(r)},function(h){i.layerAdded++,i.sendMapToUser(r),i.errorCallback&&i.errorCallback(h,"getFeatureFaild",i.map)},i.baseProjection.split("EPSG:")[1],this.restDataSingleRequestCount)}getFeatures(e,t,r,i){var a=this,o=t.dataSource,s=t.projection;vMe(o.url,o.layerName,null,e,null,function(l){var u=l.result.recordsets[0],h=u.features.features,c=a.parseGeoJsonData2Feature({allDatas:{features:h},fileCode:s,featureProjection:a.baseProjection},"JSON");r(c)},function(l){i(l)})}sendMapToUser(e){const t=this.isHaveGraticule?e+1:e;this.layerAdded===t&&this.successCallback&&this.successCallback(this.map,this.mapParams,this.layers,this.baseLayer)}async excelData2Feature(e,t){let r=e.rows,i=e.colTitles;for(let d in i)br.isString(i[d])&&(i[d]=br.trim(i[d]));let a=t.projection,o=t.dataSource,s=this.baseProjection,l=[],u=br.trim(t.xyField&&t.xyField.xField||t.from&&t.from.xField),h=br.trim(t.xyField&&t.xyField.yField||t.from&&t.from.yField),c=i.indexOf(u),f=i.indexOf(h);if(t.layerType==="MIGRATION")try{if(o.type==="PORTAL_DATA"){const{dataMetaInfo:d}=await li.get(`${this.server}web/datas/${o.serverId}.json`,null,{withCredentials:this.withCredentials}).then(v=>v.json());t.xyField={xField:d.xField,yField:d.yField},d.xIndex?(c=d.xIndex,f=d.yIndex):(c=i.indexOf(d.xField),f=i.indexOf(d.yField))}else if(o.type==="SAMPLE_DATA"){const d=S$r.find(v=>v.id===o.name)||{};u=d.xField,h=d.yField,t.xyField={xField:u,yField:h},c=i.findIndex(v=>v===u),f=i.findIndex(v=>v===h)}}catch(d){console.error(d)}for(let d=0,v=r.length;d<v;d++){let p=r[d],g={},m=r[d][c],y=r[d][f];if(m!==""&&y!==""){let _=new Qs([+m,+y]);a!==s&&_.transform(a,s);for(let S=0,w=p.length;S<w;S++){let b=i[S];if(b!=null)if(b=b.trim(),Object.keys(g).indexOf(b)>-1){const E=b+"_1";g[E]=p[S]}else g[b]=p[S]}let x=new d0({geometry:_,attributes:g});l.push(x)}}return Promise.resolve(l)}excelData2FeatureByDivision(e,t,r){let i=this,a;if(t==="Province"?a=window.ProvinceData:t==="City"?a=window.MunicipalData:t==="GB-T_2260"&&(a=window.AdministrativeArea),a)return i.changeExcel2Geojson(a.features,e.rows,t,r)}_parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let i=0,a=t.length;i<a;i++){let o=Object.assign({},t[i].properties);delete t[i].properties;let s=eB.readFeature(t[i],{dataProjection:e.fileCode,featureProjection:this.baseProjection||"ESPG:4326"});s.setProperties({attributes:o}),r.push(s)}return r}changeExcel2Geojson(e,t,r,i){let a={type:"FeatureCollection",features:[]};if(t.length<2)return a;let o=t[0],s=t.slice(1),l=o.findIndex(u=>u===i);return s.forEach(u=>{let h;if(r==="GB-T_2260"?h=e.find(c=>c.properties.GB===u[l]):h=br.getHighestMatchAdministration(e,u[l]),h){let c=window.cloneDeep(h);c.properties={},u.forEach((f,d)=>{let v=o[d].trim();c.properties[v]=f}),a.features.push(c)}}),a}geojsonToFeature(e,t){let r=e.features,i=[];for(let a=0,o=r.length;a<o;a++){let s=r[a].properties||{};delete r[a].properties;let l=eB.readFeature(r[a],{dataProjection:t.projection||"EPSG:4326",featureProjection:this.baseProjection||"ESPG:4326"}),u=l.getGeometry().getCoordinates();r[a].geometry.type==="Point"&&r[a].properties&&(r[a].properties.lon=u[0],r[a].properties.lat=u[1]);let h=!1,c,f;r[a].dv_v5_markerInfo&&(c=Object.assign({},r[a].dv_v5_markerInfo,s),c.lon&&(delete c.lon,delete c.lat)),r[a].dv_v5_markerStyle&&(f=r[a].dv_v5_markerStyle,h=!0);let d;if(h)d=Object.assign({},{attributes:c},{useStyle:f}),l.layerId=t.timeId;else if(t.featureStyles){let v=JSON.parse(t.featureStyles[a].style),p=s,g;p._smiportal_imgLinkUrl.indexOf("http://")>-1||p._smiportal_imgLinkUrl.indexOf("https://")>-1?g=p._smiportal_imgLinkUrl:p._smiportal_imgLinkUrl!==void 0&&p._smiportal_imgLinkUrl!==null&&p._smiportal_imgLinkUrl!==""&&(g=`${br.getIPortalUrl()}resources/markerIcon/${p._smiportal_imgLinkUrl}`),c={dataViz_description:p._smiportal_description,dataViz_imgUrl:g,dataViz_title:p._smiportal_title,dataViz_url:p._smiportal_otherLinkUrl},v.anchor=[.5,1],v.src=v.externalGraphic,f=v,d=Object.assign({},{attributes:c},{useStyle:f}),delete p._smiportal_description,delete p._smiportal_imgLinkUrl,delete p._smiportal_title,delete p._smiportal_otherLinkUrl}else d={attributes:s};l.setProperties(d),i.push(l)}return i}parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let i=0,a=t.length;i<a;i++){let o=t[i].properties;delete t[i].properties;let s=eB.readFeature(t[i],{dataProjection:e.fileCode||"EPSG:4326",featureProjection:e.featureProjection||this.baseProjection||"EPSG:4326"}),l=s.getGeometry();if(!l)continue;let u=l.getCoordinates();t[i].geometry.type==="Point"&&(o.lon=u[0],o.lat=u[1]),s.setProperties({attributes:o}),r.push(s)}return r}async addLayer(e,t,r){let i,a=this;e.layerType==="VECTOR"?e.featureType==="POINT"?e.style.type==="SYMBOL_POINT"?i=this.createSymbolLayer(e,t):i=await this.createGraphicLayer(e,t):i=await this.createVectorLayer(e,t):e.layerType==="UNIQUE"?i=await this.createUniqueLayer(e,t):e.layerType==="RANGE"?i=await this.createRangeLayer(e,t):e.layerType==="HEAT"?i=this.createHeatLayer(e,t):e.layerType==="MARKER"?i=await this.createMarkerLayer(t):e.layerType==="DATAFLOW_POINT_TRACK"?i=await this.createDataflowLayer(e,r):e.layerType==="DATAFLOW_HEAT"?i=this.createDataflowHeatLayer(e):e.layerType==="RANK_SYMBOL"?i=await this.createRankSymbolLayer(e,t):e.layerType==="MIGRATION"&&(i=this.createMigrationLayer(e,t));let o=br.newGuid(8);if(i){if(e.name&&i.setProperties({name:e.name,layerID:o,layerType:e.layerType}),e&&e.style&&e.style.imageInfo){let u=new Image;u.src=e.style.imageInfo.url,u.onload=function(){i.getSource().changed()}}e.layerType==="MIGRATION"?(i.appendTo(this.map),i.setVisible(e.visible),i.setCursor()):(e.opacity!=null&&i.setOpacity(e.opacity),i.setVisible(e.visible),this.map.addLayer(i)),i.setZIndex(r);const{visibleScale:s,autoUpdateTime:l}=e;if(s&&this.setVisibleScales(i,s),l&&!e.autoUpdateInterval){let u=e.dataSource;u.accessType==="DIRECT"&&!u.url&&(u.url=`${this.server}web/datas/${u.serverId}/content.json?pageSize=9999999&currentPage=1`),e.autoUpdateInterval=setInterval(()=>{a.updateFeaturesToMap(e,r,!0)},l)}}e.layer=i,e.layerID=o,e.labelStyle&&e.labelStyle.labelField&&e.layerType!=="DATAFLOW_POINT_TRACK"&&(t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,this.addLabelLayer(e,t))}updateFeaturesToMap(e,t){let r=this,i=e.dataSource,a=e.dataSource.url,o=i.dataSourceName||e.name;if(i.type==="USER_DATA"||i.accessType==="DIRECT")r.addGeojsonFromUrl(e,null,t);else{let s=r.formatUrlWithCredential(a),l={};l.withCredentials=this.withCredentials,!this.excludePortalProxyUrl&&!H.isInTheSameDomain(s)&&!this.isIportalProxyServiceUrl(s)&&(l.proxy=this.getProxy()),dMe(s,[o],l,async function(u){let h=r.parseGeoJsonData2Feature({allDatas:{features:u.result.features.features},fileCode:e.projection,featureProjection:r.baseProjection});r.map.removeLayer(e.layer),e.labelLayer&&r.map.removeLayer(e.labelLayer),await r.addLayer(e,h,t)},function(u){r.errorCallback&&r.errorCallback(u,"autoUpdateFaild",r.map)},void 0,this.restDataSingleRequestCount)}}async addVectorTileLayer(e,t,r){let i;r==="RESTDATA"&&(i=await this.createDataVectorTileLayer(e));let a=br.newGuid(8);return i&&(e.name&&i.setProperties({name:e.name,layerID:a}),e.opacity!=null&&i.setOpacity(e.opacity),i.setVisible(e.visible),i.setZIndex(t)),e.layer=i,e.layerID=a,i}async createDataVectorTileLayer(e){var t=new w1({featureClass:d0});w1.prototype.readProjection=function(){return new ew({code:"",units:$c.TILE_PIXELS})};let r=e.featureType,i=await ts.toOpenLayersStyle(this.getDataVectorTileStyle(r),r);return new fPe({source:new Zre({url:e.url,projection:e.projection,tileType:"ScaleXY",format:t}),style:i})}getDataVectorTileStyle(e){let t={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT"};return["LINE","LINESTRING","MULTILINESTRING"].indexOf(e)>-1?(t.strokeColor="#4CC8A3",t.strokeWidth=2):["REGION","POLYGON","MULTIPOLYGON"].indexOf(e)>-1&&(t.fillColor="#826DBA"),t}getFiterFeatures(e,t){let r=this.parseFilterCondition(e),i=[];for(let a=0;a<t.length;a++){let o=t[a],s=!1;try{const l=o.get("attributes"),u=Jq(r,Object.keys(l)),h=Qq(l),c="select * from json where ("+u+")";s=window.jsonsql.query(c,{attributes:h})}catch{continue}s&&s.length>0&&i.push(o)}return i}parseFilterCondition(e){return e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=").replace(/\(?[^\(]+?\s*in\s*\([^\)]+?\)\)?/gi,t=>{const r=t.match(/([^(]+?)\s*in\s*\(([^)]+?)\)/i);return r.length===3?`(${r[2].split(",").map(i=>`${r[1]} == ${i.trim()}`).join(" || ")})`:t})}async createGraphicLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let r=await this.getGraphicsFromFeatures(t,e.style,e.featureType),i=new v$({graphics:r,render:"canvas",map:this.map,isHighLight:!1});return new dZe({source:i})}async getGraphicsFromFeatures(e,t,r){let i=await ts.getOpenlayersStyle(t,r),a=i.getImage(),o=[];for(let s in e){let l=new qM(e[s].getGeometry());l.setStyle(a),l.setProperties({attributes:e[s].get("attributes")}),o.push(l)}return o}createSymbolLayer(e,t){let r=ts.getSymbolStyle(e.style);return new Sy({style:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1}),renderMode:"image"})}addLabelLayer(e,t){let r=e.labelStyle,i=this.getLabelStyle(r,e),a=e.labelLayer=new Sy({declutter:!0,styleOL:i,labelField:r.labelField,source:new _f({features:t,wrapX:!1})});a.setStyle(s=>{let l=r.labelField,u=s.get("attributes")[l.trim()]+"";if(u==="undefined")return null;let h=a.get("styleOL"),c=h.getText();return c&&c.setText&&c.setText(u),h}),this.map.addLayer(a),a.setVisible(e.visible),a.setZIndex(1e3);const{visibleScale:o}=e;return o&&this.setVisibleScales(a,o),a}setVisibleScales(e,t){let r=this.resolutions[t.minScale],i=this.resolutions[t.maxScale];r>1?e.setMaxResolution(Math.ceil(r)):e.setMaxResolution(r*1.1),e.setMinResolution(i)}getLabelStyle(e,t){let r=t.style||t.pointStyle;const{radius:i=0,strokeWidth:a=0}=r,o=-(i+a),{fontSize:s="14px",fontFamily:l,fill:u,backgroundFill:h,offsetX:c=0,offsetY:f=o,placement:d="point",textBaseline:v="bottom",textAlign:p="center",outlineColor:g="#000000",outlineWidth:m=0}=e,y={font:`${s} ${l}`,placement:d,textBaseline:v,fill:new Ko({color:u}),backgroundFill:new Ko({color:h}),padding:[3,3,3,3],offsetX:t.featureType==="POINT"?c:0,offsetY:t.featureType==="POINT"?f:0,overflow:!0,maxAngle:0};return t.featureType==="POINT"&&(y.textAlign=p),m>0&&(y.stroke=new es({color:g,width:m})),new So({text:new J1(y)})}async createVectorLayer(e,t){const{featureType:r,style:i}=e;let a;if(r==="LINE"&&br.isArray(i)&&i.length===2){const[o,s]=i;a=!s.lineDash||s.lineDash==="solid"?ts.getRoadPath(s,o):ts.getPathway(s,o)}else br.isArray(i)&&(e.style=i[0]),a=await ts.toOpenLayersStyle(e.style,e.featureType);return new Sy({style:a,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})})}createHeatLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let i={source:new _f({features:t,wrapX:!1})},a=e.themeSetting;i.gradient=a.colors.slice(),i.radius=parseInt(a.radius);let o=a.customSettings;for(let s in o)i.gradient[s]=o[s];return a.weight&&this.changeWeight(t,a.weight),new cPe(i)}changeWeight(e,t){let r=this;this.fieldMaxValue={},this.getMaxValue(e,t);let i=this.fieldMaxValue[t];e.forEach(function(a){let o=a.get("attributes");try{let s=o[t];a.set("weight",s/i)}catch(s){r.errorCallback&&r.errorCallback(s)}})}getMaxValue(e,t){let r=[],i=this,a,o=t;this.fieldMaxValue[o]||(e.forEach(function(s){a=s.get("attributes");try{r.push(parseFloat(a[o]))}catch(l){i.errorCallback&&i.errorCallback(l)}}),this.fieldMaxValue[o]=pB.getArrayStatistic(r,"Maximum"))}async createUniqueLayer(e,t){let r=await this.createUniqueSource(e,t),i=new Sy({styleSource:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return i.setStyle(a=>{let o=i.get("styleSource"),s=o.themeField,l=a.get("attributes")[s];return o.styleGroups.find(h=>h.value===l).olStyle}),i}async createUniqueSource(e,t){let r=await this.getUniqueStyleGroup(e,t);return{map:this.map,style:e.style,isHoverAble:e.isHoverAble,highlightStyle:e.highlightStyle,themeField:e.themeSetting.themeField,styleGroups:r}}async getUniqueStyleGroup(e,t){let r=e.featureType,i=e.style,a=e.themeSetting,o=a.themeField,s=[],l=a.customSettings;for(let d in t){let p=t[d].get("attributes")[o],g=!1;for(let m in s)if(s[m]===p){g=!0;break}g||s.push(p)}let u=[];const h=this.getCustomSettingColors(l,r).map(d=>d.toLowerCase()),c=this.getUniqueColors(a.colors||this.defaultParameters.themeSetting.colors,s.length+Object.keys(l).length).map(d=>d.toLowerCase()),f=gXr(c,h);for(let d=0;d<s.length;d++){const v=s[d];let p=this.webMapVersion==="1.0"?d:v,g=l[p];br.isString(g)&&(g=this.getCustomSetting(i,g,r),l[p]=g),g||(g=this.getCustomSetting(i,f.shift(),r));let m,y=g.type;y==="SYMBOL_POINT"?m=ts.getSymbolStyle(g):y==="SVG_POINT"?m=await ts.getSVGStyle(g):y==="IMAGE_POINT"?m=ts.getImageStyle(g):m=await ts.toOpenLayersStyle(g,r),u.push({olStyle:m,style:l[p],value:v})}return u}getCustomSetting(e,t,r){let i={};return r==="LINE"?i.strokeColor=t:i.fillColor=t,Object.assign(e,i)}getCustomSettingColors(e,t){const r=Object.keys(e),i=[];return r.forEach(a=>{if(br.isString(e[a])){i.push(e[a]);return}t==="LINE"?i.push(e[a].strokeColor):i.push(e[a].fillColor)}),i}getUniqueColors(e,t){return vB.getGradientColors(e,t)}async createRangeLayer(e,t){let r=await this.createRangeSource(e,t),i=new Sy({styleSource:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return i.setStyle(a=>{let o=i.get("styleSource");if(o){let s=o.themeField,l=Number(a.get("attributes")[s.trim()]),u=o.styleGroups;for(let h=0;h<u.length;h++)if(h===0){if(l>=u[h].start&&l<=u[h].end)return u[h].olStyle}else if(l>u[h].start&&l<=u[h].end)return u[h].olStyle}}),i}async createRangeSource(e,t){let r=await this.getRangeStyleGroup(e,t);return r?{style:e.style,themeField:e.themeSetting.themeField,styleGroups:r}:!1}async getRangeStyleGroup(e,t){let r=e.featureType,i=e.themeSetting,a=e.style,o=i.segmentCount,s=i.segmentMethod,l=i.colors,u=i.customSettings,h=i.themeField,c=[],f,d=o,v=s,p=this;t.forEach(function(m){f=m.get("attributes");try{if(f){let y=f[h.trim()];y!=null&&br.isNumber(y)&&c.push(parseFloat(y))}else m.get(h)&&br.isNumber(m.get(h))&&m.get(h)&&c.push(parseFloat(m.get(h)))}catch(y){p.errorCallback&&p.errorCallback(y)}});let g;try{g=pB.getArraySegments(c,v,d)}catch(m){p.errorCallback&&p.errorCallback(m)}if(g){let m=d;f&&g[0]===g[f.length-1]&&(m=1,g.length=2);for(let x in g){let S=g[x];Number(x)===0?S=Math.floor(S*100)/100:S=Math.ceil(S*100)/100+.1,g[x]=Number(S.toFixed(2))}let y=l;y=vB.getGradientColors(y,m,"RANGE");for(let x=0;x<m;x++)x in u&&(u[x].segment.start&&(g[x]=u[x].segment.start),u[x].segment.end&&(g[x+1]=u[x].segment.end));let _=[];for(let x=0;x<m;x++){let S=y[x];x in u&&u[x].color&&(S=u[x].color),r==="LINE"?a.strokeColor=S:a.fillColor=S;let w=await ts.toOpenLayersStyle(a,r),b=g[x],E=g[x+1];_.push({olStyle:w,color:S,start:b,end:E})}return _}else return!1}async createMarkerLayer(e){return e&&await this.setEachFeatureDefaultStyle(e),new Sy({source:new _f({features:e,wrapX:!1})})}async createDataflowLayer(e,t){let r=e.pointStyle,i;i=await ts.getOpenlayersStyle(r,e.featureType);let a=new _f({wrapX:!1}),o,s,l,u,h=new Sy({styleOL:i,source:a});e.labelStyle&&e.visible&&(o=this.addLabelLayer(e),o.setZIndex(1e3),s=o.getSource());const{visibleScale:c}=e;e.lineStyle&&e.visible&&(l=await this.createVectorLayer({style:e.lineStyle,featureType:"LINE"}),u=l.getSource(),l.setZIndex(t),this.map.addLayer(l),c&&this.setVisibleScales(l,c),e.pathLayer=l);let f={},d={},v={},p=this;return this.createDataflowService(e,function(g,m,y){return function(_){if(p.events.triggerEvent("updateDataflowFeature",{feature:_,identifyField:e.identifyField,layerID:e.layerID}),e.filterCondition){const x=p.parseFilterCondition(e.filterCondition),S=_.get("attributes"),w=Jq(x,Object.keys(S)),b=Qq(S),E="select * from json where ("+w+")";let T=window.jsonsql.query(E,{attributes:b});T&&T.length>0&&p.addDataflowFeature(_,e.identifyField,{dataflowSource:a,featureCache:g,labelSource:s,labelFeatureCache:m,pathSource:u,pathFeatureCache:y,maxPointCount:e.maxPointCount})}else p.addDataflowFeature(_,e.identifyField,{dataflowSource:a,featureCache:g,labelSource:s,labelFeatureCache:m,pathSource:u,pathFeatureCache:y,maxPointCount:e.maxPointCount})}}(f,d,v)),this.setFeatureStyle(h,e.directionField,r.type),h}addDataflowFeature(e,t,r){r.dataflowSource&&this.addFeatureFromDataflowService(r.dataflowSource,e,t,r.featureCache),r.labelSource&&this.addFeatureFromDataflowService(r.labelSource,e,t,r.labelFeatureCache),r.pathSource&&this.addPathFeature(r.pathSource,e,t,r.pathFeatureCache,r.maxPointCount)}addPathFeature(e,t,r,i,a){let o=[];var s=t.get(r);i[s]?(o=i[s].getGeometry().getCoordinates(),o.push(t.getGeometry().getCoordinates()),a&&o.length>a&&o.splice(0,o.length-a),i[s].getGeometry().setCoordinates(o)):(o.push(t.getGeometry().getCoordinates()),i[s]=new d0({geometry:new gm(o)}),e.addFeature(i[s]))}setFeatureStyle(e,t,r){let i=e.get("styleOL");e.setStyle(a=>{let o,s;if(t!==void 0&&t!=="\u672A\u8BBE\u7F6E"&&t!=="None"?o=a.get("attributes")[t]:o=0,o>360||o<0)return null;r==="SYMBOL_POINT"?s=i.getText():s=i.getImage();let l=Math.PI*o/180;return s&&s.setRotation(l),i})}createDataflowHeatLayer(e){let r={source:this.createDataflowHeatSource(e)};if(r.gradient=e.themeSetting.colors.slice(),r.radius=parseInt(e.themeSetting.radius),e.themeSetting.customSettings){let i=e.themeSetting.customSettings;for(let a in i)r.gradient[a]=i[a]}return new cPe(r)}createDataflowHeatSource(e){let t=this,r=new _f({wrapX:!1}),i={};return this.createDataflowService(e,function(a){return function(o){if(e.filterCondition){let s=t.parseFilterCondition(e.filterCondition);const l=o.get("attributes"),u=Jq(s,Object.keys(l)),h=Qq(l),c="select * from json where ("+u+")";let f=window.jsonsql.query(c,{attributes:h});f&&f.length>0&&t.addDataflowFeature(o,e.identifyField,{dataflowSource:r,featureCache:a})}else t.addDataflowFeature(o,e.identifyField,{dataflowSource:r,featureCache:a});e.themeSetting.weight&&t.changeWeight(r.getFeatures(),e.themeSetting.weight)}}(i)),r}addFeatureFromDataflowService(e,t,r,i){var a=t.get(r);a!==void 0&&i[a]?(i[a].setGeometry(t.getGeometry()),i[a].setProperties(t.getProperties()),e.changed()):(e.addFeature(t),i[a]=t)}createDataflowService(e,t){let r=this,i=new Ihe(e.wsUrl).initSubscribe();i.on("messageSucceeded",function(a){let o=JSON.parse(a.value.data),s=eB.readFeature(o,{dataProjection:e.projection||"EPSG:4326",featureProjection:r.baseProjection||"EPSG:4326"});s.setProperties({attributes:o.properties}),t(s)}),e.dataflowService=i}async setEachFeatureDefaultStyle(e){let t=this;e=br.isArray(e)||e instanceof gd?e:[e];for(let r=0;r<e.length;r++){const i=e[r];let a=i.getGeometry().getType().toUpperCase(),o=i.getProperties().useStyle;if(o){a==="POINT"&&o.text&&(a="TEXT");let s=t.setFeatureInfo(i);i.setProperties({useStyle:o,attributes:s}),a==="POINT"&&o.src&&o.src.indexOf("http://")===-1&&o.src.indexOf("https://")===-1&&(o.src=t.server+o.src)}else o=ts.getMarkerDefaultStyle(a,t.server);i.setStyle(await ts.toOpenLayersStyle(o,a))}}setFeatureInfo(e){let t=e.get("attributes"),r={dataViz_title:"",dataViz_description:"",dataViz_imgUrl:"",dataViz_url:""},i=Object.assign(r,t),a=e.getProperties();for(let o in i)a[o]&&(i[o]=a[o],delete a[o]);return i}async createRankSymbolLayer(e,t){let r=await this.createRankStyleSource(e,t,e.featureType),i=new Sy({styleSource:r,source:new _f({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1}),renderMode:"image"});return i.setStyle(a=>{let o=i.get("styleSource"),s=o.parameters.themeSetting.themeField,l=Number(a.get("attributes")[s]),u=o.styleGroups;for(let h=0,c=u.length;h<c;h++)if(l>=u[h].start&&l<u[h].end)return o.styleGroups[h].olStyle}),i}async createRankStyleSource(e,t,r){let i=e.themeSetting,a=i.themeField,o=await this.getRankStyleGroup(a,t,e,r);return o?{parameters:e,styleGroups:o}:!1}async getRankStyleGroup(e,t,r,i){let a=[],o=[],s=r.style,l=r.themeSetting,u=l.segmentMethod||this.defaultParameters.themeSetting.segmentMethod,h=l.segmentCount||this.defaultParameters.themeSetting.segmentCount,c=l.customSettings,f=r.themeSetting.minRadius,d=r.themeSetting.maxRadius,v=s.fillColor,p=r.themeSetting.colors;t.forEach(m=>{let y=m.get("attributes"),_=y[e];_==null||!br.isNumber(_)||a.push(Number(_))});try{o=pB.getArraySegments(a,u,h)}catch(m){console.error(m)}for(let m=0;m<h;m++)if(m in c){let y=c[m].segment.start,_=c[m].segment.end;y!=null&&(o[m]=y),_!=null&&(o[m+1]=_)}let g=[];if(o&&o.length){let m=o.length,y=(d-f)/(m-1),_,x,S=Number(((d+f)/2).toFixed(2)),w=p?vB.getGradientColors(p,m,"RANGE"):[];for(let b=0;b<m-1;b++){_=Number(o[b].toFixed(2)),x=Number(o[b+1].toFixed(2)),S=_===x?S:f+Math.round(y*b),x=b===m-2?x+.01:x,S=c[b]&&c[b].radius?c[b].radius:S,s.radius=S,s.fillColor=c[b]&&c[b].color?c[b].color:w[b]||v;let E=await ts.getOpenlayersStyle(s,i,!0);g.push({olStyle:E,radius:S,start:_,end:x,fillColor:s.fillColor})}return g}else return!1}checkUploadToRelationship(e){let t=this.getRequestUrl(`${this.server}web/datas/${e}/datasets.json`);return li.get(t,null,{withCredentials:this.withCredentials}).then(function(r){return r.json()}).then(function(r){return r})}getDatasources(e){let t=this.getRequestUrl(`${e}/data/datasources.json`);return li.get(t,null,{withCredentials:this.withCredentials}).then(function(r){return r.json()}).then(function(r){return r.datasourceNames[0]})}getDataService(e,t){let r=this.getRequestUrl(`${this.server}web/datas/${e}.json`);return li.get(r,null,{withCredentials:this.withCredentials}).then(function(i){return i.json()}).then(function(i){return i.fileId=e,i.datasetName=t,i})}getRequestUrl(e,t){if(e=t?e:this.formatUrlWithCredential(e),!this.excludePortalProxyUrl)return H.isInTheSameDomain(e)||this.isIportalProxyServiceUrl(e)?e:`${this.getProxy()}${encodeURIComponent(e)}`}formatUrlWithCredential(e){return this.credentialValue&&(e=e.indexOf("?")===-1?`${e}?${this.credentialKey}=${this.credentialValue}`:`${e}&${this.credentialKey}=${this.credentialValue}`),e}getProxy(e){return e||(e="json"),this.proxy||this.server+`apps/viewer/getUrlResource.${e}?url=`}getTileLayerInfo(e){let t=this,r=t.baseProjection.split("EPSG:")[1],i=t.getRequestUrl(`${e}/maps.json`);return li.get(i,null,{withCredentials:this.withCredentials}).then(function(a){return a.json()}).then(function(a){let o=[];return a&&a.forEach(function(s){let l=t.getRequestUrl(`${s.path}.json?prjCoordSys=${encodeURI(JSON.stringify({epsgCode:r}))}`),u=li.get(l,null,{withCredentials:t.withCredentials}).then(function(h){return h.json()}).then(function(h){return h.url=s.path,h});o.push(u)}),Promise.all(o).then(function(s){return s})})}addProjctionFromWKT(e,t){if(typeof e!="string")return!1;if(e==="EPSG:4326"||e==="EPSG:3857")return!0;{let r=t||this.getEpsgInfoFromWKT(e);return r?(Bu.defs(r,e),wQe&&ZN?ZN(Bu):window.ol.proj&&window.ol.proj.setProj4&&window.ol.proj.setProj4(Bu),!0):!1}}getEpsgInfoFromWKT(e){if(typeof e!="string")return!1;if(e.indexOf("EPSG")===0)return e;{let t=e.lastIndexOf("AUTHORITY")+10,r=e.indexOf("]",t)-1;return t>0&&r>0?`EPSG:${e.substring(t,r).split(",")[1].substr(1)}`:!1}}createMigrationLayer(e,t){window.ol3Echarts.prototype.getContainer||(window.ol3Echarts.prototype.getContainer=function(){return this.$container}),window.ol3Echarts.prototype.setVisible||(window.ol3Echarts.prototype.setVisible=function(l){if(l){let u=this.get("options");u&&(this.setChartOptions(u),this.unset("options"))}else{let u=this.getChartOptions();this.set("options",u),this.clear(),this.setChartOptions({})}}),window.ol3Echarts.prototype.setZIndex||(window.ol3Echarts.prototype.setZIndex=function(l){let u=this.getContainer();u&&(u.style.zIndex=l)}),window.ol3Echarts.prototype.setCursor||(window.ol3Echarts.prototype.setCursor=function(l="default"){let u=this.getContainer();u&&l==="default"&&u.classList.add("cursor-default")});let r=wFr(t),i=this.createLinesData(e,r),a=this.createPointsData(i,e,r),o=this.createOptions(e,i,a),s=new window.ol3Echarts(o,{hideOnMoving:!1,hideOnZooming:!1,forcedPrecomposeRerender:!0});return s.type="ECHARTS",s}createOptions(e,t,r){let i,a=this.createLineSeries(e,t);if(r&&r.length){let s=this.createPointSeries(e,r);i=a.concat(s)}else i=a.slice();return{series:i}}createLineSeries(e,t){let r=e.lineSetting,i=e.animationSetting,a=[{name:"line-series",type:"lines",zlevel:1,silent:!0,effect:{show:i.show,constantSpeed:i.constantSpeed,trailLength:0,symbol:i.symbol,symbolSize:i.symbolSize},lineStyle:{normal:{color:r.color,type:r.type,width:r.width,opacity:r.opacity,curveness:r.curveness}},data:t}];return t.length>yXr&&(a[0].blendMode="lighter"),a}createPointSeries(e,t){let r=e.lineSetting,i=e.animationSetting,a=e.labelSetting,o=[{name:"point-series",coordinateSystem:"geo",zlevel:2,silent:!0,label:{normal:{show:a.show,position:"right",formatter:"{b}",color:a.color,fontFamily:a.fontFamily}},itemStyle:{normal:{color:r.color||a.color}},data:t}];return i.show?(o[0].type="effectScatter",o[0].rippleEffect={brushType:"stroke"}):o[0].type="scatter",o}createPointsData(e,t,r){let i=[],a=t.labelSetting;if(!a.show||!e.length)return i;let o=[],s=[];return e.forEach((l,u)=>{let h=l.coords,c=h[0],f=h[1],d=r[u][a.from],v=r[u][a.to];!o.find(m=>m.value[0]===c[0]&&m.value[1]===c[1])&&o.push({name:d,value:c}),!s.find(m=>m.value[0]===f[0]&&m.value[1]===f[1])&&s.push({name:v,value:f})}),i=o.concat(s),i}createLinesData(e,t){let r=[];if(t&&t.length){let i=e.from,a=e.to,o,s;if(i.type==="XY_FIELD"&&i.xField&&i.yField&&a.xField&&a.yField)t.forEach(l=>{let u=l[i.xField],h=l[i.yField],c=l[a.xField],f=l[a.yField];!u||!h||!c||!f||(o=[l[i.xField],l[i.yField]],s=[l[a.xField],l[a.yField]],r.push({coords:[o,s]}))});else if(i.type==="PLACE_FIELD"&&i.field&&a.field){const l=_$r.concat(x$r);t.forEach(u=>{let h=u[i.field],c=u[a.field];o=l.find(f=>br.isMatchAdministrativeName(f.name,h)),s=l.find(f=>br.isMatchAdministrativeName(f.name,c)),!(!o||!s)&&r.push({coords:[o.coord,s.coord]})})}}return r}getService(e,t){return e.filter(i=>i&&i.serviceType===t)[0]}isMvt(e,t){let r=this;return this.getDatasetsInfo(e,t).then(i=>i.epsgCode==r.baseProjection.split("EPSG:")[1]?li.get(r.getRequestUrl(`${i.url}/tilefeature.mvt`),null,{withCredentials:r.withCredentials}).then(function(a){return a.json()}).then(function(a){return i.isMvt=a.error&&a.error.code===400,i}).catch(()=>i):i)}getDatasetsInfo(e,t){let r=this;return r.getDatasources(e).then(function(i){let a=`${e}/data/datasources/${i}/datasets/${t}.json`;return li.get(r.getRequestUrl(a),null,{withCredentials:r.withCredentials}).then(function(o){return o.json()}).then(function(o){return{epsgCode:o.datasetInfo.prjCoordSys.epsgCode,bounds:o.datasetInfo.bounds,url:a}})})}isRestMapMapboxStyle(e){const t="/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY";let r=e.dataSource,i=e.layerType;return!!(r&&r.type==="EXTERNAL"&&r.url.indexOf(t)>-1&&(i==="MAPBOXSTYLE"||i==="VECTOR_TILE"))}getMapboxStyleLayerInfo(e,t){let r=this;return new Promise((i,a)=>r.getMapLayerExtent(t).then(o=>r.getMapboxStyle(e,o).then(s=>{Object.assign(o,s),i(o)}).catch(s=>{a(s)})).catch(o=>{a(o)}))}getMapLayerExtent(e){const t="/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY";let i=e.dataSource.url;this.isRestMapMapboxStyle(e)&&(i=i.replace(t,"")),i=this.getRequestUrl(i+".json");let a=e.credential,o,s;return a&&(s=Object.keys(a)[0],o=a[s],i=`${i}?${s}=${o}`),li.get(i,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(l){return l.json()}).then(l=>(e.visibleScales=l.visibleScales,e.coordUnit=l.coordUnit,e.scale=l.scale,e.epsgCode=l.prjCoordSys.epsgCode,e.bounds=l.bounds,e)).catch(l=>{throw l})}getMapboxStyle(e,t){let r=this,i=t.url||t.dataSource.url,a=i;a.indexOf("/restjsr/")>-1&&(a=`${a}/style.json`),a=this.getRequestUrl(a);let o=t.credential,s,l;return o&&(l=Object.keys(o)[0],s=o[l],a=`${a}?${l}=${s}`),li.get(a,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(u){return u.json()}).then(u=>{r._matchStyleObject(u);let h=t.bounds;if(s){u.sprite=`${u.sprite}?${l}=${s}`;let f=u.sources;Object.keys(f).forEach(function(v){u.sources[v].tiles.forEach(function(p,g){u.sources[v].tiles[g]=`${p}?${l}=${s}`})})}let c={url:i,sourceType:"VECTOR_TILE",layerType:"VECTOR_TILE",styles:u,extent:h&&[h.left,h.bottom,h.right,h.top],bounds:t.bounds,projection:"EPSG:"+t.epsgCode,epsgCode:t.epsgCode,name:t.name};return Object.assign(t,c),t.zIndex>0&&r.modifyMapboxstyleLayer(e,t),t}).catch(u=>u)}modifyMapboxstyleLayer(e,t){let r=this;if(e.layers&&e.layers.length===0)return;let i=t.styles.layers;if(!i)return;i=i.filter(o=>o.type!=="background"),t.styles.layers=i;let a=e.layers.filter(o=>o.layerType==="VECTOR_TILE"&&o.zIndex!==t.zIndex).map(o=>o.styles&&o.styles.layers);!a||a&&a.length===0||a.forEach(o=>{i.forEach(s=>{r.renameLayerId(o,s)})})}renameLayerId(e,t){if(e.find(r=>r.id===t.id)){const r=t.id.match(/(.+)\((\w)\)$/);r?t.id=`${r[1]}(${+r[2]+1})`:t.id+="(1)",e.find(i=>i.id===t.id)&&this.renameLayerId(e,t)}}_matchStyleObject(e){let{sprite:t,glyphs:r}=e;t&&typeof t=="object"&&(e.sprite=Object.values(t)[0]),r&&typeof r=="object"&&(e.glyphs=Object.values(r)[0])}isIportalProxyServiceUrl(e){if(this.serviceProxy&&this.serviceProxy.enable&&e){let t="";return this.serviceProxy.proxyServerRootUrl?t=`${this.serviceProxy.proxyServerRootUrl}/`:this.serviceProxy.rootUrlPostfix?t=`${this.serviceProxy.port}/${this.serviceProxy.rootUrlPostfix}/`:this.serviceProxy.rootUrlPostfix||(t=`${this.serviceProxy.port}/`),this.serviceProxy.port!==80?e.indexOf(t)>=0:e.indexOf(t)>=0||e.indexOf(t.replace(":80",""))>=0}else return!1}getStyleResolutions(e,t=0,r=22){let i=[],o=Math.abs(e.left-e.right)/512;for(let s=t;s<=r;s++){if(s===0){i[s]=o;continue}o=o/2,i[s]=o}return i}createVisibleResolution(e,t,r,i){let a=[];if(e&&e.length>0)a=e.map(o=>{let s=1/o;return this.getResFromScale(s,i)});else{let o=this.getEnvelope(t,r);a=this.getStyleResolutions(o)}return a}getEnvelope(e,t){let r={};return e&&e.length===4?(r.left=e[0],r.bottom=e[1],r.right=e[2],r.top=e[3]):r=t,r}createMVTLayer(e){let t=e.styles;const r=t&&t.metadata&&t.metadata.indexbounds,i=this.createVisibleResolution(e.visibleScales,r,e.bounds,e.coordUnit),a=this.getEnvelope(r,e.bounds),o=this.getStyleResolutions(a);let s=this.isIportalProxyServiceUrl(t.sprite),l=new SQe({style:t,source:t.name,resolutions:o,map:this.map,withCredentials:s});return new Promise(u=>{l.on("styleloaded",function(){let h=i[i.length-1],c=i[0],f=new fPe({declutter:!0,source:new Zre({style:t,withCredentials:s,projection:e.projection,format:new w1({featureClass:qre}),wrapX:!1}),style:l.featureStyleFuntion,visible:e.visible,zIndex:e.zIndex,opacity:e.opacity,minResolution:h,maxResolution:c>1?Math.ceil(c):c*1.1});u(f)})})}isSupportWebp(e,t){if(this.isIE()||this.isFirefox()&&this.getFirefoxVersion()<65||this.isChrome()&&this.getChromeVersion()<32)return!1;e=t?`${e}/tileImage.webp?token=${t}`:`${e}/tileImage.webp`;let i=H.isInTheSameDomain(e),a;return i&&!t?a=!1:a=!0,e=this.getRequestUrl(e,a),li.get(e,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0}).then(function(o){if(o.status!==200)throw o.status;return o}).then(()=>!0).catch(()=>!1)}isIE(){return!!window.ActiveXObject||"ActiveXObject"in window}isFirefox(){return navigator.userAgent.indexOf("Firefox")>-1}isChrome(){return navigator.userAgent.indexOf("Chrome")>-1}getFirefoxVersion(){return+navigator.userAgent.toLowerCase().match(/firefox\/([\d.]+)/)[1]}getChromeVersion(){return+navigator.userAgent.toLowerCase().match(/chrome\/([\d.]+)/)[1]}addGraticule(e){if(this.isHaveGraticule){this.createGraticuleLayer(e.grid.graticule),this.layerAdded++;const t=e.layers?e.layers.length:0;this.sendMapToUser(t)}}createGraticuleLayer(e){const{strokeColor:t,strokeWidth:r,lineDash:i,extent:a,visible:o,interval:s,lonLabelStyle:l,latLabelStyle:u}=e,h=this.baseProjection;let c=new ya(h);c.setExtent(a),c.setWorldExtent(Cte(a,h,"EPSG:4326"));let f={layerID:"graticule_layer",strokeStyle:new es({color:t,width:r,lineDash:i}),extent:a,visible:o,intervals:s,showLabels:!0,zIndex:9999,wrapX:!1,targetSize:0};l&&(f.lonLabelStyle=new J1({font:`${l.fontSize} ${l.fontFamily}`,textBaseline:l.textBaseline,fill:new Ko({color:l.fill}),stroke:new es({color:l.outlineColor,width:l.outlineWidth})})),u&&(f.latLabelStyle=new J1({font:`${u.fontSize} ${u.fontFamily}`,textBaseline:u.textBaseline,fill:new Ko({color:u.fill}),stroke:new es({color:u.outlineColor,width:u.outlineWidth})}));const d=new M$r(f);this.map.addLayer(d)}getLang(){if(this.getCookie("language")){const e=this.getCookie("language");return this.formatCookieLang(e)}else return navigator.language||navigator.browserLanguage}getCookie(e){e=e.toLowerCase();let t=null;return document.cookie.split(";").forEach(function(i){const a=i.split("=");if(a[0].toLowerCase().trim()===e){t=a[1].trim();return}}),t}formatCookieLang(e){let t;switch(e){case"zh":t="zh-CN";break;case"ar":t="ar-EG";break;case"bg":t="bg-BG";break;case"ca":t="ca-ES";break;case"cs":t="cs-CZ";break;case"da":t="da-DK";break;case"de":t="de-DE";break;case"el":t="el-GR";break;case"es":t="es-ES";break;case"et":t="et-EE";break;case"fa":t="fa-IR";break;case"fl":t="fi-FI";break;case"fr":t="fr-FR";break;case"he":t="he-IL";break;case"hu":t="hu-HU";break;case"id":t="id-ID";break;case"is":t="is-IS";break;case"it":t="it-IT";break;case"ja":t="ja-JP";break;case"ko":t="ko-KR";break;case"ku":t="ku-IQ";break;case"mn":t="mn-MN";break;case"nb":t="nb-NO";break;case"ne":t="ne-NP";break;case"nl":t="nl-NL";break;case"pl":t="pl-PL";break;case"pt":t="pt-PT";break;case"ru":t="ru-RU";break;case"sk":t="sk-SK";break;case"sl":t="sl-SI";break;case"sr":t="sr-RS";break;case"sv":t="sv-SE";break;case"th":t="th-TH";break;case"tr":t="tr-TR";break;case"uk":t="uk-UA";break;case"vi":t="vi-VN";break;default:t="en-US";break}return t}isCustomProjection(e){return br.isNumber(e)?[-1e3,-1].includes(+e):["EPSG:-1000","EPSG:-1"].includes(e)}handleJSONSuffix(e){if(!e.includes(".json"))if(e.includes("?")){let t=e.split("?");t[0]=t[0]+".json",e=t.join("?")}else e=e+".json";return e}}class _Xr extends E7{constructor(e){e=e||{},e.format=e.format||"png",e.transparent=e.transparent===void 0?!0:e.transparent===!0,e.cacheEnabled=e.cacheEnabled===void 0?!0:e.cacheEnabled===!0;var t=e.attributions||"Map Data <span>\xA9 SuperMap iServer</span>",r=s(e.url,e),i={...e,attributions:t,url:r};!e.tileLoadFunction&&e.tileProxy&&(i.tileLoadFunction=o),super(i);var a=this;this.options=e,e.tileProxy&&(this.tileProxy=e.tileProxy);function o(h,c){h.getImage().src=a.tileProxy+encodeURIComponent(c)}function s(h,c){var f=H.urlPathAppend(h,`/collections/${c.collectionId}/tile.${c.format}?x={x}&y={y}&z={z}`),d=l(c);return f=H.urlAppend(f,u(d)),f=xs.appendCredential(f),c.cacheEnabled||(f+="&_t="+new Date().getTime()),f}function l(h){var c={};return c.transparent=h.transparent,c.cacheEnabled=h.cacheEnabled!==!1,h.sqlFilter&&(c.sqlFilter=h.sqlFilter),h.renderingRule&&(c.renderingRule=JSON.stringify(h.renderingRule)),h.ids&&(c.ids=h.ids.join(",")),h.names&&(c.names=h.names.join(",")),c}function u(h){var c=[];for(var f in h)c.push(encodeURIComponent(f)+"="+encodeURIComponent(h[f]));return c.join("&")}}}class xXr{constructor(e,t,r){this.MapService=e,this.url=t,this.options=r,this.CLASS_NAME="SuperMap.InitMapServiceBase"}createMapService(){const e=this.MapService,t=this.url,r=this.options;return new e(t,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,projection:r.projection})}getMapInfo(e){return new Promise((t,r)=>{this.createMapService().getMapInfo(a=>{e(a,t,r)})})}getWKT(){return new Promise((e,t)=>{this.createMapService().getWKT(i=>{try{const a=i.result.data;e(a)}catch(a){t(a)}})})}}function SXr(n){return n==="PCS_NON_EARTH"}window.proj4=Bu;function wXr(n,e={}){const{mapOptions:t,viewOptions:r,layerOptions:i,sourceOptions:a}=e,o=new xXr(nue,n,e);return o.getMapInfo(async function(s,l,u){if(!s||!s.result){u("service is not work!");return}let{prjCoordSys:h,bounds:c}=s.result;if(!ya(`EPSG:${h.epsgCode}`)&&!SXr(h.type)){const p=await o.getWKT();EXr(h.epsgCode,p,c)}let f=bXr(s.result,t,r),{layer:d,source:v}=TXr(n,s.result,a,i);f.addLayer(d),l({map:f,source:v,layer:d})})}function zQe(n,e=22){let{bounds:t,dpi:r,center:i,visibleScales:a,scale:o,coordUnit:s,prjCoordSys:l}=n;const u=i.x&&i.y?[i.x,i.y]:[(t.left+t.right)/2,(t.bottom+t.top)/2],h=[t.left,t.bottom,t.right,t.top];let c=br.getProjection(l,h);var f=br.scalesToResolutions(a,t,r,s,e);const d=br.getZoomByResolution(br.scaleToResolution(o,r,s),f);return{center:u,projection:c,zoom:d,resolutions:f}}function bXr(n,e,t){let r=zQe(n);var i=new EA({target:"map",view:new Lp({...r,...t}),...e});return i}function EXr(n,e,t){const r=[t.left,t.bottom,t.right,t.top];let i=`EPSG:${n}`;if(!ya(i)&&Bu.defs(i,e),wQe&&ZN){ZN(Bu);var a=ya(i);a.setExtent(r)}}function TXr(n,e,t,r){let i=Bp.optionsFromMapJSON(n,e,!0);i={...i,...t};var a=new Bp(i),o=new P8({source:a,...r});return{layer:o,source:a}}if(window&&window.ol){let n=window.ol;n.supermap={...ae,...n.supermap},n.supermap.control=n.supermap.control||{},n.supermap.control.ChangeTileVersion=Z0r,n.supermap.control.Logo=Fyr,n.supermap.control.ScaleLine=kyr,n.supermap.StyleUtils=ts,n.supermap.Util=br,n.source.BaiduMap=c$,n.source.ImageSuperMapRest=KRr,n.source.SuperMapCloud=eDr,n.source.ImageTileSuperMapRest=_Xr,n.source.Tianditu=rM,n.source.TileSuperMapRest=Bp,n.supermap.WebMap=mXr,n.style.CloverShape=L7,n.Graphic=qM,n.style.HitCloverShape=x8,n.source.GeoFeature=AS,n.source.Theme=fS,n.supermap.ThemeFeature=fZe,n.supermap.MapboxStyles=SQe,n.supermap.VectorTileStyles=Ka,n.source.DataFlow=CFr,n.source.Graph=_8,n.source.Graphic=v$,n.source.HeatMap=pVr,n.source.Label=WFr,n.source.Mapv=YFr,n.source.Range=qFr,n.source.RankSymbol=ZFr,n.source.Turf=OUr,n.source.FGB=WVr,n.source.Unique=RUr,n.source.VectorTileSuperMapRest=Zre,n.supermap.GraphMap=HVr,n.supermap.AddressMatchService=XVr,n.supermap.ChartService=qVr,n.supermap.DataFlowService=Ihe,n.supermap.DatasetService=JVr,n.supermap.DatasourceService=QVr,n.supermap.FeatureService=cZe,n.supermap.FieldService=KVr,n.supermap.GridCellInfosService=e$r,n.supermap.GeoprocessingService=t$r,n.supermap.LayerInfoService=n$r,n.supermap.MapService=nue,n.supermap.MeasureService=i$r,n.supermap.NetworkAnalyst3DService=o$r,n.supermap.NetworkAnalystService=l$r,n.supermap.ProcessingService=h$r,n.supermap.QueryService=hZe,n.supermap.ServiceBase=_l,n.supermap.SpatialAnalystService=f$r,n.supermap.ThemeService=d$r,n.supermap.TrafficTransferAnalystService=p$r,n.supermap.WebPrintingJobService=g$r,n.supermap.ImageService=y$r,n.supermap.ImageCollectionService=m$r,n.supermap.KnowledgeGraphService=_Qe,n.supermap.initMap=wXr,n.supermap.viewOptionsFromMapJSON=zQe,n.supermap.CommonUtil=H}const Gv=n=>(kd("data-v-ff64246d"),n=n(),Fd(),n),CXr={class:"layer-switcher"},AXr={key:0,class:"layer-panel"},MXr={class:"panel-tabs"},IXr={class:"tabs-left"},LXr={class:"tabs-right"},PXr={class:"checkbox-container master-select"},OXr=["checked"],RXr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),DXr=Gv(()=>fe("span",{class:"layer-name"},"\u5168\u9009",-1)),NXr=Gv(()=>fe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[fe("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),fe("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)),kXr=[NXr],FXr={key:0,class:"panel-content"},BXr={class:"layer-group"},GXr={class:"layer-grid"},zXr={class:"checkbox-container"},UXr=["onUpdate:modelValue","onChange"],VXr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),$Xr={class:"layer-name"},WXr={key:1,class:"panel-content"},HXr={class:"layer-group"},jXr={class:"layer-grid"},XXr={class:"checkbox-container"},YXr=["onUpdate:modelValue","onChange"],qXr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),ZXr={class:"layer-name"},KXr={key:2,class:"panel-content"},JXr={class:"layer-group"},QXr={class:"layer-grid-full"},eYr={class:"layer-item"},tYr={class:"checkbox-container"},rYr=["checked"],nYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),iYr=Gv(()=>fe("span",{class:"layer-name"},"\u7535\u5B50\u56F4\u680F",-1)),aYr={class:"layer-item"},oYr={class:"checkbox-container"},sYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),lYr=Gv(()=>fe("span",{class:"layer-name"},"\u8DEF\u7EBF\u56FE",-1)),uYr={class:"layer-item"},hYr={class:"checkbox-container"},cYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),fYr=Gv(()=>fe("span",{class:"layer-name"},"\u6D4B\u8BD5\u533A\u57DF1",-1)),dYr={class:"layer-item"},vYr={class:"checkbox-container"},pYr=Gv(()=>fe("span",{class:"checkmark"},null,-1)),gYr=Gv(()=>fe("span",{class:"layer-name"},"\u6D4B\u8BD5\u533A\u57DF2",-1)),yYr={__name:"LayerSwitcher",props:{map:Object,categories:Object},emits:["layerChange","setCategoryVisibility"],setup(n,{expose:e,emit:t}){const r=n,i=un(!1),a=un("icon");un("white");const o=un(!1),s=ul(()=>!o.value);let l=null;const u=un(!0);let h=null;const c=un(!0);let f=null;const d=un(!0);let v=null;const p=ul(()=>r.categories?Object.values(r.categories).every(V=>V.visible):!1),g=ul(()=>r.categories?Object.values(r.categories).every(V=>V.showLabel):!1),m=ul(()=>!o.value&&u.value&&c.value&&d.value),y=ul(()=>a.value==="icon"?p.value:a.value==="text"?g.value:a.value==="road"?m.value:!1);function _(){i.value=!i.value}function x(){if(!r.categories)return;const V=!p.value;Object.keys(r.categories).forEach(q=>{r.categories[q].visible=V,z(q)})}function S(){if(!r.categories)return;const V=!g.value;Object.keys(r.categories).forEach(q=>{r.categories[q].showLabel=V,z(q)})}function w(){const V=!m.value;o.value===V&&E(),u.value=V,c.value=V,d.value=V}function b(){a.value==="icon"?x():a.value==="text"?S():a.value==="road"&&w()}function E(){o.value=!o.value,console.log("toggleHideRoadLayer: hideRoadLayer =",o.value,"showRoadLayer =",s.value),s.value?A():R()}P0(()=>{r.map&&(T(),s.value&&A(),k(),G())}),Af(()=>r.map,V=>{V&&(T(),s.value&&A(),k(),G())}),e({setLayerVisibility(V,q){var Y;t("setCategoryVisibility",V,{visible:q,showLabel:((Y=r.categories[V])==null?void 0:Y.showLabel)||!0})}});async function T(){if(C(),!!r.map)try{const q=await(await fetch("./roadTest.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})});h=new sp({source:Y,style:new T1({stroke:new jx({color:"#C9C9C9",width:1})}),zIndex:2,visible:u.value}),r.map.addLayer(h),console.log("loadCustomRoadLayer: \u5DF2\u6DFB\u52A0\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42",h)}catch(V){console.error("loadCustomRoadLayer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42\u5931\u8D25",V)}}function C(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&le.getZIndex()===2&&(r.map.removeLayer(le),V=!0,console.log("removeCustomRoadLayer: \u5DF2\u79FB\u9664\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42",le))}h=null,V||console.log("removeCustomRoadLayer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u81EA\u5B9A\u4E49\u8DEF\u7EBF\u56FE\u5C42")}Af(u,V=>{console.log("showCustomRoadLayer\u53D8\u5316:",V),V?h?h.setVisible(!0):T():h&&h.setVisible(!1)});async function A(){if(R(),!!r.map)try{const q=await(await fetch("./dianziweilan3.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})}),le=new T1({stroke:new jx({color:"rgba(255, 0, 0, 0.8)",width:1}),fill:new C1({color:"rgba(255, 0, 0, 0.3)"})});l=new sp({source:Y,style:le,zIndex:2,className:"fence-layer"}),r.map.addLayer(l),console.log("addRoadLayer: \u5DF2\u6DFB\u52A0\u7535\u5B50\u56F4\u680F\u56FE\u5C42",l),await M()}catch(V){console.error("addRoadLayer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u7535\u5B50\u56F4\u680F\u56FE\u5C42\u5931\u8D25",V)}}async function M(){try{const q=await(await fetch("./dianziweilan2.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})}),le=new T1({stroke:new jx({color:"rgba(255, 255, 0, 0.8)",width:1}),fill:new C1({color:"rgba(255, 255, 0, 0.3)"})});I=new sp({source:Y,style:le,zIndex:1,className:"second-fence-layer"}),r.map.addLayer(I),console.log("addSecondRoadLayer: \u5DF2\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u7535\u5B50\u56F4\u680F\u56FE\u5C42",I)}catch(V){console.error("addSecondRoadLayer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u7535\u5B50\u56F4\u680F\u56FE\u5C42\u5931\u8D25",V)}}let I=null;function R(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&(le.getZIndex()===1||le.getZIndex()===2)&&(r.map.removeLayer(le),V=!0,console.log("removeRoadLayer: \u5DF2\u79FB\u9664\u9053\u8DEF\u56FE\u5C42",le))}l=null,I=null,V||console.log("removeRoadLayer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u9053\u8DEF\u56FE\u5C42")}Af(s,V=>{console.log("showRoadLayer\u53D8\u5316:",V),V?A():R()});async function k(){if(D(),!!r.map)try{const q=await(await fetch("./quyu1.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})});f=new sp({source:Y,style:new T1({stroke:new jx({color:"#FF5733",width:2}),fill:new C1({color:"rgba(255, 87, 51, 0.3)"})}),zIndex:3,visible:c.value}),r.map.addLayer(f),console.log("loadArea1Layer: \u5DF2\u6DFB\u52A0\u533A\u57DF1\u56FE\u5C42",f)}catch(V){console.error("loadArea1Layer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u533A\u57DF1\u56FE\u5C42\u5931\u8D25",V)}}function D(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&le.getZIndex()===3&&(r.map.removeLayer(le),V=!0,console.log("removeArea1Layer: \u5DF2\u79FB\u9664\u533A\u57DF1\u56FE\u5C42",le))}f=null,V||console.log("removeArea1Layer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u533A\u57DF1\u56FE\u5C42")}async function G(){if(W(),!!r.map)try{const q=await(await fetch("./quyu2.json")).json(),Y=new Hx({features:new $b().readFeatures(q,{dataProjection:"EPSG:4326",featureProjection:r.map.getView().getProjection()})});v=new sp({source:Y,style:new T1({stroke:new jx({color:"#3374FF",width:2}),fill:new C1({color:"rgba(51, 116, 255, 0.3)"})}),zIndex:4,visible:d.value}),r.map.addLayer(v),console.log("loadArea2Layer: \u5DF2\u6DFB\u52A0\u533A\u57DF2\u56FE\u5C42",v)}catch(V){console.error("loadArea2Layer: \u52A0\u8F7D\u6216\u6DFB\u52A0\u533A\u57DF2\u56FE\u5C42\u5931\u8D25",V)}}function W(){if(!r.map)return;let V=!1;const q=r.map.getLayers().getArray();for(let Y=q.length-1;Y>=0;Y--){const le=q[Y];le instanceof sp&&le.getZIndex&&le.getZIndex()===4&&(r.map.removeLayer(le),V=!0,console.log("removeArea2Layer: \u5DF2\u79FB\u9664\u533A\u57DF2\u56FE\u5C42",le))}v=null,V||console.log("removeArea2Layer: \u6CA1\u6709\u627E\u5230\u53EF\u79FB\u9664\u7684\u533A\u57DF2\u56FE\u5C42")}Af(c,V=>{console.log("showArea1Layer\u53D8\u5316:",V),V?f?f.setVisible(!0):k():f&&f.setVisible(!1)}),Af(d,V=>{console.log("showArea2Layer\u53D8\u5316:",V),V?v?v.setVisible(!0):G():v&&v.setVisible(!1)}),i_(()=>{R(),C(),D(),W()});function z(V){console.log(`LayerSwitcher: \u8BBE\u7F6E\u5206\u7C7B ${V} \u53EF\u89C1\u6027`,{visible:r.categories[V].visible,showLabel:r.categories[V].showLabel}),t("setCategoryVisibility",V,{visible:r.categories[V].visible,showLabel:r.categories[V].showLabel})}return(V,q)=>(qr(),hn("div",CXr,[fe("div",{class:"layer-icon",onClick:_}),i.value?(qr(),hn("div",AXr,[fe("div",MXr,[fe("div",IXr,[fe("div",{class:cl(["tab",{active:a.value==="icon"}]),onClick:q[0]||(q[0]=Y=>a.value="icon")}," \u56FE\u6807 ",2),fe("div",{class:cl(["tab",{active:a.value==="text"}]),onClick:q[1]||(q[1]=Y=>a.value="text")}," \u6587\u672C ",2),fe("div",{class:cl(["tab",{active:a.value==="road"}]),onClick:q[2]||(q[2]=Y=>a.value="road")}," \u9053\u8DEF ",2)]),fe("div",LXr,[fe("label",PXr,[fe("input",{type:"checkbox",checked:Xo(y),onChange:b},null,40,OXr),RXr,DXr]),fe("div",{class:"close-btn",onClick:_,title:"\u5173\u95ED\u56FE\u5C42\u9762\u677F"},kXr)])]),a.value==="icon"?(qr(),hn("div",FXr,[fe("div",BXr,[fe("div",GXr,[(qr(!0),hn(Dp,null,Np(n.categories,(Y,le)=>(qr(),hn("div",{class:"layer-item",key:le},[fe("label",zXr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":j=>Y.visible=j,onChange:j=>z(le)},null,40,UXr),[[kC,Y.visible]]),VXr,fe("span",$Xr,mn(Y.name),1)])]))),128))])])])):a.value==="text"?(qr(),hn("div",WXr,[fe("div",HXr,[fe("div",jXr,[(qr(!0),hn(Dp,null,Np(n.categories,(Y,le)=>(qr(),hn("div",{class:"layer-item",key:le},[fe("label",XXr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":j=>Y.showLabel=j,onChange:j=>z(le)},null,40,YXr),[[kC,Y.showLabel]]),qXr,fe("span",ZXr,mn(Y.name),1)])]))),128))])])])):(qr(),hn("div",KXr,[fe("div",JXr,[fe("div",QXr,[fe("div",eYr,[fe("label",tYr,[fe("input",{type:"checkbox",checked:!o.value,onChange:E},null,40,rYr),nYr,iYr])]),fe("div",aYr,[fe("label",oYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":q[3]||(q[3]=Y=>u.value=Y)},null,512),[[kC,u.value]]),sYr,lYr])]),fe("div",uYr,[fe("label",hYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":q[4]||(q[4]=Y=>c.value=Y)},null,512),[[kC,c.value]]),cYr,fYr])]),fe("div",dYr,[fe("label",vYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":q[5]||(q[5]=Y=>d.value=Y)},null,512),[[kC,d.value]]),pYr,gYr])])])])]))])):Bs("",!0)]))}},mYr=rf(yYr,[["__scopeId","data-v-ff64246d"]]);function j$(n,e){return n&&typeof n=="object"&&n.status==="error"&&n.message||e}async function _Yr(n){const e=await PS({url:"/api/VehicleRegistry",method:"post",data:n});if(e&&typeof e=="object"&&e.status==="error")throw new Error(j$(e,"\u5BF9\u8C61\u6CE8\u518C\u540C\u6B65\u5931\u8D25"));return e}async function xYr(n){const e=await PS({url:"/config/runway/alert_zone_radius/aircraft",method:"post",data:{value:n}});if(e&&typeof e=="object"&&e.status==="error")throw new Error(j$(e,"\u4FEE\u6539\u544A\u8B66\u533A\u534A\u5F84\u5931\u8D25"));return e}async function SYr(n){const e=(()=>{if(typeof n=="number")return{value:n};if(!n||typeof n!="object")return{};if(Object.prototype.hasOwnProperty.call(n,"value"))return{value:n.value};const r={};return Object.prototype.hasOwnProperty.call(n,"vehicleDistance")&&(r.vehicleDistance=n.vehicleDistance),Object.prototype.hasOwnProperty.call(n,"aircraftDistance")&&(r.aircraftDistance=n.aircraftDistance),r})(),t=await PS({url:"/config/collision/diverging_release_distance",method:"post",data:e});if(t&&typeof t=="object"&&t.status==="error")throw new Error(j$(t,"\u4FEE\u6539\u51B2\u7A81\u89E3\u9664\u8DDD\u79BB\u9608\u503C\u5931\u8D25"));return t}async function wYr(n){const e=await PS({url:"/api/vehicle-route/assignment",method:"post",data:n});if(e&&typeof e=="object"&&e.status==="error")throw new Error(j$(e,"\u8F66\u8F86\u8DEF\u7EBF\u5206\u914D\u5931\u8D25"));return e}const X$=n=>(kd("data-v-f567b4ae"),n=n(),Fd(),n),bYr=["onClick"],EYr={class:"vehicle-edit-dialog"},TYr={class:"dialog-header"},CYr=X$(()=>fe("span",{class:"dialog-title"},"\u8FD0\u884C\u5BF9\u8C61\u7F16\u8F91",-1)),AYr=["src"],MYr={class:"dialog-body"},IYr={class:"search-row"},LYr=X$(()=>fe("span",{class:"search-label"},"\u5BF9\u8C61\u68C0\u7D22\uFF1A",-1)),PYr=["onKeyup"],OYr=vne('<div class="table-header" data-v-f567b4ae><div class="col col-enable" data-v-f567b4ae>\u542F\u52A8</div><div class="col col-id" data-v-f567b4ae>\u822A\u73ED\u53F7/\u8F66\u724C\u53F7</div><div class="col col-type" data-v-f567b4ae>\u7C7B\u578B</div><div class="col col-route" data-v-f567b4ae>\u8DEF\u7EBF</div></div>',1),RYr={class:"table-body"},DYr={key:0,class:"table-empty"},NYr={key:1,class:"table-empty"},kYr={key:2,class:"table-rows"},FYr={class:"col col-enable"},BYr={class:"checkbox-container"},GYr=["onUpdate:modelValue"],zYr=X$(()=>fe("span",{class:"checkmark"},null,-1)),UYr={class:"col col-id"},VYr={class:"cell-box"},$Yr={class:"col col-type"},WYr=["onUpdate:modelValue"],HYr=["value"],jYr={class:"col col-route"},XYr=["onUpdate:modelValue"],YYr=X$(()=>fe("option",{value:""},"\u672A\u9009\u62E9",-1)),qYr=["value"],ZYr={class:"dialog-footer"},KYr=["disabled"],JYr=["disabled"],QYr={__name:"VehicleRunningEditDialog",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(n,{emit:e}){const t=n,r=OPe(),i=un(!1),a=un(!1),o=un(""),s=un([]);let l=null,u=null,h=null;const c=[{label:"\u822A\u7A7A\u5668",value:"AIRCRAFT"},{label:"\u65E0\u4EBA\u8F66",value:"UNMANNED_VEHICLE"},{label:"\u7279\u52E4\u8F66",value:"SPECIAL_VEHICLE"}],f=[{label:"807-805",routeName:"807-805",description:"\u6D4B\u8BD5\u8DEF\u7EBF-807-805",points:[{lon:40508513641064e-6,lat:4024186813497e-6},{lon:40508714127776e-6,lat:4024250934516e-6},{lon:40508853166318e-6,lat:4024293929307e-6},{lon:40508966275693e-6,lat:4024330441807e-6}]},{label:"M4 829-826-K1",routeName:"M4 829-826-K1",description:"\u6D4B\u8BD5\u8DEF\u7EBF-M4 829-826-K1",points:[{lon:40507849913313e-6,lat:4023625932486e-6},{lon:40507732597485e-6,lat:4023991671027e-6},{lon:40507723998527e-6,lat:4023986908527e-6},{lon:40507674841898e-6,lat:402413830738e-5}]},{label:"M1 K2-1-1-1#\u6D88\u9632",routeName:"M1 K2-1-1-1#\u6D88\u9632",description:"\u6D4B\u8BD5\u8DEF\u7EBF-M1 K2-1-1-1#\u6D88\u9632",points:[{lon:40509113197805e-6,lat:4024029951692e-6},{lon:40508997734226e-6,lat:4024393687528e-6},{lon:40509007523809e-6,lat:4024395275028e-6},{lon:40508957783071e-6,lat:4024548361738e-6}]}],d=ul(()=>{const T=(o.value||"").trim().toLowerCase();return T?s.value.filter(C=>String((C==null?void 0:C.id)||"").toLowerCase().includes(T)):s.value});function v(){o.value=(o.value||"").trim()}function p(T){if(!T)return null;if(typeof T=="object")return T;if(typeof T!="string")return null;try{return JSON.parse(T)}catch{return null}}function g(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"?"\u65E0\u4EBA\u8F66":C==="SPECIAL_VEHICLE"?"\u7279\u52E4\u8F66":C==="AIRCRAFT"?"\u822A\u7A7A\u5668":C==="WUREN"?"\u65E0\u4EBA\u8F66":C==="TEQIN"?"\u7279\u52E4\u8F66":C==="AIRCRAFT"||C==="AIRCRAFT_IN"||C==="AIRCRAFT_OUT"||C==="HANGKONG"?"\u822A\u7A7A\u5668":C||"\u672A\u77E5"}function m(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"||C==="WUREN"?"UNMANNED_VEHICLE":C==="SPECIAL_VEHICLE"||C==="TEQIN"?"SPECIAL_VEHICLE":(C==="AIRCRAFT"||C==="HANGKONG"||C==="AIRCRAFT_IN"||C==="AIRCRAFT_OUT","AIRCRAFT")}function y(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"?"WUREN":C==="SPECIAL_VEHICLE"?"TEQIN":C==="AIRCRAFT"?"HANGKONG":C==="WUREN"?"WUREN":C==="TEQIN"?"TEQIN":C==="AIRCRAFT"||C==="AIRCRAFT_IN"||C==="AIRCRAFT_OUT"||C==="HANGKONG"?"HANGKONG":C==="JIUYUAN"?"JIUYUAN":"PUTONG"}function _(T){const C=String(T||"").toUpperCase();return C==="UNMANNED_VEHICLE"||C==="WUREN"?"UNMANNED_VEHICLE":C==="SPECIAL_VEHICLE"||C==="TEQIN"?"SPECIAL_VEHICLE":""}function x(T,C){const A=String(T||"").trim();if(!A)return;g(C);const M=String(C||"").trim(),I=r.getVehicleRouteAssignment(A),R=s.value.find(G=>(G==null?void 0:G.id)===A);if(R){if(R.lastSeen=Date.now(),M&&(R.objectType=M),!R.typeSelected){const G=r.getVehicleTypeOverride(A);R.typeSelected=G||m(M)}!R.routeName&&I&&(R.routeName=I);return}const k=r.isVehicleEnabled(A),D=r.getVehicleTypeOverride(A);s.value=[...s.value,{id:A,enabled:k,objectType:M,typeSelected:D||m(M),routeName:I||"",lastSeen:Date.now()}]}function S(){var C;const T=(C=window.APP_CONFIG)==null?void 0:C.WS_BASE_URL;if(!T){i.value=!1;return}l=brt(T,{reconnectInterval:3e3,maxReconnectAttempts:5}),u=A=>{const M=p(A);if(!M||M.type!=="position_update")return;const I=M.payload||{};x(I.object_id,I.object_type),i.value&&(i.value=!1)},l.on("message",u),l.send(JSON.stringify({type:"subscribe",topics:["position_update","collision_warning","rule_violation"],timestamp:Date.now()})),h&&clearTimeout(h),h=setTimeout(()=>{i.value=!1},1200)}function w(){h&&(clearTimeout(h),h=null),l&&u&&l.off("message",u),u=null,l=null}function b(){a.value||e("close")}async function E(){if(!a.value){a.value=!0;try{const T=(s.value||[]).filter(I=>!!(I!=null&&I.id)&&I.enabled===!0).map(I=>({vehicleID:String(I.id),vehicleType:y(I.typeSelected||I.objectType)})),C=(s.value||[]).filter(I=>!!(I!=null&&I.id)&&I.enabled!==!0&&r.isVehicleEnabled(I.id)).map(I=>({vehicleID:String(I.id),vehicleType:"PUTONG"})),A=[...T,...C];A.length&&await _Yr(A);const M=(s.value||[]).filter(I=>!!(I!=null&&I.id)&&I.enabled===!0&&!!I.routeName).map(I=>{const R=f.find(D=>D.routeName===I.routeName),k=_(I.typeSelected||I.objectType);return!R||!k?null:{vehicleID:String(I.id),vehicleType:k,routeName:R.routeName,description:R.description,status:"ACTIVE",isBidirectional:!1,maxSpeedKph:25,typicalSpeedKph:15,points:R.points,route:{points:R.points}}}).filter(Boolean);M.length&&await Promise.all(M.map(I=>wYr(I))),(s.value||[]).forEach(I=>{!(I!=null&&I.id)||(r.setVehicleTypeOverride(I.id,I.typeSelected||m(I.objectType)),r.setVehicleRouteAssignment(I.id,I.routeName),r.setVehicleEnabled(I.id,I.enabled===!0))}),Sp.success("\u5DF2\u540C\u6B65\u5230\u540E\u7AEF"),e("close")}catch(T){Sp.error((T==null?void 0:T.message)||"\u540C\u6B65\u5931\u8D25")}finally{a.value=!1}}}return Af(()=>t.visible,async T=>{if(!T){w();return}o.value="",s.value=[],i.value=!0,S()},{immediate:!1}),(T,C)=>n.visible?(qr(),hn("div",{key:0,class:"vehicle-edit-mask",onClick:NA(b,["self"])},[fe("div",EYr,[fe("div",TYr,[CYr,fe("img",{class:"dialog-close",src:Xo(hz),alt:"close",onClick:b},null,8,AYr)]),fe("div",MYr,[fe("div",IYr,[LYr,lu(fe("input",{"onUpdate:modelValue":C[0]||(C[0]=A=>o.value=A),class:"search-input",placeholder:"\u8BF7\u8F93\u5165\u822A\u73ED\u53F7/\u8F66\u724C\u53F7",onKeyup:RPe(v,["enter"])},null,40,PYr),[[qg,o.value]])]),OYr,fe("div",RYr,[i.value?(qr(),hn("div",DYr,"\u52A0\u8F7D\u4E2D...")):Xo(d).length===0?(qr(),hn("div",NYr,"\u6682\u65E0\u6570\u636E")):(qr(),hn("div",kYr,[(qr(!0),hn(Dp,null,Np(Xo(d),A=>(qr(),hn("div",{key:A.id,class:"table-row"},[fe("div",FYr,[fe("label",BYr,[lu(fe("input",{type:"checkbox","onUpdate:modelValue":M=>A.enabled=M},null,8,GYr),[[kC,A.enabled]]),zYr])]),fe("div",UYr,[fe("div",VYr,mn(A.id),1)]),fe("div",$Yr,[lu(fe("select",{"onUpdate:modelValue":M=>A.typeSelected=M,class:"type-select"},[(qr(),hn(Dp,null,Np(c,M=>fe("option",{key:M.value,value:M.value},mn(M.label),9,HYr)),64))],8,WYr),[[Dde,A.typeSelected]])]),fe("div",jYr,[lu(fe("select",{"onUpdate:modelValue":M=>A.routeName=M,class:"type-select"},[YYr,(qr(),hn(Dp,null,Np(f,M=>fe("option",{key:M.routeName,value:M.routeName},mn(M.label),9,qYr)),64))],8,XYr),[[Dde,A.routeName]])])]))),128))]))])]),fe("div",ZYr,[fe("button",{class:"footer-btn cancel",disabled:a.value,onClick:b},"\u53D6\u6D88",8,KYr),fe("button",{class:"footer-btn confirm",disabled:a.value,onClick:E},mn(a.value?"\u63D0\u4EA4\u4E2D...":"\u786E\u5B9A"),9,JYr)])])],8,bYr)):Bs("",!0)}},eqr=rf(QYr,[["__scopeId","data-v-f567b4ae"]]);const qce=n=>(kd("data-v-0989065e"),n=n(),Fd(),n),tqr=["onClick"],rqr={class:"dialog"},nqr={class:"dialog-header"},iqr=qce(()=>fe("span",{class:"dialog-title"},"\u4FEE\u6539\u9884\u8B66\u8DDD\u79BB",-1)),aqr=["src"],oqr={class:"dialog-body"},sqr={class:"form-row"},lqr=qce(()=>fe("span",{class:"form-label"},"\u544A\u8B66\u8DDD\u79BB\u8C03\u6574\uFF1A",-1)),uqr={class:"form-row"},hqr=qce(()=>fe("span",{class:"form-label"},"\u5206\u79BB\u8DDD\u79BB\u8C03\u6574\uFF1A",-1)),cqr={__name:"WarningDistanceDialog",props:{visible:{type:Boolean,default:!1}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=un({vehicleDistance:"",aircraftDistance:"",separationDistance:""});function i(){e("close")}function a(){e("confirm",{...r.value})}return Af(()=>t.visible,o=>{!o||(r.value={vehicleDistance:"",aircraftDistance:"",separationDistance:""})}),(o,s)=>n.visible?(qr(),hn("div",{key:0,class:"dialog-mask",onClick:NA(i,["self"])},[fe("div",rqr,[fe("div",nqr,[iqr,fe("img",{class:"dialog-close",src:Xo(hz),alt:"close",onClick:i},null,8,aqr)]),fe("div",oqr,[fe("div",sqr,[lqr,lu(fe("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>r.value.vehicleDistance=l),class:"form-input",placeholder:"\u65E0\u4EBA\u8F66\u62A5\u8B66\u8DDD\u79BB"},null,512),[[qg,r.value.vehicleDistance]]),lu(fe("input",{"onUpdate:modelValue":s[1]||(s[1]=l=>r.value.aircraftDistance=l),class:"form-input",placeholder:"\u98DE\u673A\u544A\u8B66\u8DDD\u79BB"},null,512),[[qg,r.value.aircraftDistance]])]),fe("div",uqr,[hqr,lu(fe("input",{"onUpdate:modelValue":s[2]||(s[2]=l=>r.value.separationDistance=l),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,r.value.separationDistance]])])]),fe("div",{class:"dialog-footer"},[fe("button",{class:"footer-btn cancel",onClick:i},"\u53D6\u6D88"),fe("button",{class:"footer-btn confirm",onClick:a},"\u786E\u5B9A")])])],8,tqr)):Bs("",!0)}},fqr=rf(cqr,[["__scopeId","data-v-0989065e"]]);const oF=n=>(kd("data-v-4ad96261"),n=n(),Fd(),n),dqr=["onClick"],vqr={class:"dialog"},pqr={class:"dialog-header"},gqr=oF(()=>fe("span",{class:"dialog-title"},"\u822A\u7A7A\u5668\u6ED1\u884C\u8DEF\u7531\u67E5\u8BE2",-1)),yqr=["src"],mqr={class:"dialog-tabs"},_qr={class:"dialog-body"},xqr={class:"form-grid"},Sqr={class:"form-item"},wqr=oF(()=>fe("span",{class:"form-label"},[a_("flightNo\uFF08\u822A\u73ED\u53F7\uFF09\uFF1A"),fe("span",{class:"required"},"*")],-1)),bqr={class:"form-item"},Eqr=oF(()=>fe("span",{class:"form-label"},"inRunway\uFF08\u8FDB\u6E2F\u8DD1\u9053\uFF09\uFF1A",-1)),Tqr={class:"form-item"},Cqr=oF(()=>fe("span",{class:"form-label"},"outRunway\uFF08\u51FA\u6E2F\u8DD1\u9053\uFF09\uFF1A",-1)),Aqr={key:0,class:"form-item"},Mqr=oF(()=>fe("span",{class:"form-label"},[a_("contactCross\uFF08\u8054\u7EDC\u9053\u53E3\uFF09\uFF1A"),fe("span",{class:"required"},"*")],-1)),Iqr={class:"form-item"},Lqr={class:"form-label"},Pqr={key:0,class:"required"},Oqr={class:"form-hint"},Rqr={key:0},Dqr={key:1},Nqr={__name:"RouteModifyDialog",props:{visible:{type:Boolean,default:!1}},emits:["close","confirm"],setup(n,{emit:e}){const t=n,r=un("IN"),i=un({flightNo:"",inRunway:"",outRunway:"",contactCross:"",seat:""});function a(){e("close")}function o(){const s=String(i.value.flightNo||"").trim();if(!s){Sp.warning("\u8BF7\u8F93\u5165\u822A\u73ED\u53F7 flightNo");return}const l={routeType:r.value,flightNo:s,objectId:s,vehicleID:s,objectName:s};if(r.value==="IN"){if(!i.value.inRunway||!i.value.contactCross||!i.value.seat){Sp.warning("\u8FDB\u6E2F\u67E5\u8BE2\u5FC5\u987B\u586B\u5199\uFF1A\u8FDB\u6E2F\u8DD1\u9053\u3001\u8054\u7EDC\u9053\u53E3\u3001\u673A\u4F4D\u53F7");return}l.inRunway=i.value.inRunway,l.contactCross=i.value.contactCross,l.seat=i.value.seat,i.value.outRunway&&(l.outRunway=i.value.outRunway)}else{if(!i.value.outRunway){Sp.warning("\u51FA\u6E2F\u67E5\u8BE2\u5FC5\u987B\u586B\u5199\uFF1A\u51FA\u6E2F\u8DD1\u9053");return}const u=String(i.value.seat||"").trim();if(!u){Sp.warning("\u51FA\u6E2F\u67E5\u8BE2\u5FC5\u987B\u586B\u5199\uFF1A\u673A\u4F4D\u53F7 seat");return}l.outRunway=i.value.outRunway,l.seat=u,i.value.inRunway&&(l.inRunway=i.value.inRunway)}e("confirm",l),e("close")}return Af(()=>t.visible,s=>{!s||(r.value="IN",i.value={flightNo:"",inRunway:"",outRunway:"",contactCross:"",seat:""})}),(s,l)=>n.visible?(qr(),hn("div",{key:0,class:"dialog-mask",onClick:NA(a,["self"])},[fe("div",vqr,[fe("div",pqr,[gqr,fe("img",{class:"dialog-close",src:Xo(hz),alt:"close",onClick:a},null,8,yqr)]),fe("div",mqr,[fe("div",{class:cl(["tab",{active:r.value==="IN"}]),onClick:l[0]||(l[0]=u=>r.value="IN")},"\u8FDB\u6E2F\u8DEF\u7531",2),fe("div",{class:cl(["tab",{active:r.value==="OUT"}]),onClick:l[1]||(l[1]=u=>r.value="OUT")},"\u51FA\u6E2F\u8DEF\u7531",2)]),fe("div",_qr,[fe("div",xqr,[fe("div",Sqr,[wqr,lu(fe("input",{"onUpdate:modelValue":l[2]||(l[2]=u=>i.value.flightNo=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.flightNo]])]),fe("div",bqr,[Eqr,lu(fe("input",{"onUpdate:modelValue":l[3]||(l[3]=u=>i.value.inRunway=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.inRunway]])]),fe("div",Tqr,[Cqr,lu(fe("input",{"onUpdate:modelValue":l[4]||(l[4]=u=>i.value.outRunway=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.outRunway]])]),r.value==="IN"?(qr(),hn("div",Aqr,[Mqr,lu(fe("input",{"onUpdate:modelValue":l[5]||(l[5]=u=>i.value.contactCross=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.contactCross]])])):Bs("",!0),fe("div",Iqr,[fe("span",Lqr,[a_("seat\uFF08\u673A\u4F4D\u53F7\uFF09\uFF1A"),r.value==="IN"?(qr(),hn("span",Pqr,"*")):Bs("",!0)]),lu(fe("input",{"onUpdate:modelValue":l[6]||(l[6]=u=>i.value.seat=u),class:"form-input",placeholder:"\u8BF7\u8F93\u5165..."},null,512),[[qg,i.value.seat]])])]),fe("div",Oqr,[r.value==="IN"?(qr(),hn("div",Rqr,"\u8FDB\u6E2F\u5FC5\u586B\uFF1AflightNo\u3001inRunway\u3001contactCross\u3001seat\uFF1B\u5EFA\u8BAE\u586B\u5199\uFF1AoutRunway")):(qr(),hn("div",Dqr,"\u51FA\u6E2F\u5FC5\u586B\uFF1AflightNo\u3001outRunway\u3001seat\uFF1B\u5EFA\u8BAE\u586B\u5199\uFF1AinRunway"))])]),fe("div",{class:"dialog-footer"},[fe("button",{class:"footer-btn cancel",onClick:a},"\u53D6\u6D88"),fe("button",{class:"footer-btn confirm",onClick:o},"\u67E5\u8BE2")])])],8,dqr)):Bs("",!0)}},kqr=rf(Nqr,[["__scopeId","data-v-4ad96261"]]);function Fqr(n){return PS({url:"/api/aircraft-routes/query",method:"post",data:n})}const Bqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAACklpQ0NQc1JHQiBJRUM2MTk2Ni0yLjEAAEiJnVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/stRzjPAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAJcEhZcwAACxMAAAsTAQCanBgAAAEdSURBVEiJtdWxK0VhGAfg5yLLRYhYGLAYDHKZjHexSGQ2Wa3qDkrKH8JgY7BIGZSR0SChpBhkuWIgx3C/6d5c57ud8y2/es953+e833IKSZJodkq7DaUeVJHAZaVpu7bmjxtOERc4RHeahlhgB1OYxHiaho6I4XPYwDPKeErTFLNBBe3YTDs8BujHAh5xEPFRqYFVdGIf33kA5ZDHMcNjgHl84SoPYBDDuBd5PWmBsZC3scPTAn0h7/ICekN+5gVUQ3blBbyEHM0LuAk5nRfwjmuMYCIPAM5CLocs//Viq8BRyHVs4xRDWQLneFC7oi0UMJMlUMRrXa2UFdCGE8zW1TPb4AeLWFP72X+Eej3YMgBv2MMKBrCktlXxv8ZfcIwuNRzwDTEAAAAASUVORK5CYII=",Gqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAACklpQ0NQc1JHQiBJRUM2MTk2Ni0yLjEAAEiJnVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/stRzjPAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAJcEhZcwAACxMAAAsTAQCanBgAAAEdSURBVEiJtdW/K4VRGAfwD12DH3eRgZJCMlgUu0HpLgY2A3+IkjIoK6PJLMKidEcTV0bLZWAhQiGluIZ7lKTrXL3nWb6973me99P7LKehUqmoVaPLWrGGXRzg9ft5ab7muMbax+AFBezgDluYQ3vEbBQAxyFbMI0N7MXMxwInv4AFfGQFlH48d6iu7s+q5w8qWEIZvRjLErjBBBaxHt5NZQlAMeR2yPGsga8q4wpDaEsBwGnIwVTAZcjOVMBzyHwqoDnkYyqgP+RDKmAg5EUKIIc+XOM2BTCCJhzGNP8HmAxZrNn1TyCHWbxhMwUwgx7s4z5roBsreMdy7FAsMKy68y6s4igWyEX2neNMdfcLsR+vB3hSvezzIq/Kr/oE3Zs1N+v+bUIAAAAASUVORK5CYII=",zqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAASLSURBVHgBzVnPbxtFFH5vZp0fTiyBgg9OKUUcHEsQqa05UdSkd/gDAvf0wg3+jPbGpblxyo1Dwx1EHVWocmhEBbG5QCo5UZQoSG6axJuZx3uzXttx12vHcm1/B+/Oj5355pt5b2aeEfpE7va9PJDNgsW8RVpAhFkASgWlWCWCPUVYAbBl0Lq4s/VzEfoAXqXywsKdFM7oFSJcaZLpuasKEhVR09pfxSd7PX/VSyVHLKlXCWAFBgAk2OiVaFeCuU+XVsjA6tUV69p1BS2u7Wz/8lNcLR1XmLt191teS0wOJmHwSLGUy+nMjdTh/r9PO1WKVNBN6bT3gJDyMAQQURlP7f1SabPaXqYiP5j2Hg2LnAARszStH0SVvTHFMq2s6zIMGeym5qOm+xLB3O2lL9lSv4HRYTGd+bDKJF+EGY0pXrh1Z95aZxAjhRil2ECYbhBE0quIlIFRA8n53EZSfkQ9nu3HME54be6JVTsFRT0YM9gp7XYtR9ACDs2l9AqF6AiinEqIzKNuH8haoLZ0CIK3A0R73wNj8tHuOqykGoQQ2H3zgmDHiuL+idPYSljqkgV3HAg+dr/k8qROkC8/YV4sSGc9fmTjyAkppTVq7gy1Yuk1Wj49cJnkcGd1/Uj4Od7yjpclFzJKSKF/YUh8CaepG0lrKe9ZhfPYYZJEKI/JJSan1VRyVmsvgUo419tlQk5F5RqDy26f2juzZI2l2tmJOX99an1z0ZUkt5/1eKCZaHJKZgi9RELNzmUmkukPJtVEUolKqkUXgMDS2t+5GlhqOlrmB+bi3J4f7/tw8M+ZPXllWE2IBUHK63TOk5Ep9MBLTEAi+Y6eeO+jqfQnS+/qhKeC8nAgYVvBT2NR1ueYmp25pDU+7T/98WD32caRiBA7zey0PYiBJRm1gdrJsXn/xsezyblr0zAAXFv6OrP72+OjXup6csHpqCIz9P1zc/rfgX/456/HE6m5hJqcaVlpIkuv15rQmAgqzzYOLmTRdrNkwipmby5txO3BSmnwPLZdpflVi3k2LTTKOVLzHQN7dSOw4pbY+sVYfN+IxXT1n/x52WM7KhFCR4KWG/J9blpZQ7Vawy82jME9CVRdSVtvumHsIUUK/R/15gNdY1jx2BL4vkrLcfWkQdMwuKDxMNn+hA7pfsCDL/NATRnGFdYW1c5WoRgYytihsvNHoRgctyytw5iBl6oLlQROd9aMHUHNkQd5OoKlzc0qW9jYkGT1NsKwSPNOkjRrY7IWK6F6gsaucPTyZS2duV5jkp/BCIHWPtz5vbAVpi/diw/3d1/M8eWZ/eoijABk7Xppu/BDa17kRpq7eZdDHzDUe4rEZ8rPn3zVnh8dm5kx38k+CEOCuBQJHkWVxR5FshynwQEFLTtBprW8XXjYqTw2PnjEgZz0/PU9HiHHoHHAAUyq8iHj+7+fF9biavUWAubIA7nQCHwBA4Cohme0FhUPbMfVguh1otxFnhW9YhyHFeMtVZ3Rei/E+iLYitzi53yfVnKnzvJUzQeXr3AZkPwN8YovpiU+khThAsqy8UMf+B9ymBOEqiwGgAAAAABJRU5ErkJggg==",Uqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYdSURBVHgBvVnNbxtFFH9vZtdrO3bS1EnaWI34Eo6lkqptQFBa+iHEDSQQXMIf0F64wR/AGbUXxIVw4lSJQw9tT1xANFUlkEsLlRq7SBQinH6lbepQx+vdeX2zazub1HZ2t1F/ipV4Z3bmN+/N+82bF4SYKO4/Ng2kCqBwWiFNIkIGgLJ+K9aIYFEQVgFUBaQszV/+qQQxgFE6T04ezOKAnCHCmTUyoaeqIlEJJc1eL11YDP1WmE4esbQ8TgAzsAVAgnNhiW5KsPj6kRly4Xh0i206dRUVzs5f/fl8v16yX2Nx3+HPeS8xObBg65FlUx4dHX8he+/WP5d6depqQc+lKeMkIU3DcwARVbCuTpTLF2sb20TXF1LGt1HJIUSMuOC7iAVKyZPd2p5ysXYrz3QUQg8uQAhAgZL/5A/6VBEIooBfy3dz9zqCxf1HPuBhP4OQ0OQQCU0zgQnLktI0heCZ2GUtetFIMqZGx1+sMclrTxGc3HcwTyS+5PFDR6tg05nSEKnsNiO78+VkOjduouug22yQUopZRibIa8KpkaFdZ5aWFmxvjvZzJHmcrTEedhzPkexJI5HA9PAOMzuxOz0y9d72/IGPclbSQsmmjEFPE/E0t/3VI+hZD+F9iAh2MLAB0bDS0hoaM8f2vDsy/ubHO0d3H93m78N40AeCVhJ/DvCtB1GBvvH1nmNPg0ykO9tFJjPoNaOAuFBJOdMhqACj6x0pn6d2NOjtpjZ4NK79fPDCfYI6K4my9zpTs3UIdQzDOsLtDohd3ok0CWWL+w9NG+C609DHE76UYEvfyJuK1Y6tzgHComII/2UKEGRlRI5wIaVk/pJtu2ZcT4I8KNgUJAsG/yr0aucpPGMYUqI0paajFVnbjbRrDUNiMpkSppQiKCmmIUUmkxH2qq0XorMXpuMRA8exleMoUAo2JclKNW0ogfl+qs8kRHIgI1KZYUOYWj4ktszEIirQtBLCSA+JYECY6YyRGdllua6/L7Vsuy6BcprKfrzs1msP3YbdZHaiL0k2RsHg2bruv7ZrZSKJ6e27ElZuwpJWSrReXNfTkaYwAwQplTPk2KtJqfwt0SJJym2SfHCn6To3Vh1nWTWdJvQFQdbolef5K9MSIlGwG4deeWNwx55jOQiBkdeO5fSnV3v1t7O3K+e//k8boa+bOVDEJisAl93SWL7rpAaHDdgibHtp7yCxyyFEoBj6gtPLihx9ZDdWlXhwx/77x++q+bc+tKU10BFkbwtw0AgzKYzBsURyOJ/Uz+u3//q/8eiurQMhmDDoaNYBc/PCD3ccpTY/qQlrBvda6ZUgaPPrSer1urIXyvWH1a8WvAOutQVZRkQmPSDTubw1UHhnMH/gk536+f3rv9xfuHTmvt2wWxmD70qt5ZqWUg6FySMI1aLBcVRmzegp1N7AWiaUC+i0HuoA4l+GKZXtJITpOBQ0iMMha9u2sptNxQ3+kddyZ6QEQmFVa2ro+yq1P56q6QHWBJqUE1yVtpZnpWD/qNkNL6vCpnArEAO+ZX2ZQ59NYP5nO4c7UKok5i/PlfxAiQb/PPazZ9c/vgIDE1D0bHojqvN/zpV84VV0GmKAs2b/hHAdfUzQGr9Wwh/mvO0BHsLbeh5ByrixCOot5jhNsusrrl1bstvPXRY5TfxZwHnGbIdg+eLFGg8XiaS/+dm9jqtWVx45yzf/qDdWlmy38di9N/9rTQUsGhU87Ll2WaSzmycPcor92Dgbp8QhpYE6odF3FMUJAv94shQTVSHoRJtg51RYWliwR8cn2E34NkRFS4Rdj5wLoVS4B1CpU/O/z11uf193L753699rOb48s1mnICIoltJtGEOp0+Wrc98Hn3UVrOLew1z6gOdSl2lD12cqVy58uvF599rMgPsFWySWgMeBlhRdPOrW1lfyC1ynwS0qWvaCdmvl6typXu1964NLXMgZzU8s8gq5Bo1bXMCkGofWNzeuzM326xWuBOzVbXRpJHr1oRu01XCVZrvVAzciWhG9RZSn4Ls0RrpLexbjI1Ws0ukwxGIRDKI4dYjv00LfqQvsqrx/+WpvA9L/hljhZLvMJ3MJHKjogx9i4AlyrehUszxtEAAAAABJRU5ErkJggg==",Vqr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgqSURBVHgBvVlbb1TXFd6Xc585nvFcPJ4hvoDxBRK3gAOoOAKiRmoilSRvFX2IKlUiD+1b+AmVWrVJX5oXeIv6wEOSRqKhraK0EDCxVDIBF6g9JliA8Y3B4xnPeC5nztm7ax8z5lLPzLFjsawj27PX3vs731p7rbXXYLRJGdj36hDirA8xPMQw78cY+RHi5uooznOO5gjHswixSURpcuLb80m0CcEbUe7vHzaxjx7nHB9/DMbzVrOY8ySm/PR48tKc51lelFxgBj3BETqOtkAwR3/1CrQpwIGXjxznDjqxccaabj2LGT49MXbh80ZatNHgwN7D74EvATikoq0XE6g8Go13mQ/n747WU1qXQdekuvQ+x3wIPQfhnE/iEns3lbqcf3aMrDtBl049L3BCMMZ9XKfvrzf2fyYWZgVej6LnLBCmEuuZ+ymAA/uOHIOT+uvmixFEMMKSJGFFkalh+KjhD0g6/FYUCcMpBVIwmE74EHf1wS7IgwxG4915AHljba/aH/17hxOcS6dg9Xg9UJwzAEYQJgRTeDRVJZrflNRgu6wE2iQBrLI8X7VyD6yVfN6xKhVmOw4XItYQ85sKx3lUst+s+eMag9H27cK06/qd+xawOyEUEUAGrBGf3y/5Q+2yL9Gj6e39uhrZoQf7DwVDvQdNblcYsUsMIwdAiYdjvLZSEyYxUrFM1JqpcY09wHq27hzBGogsS8CaRnW/SfXwNkUJdanEjMhmYsDX0vmiSajkrmeXCk5u8utM5uaX2dLiXKVYyDqVUpnZjHEGjycmi86rgkX6BHt99cARMKeqKsQAc5rhdsVo79WV6A5NCXdpkd2HW/2xbkOYvTaHyKDb3uPTo90qsyuc2GWXTcbEU2OwMZOMEiuzcDfpAgy1d78HNlg3UwhfUwCcLxCWzfYdqhbbqdNgQgn27A+EevYFZc0n1dtE9oeVwM4DAdmMSHb+gYWZxZ2qJVhEiDcGCGewb3H+7kfUrUoQq5tjJTAbHARqxoG1tp26L95vRHYdCRnhhI4J9ZTLtfALWrD3YKCYvl+ycvNV26o+IpI3QqhGEx1JGmnrPFbvcLgAJYo13ZT0aKcSeenHreHe/a1UUSnaoBBJJaGB4VbkcCd751rBESyiZiySSRGg+hopCX8GP2Isv2AbrdHvnZNDLw63uib2IEDzEGEEJ5opcgaxzCqy9MifF1hp2UablGohU71z7k/TXvUxwX3i6MUbKomHqgTpIalqO2z+yw/vr3x3OYs2INy2WO52Mnv77B/urDy4U/FcJ3NkSk3rPPIIJZFR5OW3I1pru5ZNfpYu3btWaHnp9ZDS1mM0ml7OzpXTY//MSL6AtP3YyS5r+aGVPPWrW8hL7sPclJrpuDHVsTgvph0JDgfVTCk8/E68NDtRyN38IqPNd634el9pJXrLU2sxYG1pKpldnv5vMdz3o0BLx26XCAEQoHlKzEJoJN4tQkxd56cQShTIuarup/bygiUDQDnQpkBsU7T4gFHK3K8UJ84vUcWgUkubIubk744tL3zzeZrIOt124O2YYF18nh0fyXx39o/3Lcg0zI2DTXBCXpZAr1AvSAtxCxEiYUcNUm5E5Fzq4tLK1GgudOBnMQqstQ6+HinOjBeWxv+1hKeuLDOlhVjlghPb/1a0Bswu5e2Fq/9IO+W8o/iDEof0hzwIx2yORmNdQ+Bj3fWUoG7BVJaIovpo52u/TAR3HQ1B2cAzVz5JY8S4Eu7U5ZaoYnTsMRlRELgAjf3gtYjsC8isarHsVDKXvnFhsaVr0IztfSNqxHq02SvnFj0xyPB1Gkl0h+HPQ/V0sPsjfleRagSof9uAXwnGNaNj0F+au1XM/+dcRmndpkBpo2jBmKqHEprIMOXMTGlm9OMFSG0scfCtmBHp1MV66RtfLaYn/13wUjAQjr4AgB3gf/hYXS14U/dtHZsVZ24W7ZWMZcR2GpIRkPX2Xh/STJIdO7fo+mcgLtZCi+Bri6nRXNsPfxKK7DoUIpJCKvlFa+LT305Nf/0XwR73dIgddvpRuXXkfLNwIw6LLFOsahrRND/ddvSdWGTPG1ExxqoVlk2NLGUmLueY4seB7ftaogOHWkVVI8ZnRj+dv3PpzINyLlMVL+up3EJoNnX14pur5VasS22Uj1eJ5EgcPceGZMpsXrg3Vlye+iYX6DlgSppf0tt2GC3bh/xQF/oDnbtNTCnOz6QKEx//Zur+lb9lrPKKwzzk38f7oQtQzXzlAgzvfGESVckvPExDq9aGug5K+WphyX547e8ZbpdsPdKtyUaLIqmG5FhFZ/rSmbnxT343XcjMW6Iw8MjamlDKTz6cu1dwAS5OT1thuFGBvQebT+U1vxRsIpfNmVQxezu5LPuCND89Xhj/7Pd3569fzIn7COPeWVvbAVojqauX3I7D40vT8LCJitLZjbQ4Vm9ryK24qbh1wL+ACbLPalm/MVhrMksIf7fWt1mr6wSL0XiHBdse8r7WaiwTYIQZHWfVlHyz0EAwYx9MXB35tvb/U4Xnw/l7N7ybeusFmD+TGhv56MnP1q17BvYchtYHem6tDyGiPzN57dLPn/18/d6MzzkJZppEz0ngUCRF82i9sYaVYx/0afAWNS3riTDr5NjIB/XGG15+IFCOws1qDt4QetB4ixuYPA/H6cNb10ZON9Ly1gJ2+zb0BESSn6ItEMEaLvPT6/UDn5WNNdEfAYUthoDRONqQAGOMnyFlfsYLsE0BfFIGBl8ZgggND+oDUyVWL181N+Dia4gCwTgFpUQS2Why4vrIpr6G+B/jP7NCPGnPlgAAAABJRU5ErkJggg==";const UQe=n=>(kd("data-v-eabcb3ef"),n=n(),Fd(),n),$qr=["onClick"],Wqr=UQe(()=>fe("svg",{class:"settings-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},[fe("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z",stroke:"currentColor","stroke-width":"2"}),fe("path",{d:"M19.4 15a8.2 8.2 0 0 0 .1-1 8.2 8.2 0 0 0-.1-1l2-1.6-1.9-3.3-2.4 1a7.9 7.9 0 0 0-1.7-1l-.4-2.6H9l-.4 2.6a7.9 7.9 0 0 0-1.7 1l-2.4-1-1.9 3.3 2 1.6a8.2 8.2 0 0 0-.1 1 8.2 8.2 0 0 0 .1 1l-2 1.6 1.9 3.3 2.4-1c.5.4 1.1.7 1.7 1l.4 2.6h6.2l.4-2.6c.6-.3 1.2-.6 1.7-1l2.4 1 1.9-3.3-2-1.6Z",stroke:"currentColor","stroke-width":"2","stroke-linejoin":"round"})],-1)),Hqr=[Wqr],jqr=UQe(()=>fe("span",null,"\u8DEF\u5F84\u51B2\u7A81\u663E\u793A",-1)),Xqr={__name:"OpenLayersZoomControl",props:{map:Object,resetView:{type:Function,default:null},vehicleCategories:{type:Object,default:()=>({})},vehicleMovementControl:{type:Object,default:null}},emits:["compass","zoomIn","zoomOut","layerChange","rotate","setCategoryVisibility","drawTestRoute","routeQueried"],setup(n,{expose:e,emit:t}){const r=n;[Bqr,Gqr,zqr,Uqr,Vqr].forEach(R=>{const k=new window.Image;k.src=R});const i=un(null),a=un(null),o=un(!1),s=un(!1),l=un(!1),u=un(!1),h=Irt(),c=ul({get:()=>h.pathConflictDisplayEnabled!==!1,set:R=>{h.changeSetting({key:"pathConflictDisplayEnabled",value:R});const k=JSON.parse(localStorage.getItem("layout-setting"))||{};localStorage.setItem("layout-setting",JSON.stringify({...k,pathConflictDisplayEnabled:R}))}}),f=un(0);function d(){r.map&&r.map.getView()&&(f.value=r.map.getView().getRotation()*180/Math.PI)}function v(){r.map&&(r.map.getView().animate({rotation:0,duration:300}),t("rotate",0))}function p(){if(r.map){const k=r.map.getView().getRotation()-Math.PI/2;r.map.getView().animate({rotation:k,duration:300}),t("rotate",k*180/Math.PI)}}function g(){if(r.map){const k=r.map.getView().getRotation()+Math.PI/2;r.map.getView().animate({rotation:k,duration:300}),t("rotate",k*180/Math.PI)}}function m(){if(t("zoomIn"),r.map){const R=r.map.getView(),k=R.getConstrainedZoom(R.getZoom()+1);R.animate({zoom:k,duration:250})}}function y(){if(t("zoomOut"),r.map){const R=r.map.getView(),k=R.getConstrainedZoom(R.getZoom()-1);R.animate({zoom:k,duration:250})}}function _(R){console.log("ZoomControl\u6536\u5230\u56FE\u5C42\u53D8\u5316:",R),t("layerChange",R)}function x(R,k){t("setCategoryVisibility",R,k),r.vehicleMovementControl&&r.vehicleMovementControl.setCategoryVisibility&&r.vehicleMovementControl.setCategoryVisibility(R,k)}function S(){o.value=!o.value}function w(){o.value=!1,s.value=!0}function b(){o.value=!1,l.value=!0}function E(){o.value=!1,u.value=!0}function T(){o.value=!1,t("drawTestRoute")}async function C(R){var k,D,G,W,z;try{const V=await Fqr(R);if(V.code===200&&V.data){Sp.success("\u8DEF\u7531\u67E5\u8BE2\u6210\u529F\uFF0C\u5DF2\u5728\u5730\u56FE\u4E0A\u7ED8\u5236");const Y={flightNo:(R==null?void 0:R.objectId)||(R==null?void 0:R.vehicleID)||(R==null?void 0:R.flightNo)||(R==null?void 0:R.objectName)||((k=V==null?void 0:V.data)==null?void 0:k.flightNo)||((D=V==null?void 0:V.data)==null?void 0:D.objectId)||((G=V==null?void 0:V.data)==null?void 0:G.vehicleID)||((W=V==null?void 0:V.data)==null?void 0:W.objectName)||((z=V==null?void 0:V.data)==null?void 0:z.routeCodes)||"QUERY-ROUTE",routeType:R.routeType,routeStatus:V.data.routeStatus||"ACTIVE",routeGeometry:V.data.geoPath||V.data.featureCollection||V.data.geojson||V.data.routeGeometry||V.data.featureLayer,routeCodes:V.data.routeCodes||V.data.codes};r.vehicleMovementControl&&typeof r.vehicleMovementControl.handleAircraftRouteUpdate=="function"?r.vehicleMovementControl.handleAircraftRouteUpdate(Y):window.__injectAircraftRouteUpdate?window.__injectAircraftRouteUpdate(Y):t("routeQueried",Y)}else Sp.warning(V.msg||"\u67E5\u8BE2\u8DEF\u7531\u5931\u8D25")}catch(V){console.error("\u67E5\u8BE2\u8DEF\u7531\u51FA\u9519:",V),Sp.error(V.message||"\u67E5\u8BE2\u8DEF\u7531\u51FA\u9519")}}async function A(R){const k=Number(R==null?void 0:R.vehicleDistance),D=Number(R==null?void 0:R.aircraftDistance),G=Number(R==null?void 0:R.separationDistance),W=Number.isFinite(k)&&k>0,z=Number.isFinite(D)&&D>0,V=Number.isFinite(G)&&G>0;if(!W&&!z&&!V){Sp.error("\u8BF7\u81F3\u5C11\u586B\u5199\u4E00\u9879\u6709\u6548\u914D\u7F6E\uFF08\u5927\u4E8E 0 \u7684\u6570\u5B57\uFF09");return}try{const q=[];if(W||z){const Y={};W&&(Y.vehicleDistance=k),z&&(Y.aircraftDistance=D),q.push(SYr(Y))}V&&q.push(xYr(G)),await Promise.all(q),Sp.success("\u914D\u7F6E\u5DF2\u66F4\u65B0"),l.value=!1}catch(q){Sp.error((q==null?void 0:q.message)||"\u914D\u7F6E\u66F4\u65B0\u5931\u8D25")}}function M(R){const k=a.value;!k||k.contains(R.target)||(o.value=!1)}let I=null;return P0(()=>{document.addEventListener("click",M),r.map&&(d(),I=r.map.getView().on("change:rotation",d))}),i_(()=>{if(document.removeEventListener("click",M),I&&r.map)try{Nde(()=>import("./VehicleMovementControlRefactored.a43df089.js").then(R=>R.bs),["assets/VehicleMovementControlRefactored.a43df089.js","assets/index.bba5ce79.js","assets/index.eab70bbf.css","assets/VehicleMovementControlRefactored.34604a8b.css"]).then(({unByKey:R})=>{R(I)}).catch(R=>{console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",R)})}catch(R){console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",R)}}),Af(()=>r.map,R=>{if(R){if(d(),I)try{Nde(()=>import("./VehicleMovementControlRefactored.a43df089.js").then(k=>k.bs),["assets/VehicleMovementControlRefactored.a43df089.js","assets/index.bba5ce79.js","assets/index.eab70bbf.css","assets/VehicleMovementControlRefactored.34604a8b.css"]).then(({unByKey:k})=>{k(I)}).catch(k=>{console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",k)})}catch(k){console.error("\u6E05\u7406\u4E8B\u4EF6\u76D1\u542C\u5668\u5931\u8D25:",k)}I=R.getView().on("change:rotation",d)}}),e({setLayerVisibility(R,k){return i.value?i.value.setLayerVisibility(R,k):!1},resetRotation:v,getRotation(){return f.value}}),(R,k)=>{const D=nB("el-switch");return qr(),hn("div",{class:"zoom-control",ref_key:"zoomControlRef",ref:a},[fe("div",{class:cl(["settings-control",{active:o.value}]),onClick:NA(S,["stop"])},Hqr,10,$qr),o.value?(qr(),hn("div",{key:0,class:"settings-panel",onClick:k[2]||(k[2]=NA(()=>{},["stop"]))},[fe("div",{class:"settings-item",onClick:w},"\u7F16\u8F91"),fe("div",{class:"settings-item",onClick:b},"\u4FEE\u6539\u9884\u8B66\u8DDD\u79BB"),fe("div",{class:"settings-item",onClick:E},"\u67E5\u8BE2\u8DEF\u7531"),fe("div",{class:"settings-item",onClick:T},"\u7ED8\u5236\u6D4B\u8BD5\u8DEF\u7531"),fe("div",{class:"settings-item settings-switch-item",onClick:k[1]||(k[1]=NA(()=>{},["stop"]))},[jqr,Mf(D,{modelValue:Xo(c),"onUpdate:modelValue":k[0]||(k[0]=G=>Lrt(c)?c.value=G:null),size:"small"},null,8,["modelValue"])])])):Bs("",!0),Mf(eqr,{visible:s.value,onClose:k[3]||(k[3]=G=>s.value=!1)},null,8,["visible"]),Mf(fqr,{visible:l.value,onClose:k[4]||(k[4]=G=>l.value=!1),onConfirm:A},null,8,["visible"]),Mf(kqr,{visible:u.value,onClose:k[5]||(k[5]=G=>u.value=!1),onConfirm:C},null,8,["visible"]),Mf(mYr,{class:"layer-switcher",map:n.map,categories:n.vehicleCategories,onLayerChange:_,onSetCategoryVisibility:x,ref_key:"layerSwitcherRef",ref:i},null,8,["map","categories"]),fe("div",{class:"compass-container",style:XZ({transform:`rotate(${-f.value}deg)`})},[fe("div",{class:"rotate-left",onClick:p,title:"\u5411\u53F3\u65CB\u8F6C90\xB0"}),fe("div",{class:"rotate-right",onClick:g,title:"\u5411\u5DE6\u65CB\u8F6C90\xB0"})],4),fe("div",{class:"zoom-in",onClick:m}),fe("div",{class:"zoom-out",onClick:y})],512)}}},Yqr=rf(Xqr,[["__scopeId","data-v-eabcb3ef"]]);const qqr={class:"map-info"},Zqr=["value"],Kqr=["value"],Jqr={__name:"OpenLayersMapInfo",props:{map:Object},setup(n){const e=n,t=un("XY\u5750\u6807: --"),r=un("WGS84: --");function i(s){if(!e.map){console.warn("\u5730\u56FE\u5B9E\u4F8B\u672A\u4F20\u9012\u5230OpenLayersMapInfo\u7EC4\u4EF6");return}try{const l=[s.offsetX,s.offsetY],u=e.map.getCoordinateFromPixel(l);if(u){t.value=`XY\u5750\u6807: X=${u[0].toFixed(6)}, Y=${u[1].toFixed(6)}`;try{const[h,c]=lA(u,"EPSG:4528","EPSG:4326");r.value=`WGS84: \u7ECF\u5EA6=${h.toFixed(6)}\xB0, \u7EAC\u5EA6=${c.toFixed(6)}\xB0`}catch{r.value="WGS84: \u8F6C\u6362\u9519\u8BEF"}}else t.value="XY\u5750\u6807: --",r.value="WGS84: --"}catch(l){console.error("\u5904\u7406\u9F20\u6807\u79FB\u52A8\u4E8B\u4EF6\u65F6\u51FA\u9519:",l),t.value="XY\u5750\u6807: \u9519\u8BEF",r.value="WGS84: \u9519\u8BEF"}}function a(){if(!e.map)return;const s=e.map.getTargetElement();s&&s.addEventListener("mousemove",i)}function o(){if(!e.map)return;const s=e.map.getTargetElement();s&&s.removeEventListener("mousemove",i)}return P0(a),i_(o),Af(()=>e.map,(s,l)=>{o(),a()}),(s,l)=>(qr(),hn("div",qqr,[fe("input",{type:"text",readonly:"",value:t.value},null,8,Zqr),fe("input",{type:"text",readonly:"",value:r.value},null,8,Kqr)]))}},Qqr=rf(Jqr,[["__scopeId","data-v-c7543916"]]);const VQe=n=>(kd("data-v-40bee71a"),n=n(),Fd(),n),eZr={class:"scale-control"},tZr={class:"scale-bar"},rZr=VQe(()=>fe("div",{class:"tick left"},null,-1)),nZr=VQe(()=>fe("div",{class:"tick right"},null,-1)),iZr=[rZr,nZr],aZr={class:"scale-text"},oZr={__name:"OpenLayersScaleControl",props:{map:Object,position:{type:String,default:"bottomleft"}},setup(n){const e=n,t=un("100 \u7C73"),r=un(80);function i(){if(!e.map)return;const s=e.map.getView();if(!s)return;const l=s.getResolution();if(!l)return;const u=60,h=150,c=Math.round((u+h)/2),f=l*c;function d(g){if(g<=0)return 0;const m=Math.floor(Math.log10(g)),y=g/Math.pow(10,m);let _;return y<1.5?_=1:y<3?_=2:y<7?_=5:_=10,_*Math.pow(10,m)}let v=d(f),p=v/l;if((p<u||p>h)&&(p=Math.max(u,Math.min(h,p)),v=d(p*l)),r.value=Math.round(p),v>=1e3){const g=v/1e3;t.value=Math.round(g*10)/10+" \u516C\u91CC"}else t.value=Math.round(v)+" \u7C73"}function a(){!e.map||(e.map.on("moveend",i),i())}function o(){e.map&&e.map.un("moveend",i)}return Af(()=>e.map,s=>{o(),s&&a()}),P0(()=>{a()}),i_(()=>{o()}),(s,l)=>(qr(),hn("div",eZr,[fe("div",tZr,[fe("div",{class:"scale-line",style:XZ({width:r.value+"px"})},null,4),fe("div",{class:"scale-ticks",style:XZ({width:r.value+"px"})},iZr,4),fe("div",aZr,mn(t.value),1)])]))}},sZr=rf(oZr,[["__scopeId","data-v-40bee71a"]]);const Z_=n=>(kd("data-v-6d6fb11e"),n=n(),Fd(),n),lZr={class:"route-draw-control"},uZr={class:"draw-tools"},hZr=Z_(()=>fe("span",null,"\u7ED8\u5236\u8DEF\u7EBF",-1)),cZr=[hZr],fZr=Z_(()=>fe("span",null,"\u7ED8\u5236\u70B9\u7EBF\u9762",-1)),dZr=[fZr],vZr=Z_(()=>fe("span",null,"\u6E05\u9664",-1)),pZr=[vZr],gZr=Z_(()=>fe("span",null,"\u5BFC\u51FA\u6570\u636E",-1)),yZr=[gZr],mZr=Z_(()=>fe("span",null,"\u5BFC\u5165\u6570\u636E",-1)),_Zr=[mZr],xZr={key:0,class:"polygon-panel"},SZr=Z_(()=>fe("span",null,"\u70B9\u7EBF\u9762\u4FE1\u606F",-1)),wZr={class:"panel-content"},bZr={class:"info-header"},EZr={class:"info-content"},TZr=["onClick"],CZr={key:0,class:"no-data"},AZr={key:1,class:"route-lines-panel"},MZr=Z_(()=>fe("span",null,"\u8DEF\u7EBF\u4FE1\u606F",-1)),IZr={class:"panel-content"},LZr={class:"info-header"},PZr={class:"info-content"},OZr=["onClick"],RZr={key:0,class:"no-data"},DZr={key:2,class:"import-dialog"},NZr={class:"dialog-content"},kZr={class:"dialog-header"},FZr=Z_(()=>fe("h3",null,"\u5BFC\u5165\u6570\u636E",-1)),BZr={class:"dialog-body"},GZr={class:"file-upload"},zZr=Z_(()=>fe("label",{for:"jsonFileInput"},"\u6216\u8005\u4E0A\u4F20JSON\u6587\u4EF6",-1)),UZr={class:"dialog-footer"},VZr={__name:"RouteDrawControl",props:{map:Object},setup(n,{expose:e}){const t=n,r=un(!1),i=un(""),a=un(!1),o=un(!1),s=un([]),l=un([]),u=un(!1),h=un("");let c=null,f=null,d=null;function v(){!t.map||(f=new Hx,d=new sp({source:f,style:new T1({fill:new C1({color:"rgba(0, 150, 255, 0.3)"}),stroke:new jx({color:"#0096ff",width:3}),image:new DW({radius:7,fill:new C1({color:"#0096ff"})})})}),t.map.addLayer(d))}function p(){m(),r.value=!0,i.value="LineString",o.value=!0,c=new zde({source:f,type:"LineString",style:new T1({stroke:new jx({color:"#ff0000",width:3}),image:new DW({radius:5,fill:new C1({color:"#ff0000"})})})}),c.on("drawend",function(T){const C=T.feature,A=C.getGeometry(),M=RF(A),I=A.getCoordinates().length;C.setProperties({type:"route",length:M,vertices:I}),l.value.push({id:Date.now(),feature:C,length:M,vertices:I,extent:A.getExtent()}),r.value=!1}),t.map.addInteraction(c)}function g(){m(),r.value=!0,i.value="Polygon",a.value=!0,c=new zde({source:f,type:"Polygon",style:new T1({fill:new C1({color:"rgba(255, 165, 0, 0.3)"}),stroke:new jx({color:"#ffa500",width:3}),image:new DW({radius:5,fill:new C1({color:"#ffa500"})})})}),c.on("drawend",function(T){const C=T.feature,A=C.getGeometry(),M=Pde(A),I=RF(A.getLinearRing(0)),R=A.getLinearRing(0).getCoordinates().length-1;C.setProperties({type:"polygon",area:M,perimeter:I,vertices:R}),s.value.push({id:Date.now(),feature:C,area:M,perimeter:I,vertices:R,extent:A.getExtent()}),r.value=!1}),t.map.addInteraction(c)}function m(){c&&(t.map.removeInteraction(c),c=null),f&&f.clear(),r.value=!1,s.value=[],l.value=[]}function y(){a.value=!1}function _(){o.value=!1}function x(T){t.map&&T.extent&&t.map.getView().fit(T.extent,{padding:[50,50,50,50],duration:1e3})}function S(T){t.map&&T.extent&&t.map.getView().fit(T.extent,{padding:[50,50,50,50],duration:1e3})}function w(){if(!f||f.getFeatures().length===0){alert("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u6570\u636E\uFF0C\u8BF7\u5148\u7ED8\u5236\u8DEF\u7EBF\u6216\u70B9\u7EBF\u9762");return}const T=new $b,C=f.getFeatures(),A=T.writeFeaturesObject(C,{dataProjection:"EPSG:4326",featureProjection:t.map.getView().getProjection()}),M=JSON.stringify(A,null,2),I=new Blob([M],{type:"application/json"}),R=URL.createObjectURL(I),k=document.createElement("a");k.href=R,k.download="roadTest.json",document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(R),console.log("\u6570\u636E\u5DF2\u5BFC\u51FA\u4E3AGeoJSON\uFF0C\u6587\u4EF6\u540D\uFF1AroadTest.json"),alert("\u6587\u4EF6\u5DF2\u4E0B\u8F7D\u4E3AroadTest.json\uFF0C\u8BF7\u5C06\u5176\u590D\u5236\u5230\u9879\u76EE\u7684public\u76EE\u5F55\u4E0B")}function b(T){const C=T.target.files[0];if(!C)return;const A=new FileReader;A.onload=M=>{h.value=M.target.result},A.readAsText(C)}function E(){if(!h.value){alert("\u8BF7\u8F93\u5165\u6216\u4E0A\u4F20JSON\u6570\u636E");return}try{const T=JSON.parse(h.value),C=new $b;m();const A=C.readFeatures(T,{dataProjection:"EPSG:4326",featureProjection:t.map.getView().getProjection()});if(f.addFeatures(A),A.forEach(M=>{const I=M.getGeometry(),R=M.getProperties();if(I instanceof rB||R.type==="route"){const k=RF(I),D=I.getCoordinates().length;l.value.push({id:Date.now()+Math.random(),feature:M,length:R.length||k,vertices:R.vertices||D,extent:I.getExtent()})}else if(I instanceof cne||R.type==="polygon"){const k=Pde(I),D=RF(I.getLinearRing(0)),G=I.getLinearRing(0).getCoordinates().length-1;s.value.push({id:Date.now()+Math.random(),feature:M,area:R.area||k,perimeter:R.perimeter||D,vertices:R.vertices||G,extent:I.getExtent()})}}),l.value.length>0&&(o.value=!0),s.value.length>0&&(a.value=!0),u.value=!1,h.value="",A.length>0){const M=f.getExtent();t.map.getView().fit(M,{padding:[50,50,50,50],duration:1e3})}console.log("\u6210\u529F\u5BFC\u5165\u6570\u636E\uFF0C\u5171",A.length,"\u4E2A\u7279\u5F81")}catch(T){console.error("\u5BFC\u5165\u6570\u636E\u5931\u8D25:",T),alert("\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5JSON\u683C\u5F0F\u662F\u5426\u6B63\u786E")}}return P0(()=>{t.map&&v()}),Af(()=>t.map,T=>{T&&v()}),i_(()=>{t.map&&(c&&t.map.removeInteraction(c),d&&t.map.removeLayer(d))}),e({startDrawLine:p,startDrawPolygon:g,clearDraw:m,exportRouteData:w,importRouteData:E,showImportDialog:u}),(T,C)=>(qr(),hn("div",lZr,[fe("div",uZr,[fe("div",{class:cl(["tool-button",{active:r.value&&i.value==="LineString"}]),onClick:p},cZr,2),fe("div",{class:cl(["tool-button",{active:r.value&&i.value==="Polygon"}]),onClick:g},dZr,2),fe("div",{class:"tool-button",onClick:m},pZr),fe("div",{class:"tool-button",onClick:w},yZr),fe("div",{class:"tool-button",onClick:C[0]||(C[0]=A=>u.value=!0)},_Zr)]),a.value?(qr(),hn("div",xZr,[fe("div",{class:"panel-header"},[SZr,fe("span",{class:"close-btn",onClick:y},"\xD7")]),fe("div",wZr,[(qr(!0),hn(Dp,null,Np(s.value,(A,M)=>(qr(),hn("div",{class:"info-item",key:M},[fe("div",bZr,"\u70B9\u7EBF\u9762 "+mn(M+1),1),fe("div",EZr,[fe("p",null,"\u9762\u79EF: "+mn(A.area.toFixed(2))+" \u5E73\u65B9\u7C73",1),fe("p",null,"\u5468\u957F: "+mn(A.perimeter.toFixed(2))+" \u7C73",1),fe("p",null,"\u9876\u70B9\u6570: "+mn(A.vertices),1),fe("button",{class:"focus-btn",onClick:I=>x(A)},"\u5B9A\u4F4D",8,TZr)])]))),128)),s.value.length===0?(qr(),hn("div",CZr," \u6682\u65E0\u70B9\u7EBF\u9762\u6570\u636E\uFF0C\u8BF7\u5148\u7ED8\u5236\u70B9\u7EBF\u9762 ")):Bs("",!0)])])):Bs("",!0),o.value?(qr(),hn("div",AZr,[fe("div",{class:"panel-header"},[MZr,fe("span",{class:"close-btn",onClick:_},"\xD7")]),fe("div",IZr,[(qr(!0),hn(Dp,null,Np(l.value,(A,M)=>(qr(),hn("div",{class:"info-item",key:M},[fe("div",LZr,"\u8DEF\u7EBF "+mn(M+1),1),fe("div",PZr,[fe("p",null,"\u957F\u5EA6: "+mn(A.length.toFixed(2))+" \u7C73",1),fe("p",null,"\u9876\u70B9\u6570: "+mn(A.vertices),1),fe("button",{class:"focus-btn",onClick:I=>S(A)},"\u5B9A\u4F4D",8,OZr)])]))),128)),l.value.length===0?(qr(),hn("div",RZr," \u6682\u65E0\u8DEF\u7EBF\u6570\u636E\uFF0C\u8BF7\u5148\u7ED8\u5236\u8DEF\u7EBF ")):Bs("",!0)])])):Bs("",!0),u.value?(qr(),hn("div",DZr,[fe("div",NZr,[fe("div",kZr,[FZr,fe("span",{class:"close-btn",onClick:C[1]||(C[1]=A=>u.value=!1)},"\xD7")]),fe("div",BZr,[lu(fe("textarea",{"onUpdate:modelValue":C[2]||(C[2]=A=>h.value=A),placeholder:"\u8BF7\u7C98\u8D34JSON\u6570\u636E"},null,512),[[qg,h.value]]),fe("div",GZr,[zZr,fe("input",{type:"file",id:"jsonFileInput",accept:".json",onChange:b},null,32)])]),fe("div",UZr,[fe("button",{onClick:C[3]||(C[3]=A=>u.value=!1)},"\u53D6\u6D88"),fe("button",{onClick:E,class:"primary-btn"},"\u5BFC\u5165")])])])):Bs("",!0)]))}},$Zr=rf(VZr,[["__scopeId","data-v-6d6fb11e"]]);const WZr={class:"map-container"},HZr={class:"map-content-wrapper"},jZr={__name:"OpenLayersMap",props:{vehicleCategories:{type:Object,default:()=>({})},vehicleMovementControl:{type:Object,default:null}},emits:["setCategoryVisibility","drawTestRoute"],setup(n,{expose:e,emit:t}){function r(b,E){t("setCategoryVisibility",b,E)}Ode.defs("EPSG:4528","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"),Ert(Ode);const i=Trt("EPSG:4528"),a=[405027047458807e-7,40192710092735e-7,40514081829214096e-9,40309391342735e-7],o=[40512494329214066e-9,4026228757190162e-9],s=[1322.9166666666665,529.1666666666666,264.5833333333333,132.29166666666666,66.14583333333333,26.45833333333333,13.229166666666664,6.614583333333332,2.645833333333333,1.3229166666666665,.5291666666666666,.2645833333333333,.13229166666666664];function l(b){const E=[];for(let T=0;T<b.length-1;T++){const C=b[T],A=b[T+1];E.push(C);const M=Math.sqrt(C*A);M!==C&&M!==A&&E.push(M)}return E.push(b[b.length-1]),E}const u=l(s),h=-1.26,c=un(null),f=un(null),d=15,v=u.length-1,p=12;P0(()=>{let b=null;try{const M=localStorage.getItem("defaultMapView");M&&(b=JSON.parse(M),console.log("\u52A0\u8F7D\u4FDD\u5B58\u7684\u9ED8\u8BA4\u89C6\u56FE:",b))}catch(M){console.error("\u52A0\u8F7D\u4FDD\u5B58\u7684\u89C6\u56FE\u51FA\u9519:",M)}const E=new hat({extent:a,resolutions:s,tileSize:256,origin:[a[0],a[3]]}),T=new Ay({projection:i,center:b?b.center:o,zoom:b?b.zoom:p,minZoom:d,maxZoom:v,resolutions:u,rotation:b?b.rotation:h});f.value=new kit({target:c.value,controls:[],loadTilesWhileAnimating:!0,interactions:JPe({altShiftDragRotate:!1,pinchRotate:!1,mouseWheelZoom:!1,doubleClickZoom:!1,shiftDragZoom:!1}),layers:[new Wde({source:new Bp({url:"http://10.96.3.10:8090/iserver/services/map-QDJC_DT-GX3/rest/maps/QDJC2DZT",projection:"EPSG:4528",tileGrid:E,wrapX:!1,attributions:""}),transition:0})],view:T}),console.log("\u5730\u56FE\u5B9E\u4F8B\u5DF2\u521B\u5EFA:",f.value),f.value.addInteraction(new qPe({constrainResolution:!0}));const C=new Wde({source:new Bp({url:"http://10.96.3.10:8090/iserver/services/map-QDJC_DT-GX3/rest/maps/QDJC2DZT",projection:"EPSG:4528",tileGrid:E,wrapX:!1})}),A=new znt({className:"ol-overviewmap custom-overview",layers:[C],collapsed:!1,collapsible:!1,rotateWithView:!0,tipLabel:"",view:new Ay({projection:i,center:o,zoom:10,minZoom:3,maxZoom:15,resolutions:s})});f.value.addControl(A),setTimeout(()=>{const M=document.querySelector(".custom-overview");M?(M.style.display="block",console.log("\u9E70\u773C\u56FE\u5DF2\u6DFB\u52A0\u5230\u5730\u56FE")):console.warn("\u672A\u627E\u5230\u9E70\u773C\u56FE\u5143\u7D20")},500),setTimeout(()=>{const M=f.value.getView();b||M.fit(a,{size:f.value.getSize(),padding:[50,50,50,350],maxZoom:p,constrainResolution:!1}),M.animate({rotation:b?b.rotation:h,duration:500}),f.value.updateSize()},200),T.on("change:rotation",function(){})}),i_(()=>{f.value&&f.value.setTarget(null)});function g(){}function m(){}function y(){f.value&&(f.value.getView().setRotation(h),f.value.getView().setCenter(o),f.value.getView().setZoom(p))}function _(){if(f.value){try{const b=localStorage.getItem("defaultMapView");if(b){const E=JSON.parse(b);f.value.getView().setCenter(E.center),f.value.getView().setZoom(E.zoom),f.value.getView().setRotation(E.rotation);return}}catch(b){console.error("\u52A0\u8F7D\u4FDD\u5B58\u7684\u89C6\u56FE\u51FA\u9519:",b)}f.value.getView().setRotation(h),f.value.getView().setCenter(o),f.value.getView().setZoom(p)}}const x={center:o,rotation:h,initialZoom:p,bounds:{left:a[0],bottom:a[1],right:a[2],top:a[3]}};function S(b){console.log("\u5207\u6362\u56FE\u5C42\u7C7B\u578B:",b)}function w(){if(f.value){const b=f.value.getView(),E=b.getCenter(),T=b.getZoom(),C=b.getRotation();return console.log("\u5F53\u524D\u5730\u56FE\u72B6\u6001:"),console.log("\u4E2D\u5FC3\u70B9:",E),console.log("\u7F29\u653E\u7EA7\u522B:",T),console.log("\u65CB\u8F6C\u89D2\u5EA6:",C),{center:E,zoom:T,rotation:C}}return null}return e({zoomIn:g,zoomOut:m,compass:y,resetView:_,getCurrentMapState:w,map:f}),(b,E)=>(qr(),hn("div",WZr,[fe("div",HZr,[fe("div",{ref_key:"mapContainer",ref:c,id:"map"},null,512)]),Mf(Yqr,{map:f.value,resetView:_,vehicleCategories:n.vehicleCategories,vehicleMovementControl:n.vehicleMovementControl,onCompass:y,onZoomIn:g,onZoomOut:m,onLayerChange:S,onSetCategoryVisibility:r,onDrawTestRoute:E[0]||(E[0]=T=>b.$emit("drawTestRoute"))},null,8,["map","vehicleCategories","vehicleMovementControl"]),Mf(Qqr,{map:f.value,mapConfig:x},null,8,["map"]),Mf(sZr,{map:f.value},null,8,["map"]),f.value?(qr(),uA($Zr,{key:0,map:f.value,ref:"routeDrawControlRef"},null,8,["map"])):Bs("",!0),Prt(b.$slots,"default",{},void 0,!0)]))}},XZr=rf(jZr,[["__scopeId","data-v-853f4944"]]),YZr="/airport/assets/online_car.75a67313.png",qZr="/airport/assets/offline_car.b6d879a9.png",ZZr="/airport/assets/fault_car.d14b763b.png";const CL=n=>(kd("data-v-f04383d5"),n=n(),Fd(),n),KZr={class:"car-alarm-container"},JZr={class:"car-item"},QZr=CL(()=>fe("img",{src:YZr,class:"car-icon"},null,-1)),eKr={class:"car-text"},tKr={class:"car-count"},rKr=CL(()=>fe("span",{class:"unit"},"\u8F86",-1)),nKr=CL(()=>fe("div",{class:"car-label"},"\u5728\u7EBF\u8F66\u8F86",-1)),iKr={class:"car-item"},aKr=CL(()=>fe("img",{src:qZr,class:"car-icon"},null,-1)),oKr={class:"car-text"},sKr={class:"car-count"},lKr=CL(()=>fe("span",{class:"unit"},"\u8F86",-1)),uKr=CL(()=>fe("div",{class:"car-label"},"\u79BB\u7EBF\u8F66\u8F86",-1)),hKr=vne('<div class="car-item" data-v-f04383d5><img src="'+ZZr+'" class="car-icon" data-v-f04383d5><div class="car-text" data-v-f04383d5><div class="car-count" data-v-f04383d5> 0<span class="unit" data-v-f04383d5>\u8F86</span></div><div class="car-label" data-v-f04383d5>\u6545\u969C\u8F66\u8F86</div></div></div>',1),cKr={__name:"carClarm",props:{onlineCountProp:{type:Number,default:206},offlineCountProp:{type:Number,default:25},faultCountProp:{type:Number,default:27}},setup(n,{expose:e}){const t=n,r=un(t.onlineCountProp),i=un(t.offlineCountProp),a=un(t.faultCountProp);e({updateCounts:o});function o(l,u,h){r.value=l!==void 0?l:r.value,i.value=u!==void 0?u:i.value,a.value=h!==void 0?h:a.value}P0(()=>{console.log("\u8F66\u8F86\u62A5\u8B66\u4FE1\u606F\u7EC4\u4EF6\u5DF2\u52A0\u8F7D"),s()});async function s(){var l,u,h;try{const c=await PS({url:"/api/vehicle-manager/vehicles/summary",method:"get"}),f=c&&c.data!==void 0?c.data:c||{};o(Number(f.onlineCount)||0,Number(f.offlineCount)||0,Number(f.faultCount)||0)}catch{o((l=r.value)!=null?l:0,(u=i.value)!=null?u:0,(h=a.value)!=null?h:0)}}return(l,u)=>(qr(),hn("div",KZr,[fe("div",JZr,[QZr,fe("div",eKr,[fe("div",tKr,[a_(mn(r.value),1),rKr]),nKr])]),fe("div",iKr,[aKr,fe("div",oKr,[fe("div",sKr,[a_(mn(i.value),1),lKr]),uKr])]),hKr]))}},fKr=rf(cKr,[["__scopeId","data-v-f04383d5"]]),$Qe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAARCAYAAAC8XK78AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMGSURBVHgBxVXLSiNBFL2VRI3PtG8UxPaBS+1tFjI9G7eapQuxAyq6i4I7JRkEwZXJF8T5ggm4mpUJfkD0C6YHBEEEexTfj55zmkQiQ2KQzMyFS3WqbtU5955bFZH/bKrcwtra2o9gMDjo9/t/4Wdqa2srIX/B/OUWwuGw3tnZGe7r6wuChDk5OTkD/57L5RypofnKLby8vHy5uLiwn5+fpaOjw+3t7TXa2toOdnZ2ZuRfEEgmk47rutGzszNRsJaWFkE19MbGxm+pVCohNTL1XsDm5uZuT09PrLu7WyCF1NXVuZeXl3J1dXXs8/kiKysrtlRp+Xxex36tvr5exsbGjqoiEI/HNRQgPzIyMtjU1KRIgERub28VSNgIicKy5fYfHh6a2DMNUKuhoUFDBQXEKbGNcz+/S6BAwmxubj4YHR2VAgEVCAQEEgklYr/Mz88nivH7+/smAKdxi6zW1tYQiaN/BHPeXibA3kICyaoI0La3t3dxK2L9/f1CcHqRDJpVbm5ubMzZyNIIhUIaXABMUMa6xT0F8i7iFaoYU7Ozs0mU4hM2JtPp9NdKJHAD8sPDwwTwZChWgo6yunCFc14JEqg0hv709ESyrEAGskZ8KN+ErutGe3v73uLiYnp5eVkvRwCxkdPTUwcjL4ailhg8cByuWOKSOe/2UKa7uzthlU5OTpzz8/Ps4+OjSXCeGUBMFIfmh4aGtOvra6uAFS3RX8NgsJFwqIFv7f7+XqCvW0qCDuMUibqO46iHhwd+O6jCHshlsHY8Pj7+5iHzds3NzVk4aIJBLFmha02WGc1nQHtBM7nUFV2siqVlDzBznsHSMlM6gLKYz2A6NzU1dSQV7LUJLcvSsSmNV88cGBggIJtMoKkHUtDcm+OIzDwt0UjU00YCGZDOAjwXiUSqfq7f3IKlpaU4OjeBRpOurq7X7iUgtFTQzgOFsw+OQI5ZZhYWFn7KB+2PaxiLxXRkFEfpLd5daC0E5sNBMIJSy9XV1Zr8KVV8B9bX1w0QCAHU3tjY+HCWlew32VsyAm4h+D0AAAAASUVORK5CYII=",dKr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBlVELEcIwDO04BNTBigMcMAebg80Bk4CD4WAWcAAOwAFzgISSN97uclyzz7vLLenyXtM85wzEGC8Sb4kncrcFilxKnJi3WwQ+IKq6gEiqd29oeIlBSJ18j6xDqjEzJogkHCRyClwzwdoJJrwwiTNuNxF/yCXuUWEt2U8C6ixsEejhfUIUVvZL5IKNQRG9mgL2Fpqz+9MoJR6y7IEimGQk4UzyG3tMgdF/lQfm0z4Gt/CEMzav6gZnqoYr9ZyA5zvrxL9W72dOpKGNPZdaMYdw5daAGx/t5K2ddfMXZoj7fWN1zB8AAAAASUVORK5CYII=";const TT=n=>(kd("data-v-daf5595e"),n=n(),Fd(),n),vKr={class:"car-detail-container"},pKr=TT(()=>fe("div",{class:"header"},[fe("img",{src:$Qe,alt:"list_bg",class:"header-title-icon"}),fe("span",{class:"header-title"},"\u8F66\u8F86\u8BE6\u60C5")],-1)),gKr={class:"back-button"},yKr={class:"track-list"},mKr={class:"section base-info"},_Kr={class:"car-id"},xKr=TT(()=>fe("div",{class:"video-tabs"},[fe("span",{class:"tab active"},"\u4EFB\u52A1\u4E2D"),fe("span",{class:"tab active"},"\u5728\u7EBF")],-1)),SKr={class:"info-row"},wKr={class:"info-row"},bKr={class:"section task-info"},EKr=TT(()=>fe("div",{class:"section-title"},"\u4EFB\u52A1\u4FE1\u606F",-1)),TKr={class:"info-row"},CKr={class:"info-row"},AKr={class:"info-row"},MKr={class:"section battery-info"},IKr=TT(()=>fe("div",{class:"section-title"},[a_(" \u7535\u6C60\u76D1\u63A7 "),fe("span",{class:"status-normal"},"\u6B63\u5E38")],-1)),LKr={class:"info-row1"},PKr=TT(()=>fe("div",{class:"battery-left"},[fe("img",{src:dKr,alt:"battery",class:"battery-icon"}),fe("p",{class:"battery-content"},"\u7535\u6C60\u6E29\u5EA6")],-1)),OKr={class:"section video-info"},RKr=vne('<div class="section-title" data-v-daf5595e> 360\xB0\u76D1\u63A7\u72B6\u6001 <span class="video-tabs" data-v-daf5595e><span class="tab active" data-v-daf5595e>\u524D\u89C6</span><span class="tab" data-v-daf5595e>\u5DE6\u524D</span><span class="tab" data-v-daf5595e>\u53F3\u524D</span><span class="tab" data-v-daf5595e>\u540E\u89C6</span></span></div>',1),DKr={class:"video-preview"},NKr=["src"],kKr={class:"section track-info"},FKr={class:"section-title"},BKr=TT(()=>fe("div",{class:"track-search"},[fe("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22"}),fe("span",{class:"search-icon"})],-1)),GKr={class:"track-timeline"},zKr=TT(()=>fe("div",{class:"timeline-line"},null,-1)),UKr={class:"track-content"},VKr={class:"track-time"},$Kr={class:"track-desc"},WKr={class:"track-detail"},HKr={__name:"CarDetail",props:{car:{type:Object,required:!0}},setup(n){const e=n,t=[{time:"2024\u5E746\u670816\u65E5 18:12:09\u20142024\u5E746\u670816\u65E5 20:12:09",desc:"\u8D77\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8 \u7EC8\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8",distance:"20km",taskId:"001"},{time:"2024\u5E746\u670815\u65E5 18:12:09\u20142024\u5E746\u670815\u65E5 20:12:09",desc:"\u8D77\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8 \u7EC8\u70B9\uFF1A\u673A\u573A\u53D1\u5C55\u516C\u53F8",distance:"20km",taskId:"002"}];function r(a){const o=parseFloat(a);return isNaN(o)?"temp-normal":o>=45?"temp-danger":o>=38?"temp-warning":"temp-normal"}const i=ul(()=>{var o;const a=(o=e.car)==null?void 0:o.trackList;return Array.isArray(a)?a.length:t.length});return(a,o)=>{var h,c;const s=nB("ArrowLeft"),l=nB("el-icon"),u=nB("el-button");return qr(),hn("div",vKr,[pKr,fe("div",gKr,[Mf(u,{type:"primary",plain:"",class:"btn custom-back-btn",size:"small",onClick:o[0]||(o[0]=f=>a.$emit("back"))},{default:kde(()=>[Mf(l,{class:"back-icon"},{default:kde(()=>[Mf(s)]),_:1}),a_(" \u8FD4\u56DE\u8F66\u8F86\u5217\u8868 ")]),_:1})]),fe("div",yKr,[fe("div",mKr,[fe("div",_Kr,[a_(mn(n.car.id)+"\uFF08"+mn(n.car.type)+"\uFF09 ",1),xKr]),fe("div",SKr,[fe("div",null,"\u54C1\u724C\uFF1A"+mn(n.car.brand||"\u9A71\u9E1F\u8F66"),1),fe("div",null,"\u8D1F\u8D23\u4EBA\uFF1A"+mn(n.car.manager),1)]),fe("div",wKr,[fe("div",null,"\u6240\u5C5E\u5355\u4F4D\uFF1A"+mn(n.car.company||"\u673A\u573A\u53D1\u5C55\u516C\u53F8"),1),fe("div",null,"\u8054\u7CFB\u65B9\u5F0F\uFF1A"+mn(n.car.phone||"18661190988"),1)])]),fe("div",bKr,[EKr,fe("div",TKr,[fe("div",null,"\u5F00\u59CB\u65F6\u95F4\uFF1A"+mn(n.car.taskStart||"5\u67081\u65E512:00"),1),fe("div",null,"\u7ED3\u675F\u65F6\u95F4\uFF1A"+mn(n.car.taskEnd||"5\u67081\u65E512:30"),1)]),fe("div",CKr,[fe("div",null,"\u8D77\u70B9\uFF1A"+mn(n.car.taskStartPoint||"A\u533A\u5FEB\u51B2\u6869"),1),fe("div",null,"\u7EC8\u70B9\uFF1A"+mn(n.car.taskEndPoint||"B\u533A\u5FEB\u51B2\u6869"),1)]),fe("div",AKr,[fe("div",null,"\u884C\u9A76\u901F\u5EA6\uFF1A"+mn(n.car.speed),1),fe("div",null,"\u884C\u9A76\u91CC\u7A0B\uFF1A"+mn(n.car.distance),1)])]),fe("div",MKr,[IKr,fe("div",LKr,[PKr,fe("p",{class:cl(["battery-temp",r((h=n.car.batteryTemp)!=null?h:"--")])},mn((c=n.car.batteryTemp)!=null?c:"--"),3)])]),fe("div",OKr,[RKr,fe("div",DKr,[fe("img",{src:n.car.videoImg,alt:"360\u76D1\u63A7"},null,8,NKr)])]),fe("div",kKr,[fe("div",FKr,"\u5386\u53F2\u8F68\u8FF9\uFF08"+mn(Xo(i))+"\uFF09",1),BKr,(qr(!0),hn(Dp,null,Np(n.car.trackList||t,(f,d)=>(qr(),hn("div",{class:"track-item",key:d},[fe("div",GKr,[fe("div",{class:cl(["timeline-dot",{active:d===0}])},null,2),zKr]),fe("div",UKr,[fe("div",VKr,mn(f.time),1),fe("div",$Kr,mn(f.desc),1),fe("div",WKr,[fe("span",null,"\u884C\u9A76\u91CC\u7A0B\uFF1A"+mn(f.distance),1),fe("span",null,"\u4EFB\u52A1\u7F16\u53F7\uFF1A"+mn(f.taskId),1)])])]))),128))])])])}}},jKr=rf(HKr,[["__scopeId","data-v-daf5595e"]]);const XKr=n=>(kd("data-v-6aa232ba"),n=n(),Fd(),n),YKr={class:"filter-dropdown"},qKr=XKr(()=>fe("span",{class:"arrow-down"},null,-1)),ZKr={class:"dropdown-menu"},KKr=["onClick"],JKr={__name:"FilterDropdown",props:{options:{type:Array,required:!0,default:()=>[]},modelValue:{type:[String,Number,Object],default:""},placeholder:{type:String,default:"\u5168\u90E8"}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,r=un(!1),i=un(t.placeholder);P0(()=>{if(t.modelValue){const l=t.options.find(u=>u.value===t.modelValue);l&&(i.value=l.label)}document.addEventListener("click",s)}),Ort(()=>{document.removeEventListener("click",s)}),Af(()=>t.modelValue,l=>{if(l){const u=t.options.find(h=>h.value===l);u&&(i.value=u.label)}else i.value=t.placeholder});function a(l){l.stopPropagation(),r.value=!r.value}function o(l){i.value=l.label,r.value=!1,e("update:modelValue",l.value),e("change",l)}function s(l){l.target.closest(".filter-dropdown")||(r.value=!1)}return(l,u)=>(qr(),hn("div",YKr,[fe("div",{class:"selected-filter",onClick:a},[a_(mn(i.value)+" ",1),qKr]),lu(fe("div",ZKr,[(qr(!0),hn(Dp,null,Np(n.options,(h,c)=>(qr(),hn("div",{key:c,class:"menu-item",onClick:f=>o(h)},mn(h.label),9,KKr))),128))],512),[[DPe,r.value]])]))}},_Pe=rf(JKr,[["__scopeId","data-v-6aa232ba"]]);const AL=n=>(kd("data-v-aebeef26"),n=n(),Fd(),n),QKr={class:"event-list-container"},eJr={key:1,class:"event-list-header"},tJr={class:"header-title"},rJr=AL(()=>fe("img",{src:$Qe,alt:"list_bg",class:"header-title-icon"},null,-1)),nJr={class:"header-title-text"},iJr={class:"header-actions"},aJr={class:"search-box"},oJr=["onKeyup"],sJr={class:"event-list-content"},lJr=["onClick"],uJr={class:"car-main-info"},hJr={class:"car-id"},cJr={class:"car-actions"},fJr={class:"car-details"},dJr={class:"detail-row"},vJr={class:"detail-item"},pJr=AL(()=>fe("span",{class:"detail-label"},"\u884C\u9A76\u901F\u5EA6:",-1)),gJr={class:"detail-value"},yJr={class:"detail-item"},mJr=AL(()=>fe("span",{class:"detail-label"},"\u884C\u9A76\u8DDD\u79BB:",-1)),_Jr={class:"detail-value"},xJr={class:"detail-row"},SJr={class:"detail-item"},wJr=AL(()=>fe("span",{class:"detail-label"},"\u4EFB\u52A1\u8FDB\u5EA6:",-1)),bJr={class:"detail-value"},EJr={class:"detail-item"},TJr=AL(()=>fe("span",{class:"detail-label"},"\u8D1F\u8D23\u4EBA:",-1)),CJr={class:"detail-value"},AJr={class:"car-owner"},MJr=AL(()=>fe("span",{class:"owner-icon"},null,-1)),IJr={class:"owner-name"},LJr={class:"event-list-pagination"},PJr=["onClick"],OJr={__name:"eventlist",setup(n,{expose:e}){const t=[{label:"\u5168\u90E8",value:"all"},{label:"\u5728\u7EBF",value:"online"},{label:"\u79BB\u7EBF",value:"offline"},{label:"\u6545\u969C",value:"fault"}],r=un([{label:"\u5168\u90E8",value:"all"}]),i=un("all"),a=un("all"),o=un(""),s=un(1),l=un(8),u=un([]),h=OPe();function c(D,G){return D==="fault"||G?"fault":D==="offline"?"offline":(D==="online","online")}function f(D){return D!=null&&D.isFault?"repair":D!=null&&D.currentTask?"task":"idle"}function d(D){var G,W,z,V,q;return{id:D==null?void 0:D.vehicleId,type:(D==null?void 0:D.vehicleType)||"",status:c(D==null?void 0:D.status,D==null?void 0:D.isFault),taskStatus:f(D),speed:(G=D==null?void 0:D.speed)!=null?G:"",distance:(W=D==null?void 0:D.distance)!=null?W:"",progress:(z=D==null?void 0:D.progress)!=null?z:0,manager:(V=D==null?void 0:D.manager)!=null?V:"",owner:(q=D==null?void 0:D.organization)!=null?q:""}}function v(D){const G=h.getVehicleTypeOverride(D==null?void 0:D.id),W=String(G||"").toUpperCase();return W==="UNMANNED_VEHICLE"?"\u65E0\u4EBA\u8F66":W==="SPECIAL_VEHICLE"?"\u7279\u52E4\u8F66":W==="AIRCRAFT"?"\u822A\u7A7A\u5668":G||(D==null?void 0:D.type)||""}function p(D,G){return{id:D,type:G||"",status:"online",taskStatus:"idle",speed:"",distance:"",progress:0,manager:"",owner:""}}const g=ul(()=>{const D=Array.isArray(u.value)?u.value:[],G=new Set(D.map(q=>q==null?void 0:q.id).filter(Boolean)),W=h.vehicleTypeOverrides||{},z=h.enabledVehicleIds||{},V=[];return Object.keys(W).forEach(q=>{if(!q||G.has(q))return;const Y=String(W[q]||"").toUpperCase();Y!=="UNMANNED_VEHICLE"&&Y!=="SPECIAL_VEHICLE"||z[q]===!0&&V.push(p(q,W[q]))}),[...D,...V]});async function m(D={pageNum:1,pageSize:100}){var G;try{const W=await PS({url:"/api/vehicle-manager/vehicles",method:"get",params:D}),z=W&&W.data!==void 0?W.data:W||{},V=(z==null?void 0:z.rows)||((G=z==null?void 0:z.data)==null?void 0:G.rows)||[];u.value=V.map(d)}catch{u.value=[]}}const y=ul(()=>_.value.length),_=ul(()=>g.value.filter(D=>{if(!h.isVehicleEnabled(D==null?void 0:D.id)||i.value!=="all"&&D.status!==i.value||a.value!=="all"&&v(D)!==a.value)return!1;if(o.value.trim()){const G=o.value.toLowerCase().trim();if(![D.id,v(D),D.manager,D.owner,A(D.status),M(D.taskStatus)].join(" ").toLowerCase().includes(G))return!1}return!0})),x=ul(()=>{const D=_.value.length,G=l.value||1;return Math.max(1,Math.ceil(D/G))}),S=ul(()=>{const D=(s.value-1)*l.value,G=D+l.value;return _.value.slice(D,G)});function w(D){if(typeof D!="number")return;const G=x.value;D<1?s.value=1:D>G?s.value=G:s.value=D}function b(){s.value=1,console.log("\u7B5B\u9009\u6761\u4EF6\u53D8\u66F4:",{status:i.value,type:a.value,search:o.value})}function E(){s.value=1,console.log("\u641C\u7D22\u5173\u952E\u5B57:",o.value)}function T(){o.value="",s.value=1,console.log("\u6E05\u7A7A\u641C\u7D22\u5173\u952E\u5B57")}function C(){Nrt({level:2}).then(D=>{if(D.rows&&Array.isArray(D.rows)){const W=D.rows.filter(z=>z.level===2).map(z=>({label:z.displayNameCn,value:z.displayNameCn}));r.value=[{label:"\u5168\u90E8",value:"all"},...W],console.log("\u8F66\u8F86\u7C7B\u578B\u5217\u8868\u5DF2\u66F4\u65B0:",r.value)}}).catch(D=>{console.error("\u83B7\u53D6\u8F66\u8F86\u7C7B\u578B\u5217\u8868\u5931\u8D25:",D)})}function A(D){switch(D){case"online":return"\u5728\u7EBF";case"offline":return"\u79BB\u7EBF";case"fault":return"\u6545\u969C";default:return"\u672A\u77E5"}}function M(D){switch(D){case"task":return"\u4EFB\u52A1\u4E2D";case"idle":return"\u95F2\u7F6E\u4E2D";case"repair":return"\u7EF4\u4FEE\u4E2D";default:return"\u672A\u77E5"}}e({updateCarList:I});function I(D){D&&Array.isArray(D)&&(u.value=D)}const R=un(null);async function k(D){var G,W,z,V,q,Y,le,j,Q,ie,oe;if(!k.inFlight){k.inFlight=!0;try{const se=await PS({url:`/api/vehicle-manager/vehicles/${encodeURIComponent(D.id)}`,method:"get"}),me=se&&se.data!==void 0?se.data:se||{},Ce={...D,id:(G=me==null?void 0:me.vehicleId)!=null?G:D.id,type:(W=me==null?void 0:me.vehicleType)!=null?W:D.type,brand:(z=me==null?void 0:me.brand)!=null?z:D.brand,manager:(V=me==null?void 0:me.manager)!=null?V:D.manager,company:(q=me==null?void 0:me.organization)!=null?q:D.company,phone:(Y=me==null?void 0:me.contactPhone)!=null?Y:D.phone,speed:(le=me==null?void 0:me.speed)!=null?le:D.speed,distance:(j=me==null?void 0:me.distance)!=null?j:D.distance,batteryTemp:(Q=me==null?void 0:me.batteryTemp)!=null?Q:D.batteryTemp};R.value=Ce;try{const Le=await krt(Ce.id),re=Le&&Le.data!==void 0?Le.data:Le||{};let yt=[];const je=[re==null?void 0:re.data,re==null?void 0:re.rows,re==null?void 0:re.list,re==null?void 0:re.tasks,re];for(const qe of je)if(Array.isArray(qe)){yt=qe;break}(!yt||yt.length===0)&&Array.isArray(re==null?void 0:re.waypoints)&&(yt=[{id:Ce.id,vehicleId:Ce.id,waypoints:re.waypoints,timestamp:re.timestamp}]);const st=qe=>String(qe).padStart(2,"0"),Nt=qe=>{const ur=new Date(qe);return`${ur.getFullYear()}\u5E74${ur.getMonth()+1}\u6708${ur.getDate()}\u65E5 ${st(ur.getHours())}:${st(ur.getMinutes())}:${st(ur.getSeconds())}`},Zt=(yt||[]).map((qe,ur)=>{var zt,mt,wt,pt,ar;const ft=(Array.isArray(qe==null?void 0:qe.points)?qe.points:Array.isArray(qe==null?void 0:qe.waypoints)?qe.waypoints:Array.isArray((zt=qe==null?void 0:qe.path)==null?void 0:zt.points)?qe.path.points:[]).map((kt,Dr)=>{var Jn,Rn,hi,yn,Oi,oi,Gi,ws,Sl,Os;const Sr=(hi=(Rn=(Jn=kt==null?void 0:kt.timestamp)!=null?Jn:kt==null?void 0:kt.time)!=null?Rn:kt==null?void 0:kt.ts)!=null?hi:Date.now()+Dr*1e3,jr=(Gi=(oi=(Oi=(yn=kt==null?void 0:kt.longitude)!=null?yn:kt==null?void 0:kt.lng)!=null?Oi:kt==null?void 0:kt.lon)!=null?oi:kt==null?void 0:kt.y)!=null?Gi:0,pn=(Os=(Sl=(ws=kt==null?void 0:kt.latitude)!=null?ws:kt==null?void 0:kt.lat)!=null?Sl:kt==null?void 0:kt.x)!=null?Os:0;return{timestamp:typeof Sr=="string"?Sr:new Date(Sr).toISOString(),longitude:Number(jr)||0,latitude:Number(pn)||0}});if(ft.length===0)return{time:"",desc:"",distance:"",taskId:String((wt=(mt=qe==null?void 0:qe.missionId)!=null?mt:qe==null?void 0:qe.id)!=null?wt:ur+1)};const Oe=ft[0],J=ft[ft.length-1]||Oe;let We=0;for(let kt=1;kt<ft.length;kt++){const Dr=ft[kt-1],Sr=ft[kt],jr=Math.sqrt(Math.pow(Sr.longitude-Dr.longitude,2)+Math.pow(Sr.latitude-Dr.latitude,2))*111;We+=jr}const Tt=Nt(Oe.timestamp),Qe=Nt(J.timestamp);return{time:`${Tt}\u2014${Qe}`,desc:`\u8D77\u70B9\uFF1A\u7ECF\u5EA6${Oe.longitude},\u7EAC\u5EA6${Oe.latitude} \u7EC8\u70B9\uFF1A\u7ECF\u5EA6${J.longitude},\u7EAC\u5EA6${J.latitude}`,distance:`${We.toFixed(2)}km`,taskId:String((ar=(pt=qe==null?void 0:qe.missionId)!=null?pt:qe==null?void 0:qe.id)!=null?ar:ur+1)}});R.value={...R.value,trackList:Zt}}catch{R.value={...R.value,trackList:[]}}try{const Le=await Frt(Ce.id),re=Le&&Le.data!==void 0?Le.data:Le||{},yt=re&&re.data!==void 0?re.data:re||{},je=(oe=(ie=yt==null?void 0:yt.batteryStatus)==null?void 0:ie.mainBattery)==null?void 0:oe.temperature,st=typeof je=="number"?`${je}\u2103`:"--";R.value={...R.value,batteryTemp:st}}catch{R.value={...R.value,batteryTemp:"--"}}}catch{R.value=D}k.inFlight=!1}}return P0(()=>{console.log("\u8F66\u8F86\u5217\u8868\u7EC4\u4EF6\u5DF2\u52A0\u8F7D"),C(),m()}),(D,G)=>(qr(),hn("div",null,[fe("div",QKr,[R.value?(qr(),uA(jKr,{key:0,car:R.value,onBack:G[0]||(G[0]=W=>R.value=null)},null,8,["car"])):(qr(),hn("div",eJr,[fe("div",tJr,[rJr,fe("div",nJr,"\u8F66\u8F86\u5217\u8868 ("+mn(Xo(y))+")",1)]),fe("div",iJr,[Mf(_Pe,{modelValue:i.value,"onUpdate:modelValue":G[1]||(G[1]=W=>i.value=W),options:t,onChange:b},null,8,["modelValue"]),Mf(_Pe,{modelValue:a.value,"onUpdate:modelValue":G[2]||(G[2]=W=>a.value=W),options:r.value,onChange:b},null,8,["modelValue","options"]),fe("div",aJr,[lu(fe("input",{type:"text",placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22","onUpdate:modelValue":G[3]||(G[3]=W=>o.value=W),onInput:E,onKeyup:RPe(E,["enter"])},null,40,oJr),[[qg,o.value]]),o.value?Bs("",!0):(qr(),hn("div",{key:0,class:"search-icon",onClick:T})),o.value?(qr(),hn("div",{key:1,class:"clear-icon",onClick:T},"\xD7")):Bs("",!0)])])])),fe("div",sJr,[(qr(!0),hn(Dp,null,Np(Xo(S),(W,z)=>(qr(),hn("div",{key:W.id,class:cl(["car-item",{fault:W.status==="fault",online:W.status==="online",offline:W.status==="offline"}]),onClick:V=>k(W)},[fe("div",uJr,[fe("div",hJr,mn(W.id)+" ("+mn(v(W))+")",1),fe("div",cJr,[fe("div",{class:cl(["status-btn",W.taskStatus])},mn(M(W.taskStatus)),3),fe("div",{class:cl(["online-status",W.status])},mn(A(W.status)),3)])]),fe("div",fJr,[fe("div",dJr,[fe("div",vJr,[pJr,fe("span",gJr,mn(W.speed),1)]),fe("div",yJr,[mJr,fe("span",_Jr,mn(W.distance),1)])]),fe("div",xJr,[fe("div",SJr,[wJr,fe("span",bJr,mn(W.progress)+"%",1)]),fe("div",EJr,[TJr,fe("span",CJr,mn(W.manager),1)])]),fe("div",AJr,[MJr,fe("span",IJr,mn(W.owner),1)])])],10,lJr))),128))]),fe("div",LJr,[(qr(!0),hn(Dp,null,Np(Xo(x),W=>(qr(),hn("div",{key:W,class:cl(["page-btn",{active:W===s.value}]),onClick:z=>w(W)},mn(W),11,PJr))),128))])])]))}},RJr=rf(OJr,[["__scopeId","data-v-aebeef26"]]),DJr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJKSURBVHgB7VPNThpRFL53ZtBCSjMubNLYpLhxW7auxDegO10oNNE1w0o3lk40ujIZ4gNAdW95A4aNiRtLH6CBrkhpGqZYZgZm7r39LpWGEjDttvFLhnv4zj3fnL8h5L+DODlJyGeWXyN/gfDwMK2GoR3MzSVYENyolL4G3bxX0N/bey8o1Uf/qcwGD2MsP+h01thg4CjxuA6xpnZ8/G7Wy2Uc6RpGGkYmblmvxp0dw0hoQpTcVqvIOF97vLREFEWpB0LUVMZyT87O8pOCSmdnJ8VcNxO6bmXSuWBZzdD3CZ2f1/vtdp15Xs3zvM/EdavM96dmSb9tbxc45wXY31GijkwFAA9AiIOz/ENVzeVy2ZEB7a2tLDjx9Px8umBrYyMhgqDEFSWvMHYjOTH8EWgpNZ9dXprkH6D5jkMUSlOwP7ARKzOEJnhbGoOjI0OjNINKLO3g4I/M5ArxIMgJRUmiorpG0KMQAhFK0zQScX7fDEPJf5Qm9zyCQbyEWfL291N4ofmo33f8aNQY3N6+GQoPO4QsGqmUHnheZuX6unhfKT3DKHAhCrK1gvMGxr0ABV12HD11FPQ5dnpapNOCv2azKXkulsv2ON/Z3S0hPkPu1k0OEMJFEouZ2AiHjByT+LK52cCRQHBT+P66j2lHo9G34HIyYDgwVbUhZi5eXNTGY6d+eujZOsqrorQXKKeBS07Y6/1aKZQHLv+8Upm+NmQGGum0TrrdKswkoXfXKLUwLHPZtp1ZcTMFR/i0uppDVklOSHHl6qpOHjCJnxWaE28UYzl7AAAAAElFTkSuQmCC",NJr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANMSURBVHgBlZTNbhtVFMfPueMJNBuGJ8jwBDW8QJIVIJDsIiGVUCkxK0RBjiuUquFjbBYEqJoYCQQLJDuq2rAA7EgIkFjEeYK2T9DJsl20TuvE47lzzumZiTpqPuq2V16M7z33dz7+51yEZyz585tFMBiASB8I1/H9r+rj7HEsbCPwwcXb+vX4Bzjp+vjOlzsvBJSNL2YAkhCMWwTEDgCLCOpKmTgLZBQYAX7wfXj0rjkG+325Cchb6qoEE04PSMFMykxAmHYiinfAsSUBc1s2LtbHRkjXP2+j4LyG0sS5H2qZg9ZFH16SavodjeIfT1WaYbZ/bSkQkLqG3HY+vFw5BqSrtToCBoy4UDh3ZR1OKkUn8NkmgYljiOzDxssTkzPA2AKUGp5bbeYpS2vRR+avhbn+NFi2hsOiGQ3DZDhcd61twd17XSBqCtGqtD72cyADBULJTszR02FZGslp4FGINAwgGq4zDKoqU0NruwvgVnMgstXQqXeq8ms4FijSo/1oVoE9TEavSBwVsdLsG6a2kJ1PTQrSWvDYkm9Quofu/hGUAZ1pddnPNxPadh7c6RAlHtjRLifcyAKn5JZB8OS381MFa13fEWoC8a1DwHi/auYuzz65x9eWOubT62eOBu64tsvWTCfx3qu5yvHPC0V3EkKstPvSOr+mAs1rW2yarMaQjYm20wwap42Vnxq5Y80wGUDR/azdy8onv5z1hZ0tEZjSSYBE+IKLhT4Ji16uq4mvY6LjDDcEYdNoHfGTq9sHQcwtGG0bPVMLDI0tvGHYYlUVnlJRUOVHhyGgaE+th02IBtrNgxBHeyFEe57sD+qQRHmqBZIgnSLWe9oBr3EhqhaA04TUN1DqJZ1Wz7HRfWJedJb/O9RG8bdvLzqWcpE4Fedx6mm6LB7K2lmfOU7T8TDdR2g4tb8a8ByLrrwXqH06gilu14749UwUWSnrvMK0boZ4obP9PDBZK3tY6/Zl9UxJ/3mwC5vY6PbxqBEnlD6mJS3NR+6lv3snwezKu6q2tLQTuu6lf2tPnh17D2XlLV8fq61UXQYJUaRrjAkPDtnXmpTTM73ZY4O1iaV/bo4F5uDv3iwRcVmrU1To6QPr9GGVnoPQxuX/TyzNI9WdzeQzAvSaAAAAAElFTkSuQmCC",kJr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAL+SURBVHgBrVQ9TBRBFH5vZg8Q/87GRC1YexPu1EiiMUKiibGQO2Ote4mFheawMKLNHYWFheGuMrEBCisLDoyFxGQhFhghARITOzl7o6sIy+3OvOfsHiBC4AL6Njuz8/O++d735i1CA+OZgg0gXfOZBNB9mO4rNfIRjTYAkwukBgGUw1r3+5MPbPgXUx96HZrunV8d66mH/TR1323kty1TwUEBdVhcG1t+HxC1h5M9nbsCDSfvFIlCwI6nQ6tzmC55DLUygi7ATkF58rYtWN2UrJxNDktWGShIhe9udcJOQEmHBa2CcTz7bGLjGnaVPGLdx0ADW4HixgnfdWxL6s+W3H8SWo8kN7uoqrlW1WDixjyRLrd0vSg1ZJrA5QLrcIiaD+SJgm6jblv9pahvZxXEDDUFOYHczjOPU/W7vAVT383YkuS8Fvp4U8sxV7Qk0lFy/uL5/q4rfZmNZODpR3lGWUIENktV086F2hTIeofgbbeLMuGh3Jcymh1k4JF6OALIPLGx6DQgSZbYZSUODwNyWzzNhqAQg/L0k5y1xnLsskM6sJsXfqTVAcrXQWTKkMhQxIQjMjgrEqIHQuoWiaMZ1r5tQLkesAE8U85FWGugSGFBIBQxO+7V3lw0GOyYow8SxjTiFgFtVeOibG6toAocFmYXMQohZuW557lVrBjUf33eMfUNTVcm4otOwc84aBaiHGVyJXDzG4CIcsqSR2xmv42V4Qng+Urn1su4wlQXmP6UI6mFOQRZas1+LMMGC8YupbT2ZzA6ieOpZBPCTOher1igcthV8azF0VMZ0GF1z9WptXLcm/1UgS1M672eJYMiKSNPlCQjDGuY07Vf5ZAXo/K9ZwmtPUKVWnh5orPOe1VmVf9WpreslbFpl6ugl4MR2XLsiwEdABSVcOlbWWKYN4JV4/zEmg6fKBitMkb25Mqdq8fGiHHO4+ybvRjlL+4HRdMhB1lWVO3rnElwxHC+hkvXDmWrHuzGFkdOF5dfdeThf9n34VTSH01f2G7PbyaydzoUZ98tAAAAAElFTkSuQmCC",FJr=n=>(kd("data-v-499c1eca"),n=n(),Fd(),n),BJr={class:"alarm-notification-container"},GJr={class:"detail-tabs"},zJr={class:"tab-header"},UJr={class:"tab-list"},VJr=FJr(()=>fe("i",{class:"close-icon"},"\xD7",-1)),$Jr=[VJr],WJr={class:"alarm-list"},HJr={key:0,src:DJr,class:"alarm-img",alt:"\u8F66\u8F86\u51B2\u7A81"},jJr={key:1,src:NJr,class:"alarm-img",alt:"\u8D8A\u754C\u544A\u8B66"},XJr={key:2,src:kJr,class:"alarm-img",alt:"\u8D85\u901F\u544A\u8B66"},YJr={key:3,class:"alarm-dot"},qJr={class:"alarm-content"},ZJr={class:"alarm-title"},KJr={class:"alarm-time"},JJr={key:0,class:"empty-data"},QJr={__name:"AlarmNotification",emits:["close"],setup(n,{expose:e,emit:t}){const r=un("all"),i=un(!0),a=un([]),o=ul(()=>r.value==="all"?a.value:a.value.filter(l=>l.type===r.value));function s(){i.value=!1,t("close")}return e({updateAlarmList(l){l&&Array.isArray(l)&&(a.value=l)},show(){i.value=!0},hide(){i.value=!1},toggle(){i.value=!i.value},isVisible(){return i.value}}),(l,u)=>lu((qr(),hn("div",BJr,[fe("div",GJr,[fe("div",zJr,[fe("div",UJr,[fe("div",{class:cl(["tab-item",{active:r.value==="all"}]),onClick:u[0]||(u[0]=h=>r.value="all")}," \u5168\u90E8 ",2),fe("div",{class:cl(["tab-item",{active:r.value==="car"}]),onClick:u[1]||(u[1]=h=>r.value="car")}," \u8F66\u8F86\u51B2\u7A81 ",2),fe("div",{class:cl(["tab-item",{active:r.value==="report"}]),onClick:u[2]||(u[2]=h=>r.value="report")}," \u8D8A\u754C\u544A\u8B66 ",2),fe("div",{class:cl(["tab-item",{active:r.value==="speed"}]),onClick:u[3]||(u[3]=h=>r.value="speed")}," \u8D85\u901F\u544A\u8B66 ",2)]),fe("div",{class:"tab-actions"},[fe("div",{class:"close-btn",onClick:s},$Jr)])])]),fe("div",WJr,[(qr(!0),hn(Dp,null,Np(Xo(o),(h,c)=>(qr(),hn("div",{class:"alarm-item",key:c},[fe("div",{class:cl(["alarm-icon1",h.level])},[h.type==="car"?(qr(),hn("img",HJr)):h.type==="report"?(qr(),hn("img",jJr)):h.type==="speed"?(qr(),hn("img",XJr)):(qr(),hn("i",YJr))],2),fe("div",qJr,[fe("div",ZJr,mn(h.carId)+" ("+mn(h.carType)+") "+mn(h.time)+" "+mn(h.description),1),fe("div",KJr,mn(h.date),1)])]))),128)),Xo(o).length===0?(qr(),hn("div",JJr," \u6682\u65E0\u544A\u8B66\u6570\u636E ")):Bs("",!0)])],512)),[[DPe,i.value]])}},eQr=rf(QJr,[["__scopeId","data-v-499c1eca"]]),tQr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAG7SURBVHgBvZRLTgJBEIb/aokxLszcQFj42Ck3gAsYETVxN5wAOAFwAzwBvTbKeAPgBrhDYDE3cFhCZNqq4eEwvBNjJZ1UT3V/XV31TwN/bLRtwZljXx/4uPYNPMWj86CbewPjjm0d+SgYQp6nViTs8vemAiqdjHa3Ai8dO2UMnBUgLIF9FLv3+n0t8PzVviUVwHY2GiMdLgOFMotzZg1249jDDOCNBki4Oe3JXM0CPlDaFcYH63GMUux6nJF1eBLUGgtAMkjtCutmda5/U2tJcyabUVgAijQi2XnTsRIm/uWbXeYkbic8WGcvAWMC5MKGYaAhkjLYddfBOLvSwp4YXc2BiiISiSHeedIuQ9MCZVFXN8GmWf42ZazQDgf9AzhyBYEOB0j2srq4CRYwpsC5bC7q9hdCYhY5mG+ke4+6vQ0mt/i804nJ5WYAQpWLXA5dweJo47yeKxBMkg/Ir4FJfZszfy6bY+AZkc4KlGEaG2CSnRqhsgRsZ7RHhAz2NPmfpdZLQDF+PZoMDTqL7eaNQano46CiqwIoy0V0twbscazM3U/072qtaHCnB1YZOuWmWIbMRy+j2/hP+wHqGsG1HQspqAAAAABJRU5ErkJggg==",Dw=n=>(kd("data-v-aaea1471"),n=n(),Fd(),n),rQr={key:0,class:"weather-station-container"},nQr={class:"weather-station-box"},iQr=Dw(()=>fe("div",{class:"weather-station-title"},[fe("span",null,"\u4FE1\u53F7\u706FXH001 | \u6C14\u8C61\u76D1\u6D4B"),fe("img",{class:"weather-station-status",src:tQr,alt:"\u6C14\u8C61\u76D1\u6D4B\u7AD9"})],-1)),aQr={class:"weather-station-content"},oQr={class:"weather-station-info-container"},sQr={class:"weather-station-info-row"},lQr={class:"weather-station-info-item"},uQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6E29\u5EA6:",-1)),hQr={class:"weather-info-value"},cQr={class:"weather-station-info-item"},fQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6E7F\u5EA6:",-1)),dQr={class:"weather-info-value"},vQr={class:"weather-station-info-row"},pQr={class:"weather-station-info-item"},gQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u98CE\u901F:",-1)),yQr={class:"weather-info-value"},mQr={class:"weather-station-info-item"},_Qr=Dw(()=>fe("span",{class:"weather-info-label"},"\u80FD\u89C1\u5EA6:",-1)),xQr={class:"weather-info-value"},SQr={class:"weather-station-info-row"},wQr={class:"weather-station-info-item"},bQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u98CE\u5411:",-1)),EQr={class:"weather-info-value"},TQr={class:"weather-station-info-item"},CQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6E7F\u6ED1\u7A0B\u5EA6:",-1)),AQr={class:"weather-info-value"},MQr={class:"weather-station-info-row"},IQr={class:"weather-station-info-item"},LQr=Dw(()=>fe("span",{class:"weather-info-label"},"\u6C14\u538B:",-1)),PQr={class:"weather-info-value"},OQr={__name:"WeatherStationPopup",props:{visible:{type:Boolean,default:!1},stationData:{type:Object,default:()=>({})},position:{type:Object,default:()=>({x:0,y:0})}},emits:["close"],setup(n,{emit:e}){const t=n;Rrt(o=>({"0f57bb8d":t.position.x+"px","7738e86c":t.position.y+"px"}));const r=un({temperature:"22.5",humidity:"68",windSpeed:"3.2",visibility:"8.5",pressure:"1013.2",windDirection:"\u5317\u98CE",wetness:"\u5E72\u71E5",updateTime:Date.now()});function i(){r.value={temperature:"22.5",humidity:"68",windSpeed:"3.2",visibility:"8.5",pressure:"1013.2",windDirection:"\u5317\u98CE",wetness:"\u5E72\u71E5",updateTime:Date.now()}}function a(){e("close")}return P0(()=>{const o=setInterval(()=>{i()},6e4);i_(()=>{clearInterval(o)})}),(o,s)=>n.visible?(qr(),hn("div",rQr,[fe("div",nQr,[fe("div",{class:"weather-station-header"},[iQr,fe("img",{class:"weather-station-close",src:hz,alt:"",onClick:a})]),fe("div",aQr,[fe("div",oQr,[fe("div",sQr,[fe("div",lQr,[uQr,fe("span",hQr,mn(r.value.temperature)+"\xB0C",1)]),fe("div",cQr,[fQr,fe("span",dQr,mn(r.value.humidity)+"%",1)])]),fe("div",vQr,[fe("div",pQr,[gQr,fe("span",yQr,mn(r.value.windSpeed)+"m/s",1)]),fe("div",mQr,[_Qr,fe("span",xQr,mn(r.value.visibility)+"km",1)])]),fe("div",SQr,[fe("div",wQr,[bQr,fe("span",EQr,mn(r.value.windDirection),1)]),fe("div",TQr,[CQr,fe("span",AQr,mn(r.value.wetness),1)])]),fe("div",MQr,[fe("div",IQr,[LQr,fe("span",PQr,mn(r.value.pressure)+"hPa",1)])])])])])])):Bs("",!0)}},RQr=rf(OQr,[["__scopeId","data-v-aaea1471"]]),DQr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABOCAYAAABSU1QqAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA8bSURBVHgBzVpLjxxXFT73VlU/ZjweTxJszeSBE9mJbCBK0hGsgkYIELCPlDV/IAhQRISQxYIFC34Ie1iTLUIjFhGbSKA4UTy2Y3s8Hk8/quqey3fuo+pWT0/3KO876unu6nurTn3nnO88bhF9Q8aNGzc0jUYFvflmlh5X9DWN3d3d/O5dGuQXyrXZROWqGMwOzcPJDlG1t7dXxXk5fYVjezRa2zQbF3VBF249zArqc8nHelIbPSmKxWu+VAGvXPl5P9t49KRl/YzOiktsTc7KTqlSE9ZmqphUbdj0Oa/G5X1Dd6DdnS9ZwMuv7F7okb2qtH5e2ckWqcyqTJdsqykpPWMMKmhMhh7XqjjmflZqolpTZnd2tmmP9r9YAUVtW3Zjp6zttVyrl5j4HEx7pqwtieRFMxybMJuDIsse6Vwds9UVaV0NSVuLCeYI/zaIbkG4ET7ufV4BXxztPpUxvULKfo8tbddk80xTzWQrTRqyMitlD1jRQ7L6ET7PKOtVpEzp/FLEhqanmGCGmvpy0gNod2sbHz4jgtdffeO6UfQaLjAiYzYNaWPJ1rhcrayq8PlYkT2EjT0odHZUM5eWVZVlDNMzFnOszQtFlSHqCa5EgyHReJLZYz22/S2P4P7cdU8V8NLLL68/oZ/cZc3XFanrOO2QLEMoBdmUsQzTJzq0Vh2S4gPoaorfSs2we0DWOVmWK6oNPKK2thcQdAMSUk3rvKZqEeXWAY12lqj42uu732XD38eFvgOhvg0ZLAEAq7TohPFvAhwe4/2IRH24LFmqIFwt63Xg1UxbBX1TBv8goyGsoAch5Txl3SA4pQnZocYa4eYDJ8PeaQi++OruW2zoLTkZlkAqFgOGLenH7nRWPcZPM6tUBVlhaxm0htm4trYZCWS4G5EKVs94y4CKoRgWFAyBIteVM2pixBivtVagFU7Csq7EJaEyxlI9hTo1GQvNKajUAiWNWYxLk/skC2B/isJnGSaH1EZMNJ638vNsoUp8zp1blF7FazPRh/PiRQhqmh+shB7uKsrG6SwB1d8COyHj/SRv4QvmmXjvQA1qrh26ucKwvV7hVNzrwRgnE79mo4vgEgHnvqr26sBOtTIwZd27IopHYLHyalRjlM2hW5irdUgGBynL0jofkXF05N/nosgCieaGba+vU1nwxQTJYagq/sqyQjw4F+TSE1Xtx154A4J97isFmvFHtiDf9ioVR2VZj1bATOvuCn3ivkB1EFk3RkjCKn6IJ0fvEDkDghoIIhxaOwS7io69E69ScTvgmsoLwl0bo3gbulmtdat+UW8mL22TVM4j6KiGgpD9gaOZZmyJhPsn5DghoMcbDCJEE1wiqjUVEU5tUydR3JKzgGeE0+PIvGCqIfAZTWdTGky61751i1YLqMIVlVYqfLcByGQR/qwOFwXY7BFvTyI2GN0kd44in6oq2qKLvjQVJxGuEC8WAHe2VwvojyJwBkSsY5g5KsmEjRBnAiLcsk6DWm5iJGmRzKFi4cGGZmQIScOJt7bESVaqOH6VC3N7pDG34K1GTA0MbgNqEkDwp5MSosafAXJ1cva6rhthS6wWL3ZBRHzkQCCEF+8tFZBbCMJPNqDSugo3pCJHrERY3T1T6iB5ZufqHu/Rg5mY0cy6aCA0uOV/HY2WCqhPVFEqoNIwXQhwDdlAv8zBYQIfGZhHprOFBVlPeBCxGNkgUWTqEEkW+MgSHtQLpopdhilZmJ2l87hLSJnDF5EkoOiwE4rpBScRmhnHQLK1KJCcYoNBEK3nf7ZOnXLUJQvaJS6C5ZwHi+Mq67i6FtIO9FIUTSQZ9MP8NQ/gVmTq5QK2gnhBA6YJMExJ5BU6Uj5zDcHPRqImgxQ0D4JFO6zaWDydhftJQt0ZBGydRFIobhyinakXLW8SCnIqNQlpO+EiD8q/Xrt6IGssQp2zwQMQ9RloJgRhMR7r8IhETR1Zmm/g6TWQ9TDNZsSLxUnqlGPEAmMkKb2KxU3WAg86Ba/OZuairuARuY3TBT5hdfKQHlprfwtqH8YERhBU83UJ8CskFjsnke+C35DGtHwszwep5cHuLaTzRBb1LMD+nQgbj9amnjtT4YQsQ+IgsRglDkWiliHp1goBY/QPRi1G1aHGNp606Z5HCmA/B9B+Dz8fyo+ZnefBygnZo7YJI5FknEB468yhLtKLpKI2iQTcOo1ppncixWXIewOhcN2Xnp4HWxl9HHZFE2xwhkgSY7Er3M+MoPhGdFAYV+rJ3MxiWmQSkPZ5rfiXPtwpRztp0loGoh6kNLPhkwXJB/f2NuwSAeOwahH3dVMGfSJytEKqH0Gwt9O6xKnYyei5UCzQ0Yxk1M6LD86WD8aENfluuxO5LZpOzcfdoh/jNn9Dc97sbdDDZ2GD6W/S3RqNjtQSAVOP8OioJof1OLpktdDeBnnBKdKh1E8x5x3K26LJBZIQi50NJuPWWVL+eOb5GZ2cwKRzF6s5GT9TnL/r9Vt4Cgw1iYy1FYtPERAhL6T8TcmpdRubabWK58YvVMa/Sg/0kI87mpmbeGrZqZv2hYw2rUpkbjNrG+xqlYrbsY81f+1cWElq1FWxJISnlp2cOIbPUiwnXxsvZi+/MkmGvWLchse8bbl2BuaTGV/ViSensS7LenZvYxnN2OSoDf4SKjq9cMHKcRtLfw0qbKzfZdTCg+RpZi0xQmNKNTpa5sXNT7bTh/EE7XFs+XBF18TSHejgHa3snXisLTvJRZJ5mjlDNtOED+vyZO1IZW6qbuuT02jeojum6V24WiOc5JdF3Axx/cEBzWYommJdLGM1UXNymH2gOEEzyRxeLBxu7w/M+q47YHwLztFMJ6NGZ2E47Kh40Vjco3Y2GIyPfWcwVh3haPgi1YjyZuDHp7CTP6qMPoVTyHdF0vWoXPgLbWAh0b47k2wGpBCdoWhqcGgoB3xjdTPT2578972ZDoT3YBl/UiJkKDtdTSLJQuFjsSvcYwMdCDaRBLFYH+Z2admpg2O0sViHfFC7So5D9RQpx4beDDt7pXvA58+Ydo9CeibNI5fyi4pD7los2JCLLMOb2NHYWULU3CSeyS/KC9ZNrEKMlmrOT5kApr9gxr1mStq8TIxIvNgBCCcZINQNmhYrnaU/mAZYZ1gOQb3QCNj3Zsh55xh2eL8pOyV7MaaVLUl4BcFY1Hmi9v23Y42cMFSdS3ozWfLVBk1Tt1EuxRCzTZfZhtBD88glqpLz516zIRe0lLecJ9lMSBZk+MJ9y4e6pb0ZG+tiq6INdiYCKqs9cv6gdxpmbl3b+H/5XAu4yKOKPVkPXNHksxlGgSAJ6wovNm3yR6GBGb9wmg+2A/7hk1kt+WFqIplrv2VJZyu23mLRNJ2X5GBl8yi1bOU3mmzIqHUnfvgZ0lm1LR01q8UGnZpz1x9s0n1BMenNuCG9o9g8Wtz5OCXUUWgS+ZpzLnjHOSz7ZFYEFRENUdObcc2nKHFTMIU4XLbnkkjimkcu1G0tbAHn7YUlyetUmG7vTSToqDXZHxEmdE7i3cL3ZuJwhbtq+tNuVH5LLI6pK9xD+bCqu8VJ29cJEDpcp+UtDiDX4fCuZJIfXHcr3nsWy07y7bcF4/gYNBPq4vl8MJ+XVwxPhd6K9DS88fsqVCeMjSgq7S+PmmXXo+6m4R5B6Q1mIQhYEbzXvaLY4Dq8eGM9GOF7781J1AxvRaHn0SSrOtQiem523IZwn53BmsgwHX/L87k+delfscsfsxlRsHtmYTQ6LWFNzqqTmiOgxnMLnDBSFzj8fEvTnQH7xZ0etfW7nX56bX3Z6bv81Bm+yz8/Ts1mpKZJN8Fa320ll7340Gl12vW1skQaQ00Ts6GatjUjQ4haYnHaPDp7j1pEjBdQNincT5vt0c9jCzjduyOxxrRw958ZKnZeHJtHRK7Duny30yZlJ3nbSqPF/NJWZBNTtZBqyfq2P5gHV/TJQmwiYb94EtKtkPJLVbd8t1O1RB1T/iaCpDVw0m0VZ3Hd/pjNBJrJs4Rm6sInC4mOJVXo91E0iYQBwUuXyrme4qLmEViL2G2RO17sAhdquuQgu8xaY78kZDNAT3qDvsNaN0Ttd9zbIbH4ZG/m5DhRNOEWhipTV+ElzyBfOB+pTzc8s2j/uN2aJR2a6K7DmjsEhWaadCsJddL6cOnMRgzFJ7244ZYLF3fu4vrrgHAd/LwG04My1Dqyhk15XAOhxcgTIVpoXBIZcSN3R1IFBbYh5/iMGIj+EhvUJM7d2chTShVnRU/cmyE727zgWs3kQSHOjzSP++sosz7lD+Sc+/t8QsCDOx8fP7j90T/v3775tycuPvchuLCEM1526YBSPWCwjuxlHSfsQbgpFFo5rwoCyhNJUWCWzog8E1Vjj0e7gC5zjMah0ijWeBU4Wa76poDEttS82dd8RFN+CefYXyRgOu7f+eiT+/s3/1XsPPn33OafIEtdh7qfcjt4ym14bAKoDThVjY0YVDuqCiWWZ0QRWhvBkkVY99wZftNZj42Zse7lXJel0Uj1xwA7LwXBQylU+YO9vZAY+aHojOPKq298C4Jcg1f/BOp/huShMviC4xOlHkFpd4HUI5zxsZY6LtdlhSw1y+TBM7xqU+ZFr7JlXXFPVzwrK5hghTup+kdZtbFxJATpXukjotlZBYT6xw9u37x5//aH/7j09NV/w5QKADoAZQ4kfYTw5xB7LoB0enAwCE0Tee7NqRg2iEux5ppLoKmznPuwQQmK9SQ3GbAe90tGsINauio+M4KnjWuv/PBqzep1bMtehsGdg2+4BxvhSmNU/A9hr6iZs0Nr6yoHkjN57/VbBMdA0IyremOr2qIBkNvvIPi5BUzHlZffeE3n2VXN9gWcujLWzMCPpWVzrAv1AJ5+bzpTk3yBius6ryZbB9XOZ1XxWcaDOx/t39//8D/nn37qffjvXdB3gaRjDdwPbXMO2l8rCtXLlK2k31DoYV1BzTk8mKeHfHG4DdU+/mJVvGpcv757rhrwswhPV1iKZUtT+PcU/jVBGfVYFdWjkvWE9bhEaD6B4JcuYDpeGI02e7T+XF2ZdQhHE1NPBjlNapuPh7Y+vtebzL7WB73/t7d3iLf35fOVKz84nw36m1VW9YeZVpXqa/r4v7Kb01nzlSJ42tjeHq2dPz/IHp2bmv094cK9ir6hQ9EcaP8H8vStdyyempgAAAAASUVORK5CYII=",NQr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABOCAYAAABSU1QqAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA8ZSURBVHgBzVpLjxxXFT733urHzLhtDwmxZhJCCHaiGIiSdARiERiEWLBjEym/AKQsAIGExAJFbFiyQWLB74A1WbBBaMQiYhMJlIfisR3b4/F4+lFV91y+cx9Vt3p6ukd5n1FPd1ffqvrqPL7zqCL6gsgbb7yhaTzu0auvmny7os9J9vb2itu3aVhcLjfnU1Wo3nB+ZO9Pd4mq/f39Kq0r6DOUnfF485IdPaZ7dPnGfdOjAZd8oqe11dNeb/k+nyrAq1d/PDCjB4841k9o07vCzhas3IwqNWVtZ4pJ1ZbtgItqUt61dAvW3f2UAT71wt7lPrlrSuuvKTfdJmWcMrpkV81I6TlDqEcTsvSwVr0THphSE9WajNvd3aF9OvhkAYrZtt1ot6zdc4VWzzLxBbj2XDlXEsmL5tg2ZbaHPWMe6EKdsNMVaV1tkHYOC+wx/o2IbgDcGB/3Py7AZ8Z7jxqmF0i5b7GjnZpcYTTVTK7SpIGVWSl3yIruk9MP8HlOpl+RsqWPS4ENS8+wwG5oGshBD2Hd7R18+IgavP7iK9etopdwgjFZe8mSto5cjdPVyqkKn08UuSP42L2eNsc1c+lYVcYwXM86rHGu6CmqLFFf9Eo03CCaTI070RM32A4aPFg475kArzz//NaX9CN7rPm6InUdh90gxwClgE1Zx3B9oiPn1BEpPoStZvit1Ay/h8o6BzOFotoiImrn+lGDXoCQatriTVULlBuHNN5dYeLnXt77Jlv+Nk70DYD6KjA4ggKc0mITxr8p9PAQ78ck5sNpyVEFcLXsryOvGu0U7E0G8UFWA6xoDyDlOGXdaHBGU3IbGvsINx96DPtnafCZF/deY0uvycGwC1CxODB8ST/0h3PqIX6aO6UqYIWvGVgNq3Fu7QyJynA1ggpez3gz0IqllBYUHIES15VzanLEBK/NFtCaIGHZr8QpYTLGrnoGc2qyDpZTMKmDljRWMU5N/pPsAP9TFD+L2AKorbhoOm4V1rmeKvG58GFRBhNvzsUePoqXaVDTorASerityEzyVaLUcAnsQabryd7iF6yz6dqhNZi59totFMT1+z1v4n4fzjidhn1GXQ2uALjwVbVnh+5Ui4HJdK+KKG2Bx8qrMY1VroBt4a7OazIGSFmWzseIyPFxeF/IIksQLYhrz69zLPhiI3I4qkq/suwhEVyI5vIDVe3HfnyDBgc8UAo0E7ZsA9/OOhMnY7mgragzrbt76FPXBaoDZN04IQmrBJFITtEhOKMGNTSIdOjcBthVbByCeJ2JW0FoqgCEuz5G6TJ0s7fWrfnFvEZe2mWlXNCgpxqKIAdDTzONbAvCg1M4TgEM+gaDCNHEkEhmzSEiqF0eJIpbchblWeH0JCYAUw2Bz2k2n9Fw2j33jRu0HqCKZ1RaqfjdRUVmO+HP6XhSKJuDxtuDiA+mMCl8oMinqkq+6LMvzSRIhCskikWBuzvrAYatSJxRI84zzAKVGGEj5JmoEW5Zp9FaYVMmaTVZwMTCgw3NiAhJI4i3tyVI1po4fZUTc7ulcbcYrVZcDQzuotYkgeBPZy1EjT8LzdXZ0eu6bsCW2Fui2CcRiZFDUSGieH8lQG5VEH9yUSttqHBDKrLFSYbV3SPlAVIYt9D3hIgezsWN5s5nA6HB7fDreLwSoD7VRamolYbpYoJryAb2ZY4BE/nIwj2MNksbsr7wIHIxqkGixNQxkyyJkRU8qJcsFb+MS0xcbfJ13CUk4/WLTBK16HUnFNOPQSI0M0mJZHtZIjnDByMQrRd/dt6cstUXC9oXLqLLhQiWwFXOc3UtpB3ppddrMslwENdvBgVuJ6ZeDbAFEoBGnWaKYcoyr9CRCpVrTH4uETVZlKBFBJb8sGpz8WwerydLdecA2AaJlFDcBES7Ui/bvSkoyJvUZqTtwSUelH/9du+h7OOQ6rwPHoKoz0EzMQmL8zivj0TU1MHSXpCLUZxVMxLFEiR1zjHigQ5QLF5lMLGEyWbkQW/g9dXMQtYVfSRu43yHULD6JSoqXTcQfRSrxb7EVSNj9F+cc6OgRdHfBk1otayuB6nlwe4ltOt8ucV06tpq26oPUC9oY/6Mlc9YCsAlF6PFoUTUIlJurQGYsn90anGqDjW2+aTpNRS5QNm2XWbE9SIPOnMBUfMnHOVa+Kklbskkk0yFN86d6hK9SCnqskzAbdDYuNxrUOeQw49CM8hm0A3/Edd5tQVfhKYJPjhHJkm52Dfu59agnDYFKOqGPJJba2Y1GAcNqlRRU0h3yM6/xsev52ewUjyAqIc5zYxCsSD14P7+yK0AmMSpZdzXLRl0mzmgQdGoC61bqNgc/RLfv7v08GWIYE8zUlH7KD48Xz2YCtbsu+su5LZpShv992hi41H+HK8f0hLBOuW7djk2fDD/TaZb4/GxWgEwj4igHdXUsEGPvljtBY2FJdqnRBuDBGXY69jjB3SGWMl9MRd7H8zkxnlK/iBKLa7o1AQ2X8uhmhFwSv0Mmvs+rZPYk4hsrll6BkBkiFjyNy2n1m1upgUTa98h/AQ7vEJrxMRhRh/1uKeZhd/PbDt1M74QacuqDHNbWbvoo8nEUiM6/Q98+ZDWSFK+1ONqwcRSEJ7ZdnIWGKFKcZx9baKYA35lswpbBBq9A6//gzsHyNTVSSTnuc6YvtsfraIZl211MV5iR6eX7hAhNpeiPoR2f48a4zadITL88jxIgWY2Mye0tlTj41VR3PzkOnOYQNBBjy0fZrvqhrqlHfwQe/9uFUgvg9M0c45qpkkfLtGHPqU73fYnnb3j6ENSHGtMx+i3OMgtWiZ+Pjik+RxNU+qLRdYTNWebOZjuFM1ka7h7mLwvZmcAzv0GkG9S9zq8+MnCxkbHxMtEn701Oh93e6G4NX7BnFXHlKezvti3DLWMCm+hHfgVtrYMHH1QeFBuBuSnPUfTlKSlHCcE0gEdTBxmM20uFmn4O7ad0pNogATAX1CcDNm0CBpsMglysT4q3Mq2U8fAaHOxjvWgVrqpC7ihHBdnM2nQHqYLRKlYkOGRL/nRj+BmxQGQvo4fD8wCgMQyfAl3NHZXEHXiQZX/ogIwptM+6Lu5CLTTdorkKOIMyVXuQDH/1DI/kCAZwsTDZsRK55kP5gkWaY6Dy+ulTsARWDR13nZKPRjt6LFlBa8q+jcK8rcxIlGH+duJRk0Yu84VsxmTfXXR0tQdlEsz5AuDhZ7EHykGiQ8Q4ytn35X4lrPyQ/RmpxgkSULjvh1S3crZjEt9sVPJBzsLURE4HTQXNoagYeY2tG34VyyMgHtFmA+Wcdo69E1TqGZ4yyopWNdEsW2LP4oDzPSF83qwFfB5KGazejCi8uM3k0220uitH6dbs0Ukh2uHR7lnq3CjycWKWnfyR1ghk1XX0lGzt/igN3Ph54PJxF6L2WzGi8yO0vBo+eTjjFRHcUgUes6F5N3U+XKfzIW2M1g2zWb88Ckhbqb8cfxbtseSTOKHRz7VbS8dARftiaXI63SY/t6bIOiYNbs/IuTigySERWiakvjGXTXzaS9VuCWWZOYb99g+rJtucTb29QDihGuhbmnEK8hPOEIo2ewHP91K1y4aTL54xpMTJyegmdgXL9aDxSJecTwVZytycy04f+hCdd4KKz/+iq1m6Oq6ZXjQoMwGTUwCToD3u2cUH9xCFI+2ohO++eYCokaCF8V5RVOs6tiL6IXV6TaE/+wd1iaG6cRbUSzMqcvwSlP+VM2Igf0zC+PxWQVrdlSd9RxRa7ywgwcjfUEzm4mdMUrmzozahbudYXntn7IQLcqUnzoSpvyLcmY1Iz1NfhOsjd0WudyLj5NWb93QK0umsdQMMRuqCTGSLCxELbk4Hx6df0YtENMJlMsa97NWB+0XaQSsu8VDnd3tTJmEYWIfxWl4ROQnrKvvdrqs7aTgW3m2WNy1hWxTqRZLLdm/nQ8WMRSFqFMm8feLp7HciiW/dHWr73aqlqhTyd9kEM6WZ9NWCRY/7U/VTKSZwmQ0U/dCsZDZWEqFwQBNkyCMGrxypVS0EmCAZoj9LXLPi13FxZ4u28i+spbSP1Yz0J7MBsOEtW6IOtxxb0Vy8enZzGk51TThEjaUUdcQJU+gXriYqE9nfcrpoUN7a5Z0HKL7CWvhNSg005RbWaqT0YcvZ0YpFZ+O4oZbLj+2exvn34IKt8DPm3A9GENtoWq4JI9rILXIhLLUQuN+/Of8OwmXU2Qb8oHPyIGYL7FFT+LDna08pVSx6fUlvNHwQe1Fj2s1lweFuDjWPBlscU0f8ttyzIMDPgXw8Nb7J/duvvfPuzff/euXHnvyHXBhiWB8ypcDSvWhgy1UL1s4YB/gZjBo5aMqApQnkhJglsmIPBNV4x6P9gld1liNTaVF14xXDwcr1MD2gNiVmi8NNB/TjJ/FMQ6WAczl7q33Prh78O6/eruP/K1wxQeoUrdg7kf9HTwlYaguQVEjBFWNGzHodlQVW6zAiAJaW9ElC1j/3Bl+06bP1s5Z9wuuy9JqlPoTKLsoRYNH0CDx2/v7sTAKouiccvXFV74MIM8hqn8E8z9B8lAZYsHziVIPYLTb0NQDHPGhlkelCl1WqFKNkQfP8KptWfT6lSvrivu64nlZwQUrXEk1ODbVaHQsBOlf+SOi5rwAYf7JvZvvvnv35jt/v/L4tX/DlXpQ6BCUOZTyEeAvIPdcBun0EWAATVN57s2bGD6IU7HmmktoU5uCB/BBSYr1tLAGup4MSkay49GCic+twbPkuRe+d61m9TJuyz4Fh7uA2PAPNiKUJuj478Nf7yAzH6E5rgpoci7v/UGrwQk0aCdVPdqutmkIzR10NPixAeZy9flXXtKFuYZpwtM4dGWdnYMfS8f2RPfUPUT6ndlcTYslJq7roppuH1a7H9XE55F7t947uHvwzn8uPv7oW4jf26DvHoqOTXA/rM0FaH+z11N9o1wFYqx7eqOuYOYCEcyzI35sYwemffjJmnidXL++d6Ea8leQnq6yNMuOZojvGeJrijbqoepVD0rWU9aTEqn5lAY/dYC5PD0eX+rT1pN1ZbcAjqa2ng4LmtaumGy4+uROfzr/XB/0/t/+/hHe3pLPV69+56IZDi5VphpsGK0qNdD0/n/lbk5nn89Ug2fJzs548+LFoXlwYWYP9oUL9yv6goqiBaX9H5WkspUGs1/AAAAAAElFTkSuQmCC",kQr="/airport/assets/red.892fd06c.svg",FQr="/airport/assets/yellow.ada6d5da.svg",BQr="/airport/assets/green.08121006.svg";const $m=n=>(kd("data-v-2b86b8c7"),n=n(),Fd(),n),GQr={class:"platform-overview platform-no-padding"},zQr={class:"alarm-stats-card"},UQr={class:"stats-header"},VQr=$m(()=>fe("span",{class:"stats-title"},"\u544A\u8B66\u7EDF\u8BA1",-1)),$Qr={class:"stats-time"},WQr={class:"stats-content"},HQr=$m(()=>fe("img",{src:Urt,class:"stats-icon"},null,-1)),jQr={class:"stats-text"},XQr={class:"stats-count"},YQr=$m(()=>fe("span",{class:"stats-label"},"\u51B2\u7A81\u9884\u8B66",-1)),qQr={key:0,class:"new-badge"},ZQr=$m(()=>fe("img",{src:Vrt,class:"stats-icon"},null,-1)),KQr={class:"stats-text"},JQr={class:"stats-count"},QQr=$m(()=>fe("span",{class:"stats-label"},"\u51B2\u7A81\u544A\u8B66",-1)),een={key:0,class:"new-badge"},ten=$m(()=>fe("img",{src:$rt,class:"stats-icon"},null,-1)),ren={class:"stats-text"},nen={class:"stats-count"},ien=$m(()=>fe("span",{class:"stats-label"},"\u8D8A\u754C\u544A\u8B66",-1)),aen={key:0,class:"new-badge"},oen=$m(()=>fe("img",{src:Wrt,class:"stats-icon"},null,-1)),sen={class:"stats-text"},len={class:"stats-count"},uen=$m(()=>fe("span",{class:"stats-label"},"\u8D85\u901F\u544A\u8B66",-1)),hen={key:0,class:"new-badge"},cen=$m(()=>fe("i",{class:"alarm-icon"},null,-1)),fen={key:0,class:"alarm-badge"},den=["src","alt"],ven={__name:"index",setup(n){const e=un(!1),t=un(!1),r=un(null),i=un(null),a=un(null),o=un([]),s=un(null),l=un(null),u=un([]),h=un(null),c=un(!1),f=un(null),d=un({x:0,y:0}),v=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="car"&&ie.level==="medium").length}),p=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="car"&&ie.level==="high").length}),g=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="report").length}),m=ul(()=>{var Q;return(((Q=i.value)==null?void 0:Q.alarmList)||[]).filter(ie=>ie.type==="speed").length}),y=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="car"&&oe.level==="medium"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),_=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="car"&&oe.level==="high"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),x=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="report"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),S=ul(()=>{var ie;return(((ie=i.value)==null?void 0:ie.alarmList)||[]).filter(oe=>oe.type==="speed"&&Date.now()-new Date(oe.date).getTime()<1e4).length>0}),w=un(""),b=un(null);Af(()=>{var j;return(j=i.value)==null?void 0:j.alarmList},j=>{j&&b.value&&b.value.updateAlarmList(j)},{deep:!0});function E(){const j=new Date;w.value=j.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}const T=ul(()=>v.value+p.value+g.value+m.value),C=ul(()=>{var j;return((j=i.value)==null?void 0:j.vehicleCategories)||{}});function A(j,Q){i.value&&i.value.setCategoryVisibility&&i.value.setCategoryVisibility(j,Q)}function M(){i.value&&i.value.drawTestRoute&&i.value.drawTestRoute()}function I(){t.value=!1,console.log("\u544A\u8B66\u9762\u677F\u5DF2\u5173\u95ED")}function R(){c.value=!1,f.value=null,console.log("\u6C14\u8C61\u76D1\u6D4B\u7AD9\u5F39\u7A97\u5DF2\u5173\u95ED")}function k(j){const Q=a.value.forEachFeatureAtPixel(j.pixel,function(ie){return ie});if(Q){const ie=Q.getProperties();if(ie.type==="trafficLight"){f.value=ie;const oe=j.pixel[0],se=j.pixel[1],Ce=a.value.getTargetElement().getBoundingClientRect();d.value={x:Ce.left+oe+20,y:Ce.top+se-50},c.value=!0,console.log("\u70B9\u51FB\u4E86\u7EA2\u7EFF\u706F:",ie,"\u5F39\u7A97\u4F4D\u7F6E:",d.value)}}}function D(){e.value=!e.value}function G(){t.value=!t.value,t.value&&b.value&&i.value&&b.value.updateAlarmList(i.value.alarmList)}async function W(){console.log("\u{1F50D} \u5F00\u59CB\u83B7\u53D6\u8DEF\u53E3\u6570\u636E...");try{const j=await Brt();console.log("\u{1F4E1} API\u54CD\u5E94\u539F\u59CB\u6570\u636E:",j),console.log("\u{1F4CA} \u54CD\u5E94\u6570\u636E\u7C7B\u578B:",typeof j,"\u662F\u5426\u4E3A\u6570\u7EC4:",Array.isArray(j)),j&&Array.isArray(j)?(console.log("\u2705 \u54CD\u5E94\u6570\u636E\u6709\u6548\uFF0C\u8DEF\u53E3\u6570\u91CF:",j.length),o.value=j.map(Q=>{const ie={intersectionId:Q.intersectionId,intersectionName:Q.intersectionName,longitude:Q.longitude,latitude:Q.latitude,areaCode:Q.areaCode||"",description:Q.description||"",status:Q.isActive?"1":"0",createTime:Q.createdTime};return console.log("\u{1F5FA}\uFE0F \u6620\u5C04\u8DEF\u53E3\u6570\u636E:",ie),ie}),console.log("\u2705 \u83B7\u53D6\u8DEF\u53E3\u6570\u636E\u6210\u529F\uFF0C\u603B\u6570:",o.value.length),console.log("\u{1F4CD} \u5904\u7406\u540E\u7684\u8DEF\u53E3\u6570\u636E:",o.value)):(console.warn("\u26A0\uFE0F API\u54CD\u5E94\u6570\u636E\u65E0\u6548\u6216\u4E0D\u662F\u6570\u7EC4"),o.value=[])}catch(j){console.error("\u274C \u83B7\u53D6\u8DEF\u53E3\u5217\u8868\u5931\u8D25:",j),console.error("\u274C \u9519\u8BEF\u8BE6\u60C5:",j.message,j.stack),o.value=[]}}function z(j="unknown",Q="ns"){let ie=zrt;j==="red"?ie=kQr:j==="yellow"?ie=FQr:j==="green"&&(ie=BQr);const oe=Q==="ew"?Math.PI/2:0;return new T1({image:new Art({src:ie,scale:.2,anchor:[.5,.5],opacity:1,rotation:oe})})}const V=un({});function q(j){var ie;if(!j)return;let Q="unknown";if(j.status)Q=j.status;else if(j.ns_status||j.ew_status)Q=j.ns_status||j.ew_status||"unknown";else{const oe=j.serviceData?j.serviceData:j,se=Array.isArray(oe&&oe.phases)?oe.phases:[];if(se.length>0){const me=se.map(Ce=>Number(Ce.phaseColor));me.includes(3)?Q="red":me.includes(4)||me.includes(2)?Q="yellow":me.includes(1)&&(Q="green")}else{const me=Number((ie=oe&&oe.trafficLightsStatus)!=null?ie:j.trafficLightsStatus);me===3?Q="red":me===4||me===2?Q="yellow":me===1&&(Q="green")}}V.value.globalStatus=Q,V.value.timestamp=Date.now(),Y()}function Y(){if(!h.value||!h.value.getSource())return;const j=h.value.getSource(),Q=j.getFeatures(),ie=V.value.globalStatus||"unknown";Q.forEach(oe=>{oe.getProperties().type==="trafficLight"&&oe.setStyle(z(ie,"ns"))}),j.changed()}window.updateTrafficLightStatus=q;function le(){if(console.log("\u{1F6A6} \u5F00\u59CB\u6E32\u67D3\u7EA2\u7EFF\u706F\u5230\u5730\u56FE..."),console.log("\u{1F5FA}\uFE0F \u5730\u56FE\u5B9E\u4F8B\u72B6\u6001:",a.value?"\u5DF2\u521D\u59CB\u5316":"\u672A\u521D\u59CB\u5316"),console.log("\u{1F4CD} \u7EA2\u7EFF\u706F\u6570\u636E\u6570\u91CF:",u.value.length),!a.value){console.warn("\u26A0\uFE0F \u5730\u56FE\u5B9E\u4F8B\u672A\u521D\u59CB\u5316\uFF0C\u65E0\u6CD5\u6E32\u67D3\u7EA2\u7EFF\u706F");return}h.value&&(console.log("\u{1F5D1}\uFE0F \u79FB\u9664\u73B0\u6709\u7EA2\u7EFF\u706F\u56FE\u5C42"),a.value.removeLayer(h.value));const j=new Hx;let Q=0,ie=0;if([{id:"fixed-1",longitude:120.09986800557976,latitude:36.35086289387643,intersectionName:"\u56FA\u5B9A\u5750\u6807\u70B91",status:"green"},{id:"fixed-2",longitude:120.09437418546923,latitude:36.34969069796734,intersectionName:"\u56FA\u5B9A\u5750\u6807\u70B92",status:"red"},{id:"fixed-3",longitude:120.0857115242345,latitude:36.346946273836345,intersectionName:"\u56FA\u5B9A\u5750\u6807\u70B93",status:"yellow"}].forEach((se,me)=>{console.log(`\u{1F50D} \u5904\u7406\u56FA\u5B9A\u5750\u6807\u70B9${me+1}:`,se);const Ce=parseFloat(se.longitude),Le=parseFloat(se.latitude);console.log(`\u{1F4CD} \u56FA\u5B9A\u5750\u6807\u70B9 "${se.intersectionName}" \u4F4D\u7F6E: [${Ce}, ${Le}]`);const re=lA([Ce,Le],"EPSG:4326",a.value.getView().getProjection());console.log("\u{1F504} \u8F6C\u6362\u540E\u7684\u5730\u56FE\u5750\u6807:",re);const yt=new Qb(re),je=new E1({geometry:yt,...se,type:"trafficLight",deviceName:se.intersectionName+" (\u5357\u5317\u65B9\u5411)",intersectionId:se.id,deviceId:se.id+"-ns"});je.setStyle(z(se.status,"ns")),j.addFeature(je),Q++,console.log(`\u2705 \u56FA\u5B9A\u5750\u6807\u70B9 "${se.intersectionName}" \u5DF2\u6DFB\u52A0\u5230\u5730\u56FE`);const st=Ce+8e-4,Nt=Le-5e-4,Zt=lA([st,Nt],"EPSG:4326",a.value.getView().getProjection()),qe=new Qb(Zt);new E1({geometry:qe,...se,id:se.id+"-ew",longitude:st,latitude:Nt,type:"trafficLight",deviceName:se.intersectionName+" (\u4E1C\u897F\u65B9\u5411)",intersectionId:se.id,deviceId:se.id+"-ew"})}),u.value.forEach((se,me)=>{if(console.log(`\u{1F50D} \u5904\u7406\u7B2C${me+1}\u4E2A\u7EA2\u7EFF\u706F:`,se),se.longitude&&se.latitude){const Ce=parseFloat(se.longitude),Le=parseFloat(se.latitude);if(console.log(`\u{1F4CD} \u7EA2\u7EFF\u706F "${se.deviceName}" \u4F4D\u7F6E: [${Ce}, ${Le}] (\u8DEF\u53E3: ${se.intersectionName})`),isNaN(Ce)||isNaN(Le)){console.warn(`\u26A0\uFE0F \u7EA2\u7EFF\u706F "${se.deviceName}" \u5750\u6807\u65E0\u6548: [${se.longitude}, ${se.latitude}]`),ie++;return}const re=lA([Ce,Le],"EPSG:4326",a.value.getView().getProjection());console.log("\u{1F504} \u8F6C\u6362\u540E\u7684\u5730\u56FE\u5750\u6807:",re);const yt=new Qb(re),je=new E1({geometry:yt,...se,type:"trafficLight",deviceName:se.deviceName+" (\u5357\u5317\u65B9\u5411)",deviceId:se.deviceId+"-ns"});je.setStyle(z(se.status||"unknown","ns")),j.addFeature(je),Q++,console.log(`\u2705 \u7EA2\u7EFF\u706F "${se.deviceName}" \u5DF2\u6DFB\u52A0\u5230\u5730\u56FE`);const st=Ce+1e-4,Nt=lA([st,Le],"EPSG:4326",a.value.getView().getProjection()),Zt=new Qb(Nt),qe=new E1({geometry:Zt,...se,id:se.id+"-ew",longitude:st,latitude:Le,type:"trafficLight",deviceName:(se.deviceName||se.intersectionName)+" (\u4E1C\u897F\u65B9\u5411)",deviceId:se.deviceId+"-ew"});qe.setStyle(z(se.status||"unknown","ew")),j.addFeature(qe),Q++,console.log(`\u2705 \u7EA2\u7EFF\u706F "${se.deviceName}" \u7684\u914D\u5BF9\u7EA2\u7EFF\u706F\u5DF2\u6DFB\u52A0\u5230\u5730\u56FE`)}else console.warn(`\u26A0\uFE0F \u7EA2\u7EFF\u706F "${se.deviceName}" \u7F3A\u5C11\u7ECF\u7EAC\u5EA6\u4FE1\u606F (\u672A\u5339\u914D\u5230\u8DEF\u53E3):`,{intersectionId:se.intersectionId,longitude:se.longitude,latitude:se.latitude}),ie++}),console.log(`\u{1F4CA} \u7EA2\u7EFF\u706F\u5904\u7406\u7EDF\u8BA1: \u6709\u6548=${Q}, \u65E0\u6548=${ie}`),Q===0){console.warn("\u26A0\uFE0F \u6CA1\u6709\u6709\u6548\u7684\u7EA2\u7EFF\u706F\u5750\u6807\u53EF\u4EE5\u6E32\u67D3");return}h.value=new sp({source:j,zIndex:2001}),console.log("\u{1F6A6} \u521B\u5EFA\u7EA2\u7EFF\u706F\u56FE\u5C42:",h.value),console.log("\u{1F4CD} \u56FE\u5C42\u7279\u5F81\u6570\u91CF:",j.getFeatures().length),a.value.addLayer(h.value),console.log("\u2705 \u7EA2\u7EFF\u706F\u56FE\u5C42\u5DF2\u6DFB\u52A0\u5230\u5730\u56FE"),Y(),setTimeout(()=>{h.value.setZIndex(2001),console.log("\u{1F5FA}\uFE0F \u8BBE\u7F6E\u7EA2\u7EFF\u706F\u56FE\u5C42zIndex\u4E3A2001")},100)}return Drt(()=>{console.log("\u5E73\u53F0\u6982\u89C8\u7EC4\u4EF6\u88AB\u6FC0\u6D3B"),setTimeout(()=>{if(i.value){const j=i.value.wsConnected;console.log("WebSocket\u8FDE\u63A5\u72B6\u6001:",j),j||(console.log("WebSocket\u672A\u8FDE\u63A5\uFF0C\u5C1D\u8BD5\u91CD\u65B0\u8FDE\u63A5"),i.value.reconnectWebSocket())}},1e3)}),P0(()=>{var Q;(Q=document.querySelector(".app-main"))==null||Q.classList.add("platform-no-padding"),E();const j=setInterval(E,1e3);r.value&&setTimeout(async()=>{a.value=r.value.map,console.log("\u5730\u56FE\u5B9E\u4F8B\u5DF2\u83B7\u53D6:",a.value),await W(),le(),a.value.on("click",k)},1e3),i_(()=>{clearInterval(j),l.value&&Rde(l.value)}),window.updateTrafficLightStatus=q}),i_(()=>{var j;(j=document.querySelector(".app-main"))==null||j.classList.remove("platform-no-padding"),a.value&&s.value&&a.value.removeLayer(s.value),l.value&&Rde(l.value)}),Af(()=>{var j;return(j=r.value)==null?void 0:j.map},j=>{j&&(a.value=j,console.log("\u5730\u56FE\u5B9E\u4F8B\u5DF2\u66F4\u65B0:",a.value),W())}),(j,Q)=>(qr(),hn("div",GQr,[Mf(XZr,{ref_key:"mapRef",ref:r,vehicleMovementControl:i.value,vehicleCategories:Xo(C),onSetCategoryVisibility:A,onDrawTestRoute:M},null,8,["vehicleMovementControl","vehicleCategories"]),Mf(fKr),fe("div",zQr,[fe("div",UQr,[VQr,fe("span",$Qr,mn(w.value),1)]),fe("div",WQr,[fe("div",{class:cl(["stats-item",{"has-new":Xo(y)}])},[HQr,fe("div",jQr,[fe("span",XQr,mn(Xo(v)),1),YQr]),Xo(y)?(qr(),hn("span",qQr)):Bs("",!0)],2),fe("div",{class:cl(["stats-item",{"has-new":Xo(_)}])},[ZQr,fe("div",KQr,[fe("span",JQr,mn(Xo(p)),1),QQr]),Xo(_)?(qr(),hn("span",een)):Bs("",!0)],2),fe("div",{class:cl(["stats-item",{"has-new":Xo(x)}])},[ten,fe("div",ren,[fe("span",nen,mn(Xo(g)),1),ien]),Xo(x)?(qr(),hn("span",aen)):Bs("",!0)],2),fe("div",{class:cl(["stats-item",{"has-new":Xo(S)}])},[oen,fe("div",sen,[fe("span",len,mn(Xo(m)),1),uen]),Xo(S)?(qr(),hn("span",hen)):Bs("",!0)],2)])]),t.value?(qr(),uA(eQr,{key:0,ref_key:"alarmNotificationRef",ref:b,onClose:I},null,512)):Bs("",!0),fe("div",{class:"alarm-btn",onClick:G},[cen,Xo(T)>0?(qr(),hn("span",fen,mn(Xo(T)),1)):Bs("",!0)]),fe("img",{class:cl(["eventlist-toggle-btn",{"btn-opened":e.value}]),src:e.value?Xo(DQr):Xo(NQr),alt:e.value?"\u6536\u8D77\u8F66\u8F86\u5217\u8868":"\u5C55\u5F00\u8F66\u8F86\u5217\u8868",onClick:D},null,10,den),e.value?(qr(),uA(RJr,{key:1})):Bs("",!0),a.value?(qr(),uA(Crt,{key:2,map:a.value,ref_key:"vehicleMovementRef",ref:i},null,8,["map"])):Bs("",!0),c.value?(qr(),uA(RQr,{key:3,visible:c.value,"station-data":f.value,position:d.value,onClose:R},null,8,["visible","station-data","position"])):Bs("",!0)]))}},$en=rf(ven,[["__scopeId","data-v-2b86b8c7"]]);export{$en as default};